wireless: remove obsolete chan no/center freq conversion functions
[carl9170fw.git] / include / linux / ieee80211.h
index 51afccda3e62a28acbc8e238b8085dcf86768fd0..213467ba72ffbbcb879ff3f1a48a23079eed864f 100644 (file)
@@ -44,6 +44,7 @@
 #define IEEE80211_FCTL_MOREDATA                0x2000
 #define IEEE80211_FCTL_PROTECTED       0x4000
 #define IEEE80211_FCTL_ORDER           0x8000
+#define IEEE80211_FCTL_CTL_EXT         0x0f00
 
 #define IEEE80211_SCTL_FRAG            0x000F
 #define IEEE80211_SCTL_SEQ             0xFFF0
@@ -51,6 +52,7 @@
 #define IEEE80211_FTYPE_MGMT           0x0000
 #define IEEE80211_FTYPE_CTL            0x0004
 #define IEEE80211_FTYPE_DATA           0x0008
+#define IEEE80211_FTYPE_EXT            0x000c
 
 /* management */
 #define IEEE80211_STYPE_ASSOC_REQ      0x0000
@@ -67,6 +69,7 @@
 #define IEEE80211_STYPE_ACTION         0x00D0
 
 /* control */
+#define IEEE80211_STYPE_CTL_EXT                0x0060
 #define IEEE80211_STYPE_BACK_REQ       0x0080
 #define IEEE80211_STYPE_BACK           0x0090
 #define IEEE80211_STYPE_PSPOLL         0x00A0
 #define IEEE80211_STYPE_QOS_CFPOLL             0x00E0
 #define IEEE80211_STYPE_QOS_CFACKPOLL          0x00F0
 
+/* extension, added by 802.11ad */
+#define IEEE80211_STYPE_DMG_BEACON             0x0000
+
+/* control extension - for IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTL_EXT */
+#define IEEE80211_CTL_EXT_POLL         0x2000
+#define IEEE80211_CTL_EXT_SPR          0x3000
+#define IEEE80211_CTL_EXT_GRANT        0x4000
+#define IEEE80211_CTL_EXT_DMG_CTS      0x5000
+#define IEEE80211_CTL_EXT_DMG_DTS      0x6000
+#define IEEE80211_CTL_EXT_SSW          0x8000
+#define IEEE80211_CTL_EXT_SSW_FBACK    0x9000
+#define IEEE80211_CTL_EXT_SSW_ACK      0xa000
 
 /* miscellaneous IEEE 802.11 constants */
 #define IEEE80211_MAX_FRAG_THRESHOLD   2352
