hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/staging/rtl8192u/ieee80211/dot11d.c
....@@ -3,42 +3,42 @@
33
44 #include "dot11d.h"
55
6
-void Dot11d_Init(struct ieee80211_device *ieee)
6
+void rtl8192u_dot11d_init(struct ieee80211_device *ieee)
77 {
8
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
8
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);
99
10
- pDot11dInfo->enabled = false;
10
+ dot11d_info->dot11d_enabled = false;
1111
12
- pDot11dInfo->state = DOT11D_STATE_NONE;
13
- pDot11dInfo->country_ie_len = 0;
14
- memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
15
- memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
12
+ dot11d_info->state = DOT11D_STATE_NONE;
13
+ dot11d_info->country_ie_len = 0;
14
+ memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
15
+ memset(dot11d_info->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
1616 RESET_CIE_WATCHDOG(ieee);
1717
18
- netdev_info(ieee->dev, "Dot11d_Init()\n");
18
+ netdev_info(ieee->dev, "rtl8192u_dot11d_init()\n");
1919 }
20
-EXPORT_SYMBOL(Dot11d_Init);
20
+EXPORT_SYMBOL(rtl8192u_dot11d_init);
2121
2222 /* Reset to the state as we are just entering a regulatory domain. */
23
-void Dot11d_Reset(struct ieee80211_device *ieee)
23
+void dot11d_reset(struct ieee80211_device *ieee)
2424 {
2525 u32 i;
26
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(ieee);
26
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee);
2727 /* Clear old channel map */
28
- memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
29
- memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
28
+ memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
29
+ memset(dot11d_info->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
3030 /* Set new channel map */
3131 for (i = 1; i <= 11; i++)
32
- (pDot11dInfo->channel_map)[i] = 1;
32
+ (dot11d_info->channel_map)[i] = 1;
3333
3434 for (i = 12; i <= 14; i++)
35
- (pDot11dInfo->channel_map)[i] = 2;
35
+ (dot11d_info->channel_map)[i] = 2;
3636
37
- pDot11dInfo->state = DOT11D_STATE_NONE;
38
- pDot11dInfo->country_ie_len = 0;
37
+ dot11d_info->state = DOT11D_STATE_NONE;
38
+ dot11d_info->country_ie_len = 0;
3939 RESET_CIE_WATCHDOG(ieee);
4040 }
41
-EXPORT_SYMBOL(Dot11d_Reset);
41
+EXPORT_SYMBOL(dot11d_reset);
4242
4343 /*
4444 * Update country IE from Beacon or Probe Resopnse and configure PHY for
....@@ -49,15 +49,15 @@
4949 * 1. IS_DOT11D_ENABLE() is TRUE.
5050 * 2. Input IE is an valid one.
5151 */
52
-void Dot11d_UpdateCountryIe(struct ieee80211_device *dev, u8 *pTaddr,
52
+void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr,
5353 u16 CoutryIeLen, u8 *pCoutryIe)
5454 {
55
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
55
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
5656 u8 i, j, NumTriples, MaxChnlNum;
5757 struct chnl_txpower_triple *pTriple;
5858
59
- memset(pDot11dInfo->channel_map, 0, MAX_CHANNEL_NUMBER+1);
60
- memset(pDot11dInfo->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER+1);
59
+ memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1);
60
+ memset(dot11d_info->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER + 1);
6161 MaxChnlNum = 0;
6262 NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */
6363 pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3);
....@@ -66,20 +66,20 @@
6666 /* It is not in a monotonically increasing order, so
6767 * stop processing.
6868 */
69
- netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........1\n");
69
+ netdev_err(dev->dev, "dot11d_update_country_ie(): Invalid country IE, skip it........1\n");
7070 return;
7171 }
7272 if (MAX_CHANNEL_NUMBER < (pTriple->first_channel + pTriple->num_channels)) {
7373 /* It is not a valid set of channel id, so stop
7474 * processing.
7575 */
76
- netdev_err(dev->dev, "Dot11d_UpdateCountryIe(): Invalid country IE, skip it........2\n");
76
+ netdev_err(dev->dev, "dot11d_update_country_ie(): Invalid country IE, skip it........2\n");
7777 return;
7878 }
7979
8080 for (j = 0; j < pTriple->num_channels; j++) {
81
- pDot11dInfo->channel_map[pTriple->first_channel + j] = 1;
82
- pDot11dInfo->max_tx_pwr_dbm_list[pTriple->first_channel + j] = pTriple->max_tx_pwr_dbm;
81
+ dot11d_info->channel_map[pTriple->first_channel + j] = 1;
82
+ dot11d_info->max_tx_pwr_dbm_list[pTriple->first_channel + j] = pTriple->max_tx_pwr_dbm;
8383 MaxChnlNum = pTriple->first_channel + j;
8484 }
8585
....@@ -87,90 +87,90 @@
8787 }
8888 netdev_info(dev->dev, "Channel List:");
8989 for (i = 1; i <= MAX_CHANNEL_NUMBER; i++)
90
- if (pDot11dInfo->channel_map[i] > 0)
90
+ if (dot11d_info->channel_map[i] > 0)
9191 netdev_info(dev->dev, " %d", i);
9292 netdev_info(dev->dev, "\n");
9393
9494 UPDATE_CIE_SRC(dev, pTaddr);
9595
96
- pDot11dInfo->country_ie_len = CoutryIeLen;
97
- memcpy(pDot11dInfo->country_ie_buf, pCoutryIe, CoutryIeLen);
98
- pDot11dInfo->state = DOT11D_STATE_LEARNED;
96
+ dot11d_info->country_ie_len = CoutryIeLen;
97
+ memcpy(dot11d_info->country_ie_buf, pCoutryIe, CoutryIeLen);
98
+ dot11d_info->state = DOT11D_STATE_LEARNED;
9999 }
100
-EXPORT_SYMBOL(Dot11d_UpdateCountryIe);
100
+EXPORT_SYMBOL(dot11d_update_country_ie);
101101
102
-u8 DOT11D_GetMaxTxPwrInDbm(struct ieee80211_device *dev, u8 Channel)
102
+u8 dot11d_get_max_tx_pwr_in_dbm(struct ieee80211_device *dev, u8 Channel)
103103 {
104
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
104
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
105105 u8 MaxTxPwrInDbm = 255;
106106
107107 if (Channel > MAX_CHANNEL_NUMBER) {
108
- netdev_err(dev->dev, "DOT11D_GetMaxTxPwrInDbm(): Invalid Channel\n");
108
+ netdev_err(dev->dev, "dot11d_get_max_tx_pwr_in_dbm(): Invalid Channel\n");
109109 return MaxTxPwrInDbm;
110110 }
111
- if (pDot11dInfo->channel_map[Channel])
112
- MaxTxPwrInDbm = pDot11dInfo->max_tx_pwr_dbm_list[Channel];
111
+ if (dot11d_info->channel_map[Channel])
112
+ MaxTxPwrInDbm = dot11d_info->max_tx_pwr_dbm_list[Channel];
113113
114114 return MaxTxPwrInDbm;
115115 }
116
-EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm);
116
+EXPORT_SYMBOL(dot11d_get_max_tx_pwr_in_dbm);
117117
118
-void DOT11D_ScanComplete(struct ieee80211_device *dev)
118
+void dot11d_scan_complete(struct ieee80211_device *dev)
119119 {
120
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
120
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
121121
122
- switch (pDot11dInfo->state) {
122
+ switch (dot11d_info->state) {
123123 case DOT11D_STATE_LEARNED:
124
- pDot11dInfo->state = DOT11D_STATE_DONE;
124
+ dot11d_info->state = DOT11D_STATE_DONE;
125125 break;
126126
127127 case DOT11D_STATE_DONE:
128128 if (GET_CIE_WATCHDOG(dev) == 0) {
129129 /* Reset country IE if previous one is gone. */
130
- Dot11d_Reset(dev);
130
+ dot11d_reset(dev);
131131 }
132132 break;
133133 case DOT11D_STATE_NONE:
134134 break;
135135 }
136136 }
137
-EXPORT_SYMBOL(DOT11D_ScanComplete);
137
+EXPORT_SYMBOL(dot11d_scan_complete);
138138
139
-int IsLegalChannel(struct ieee80211_device *dev, u8 channel)
139
+int is_legal_channel(struct ieee80211_device *dev, u8 channel)
140140 {
141
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
141
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
142142
143143 if (channel > MAX_CHANNEL_NUMBER) {
144
- netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
144
+ netdev_err(dev->dev, "is_legal_channel(): Invalid Channel\n");
145145 return 0;
146146 }
147
- if (pDot11dInfo->channel_map[channel] > 0)
147
+ if (dot11d_info->channel_map[channel] > 0)
148148 return 1;
149149 return 0;
150150 }
151
-EXPORT_SYMBOL(IsLegalChannel);
151
+EXPORT_SYMBOL(is_legal_channel);
152152
153
-int ToLegalChannel(struct ieee80211_device *dev, u8 channel)
153
+int to_legal_channel(struct ieee80211_device *dev, u8 channel)
154154 {
155
- struct rt_dot11d_info *pDot11dInfo = GET_DOT11D_INFO(dev);
155
+ struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(dev);
156156 u8 default_chn = 0;
157157 u32 i = 0;
158158
159159 for (i = 1; i <= MAX_CHANNEL_NUMBER; i++) {
160
- if (pDot11dInfo->channel_map[i] > 0) {
160
+ if (dot11d_info->channel_map[i] > 0) {
161161 default_chn = i;
162162 break;
163163 }
164164 }
165165
166166 if (channel > MAX_CHANNEL_NUMBER) {
167
- netdev_err(dev->dev, "IsLegalChannel(): Invalid Channel\n");
167
+ netdev_err(dev->dev, "is_legal_channel(): Invalid Channel\n");
168168 return default_chn;
169169 }
170170
171
- if (pDot11dInfo->channel_map[channel] > 0)
171
+ if (dot11d_info->channel_map[channel] > 0)
172172 return channel;
173173
174174 return default_chn;
175175 }
176
-EXPORT_SYMBOL(ToLegalChannel);
176
+EXPORT_SYMBOL(to_legal_channel);