hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/staging/rtl8192u/ieee80211/ieee80211.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Merged with mainline ieee80211.h in Aug 2004. Original ieee802_11
34 * remains copyright by the original authors
....@@ -15,11 +16,6 @@
1516 *
1617 * Modified for Realtek's wi-fi cards by Andrea Merello
1718 * <andrea.merello@gmail.com>
18
- *
19
- * This program is free software; you can redistribute it and/or modify
20
- * it under the terms of the GNU General Public License version 2 as
21
- * published by the Free Software Foundation. See README and COPYING for
22
- * more details.
2319 */
2420 #ifndef IEEE80211_H
2521 #define IEEE80211_H
....@@ -173,9 +169,9 @@
173169 #define MGN_MCS14 0x8e
174170 #define MGN_MCS15 0x8f
175171
176
-#define aSifsTime ((priv->ieee80211->current_network.mode == IEEE_A || \
172
+#define aSifsTime ((priv->ieee80211->current_network.mode == IEEE_A || \
177173 priv->ieee80211->current_network.mode == IEEE_N_24G || \
178
- priv->ieee80211->current_network.mode == IEEE_N_5G) ? \
174
+ priv->ieee80211->current_network.mode == IEEE_N_5G) ? \
179175 16 : 10)
180176
181177 #define MGMT_QUEUE_NUM 5
....@@ -296,7 +292,7 @@
296292 #define ieee80211_wx_get_encode_ext ieee80211_wx_get_encode_ext_rsl
297293
298294
299
-typedef struct ieee_param {
295
+struct ieee_param {
300296 u32 cmd;
301297 u8 sta_addr[ETH_ALEN];
302298 union {
....@@ -323,7 +319,7 @@
323319 u8 key[0];
324320 } crypt;
325321 } u;
326
-} ieee_param;
322
+};
327323
328324
329325 // linux under 2.6.9 release may not support it, so modify it for common use
....@@ -391,7 +387,7 @@
391387 #define IEEE80211_STYPE_ACK 0x00D0
392388 #define IEEE80211_STYPE_CFEND 0x00E0
393389 #define IEEE80211_STYPE_CFENDACK 0x00F0
394
-#define IEEE80211_STYPE_BLOCKACK 0x0094
390
+#define IEEE80211_STYPE_BLOCKACK 0x0094
395391
396392 /* data */
397393 #define IEEE80211_STYPE_DATA 0x0000
....@@ -456,23 +452,23 @@
456452 printk(KERN_DEBUG "ieee80211: " fmt, ## args); } while (0)
457453 //wb added to debug out data buf
458454 //if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA
459
-#define IEEE80211_DEBUG_DATA(level, data, datalen) \
460
- do { if ((ieee80211_debug_level & (level)) == (level)) \
461
- { \
462
- int i; \
463
- u8 *pdata = (u8 *) data; \
464
- printk(KERN_DEBUG "ieee80211: %s()\n", __func__); \
465
- for (i = 0; i < (int)(datalen); i++) \
466
- { \
467
- printk("%2x ", pdata[i]); \
468
- if ((i + 1) % 16 == 0) printk("\n"); \
469
- } \
470
- printk("\n"); \
471
- } \
455
+#define IEEE80211_DEBUG_DATA(level, data, datalen) \
456
+ do { if ((ieee80211_debug_level & (level)) == (level)) \
457
+ { \
458
+ int i; \
459
+ u8 *pdata = (u8 *)data; \
460
+ printk(KERN_DEBUG "ieee80211: %s()\n", __func__); \
461
+ for (i = 0; i < (int)(datalen); i++) { \
462
+ printk("%2x ", pdata[i]); \
463
+ if ((i + 1) % 16 == 0) \
464
+ printk("\n"); \
465
+ } \
466
+ printk("\n"); \
467
+ } \
472468 } while (0)
473469 #else
474470 #define IEEE80211_DEBUG (level, fmt, args...) do {} while (0)
475
-#define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while(0)
471
+#define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while (0)
476472 #endif /* CONFIG_IEEE80211_DEBUG */
477473
478474 /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
....@@ -890,14 +886,14 @@
890886 struct rtl_80211_hdr {
891887 __le16 frame_ctl;
892888 __le16 duration_id;
893
- u8 payload[0];
889
+ u8 payload[];
894890 } __packed;
895891
896892 struct rtl_80211_hdr_1addr {
897893 __le16 frame_ctl;
898894 __le16 duration_id;
899895 u8 addr1[ETH_ALEN];
900
- u8 payload[0];
896
+ u8 payload[];
901897 } __packed;
902898
903899 struct rtl_80211_hdr_2addr {
....@@ -905,7 +901,7 @@
905901 __le16 duration_id;
906902 u8 addr1[ETH_ALEN];
907903 u8 addr2[ETH_ALEN];
908
- u8 payload[0];
904
+ u8 payload[];
909905 } __packed;
910906
911907 struct rtl_80211_hdr_3addr {
....@@ -915,7 +911,7 @@
915911 u8 addr2[ETH_ALEN];
916912 u8 addr3[ETH_ALEN];
917913 __le16 seq_ctl;
918
- u8 payload[0];
914
+ u8 payload[];
919915 } __packed;
920916
921917 struct rtl_80211_hdr_4addr {
....@@ -926,7 +922,7 @@
926922 u8 addr3[ETH_ALEN];
927923 __le16 seq_ctl;
928924 u8 addr4[ETH_ALEN];
929
- u8 payload[0];
925
+ u8 payload[];
930926 } __packed;
931927
932928 struct rtl_80211_hdr_3addrqos {
....@@ -955,7 +951,7 @@
955951 struct ieee80211_info_element {
956952 u8 id;
957953 u8 len;
958
- u8 data[0];
954
+ u8 data[];
959955 } __packed;
960956
961957 struct ieee80211_authentication {
....@@ -964,7 +960,7 @@
964960 __le16 transaction;
965961 __le16 status;
966962 /*challenge*/
967
- struct ieee80211_info_element info_element[0];
963
+ struct ieee80211_info_element info_element[];
968964 } __packed;
969965
970966 struct ieee80211_disassoc {
....@@ -975,7 +971,7 @@
975971 struct ieee80211_probe_request {
976972 struct rtl_80211_hdr_3addr header;
977973 /* SSID, supported rates */
978
- struct ieee80211_info_element info_element[0];
974
+ struct ieee80211_info_element info_element[];
979975 } __packed;
980976
981977 struct ieee80211_probe_response {
....@@ -986,7 +982,7 @@
986982 /* SSID, supported rates, FH params, DS params,
987983 * CF params, IBSS params, TIM (if beacon), RSN
988984 */
989
- struct ieee80211_info_element info_element[0];
985
+ struct ieee80211_info_element info_element[];
990986 } __packed;
991987
992988 /* Alias beacon for probe_response */
....@@ -997,7 +993,7 @@
997993 __le16 capability;
998994 __le16 listen_interval;
999995 /* SSID, supported rates, RSN */
1000
- struct ieee80211_info_element info_element[0];
996
+ struct ieee80211_info_element info_element[];
1001997 } __packed;
1002998
1003999 struct ieee80211_reassoc_request_frame {
....@@ -1006,7 +1002,7 @@
10061002 __le16 listen_interval;
10071003 u8 current_ap[ETH_ALEN];
10081004 /* SSID, supported rates, RSN */
1009
- struct ieee80211_info_element info_element[0];
1005
+ struct ieee80211_info_element info_element[];
10101006 } __packed;
10111007
10121008 struct ieee80211_assoc_response_frame {
....@@ -1014,7 +1010,7 @@
10141010 __le16 capability;
10151011 __le16 status;
10161012 __le16 aid;
1017
- struct ieee80211_info_element info_element[0]; /* supported rates */
1013
+ struct ieee80211_info_element info_element[]; /* supported rates */
10181014 } __packed;
10191015
10201016 struct ieee80211_txb {
....@@ -1025,7 +1021,7 @@
10251021 u16 reserved;
10261022 __le16 frag_size;
10271023 __le16 payload_size;
1028
- struct sk_buff *fragments[0];
1024
+ struct sk_buff *fragments[];
10291025 };
10301026
10311027 #define MAX_TX_AGG_COUNT 16
....@@ -1329,8 +1325,13 @@
13291325
13301326 struct ieee80211_network {
13311327 /* These entries are used to identify a unique network */
1332
- u8 bssid[ETH_ALEN];
1328
+ u8 bssid[ETH_ALEN]; /* u16 aligned! */
13331329 u8 channel;
1330
+
1331
+ // CCXv4 S59, MBSSID.
1332
+ bool bMBssidValid;
1333
+ u8 MBssid[ETH_ALEN]; /* u16 aligned! */
1334
+ u8 MBssidMask;
13341335 /* Ensure null-terminated for any debug msgs */
13351336 u8 ssid[IW_ESSID_MAX_SIZE + 1];
13361337 u8 ssid_len;
....@@ -1341,10 +1342,6 @@
13411342 bool bCkipSupported;
13421343 bool bCcxRmEnable;
13431344 u16 CcxRmState[2];
1344
- // CCXv4 S59, MBSSID.
1345
- bool bMBssidValid;
1346
- u8 MBssidMask;
1347
- u8 MBssid[6];
13481345 // CCX 2 S38, WLAN Device Version Number element. Annie, 2006-08-20.
13491346 bool bWithCcxVerNum;
13501347 u8 BssCcxVerNumber;
....@@ -1461,23 +1458,23 @@
14611458 struct ieee80211_txb *txb;
14621459 };
14631460
1464
-typedef struct _bandwidth_autoswitch {
1461
+struct bandwidth_autoswitch {
14651462 long threshold_20Mhzto40Mhz;
14661463 long threshold_40Mhzto20Mhz;
14671464 bool bforced_tx20Mhz;
14681465 bool bautoswitch_enable;
1469
-} bandwidth_autoswitch, *pbandwidth_autoswitch;
1466
+};
14701467
14711468
14721469 //added by amy for order
14731470
14741471 #define REORDER_WIN_SIZE 128
14751472 #define REORDER_ENTRY_NUM 128
1476
-typedef struct _RX_REORDER_ENTRY {
1473
+struct rx_reorder_entry {
14771474 struct list_head List;
14781475 u16 SeqNum;
14791476 struct ieee80211_rxb *prxb;
1480
-} RX_REORDER_ENTRY, *PRX_REORDER_ENTRY;
1477
+};
14811478 //added by amy for order
14821479 typedef enum _Fsync_State {
14831480 Default_Fsync,
....@@ -1505,9 +1502,9 @@
15051502 RT_NO_ACTION = 4,
15061503 } RT_JOIN_ACTION;
15071504
1508
-typedef struct _IbssParms {
1505
+struct ibss_parms {
15091506 u16 atimWin;
1510
-} IbssParms, *PIbssParms;
1507
+};
15111508 #define MAX_NUM_RATES 264 // Max num of support rates element: 8, Max num of ext. support rate: 255. 061122, by rcnjko.
15121509
15131510 // RF state.
....@@ -1517,7 +1514,7 @@
15171514 eRfOff
15181515 } RT_RF_POWER_STATE;
15191516
1520
-typedef struct _RT_POWER_SAVE_CONTROL {
1517
+struct rt_power_save_control {
15211518
15221519 //
15231520 // Inactive Power Save(IPS) : Disable RF when disconnected
....@@ -1553,7 +1550,7 @@
15531550 struct octet_string tmpSuppRateSet;
15541551 u8 tmpSuppRateBuf[MAX_NUM_RATES];
15551552 bool bTmpSuppRate;
1556
- IbssParms tmpIbpm;
1553
+ struct ibss_parms tmpIbpm;
15571554 bool bTmpIbpm;
15581555
15591556 //
....@@ -1561,7 +1558,7 @@
15611558 //
15621559 bool bLeisurePs;
15631560
1564
-} RT_POWER_SAVE_CONTROL, *PRT_POWER_SAVE_CONTROL;
1561
+};
15651562
15661563 typedef u32 RT_RF_CHANGE_SOURCE;
15671564 #define RF_CHANGE_BY_SW BIT(31)
....@@ -1585,7 +1582,7 @@
15851582 } country_code_type_t;
15861583
15871584 #define RT_MAX_LD_SLOT_NUM 10
1588
-typedef struct _RT_LINK_DETECT_T {
1585
+struct rt_link_detect {
15891586
15901587 u32 NumRecvBcnInPeriod;
15911588 u32 NumRecvDataInPeriod;
....@@ -1598,7 +1595,7 @@
15981595 u32 NumTxOkInPeriod;
15991596 u32 NumRxOkInPeriod;
16001597 bool bBusyTraffic;
1601
-} RT_LINK_DETECT_T, *PRT_LINK_DETECT_T;
1598
+};
16021599
16031600
16041601 struct ieee80211_device {
....@@ -1652,10 +1649,8 @@
16521649 struct list_head Rx_TS_Pending_List;
16531650 struct list_head Rx_TS_Unused_List;
16541651 struct rx_ts_record RxTsRecord[TOTAL_TS_NUM];
1655
-//#ifdef TO_DO_LIST
1656
- RX_REORDER_ENTRY RxReorderEntry[128];
1652
+ struct rx_reorder_entry RxReorderEntry[128];
16571653 struct list_head RxReorder_Unused_List;
1658
-//#endif
16591654 // Qos related. Added by Annie, 2005-11-01.
16601655 // PSTA_QOS pStaQos;
16611656 u8 ForcedPriority; // Force per-packet priority 1~7. (default: 0, not to force it.)
....@@ -1771,7 +1766,7 @@
17711766
17721767 /* map of allowed channels. 0 is dummy */
17731768 // FIXME: remember to default to a basic channel plan depending of the PHY type
1774
- void *pDot11dInfo;
1769
+ void *dot11d_info;
17751770 bool bGlobalDomain;
17761771 int rate; /* current rate */
17771772 int basic_rate;
....@@ -1870,14 +1865,14 @@
18701865 Fsync_State fsync_state;
18711866 bool bis_any_nonbepkts;
18721867 //20Mhz 40Mhz AutoSwitch Threshold
1873
- bandwidth_autoswitch bandwidth_auto_switch;
1868
+ struct bandwidth_autoswitch bandwidth_auto_switch;
18741869 //for txpower tracking
18751870 bool FwRWRF;
18761871
18771872 //added by amy for AP roaming
1878
- RT_LINK_DETECT_T LinkDetectInfo;
1873
+ struct rt_link_detect LinkDetectInfo;
18791874 //added by amy for ps
1880
- RT_POWER_SAVE_CONTROL PowerSaveControl;
1875
+ struct rt_power_save_control PowerSaveControl;
18811876 //}
18821877 /* used if IEEE_SOFTMAC_TX_QUEUE is set */
18831878 struct tx_pending tx_pending;
....@@ -2012,14 +2007,14 @@
20122007 /* This must be the last item so that it points to the data
20132008 * allocated beyond this structure by alloc_ieee80211
20142009 */
2015
- u8 priv[0];
2010
+ u8 priv[];
20162011 };
20172012
20182013 #define IEEE_A (1<<0)
20192014 #define IEEE_B (1<<1)
20202015 #define IEEE_G (1<<2)
2021
-#define IEEE_N_24G (1<<4)
2022
-#define IEEE_N_5G (1<<5)
2016
+#define IEEE_N_24G (1<<4)
2017
+#define IEEE_N_5G (1<<5)
20232018 #define IEEE_MODE_MASK (IEEE_A | IEEE_B | IEEE_G)
20242019
20252020 /* Generate a 802.11 header */
....@@ -2378,11 +2373,8 @@
23782373 extern u8 MCS_FILTER_ALL[];
23792374 extern u16 MCS_DATA_RATE[2][2][77];
23802375 u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame);
2381
-//extern void HTSetConnectBwModeCallback(unsigned long data);
23822376 void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo);
23832377 bool IsHTHalfNmodeAPs(struct ieee80211_device *ieee);
2384
-u16 HTHalfMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate);
2385
-u16 HTMcsToDataRate(struct ieee80211_device *ieee, u8 nMcsRate);
23862378 u16 TxCountToDataRate(struct ieee80211_device *ieee, u8 nDataRate);
23872379 //function in BAPROC.c
23882380 int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb);
....@@ -2395,7 +2387,7 @@
23952387 void BaSetupTimeOut(struct timer_list *t);
23962388 void TxBaInactTimeout(struct timer_list *t);
23972389 void RxBaInactTimeout(struct timer_list *t);
2398
-void ResetBaEntry(PBA_RECORD pBA);
2390
+void ResetBaEntry(struct ba_record *pBA);
23992391 //function in TS.c
24002392 bool GetTs(
24012393 struct ieee80211_device *ieee,
....@@ -2432,7 +2424,7 @@
24322424 return escaped;
24332425 }
24342426
2435
- snprintf(escaped, sizeof(escaped), "%*pEn", essid_len, essid);
2427
+ snprintf(escaped, sizeof(escaped), "%*pE", essid_len, essid);
24362428 return escaped;
24372429 }
24382430