diff options
author | Stephen Brennan <stephen@brennan.io> | 2019-08-21 10:35:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-21 12:20:23 -0400 |
commit | f401441deda68326852560bf70d59e95f585bbb3 (patch) | |
tree | ec9bb66c945286875f5db48632a864de811f8c10 | |
parent | 2b1d4c425ae548f3f8da11238abf59a08f1626b7 (diff) |
staging: rtl8192u: fix spacing in ieee80211
Checkpatch emits several errors, warnings, and checks about spacing.
Apply checkpatch's suggested spacing rules.
Signed-off-by: Stephen Brennan <stephen@brennan.io>
Link: https://lore.kernel.org/r/20190821143540.4501-4-stephen@brennan.io
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 files changed, 86 insertions, 86 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c b/drivers/staging/rtl8192u/ieee80211/dot11d.c index 130ddfe9868f..bc642076b96f 100644 --- a/drivers/staging/rtl8192u/ieee80211/dot11d.c +++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c | |||
@@ -12,7 +12,7 @@ void rtl8192u_dot11d_init(struct ieee80211_device *ieee) | |||
12 | dot11d_info->state = DOT11D_STATE_NONE; | 12 | dot11d_info->state = DOT11D_STATE_NONE; |
13 | dot11d_info->country_ie_len = 0; | 13 | dot11d_info->country_ie_len = 0; |
14 | memset(dot11d_info->channel_map, 0, MAX_CHANNEL_NUMBER + 1); | 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); | 15 | memset(dot11d_info->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER + 1); |
16 | RESET_CIE_WATCHDOG(ieee); | 16 | RESET_CIE_WATCHDOG(ieee); |
17 | 17 | ||
18 | netdev_info(ieee->dev, "rtl8192u_dot11d_init()\n"); | 18 | netdev_info(ieee->dev, "rtl8192u_dot11d_init()\n"); |
@@ -25,8 +25,8 @@ void dot11d_reset(struct ieee80211_device *ieee) | |||
25 | u32 i; | 25 | u32 i; |
26 | struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee); | 26 | struct rt_dot11d_info *dot11d_info = GET_DOT11D_INFO(ieee); |
27 | /* Clear old channel map */ | 27 | /* Clear old channel map */ |
28 | memset(dot11d_info->channel_map, 0, 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); | 29 | memset(dot11d_info->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER + 1); |
30 | /* Set new channel map */ | 30 | /* Set new channel map */ |
31 | for (i = 1; i <= 11; i++) | 31 | for (i = 1; i <= 11; i++) |
32 | (dot11d_info->channel_map)[i] = 1; | 32 | (dot11d_info->channel_map)[i] = 1; |
@@ -56,8 +56,8 @@ void dot11d_update_country_ie(struct ieee80211_device *dev, u8 *pTaddr, | |||
56 | u8 i, j, NumTriples, MaxChnlNum; | 56 | u8 i, j, NumTriples, MaxChnlNum; |
57 | struct chnl_txpower_triple *pTriple; | 57 | struct chnl_txpower_triple *pTriple; |
58 | 58 | ||
59 | memset(dot11d_info->channel_map, 0, 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); | 60 | memset(dot11d_info->max_tx_pwr_dbm_list, 0xFF, MAX_CHANNEL_NUMBER + 1); |
61 | MaxChnlNum = 0; | 61 | MaxChnlNum = 0; |
62 | NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */ | 62 | NumTriples = (CoutryIeLen - 3) / 3; /* skip 3-byte country string. */ |
63 | pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3); | 63 | pTriple = (struct chnl_txpower_triple *)(pCoutryIe + 3); |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 6b7828a9e71d..daebbbd8f4dd 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h | |||
@@ -456,7 +456,7 @@ do { if (ieee80211_debug_level & (level)) \ | |||
456 | do { if ((ieee80211_debug_level & (level)) == (level)) \ | 456 | do { if ((ieee80211_debug_level & (level)) == (level)) \ |
457 | { \ | 457 | { \ |
458 | int i; \ | 458 | int i; \ |
459 | u8 *pdata = (u8 *) data; \ | 459 | u8 *pdata = (u8 *)data; \ |
460 | printk(KERN_DEBUG "ieee80211: %s()\n", __func__); \ | 460 | printk(KERN_DEBUG "ieee80211: %s()\n", __func__); \ |
461 | for (i = 0; i < (int)(datalen); i++) { \ | 461 | for (i = 0; i < (int)(datalen); i++) { \ |
462 | printk("%2x ", pdata[i]); \ | 462 | printk("%2x ", pdata[i]); \ |
@@ -468,7 +468,7 @@ do { if (ieee80211_debug_level & (level)) \ | |||
468 | } while (0) | 468 | } while (0) |
469 | #else | 469 | #else |
470 | #define IEEE80211_DEBUG (level, fmt, args...) do {} while (0) | 470 | #define IEEE80211_DEBUG (level, fmt, args...) do {} while (0) |
471 | #define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while(0) | 471 | #define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while (0) |
472 | #endif /* CONFIG_IEEE80211_DEBUG */ | 472 | #endif /* CONFIG_IEEE80211_DEBUG */ |
473 | 473 | ||
474 | /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ | 474 | /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c index 36987fccac5d..01012dddcd73 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | |||
@@ -176,7 +176,7 @@ struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name) | |||
176 | } | 176 | } |
177 | 177 | ||
178 | 178 | ||
179 | static void *ieee80211_crypt_null_init(int keyidx) { return (void *) 1; } | 179 | static void *ieee80211_crypt_null_init(int keyidx) { return (void *)1; } |
180 | static void ieee80211_crypt_null_deinit(void *priv) {} | 180 | static void ieee80211_crypt_null_deinit(void *priv) {} |
181 | 181 | ||
182 | static struct ieee80211_crypto_ops ieee80211_crypt_null = { | 182 | static struct ieee80211_crypto_ops ieee80211_crypt_null = { |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index 0927b2b15151..6f4710171151 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | |||
@@ -160,7 +160,7 @@ static inline u16 Hi16(u32 val) | |||
160 | 160 | ||
161 | static inline u16 Mk16(u8 hi, u8 lo) | 161 | static inline u16 Mk16(u8 hi, u8 lo) |
162 | { | 162 | { |
163 | return lo | (((u16) hi) << 8); | 163 | return lo | (((u16)hi) << 8); |
164 | } | 164 | } |
165 | 165 | ||
166 | static const u16 Sbox[256] = { | 166 | static const u16 Sbox[256] = { |
@@ -238,7 +238,7 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK, | |||
238 | * Make temporary area overlap WEP seed so that the final copy can be | 238 | * Make temporary area overlap WEP seed so that the final copy can be |
239 | * avoided on little endian hosts. | 239 | * avoided on little endian hosts. |
240 | */ | 240 | */ |
241 | u16 *PPK = (u16 *) &WEPSeed[4]; | 241 | u16 *PPK = (u16 *)&WEPSeed[4]; |
242 | 242 | ||
243 | /* Step 1 - make copy of TTAK and bring in TSC */ | 243 | /* Step 1 - make copy of TTAK and bring in TSC */ |
244 | PPK[0] = TTAK[0]; | 244 | PPK[0] = TTAK[0]; |
@@ -299,7 +299,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
299 | skb->len < hdr_len) | 299 | skb->len < hdr_len) |
300 | return -1; | 300 | return -1; |
301 | 301 | ||
302 | hdr = (struct rtl_80211_hdr_4addr *) skb->data; | 302 | hdr = (struct rtl_80211_hdr_4addr *)skb->data; |
303 | 303 | ||
304 | if (!tcb_desc->bHwSec) { | 304 | if (!tcb_desc->bHwSec) { |
305 | if (!tkey->tx_phase1_done) { | 305 | if (!tkey->tx_phase1_done) { |
@@ -343,7 +343,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
343 | icv[2] = crc >> 16; | 343 | icv[2] = crc >> 16; |
344 | icv[3] = crc >> 24; | 344 | icv[3] = crc >> 24; |
345 | crypto_sync_skcipher_setkey(tkey->tx_tfm_arc4, rc4key, 16); | 345 | crypto_sync_skcipher_setkey(tkey->tx_tfm_arc4, rc4key, 16); |
346 | sg_init_one(&sg, pos, len+4); | 346 | sg_init_one(&sg, pos, len + 4); |
347 | skcipher_request_set_sync_tfm(req, tkey->tx_tfm_arc4); | 347 | skcipher_request_set_sync_tfm(req, tkey->tx_tfm_arc4); |
348 | skcipher_request_set_callback(req, 0, NULL, NULL); | 348 | skcipher_request_set_callback(req, 0, NULL, NULL); |
349 | skcipher_request_set_crypt(req, &sg, &sg, len + 4, NULL); | 349 | skcipher_request_set_crypt(req, &sg, &sg, len + 4, NULL); |
@@ -383,7 +383,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
383 | if (skb->len < hdr_len + 8 + 4) | 383 | if (skb->len < hdr_len + 8 + 4) |
384 | return -1; | 384 | return -1; |
385 | 385 | ||
386 | hdr = (struct rtl_80211_hdr_4addr *) skb->data; | 386 | hdr = (struct rtl_80211_hdr_4addr *)skb->data; |
387 | pos = skb->data + hdr_len; | 387 | pos = skb->data + hdr_len; |
388 | keyidx = pos[3]; | 388 | keyidx = pos[3]; |
389 | if (!(keyidx & BIT(5))) { | 389 | if (!(keyidx & BIT(5))) { |
@@ -435,7 +435,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
435 | plen = skb->len - hdr_len - 12; | 435 | plen = skb->len - hdr_len - 12; |
436 | 436 | ||
437 | crypto_sync_skcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16); | 437 | crypto_sync_skcipher_setkey(tkey->rx_tfm_arc4, rc4key, 16); |
438 | sg_init_one(&sg, pos, plen+4); | 438 | sg_init_one(&sg, pos, plen + 4); |
439 | 439 | ||
440 | skcipher_request_set_sync_tfm(req, tkey->rx_tfm_arc4); | 440 | skcipher_request_set_sync_tfm(req, tkey->rx_tfm_arc4); |
441 | skcipher_request_set_callback(req, 0, NULL, NULL); | 441 | skcipher_request_set_callback(req, 0, NULL, NULL); |
@@ -523,7 +523,7 @@ static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) | |||
523 | { | 523 | { |
524 | struct rtl_80211_hdr_4addr *hdr11; | 524 | struct rtl_80211_hdr_4addr *hdr11; |
525 | 525 | ||
526 | hdr11 = (struct rtl_80211_hdr_4addr *) skb->data; | 526 | hdr11 = (struct rtl_80211_hdr_4addr *)skb->data; |
527 | switch (le16_to_cpu(hdr11->frame_ctl) & | 527 | switch (le16_to_cpu(hdr11->frame_ctl) & |
528 | (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { | 528 | (IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS)) { |
529 | case IEEE80211_FCTL_TODS: | 529 | case IEEE80211_FCTL_TODS: |
@@ -556,7 +556,7 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri | |||
556 | u8 *pos; | 556 | u8 *pos; |
557 | struct rtl_80211_hdr_4addr *hdr; | 557 | struct rtl_80211_hdr_4addr *hdr; |
558 | 558 | ||
559 | hdr = (struct rtl_80211_hdr_4addr *) skb->data; | 559 | hdr = (struct rtl_80211_hdr_4addr *)skb->data; |
560 | 560 | ||
561 | if (skb_tailroom(skb) < 8 || skb->len < hdr_len) { | 561 | if (skb_tailroom(skb) < 8 || skb->len < hdr_len) { |
562 | printk(KERN_DEBUG "Invalid packet for Michael MIC add " | 562 | printk(KERN_DEBUG "Invalid packet for Michael MIC add " |
@@ -599,7 +599,7 @@ static void ieee80211_michael_mic_failure(struct net_device *dev, | |||
599 | memcpy(ev.src_addr.sa_data, hdr->addr2, ETH_ALEN); | 599 | memcpy(ev.src_addr.sa_data, hdr->addr2, ETH_ALEN); |
600 | memset(&wrqu, 0, sizeof(wrqu)); | 600 | memset(&wrqu, 0, sizeof(wrqu)); |
601 | wrqu.data.length = sizeof(ev); | 601 | wrqu.data.length = sizeof(ev); |
602 | wireless_send_event(dev, IWEVMICHAELMICFAILURE, &wrqu, (char *) &ev); | 602 | wireless_send_event(dev, IWEVMICHAELMICFAILURE, &wrqu, (char *)&ev); |
603 | } | 603 | } |
604 | 604 | ||
605 | static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, | 605 | static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, |
@@ -609,7 +609,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, | |||
609 | u8 mic[8]; | 609 | u8 mic[8]; |
610 | struct rtl_80211_hdr_4addr *hdr; | 610 | struct rtl_80211_hdr_4addr *hdr; |
611 | 611 | ||
612 | hdr = (struct rtl_80211_hdr_4addr *) skb->data; | 612 | hdr = (struct rtl_80211_hdr_4addr *)skb->data; |
613 | 613 | ||
614 | if (!tkey->key_set) | 614 | if (!tkey->key_set) |
615 | return -1; | 615 | return -1; |
@@ -626,7 +626,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, | |||
626 | return -1; | 626 | return -1; |
627 | if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { | 627 | if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { |
628 | struct rtl_80211_hdr_4addr *hdr; | 628 | struct rtl_80211_hdr_4addr *hdr; |
629 | hdr = (struct rtl_80211_hdr_4addr *) skb->data; | 629 | hdr = (struct rtl_80211_hdr_4addr *)skb->data; |
630 | 630 | ||
631 | printk(KERN_DEBUG "%s: Michael MIC verification failed for " | 631 | printk(KERN_DEBUG "%s: Michael MIC verification failed for " |
632 | "MSDU from %pM keyidx=%d\n", | 632 | "MSDU from %pM keyidx=%d\n", |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c index 805493a0870d..26482c3dcd1c 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c | |||
@@ -135,7 +135,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
135 | icv[3] = crc >> 24; | 135 | icv[3] = crc >> 24; |
136 | 136 | ||
137 | crypto_sync_skcipher_setkey(wep->tx_tfm, key, klen); | 137 | crypto_sync_skcipher_setkey(wep->tx_tfm, key, klen); |
138 | sg_init_one(&sg, pos, len+4); | 138 | sg_init_one(&sg, pos, len + 4); |
139 | 139 | ||
140 | skcipher_request_set_sync_tfm(req, wep->tx_tfm); | 140 | skcipher_request_set_sync_tfm(req, wep->tx_tfm); |
141 | skcipher_request_set_callback(req, 0, NULL, NULL); | 141 | skcipher_request_set_callback(req, 0, NULL, NULL); |
@@ -192,7 +192,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int hdr_len, void *priv) | |||
192 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, wep->rx_tfm); | 192 | SYNC_SKCIPHER_REQUEST_ON_STACK(req, wep->rx_tfm); |
193 | 193 | ||
194 | crypto_sync_skcipher_setkey(wep->rx_tfm, key, klen); | 194 | crypto_sync_skcipher_setkey(wep->rx_tfm, key, klen); |
195 | sg_init_one(&sg, pos, plen+4); | 195 | sg_init_one(&sg, pos, plen + 4); |
196 | 196 | ||
197 | skcipher_request_set_sync_tfm(req, wep->rx_tfm); | 197 | skcipher_request_set_sync_tfm(req, wep->rx_tfm); |
198 | skcipher_request_set_callback(req, 0, NULL, NULL); | 198 | skcipher_request_set_callback(req, 0, NULL, NULL); |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 9d8b2ff700fe..a1462ec55767 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | |||
@@ -1237,7 +1237,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | |||
1237 | && !is_multicast_ether_addr(hdr->addr1)) { | 1237 | && !is_multicast_ether_addr(hdr->addr1)) { |
1238 | TID = Frame_QoSTID(skb->data); | 1238 | TID = Frame_QoSTID(skb->data); |
1239 | SeqNum = WLAN_GET_SEQ_SEQ(sc); | 1239 | SeqNum = WLAN_GET_SEQ_SEQ(sc); |
1240 | GetTs(ieee, (struct ts_common_info **) &pTS, hdr->addr2, TID, RX_DIR, true); | 1240 | GetTs(ieee, (struct ts_common_info **)&pTS, hdr->addr2, TID, RX_DIR, true); |
1241 | if (TID != 0 && TID != 3) { | 1241 | if (TID != 0 && TID != 3) { |
1242 | ieee->bis_any_nonbepkts = true; | 1242 | ieee->bis_any_nonbepkts = true; |
1243 | } | 1243 | } |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c index 4a8d16a45fc5..b1baaa18b129 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | |||
@@ -42,8 +42,8 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info | |||
42 | 42 | ||
43 | /* if setting by freq convert to channel */ | 43 | /* if setting by freq convert to channel */ |
44 | if (fwrq->e == 1) { | 44 | if (fwrq->e == 1) { |
45 | if ((fwrq->m >= (int) 2.412e8 && | 45 | if ((fwrq->m >= (int)2.412e8 && |
46 | fwrq->m <= (int) 2.487e8)) { | 46 | fwrq->m <= (int)2.487e8)) { |
47 | int f = fwrq->m / 100000; | 47 | int f = fwrq->m / 100000; |
48 | int c = 0; | 48 | int c = 0; |
49 | 49 | ||
@@ -92,7 +92,7 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee, | |||
92 | if (ieee->current_network.channel == 0) | 92 | if (ieee->current_network.channel == 0) |
93 | return -1; | 93 | return -1; |
94 | /* NM 0.7.0 will not accept channel any more. */ | 94 | /* NM 0.7.0 will not accept channel any more. */ |
95 | fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 100000; | 95 | fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel - 1] * 100000; |
96 | fwrq->e = 1; | 96 | fwrq->e = 1; |
97 | /* fwrq->m = ieee->current_network.channel; */ | 97 | /* fwrq->m = ieee->current_network.channel; */ |
98 | /* fwrq->e = 0; */ | 98 | /* fwrq->e = 0; */ |
@@ -220,7 +220,7 @@ int ieee80211_wx_set_rate(struct ieee80211_device *ieee, | |||
220 | 220 | ||
221 | u32 target_rate = wrqu->bitrate.value; | 221 | u32 target_rate = wrqu->bitrate.value; |
222 | 222 | ||
223 | ieee->rate = target_rate/100000; | 223 | ieee->rate = target_rate / 100000; |
224 | /* FIXME: we might want to limit rate also in management protocols. */ | 224 | /* FIXME: we might want to limit rate also in management protocols. */ |
225 | return 0; | 225 | return 0; |
226 | } | 226 | } |
@@ -415,9 +415,9 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee, | |||
415 | 415 | ||
416 | if (wrqu->essid.flags && wrqu->essid.length) { | 416 | if (wrqu->essid.flags && wrqu->essid.length) { |
417 | /* first flush current network.ssid */ | 417 | /* first flush current network.ssid */ |
418 | len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE; | 418 | len = ((wrqu->essid.length - 1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length - 1) : IW_ESSID_MAX_SIZE; |
419 | strncpy(ieee->current_network.ssid, extra, len+1); | 419 | strncpy(ieee->current_network.ssid, extra, len + 1); |
420 | ieee->current_network.ssid_len = len+1; | 420 | ieee->current_network.ssid_len = len + 1; |
421 | ieee->ssid_set = 1; | 421 | ieee->ssid_set = 1; |
422 | } else { | 422 | } else { |
423 | ieee->ssid_set = 0; | 423 | ieee->ssid_set = 0; |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index c49357067735..e76bdedc8409 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | |||
@@ -294,7 +294,7 @@ static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, | |||
294 | struct tx_ts_record *pTxTs = NULL; | 294 | struct tx_ts_record *pTxTs = NULL; |
295 | struct rtl_80211_hdr_1addr *hdr = (struct rtl_80211_hdr_1addr *)skb->data; | 295 | struct rtl_80211_hdr_1addr *hdr = (struct rtl_80211_hdr_1addr *)skb->data; |
296 | 296 | ||
297 | if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) | 297 | if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) |
298 | return; | 298 | return; |
299 | if (!IsQoSDataFrame(skb->data)) | 299 | if (!IsQoSDataFrame(skb->data)) |
300 | return; | 300 | return; |
@@ -334,7 +334,7 @@ static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, | |||
334 | } | 334 | } |
335 | } | 335 | } |
336 | FORCED_AGG_SETTING: | 336 | FORCED_AGG_SETTING: |
337 | switch (pHTInfo->ForcedAMPDUMode ) { | 337 | switch (pHTInfo->ForcedAMPDUMode) { |
338 | case HT_AGG_AUTO: | 338 | case HT_AGG_AUTO: |
339 | break; | 339 | break; |
340 | 340 | ||
@@ -372,7 +372,7 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, struct cb_desc *tcb_ | |||
372 | 372 | ||
373 | tcb_desc->bUseShortGI = false; | 373 | tcb_desc->bUseShortGI = false; |
374 | 374 | ||
375 | if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) | 375 | if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) |
376 | return; | 376 | return; |
377 | 377 | ||
378 | if (pHTInfo->bForcedShortGI) { | 378 | if (pHTInfo->bForcedShortGI) { |
@@ -380,9 +380,9 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, struct cb_desc *tcb_ | |||
380 | return; | 380 | return; |
381 | } | 381 | } |
382 | 382 | ||
383 | if ((pHTInfo->bCurBW40MHz==true) && pHTInfo->bCurShortGI40MHz) | 383 | if ((pHTInfo->bCurBW40MHz == true) && pHTInfo->bCurShortGI40MHz) |
384 | tcb_desc->bUseShortGI = true; | 384 | tcb_desc->bUseShortGI = true; |
385 | else if ((pHTInfo->bCurBW40MHz==false) && pHTInfo->bCurShortGI20MHz) | 385 | else if ((pHTInfo->bCurBW40MHz == false) && pHTInfo->bCurShortGI20MHz) |
386 | tcb_desc->bUseShortGI = true; | 386 | tcb_desc->bUseShortGI = true; |
387 | } | 387 | } |
388 | 388 | ||
@@ -393,16 +393,16 @@ static void ieee80211_query_BandwidthMode(struct ieee80211_device *ieee, | |||
393 | 393 | ||
394 | tcb_desc->bPacketBW = false; | 394 | tcb_desc->bPacketBW = false; |
395 | 395 | ||
396 | if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) | 396 | if (!pHTInfo->bCurrentHTSupport || !pHTInfo->bEnableHT) |
397 | return; | 397 | return; |
398 | 398 | ||
399 | if (tcb_desc->bMulticast || tcb_desc->bBroadcast) | 399 | if (tcb_desc->bMulticast || tcb_desc->bBroadcast) |
400 | return; | 400 | return; |
401 | 401 | ||
402 | if ((tcb_desc->data_rate & 0x80)==0) // If using legacy rate, it shall use 20MHz channel. | 402 | if ((tcb_desc->data_rate & 0x80) == 0) // If using legacy rate, it shall use 20MHz channel. |
403 | return; | 403 | return; |
404 | //BandWidthAutoSwitch is for auto switch to 20 or 40 in long distance | 404 | //BandWidthAutoSwitch is for auto switch to 20 or 40 in long distance |
405 | if(pHTInfo->bCurBW40MHz && pHTInfo->bCurTxBW40MHz && !ieee->bandwidth_auto_switch.bforced_tx20Mhz) | 405 | if (pHTInfo->bCurBW40MHz && pHTInfo->bCurTxBW40MHz && !ieee->bandwidth_auto_switch.bforced_tx20Mhz) |
406 | tcb_desc->bPacketBW = true; | 406 | tcb_desc->bPacketBW = true; |
407 | return; | 407 | return; |
408 | } | 408 | } |
@@ -418,10 +418,10 @@ static void ieee80211_query_protectionmode(struct ieee80211_device *ieee, | |||
418 | tcb_desc->RTSSC = 0; // 20MHz: Don't care; 40MHz: Duplicate. | 418 | tcb_desc->RTSSC = 0; // 20MHz: Don't care; 40MHz: Duplicate. |
419 | tcb_desc->bRTSBW = false; // RTS frame bandwidth is always 20MHz | 419 | tcb_desc->bRTSBW = false; // RTS frame bandwidth is always 20MHz |
420 | 420 | ||
421 | if(tcb_desc->bBroadcast || tcb_desc->bMulticast)//only unicast frame will use rts/cts | 421 | if (tcb_desc->bBroadcast || tcb_desc->bMulticast) //only unicast frame will use rts/cts |
422 | return; | 422 | return; |
423 | 423 | ||
424 | if (is_broadcast_ether_addr(skb->data+16)) //check addr3 as infrastructure add3 is DA. | 424 | if (is_broadcast_ether_addr(skb->data + 16)) //check addr3 as infrastructure add3 is DA. |
425 | return; | 425 | return; |
426 | 426 | ||
427 | if (ieee->mode < IEEE_N_24G) /* b, g mode */ { | 427 | if (ieee->mode < IEEE_N_24G) /* b, g mode */ { |
@@ -451,9 +451,9 @@ static void ieee80211_query_protectionmode(struct ieee80211_device *ieee, | |||
451 | break; | 451 | break; |
452 | } | 452 | } |
453 | //check HT op mode | 453 | //check HT op mode |
454 | if(pHTInfo->bCurrentHTSupport && pHTInfo->bEnableHT) { | 454 | if (pHTInfo->bCurrentHTSupport && pHTInfo->bEnableHT) { |
455 | u8 HTOpMode = pHTInfo->CurrentOpMode; | 455 | u8 HTOpMode = pHTInfo->CurrentOpMode; |
456 | if((pHTInfo->bCurBW40MHz && (HTOpMode == 2 || HTOpMode == 3)) || | 456 | if ((pHTInfo->bCurBW40MHz && (HTOpMode == 2 || HTOpMode == 3)) || |
457 | (!pHTInfo->bCurBW40MHz && HTOpMode == 3)) { | 457 | (!pHTInfo->bCurBW40MHz && HTOpMode == 3)) { |
458 | tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. | 458 | tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. |
459 | tcb_desc->bRTSEnable = true; | 459 | tcb_desc->bRTSEnable = true; |
@@ -468,7 +468,7 @@ static void ieee80211_query_protectionmode(struct ieee80211_device *ieee, | |||
468 | } | 468 | } |
469 | //to do list: check MIMO power save condition. | 469 | //to do list: check MIMO power save condition. |
470 | //check AMPDU aggregation for TXOP | 470 | //check AMPDU aggregation for TXOP |
471 | if(tcb_desc->bAMPDUEnable) { | 471 | if (tcb_desc->bAMPDUEnable) { |
472 | tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. | 472 | tcb_desc->rts_rate = MGN_24M; // Rate is 24Mbps. |
473 | // According to 8190 design, firmware sends CF-End only if RTS/CTS is enabled. However, it degrads | 473 | // According to 8190 design, firmware sends CF-End only if RTS/CTS is enabled. However, it degrads |
474 | // throughput around 10M, so we disable of this mechanism. 2007.08.03 by Emily | 474 | // throughput around 10M, so we disable of this mechanism. 2007.08.03 by Emily |
@@ -476,7 +476,7 @@ static void ieee80211_query_protectionmode(struct ieee80211_device *ieee, | |||
476 | break; | 476 | break; |
477 | } | 477 | } |
478 | //check IOT action | 478 | //check IOT action |
479 | if(pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) { | 479 | if (pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) { |
480 | tcb_desc->bCTSEnable = true; | 480 | tcb_desc->bCTSEnable = true; |
481 | tcb_desc->rts_rate = MGN_24M; | 481 | tcb_desc->rts_rate = MGN_24M; |
482 | tcb_desc->bRTSEnable = true; | 482 | tcb_desc->bRTSEnable = true; |
@@ -517,7 +517,7 @@ static void ieee80211_txrate_selectmode(struct ieee80211_device *ieee, | |||
517 | return; | 517 | return; |
518 | } | 518 | } |
519 | 519 | ||
520 | if (pMgntInfo->ForcedDataRate!= 0) { | 520 | if (pMgntInfo->ForcedDataRate != 0) { |
521 | pTcb->bTxDisableRateFallBack = true; | 521 | pTcb->bTxDisableRateFallBack = true; |
522 | pTcb->bTxUseDriverAssingedRate = true; | 522 | pTcb->bTxUseDriverAssingedRate = true; |
523 | return; | 523 | return; |
@@ -576,7 +576,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
576 | /* If there is no driver handler to take the TXB, dont' bother | 576 | /* If there is no driver handler to take the TXB, dont' bother |
577 | * creating it... | 577 | * creating it... |
578 | */ | 578 | */ |
579 | if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE))|| | 579 | if ((!ieee->hard_start_xmit && !(ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)) || |
580 | ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) { | 580 | ((!ieee->softmac_data_hard_start_xmit && (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE)))) { |
581 | printk(KERN_WARNING "%s: No xmit handler.\n", | 581 | printk(KERN_WARNING "%s: No xmit handler.\n", |
582 | ieee->dev->name); | 582 | ieee->dev->name); |
@@ -615,7 +615,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
615 | 615 | ||
616 | /* Save source and destination addresses */ | 616 | /* Save source and destination addresses */ |
617 | memcpy(&dest, skb->data, ETH_ALEN); | 617 | memcpy(&dest, skb->data, ETH_ALEN); |
618 | memcpy(&src, skb->data+ETH_ALEN, ETH_ALEN); | 618 | memcpy(&src, skb->data + ETH_ALEN, ETH_ALEN); |
619 | 619 | ||
620 | /* Advance the SKB to the start of the payload */ | 620 | /* Advance the SKB to the start of the payload */ |
621 | skb_pull(skb, sizeof(struct ethhdr)); | 621 | skb_pull(skb, sizeof(struct ethhdr)); |
@@ -630,7 +630,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
630 | fc = IEEE80211_FTYPE_DATA; | 630 | fc = IEEE80211_FTYPE_DATA; |
631 | 631 | ||
632 | //if(ieee->current_network.QoS_Enable) | 632 | //if(ieee->current_network.QoS_Enable) |
633 | if(qos_actived) | 633 | if (qos_actived) |
634 | fc |= IEEE80211_STYPE_QOS_DATA; | 634 | fc |= IEEE80211_STYPE_QOS_DATA; |
635 | else | 635 | else |
636 | fc |= IEEE80211_STYPE_DATA; | 636 | fc |= IEEE80211_STYPE_DATA; |
@@ -724,7 +724,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
724 | for (i = 0; i < nr_frags; i++) { | 724 | for (i = 0; i < nr_frags; i++) { |
725 | skb_frag = txb->fragments[i]; | 725 | skb_frag = txb->fragments[i]; |
726 | tcb_desc = (struct cb_desc *)(skb_frag->cb + MAX_DEV_ADDR_SIZE); | 726 | tcb_desc = (struct cb_desc *)(skb_frag->cb + MAX_DEV_ADDR_SIZE); |
727 | if(qos_actived){ | 727 | if (qos_actived) { |
728 | skb_frag->priority = skb->priority;//UP2AC(skb->priority); | 728 | skb_frag->priority = skb->priority;//UP2AC(skb->priority); |
729 | tcb_desc->queue_index = UP2AC(skb->priority); | 729 | tcb_desc->queue_index = UP2AC(skb->priority); |
730 | } else { | 730 | } else { |
@@ -757,11 +757,11 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
757 | bytes = bytes_last_frag; | 757 | bytes = bytes_last_frag; |
758 | } | 758 | } |
759 | //if(ieee->current_network.QoS_Enable) | 759 | //if(ieee->current_network.QoS_Enable) |
760 | if(qos_actived) { | 760 | if (qos_actived) { |
761 | // add 1 only indicate to corresponding seq number control 2006/7/12 | 761 | // add 1 only indicate to corresponding seq number control 2006/7/12 |
762 | frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[UP2AC(skb->priority)+1]<<4 | i); | 762 | frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[UP2AC(skb->priority) + 1] << 4 | i); |
763 | } else { | 763 | } else { |
764 | frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0]<<4 | i); | 764 | frag_hdr->seq_ctl = cpu_to_le16(ieee->seq_ctrl[0] << 4 | i); |
765 | } | 765 | } |
766 | 766 | ||
767 | /* Put a SNAP header on the first fragment */ | 767 | /* Put a SNAP header on the first fragment */ |
@@ -806,7 +806,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
806 | } | 806 | } |
807 | 807 | ||
808 | txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC); | 808 | txb = ieee80211_alloc_txb(1, skb->len, GFP_ATOMIC); |
809 | if(!txb){ | 809 | if (!txb) { |
810 | printk(KERN_WARNING "%s: Could not allocate TXB\n", | 810 | printk(KERN_WARNING "%s: Could not allocate TXB\n", |
811 | ieee->dev->name); | 811 | ieee->dev->name); |
812 | goto failed; | 812 | goto failed; |
@@ -841,9 +841,9 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) | |||
841 | spin_unlock_irqrestore(&ieee->lock, flags); | 841 | spin_unlock_irqrestore(&ieee->lock, flags); |
842 | dev_kfree_skb_any(skb); | 842 | dev_kfree_skb_any(skb); |
843 | if (txb) { | 843 | if (txb) { |
844 | if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){ | 844 | if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE) { |
845 | ieee80211_softmac_xmit(txb, ieee); | 845 | ieee80211_softmac_xmit(txb, ieee); |
846 | }else{ | 846 | } else { |
847 | if ((*ieee->hard_start_xmit)(txb, dev) == 0) { | 847 | if ((*ieee->hard_start_xmit)(txb, dev) == 0) { |
848 | stats->tx_packets++; | 848 | stats->tx_packets++; |
849 | stats->tx_bytes += __le16_to_cpu(txb->payload_size); | 849 | stats->tx_bytes += __le16_to_cpu(txb->payload_size); |
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 8ad85331f020..8ca7a7fd74f9 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | |||
@@ -70,10 +70,10 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, | |||
70 | } | 70 | } |
71 | /* Add the protocol name */ | 71 | /* Add the protocol name */ |
72 | iwe.cmd = SIOCGIWNAME; | 72 | iwe.cmd = SIOCGIWNAME; |
73 | for(i=0; i<ARRAY_SIZE(ieee80211_modes); i++) { | 73 | for (i = 0; i < ARRAY_SIZE(ieee80211_modes); i++) { |
74 | if (network->mode & BIT(i)) { | 74 | if (network->mode & BIT(i)) { |
75 | sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size); | 75 | sprintf(pname, ieee80211_modes[i].mode_string, ieee80211_modes[i].mode_size); |
76 | pname +=ieee80211_modes[i].mode_size; | 76 | pname += ieee80211_modes[i].mode_size; |
77 | } | 77 | } |
78 | } | 78 | } |
79 | *pname = '\0'; | 79 | *pname = '\0'; |
@@ -138,13 +138,13 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, | |||
138 | ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[4]; | 138 | ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[4]; |
139 | else | 139 | else |
140 | ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0]; | 140 | ht_cap = (struct ht_capability_ele *)&network->bssht.bdHTCapBuf[0]; |
141 | is40M = (ht_cap->ChlWidth)?1:0; | 141 | is40M = (ht_cap->ChlWidth) ? 1 : 0; |
142 | isShortGI = (ht_cap->ChlWidth)? | 142 | isShortGI = (ht_cap->ChlWidth) ? |
143 | ((ht_cap->ShortGI40Mhz)?1:0): | 143 | ((ht_cap->ShortGI40Mhz) ? 1 : 0) : |
144 | ((ht_cap->ShortGI20Mhz)?1:0); | 144 | ((ht_cap->ShortGI20Mhz) ? 1 : 0); |
145 | 145 | ||
146 | max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL); | 146 | max_mcs = HTGetHighestMCSRate(ieee, ht_cap->MCS, MCS_FILTER_ALL); |
147 | rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs&0x7f]; | 147 | rate = MCS_DATA_RATE[is40M][isShortGI][max_mcs & 0x7f]; |
148 | if (rate > max_rate) | 148 | if (rate > max_rate) |
149 | max_rate = rate; | 149 | max_rate = rate; |
150 | } | 150 | } |
@@ -242,7 +242,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, | |||
242 | 242 | ||
243 | list_for_each_entry(network, &ieee->network_list, list) { | 243 | list_for_each_entry(network, &ieee->network_list, list) { |
244 | i++; | 244 | i++; |
245 | if((stop-ev)<200) { | 245 | if ((stop - ev) < 200) { |
246 | err = -E2BIG; | 246 | err = -E2BIG; |
247 | break; | 247 | break; |
248 | } | 248 | } |
@@ -453,7 +453,7 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee, | |||
453 | 453 | ||
454 | IEEE80211_DEBUG_WX("GET_ENCODE\n"); | 454 | IEEE80211_DEBUG_WX("GET_ENCODE\n"); |
455 | 455 | ||
456 | if(ieee->iw_mode == IW_MODE_MONITOR) | 456 | if (ieee->iw_mode == IW_MODE_MONITOR) |
457 | return -1; | 457 | return -1; |
458 | 458 | ||
459 | key = erq->flags & IW_ENCODE_INDEX; | 459 | key = erq->flags & IW_ENCODE_INDEX; |
@@ -570,7 +570,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, | |||
570 | ret = -EINVAL; | 570 | ret = -EINVAL; |
571 | goto done; | 571 | goto done; |
572 | } | 572 | } |
573 | printk("alg name:%s\n",alg); | 573 | printk("alg name:%s\n", alg); |
574 | 574 | ||
575 | ops = try_then_request_module(ieee80211_get_crypto_ops(alg), module); | 575 | ops = try_then_request_module(ieee80211_get_crypto_ops(alg), module); |
576 | if (!ops) { | 576 | if (!ops) { |
@@ -687,7 +687,7 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, | |||
687 | ext->key_len = 0; | 687 | ext->key_len = 0; |
688 | encoding->flags |= IW_ENCODE_DISABLED; | 688 | encoding->flags |= IW_ENCODE_DISABLED; |
689 | } else { | 689 | } else { |
690 | if (strcmp(crypt->ops->name, "WEP") == 0 ) | 690 | if (strcmp(crypt->ops->name, "WEP") == 0) |
691 | ext->alg = IW_ENCODE_ALG_WEP; | 691 | ext->alg = IW_ENCODE_ALG_WEP; |
692 | else if (strcmp(crypt->ops->name, "TKIP")) | 692 | else if (strcmp(crypt->ops->name, "TKIP")) |
693 | ext->alg = IW_ENCODE_ALG_TKIP; | 693 | ext->alg = IW_ENCODE_ALG_TKIP; |
@@ -711,7 +711,7 @@ int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, | |||
711 | struct iw_request_info *info, | 711 | struct iw_request_info *info, |
712 | union iwreq_data *wrqu, char *extra) | 712 | union iwreq_data *wrqu, char *extra) |
713 | { | 713 | { |
714 | struct iw_mlme *mlme = (struct iw_mlme *) extra; | 714 | struct iw_mlme *mlme = (struct iw_mlme *)extra; |
715 | switch (mlme->cmd) { | 715 | switch (mlme->cmd) { |
716 | case IW_MLME_DEAUTH: | 716 | case IW_MLME_DEAUTH: |
717 | case IW_MLME_DISASSOC: | 717 | case IW_MLME_DISASSOC: |
@@ -764,7 +764,7 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee, | |||
764 | break; | 764 | break; |
765 | 765 | ||
766 | case IW_AUTH_WPA_ENABLED: | 766 | case IW_AUTH_WPA_ENABLED: |
767 | ieee->wpa_enabled = (data->value)?1:0; | 767 | ieee->wpa_enabled = (data->value) ? 1 : 0; |
768 | break; | 768 | break; |
769 | 769 | ||
770 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: | 770 | case IW_AUTH_RX_UNENCRYPTED_EAPOL: |
@@ -784,14 +784,14 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len) | |||
784 | { | 784 | { |
785 | u8 *buf; | 785 | u8 *buf; |
786 | 786 | ||
787 | if (len>MAX_WPA_IE_LEN || (len && !ie)) { | 787 | if (len > MAX_WPA_IE_LEN || (len && !ie)) { |
788 | // printk("return error out, len:%d\n", len); | 788 | // printk("return error out, len:%d\n", len); |
789 | return -EINVAL; | 789 | return -EINVAL; |
790 | } | 790 | } |
791 | 791 | ||
792 | 792 | ||
793 | if (len) { | 793 | if (len) { |
794 | if (len != ie[1]+2) { | 794 | if (len != ie[1] + 2) { |
795 | printk("len:%zu, ie:%d\n", len, ie[1]); | 795 | printk("len:%zu, ie:%d\n", len, ie[1]); |
796 | return -EINVAL; | 796 | return -EINVAL; |
797 | } | 797 | } |
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 53869b3c985c..379a2ccf4d9f 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | |||
@@ -162,7 +162,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, s | |||
162 | tag += 2; | 162 | tag += 2; |
163 | } | 163 | } |
164 | 164 | ||
165 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); | 165 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_BA, skb->data, skb->len); |
166 | return skb; | 166 | return skb; |
167 | //return NULL; | 167 | //return NULL; |
168 | } | 168 | } |
@@ -229,7 +229,7 @@ static struct sk_buff *ieee80211_DELBA( | |||
229 | put_unaligned_le16(ReasonCode, tag); | 229 | put_unaligned_le16(ReasonCode, tag); |
230 | tag += 2; | 230 | tag += 2; |
231 | 231 | ||
232 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); | 232 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_BA, skb->data, skb->len); |
233 | if (net_ratelimit()) | 233 | if (net_ratelimit()) |
234 | IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, | 234 | IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, |
235 | "<=====%s()\n", __func__); | 235 | "<=====%s()\n", __func__); |
@@ -331,9 +331,9 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb) | |||
331 | return -1; | 331 | return -1; |
332 | } | 332 | } |
333 | 333 | ||
334 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); | 334 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_BA, skb->data, skb->len); |
335 | 335 | ||
336 | req = (struct rtl_80211_hdr_3addr *) skb->data; | 336 | req = (struct rtl_80211_hdr_3addr *)skb->data; |
337 | tag = (u8 *)req; | 337 | tag = (u8 *)req; |
338 | dst = &req->addr2[0]; | 338 | dst = &req->addr2[0]; |
339 | tag += sizeof(struct rtl_80211_hdr_3addr); | 339 | tag += sizeof(struct rtl_80211_hdr_3addr); |
@@ -556,7 +556,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device *ieee, struct sk_buff *skb) | |||
556 | return -1; | 556 | return -1; |
557 | } | 557 | } |
558 | 558 | ||
559 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); | 559 | IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA | IEEE80211_DL_BA, skb->data, skb->len); |
560 | delba = (struct rtl_80211_hdr_3addr *)skb->data; | 560 | delba = (struct rtl_80211_hdr_3addr *)skb->data; |
561 | dst = &delba->addr2[0]; | 561 | dst = &delba->addr2[0]; |
562 | pDelBaParamSet = (union delba_param_set *)&delba->payload[2]; | 562 | pDelBaParamSet = (union delba_param_set *)&delba->payload[2]; |
@@ -643,7 +643,7 @@ TsInitDelBA(struct ieee80211_device *ieee, struct ts_common_info *pTsCommonInfo, | |||
643 | ieee80211_send_DELBA( | 643 | ieee80211_send_DELBA( |
644 | ieee, | 644 | ieee, |
645 | pTsCommonInfo->addr, | 645 | pTsCommonInfo->addr, |
646 | (pTxTs->tx_admitted_ba_record.valid)?(&pTxTs->tx_admitted_ba_record):(&pTxTs->tx_pending_ba_record), | 646 | (pTxTs->tx_admitted_ba_record.valid) ? (&pTxTs->tx_admitted_ba_record) : (&pTxTs->tx_pending_ba_record), |
647 | TxRxSelect, | 647 | TxRxSelect, |
648 | DELBA_REASON_END_BA); | 648 | DELBA_REASON_END_BA); |
649 | } else if (TxRxSelect == RX_DIR) { | 649 | } else if (TxRxSelect == RX_DIR) { |
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 586d93720e37..79346a00af09 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h | |||
@@ -270,7 +270,7 @@ typedef enum _HT_AGGRE_SIZE { | |||
270 | HT_AGG_SIZE_16K = 1, | 270 | HT_AGG_SIZE_16K = 1, |
271 | HT_AGG_SIZE_32K = 2, | 271 | HT_AGG_SIZE_32K = 2, |
272 | HT_AGG_SIZE_64K = 3, | 272 | HT_AGG_SIZE_64K = 3, |
273 | }HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E; | 273 | } HT_AGGRE_SIZE_E, *PHT_AGGRE_SIZE_E; |
274 | 274 | ||
275 | /* Indicate different AP vendor for IOT issue */ | 275 | /* Indicate different AP vendor for IOT issue */ |
276 | typedef enum _HT_IOT_PEER { | 276 | typedef enum _HT_IOT_PEER { |
@@ -281,7 +281,7 @@ typedef enum _HT_IOT_PEER { | |||
281 | HT_IOT_PEER_ATHEROS = 4, | 281 | HT_IOT_PEER_ATHEROS = 4, |
282 | HT_IOT_PEER_CISCO = 5, | 282 | HT_IOT_PEER_CISCO = 5, |
283 | HT_IOT_PEER_MAX = 6 | 283 | HT_IOT_PEER_MAX = 6 |
284 | }HT_IOT_PEER_E, *PHTIOT_PEER_E; | 284 | } HT_IOT_PEER_E, *PHTIOT_PEER_E; |
285 | 285 | ||
286 | /* | 286 | /* |
287 | * IOT Action for different AP | 287 | * IOT Action for different AP |
@@ -297,6 +297,6 @@ typedef enum _HT_IOT_ACTION { | |||
297 | HT_IOT_ACT_CDD_FSYNC = 0x00000080, | 297 | HT_IOT_ACT_CDD_FSYNC = 0x00000080, |
298 | HT_IOT_ACT_PURE_N_MODE = 0x00000100, | 298 | HT_IOT_ACT_PURE_N_MODE = 0x00000100, |
299 | HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200, | 299 | HT_IOT_ACT_FORCED_CTS2SELF = 0x00000200, |
300 | }HT_IOT_ACTION_E, *PHT_IOT_ACTION_E; | 300 | } HT_IOT_ACTION_E, *PHT_IOT_ACTION_E; |
301 | 301 | ||
302 | #endif //_RTL819XU_HTTYPE_H_ | 302 | #endif //_RTL819XU_HTTYPE_H_ |
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 59d179ae7ad2..f4e5aa07421f 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | |||
@@ -105,7 +105,7 @@ static void ResetTsCommonInfo(struct ts_common_info *pTsCommonInfo) | |||
105 | { | 105 | { |
106 | eth_zero_addr(pTsCommonInfo->addr); | 106 | eth_zero_addr(pTsCommonInfo->addr); |
107 | memset(&pTsCommonInfo->t_spec, 0, sizeof(struct tspec_body)); | 107 | memset(&pTsCommonInfo->t_spec, 0, sizeof(struct tspec_body)); |
108 | memset(&pTsCommonInfo->t_class, 0, sizeof(union qos_tclas)*TCLAS_NUM); | 108 | memset(&pTsCommonInfo->t_class, 0, sizeof(union qos_tclas) * TCLAS_NUM); |
109 | pTsCommonInfo->t_clas_proc = 0; | 109 | pTsCommonInfo->t_clas_proc = 0; |
110 | pTsCommonInfo->t_clas_num = 0; | 110 | pTsCommonInfo->t_clas_num = 0; |
111 | } | 111 | } |
@@ -183,9 +183,9 @@ void TSInitialize(struct ieee80211_device *ieee) | |||
183 | //#ifdef TO_DO_LIST | 183 | //#ifdef TO_DO_LIST |
184 | for (count = 0; count < REORDER_ENTRY_NUM; count++) { | 184 | for (count = 0; count < REORDER_ENTRY_NUM; count++) { |
185 | list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List); | 185 | list_add_tail(&pRxReorderEntry->List, &ieee->RxReorder_Unused_List); |
186 | if (count == (REORDER_ENTRY_NUM-1)) | 186 | if (count == (REORDER_ENTRY_NUM - 1)) |
187 | break; | 187 | break; |
188 | pRxReorderEntry = &ieee->RxReorderEntry[count+1]; | 188 | pRxReorderEntry = &ieee->RxReorderEntry[count + 1]; |
189 | } | 189 | } |
190 | //#endif | 190 | //#endif |
191 | } | 191 | } |
@@ -259,7 +259,7 @@ static struct ts_common_info *SearchAdmitTRStream(struct ieee80211_device *ieee, | |||
259 | } | 259 | } |
260 | 260 | ||
261 | if (&pRet->list != psearch_list) | 261 | if (&pRet->list != psearch_list) |
262 | return pRet ; | 262 | return pRet; |
263 | else | 263 | else |
264 | return NULL; | 264 | return NULL; |
265 | } | 265 | } |
@@ -367,8 +367,8 @@ bool GetTs( | |||
367 | (&ieee->Rx_TS_Admit_List); | 367 | (&ieee->Rx_TS_Admit_List); |
368 | 368 | ||
369 | enum direction_value Dir = (ieee->iw_mode == IW_MODE_MASTER) ? | 369 | enum direction_value Dir = (ieee->iw_mode == IW_MODE_MASTER) ? |
370 | ((TxRxSelect == TX_DIR)?DIR_DOWN:DIR_UP) : | 370 | ((TxRxSelect == TX_DIR) ? DIR_DOWN : DIR_UP) : |
371 | ((TxRxSelect == TX_DIR)?DIR_UP:DIR_DOWN); | 371 | ((TxRxSelect == TX_DIR) ? DIR_UP : DIR_DOWN); |
372 | IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n"); | 372 | IEEE80211_DEBUG(IEEE80211_DL_TS, "to add Ts\n"); |
373 | if (!list_empty(pUnusedList)) { | 373 | if (!list_empty(pUnusedList)) { |
374 | (*ppTS) = list_entry(pUnusedList->next, struct ts_common_info, list); | 374 | (*ppTS) = list_entry(pUnusedList->next, struct ts_common_info, list); |
@@ -530,7 +530,7 @@ void TsStartAddBaProcess(struct ieee80211_device *ieee, struct tx_ts_record *pTx | |||
530 | jiffies + msecs_to_jiffies(TS_ADDBA_DELAY)); | 530 | jiffies + msecs_to_jiffies(TS_ADDBA_DELAY)); |
531 | } else { | 531 | } else { |
532 | IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: Immediately Start ADDBA now!!\n", __func__); | 532 | IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: Immediately Start ADDBA now!!\n", __func__); |
533 | mod_timer(&pTxTS->ts_add_ba_timer, jiffies+10); //set 10 ticks | 533 | mod_timer(&pTxTS->ts_add_ba_timer, jiffies + 10); //set 10 ticks |
534 | } | 534 | } |
535 | } else { | 535 | } else { |
536 | IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s()==>BA timer is already added\n", __func__); | 536 | IEEE80211_DEBUG(IEEE80211_DL_ERR, "%s()==>BA timer is already added\n", __func__); |