external/modules/rtl8723au
Revision | 61de6bd146c8413759a9853d03baffe86c69ea52 (tree) |
---|---|
Time | 2013-12-10 01:32:09 |
Author | Jes Sorensen <Jes.Sorensen@redh...> |
Commiter | Larry Finger |
Make parts of ioctl_linux.c slightly less ugly
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
@@ -78,12 +78,31 @@ extern u8 key_2char2num(u8 hch, u8 lch); | ||
78 | 78 | extern u8 str_2char2num(u8 hch, u8 lch); |
79 | 79 | extern u8 convert_ip_addr(u8 hch, u8 mch, u8 lch); |
80 | 80 | |
81 | -u32 rtw_rates[] = {1000000,2000000,5500000,11000000, | |
82 | - 6000000,9000000,12000000,18000000,24000000,36000000,48000000,54000000}; | |
81 | +u32 rtw_rates[] = | |
82 | +{ | |
83 | + 1000000, | |
84 | + 2000000, | |
85 | + 5500000, | |
86 | + 11000000, | |
87 | + 6000000, | |
88 | + 9000000, | |
89 | + 12000000, | |
90 | + 18000000, | |
91 | + 24000000, | |
92 | + 36000000, | |
93 | + 48000000, | |
94 | + 54000000 | |
95 | +}; | |
83 | 96 | |
84 | -static const char * const iw_operation_mode[] = | |
97 | +static const char *const iw_operation_mode[] = | |
85 | 98 | { |
86 | - "Auto", "Ad-Hoc", "Managed", "Master", "Repeater", "Secondary", "Monitor" | |
99 | + "Auto", | |
100 | + "Ad-Hoc", | |
101 | + "Managed", | |
102 | + "Master", | |
103 | + "Repeater", | |
104 | + "Secondary", | |
105 | + "Monitor" | |
87 | 106 | }; |
88 | 107 | |
89 | 108 | static int hex2num_i(char c) |
@@ -142,17 +161,18 @@ static void indicate_wx_custom_event(struct rtw_adapter *padapter, char *msg) | ||
142 | 161 | union iwreq_data wrqu; |
143 | 162 | |
144 | 163 | if (strlen(msg) > IW_CUSTOM_MAX) { |
145 | - DBG_8723A("%s strlen(msg):%zu > IW_CUSTOM_MAX:%u\n", __func__ , strlen(msg), IW_CUSTOM_MAX); | |
164 | + DBG_8723A("%s strlen(msg):%zu > IW_CUSTOM_MAX:%u\n", | |
165 | + __func__ , strlen(msg), IW_CUSTOM_MAX); | |
146 | 166 | return; |
147 | 167 | } |
148 | 168 | |
149 | 169 | buff = kzalloc(IW_CUSTOM_MAX + 1, GFP_KERNEL); |
150 | - if(!buff) | |
170 | + if (!buff) | |
151 | 171 | return; |
152 | 172 | |
153 | 173 | memcpy(buff, msg, strlen(msg)); |
154 | 174 | |
155 | - memset(&wrqu,0,sizeof(wrqu)); | |
175 | + memset(&wrqu, 0, sizeof(wrqu)); | |
156 | 176 | wrqu.data.length = strlen(msg); |
157 | 177 | |
158 | 178 | DBG_8723A("%s %s\n", __func__, buff); |
@@ -161,7 +181,6 @@ static void indicate_wx_custom_event(struct rtw_adapter *padapter, char *msg) | ||
161 | 181 | #endif |
162 | 182 | |
163 | 183 | kfree(buff); |
164 | - | |
165 | 184 | } |
166 | 185 | |
167 | 186 |
@@ -170,20 +189,18 @@ static void request_wps_pbc_event(struct rtw_adapter *padapter) | ||
170 | 189 | u8 *buff, *p; |
171 | 190 | union iwreq_data wrqu; |
172 | 191 | |
173 | - | |
174 | 192 | buff = kzalloc(IW_CUSTOM_MAX, GFP_KERNEL); |
175 | 193 | if(!buff) |
176 | 194 | return; |
177 | 195 | |
178 | - p=buff; | |
196 | + p = buff; | |
197 | + p += sprintf(p, "WPS_PBC_START.request=TRUE"); | |
179 | 198 | |
180 | - p+=sprintf(p, "WPS_PBC_START.request=TRUE"); | |
181 | - | |
182 | - memset(&wrqu,0,sizeof(wrqu)); | |
199 | + memset(&wrqu, 0, sizeof(wrqu)); | |
183 | 200 | |
184 | 201 | wrqu.data.length = p-buff; |
185 | 202 | |
186 | - wrqu.data.length = (wrqu.data.length<IW_CUSTOM_MAX) ? wrqu.data.length:IW_CUSTOM_MAX; | |
203 | + wrqu.data.length = (wrqu.data.length < IW_CUSTOM_MAX) ? wrqu.data.length:IW_CUSTOM_MAX; | |
187 | 204 | |
188 | 205 | DBG_8723A("%s\n", __func__); |
189 | 206 |
@@ -191,17 +208,15 @@ static void request_wps_pbc_event(struct rtw_adapter *padapter) | ||
191 | 208 | wireless_send_event(padapter->pnetdev, IWEVCUSTOM, &wrqu, buff); |
192 | 209 | #endif |
193 | 210 | |
194 | - if(buff) { | |
211 | + if (buff) | |
195 | 212 | kfree(buff); |
196 | - } | |
197 | - | |
198 | 213 | } |
199 | 214 | |
200 | 215 | |
201 | 216 | void indicate_wx_scan_complete_event(struct rtw_adapter *padapter) |
202 | 217 | { |
203 | 218 | union iwreq_data wrqu; |
204 | - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | |
219 | + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; | |
205 | 220 | |
206 | 221 | memset(&wrqu, 0, sizeof(union iwreq_data)); |
207 | 222 |
@@ -221,7 +236,8 @@ void rtw_indicate_wx_assoc_event(struct rtw_adapter *padapter) | ||
221 | 236 | |
222 | 237 | wrqu.ap_addr.sa_family = ARPHRD_ETHER; |
223 | 238 | |
224 | - memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN); | |
239 | + memcpy(wrqu.ap_addr.sa_data, | |
240 | + pmlmepriv->cur_network.network.MacAddress, ETH_ALEN); | |
225 | 241 | |
226 | 242 | DBG_8723A_LEVEL(_drv_always_, "assoc success\n"); |
227 | 243 | #ifndef CONFIG_IOCTL_CFG80211 |
@@ -288,7 +304,7 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
288 | 304 | char *p; |
289 | 305 | u16 max_rate=0, rate, ht_cap=_FALSE; |
290 | 306 | u32 i = 0; |
291 | - char *current_val; | |
307 | + char *current_val; | |
292 | 308 | long rssi; |
293 | 309 | u8 bw_40MHz=0, short_GI=0; |
294 | 310 | u16 mcs_rate=0; |
@@ -299,43 +315,42 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
299 | 315 | |
300 | 316 | #ifdef CONFIG_P2P |
301 | 317 | #ifdef CONFIG_WFD |
302 | - if ( SCAN_RESULT_ALL == pwdinfo->wfd_info->scan_result_type ) | |
303 | - { | |
304 | - | |
305 | - } | |
306 | - else if ( ( SCAN_RESULT_P2P_ONLY == pwdinfo->wfd_info->scan_result_type ) || | |
307 | - ( SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type ) ) | |
318 | + if (pwdinfo->wfd_info->scan_result_type == SCAN_RESULT_ALL) { | |
319 | + } else if ((pwdinfo->wfd_info->scan_result_type == SCAN_RESULT_P2P_ONLY) || | |
320 | + (pwdinfo->wfd_info->scan_result_type == SCAN_RESULT_WFD_TYPE)) | |
308 | 321 | #endif // CONFIG_WFD |
309 | 322 | { |
310 | - if(!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) | |
311 | - { | |
323 | + if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { | |
312 | 324 | u32 blnGotP2PIE = _FALSE; |
313 | 325 | |
314 | - // User is doing the P2P device discovery | |
315 | - // The prefix of SSID should be "DIRECT-" and the IE should contains the P2P IE. | |
316 | - // If not, the driver should ignore this AP and go to the next AP. | |
317 | - | |
318 | - // Verifying the SSID | |
319 | - if (!memcmp(pnetwork->network.Ssid.Ssid, pwdinfo->p2p_wildcard_ssid, P2P_WILDCARD_SSID_LEN)) | |
320 | - { | |
321 | - u32 p2pielen = 0; | |
322 | - | |
323 | - if (pnetwork->network.Reserved[0] == 2) { // Probe Request | |
324 | - // Verifying the P2P IE | |
325 | - if ( rtw_get_p2p_ie( pnetwork->network.IEs, pnetwork->network.IELength, NULL, &p2pielen) ) | |
326 | - { | |
326 | + /* | |
327 | + * User is doing the P2P device discovery | |
328 | + * The prefix of SSID should be "DIRECT-" and the IE | |
329 | + * should contains the P2P IE. If not, the driver | |
330 | + * should ignore this AP and go to the next AP. | |
331 | + * | |
332 | + * Verifying the SSID | |
333 | + */ | |
334 | + if (!memcmp(pnetwork->network.Ssid.Ssid, | |
335 | + pwdinfo->p2p_wildcard_ssid, | |
336 | + P2P_WILDCARD_SSID_LEN)) { | |
337 | + u32 p2pielen = 0; | |
338 | + | |
339 | + /* Probe Request */ | |
340 | + if (pnetwork->network.Reserved[0] == 2) { | |
341 | + /* Verifying the P2P IE */ | |
342 | + if (rtw_get_p2p_ie(pnetwork->network.IEs, pnetwork->network.IELength, NULL, &p2pielen)) { | |
327 | 343 | blnGotP2PIE = _TRUE; |
328 | 344 | } |
329 | - } else { // Beacon or Probe Respones | |
330 | - // Verifying the P2P IE | |
331 | - if ( rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen) ) | |
332 | - { | |
345 | + } else { /* Beacon or Probe Respones */ | |
346 | + /* Verifying the P2P IE */ | |
347 | + if (rtw_get_p2p_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, NULL, &p2pielen)) { | |
333 | 348 | blnGotP2PIE = _TRUE; |
334 | 349 | } |
335 | 350 | } |
336 | 351 | } |
337 | 352 | |
338 | - if ( blnGotP2PIE == _FALSE ) | |
353 | + if (blnGotP2PIE == _FALSE) | |
339 | 354 | { |
340 | 355 | return start; |
341 | 356 | } |
@@ -344,42 +359,54 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
344 | 359 | } |
345 | 360 | |
346 | 361 | #ifdef CONFIG_WFD |
347 | - if ( SCAN_RESULT_WFD_TYPE == pwdinfo->wfd_info->scan_result_type ) | |
348 | - { | |
362 | + if (pwdinfo->wfd_info->scan_result_type == SCAN_RESULT_WFD_TYPE) { | |
349 | 363 | u32 blnGotWFD = _FALSE; |
350 | - u8 wfd_ie[ 128 ] = { 0x00 }; | |
364 | + u8 wfd_ie[128] = {0x00}; | |
351 | 365 | uint wfd_ielen = 0; |
352 | 366 | |
353 | - if ( rtw_get_wfd_ie( &pnetwork->network.IEs[12], pnetwork->network.IELength - 12, wfd_ie, &wfd_ielen ) ) | |
354 | - { | |
355 | - u8 wfd_devinfo[ 6 ] = { 0x00 }; | |
367 | + if (rtw_get_wfd_ie(&pnetwork->network.IEs[12], | |
368 | + pnetwork->network.IELength - 12, | |
369 | + wfd_ie, &wfd_ielen)) { | |
370 | + u8 wfd_devinfo[6] = {0x00}; | |
356 | 371 | uint wfd_devlen = 6; |
357 | 372 | |
358 | - if ( rtw_get_wfd_attr_content( wfd_ie, wfd_ielen, WFD_ATTR_DEVICE_INFO, wfd_devinfo, &wfd_devlen) ) | |
359 | - { | |
360 | - if ( pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_PSINK ) | |
361 | - { | |
362 | - // the first two bits will indicate the WFD device type | |
363 | - if ( ( wfd_devinfo[ 1 ] & 0x03 ) == WFD_DEVINFO_SOURCE ) | |
364 | - { | |
365 | - // If this device is Miracast PSink device, the scan reuslt should just provide the Miracast source. | |
373 | + if (rtw_get_wfd_attr_content(wfd_ie, wfd_ielen, | |
374 | + WFD_ATTR_DEVICE_INFO, | |
375 | + wfd_devinfo, | |
376 | + &wfd_devlen)) { | |
377 | + if (pwdinfo->wfd_info->wfd_device_type == | |
378 | + WFD_DEVINFO_PSINK) { | |
379 | + /* the first two bits will indicate | |
380 | + the WFD device type */ | |
381 | + if ((wfd_devinfo[1] & 0x03) == | |
382 | + WFD_DEVINFO_SOURCE) { | |
383 | + /* If this device is Miracast | |
384 | + * PSink device, the scan | |
385 | + * reuslt should just provide | |
386 | + * the Miracast source. */ | |
366 | 387 | blnGotWFD = _TRUE; |
367 | 388 | } |
368 | 389 | } |
369 | - else if ( pwdinfo->wfd_info->wfd_device_type == WFD_DEVINFO_SOURCE ) | |
370 | - { | |
371 | - // the first two bits will indicate the WFD device type | |
372 | - if ( ( wfd_devinfo[ 1 ] & 0x03 ) == WFD_DEVINFO_PSINK ) | |
373 | - { | |
374 | - // If this device is Miracast source device, the scan reuslt should just provide the Miracast PSink. | |
375 | - // Todo: How about the SSink?! | |
390 | + else if (pwdinfo->wfd_info->wfd_device_type == | |
391 | + WFD_DEVINFO_SOURCE) { | |
392 | + /* the first two bits will indicate | |
393 | + the WFD device type */ | |
394 | + if ((wfd_devinfo[1] & 0x03) == | |
395 | + WFD_DEVINFO_PSINK) { | |
396 | + /* | |
397 | + * If this device is Miracast | |
398 | + * source device, the scan | |
399 | + * reuslt should just provide | |
400 | + * the Miracast PSink. | |
401 | + * Todo: How about the SSink?! | |
402 | + */ | |
376 | 403 | blnGotWFD = _TRUE; |
377 | 404 | } |
378 | 405 | } |
379 | 406 | } |
380 | 407 | } |
381 | 408 | |
382 | - if ( blnGotWFD == _FALSE ) | |
409 | + if (blnGotWFD == _FALSE) | |
383 | 410 | { |
384 | 411 | return start; |
385 | 412 | } |
@@ -398,50 +425,48 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
398 | 425 | /* Add the ESSID */ |
399 | 426 | iwe.cmd = SIOCGIWESSID; |
400 | 427 | iwe.u.data.flags = 1; |
401 | - iwe.u.data.length = min((u16)pnetwork->network.Ssid.SsidLength, (u16)32); | |
402 | - start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid); | |
428 | + iwe.u.data.length = min((u16)pnetwork->network.Ssid.SsidLength, | |
429 | + (u16)32); | |
430 | + start = iwe_stream_add_point(info, start, stop, &iwe, | |
431 | + pnetwork->network.Ssid.Ssid); | |
403 | 432 | |
404 | 433 | //parsing HT_CAP_IE |
405 | - p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, &ht_ielen, pnetwork->network.IELength-12); | |
434 | + p = rtw_get_ie(&pnetwork->network.IEs[12], _HT_CAPABILITY_IE_, | |
435 | + &ht_ielen, pnetwork->network.IELength - 12); | |
406 | 436 | |
407 | - if(p && ht_ielen>0) | |
437 | + if (p && ht_ielen>0) | |
408 | 438 | { |
409 | 439 | struct ieee80211_ht_cap *pht_capie; |
410 | 440 | ht_cap = _TRUE; |
411 | 441 | pht_capie = (struct ieee80211_ht_cap *)(p+2); |
412 | 442 | memcpy(&mcs_rate , &pht_capie->mcs, 2); |
413 | - bw_40MHz = (pht_capie->cap_info & IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; | |
414 | - short_GI = (pht_capie->cap_info&(IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0; | |
443 | + bw_40MHz = (pht_capie->cap_info & | |
444 | + IEEE80211_HT_CAP_SUP_WIDTH_20_40) ? 1:0; | |
445 | + short_GI = (pht_capie->cap_info & | |
446 | + (IEEE80211_HT_CAP_SGI_20|IEEE80211_HT_CAP_SGI_40)) ? 1:0; | |
415 | 447 | } |
416 | 448 | |
417 | 449 | /* Add the protocol name */ |
418 | 450 | iwe.cmd = SIOCGIWNAME; |
419 | - if ((rtw_is_cckratesonly_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE) | |
420 | - { | |
421 | - if(ht_cap == _TRUE) | |
451 | + if ((rtw_is_cckratesonly_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE) { | |
452 | + if (ht_cap == _TRUE) | |
422 | 453 | snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bn"); |
423 | 454 | else |
424 | - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b"); | |
425 | - } | |
426 | - else if ((rtw_is_cckrates_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE) | |
427 | - { | |
455 | + snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11b"); | |
456 | + } else if ((rtw_is_cckrates_included((u8*)&pnetwork->network.SupportedRates)) == _TRUE) { | |
428 | 457 | if(ht_cap == _TRUE) |
429 | 458 | snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bgn"); |
430 | 459 | else |
431 | - snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg"); | |
432 | - } | |
433 | - else | |
434 | - { | |
435 | - if(pnetwork->network.Configuration.DSConfig > 14) | |
460 | + snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11bg"); | |
461 | + } else { | |
462 | + if (pnetwork->network.Configuration.DSConfig > 14) | |
436 | 463 | { |
437 | 464 | if(ht_cap == _TRUE) |
438 | 465 | snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11an"); |
439 | 466 | else |
440 | 467 | snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11a"); |
441 | - } | |
442 | - else | |
443 | - { | |
444 | - if(ht_cap == _TRUE) | |
468 | + } else { | |
469 | + if (ht_cap == _TRUE) | |
445 | 470 | snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11gn"); |
446 | 471 | else |
447 | 472 | snprintf(iwe.u.name, IFNAMSIZ, "IEEE 802.11g"); |
@@ -452,26 +477,29 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
452 | 477 | |
453 | 478 | /* Add mode */ |
454 | 479 | iwe.cmd = SIOCGIWMODE; |
455 | - memcpy((u8 *)&cap, rtw_get_capability_from_ie(pnetwork->network.IEs), 2); | |
480 | + memcpy((u8 *)&cap, | |
481 | + rtw_get_capability_from_ie(pnetwork->network.IEs), 2); | |
456 | 482 | |
457 | 483 | |
458 | 484 | cap = le16_to_cpu(cap); |
459 | 485 | |
460 | - if(cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_ESS)){ | |
486 | + if (cap & (WLAN_CAPABILITY_IBSS |WLAN_CAPABILITY_ESS)) { | |
461 | 487 | if (cap & WLAN_CAPABILITY_ESS) |
462 | 488 | iwe.u.mode = IW_MODE_MASTER; |
463 | 489 | else |
464 | 490 | iwe.u.mode = IW_MODE_ADHOC; |
465 | 491 | |
466 | - start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_UINT_LEN); | |
492 | + start = iwe_stream_add_event(info, start, stop, &iwe, | |
493 | + IW_EV_UINT_LEN); | |
467 | 494 | } |
468 | 495 | |
469 | - if(pnetwork->network.Configuration.DSConfig<1 /*|| pnetwork->network.Configuration.DSConfig>14*/) | |
496 | + if (pnetwork->network.Configuration.DSConfig<1 /*|| pnetwork->network.Configuration.DSConfig>14*/) | |
470 | 497 | pnetwork->network.Configuration.DSConfig = 1; |
471 | 498 | |
472 | 499 | /* Add frequency/channel */ |
473 | 500 | iwe.cmd = SIOCGIWFREQ; |
474 | - iwe.u.freq.m = rtw_ch2freq(pnetwork->network.Configuration.DSConfig) * 100000; | |
501 | + iwe.u.freq.m = | |
502 | + rtw_ch2freq(pnetwork->network.Configuration.DSConfig) * 100000; | |
475 | 503 | iwe.u.freq.e = 1; |
476 | 504 | iwe.u.freq.i = pnetwork->network.Configuration.DSConfig; |
477 | 505 | start = iwe_stream_add_event(info, start, stop, &iwe, IW_EV_FREQ_LEN); |
@@ -483,14 +511,14 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
483 | 511 | else |
484 | 512 | iwe.u.data.flags = IW_ENCODE_DISABLED; |
485 | 513 | iwe.u.data.length = 0; |
486 | - start = iwe_stream_add_point(info, start, stop, &iwe, pnetwork->network.Ssid.Ssid); | |
514 | + start = iwe_stream_add_point(info, start, stop, &iwe, | |
515 | + pnetwork->network.Ssid.Ssid); | |
487 | 516 | |
488 | 517 | /*Add basic and extended rates */ |
489 | 518 | max_rate = 0; |
490 | 519 | p = custom; |
491 | 520 | p += snprintf(p, MAX_CUSTOM_LEN - (p - custom), " Rates (Mb/s): "); |
492 | - while(pnetwork->network.SupportedRates[i]!=0) | |
493 | - { | |
521 | + while (pnetwork->network.SupportedRates[i] != 0) { | |
494 | 522 | rate = pnetwork->network.SupportedRates[i]&0x7F; |
495 | 523 | if (rate > max_rate) |
496 | 524 | max_rate = rate; |
@@ -499,19 +527,17 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
499 | 527 | i++; |
500 | 528 | } |
501 | 529 | |
502 | - if(ht_cap == _TRUE) | |
530 | + if (ht_cap == _TRUE) | |
503 | 531 | { |
504 | - if(mcs_rate&0x8000)//MCS15 | |
532 | + if (mcs_rate & 0x8000)//MCS15 | |
505 | 533 | { |
506 | - max_rate = (bw_40MHz) ? ((short_GI)?300:270):((short_GI)?144:130); | |
534 | + max_rate = (bw_40MHz) ? | |
535 | + ((short_GI) ? 300 : 270) : ((short_GI)?144:130); | |
507 | 536 | |
508 | - } | |
509 | - else if(mcs_rate&0x0080)//MCS7 | |
537 | + } else if (mcs_rate & 0x0080)//MCS7 | |
510 | 538 | { |
511 | 539 | max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65); |
512 | - } | |
513 | - else//default MCS7 | |
514 | - { | |
540 | + } else { //default MCS7 | |
515 | 541 | //DBG_8723A("wx_get_scan, mcs_rate_bitmap=0x%x\n", mcs_rate); |
516 | 542 | max_rate = (bw_40MHz) ? ((short_GI)?150:135):((short_GI)?72:65); |
517 | 543 | } |
@@ -535,8 +561,7 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
535 | 561 | RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: ssid=%s\n",pnetwork->network.Ssid.Ssid)); |
536 | 562 | RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("rtw_wx_get_scan: wpa_len=%d rsn_len=%d\n",wpa_len,rsn_len)); |
537 | 563 | |
538 | - if (wpa_len > 0) | |
539 | - { | |
564 | + if (wpa_len > 0) { | |
540 | 565 | p=buf; |
541 | 566 | memset(buf, 0, MAX_WPA_IE_LEN); |
542 | 567 | p += sprintf(p, "wpa_ie="); |
@@ -547,15 +572,16 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
547 | 572 | memset(&iwe, 0, sizeof(iwe)); |
548 | 573 | iwe.cmd = IWEVCUSTOM; |
549 | 574 | iwe.u.data.length = strlen(buf); |
550 | - start = iwe_stream_add_point(info, start, stop, &iwe,buf); | |
575 | + start = iwe_stream_add_point(info, start, stop, | |
576 | + &iwe,buf); | |
551 | 577 | |
552 | 578 | memset(&iwe, 0, sizeof(iwe)); |
553 | 579 | iwe.cmd =IWEVGENIE; |
554 | 580 | iwe.u.data.length = wpa_len; |
555 | - start = iwe_stream_add_point(info, start, stop, &iwe, wpa_ie); | |
581 | + start = iwe_stream_add_point(info, start, stop, | |
582 | + &iwe, wpa_ie); | |
556 | 583 | } |
557 | - if (rsn_len > 0) | |
558 | - { | |
584 | + if (rsn_len > 0) { | |
559 | 585 | p = buf; |
560 | 586 | memset(buf, 0, MAX_WPA_IE_LEN); |
561 | 587 | p += sprintf(p, "rsn_ie="); |
@@ -565,16 +591,19 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
565 | 591 | memset(&iwe, 0, sizeof(iwe)); |
566 | 592 | iwe.cmd = IWEVCUSTOM; |
567 | 593 | iwe.u.data.length = strlen(buf); |
568 | - start = iwe_stream_add_point(info, start, stop, &iwe,buf); | |
594 | + start = iwe_stream_add_point(info, start, stop, | |
595 | + &iwe,buf); | |
569 | 596 | |
570 | 597 | memset(&iwe, 0, sizeof(iwe)); |
571 | 598 | iwe.cmd =IWEVGENIE; |
572 | 599 | iwe.u.data.length = rsn_len; |
573 | - start = iwe_stream_add_point(info, start, stop, &iwe, rsn_ie); | |
600 | + start = iwe_stream_add_point(info, start, stop, | |
601 | + &iwe, rsn_ie); | |
574 | 602 | } |
575 | 603 | } |
576 | 604 | |
577 | - { //parsing WPS IE | |
605 | + /* parsing WPS IE */ | |
606 | + { | |
578 | 607 | uint cnt = 0,total_ielen; |
579 | 608 | u8 *wpsie_ptr=NULL; |
580 | 609 | uint wps_ielen = 0; |
@@ -602,13 +631,14 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
602 | 631 | /* Add quality statistics */ |
603 | 632 | iwe.cmd = IWEVQUAL; |
604 | 633 | iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_NOISE_INVALID |
605 | - #ifdef CONFIG_SIGNAL_DISPLAY_DBM | |
634 | +#ifdef CONFIG_SIGNAL_DISPLAY_DBM | |
606 | 635 | | IW_QUAL_DBM |
607 | - #endif | |
636 | +#endif | |
608 | 637 | ; |
609 | 638 | |
610 | - if ( check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE && | |
611 | - is_same_network(&pmlmepriv->cur_network.network, &pnetwork->network)) { | |
639 | + if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE && | |
640 | + is_same_network(&pmlmepriv->cur_network.network, | |
641 | + &pnetwork->network)) { | |
612 | 642 | ss = padapter->recvpriv.signal_strength; |
613 | 643 | sq = padapter->recvpriv.signal_qual; |
614 | 644 | } else { |
@@ -617,14 +647,14 @@ static char *translate_scan(struct rtw_adapter *padapter, | ||
617 | 647 | } |
618 | 648 | |
619 | 649 | |
620 | - #ifdef CONFIG_SIGNAL_DISPLAY_DBM | |
650 | +#ifdef CONFIG_SIGNAL_DISPLAY_DBM | |
621 | 651 | iwe.u.qual.level = (u8) translate_percentage_to_dbm(ss);//dbm |
622 | - #else | |
652 | +#else | |
623 | 653 | iwe.u.qual.level = (u8)ss;//% |
624 | - #ifdef CONFIG_BT_COEXIST | |
654 | +#ifdef CONFIG_BT_COEXIST | |
625 | 655 | BT_SignalCompensation(padapter, &iwe.u.qual.level, NULL); |
626 | - #endif // CONFIG_BT_COEXIST | |
627 | - #endif | |
656 | +#endif // CONFIG_BT_COEXIST | |
657 | +#endif | |
628 | 658 | |
629 | 659 | iwe.u.qual.qual = (u8)sq; // signal quality |
630 | 660 |