forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/staging/rtl8712/ieee80211.h
....@@ -1,18 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /******************************************************************************
23 *
34 * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of version 2 of the GNU General Public License as
7
- * published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program; if not, see <http://www.gnu.org/licenses/>.
165 *
176 * Modifications for inclusion into the Linux staging tree are
187 * Copyright(c) 2010 Larry Finger. All rights reserved.
....@@ -25,14 +14,8 @@
2514 #ifndef __IEEE80211_H
2615 #define __IEEE80211_H
2716
28
-#include "osdep_service.h"
29
-#include "drv_types.h"
30
-#include "wifi.h"
31
-#include <linux/compiler.h>
32
-#include <linux/wireless.h>
17
+#include <linux/ieee80211.h>
3318
34
-#define MGMT_QUEUE_NUM 5
35
-#define ETH_ALEN 6
3619 #define IEEE_CMD_SET_WPA_PARAM 1
3720 #define IEEE_CMD_SET_WPA_IE 2
3821 #define IEEE_CMD_SET_ENCRYPTION 3
....@@ -113,162 +96,11 @@
11396 } u;
11497 };
11598
116
-#define IEEE80211_DATA_LEN 2304
117
-/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
118
- * 6.2.1.1.2.
119
- *
120
- * The figure in section 7.1.2 suggests a body size of up to 2312
121
- * bytes is allowed, which is a bit confusing, I suspect this
122
- * represents the 2304 bytes of real data, plus a possible 8 bytes of
123
- * WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro)
124
- */
125
-
126
-#define IEEE80211_HLEN 30
127
-#define IEEE80211_FRAME_LEN (IEEE80211_DATA_LEN + IEEE80211_HLEN)
128
-
129
-/* this is stolen from ipw2200 driver */
130
-#define IEEE_IBSS_MAC_HASH_SIZE 31
131
-
132
-struct ieee_ibss_seq {
133
- u8 mac[ETH_ALEN];
134
- u16 seq_num;
135
- u16 frag_num;
136
- unsigned long packet_time;
137
- struct list_head list;
138
-};
139
-
140
-struct ieee80211_hdr {
141
- __le16 frame_ctl;
142
- __le16 duration_id;
143
- u8 addr1[ETH_ALEN];
144
- u8 addr2[ETH_ALEN];
145
- u8 addr3[ETH_ALEN];
146
- __le16 seq_ctl;
147
- u8 addr4[ETH_ALEN];
148
-} __packed __aligned(2);
149
-
150
-struct ieee80211_hdr_3addr {
151
- __le16 frame_ctl;
152
- __le16 duration_id;
153
- u8 addr1[ETH_ALEN];
154
- u8 addr2[ETH_ALEN];
155
- u8 addr3[ETH_ALEN];
156
- __le16 seq_ctl;
157
-} __packed __aligned(2);
158
-
159
-struct ieee80211_hdr_qos {
160
- __le16 frame_ctl;
161
- __le16 duration_id;
162
- u8 addr1[ETH_ALEN];
163
- u8 addr2[ETH_ALEN];
164
- u8 addr3[ETH_ALEN];
165
- __le16 seq_ctl;
166
- u8 addr4[ETH_ALEN];
167
- __le16 qc;
168
-} __packed __aligned(2);
169
-
170
-struct ieee80211_hdr_3addr_qos {
171
- __le16 frame_ctl;
172
- __le16 duration_id;
173
- u8 addr1[ETH_ALEN];
174
- u8 addr2[ETH_ALEN];
175
- u8 addr3[ETH_ALEN];
176
- __le16 seq_ctl;
177
- __le16 qc;
178
-} __packed;
179
-
180
-struct eapol {
181
- u8 snap[6];
182
- __be16 ethertype;
183
- u8 version;
184
- u8 type;
185
- __le16 length;
186
-} __packed;
187
-
188
-enum eap_type {
189
- EAP_PACKET = 0,
190
- EAPOL_START,
191
- EAPOL_LOGOFF,
192
- EAPOL_KEY,
193
- EAPOL_ENCAP_ASF_ALERT
194
-};
195
-
196
-#define IEEE80211_3ADDR_LEN 24
197
-#define IEEE80211_4ADDR_LEN 30
198
-#define IEEE80211_FCS_LEN 4
199
-
20099 #define MIN_FRAG_THRESHOLD 256U
201100 #define MAX_FRAG_THRESHOLD 2346U
202101
203
-/* Frame control field constants */
204
-#define IEEE80211_FCTL_VERS 0x0002
205
-#define IEEE80211_FCTL_FTYPE 0x000c
206
-#define IEEE80211_FCTL_STYPE 0x00f0
207
-#define IEEE80211_FCTL_TODS 0x0100
208
-#define IEEE80211_FCTL_FROMDS 0x0200
209
-#define IEEE80211_FCTL_MOREFRAGS 0x0400
210
-#define IEEE80211_FCTL_RETRY 0x0800
211
-#define IEEE80211_FCTL_PM 0x1000
212
-#define IEEE80211_FCTL_MOREDATA 0x2000
213
-#define IEEE80211_FCTL_WEP 0x4000
214
-#define IEEE80211_FCTL_ORDER 0x8000
215
-
216
-#define IEEE80211_FTYPE_MGMT 0x0000
217
-#define IEEE80211_FTYPE_CTL 0x0004
218
-#define IEEE80211_FTYPE_DATA 0x0008
219
-
220
-/* management */
221
-#define IEEE80211_STYPE_ASSOC_REQ 0x0000
222
-#define IEEE80211_STYPE_ASSOC_RESP 0x0010
223
-#define IEEE80211_STYPE_REASSOC_REQ 0x0020
224
-#define IEEE80211_STYPE_REASSOC_RESP 0x0030
225
-#define IEEE80211_STYPE_PROBE_REQ 0x0040
226
-#define IEEE80211_STYPE_PROBE_RESP 0x0050
227
-#define IEEE80211_STYPE_BEACON 0x0080
228
-#define IEEE80211_STYPE_ATIM 0x0090
229
-#define IEEE80211_STYPE_DISASSOC 0x00A0
230
-#define IEEE80211_STYPE_AUTH 0x00B0
231
-#define IEEE80211_STYPE_DEAUTH 0x00C0
232
-
233
-/* control */
234
-#define IEEE80211_STYPE_PSPOLL 0x00A0
235
-#define IEEE80211_STYPE_RTS 0x00B0
236
-#define IEEE80211_STYPE_CTS 0x00C0
237
-#define IEEE80211_STYPE_ACK 0x00D0
238
-#define IEEE80211_STYPE_CFEND 0x00E0
239
-#define IEEE80211_STYPE_CFENDACK 0x00F0
240
-
241
-/* data */
242
-#define IEEE80211_STYPE_DATA 0x0000
243
-#define IEEE80211_STYPE_DATA_CFACK 0x0010
244
-#define IEEE80211_STYPE_DATA_CFPOLL 0x0020
245
-#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030
246
-#define IEEE80211_STYPE_NULLFUNC 0x0040
247
-#define IEEE80211_STYPE_CFACK 0x0050
248
-#define IEEE80211_STYPE_CFPOLL 0x0060
249
-#define IEEE80211_STYPE_CFACKPOLL 0x0070
250
-#define IEEE80211_QOS_DATAGRP 0x0080
251
-
252
-#define IEEE80211_SCTL_FRAG 0x000F
253
-#define IEEE80211_SCTL_SEQ 0xFFF0
254
-
255102 /* QoS,QOS */
256103 #define NORMAL_ACK 0
257
-#define NO_ACK 1
258
-#define NON_EXPLICIT_ACK 2
259
-#define BLOCK_ACK 3
260
-
261
-#ifndef ETH_P_PAE
262
-#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
263
-#endif /* ETH_P_PAE */
264
-
265
-#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
266
-
267
-#define ETH_P_ECONET 0x0018
268
-
269
-#ifndef ETH_P_80211_RAW
270
-#define ETH_P_80211_RAW (ETH_P_ECONET + 1)
271
-#endif
272104
273105 /* IEEE 802.11 defines */
274106
....@@ -283,58 +115,6 @@
283115
284116 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
285117
286
-#define WLAN_FC_GET_TYPE(fc) ((fc) & IEEE80211_FCTL_FTYPE)
287
-#define WLAN_FC_GET_STYPE(fc) ((fc) & IEEE80211_FCTL_STYPE)
288
-
289
-#define WLAN_QC_GET_TID(qc) ((qc) & 0x0f)
290
-
291
-#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
292
-#define WLAN_GET_SEQ_SEQ(seq) ((seq) & IEEE80211_SCTL_SEQ)
293
-
294
-/* Authentication algorithms */
295
-#define WLAN_AUTH_OPEN 0
296
-#define WLAN_AUTH_SHARED_KEY 1
297
-
298
-#define WLAN_AUTH_CHALLENGE_LEN 128
299
-
300
-#define WLAN_CAPABILITY_BSS BIT(0)
301
-#define WLAN_CAPABILITY_IBSS BIT(1)
302
-#define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
303
-#define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
304
-#define WLAN_CAPABILITY_PRIVACY BIT(4)
305
-#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
306
-#define WLAN_CAPABILITY_PBCC BIT(6)
307
-#define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
308
-#define WLAN_CAPABILITY_SHORT_SLOT BIT(10)
309
-
310
-/* Information Element IDs */
311
-#define WLAN_EID_SSID 0
312
-#define WLAN_EID_SUPP_RATES 1
313
-#define WLAN_EID_FH_PARAMS 2
314
-#define WLAN_EID_DS_PARAMS 3
315
-#define WLAN_EID_CF_PARAMS 4
316
-#define WLAN_EID_TIM 5
317
-#define WLAN_EID_IBSS_PARAMS 6
318
-#define WLAN_EID_CHALLENGE 16
319
-#define WLAN_EID_RSN 48
320
-#define WLAN_EID_GENERIC 221
321
-
322
-#define IEEE80211_MGMT_HDR_LEN 24
323
-#define IEEE80211_DATA_HDR3_LEN 24
324
-#define IEEE80211_DATA_HDR4_LEN 30
325
-
326
-#define IEEE80211_STATMASK_SIGNAL BIT(0)
327
-#define IEEE80211_STATMASK_RSSI BIT(1)
328
-#define IEEE80211_STATMASK_NOISE BIT(2)
329
-#define IEEE80211_STATMASK_RATE BIT(3)
330
-#define IEEE80211_STATMASK_WEMASK 0x7
331
-
332
-#define IEEE80211_CCK_MODULATION BIT(0)
333
-#define IEEE80211_OFDM_MODULATION BIT(1)
334
-
335
-#define IEEE80211_24GHZ_BAND BIT(0)
336
-#define IEEE80211_52GHZ_BAND BIT(1)
337
-
338118 #define IEEE80211_CCK_RATE_LEN 4
339119 #define IEEE80211_NUM_OFDM_RATESLEN 8
340120
....@@ -342,7 +122,6 @@
342122 #define IEEE80211_CCK_RATE_2MB 0x04
343123 #define IEEE80211_CCK_RATE_5MB 0x0B
344124 #define IEEE80211_CCK_RATE_11MB 0x16
345
-#define IEEE80211_OFDM_RATE_LEN 8
346125 #define IEEE80211_OFDM_RATE_6MB 0x0C
347126 #define IEEE80211_OFDM_RATE_9MB 0x12
348127 #define IEEE80211_OFDM_RATE_12MB 0x18
....@@ -353,393 +132,22 @@
353132 #define IEEE80211_OFDM_RATE_54MB 0x6C
354133 #define IEEE80211_BASIC_RATE_MASK 0x80
355134
356
-#define IEEE80211_CCK_RATE_1MB_MASK BIT(0)
357
-#define IEEE80211_CCK_RATE_2MB_MASK BIT(1)
358
-#define IEEE80211_CCK_RATE_5MB_MASK BIT(2)
359
-#define IEEE80211_CCK_RATE_11MB_MASK BIT(3)
360
-#define IEEE80211_OFDM_RATE_6MB_MASK BIT(4)
361
-#define IEEE80211_OFDM_RATE_9MB_MASK BIT(5)
362
-#define IEEE80211_OFDM_RATE_12MB_MASK BIT(6)
363
-#define IEEE80211_OFDM_RATE_18MB_MASK BIT(7)
364
-#define IEEE80211_OFDM_RATE_24MB_MASK BIT(8)
365
-#define IEEE80211_OFDM_RATE_36MB_MASK BIT(9)
366
-#define IEEE80211_OFDM_RATE_48MB_MASK BIT(10)
367
-#define IEEE80211_OFDM_RATE_54MB_MASK BIT(11)
368
-
369
-#define IEEE80211_CCK_RATES_MASK 0x0000000F
370
-#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
371
- IEEE80211_CCK_RATE_2MB_MASK)
372
-#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
373
- IEEE80211_CCK_RATE_5MB_MASK | \
374
- IEEE80211_CCK_RATE_11MB_MASK)
375
-
376
-#define IEEE80211_OFDM_RATES_MASK 0x00000FF0
377
-#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
378
- IEEE80211_OFDM_RATE_12MB_MASK | \
379
- IEEE80211_OFDM_RATE_24MB_MASK)
380
-#define IEEE80211_OFDM_DEFAULT_RATES_MASK (IEEE80211_OFDM_BASIC_RATES_MASK | \
381
- IEEE80211_OFDM_RATE_9MB_MASK | \
382
- IEEE80211_OFDM_RATE_18MB_MASK | \
383
- IEEE80211_OFDM_RATE_36MB_MASK | \
384
- IEEE80211_OFDM_RATE_48MB_MASK | \
385
- IEEE80211_OFDM_RATE_54MB_MASK)
386
-#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
387
- IEEE80211_CCK_DEFAULT_RATES_MASK)
388
-
389
-#define IEEE80211_NUM_OFDM_RATES 8
390
-#define IEEE80211_NUM_CCK_RATES 4
391
-#define IEEE80211_OFDM_SHIFT_MASK_A 4
392
-
393
-/* NOTE: This data is for statistical purposes; not all hardware provides this
394
- * information for frames received. Not setting these will not cause
395
- * any adverse affects.
396
- */
397
-struct ieee80211_rx_stats {
398
- s8 rssi;
399
- u8 signal;
400
- u8 noise;
401
- u8 received_channel;
402
- u16 rate; /* in 100 kbps */
403
- u8 mask;
404
- u8 freq;
405
- u16 len;
406
-};
407
-
408
-/* IEEE 802.11 requires that STA supports concurrent reception of at least
409
- * three fragmented frames. This define can be increased to support more
410
- * concurrent frames, but it should be noted that each entry can consume about
411
- * 2 kB of RAM and increasing cache size will slow down frame reassembly.
412
- */
413
-#define IEEE80211_FRAG_CACHE_LEN 4
414
-
415
-struct ieee80211_frag_entry {
416
- u32 first_frag_time;
417
- uint seq;
418
- uint last_frag;
419
- uint qos; /*jackson*/
420
- uint tid; /*jackson*/
421
- struct sk_buff *skb;
422
- u8 src_addr[ETH_ALEN];
423
- u8 dst_addr[ETH_ALEN];
424
-};
425
-
426
-struct ieee80211_stats {
427
- uint tx_unicast_frames;
428
- uint tx_multicast_frames;
429
- uint tx_fragments;
430
- uint tx_unicast_octets;
431
- uint tx_multicast_octets;
432
- uint tx_deferred_transmissions;
433
- uint tx_single_retry_frames;
434
- uint tx_multiple_retry_frames;
435
- uint tx_retry_limit_exceeded;
436
- uint tx_discards;
437
- uint rx_unicast_frames;
438
- uint rx_multicast_frames;
439
- uint rx_fragments;
440
- uint rx_unicast_octets;
441
- uint rx_multicast_octets;
442
- uint rx_fcs_errors;
443
- uint rx_discards_no_buffer;
444
- uint tx_discards_wrong_sa;
445
- uint rx_discards_undecryptable;
446
- uint rx_message_in_msg_fragments;
447
- uint rx_message_in_bad_msg_fragments;
448
-};
449
-
450
-struct ieee80211_softmac_stats {
451
- uint rx_ass_ok;
452
- uint rx_ass_err;
453
- uint rx_probe_rq;
454
- uint tx_probe_rs;
455
- uint tx_beacons;
456
- uint rx_auth_rq;
457
- uint rx_auth_rs_ok;
458
- uint rx_auth_rs_err;
459
- uint tx_auth_rq;
460
- uint no_auth_rs;
461
- uint no_ass_rs;
462
- uint tx_ass_rq;
463
- uint rx_ass_rq;
464
- uint tx_probe_rq;
465
- uint reassoc;
466
- uint swtxstop;
467
- uint swtxawake;
468
-};
469
-
470
-#define SEC_KEY_1 BIT(0)
471
-#define SEC_KEY_2 BIT(1)
472
-#define SEC_KEY_3 BIT(2)
473
-#define SEC_KEY_4 BIT(3)
474
-#define SEC_ACTIVE_KEY BIT(4)
475
-#define SEC_AUTH_MODE BIT(5)
476
-#define SEC_UNICAST_GROUP BIT(6)
477
-#define SEC_LEVEL BIT(7)
478
-#define SEC_ENABLED BIT(8)
479
-
480
-#define SEC_LEVEL_0 0 /* None */
481
-#define SEC_LEVEL_1 1 /* WEP 40 and 104 bit */
482
-#define SEC_LEVEL_2 2 /* Level 1 + TKIP */
483
-#define SEC_LEVEL_2_CKIP 3 /* Level 1 + CKIP */
484
-#define SEC_LEVEL_3 4 /* Level 2 + CCMP */
485
-
486135 #define WEP_KEYS 4
487
-#define WEP_KEY_LEN 13
488136
489
-struct ieee80211_security {
490
- u16 active_key:2,
491
- enabled:1,
492
- auth_mode:2,
493
- auth_algo:4,
494
- unicast_uses_group:1;
495
- u8 key_sizes[WEP_KEYS];
496
- u8 keys[WEP_KEYS][WEP_KEY_LEN];
497
- u8 level;
498
- u16 flags;
499
-} __packed;
500
-
501
-/*
502
- *
503
- * 802.11 data frame from AP
504
- *
505
- * ,-------------------------------------------------------------------.
506
- * Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
507
- * |------|------|---------|---------|---------|------|---------|------|
508
- * Desc. | ctrl | dura | DA/RA | TA | SA | Sequ | frame | fcs |
509
- * | | tion | (BSSID) | | | ence | data | |
510
- * `-------------------------------------------------------------------'
511
- *
512
- * Total: 28-2340 bytes
513
- *
514
- */
515
-
516
-struct ieee80211_header_data {
517
- __le16 frame_ctl;
518
- __le16 duration_id;
519
- u8 addr1[6];
520
- u8 addr2[6];
521
- u8 addr3[6];
522
- __le16 seq_ctrl;
523
-} __packed __aligned(2);
524
-
525
-#define BEACON_PROBE_SSID_ID_POSITION 12
526
-
527
-/* Management Frame Information Element Types */
528
-#define MFIE_TYPE_SSID 0
529
-#define MFIE_TYPE_RATES 1
530
-#define MFIE_TYPE_FH_SET 2
531
-#define MFIE_TYPE_DS_SET 3
532
-#define MFIE_TYPE_CF_SET 4
533
-#define MFIE_TYPE_TIM 5
534
-#define MFIE_TYPE_IBSS_SET 6
535
-#define MFIE_TYPE_CHALLENGE 16
536
-#define MFIE_TYPE_ERP 42
537
-#define MFIE_TYPE_RSN 48
538
-#define MFIE_TYPE_RATES_EX 50
539
-#define MFIE_TYPE_GENERIC 221
540
-
541
-struct ieee80211_info_element_hdr {
542
- u8 id;
543
- u8 len;
544
-} __packed;
545
-
546
-struct ieee80211_info_element {
547
- u8 id;
548
- u8 len;
549
- u8 data[0];
550
-} __packed;
551
-
552
-/*
553
- * These are the data types that can make up management packets
554
- *
555
- __le16 auth_algorithm;
556
- __le16 auth_sequence;
557
- __le16 beacon_interval;
558
- __le16 capability;
559
- u8 current_ap[ETH_ALEN];
560
- __le16 listen_interval;
561
- struct {
562
- u16 association_id:14, reserved:2;
563
- } __packed;
564
- __le32 time_stamp[2];
565
- __le16 reason;
566
- __le16 status;
567
-*/
568
-
569
-#define IEEE80211_DEFAULT_TX_ESSID "Penguin"
570
-#define IEEE80211_DEFAULT_BASIC_RATE 10
571
-
572
-struct ieee80211_authentication {
573
- struct ieee80211_header_data header;
574
- __le16 algorithm;
575
- __le16 transaction;
576
- __le16 status;
577
-} __packed;
578
-
579
-struct ieee80211_probe_response {
580
- struct ieee80211_header_data header;
581
- __le32 time_stamp[2];
582
- __le16 beacon_interval;
583
- __le16 capability;
584
- struct ieee80211_info_element info_element;
585
-} __packed;
586
-
587
-struct ieee80211_probe_request {
588
- struct ieee80211_header_data header;
589
-} __packed;
590
-
591
-struct ieee80211_assoc_request_frame {
592
- struct ieee80211_hdr_3addr header;
593
- __le16 capability;
594
- __le16 listen_interval;
595
- struct ieee80211_info_element_hdr info_element;
596
-} __packed;
597
-
598
-struct ieee80211_assoc_response_frame {
599
- struct ieee80211_hdr_3addr header;
600
- __le16 capability;
601
- __le16 status;
602
- __le16 aid;
603
-} __packed;
604
-
605
-struct ieee80211_txb {
606
- u8 nr_frags;
607
- u8 encrypted;
608
- u16 reserved;
609
- u16 frag_size;
610
- u16 payload_size;
611
- struct sk_buff *fragments[0];
612
-};
613
-
614
-/* SWEEP TABLE ENTRIES NUMBER*/
615
-#define MAX_SWEEP_TAB_ENTRIES 42
616
-#define MAX_SWEEP_TAB_ENTRIES_PER_PACKET 7
617137 /* MAX_RATES_LENGTH needs to be 12. The spec says 8, and many APs
618138 * only use 8, and then use extended rates for the remaining supported
619139 * rates. Other APs, however, stick all of their supported rates on the
620140 * main rates information element...
621141 */
622142 #define MAX_RATES_LENGTH ((u8)12)
623
-#define MAX_RATES_EX_LENGTH ((u8)16)
624
-#define MAX_NETWORK_COUNT 128
625
-#define MAX_CHANNEL_NUMBER 161
626
-#define IEEE80211_SOFTMAC_SCAN_TIME 400
627
-/*(HZ / 2)*/
628
-#define IEEE80211_SOFTMAC_ASSOC_RETRY_TIME (HZ * 2)
629
-
630
-#define CRC_LENGTH 4U
631
-
632143 #define MAX_WPA_IE_LEN 128
633
-
634
-#define NETWORK_EMPTY_ESSID BIT(0)
635
-#define NETWORK_HAS_OFDM BIT(1)
636
-#define NETWORK_HAS_CCK BIT(2)
637
-
638
-#define IEEE80211_DTIM_MBCAST 4
639
-#define IEEE80211_DTIM_UCAST 2
640
-#define IEEE80211_DTIM_VALID 1
641
-#define IEEE80211_DTIM_INVALID 0
642
-
643
-#define IEEE80211_PS_DISABLED 0
644
-#define IEEE80211_PS_UNICAST IEEE80211_DTIM_UCAST
645
-#define IEEE80211_PS_MBCAST IEEE80211_DTIM_MBCAST
646
-#define IW_ESSID_MAX_SIZE 32
647
-/*
648
- * join_res:
649
- * -1: authentication fail
650
- * -2: association fail
651
- * > 0: TID
652
- */
653
-
654
-enum ieee80211_state {
655
- /* the card is not linked at all */
656
- IEEE80211_NOLINK = 0,
657
- /* IEEE80211_ASSOCIATING* are for BSS client mode
658
- * the driver shall not perform RX filtering unless
659
- * the state is LINKED.
660
- * The driver shall just check for the state LINKED and
661
- * defaults to NOLINK for ALL the other states (including
662
- * LINKED_SCANNING)
663
- */
664
- /* the association procedure will start (wq scheduling)*/
665
- IEEE80211_ASSOCIATING,
666
- IEEE80211_ASSOCIATING_RETRY,
667
- /* the association procedure is sending AUTH request*/
668
- IEEE80211_ASSOCIATING_AUTHENTICATING,
669
- /* the association procedure has successfully authenticated
670
- * and is sending association request
671
- */
672
- IEEE80211_ASSOCIATING_AUTHENTICATED,
673
- /* the link is ok. the card associated to a BSS or linked
674
- * to a ibss cell or acting as an AP and creating the bss
675
- */
676
- IEEE80211_LINKED,
677
- /* same as LINKED, but the driver shall apply RX filter
678
- * rules as we are in NO_LINK mode. As the card is still
679
- * logically linked, but it is doing a syncro site survey
680
- * then it will be back to LINKED state.
681
- */
682
- IEEE80211_LINKED_SCANNING,
683
-};
684
-
685
-#define DEFAULT_MAX_SCAN_AGE (15 * HZ)
686
-#define DEFAULT_FTS 2346
687
-
688
-#define CFG_IEEE80211_RESERVE_FCS BIT(0)
689
-#define CFG_IEEE80211_COMPUTE_FCS BIT(1)
690
-
691
-#define MAXTID 16
692
-
693
-#define IEEE_A BIT(0)
694
-#define IEEE_B BIT(1)
695
-#define IEEE_G BIT(2)
696
-#define IEEE_MODE_MASK (IEEE_A | IEEE_B | IEEE_G)
697
-
698
-static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
699
-{
700
- /* Single white space is for Linksys APs */
701
- if (essid_len == 1 && essid[0] == ' ')
702
- return 1;
703
- /* Otherwise, if the entire essid is 0, we assume it is hidden */
704
- while (essid_len) {
705
- essid_len--;
706
- if (essid[essid_len] != '\0')
707
- return 0;
708
- }
709
- return 1;
710
-}
711
-
712
-static inline int ieee80211_get_hdrlen(u16 fc)
713
-{
714
- int hdrlen = 24;
715
-
716
- switch (WLAN_FC_GET_TYPE(fc)) {
717
- case IEEE80211_FTYPE_DATA:
718
- if (fc & IEEE80211_QOS_DATAGRP)
719
- hdrlen += 2;
720
- if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))
721
- hdrlen += 6; /* Addr4 */
722
- break;
723
- case IEEE80211_FTYPE_CTL:
724
- switch (WLAN_FC_GET_STYPE(fc)) {
725
- case IEEE80211_STYPE_CTS:
726
- case IEEE80211_STYPE_ACK:
727
- hdrlen = 10;
728
- break;
729
- default:
730
- hdrlen = 16;
731
- break;
732
- }
733
- break;
734
- }
735
- return hdrlen;
736
-}
737144
738145 struct registry_priv;
739146
740147 u8 *r8712_set_ie(u8 *pbuf, sint index, uint len, u8 *source, uint *frlen);
741148 u8 *r8712_get_ie(u8 *pbuf, sint index, uint *len, sint limit);
742
-unsigned char *r8712_get_wpa_ie(unsigned char *pie, uint *rsn_ie_len, int limit);
149
+unsigned char *r8712_get_wpa_ie(unsigned char *pie, uint *rsn_ie_len,
150
+ int limit);
743151 unsigned char *r8712_get_wpa2_ie(unsigned char *pie, uint *rsn_ie_len,
744152 int limit);
745153 int r8712_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher,