hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/staging/rtl8192e/dot11d.h
....@@ -1,13 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /******************************************************************************
23 * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
3
- *
4
- * This program is distributed in the hope that it will be useful, but WITHOUT
5
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
6
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
7
- * more details.
8
- *
9
- * The full GNU General Public License is included in this distribution in the
10
- * file called LICENSE.
114 *
125 * Contact Information:
136 * wlanfae <wlanfae@realtek.com>
....@@ -18,9 +11,9 @@
1811 #include "rtllib.h"
1912
2013 struct chnl_txpow_triple {
21
- u8 FirstChnl;
22
- u8 NumChnls;
23
- u8 MaxTxPowerInDbm;
14
+ u8 first_channel;
15
+ u8 num_channels;
16
+ u8 max_tx_power;
2417 };
2518
2619 enum dot11d_state {
....@@ -30,62 +23,62 @@
3023 };
3124
3225 /**
33
- * struct rt_dot11d_info * @CountryIeLen: value greater than 0 if
34
- * @CountryIeBuf contains valid country information element.
26
+ * struct rt_dot11d_info * @country_len: value greater than 0 if
27
+ * @country_buffer contains valid country information element.
3528 * @channel_map: holds channel values
3629 * 0 - invalid,
3730 * 1 - valid (active scan),
3831 * 2 - valid (passive scan)
39
- * @CountryIeSrcAddr - Source AP of the country IE
32
+ * @country_src_addr - Source AP of the country IE
4033 */
4134
4235 struct rt_dot11d_info {
43
- bool bEnabled;
36
+ bool enabled;
4437
45
- u16 CountryIeLen;
46
- u8 CountryIeBuf[MAX_IE_LEN];
47
- u8 CountryIeSrcAddr[6];
48
- u8 CountryIeWatchdog;
38
+ u16 country_len;
39
+ u8 country_buffer[MAX_IE_LEN];
40
+ u8 country_src_addr[6];
41
+ u8 country_watchdog;
4942
5043 u8 channel_map[MAX_CHANNEL_NUMBER + 1];
51
- u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER + 1];
44
+ u8 max_tx_power_list[MAX_CHANNEL_NUMBER + 1];
5245
53
- enum dot11d_state State;
46
+ enum dot11d_state state;
5447 };
5548
56
-static inline void cpMacAddr(unsigned char *des, unsigned char *src)
49
+static inline void copy_mac_addr(unsigned char *des, unsigned char *src)
5750 {
5851 memcpy(des, src, 6);
5952 }
6053
61
-#define GET_DOT11D_INFO(__pIeeeDev) \
62
- ((struct rt_dot11d_info *)((__pIeeeDev)->pDot11dInfo))
54
+#define GET_DOT11D_INFO(__ieee_dev) \
55
+ ((struct rt_dot11d_info *)((__ieee_dev)->dot11d_info))
6356
64
-#define IS_DOT11D_ENABLE(__pIeeeDev) \
65
- (GET_DOT11D_INFO(__pIeeeDev)->bEnabled)
66
-#define IS_COUNTRY_IE_VALID(__pIeeeDev) \
67
- (GET_DOT11D_INFO(__pIeeeDev)->CountryIeLen > 0)
57
+#define IS_DOT11D_ENABLE(__ieee_dev) \
58
+ (GET_DOT11D_INFO(__ieee_dev)->enabled)
59
+#define IS_COUNTRY_IE_VALID(__ieee_dev) \
60
+ (GET_DOT11D_INFO(__ieee_dev)->country_len > 0)
6861
69
-#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \
62
+#define IS_EQUAL_CIE_SRC(__ieee_dev, __address) \
7063 ether_addr_equal_unaligned( \
71
- GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
72
-#define UPDATE_CIE_SRC(__pIeeeDev, __pTa) \
73
- cpMacAddr(GET_DOT11D_INFO(__pIeeeDev)->CountryIeSrcAddr, __pTa)
64
+ GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
65
+#define UPDATE_CIE_SRC(__ieee_dev, __address) \
66
+ copy_mac_addr(GET_DOT11D_INFO(__ieee_dev)->country_src_addr, __address)
7467
75
-#define GET_CIE_WATCHDOG(__pIeeeDev) \
76
- (GET_DOT11D_INFO(__pIeeeDev)->CountryIeWatchdog)
77
-static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__pIeeeDev)
68
+#define GET_CIE_WATCHDOG(__ieee_dev) \
69
+ (GET_DOT11D_INFO(__ieee_dev)->country_watchdog)
70
+static inline void RESET_CIE_WATCHDOG(struct rtllib_device *__ieee_dev)
7871 {
79
- GET_CIE_WATCHDOG(__pIeeeDev) = 0;
72
+ GET_CIE_WATCHDOG(__ieee_dev) = 0;
8073 }
8174
82
-#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev))
75
+#define UPDATE_CIE_WATCHDOG(__ieee_dev) (++GET_CIE_WATCHDOG(__ieee_dev))
8376
8477 void dot11d_init(struct rtllib_device *dev);
85
-void Dot11d_Channelmap(u8 channel_plan, struct rtllib_device *ieee);
86
-void Dot11d_Reset(struct rtllib_device *dev);
87
-void Dot11d_UpdateCountryIe(struct rtllib_device *dev, u8 *pTaddr,
88
- u16 CoutryIeLen, u8 *pCoutryIe);
89
-void DOT11D_ScanComplete(struct rtllib_device *dev);
78
+void dot11d_channel_map(u8 channel_plan, struct rtllib_device *ieee);
79
+void dot11d_reset(struct rtllib_device *dev);
80
+void dot11d_update_country(struct rtllib_device *dev, u8 *address,
81
+ u16 country_len, u8 *country);
82
+void dot11d_scan_complete(struct rtllib_device *dev);
9083
9184 #endif