aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8192su
diff options
context:
space:
mode:
authorFlorian Schilhabel <florian.c.schilhabel@googlemail.com>2010-07-14 08:46:09 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-22 14:58:03 -0400
commite2e539065f9057163b2532cabccf2ece21c6a47c (patch)
tree58064ef6d8b5309adfca19cabb952e95d45acb96 /drivers/staging/rtl8192su
parent5889ef2dac613e84b0df7fe7749ba0c4e6539be4 (diff)
staging: rtl8192su: cleanup in ieee80211_tx.c, ieee80211_wx.c
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192su')
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c11
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c17
2 files changed, 1 insertions, 27 deletions
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
index 484c3aba5cb..a6a5d68df3a 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
@@ -32,7 +32,6 @@
32******************************************************************************/ 32******************************************************************************/
33 33
34#include <linux/compiler.h> 34#include <linux/compiler.h>
35//#include <linux/config.h>
36#include <linux/errno.h> 35#include <linux/errno.h>
37#include <linux/if_arp.h> 36#include <linux/if_arp.h>
38#include <linux/in6.h> 37#include <linux/in6.h>
@@ -208,7 +207,6 @@ int ieee80211_encrypt_fragment(
208 /* To encrypt, frame format is: 207 /* To encrypt, frame format is:
209 * IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */ 208 * IV (4 bytes), clear payload (including SNAP), ICV (4 bytes) */
210 209
211 // PR: FIXME: Copied from hostap. Check fragmentation/MSDU/MPDU encryption.
212 /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so 210 /* Host-based IEEE 802.11 fragmentation for TX is not yet supported, so
213 * call both MSDU and MPDU encryption functions from here. */ 211 * call both MSDU and MPDU encryption functions from here. */
214 atomic_inc(&crypt->refcnt); 212 atomic_inc(&crypt->refcnt);
@@ -231,7 +229,6 @@ int ieee80211_encrypt_fragment(
231 229
232 230
233void ieee80211_txb_free(struct ieee80211_txb *txb) { 231void ieee80211_txb_free(struct ieee80211_txb *txb) {
234 //int i;
235 if (unlikely(!txb)) 232 if (unlikely(!txb))
236 return; 233 return;
237 kfree(txb); 234 kfree(txb);
@@ -280,7 +277,6 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network)
280 if (eth->h_proto != htons(ETH_P_IP)) 277 if (eth->h_proto != htons(ETH_P_IP))
281 return 0; 278 return 0;
282 279
283// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len);
284 ip = ip_hdr(skb); 280 ip = ip_hdr(skb);
285 281
286 switch (ip->tos & 0xfc) { 282 switch (ip->tos & 0xfc) {
@@ -681,10 +677,8 @@ int rtl8192_ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
681 if (encrypt) 677 if (encrypt)
682 fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_WEP; 678 fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_WEP;
683 else 679 else
684
685 fc = IEEE80211_FTYPE_DATA; 680 fc = IEEE80211_FTYPE_DATA;
686 681
687 //if(ieee->current_network.QoS_Enable)
688 if(qos_actived) 682 if(qos_actived)
689 fc |= IEEE80211_STYPE_QOS_DATA; 683 fc |= IEEE80211_STYPE_QOS_DATA;
690 else 684 else
@@ -765,7 +759,6 @@ int rtl8192_ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
765 txb->encrypted = encrypt; 759 txb->encrypted = encrypt;
766 txb->payload_size = bytes; 760 txb->payload_size = bytes;
767 761
768 //if (ieee->current_network.QoS_Enable)
769 if(qos_actived) 762 if(qos_actived)
770 { 763 {
771 txb->queue_index = UP2AC(skb->priority); 764 txb->queue_index = UP2AC(skb->priority);
@@ -812,7 +805,6 @@ int rtl8192_ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
812 /* The last fragment takes the remaining length */ 805 /* The last fragment takes the remaining length */
813 bytes = bytes_last_frag; 806 bytes = bytes_last_frag;
814 } 807 }
815 //if(ieee->current_network.QoS_Enable)
816 if(qos_actived) 808 if(qos_actived)
817 { 809 {
818 // add 1 only indicate to corresponding seq number control 2006/7/12 810 // add 1 only indicate to corresponding seq number control 2006/7/12
@@ -889,7 +881,6 @@ int rtl8192_ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
889 if ( tcb_desc->bMulticast || tcb_desc->bBroadcast) 881 if ( tcb_desc->bMulticast || tcb_desc->bBroadcast)
890 tcb_desc->data_rate = ieee->basic_rate; 882 tcb_desc->data_rate = ieee->basic_rate;
891 else 883 else
892 //tcb_desc->data_rate = CURRENT_RATE(ieee->current_network.mode, ieee->rate, ieee->HTCurrentOperaRate);
893 tcb_desc->data_rate = CURRENT_RATE(ieee->mode, ieee->rate, ieee->HTCurrentOperaRate); 884 tcb_desc->data_rate = CURRENT_RATE(ieee->mode, ieee->rate, ieee->HTCurrentOperaRate);
894 ieee80211_qurey_ShortPreambleMode(ieee, tcb_desc); 885 ieee80211_qurey_ShortPreambleMode(ieee, tcb_desc);
895 ieee80211_tx_query_agg_cap(ieee, txb->fragments[0], tcb_desc); 886 ieee80211_tx_query_agg_cap(ieee, txb->fragments[0], tcb_desc);
@@ -897,8 +888,6 @@ int rtl8192_ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
897 ieee80211_query_BandwidthMode(ieee, tcb_desc); 888 ieee80211_query_BandwidthMode(ieee, tcb_desc);
898 ieee80211_query_protectionmode(ieee, tcb_desc, txb->fragments[0]); 889 ieee80211_query_protectionmode(ieee, tcb_desc, txb->fragments[0]);
899 ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1); 890 ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1);
900// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len);
901 //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc));
902#endif 891#endif
903 } 892 }
904 spin_unlock_irqrestore(&ieee->lock, flags); 893 spin_unlock_irqrestore(&ieee->lock, flags);
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
index 2ce5bd543ea..984a3608561 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
@@ -77,7 +77,6 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
77 /* Add the ESSID */ 77 /* Add the ESSID */
78 iwe.cmd = SIOCGIWESSID; 78 iwe.cmd = SIOCGIWESSID;
79 iwe.u.data.flags = 1; 79 iwe.u.data.flags = 1;
80// if (network->flags & NETWORK_EMPTY_ESSID) {
81 if (network->ssid_len == 0) { 80 if (network->ssid_len == 0) {
82 iwe.u.data.length = sizeof("<hidden>"); 81 iwe.u.data.length = sizeof("<hidden>");
83 start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>"); 82 start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>");
@@ -240,9 +239,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
240 unsigned long flags; 239 unsigned long flags;
241 240
242 char *ev = extra; 241 char *ev = extra;
243// char *stop = ev + IW_SCAN_MAX_DATA;
244 char *stop = ev + wrqu->data.length;//IW_SCAN_MAX_DATA; 242 char *stop = ev + wrqu->data.length;//IW_SCAN_MAX_DATA;
245 //char *stop = ev + IW_SCAN_MAX_DATA;
246 int i = 0; 243 int i = 0;
247 int err = 0; 244 int err = 0;
248 IEEE80211_DEBUG_WX("Getting scan\n"); 245 IEEE80211_DEBUG_WX("Getting scan\n");
@@ -511,7 +508,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
511 struct ieee80211_security sec = { 508 struct ieee80211_security sec = {
512 .flags = 0, 509 .flags = 0,
513 }; 510 };
514 //printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg);
515 idx = encoding->flags & IW_ENCODE_INDEX; 511 idx = encoding->flags & IW_ENCODE_INDEX;
516 if (idx) { 512 if (idx) {
517 if (idx < 1 || idx > WEP_KEYS) 513 if (idx < 1 || idx > WEP_KEYS)
@@ -562,7 +558,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
562 } 558 }
563 559
564 sec.enabled = 1; 560 sec.enabled = 1;
565 // sec.encrypt = 1;
566 561
567 switch (ext->alg) { 562 switch (ext->alg) {
568 case IW_ENCODE_ALG_WEP: 563 case IW_ENCODE_ALG_WEP:
@@ -580,7 +575,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
580 ret = -EINVAL; 575 ret = -EINVAL;
581 goto done; 576 goto done;
582 } 577 }
583 printk("alg name:%s\n",alg); 578 IEEE80211_DEBUG_WX("alg name: %s\n", alg);
584 579
585 ops = ieee80211_get_crypto_ops(alg); 580 ops = ieee80211_get_crypto_ops(alg);
586 if (ops == NULL) 581 if (ops == NULL)
@@ -624,8 +619,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
624 goto done; 619 goto done;
625 } 620 }
626#if 1 621#if 1
627 //skip_host_crypt:
628 //printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags);
629 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { 622 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
630 ieee->tx_keyidx = idx; 623 ieee->tx_keyidx = idx;
631 sec.active_key = idx; 624 sec.active_key = idx;
@@ -633,7 +626,6 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
633 } 626 }
634 627
635 if (ext->alg != IW_ENCODE_ALG_NONE) { 628 if (ext->alg != IW_ENCODE_ALG_NONE) {
636 //memcpy(sec.keys[idx], ext->key, ext->key_len);
637 sec.key_sizes[idx] = ext->key_len; 629 sec.key_sizes[idx] = ext->key_len;
638 sec.flags |= (1 << idx); 630 sec.flags |= (1 << idx);
639 if (ext->alg == IW_ENCODE_ALG_WEP) { 631 if (ext->alg == IW_ENCODE_ALG_WEP) {
@@ -690,7 +682,6 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
690 switch (data->flags & IW_AUTH_INDEX) { 682 switch (data->flags & IW_AUTH_INDEX) {
691 case IW_AUTH_WPA_VERSION: 683 case IW_AUTH_WPA_VERSION:
692 /*need to support wpa2 here*/ 684 /*need to support wpa2 here*/
693 //printk("wpa version:%x\n", data->value);
694 break; 685 break;
695 case IW_AUTH_CIPHER_PAIRWISE: 686 case IW_AUTH_CIPHER_PAIRWISE:
696 case IW_AUTH_CIPHER_GROUP: 687 case IW_AUTH_CIPHER_GROUP:
@@ -708,8 +699,6 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
708 break; 699 break;
709 700
710 case IW_AUTH_80211_AUTH_ALG: 701 case IW_AUTH_80211_AUTH_ALG:
711 //printk("======>%s():data->value is %d\n",__FUNCTION__,data->value);
712 // ieee->open_wep = (data->value&IW_AUTH_ALG_OPEN_SYSTEM)?1:0;
713 if(data->value & IW_AUTH_ALG_SHARED_KEY){ 702 if(data->value & IW_AUTH_ALG_SHARED_KEY){
714 ieee->open_wep = 0; 703 ieee->open_wep = 0;
715 ieee->auth_mode = 1; 704 ieee->auth_mode = 1;
@@ -721,17 +710,14 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
721 else if(data->value & IW_AUTH_ALG_LEAP){ 710 else if(data->value & IW_AUTH_ALG_LEAP){
722 ieee->open_wep = 1; 711 ieee->open_wep = 1;
723 ieee->auth_mode = 2; 712 ieee->auth_mode = 2;
724 //printk("hahahaa:LEAP\n");
725 } 713 }
726 else 714 else
727 return -EINVAL; 715 return -EINVAL;
728 //printk("open_wep:%d\n", ieee->open_wep);
729 break; 716 break;
730 717
731#if 1 718#if 1
732 case IW_AUTH_WPA_ENABLED: 719 case IW_AUTH_WPA_ENABLED:
733 ieee->wpa_enabled = (data->value)?1:0; 720 ieee->wpa_enabled = (data->value)?1:0;
734 //printk("enable wpa:%d\n", ieee->wpa_enabled);
735 break; 721 break;
736 722
737#endif 723#endif
@@ -755,7 +741,6 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len)
755 741
756 if (len>MAX_WPA_IE_LEN || (len && ie == NULL)) 742 if (len>MAX_WPA_IE_LEN || (len && ie == NULL))
757 { 743 {
758 // printk("return error out, len:%d\n", len);
759 return -EINVAL; 744 return -EINVAL;
760 } 745 }
761 746