@@ -1221,6 +1236,21 @@ struct ieee80211_vht_mcs_info {
 #define WLAN_CAPABILITY_QOS            (1<<9)
 #define WLAN_CAPABILITY_SHORT_SLOT_TIME        (1<<10)
 #define WLAN_CAPABILITY_DSSS_OFDM      (1<<13)
+
+/* DMG (60gHz) 802.11ad */
+/* type - bits 0..1 */
+#define WLAN_CAPABILITY_DMG_TYPE_IBSS          (1<<0) /* Tx by: STA */
+#define WLAN_CAPABILITY_DMG_TYPE_PBSS          (2<<0) /* Tx by: PCP */
+#define WLAN_CAPABILITY_DMG_TYPE_AP            (3<<0) /* Tx by: AP */
+
+#define WLAN_CAPABILITY_DMG_CBAP_ONLY          (1<<2)
+#define WLAN_CAPABILITY_DMG_CBAP_SOURCE        (1<<3)
+#define WLAN_CAPABILITY_DMG_PRIVACY            (1<<4)
+#define WLAN_CAPABILITY_DMG_ECPAC              (1<<5)
+
+#define WLAN_CAPABILITY_DMG_SPECTRUM_MGMT      (1<<8)
+#define WLAN_CAPABILITY_DMG_RADIO_MEASURE      (1<<12)
+
 /* measurement */
 #define IEEE80211_SPCT_MSR_RPRT_MODE_LATE      (1<<0)
 #define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1)
@@ -1230,7 +1260,6 @@ struct ieee80211_vht_mcs_info {
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA       1
 #define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI       2
 
-
 /* 802.11g ERP information element */
 #define WLAN_ERP_NON_ERP_PRESENT (1<<0)
 #define WLAN_ERP_USE_PROTECTION (1<<1)
@@ -1242,6 +1271,16 @@ enum {
        WLAN_ERP_PREAMBLE_LONG = 1,
 };
 
+/* Band ID, 802.11ad #8.4.1.45 */
+enum {
+       IEEE80211_BANDID_TV_WS = 0, /* TV white spaces */
+       IEEE80211_BANDID_SUB1  = 1, /* Sub-1 GHz (excluding TV white spaces) */
+       IEEE80211_BANDID_2G    = 2, /* 2.4 GHz */
+       IEEE80211_BANDID_3G    = 3, /* 3.6 GHz */
+       IEEE80211_BANDID_5G    = 4, /* 4.9 and 5 GHz */
+       IEEE80211_BANDID_60G   = 5, /* 60 GHz */
+};
+
 /* Status codes */
 enum ieee80211_statuscode {
        WLAN_STATUS_SUCCESS = 0,
@@ -1293,6 +1332,17 @@ enum ieee80211_statuscode {
        WLAN_STATUS_ANTI_CLOG_REQUIRED = 76,
        WLAN_STATUS_FCG_NOT_SUPP = 78,
        WLAN_STATUS_STA_NO_TBTT = 78,
+       /* 802.11ad */
+       WLAN_STATUS_REJECTED_WITH_SUGGESTED_CHANGES = 39,
+       WLAN_STATUS_REJECTED_FOR_DELAY_PERIOD = 47,
+       WLAN_STATUS_REJECT_WITH_SCHEDULE = 83,
+       WLAN_STATUS_PENDING_ADMITTING_FST_SESSION = 86,
+       WLAN_STATUS_PERFORMING_FST_NOW = 87,
+       WLAN_STATUS_PENDING_GAP_IN_BA_WINDOW = 88,
+       WLAN_STATUS_REJECT_U_PID_SETTING = 89,
+       WLAN_STATUS_REJECT_DSE_BAND = 96,
+       WLAN_STATUS_DENIED_WITH_SUGGESTED_BAND_AND_CHANNEL = 99,
+       WLAN_STATUS_DENIED_DUE_TO_SPECTRUM_MANAGEMENT = 103,
 };
 
 
@@ -1452,6 +1502,40 @@ enum ieee80211_eid {
 
        WLAN_EID_VHT_CAPABILITY = 191,
        WLAN_EID_VHT_OPERATION = 192,
+
+       /* 802.11ad */
+       WLAN_EID_NON_TX_BSSID_CAP =  83,
+       WLAN_EID_WAKEUP_SCHEDULE = 143,
+       WLAN_EID_EXT_SCHEDULE = 144,
+       WLAN_EID_STA_AVAILABILITY = 145,
+       WLAN_EID_DMG_TSPEC = 146,
+       WLAN_EID_DMG_AT = 147,
+       WLAN_EID_DMG_CAP = 148,
+       WLAN_EID_DMG_OPERATION = 151,
+       WLAN_EID_DMG_BSS_PARAM_CHANGE = 152,
+       WLAN_EID_DMG_BEAM_REFINEMENT = 153,
+       WLAN_EID_CHANNEL_MEASURE_FEEDBACK = 154,
+       WLAN_EID_AWAKE_WINDOW = 157,
+       WLAN_EID_MULTI_BAND = 158,
+       WLAN_EID_ADDBA_EXT = 159,
+       WLAN_EID_NEXT_PCP_LIST = 160,
+       WLAN_EID_PCP_HANDOVER = 161,
+       WLAN_EID_DMG_LINK_MARGIN = 162,
+       WLAN_EID_SWITCHING_STREAM = 163,
+       WLAN_EID_SESSION_TRANSITION = 164,
+       WLAN_EID_DYN_TONE_PAIRING_REPORT = 165,
+       WLAN_EID_CLUSTER_REPORT = 166,
+       WLAN_EID_RELAY_CAP = 167,
+       WLAN_EID_RELAY_XFER_PARAM_SET = 168,
+       WLAN_EID_BEAM_LINK_MAINT = 169,
+       WLAN_EID_MULTIPLE_MAC_ADDR = 170,
+       WLAN_EID_U_PID = 171,
+       WLAN_EID_DMG_LINK_ADAPT_ACK = 172,
+       WLAN_EID_QUIET_PERIOD_REQ = 175,
+       WLAN_EID_QUIET_PERIOD_RESP = 177,
+       WLAN_EID_EPAC_POLICY = 182,
+       WLAN_EID_CLISTER_TIME_OFF = 183,
+       WLAN_EID_ANTENNA_SECTOR_ID_PATTERN = 190,
 };
 
 /* Action category code */
@@ -1468,7 +1552,10 @@ enum ieee80211_category {
        WLAN_CATEGORY_MESH_ACTION = 13,
        WLAN_CATEGORY_MULTIHOP_ACTION = 14,
        WLAN_CATEGORY_SELF_PROTECTED = 15,
+       WLAN_CATEGORY_DMG = 16,
        WLAN_CATEGORY_WMM = 17,
+       WLAN_CATEGORY_FST = 18,
+       WLAN_CATEGORY_UNPROT_DMG = 20,
        WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126,
        WLAN_CATEGORY_VENDOR_SPECIFIC = 127,
 };
@@ -1716,6 +1803,7 @@ enum ieee80211_sa_query_action {
 #define WLAN_CIPHER_SUITE_CCMP         0x000FAC04
 #define WLAN_CIPHER_SUITE_WEP104       0x000FAC05
 #define WLAN_CIPHER_SUITE_AES_CMAC     0x000FAC06
+#define WLAN_CIPHER_SUITE_GCMP         0x000FAC08
 
 #define WLAN_CIPHER_SUITE_SMS4         0x00147201
 
@@ -1876,36 +1964,6 @@ static inline bool ieee80211_is_public_action(struct ieee80211_hdr *hdr,
        return mgmt->u.action.category == WLAN_CATEGORY_PUBLIC;
 }
 
-/**
- * ieee80211_fhss_chan_to_freq - get channel frequency
- * @channel: the FHSS channel
- *
- * Convert IEEE802.11 FHSS channel to frequency (MHz)
- * Ref IEEE 802.11-2007 section 14.6
- */
-static inline int ieee80211_fhss_chan_to_freq(int channel)
-{
-       if ((channel > 1) && (channel < 96))
-               return channel + 2400;
-       else
-               return -1;
-}
-
-/**
- * ieee80211_freq_to_fhss_chan - get channel
- * @freq: the channels frequency
- *
- * Convert frequency (MHz) to IEEE802.11 FHSS channel
- * Ref IEEE 802.11-2007 section 14.6
- */
-static inline int ieee80211_freq_to_fhss_chan(int freq)
-{
-       if ((freq > 2401) && (freq < 2496))
-               return freq - 2400;
-       else
-               return -1;
-}
-
 /**
  * ieee80211_dsss_chan_to_freq - get channel center frequency
  * @channel: the DSSS channel
@@ -1942,56 +2000,6 @@ static inline int ieee80211_freq_to_dsss_chan(int freq)
                return -1;
 }
 
-/* Convert IEEE802.11 HR DSSS channel to frequency (MHz) and back
- * Ref IEEE 802.11-2007 section 18.4.6.2
- *
- * The channels and frequencies are the same as those defined for DSSS
- */
-#define ieee80211_hr_chan_to_freq(chan) ieee80211_dsss_chan_to_freq(chan)
-#define ieee80211_freq_to_hr_chan(freq) ieee80211_freq_to_dsss_chan(freq)
-
-/* Convert IEEE802.11 ERP channel to frequency (MHz) and back
- * Ref IEEE 802.11-2007 section 19.4.2
- */
-#define ieee80211_erp_chan_to_freq(chan) ieee80211_hr_chan_to_freq(chan)
-#define ieee80211_freq_to_erp_chan(freq) ieee80211_freq_to_hr_chan(freq)
-
-/**
- * ieee80211_ofdm_chan_to_freq - get channel center frequency
- * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
- * @channel: the OFDM channel
- *
- * Convert IEEE802.11 OFDM channel to center frequency (MHz)
- * Ref IEEE 802.11-2007 section 17.3.8.3.2
- */
-static inline int ieee80211_ofdm_chan_to_freq(int s_freq, int channel)
-{
-       if ((channel > 0) && (channel <= 200) &&
-           (s_freq >= 4000))
-               return s_freq + (channel * 5);
-       else
-               return -1;
-}
-
-/**
- * ieee80211_freq_to_ofdm_channel - get channel
- * @s_freq: starting frequency == (dotChannelStartingFactor/2) MHz
- * @freq: the frequency
- *
- * Convert frequency (MHz) to IEEE802.11 OFDM channel
- * Ref IEEE 802.11-2007 section 17.3.8.3.2
- *
- * This routine selects the channel with the closest center frequency.
- */
-static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq)
-{
-       if ((freq > (s_freq + 2)) && (freq <= (s_freq + 1202)) &&
-           (s_freq >= 4000))
-               return (freq + 2 - s_freq) / 5;
-       else
-               return -1;
-}
-
 /**
  * ieee80211_tu_to_usec - convert time units (TU) to microseconds
  * @tu: the TUs