Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8712: switch to common ieee80211 headers

This patch switches to <linux/ieee80211.h> and <net/cfg80211.h> and
deletes a lot of duplicate definitions plus many unused ones.

Non obvious changes:
- struct ieee80211_ht_cap is different enough that I preferred to keep
(and rename) it for now.
- mcs_rate in translate_scan was not read after being set, so I deleted
that part rather than using the renamed struct
- WLAN_CAPABILITY_BSS is replaced with WLAN_CAPABILITY_ESS which is the
corresponding one with same value

Signed-off-by: Pascal Terjan <pterjan@google.com>
Link: https://lore.kernel.org/r/20200609194848.166130-1-pterjan@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Pascal Terjan and committed by
Greg Kroah-Hartman
3ee97e22 ce59858b

+21 -633
+1 -1
drivers/staging/rtl8712/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 config R8712U 3 3 tristate "RealTek RTL8712U (RTL8192SU) Wireless LAN NIC driver" 4 - depends on WLAN && USB 4 + depends on WLAN && USB && CFG80211 5 5 select WIRELESS_EXT 6 6 select WEXT_PRIV 7 7 select FW_LOADER
+1 -583
drivers/staging/rtl8712/ieee80211.h
··· 14 14 #ifndef __IEEE80211_H 15 15 #define __IEEE80211_H 16 16 17 - #include "osdep_service.h" 18 - #include "drv_types.h" 19 - #include "wifi.h" 20 - #include <linux/compiler.h> 21 - #include <linux/wireless.h> 17 + #include <linux/ieee80211.h> 22 18 23 - #define MGMT_QUEUE_NUM 5 24 - #define ETH_ALEN 6 25 19 #define IEEE_CMD_SET_WPA_PARAM 1 26 20 #define IEEE_CMD_SET_WPA_IE 2 27 21 #define IEEE_CMD_SET_ENCRYPTION 3 ··· 96 102 } u; 97 103 }; 98 104 99 - #define IEEE80211_DATA_LEN 2304 100 - /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 101 - * 6.2.1.1.2. 102 - * 103 - * The figure in section 7.1.2 suggests a body size of up to 2312 104 - * bytes is allowed, which is a bit confusing, I suspect this 105 - * represents the 2304 bytes of real data, plus a possible 8 bytes of 106 - * WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) 107 - */ 108 - 109 - #define IEEE80211_HLEN 30 110 - #define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN) 111 - 112 - /* this is stolen from ipw2200 driver */ 113 - #define IEEE_IBSS_MAC_HASH_SIZE 31 114 - 115 - struct ieee_ibss_seq { 116 - u8 mac[ETH_ALEN]; 117 - u16 seq_num; 118 - u16 frag_num; 119 - unsigned long packet_time; 120 - struct list_head list; 121 - }; 122 - 123 - struct ieee80211_hdr { 124 - __le16 frame_ctl; 125 - __le16 duration_id; 126 - u8 addr1[ETH_ALEN]; 127 - u8 addr2[ETH_ALEN]; 128 - u8 addr3[ETH_ALEN]; 129 - __le16 seq_ctl; 130 - u8 addr4[ETH_ALEN]; 131 - } __packed __aligned(2); 132 - 133 - struct ieee80211_hdr_3addr { 134 - __le16 frame_ctl; 135 - __le16 duration_id; 136 - u8 addr1[ETH_ALEN]; 137 - u8 addr2[ETH_ALEN]; 138 - u8 addr3[ETH_ALEN]; 139 - __le16 seq_ctl; 140 - } __packed __aligned(2); 141 - 142 - struct ieee80211_hdr_qos { 143 - __le16 frame_ctl; 144 - __le16 duration_id; 145 - u8 addr1[ETH_ALEN]; 146 - u8 addr2[ETH_ALEN]; 147 - u8 addr3[ETH_ALEN]; 148 - __le16 seq_ctl; 149 - u8 addr4[ETH_ALEN]; 150 - __le16 qc; 151 - } __packed __aligned(2); 152 - 153 - struct ieee80211_hdr_3addr_qos { 154 - __le16 frame_ctl; 155 - __le16 duration_id; 156 - u8 addr1[ETH_ALEN]; 157 - u8 addr2[ETH_ALEN]; 158 - u8 addr3[ETH_ALEN]; 159 - __le16 seq_ctl; 160 - __le16 qc; 161 - } __packed; 162 - 163 - struct eapol { 164 - u8 snap[6]; 165 - __be16 ethertype; 166 - u8 version; 167 - u8 type; 168 - __le16 length; 169 - } __packed; 170 - 171 - enum eap_type { 172 - EAP_PACKET = 0, 173 - EAPOL_START, 174 - EAPOL_LOGOFF, 175 - EAPOL_KEY, 176 - EAPOL_ENCAP_ASF_ALERT 177 - }; 178 - 179 - #define IEEE80211_3ADDR_LEN 24 180 - #define IEEE80211_4ADDR_LEN 30 181 - #define IEEE80211_FCS_LEN 4 182 - 183 105 #define MIN_FRAG_THRESHOLD 256U 184 106 #define MAX_FRAG_THRESHOLD 2346U 185 107 186 - /* Frame control field constants */ 187 - #define IEEE80211_FCTL_VERS 0x0002 188 - #define IEEE80211_FCTL_FTYPE 0x000c 189 - #define IEEE80211_FCTL_STYPE 0x00f0 190 - #define IEEE80211_FCTL_TODS 0x0100 191 - #define IEEE80211_FCTL_FROMDS 0x0200 192 - #define IEEE80211_FCTL_MOREFRAGS 0x0400 193 - #define IEEE80211_FCTL_RETRY 0x0800 194 - #define IEEE80211_FCTL_PM 0x1000 195 - #define IEEE80211_FCTL_MOREDATA 0x2000 196 - #define IEEE80211_FCTL_WEP 0x4000 197 - #define IEEE80211_FCTL_ORDER 0x8000 198 - 199 - #define IEEE80211_FTYPE_MGMT 0x0000 200 - #define IEEE80211_FTYPE_CTL 0x0004 201 - #define IEEE80211_FTYPE_DATA 0x0008 202 - 203 - /* management */ 204 - #define IEEE80211_STYPE_ASSOC_REQ 0x0000 205 - #define IEEE80211_STYPE_ASSOC_RESP 0x0010 206 - #define IEEE80211_STYPE_REASSOC_REQ 0x0020 207 - #define IEEE80211_STYPE_REASSOC_RESP 0x0030 208 - #define IEEE80211_STYPE_PROBE_REQ 0x0040 209 - #define IEEE80211_STYPE_PROBE_RESP 0x0050 210 - #define IEEE80211_STYPE_BEACON 0x0080 211 - #define IEEE80211_STYPE_ATIM 0x0090 212 - #define IEEE80211_STYPE_DISASSOC 0x00A0 213 - #define IEEE80211_STYPE_AUTH 0x00B0 214 - #define IEEE80211_STYPE_DEAUTH 0x00C0 215 - 216 - /* control */ 217 - #define IEEE80211_STYPE_PSPOLL 0x00A0 218 - #define IEEE80211_STYPE_RTS 0x00B0 219 - #define IEEE80211_STYPE_CTS 0x00C0 220 - #define IEEE80211_STYPE_ACK 0x00D0 221 - #define IEEE80211_STYPE_CFEND 0x00E0 222 - #define IEEE80211_STYPE_CFENDACK 0x00F0 223 - 224 - /* data */ 225 - #define IEEE80211_STYPE_DATA 0x0000 226 - #define IEEE80211_STYPE_DATA_CFACK 0x0010 227 - #define IEEE80211_STYPE_DATA_CFPOLL 0x0020 228 - #define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030 229 - #define IEEE80211_STYPE_NULLFUNC 0x0040 230 - #define IEEE80211_STYPE_CFACK 0x0050 231 - #define IEEE80211_STYPE_CFPOLL 0x0060 232 - #define IEEE80211_STYPE_CFACKPOLL 0x0070 233 - #define IEEE80211_QOS_DATAGRP 0x0080 234 - 235 - #define IEEE80211_SCTL_FRAG 0x000F 236 - #define IEEE80211_SCTL_SEQ 0xFFF0 237 - 238 108 /* QoS,QOS */ 239 109 #define NORMAL_ACK 0 240 - #define NO_ACK 1 241 - #define NON_EXPLICIT_ACK 2 242 - #define BLOCK_ACK 3 243 - 244 - #ifndef ETH_P_PAE 245 - #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 246 - #endif /* ETH_P_PAE */ 247 - 248 - #define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */ 249 - 250 - #define ETH_P_ECONET 0x0018 251 - 252 - #ifndef ETH_P_80211_RAW 253 - #define ETH_P_80211_RAW (ETH_P_ECONET + 1) 254 - #endif 255 110 256 111 /* IEEE 802.11 defines */ 257 112 ··· 115 272 116 273 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) 117 274 118 - #define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE) 119 - #define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE) 120 - 121 - #define WLAN_QC_GET_TID(qc) ((qc) & 0x0f) 122 - 123 - #define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 124 - #define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ) 125 - 126 - /* Authentication algorithms */ 127 - #define WLAN_AUTH_OPEN 0 128 - #define WLAN_AUTH_SHARED_KEY 1 129 - 130 - #define WLAN_AUTH_CHALLENGE_LEN 128 131 - 132 - #define WLAN_CAPABILITY_BSS BIT(0) 133 - #define WLAN_CAPABILITY_IBSS BIT(1) 134 - #define WLAN_CAPABILITY_CF_POLLABLE BIT(2) 135 - #define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3) 136 - #define WLAN_CAPABILITY_PRIVACY BIT(4) 137 - #define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5) 138 - #define WLAN_CAPABILITY_PBCC BIT(6) 139 - #define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7) 140 - #define WLAN_CAPABILITY_SHORT_SLOT BIT(10) 141 - 142 - /* Information Element IDs */ 143 - #define WLAN_EID_SSID 0 144 - #define WLAN_EID_SUPP_RATES 1 145 - #define WLAN_EID_FH_PARAMS 2 146 - #define WLAN_EID_DS_PARAMS 3 147 - #define WLAN_EID_CF_PARAMS 4 148 - #define WLAN_EID_TIM 5 149 - #define WLAN_EID_IBSS_PARAMS 6 150 - #define WLAN_EID_CHALLENGE 16 151 - #define WLAN_EID_RSN 48 152 - #define WLAN_EID_GENERIC 221 153 - 154 - #define IEEE80211_MGMT_HDR_LEN 24 155 - #define IEEE80211_DATA_HDR3_LEN 24 156 - #define IEEE80211_DATA_HDR4_LEN 30 157 - 158 - #define IEEE80211_STATMASK_SIGNAL BIT(0) 159 - #define IEEE80211_STATMASK_RSSI BIT(1) 160 - #define IEEE80211_STATMASK_NOISE BIT(2) 161 - #define IEEE80211_STATMASK_RATE BIT(3) 162 - #define IEEE80211_STATMASK_WEMASK 0x7 163 - 164 - #define IEEE80211_CCK_MODULATION BIT(0) 165 - #define IEEE80211_OFDM_MODULATION BIT(1) 166 - 167 - #define IEEE80211_24GHZ_BAND BIT(0) 168 - #define IEEE80211_52GHZ_BAND BIT(1) 169 - 170 275 #define IEEE80211_CCK_RATE_LEN 4 171 276 #define IEEE80211_NUM_OFDM_RATESLEN 8 172 277 ··· 122 331 #define IEEE80211_CCK_RATE_2MB 0x04 123 332 #define IEEE80211_CCK_RATE_5MB 0x0B 124 333 #define IEEE80211_CCK_RATE_11MB 0x16 125 - #define IEEE80211_OFDM_RATE_LEN 8 126 334 #define IEEE80211_OFDM_RATE_6MB 0x0C 127 335 #define IEEE80211_OFDM_RATE_9MB 0x12 128 336 #define IEEE80211_OFDM_RATE_12MB 0x18 ··· 132 342 #define IEEE80211_OFDM_RATE_54MB 0x6C 133 343 #define IEEE80211_BASIC_RATE_MASK 0x80 134 344 135 - #define IEEE80211_CCK_RATE_1MB_MASK BIT(0) 136 - #define IEEE80211_CCK_RATE_2MB_MASK BIT(1) 137 - #define IEEE80211_CCK_RATE_5MB_MASK BIT(2) 138 - #define IEEE80211_CCK_RATE_11MB_MASK BIT(3) 139 - #define IEEE80211_OFDM_RATE_6MB_MASK BIT(4) 140 - #define IEEE80211_OFDM_RATE_9MB_MASK BIT(5) 141 - #define IEEE80211_OFDM_RATE_12MB_MASK BIT(6) 142 - #define IEEE80211_OFDM_RATE_18MB_MASK BIT(7) 143 - #define IEEE80211_OFDM_RATE_24MB_MASK BIT(8) 144 - #define IEEE80211_OFDM_RATE_36MB_MASK BIT(9) 145 - #define IEEE80211_OFDM_RATE_48MB_MASK BIT(10) 146 - #define IEEE80211_OFDM_RATE_54MB_MASK BIT(11) 147 - 148 - #define IEEE80211_CCK_RATES_MASK 0x0000000F 149 - #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ 150 - IEEE80211_CCK_RATE_2MB_MASK) 151 - #define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ 152 - IEEE80211_CCK_RATE_5MB_MASK | \ 153 - IEEE80211_CCK_RATE_11MB_MASK) 154 - 155 - #define IEEE80211_OFDM_RATES_MASK 0x00000FF0 156 - #define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ 157 - IEEE80211_OFDM_RATE_12MB_MASK | \ 158 - IEEE80211_OFDM_RATE_24MB_MASK) 159 - #define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \ 160 - IEEE80211_OFDM_RATE_9MB_MASK | \ 161 - IEEE80211_OFDM_RATE_18MB_MASK | \ 162 - IEEE80211_OFDM_RATE_36MB_MASK | \ 163 - IEEE80211_OFDM_RATE_48MB_MASK | \ 164 - IEEE80211_OFDM_RATE_54MB_MASK) 165 - #define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ 166 - IEEE80211_CCK_DEFAULT_RATES_MASK) 167 - 168 - #define IEEE80211_NUM_OFDM_RATES 8 169 - #define IEEE80211_NUM_CCK_RATES 4 170 - #define IEEE80211_OFDM_SHIFT_MASK_A 4 171 - 172 - /* NOTE: This data is for statistical purposes; not all hardware provides this 173 - * information for frames received. Not setting these will not cause 174 - * any adverse affects. 175 - */ 176 - struct ieee80211_rx_stats { 177 - s8 rssi; 178 - u8 signal; 179 - u8 noise; 180 - u8 received_channel; 181 - u16 rate; /* in 100 kbps */ 182 - u8 mask; 183 - u8 freq; 184 - u16 len; 185 - }; 186 - 187 - /* IEEE 802.11 requires that STA supports concurrent reception of at least 188 - * three fragmented frames. This define can be increased to support more 189 - * concurrent frames, but it should be noted that each entry can consume about 190 - * 2 kB of RAM and increasing cache size will slow down frame reassembly. 191 - */ 192 - #define IEEE80211_FRAG_CACHE_LEN 4 193 - 194 - struct ieee80211_frag_entry { 195 - u32 first_frag_time; 196 - uint seq; 197 - uint last_frag; 198 - uint qos; /*jackson*/ 199 - uint tid; /*jackson*/ 200 - struct sk_buff *skb; 201 - u8 src_addr[ETH_ALEN]; 202 - u8 dst_addr[ETH_ALEN]; 203 - }; 204 - 205 - struct ieee80211_stats { 206 - uint tx_unicast_frames; 207 - uint tx_multicast_frames; 208 - uint tx_fragments; 209 - uint tx_unicast_octets; 210 - uint tx_multicast_octets; 211 - uint tx_deferred_transmissions; 212 - uint tx_single_retry_frames; 213 - uint tx_multiple_retry_frames; 214 - uint tx_retry_limit_exceeded; 215 - uint tx_discards; 216 - uint rx_unicast_frames; 217 - uint rx_multicast_frames; 218 - uint rx_fragments; 219 - uint rx_unicast_octets; 220 - uint rx_multicast_octets; 221 - uint rx_fcs_errors; 222 - uint rx_discards_no_buffer; 223 - uint tx_discards_wrong_sa; 224 - uint rx_discards_undecryptable; 225 - uint rx_message_in_msg_fragments; 226 - uint rx_message_in_bad_msg_fragments; 227 - }; 228 - 229 - struct ieee80211_softmac_stats { 230 - uint rx_ass_ok; 231 - uint rx_ass_err; 232 - uint rx_probe_rq; 233 - uint tx_probe_rs; 234 - uint tx_beacons; 235 - uint rx_auth_rq; 236 - uint rx_auth_rs_ok; 237 - uint rx_auth_rs_err; 238 - uint tx_auth_rq; 239 - uint no_auth_rs; 240 - uint no_ass_rs; 241 - uint tx_ass_rq; 242 - uint rx_ass_rq; 243 - uint tx_probe_rq; 244 - uint reassoc; 245 - uint swtxstop; 246 - uint swtxawake; 247 - }; 248 - 249 - #define SEC_KEY_1 BIT(0) 250 - #define SEC_KEY_2 BIT(1) 251 - #define SEC_KEY_3 BIT(2) 252 - #define SEC_KEY_4 BIT(3) 253 - #define SEC_ACTIVE_KEY BIT(4) 254 - #define SEC_AUTH_MODE BIT(5) 255 - #define SEC_UNICAST_GROUP BIT(6) 256 - #define SEC_LEVEL BIT(7) 257 - #define SEC_ENABLED BIT(8) 258 - 259 - #define SEC_LEVEL_0 0 /* None */ 260 - #define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */ 261 - #define SEC_LEVEL_2 2 /* Level 1 + TKIP */ 262 - #define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */ 263 - #define SEC_LEVEL_3 4 /* Level 2 + CCMP */ 264 - 265 345 #define WEP_KEYS 4 266 - #define WEP_KEY_LEN 13 267 346 268 - struct ieee80211_security { 269 - u16 active_key:2, 270 - enabled:1, 271 - auth_mode:2, 272 - auth_algo:4, 273 - unicast_uses_group:1; 274 - u8 key_sizes[WEP_KEYS]; 275 - u8 keys[WEP_KEYS][WEP_KEY_LEN]; 276 - u8 level; 277 - u16 flags; 278 - } __packed; 279 - 280 - /* 281 - * 282 - * 802.11 data frame from AP 283 - * 284 - * ,-------------------------------------------------------------------. 285 - * Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 | 286 - * |------|------|---------|---------|---------|------|---------|------| 287 - * Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs | 288 - * | | tion | (BSSID) | | | ence | data | | 289 - * `-------------------------------------------------------------------' 290 - * 291 - * Total: 28-2340 bytes 292 - * 293 - */ 294 - 295 - struct ieee80211_header_data { 296 - __le16 frame_ctl; 297 - __le16 duration_id; 298 - u8 addr1[6]; 299 - u8 addr2[6]; 300 - u8 addr3[6]; 301 - __le16 seq_ctrl; 302 - } __packed __aligned(2); 303 - 304 - #define BEACON_PROBE_SSID_ID_POSITION 12 305 - 306 - /* Management Frame Information Element Types */ 307 - #define MFIE_TYPE_SSID 0 308 - #define MFIE_TYPE_RATES 1 309 - #define MFIE_TYPE_FH_SET 2 310 - #define MFIE_TYPE_DS_SET 3 311 - #define MFIE_TYPE_CF_SET 4 312 - #define MFIE_TYPE_TIM 5 313 - #define MFIE_TYPE_IBSS_SET 6 314 - #define MFIE_TYPE_CHALLENGE 16 315 - #define MFIE_TYPE_ERP 42 316 - #define MFIE_TYPE_RSN 48 317 - #define MFIE_TYPE_RATES_EX 50 318 - #define MFIE_TYPE_GENERIC 221 319 - 320 - struct ieee80211_info_element_hdr { 321 - u8 id; 322 - u8 len; 323 - } __packed; 324 - 325 - struct ieee80211_info_element { 326 - u8 id; 327 - u8 len; 328 - u8 data[]; 329 - } __packed; 330 - 331 - /* 332 - * These are the data types that can make up management packets 333 - * 334 - __le16 auth_algorithm; 335 - __le16 auth_sequence; 336 - __le16 beacon_interval; 337 - __le16 capability; 338 - u8 current_ap[ETH_ALEN]; 339 - __le16 listen_interval; 340 - struct { 341 - u16 association_id:14, reserved:2; 342 - } __packed; 343 - __le32 time_stamp[2]; 344 - __le16 reason; 345 - __le16 status; 346 - */ 347 - 348 - #define IEEE80211_DEFAULT_TX_ESSID "Penguin" 349 - #define IEEE80211_DEFAULT_BASIC_RATE 10 350 - 351 - struct ieee80211_authentication { 352 - struct ieee80211_header_data header; 353 - __le16 algorithm; 354 - __le16 transaction; 355 - __le16 status; 356 - } __packed; 357 - 358 - struct ieee80211_probe_response { 359 - struct ieee80211_header_data header; 360 - __le32 time_stamp[2]; 361 - __le16 beacon_interval; 362 - __le16 capability; 363 - struct ieee80211_info_element info_element; 364 - } __packed; 365 - 366 - struct ieee80211_probe_request { 367 - struct ieee80211_header_data header; 368 - } __packed; 369 - 370 - struct ieee80211_assoc_request_frame { 371 - struct ieee80211_hdr_3addr header; 372 - __le16 capability; 373 - __le16 listen_interval; 374 - struct ieee80211_info_element_hdr info_element; 375 - } __packed; 376 - 377 - struct ieee80211_assoc_response_frame { 378 - struct ieee80211_hdr_3addr header; 379 - __le16 capability; 380 - __le16 status; 381 - __le16 aid; 382 - } __packed; 383 - 384 - struct ieee80211_txb { 385 - u8 nr_frags; 386 - u8 encrypted; 387 - u16 reserved; 388 - u16 frag_size; 389 - u16 payload_size; 390 - struct sk_buff *fragments[]; 391 - }; 392 - 393 - /* SWEEP TABLE ENTRIES NUMBER*/ 394 - #define MAX_SWEEP_TAB_ENTRIES 42 395 - #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7 396 347 /* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs 397 348 * only use 8, and then use extended rates for the remaining supported 398 349 * rates. Other APs, however, stick all of their supported rates on the 399 350 * main rates information element... 400 351 */ 401 352 #define MAX_RATES_LENGTH ((u8)12) 402 - #define MAX_RATES_EX_LENGTH ((u8)16) 403 - #define MAX_NETWORK_COUNT 128 404 - #define MAX_CHANNEL_NUMBER 161 405 - #define IEEE80211_SOFTMAC_SCAN_TIME 400 406 - /*(HZ / 2)*/ 407 - #define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2) 408 - 409 - #define CRC_LENGTH 4U 410 - 411 353 #define MAX_WPA_IE_LEN 128 412 - 413 - #define NETWORK_EMPTY_ESSID BIT(0) 414 - #define NETWORK_HAS_OFDM BIT(1) 415 - #define NETWORK_HAS_CCK BIT(2) 416 - 417 - #define IEEE80211_DTIM_MBCAST 4 418 - #define IEEE80211_DTIM_UCAST 2 419 - #define IEEE80211_DTIM_VALID 1 420 - #define IEEE80211_DTIM_INVALID 0 421 - 422 - #define IEEE80211_PS_DISABLED 0 423 - #define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST 424 - #define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST 425 - #define IW_ESSID_MAX_SIZE 32 426 - /* 427 - * join_res: 428 - * -1: authentication fail 429 - * -2: association fail 430 - * > 0: TID 431 - */ 432 - 433 - enum ieee80211_state { 434 - /* the card is not linked at all */ 435 - IEEE80211_NOLINK = 0, 436 - /* IEEE80211_ASSOCIATING* are for BSS client mode 437 - * the driver shall not perform RX filtering unless 438 - * the state is LINKED. 439 - * The driver shall just check for the state LINKED and 440 - * defaults to NOLINK for ALL the other states (including 441 - * LINKED_SCANNING) 442 - */ 443 - /* the association procedure will start (wq scheduling)*/ 444 - IEEE80211_ASSOCIATING, 445 - IEEE80211_ASSOCIATING_RETRY, 446 - /* the association procedure is sending AUTH request*/ 447 - IEEE80211_ASSOCIATING_AUTHENTICATING, 448 - /* the association procedure has successfully authenticated 449 - * and is sending association request 450 - */ 451 - IEEE80211_ASSOCIATING_AUTHENTICATED, 452 - /* the link is ok. the card associated to a BSS or linked 453 - * to a ibss cell or acting as an AP and creating the bss 454 - */ 455 - IEEE80211_LINKED, 456 - /* same as LINKED, but the driver shall apply RX filter 457 - * rules as we are in NO_LINK mode. As the card is still 458 - * logically linked, but it is doing a syncro site survey 459 - * then it will be back to LINKED state. 460 - */ 461 - IEEE80211_LINKED_SCANNING, 462 - }; 463 - 464 - #define DEFAULT_MAX_SCAN_AGE (15 * HZ) 465 - #define DEFAULT_FTS 2346 466 - 467 - #define CFG_IEEE80211_RESERVE_FCS BIT(0) 468 - #define CFG_IEEE80211_COMPUTE_FCS BIT(1) 469 - 470 - #define MAXTID 16 471 - 472 - #define IEEE_A BIT(0) 473 - #define IEEE_B BIT(1) 474 - #define IEEE_G BIT(2) 475 - #define IEEE_MODE_MASK (IEEE_A | IEEE_B | IEEE_G) 476 - 477 - static inline int ieee80211_is_empty_essid(const char *essid, int essid_len) 478 - { 479 - /* Single white space is for Linksys APs */ 480 - if (essid_len == 1 && essid[0] == ' ') 481 - return 1; 482 - /* Otherwise, if the entire essid is 0, we assume it is hidden */ 483 - while (essid_len) { 484 - essid_len--; 485 - if (essid[essid_len] != '\0') 486 - return 0; 487 - } 488 - return 1; 489 - } 490 - 491 - static inline int ieee80211_get_hdrlen(u16 fc) 492 - { 493 - int hdrlen = 24; 494 - 495 - switch (WLAN_FC_GET_TYPE(fc)) { 496 - case IEEE80211_FTYPE_DATA: 497 - if (fc & IEEE80211_QOS_DATAGRP) 498 - hdrlen += 2; 499 - if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) 500 - hdrlen += 6; /* Addr4 */ 501 - break; 502 - case IEEE80211_FTYPE_CTL: 503 - switch (WLAN_FC_GET_STYPE(fc)) { 504 - case IEEE80211_STYPE_CTS: 505 - case IEEE80211_STYPE_ACK: 506 - hdrlen = 10; 507 - break; 508 - default: 509 - hdrlen = 16; 510 - break; 511 - } 512 - break; 513 - } 514 - return hdrlen; 515 - } 516 354 517 355 struct registry_priv; 518 356
+1 -6
drivers/staging/rtl8712/rtl8712_recv.c
··· 18 18 19 19 #include <linux/if_ether.h> 20 20 #include <linux/ip.h> 21 + #include <net/cfg80211.h> 21 22 22 23 #include "osdep_service.h" 23 24 #include "drv_types.h" ··· 27 26 #include "ethernet.h" 28 27 #include "usb_ops.h" 29 28 #include "wifi.h" 30 - 31 - /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 32 - static u8 bridge_tunnel_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8}; 33 - 34 - /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ 35 - static u8 rfc1042_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; 36 29 37 30 static void recv_tasklet(unsigned long priv); 38 31
+1 -1
drivers/staging/rtl8712/rtl871x_ht.h
··· 26 26 unsigned int rx_ampdu_maxlen; /* for rx reordering ctrl win_sz, 27 27 * updated when join_callback. 28 28 */ 29 - struct ieee80211_ht_cap ht_cap; 29 + struct rtl_ieee80211_ht_cap ht_cap; 30 30 }; 31 31 32 32 #endif /*_RTL871X_HT_H_ */
+5 -8
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
··· 211 211 char *start, char *stop) 212 212 { 213 213 struct iw_event iwe; 214 - struct ieee80211_ht_cap *pht_capie; 215 214 char *current_val; 216 215 s8 *p; 217 216 u32 i = 0, ht_ielen = 0; 218 - u16 cap, ht_cap = false, mcs_rate; 217 + u16 cap, ht_cap = false; 219 218 u8 rssi; 220 219 221 220 if ((pnetwork->network.Configuration.DSConfig < 1) || ··· 240 241 &ht_ielen, pnetwork->network.IELength - 12); 241 242 if (p && ht_ielen > 0) { 242 243 ht_cap = true; 243 - pht_capie = (struct ieee80211_ht_cap *)(p + 2); 244 - memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2); 245 244 } 246 245 /* Add the protocol name */ 247 246 iwe.cmd = SIOCGIWNAME; ··· 265 268 memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs), 266 269 2); 267 270 le16_to_cpus(&cap); 268 - if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) { 269 - if (cap & WLAN_CAPABILITY_BSS) 271 + if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_ESS)) { 272 + if (cap & WLAN_CAPABILITY_ESS) 270 273 iwe.u.mode = (u32)IW_MODE_MASTER; 271 274 else 272 275 iwe.u.mode = (u32)IW_MODE_ADHOC; ··· 1392 1395 struct _adapter *padapter = netdev_priv(dev); 1393 1396 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1394 1397 struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network; 1395 - struct ieee80211_ht_cap *pht_capie; 1398 + struct rtl_ieee80211_ht_cap *pht_capie; 1396 1399 unsigned char rf_type = padapter->registrypriv.rf_config; 1397 1400 int i; 1398 1401 u8 *p; ··· 1408 1411 pcur_bss->IELength - 12); 1409 1412 if (p && ht_ielen > 0) { 1410 1413 ht_cap = true; 1411 - pht_capie = (struct ieee80211_ht_cap *)(p + 2); 1414 + pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2); 1412 1415 memcpy(&mcs_rate, pht_capie->supp_mcs_set, 2); 1413 1416 bw_40MHz = (le16_to_cpu(pht_capie->cap_info) & 1414 1417 IEEE80211_HT_CAP_SUP_WIDTH) ? 1 : 0;
+7 -7
drivers/staging/rtl8712/rtl871x_mlme.c
··· 249 249 src->Ssid.SsidLength))) && 250 250 ((s_cap & WLAN_CAPABILITY_IBSS) == 251 251 (d_cap & WLAN_CAPABILITY_IBSS)) && 252 - ((s_cap & WLAN_CAPABILITY_BSS) == 253 - (d_cap & WLAN_CAPABILITY_BSS)); 252 + ((s_cap & WLAN_CAPABILITY_ESS) == 253 + (d_cap & WLAN_CAPABILITY_ESS)); 254 254 255 255 } 256 256 ··· 1643 1643 { 1644 1644 u32 ielen, out_len; 1645 1645 unsigned char *p; 1646 - struct ieee80211_ht_cap ht_capie; 1646 + struct rtl_ieee80211_ht_cap ht_capie; 1647 1647 unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00}; 1648 1648 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1649 1649 struct qos_priv *pqospriv = &pmlmepriv->qospriv; ··· 1659 1659 pqospriv->qos_option = 1; 1660 1660 } 1661 1661 out_len = *pout_len; 1662 - memset(&ht_capie, 0, sizeof(struct ieee80211_ht_cap)); 1662 + memset(&ht_capie, 0, sizeof(struct rtl_ieee80211_ht_cap)); 1663 1663 ht_capie.cap_info = cpu_to_le16(IEEE80211_HT_CAP_SUP_WIDTH | 1664 1664 IEEE80211_HT_CAP_SGI_20 | 1665 1665 IEEE80211_HT_CAP_SGI_40 | ··· 1669 1669 ht_capie.ampdu_params_info = (IEEE80211_HT_CAP_AMPDU_FACTOR & 1670 1670 0x03) | (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00); 1671 1671 r8712_set_ie(out_ie + out_len, _HT_CAPABILITY_IE_, 1672 - sizeof(struct ieee80211_ht_cap), 1672 + sizeof(struct rtl_ieee80211_ht_cap), 1673 1673 (unsigned char *)&ht_capie, pout_len); 1674 1674 phtpriv->ht_option = 1; 1675 1675 } ··· 1683 1683 int i; 1684 1684 uint len; 1685 1685 struct sta_info *bmc_sta, *psta; 1686 - struct ieee80211_ht_cap *pht_capie; 1686 + struct rtl_ieee80211_ht_cap *pht_capie; 1687 1687 struct recv_reorder_ctrl *preorder_ctrl; 1688 1688 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 1689 1689 struct ht_priv *phtpriv = &pmlmepriv->htpriv; ··· 1703 1703 &len, ie_len - 1704 1704 sizeof(struct NDIS_802_11_FIXED_IEs)); 1705 1705 if (p && len > 0) { 1706 - pht_capie = (struct ieee80211_ht_cap *)(p + 2); 1706 + pht_capie = (struct rtl_ieee80211_ht_cap *)(p + 2); 1707 1707 max_ampdu_sz = (pht_capie->ampdu_params_info & 1708 1708 IEEE80211_HT_CAP_AMPDU_FACTOR); 1709 1709 /* max_ampdu_sz (kbytes); */
+1 -6
drivers/staging/rtl8712/rtl871x_recv.c
··· 21 21 #include <linux/if_ether.h> 22 22 #include <linux/kmemleak.h> 23 23 #include <linux/etherdevice.h> 24 + #include <net/cfg80211.h> 24 25 25 26 #include "osdep_service.h" 26 27 #include "drv_types.h" ··· 35 34 36 35 /* Datagram Delivery Protocol */ 37 36 static const u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3}; 38 - 39 - /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */ 40 - static const u8 bridge_tunnel_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8}; 41 - 42 - /* Ethernet-II snap header (RFC1042 for most EtherTypes) */ 43 - static const u8 rfc1042_header[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00}; 44 37 45 38 void _r8712_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) 46 39 {
-2
drivers/staging/rtl8712/rtl871x_recv.h
··· 12 12 13 13 #define MAX_SUBFRAME_COUNT 64 14 14 15 - #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr) 16 - 17 15 /* for Rx reordering buffer control */ 18 16 struct recv_reorder_ctrl { 19 17 struct _adapter *padapter;
+1 -1
drivers/staging/rtl8712/rtl871x_xmit.c
··· 476 476 struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; 477 477 struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 478 478 struct qos_priv *pqospriv = &pmlmepriv->qospriv; 479 - __le16 *fctrl = &pwlanhdr->frame_ctl; 479 + __le16 *fctrl = &pwlanhdr->frame_control; 480 480 u8 *bssid; 481 481 482 482 memset(hdr, 0, WLANHDR_OFFSET);
+3 -18
drivers/staging/rtl8712/wifi.h
··· 451 451 #define GetOrderBit(pbuf) (((*(__le16 *)(pbuf)) & \ 452 452 le16_to_cpu(_ORDER_)) != 0) 453 453 454 - /** 455 - * struct ieee80211_bar - HT Block Ack Request 456 - * 457 - * This structure refers to "HT BlockAckReq" as 458 - * described in 802.11n draft section 7.2.1.7.1 459 - */ 460 - struct ieee80211_bar { 461 - __le16 frame_control; 462 - __le16 duration; 463 - unsigned char ra[6]; 464 - unsigned char ta[6]; 465 - __le16 control; 466 - __le16 start_seq_num; 467 - } __packed; 468 - 469 454 /* 802.11 BAR control masks */ 470 455 #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 471 456 #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 472 457 473 458 /* 474 - * struct ieee80211_ht_cap - HT capabilities 459 + * struct rtl_ieee80211_ht_cap - HT capabilities 475 460 * 476 461 * This structure refers to "HT capabilities element" as 477 462 * described in 802.11n draft section 7.3.2.52 478 463 */ 479 464 480 - struct ieee80211_ht_cap { 465 + struct rtl_ieee80211_ht_cap { 481 466 __le16 cap_info; 482 467 unsigned char ampdu_params_info; 483 468 unsigned char supp_mcs_set[16]; ··· 472 487 } __packed; 473 488 474 489 /** 475 - * struct ieee80211_ht_cap - HT additional information 490 + * struct ieee80211_ht_addt_info - HT additional information 476 491 * 477 492 * This structure refers to "HT information element" as 478 493 * described in 802.11n draft section 7.3.2.53