.. | .. |
---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0 */ |
---|
1 | 2 | /****************************************************************************** |
---|
2 | 3 | * 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. |
---|
11 | 4 | * |
---|
12 | 5 | * Contact Information: |
---|
13 | 6 | * wlanfae <wlanfae@realtek.com> |
---|
.. | .. |
---|
18 | 11 | #include "rtllib.h" |
---|
19 | 12 | |
---|
20 | 13 | 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; |
---|
24 | 17 | }; |
---|
25 | 18 | |
---|
26 | 19 | enum dot11d_state { |
---|
.. | .. |
---|
30 | 23 | }; |
---|
31 | 24 | |
---|
32 | 25 | /** |
---|
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. |
---|
35 | 28 | * @channel_map: holds channel values |
---|
36 | 29 | * 0 - invalid, |
---|
37 | 30 | * 1 - valid (active scan), |
---|
38 | 31 | * 2 - valid (passive scan) |
---|
39 | | - * @CountryIeSrcAddr - Source AP of the country IE |
---|
| 32 | + * @country_src_addr - Source AP of the country IE |
---|
40 | 33 | */ |
---|
41 | 34 | |
---|
42 | 35 | struct rt_dot11d_info { |
---|
43 | | - bool bEnabled; |
---|
| 36 | + bool enabled; |
---|
44 | 37 | |
---|
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; |
---|
49 | 42 | |
---|
50 | 43 | u8 channel_map[MAX_CHANNEL_NUMBER + 1]; |
---|
51 | | - u8 MaxTxPwrDbmList[MAX_CHANNEL_NUMBER + 1]; |
---|
| 44 | + u8 max_tx_power_list[MAX_CHANNEL_NUMBER + 1]; |
---|
52 | 45 | |
---|
53 | | - enum dot11d_state State; |
---|
| 46 | + enum dot11d_state state; |
---|
54 | 47 | }; |
---|
55 | 48 | |
---|
56 | | -static inline void cpMacAddr(unsigned char *des, unsigned char *src) |
---|
| 49 | +static inline void copy_mac_addr(unsigned char *des, unsigned char *src) |
---|
57 | 50 | { |
---|
58 | 51 | memcpy(des, src, 6); |
---|
59 | 52 | } |
---|
60 | 53 | |
---|
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)) |
---|
63 | 56 | |
---|
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) |
---|
68 | 61 | |
---|
69 | | -#define IS_EQUAL_CIE_SRC(__pIeeeDev, __pTa) \ |
---|
| 62 | +#define IS_EQUAL_CIE_SRC(__ieee_dev, __address) \ |
---|
70 | 63 | 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) |
---|
74 | 67 | |
---|
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) |
---|
78 | 71 | { |
---|
79 | | - GET_CIE_WATCHDOG(__pIeeeDev) = 0; |
---|
| 72 | + GET_CIE_WATCHDOG(__ieee_dev) = 0; |
---|
80 | 73 | } |
---|
81 | 74 | |
---|
82 | | -#define UPDATE_CIE_WATCHDOG(__pIeeeDev) (++GET_CIE_WATCHDOG(__pIeeeDev)) |
---|
| 75 | +#define UPDATE_CIE_WATCHDOG(__ieee_dev) (++GET_CIE_WATCHDOG(__ieee_dev)) |
---|
83 | 76 | |
---|
84 | 77 | 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); |
---|
90 | 83 | |
---|
91 | 84 | #endif |
---|