aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2009-11-03 04:42:46 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 15:23:22 -0500
commite406322b4b963e622f41d76193d8ca9e5435adb8 (patch)
treea2efb0475b523babe255e1279b841f04f778fe65 /drivers/staging
parentf61fb9356d20977258bb59a8d9f1857d2c58ac98 (diff)
Staging: rtl8192u: remove bad whitespaces
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192u/ieee80211.h716
-rw-r--r--drivers/staging/rtl8192u/ieee80211/aes.c34
-rw-r--r--drivers/staging/rtl8192u/ieee80211/arc4.c6
-rw-r--r--drivers/staging/rtl8192u/ieee80211/cipher.c98
-rw-r--r--drivers/staging/rtl8192u/ieee80211/compress.c16
-rw-r--r--drivers/staging/rtl8192u/ieee80211/crypto_compat.h12
-rw-r--r--drivers/staging/rtl8192u/ieee80211/digest.c6
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211.h702
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c2
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c40
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c54
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_module.c10
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c100
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c4
-rw-r--r--drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c434
-rw-r--r--drivers/staging/rtl8192u/ieee80211/proc.c2
-rw-r--r--drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h2
-rw-r--r--drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c20
-rw-r--r--drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h12
-rw-r--r--drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c38
-rw-r--r--drivers/staging/rtl8192u/r8180_pm.c8
-rw-r--r--drivers/staging/rtl8192u/r8192U_core.c710
-rw-r--r--drivers/staging/rtl8192u/r8192U_dm.c28
-rw-r--r--drivers/staging/rtl8192u/r8192U_dm.h2
-rw-r--r--drivers/staging/rtl8192u/r8192U_hw.h2
-rw-r--r--drivers/staging/rtl8192u/r8192U_wx.c320
-rw-r--r--drivers/staging/rtl8192u/r819xU_cmdpkt.c12
-rw-r--r--drivers/staging/rtl8192u/r819xU_cmdpkt.h8
-rw-r--r--drivers/staging/rtl8192u/r819xU_firmware.c18
-rw-r--r--drivers/staging/rtl8192u/r819xU_phy.c22
-rw-r--r--drivers/staging/rtl8192u/r819xU_phyreg.h50
31 files changed, 1744 insertions, 1744 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211.h b/drivers/staging/rtl8192u/ieee80211.h
index 690d41c8cb6..f5795855904 100644
--- a/drivers/staging/rtl8192u/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211.h
@@ -86,8 +86,8 @@ struct iw_spy_data{
86 * 86 *
87 */ 87 */
88#define container_of(ptr, type, member) ({ \ 88#define container_of(ptr, type, member) ({ \
89 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 89 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
90 (type *)( (char *)__mptr - offsetof(type,member) );}) 90 (type *)( (char *)__mptr - offsetof(type,member) );})
91#endif 91#endif
92 92
93#define KEY_TYPE_NA 0x0 93#define KEY_TYPE_NA 0x0
@@ -125,61 +125,61 @@ struct iw_spy_data{
125/* defined for skb cb field */ 125/* defined for skb cb field */
126/* At most 28 byte */ 126/* At most 28 byte */
127typedef struct cb_desc { 127typedef struct cb_desc {
128 /* Tx Desc Related flags (8-9) */ 128 /* Tx Desc Related flags (8-9) */
129 u8 bLastIniPkt:1; 129 u8 bLastIniPkt:1;
130 u8 bCmdOrInit:1; 130 u8 bCmdOrInit:1;
131 u8 bFirstSeg:1; 131 u8 bFirstSeg:1;
132 u8 bLastSeg:1; 132 u8 bLastSeg:1;
133 u8 bEncrypt:1; 133 u8 bEncrypt:1;
134 u8 bTxDisableRateFallBack:1; 134 u8 bTxDisableRateFallBack:1;
135 u8 bTxUseDriverAssingedRate:1; 135 u8 bTxUseDriverAssingedRate:1;
136 u8 bHwSec:1; //indicate whether use Hw security. WB 136 u8 bHwSec:1; //indicate whether use Hw security. WB
137 137
138 u8 reserved1; 138 u8 reserved1;
139 139
140 /* Tx Firmware Relaged flags (10-11)*/ 140 /* Tx Firmware Relaged flags (10-11)*/
141 u8 bCTSEnable:1; 141 u8 bCTSEnable:1;
142 u8 bRTSEnable:1; 142 u8 bRTSEnable:1;
143 u8 bUseShortGI:1; 143 u8 bUseShortGI:1;
144 u8 bUseShortPreamble:1; 144 u8 bUseShortPreamble:1;
145 u8 bTxEnableFwCalcDur:1; 145 u8 bTxEnableFwCalcDur:1;
146 u8 bAMPDUEnable:1; 146 u8 bAMPDUEnable:1;
147 u8 bRTSSTBC:1; 147 u8 bRTSSTBC:1;
148 u8 RTSSC:1; 148 u8 RTSSC:1;
149 149
150 u8 bRTSBW:1; 150 u8 bRTSBW:1;
151 u8 bPacketBW:1; 151 u8 bPacketBW:1;
152 u8 bRTSUseShortPreamble:1; 152 u8 bRTSUseShortPreamble:1;
153 u8 bRTSUseShortGI:1; 153 u8 bRTSUseShortGI:1;
154 u8 bMulticast:1; 154 u8 bMulticast:1;
155 u8 bBroadcast:1; 155 u8 bBroadcast:1;
156 //u8 reserved2:2; 156 //u8 reserved2:2;
157 u8 drv_agg_enable:1; 157 u8 drv_agg_enable:1;
158 u8 reserved2:1; 158 u8 reserved2:1;
159 159
160 /* Tx Desc related element(12-19) */ 160 /* Tx Desc related element(12-19) */
161 u8 rata_index; 161 u8 rata_index;
162 u8 queue_index; 162 u8 queue_index;
163 //u8 reserved3; 163 //u8 reserved3;
164 //u8 reserved4; 164 //u8 reserved4;
165 u16 txbuf_size; 165 u16 txbuf_size;
166 //u8 reserved5; 166 //u8 reserved5;
167 u8 RATRIndex; 167 u8 RATRIndex;
168 u8 reserved6; 168 u8 reserved6;
169 u8 reserved7; 169 u8 reserved7;
170 u8 reserved8; 170 u8 reserved8;
171 171
172 /* Tx firmware related element(20-27) */ 172 /* Tx firmware related element(20-27) */
173 u8 data_rate; 173 u8 data_rate;
174 u8 rts_rate; 174 u8 rts_rate;
175 u8 ampdu_factor; 175 u8 ampdu_factor;
176 u8 ampdu_density; 176 u8 ampdu_density;
177 //u8 reserved9; 177 //u8 reserved9;
178 //u8 reserved10; 178 //u8 reserved10;
179 //u8 reserved11; 179 //u8 reserved11;
180 u8 DrvAggrNum; 180 u8 DrvAggrNum;
181 u16 pkt_size; 181 u16 pkt_size;
182 u8 reserved12; 182 u8 reserved12;
183}cb_desc, *pcb_desc; 183}cb_desc, *pcb_desc;
184 184
185/*--------------------------Define -------------------------------------------*/ 185/*--------------------------Define -------------------------------------------*/
@@ -389,7 +389,7 @@ enum _ReasonCode{
389typedef struct ieee_param { 389typedef struct ieee_param {
390 u32 cmd; 390 u32 cmd;
391 u8 sta_addr[ETH_ALEN]; 391 u8 sta_addr[ETH_ALEN];
392 union { 392 union {
393 struct { 393 struct {
394 u8 name; 394 u8 name;
395 u32 value; 395 u32 value;
@@ -399,9 +399,9 @@ typedef struct ieee_param {
399 u8 reserved[32]; 399 u8 reserved[32];
400 u8 data[0]; 400 u8 data[0];
401 } wpa_ie; 401 } wpa_ie;
402 struct{ 402 struct{
403 int command; 403 int command;
404 int reason_code; 404 int reason_code;
405 } mlme; 405 } mlme;
406 struct { 406 struct {
407 u8 alg[IEEE_CRYPT_ALG_NAME_LEN]; 407 u8 alg[IEEE_CRYPT_ALG_NAME_LEN];
@@ -442,23 +442,23 @@ static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *d
442#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) 442#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
443static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) 443static inline unsigned long msleep_interruptible_rsl(unsigned int msecs)
444{ 444{
445 unsigned long timeout = MSECS(msecs) + 1; 445 unsigned long timeout = MSECS(msecs) + 1;
446 446
447 while (timeout) { 447 while (timeout) {
448 set_current_state(TASK_INTERRUPTIBLE); 448 set_current_state(TASK_INTERRUPTIBLE);
449 timeout = schedule_timeout(timeout); 449 timeout = schedule_timeout(timeout);
450 } 450 }
451 return timeout; 451 return timeout;
452} 452}
453#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) 453#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
454static inline void msleep(unsigned int msecs) 454static inline void msleep(unsigned int msecs)
455{ 455{
456 unsigned long timeout = MSECS(msecs) + 1; 456 unsigned long timeout = MSECS(msecs) + 1;
457 457
458 while (timeout) { 458 while (timeout) {
459 set_current_state(TASK_UNINTERRUPTIBLE); 459 set_current_state(TASK_UNINTERRUPTIBLE);
460 timeout = schedule_timeout(timeout); 460 timeout = schedule_timeout(timeout);
461 } 461 }
462} 462}
463#endif 463#endif
464#else 464#else
@@ -559,24 +559,24 @@ static inline void msleep(unsigned int msecs)
559#define SN_EQUAL(a, b) (a == b) 559#define SN_EQUAL(a, b) (a == b)
560#define MAX_DEV_ADDR_SIZE 8 560#define MAX_DEV_ADDR_SIZE 8
561typedef enum _ACT_CATEGORY{ 561typedef enum _ACT_CATEGORY{
562 ACT_CAT_QOS = 1, 562 ACT_CAT_QOS = 1,
563 ACT_CAT_DLS = 2, 563 ACT_CAT_DLS = 2,
564 ACT_CAT_BA = 3, 564 ACT_CAT_BA = 3,
565 ACT_CAT_HT = 7, 565 ACT_CAT_HT = 7,
566 ACT_CAT_WMM = 17, 566 ACT_CAT_WMM = 17,
567} ACT_CATEGORY, *PACT_CATEGORY; 567} ACT_CATEGORY, *PACT_CATEGORY;
568 568
569typedef enum _TS_ACTION{ 569typedef enum _TS_ACTION{
570 ACT_ADDTSREQ = 0, 570 ACT_ADDTSREQ = 0,
571 ACT_ADDTSRSP = 1, 571 ACT_ADDTSRSP = 1,
572 ACT_DELTS = 2, 572 ACT_DELTS = 2,
573 ACT_SCHEDULE = 3, 573 ACT_SCHEDULE = 3,
574} TS_ACTION, *PTS_ACTION; 574} TS_ACTION, *PTS_ACTION;
575 575
576typedef enum _BA_ACTION{ 576typedef enum _BA_ACTION{
577 ACT_ADDBAREQ = 0, 577 ACT_ADDBAREQ = 0,
578 ACT_ADDBARSP = 1, 578 ACT_ADDBARSP = 1,
579 ACT_DELBA = 2, 579 ACT_DELBA = 2,
580} BA_ACTION, *PBA_ACTION; 580} BA_ACTION, *PBA_ACTION;
581 581
582typedef enum _InitialGainOpType{ 582typedef enum _InitialGainOpType{
@@ -687,22 +687,22 @@ do { if (ieee80211_debug_level & (level)) \
687/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/ 687/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/
688#define PRINTABLE(_ch) (_ch>'!' && _ch<'~') 688#define PRINTABLE(_ch) (_ch>'!' && _ch<'~')
689#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \ 689#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \
690 if((_Comp) & level) \ 690 if((_Comp) & level) \
691 { \ 691 { \
692 int __i; \ 692 int __i; \
693 u8 buffer[MAX_STR_LEN]; \ 693 u8 buffer[MAX_STR_LEN]; \
694 int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \ 694 int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
695 memset(buffer, 0, MAX_STR_LEN); \ 695 memset(buffer, 0, MAX_STR_LEN); \
696 memcpy(buffer, (u8 *)_Ptr, length ); \ 696 memcpy(buffer, (u8 *)_Ptr, length ); \
697 for( __i=0; __i<MAX_STR_LEN; __i++ ) \ 697 for( __i=0; __i<MAX_STR_LEN; __i++ ) \
698 { \ 698 { \
699 if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \ 699 if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
700 } \ 700 } \
701 buffer[length] = '\0'; \ 701 buffer[length] = '\0'; \
702 printk("Rtl819x: "); \ 702 printk("Rtl819x: "); \
703 printk(_TitleString); \ 703 printk(_TitleString); \
704 printk(": %d, <%s>\n", _Len, buffer); \ 704 printk(": %d, <%s>\n", _Len, buffer); \
705 } 705 }
706#else 706#else
707#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0) 707#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0)
708#endif 708#endif
@@ -731,10 +731,10 @@ do { if (ieee80211_debug_level & (level)) \
731 731
732struct ieee80211_snap_hdr { 732struct ieee80211_snap_hdr {
733 733
734 u8 dsap; /* always 0xAA */ 734 u8 dsap; /* always 0xAA */
735 u8 ssap; /* always 0xAA */ 735 u8 ssap; /* always 0xAA */
736 u8 ctrl; /* always 0x03 */ 736 u8 ctrl; /* always 0x03 */
737 u8 oui[P80211_OUI_LEN]; /* organizational universal id */ 737 u8 oui[P80211_OUI_LEN]; /* organizational universal id */
738 738
739} __attribute__ ((packed)); 739} __attribute__ ((packed));
740 740
@@ -775,65 +775,65 @@ struct ieee80211_snap_hdr {
775 775
776/* Status codes */ 776/* Status codes */
777enum ieee80211_statuscode { 777enum ieee80211_statuscode {
778 WLAN_STATUS_SUCCESS = 0, 778 WLAN_STATUS_SUCCESS = 0,
779 WLAN_STATUS_UNSPECIFIED_FAILURE = 1, 779 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
780 WLAN_STATUS_CAPS_UNSUPPORTED = 10, 780 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
781 WLAN_STATUS_REASSOC_NO_ASSOC = 11, 781 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
782 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, 782 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
783 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, 783 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
784 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, 784 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
785 WLAN_STATUS_CHALLENGE_FAIL = 15, 785 WLAN_STATUS_CHALLENGE_FAIL = 15,
786 WLAN_STATUS_AUTH_TIMEOUT = 16, 786 WLAN_STATUS_AUTH_TIMEOUT = 16,
787 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, 787 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
788 WLAN_STATUS_ASSOC_DENIED_RATES = 18, 788 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
789 /* 802.11b */ 789 /* 802.11b */
790 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, 790 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
791 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, 791 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
792 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, 792 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
793 /* 802.11h */ 793 /* 802.11h */
794 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, 794 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
795 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, 795 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
796 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, 796 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
797 /* 802.11g */ 797 /* 802.11g */
798 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, 798 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
799 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, 799 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
800 /* 802.11i */ 800 /* 802.11i */
801 WLAN_STATUS_INVALID_IE = 40, 801 WLAN_STATUS_INVALID_IE = 40,
802 WLAN_STATUS_INVALID_GROUP_CIPHER = 41, 802 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
803 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, 803 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
804 WLAN_STATUS_INVALID_AKMP = 43, 804 WLAN_STATUS_INVALID_AKMP = 43,
805 WLAN_STATUS_UNSUPP_RSN_VERSION = 44, 805 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
806 WLAN_STATUS_INVALID_RSN_IE_CAP = 45, 806 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
807 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, 807 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
808}; 808};
809 809
810/* Reason codes */ 810/* Reason codes */
811enum ieee80211_reasoncode { 811enum ieee80211_reasoncode {
812 WLAN_REASON_UNSPECIFIED = 1, 812 WLAN_REASON_UNSPECIFIED = 1,
813 WLAN_REASON_PREV_AUTH_NOT_VALID = 2, 813 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
814 WLAN_REASON_DEAUTH_LEAVING = 3, 814 WLAN_REASON_DEAUTH_LEAVING = 3,
815 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, 815 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
816 WLAN_REASON_DISASSOC_AP_BUSY = 5, 816 WLAN_REASON_DISASSOC_AP_BUSY = 5,
817 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, 817 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
818 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, 818 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
819 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, 819 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
820 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, 820 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
821 /* 802.11h */ 821 /* 802.11h */
822 WLAN_REASON_DISASSOC_BAD_POWER = 10, 822 WLAN_REASON_DISASSOC_BAD_POWER = 10,
823 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, 823 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
824 /* 802.11i */ 824 /* 802.11i */
825 WLAN_REASON_INVALID_IE = 13, 825 WLAN_REASON_INVALID_IE = 13,
826 WLAN_REASON_MIC_FAILURE = 14, 826 WLAN_REASON_MIC_FAILURE = 14,
827 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, 827 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
828 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, 828 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
829 WLAN_REASON_IE_DIFFERENT = 17, 829 WLAN_REASON_IE_DIFFERENT = 17,
830 WLAN_REASON_INVALID_GROUP_CIPHER = 18, 830 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
831 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, 831 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
832 WLAN_REASON_INVALID_AKMP = 20, 832 WLAN_REASON_INVALID_AKMP = 20,
833 WLAN_REASON_UNSUPP_RSN_VERSION = 21, 833 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
834 WLAN_REASON_INVALID_RSN_IE_CAP = 22, 834 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
835 WLAN_REASON_IEEE8021X_FAILED = 23, 835 WLAN_REASON_IEEE8021X_FAILED = 23,
836 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 836 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
837}; 837};
838 838
839#define IEEE80211_STATMASK_SIGNAL (1<<0) 839#define IEEE80211_STATMASK_SIGNAL (1<<0)
@@ -849,13 +849,13 @@ enum ieee80211_reasoncode {
849#define IEEE80211_52GHZ_BAND (1<<1) 849#define IEEE80211_52GHZ_BAND (1<<1)
850 850
851#define IEEE80211_CCK_RATE_LEN 4 851#define IEEE80211_CCK_RATE_LEN 4
852#define IEEE80211_CCK_RATE_1MB 0x02 852#define IEEE80211_CCK_RATE_1MB 0x02
853#define IEEE80211_CCK_RATE_2MB 0x04 853#define IEEE80211_CCK_RATE_2MB 0x04
854#define IEEE80211_CCK_RATE_5MB 0x0B 854#define IEEE80211_CCK_RATE_5MB 0x0B
855#define IEEE80211_CCK_RATE_11MB 0x16 855#define IEEE80211_CCK_RATE_11MB 0x16
856#define IEEE80211_OFDM_RATE_LEN 8 856#define IEEE80211_OFDM_RATE_LEN 8
857#define IEEE80211_OFDM_RATE_6MB 0x0C 857#define IEEE80211_OFDM_RATE_6MB 0x0C
858#define IEEE80211_OFDM_RATE_9MB 0x12 858#define IEEE80211_OFDM_RATE_9MB 0x12
859#define IEEE80211_OFDM_RATE_12MB 0x18 859#define IEEE80211_OFDM_RATE_12MB 0x18
860#define IEEE80211_OFDM_RATE_18MB 0x24 860#define IEEE80211_OFDM_RATE_18MB 0x24
861#define IEEE80211_OFDM_RATE_24MB 0x30 861#define IEEE80211_OFDM_RATE_24MB 0x30
@@ -877,12 +877,12 @@ enum ieee80211_reasoncode {
877#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) 877#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
878#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) 878#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
879 879
880#define IEEE80211_CCK_RATES_MASK 0x0000000F 880#define IEEE80211_CCK_RATES_MASK 0x0000000F
881#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ 881#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
882 IEEE80211_CCK_RATE_2MB_MASK) 882 IEEE80211_CCK_RATE_2MB_MASK)
883#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ 883#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
884 IEEE80211_CCK_RATE_5MB_MASK | \ 884 IEEE80211_CCK_RATE_5MB_MASK | \
885 IEEE80211_CCK_RATE_11MB_MASK) 885 IEEE80211_CCK_RATE_11MB_MASK)
886 886
887#define IEEE80211_OFDM_RATES_MASK 0x00000FF0 887#define IEEE80211_OFDM_RATES_MASK 0x00000FF0
888#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ 888#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
@@ -895,10 +895,10 @@ enum ieee80211_reasoncode {
895 IEEE80211_OFDM_RATE_48MB_MASK | \ 895 IEEE80211_OFDM_RATE_48MB_MASK | \
896 IEEE80211_OFDM_RATE_54MB_MASK) 896 IEEE80211_OFDM_RATE_54MB_MASK)
897#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ 897#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
898 IEEE80211_CCK_DEFAULT_RATES_MASK) 898 IEEE80211_CCK_DEFAULT_RATES_MASK)
899 899
900#define IEEE80211_NUM_OFDM_RATES 8 900#define IEEE80211_NUM_OFDM_RATES 8
901#define IEEE80211_NUM_CCK_RATES 4 901#define IEEE80211_NUM_CCK_RATES 4
902#define IEEE80211_OFDM_SHIFT_MASK_A 4 902#define IEEE80211_OFDM_SHIFT_MASK_A 4
903 903
904 904
@@ -1064,10 +1064,10 @@ struct ieee80211_device;
1064 1064
1065struct ieee80211_security { 1065struct ieee80211_security {
1066 u16 active_key:2, 1066 u16 active_key:2,
1067 enabled:1, 1067 enabled:1,
1068 auth_mode:2, 1068 auth_mode:2,
1069 auth_algo:4, 1069 auth_algo:4,
1070 unicast_uses_group:1, 1070 unicast_uses_group:1,
1071 encrypt:1; 1071 encrypt:1;
1072 u8 key_sizes[WEP_KEYS]; 1072 u8 key_sizes[WEP_KEYS];
1073 u8 keys[WEP_KEYS][SCM_KEY_LEN]; 1073 u8 keys[WEP_KEYS][SCM_KEY_LEN];
@@ -1089,60 +1089,60 @@ Total: 28-2340 bytes
1089 1089
1090/* Management Frame Information Element Types */ 1090/* Management Frame Information Element Types */
1091enum ieee80211_mfie { 1091enum ieee80211_mfie {
1092 MFIE_TYPE_SSID = 0, 1092 MFIE_TYPE_SSID = 0,
1093 MFIE_TYPE_RATES = 1, 1093 MFIE_TYPE_RATES = 1,
1094 MFIE_TYPE_FH_SET = 2, 1094 MFIE_TYPE_FH_SET = 2,
1095 MFIE_TYPE_DS_SET = 3, 1095 MFIE_TYPE_DS_SET = 3,
1096 MFIE_TYPE_CF_SET = 4, 1096 MFIE_TYPE_CF_SET = 4,
1097 MFIE_TYPE_TIM = 5, 1097 MFIE_TYPE_TIM = 5,
1098 MFIE_TYPE_IBSS_SET = 6, 1098 MFIE_TYPE_IBSS_SET = 6,
1099 MFIE_TYPE_COUNTRY = 7, 1099 MFIE_TYPE_COUNTRY = 7,
1100 MFIE_TYPE_HOP_PARAMS = 8, 1100 MFIE_TYPE_HOP_PARAMS = 8,
1101 MFIE_TYPE_HOP_TABLE = 9, 1101 MFIE_TYPE_HOP_TABLE = 9,
1102 MFIE_TYPE_REQUEST = 10, 1102 MFIE_TYPE_REQUEST = 10,
1103 MFIE_TYPE_CHALLENGE = 16, 1103 MFIE_TYPE_CHALLENGE = 16,
1104 MFIE_TYPE_POWER_CONSTRAINT = 32, 1104 MFIE_TYPE_POWER_CONSTRAINT = 32,
1105 MFIE_TYPE_POWER_CAPABILITY = 33, 1105 MFIE_TYPE_POWER_CAPABILITY = 33,
1106 MFIE_TYPE_TPC_REQUEST = 34, 1106 MFIE_TYPE_TPC_REQUEST = 34,
1107 MFIE_TYPE_TPC_REPORT = 35, 1107 MFIE_TYPE_TPC_REPORT = 35,
1108 MFIE_TYPE_SUPP_CHANNELS = 36, 1108 MFIE_TYPE_SUPP_CHANNELS = 36,
1109 MFIE_TYPE_CSA = 37, 1109 MFIE_TYPE_CSA = 37,
1110 MFIE_TYPE_MEASURE_REQUEST = 38, 1110 MFIE_TYPE_MEASURE_REQUEST = 38,
1111 MFIE_TYPE_MEASURE_REPORT = 39, 1111 MFIE_TYPE_MEASURE_REPORT = 39,
1112 MFIE_TYPE_QUIET = 40, 1112 MFIE_TYPE_QUIET = 40,
1113 MFIE_TYPE_IBSS_DFS = 41, 1113 MFIE_TYPE_IBSS_DFS = 41,
1114 MFIE_TYPE_ERP = 42, 1114 MFIE_TYPE_ERP = 42,
1115 MFIE_TYPE_RSN = 48, 1115 MFIE_TYPE_RSN = 48,
1116 MFIE_TYPE_RATES_EX = 50, 1116 MFIE_TYPE_RATES_EX = 50,
1117 MFIE_TYPE_HT_CAP= 45, 1117 MFIE_TYPE_HT_CAP= 45,
1118 MFIE_TYPE_HT_INFO= 61, 1118 MFIE_TYPE_HT_INFO= 61,
1119 MFIE_TYPE_AIRONET=133, 1119 MFIE_TYPE_AIRONET=133,
1120 MFIE_TYPE_GENERIC = 221, 1120 MFIE_TYPE_GENERIC = 221,
1121 MFIE_TYPE_QOS_PARAMETER = 222, 1121 MFIE_TYPE_QOS_PARAMETER = 222,
1122}; 1122};
1123 1123
1124/* Minimal header; can be used for passing 802.11 frames with sufficient 1124/* Minimal header; can be used for passing 802.11 frames with sufficient
1125 * information to determine what type of underlying data type is actually 1125 * information to determine what type of underlying data type is actually
1126 * stored in the data. */ 1126 * stored in the data. */
1127struct ieee80211_hdr { 1127struct ieee80211_hdr {
1128 __le16 frame_ctl; 1128 __le16 frame_ctl;
1129 __le16 duration_id; 1129 __le16 duration_id;
1130 u8 payload[0]; 1130 u8 payload[0];
1131} __attribute__ ((packed)); 1131} __attribute__ ((packed));
1132 1132
1133struct ieee80211_hdr_1addr { 1133struct ieee80211_hdr_1addr {
1134 __le16 frame_ctl; 1134 __le16 frame_ctl;
1135 __le16 duration_id; 1135 __le16 duration_id;
1136 u8 addr1[ETH_ALEN]; 1136 u8 addr1[ETH_ALEN];
1137 u8 payload[0]; 1137 u8 payload[0];
1138} __attribute__ ((packed)); 1138} __attribute__ ((packed));
1139 1139
1140struct ieee80211_hdr_2addr { 1140struct ieee80211_hdr_2addr {
1141 __le16 frame_ctl; 1141 __le16 frame_ctl;
1142 __le16 duration_id; 1142 __le16 duration_id;
1143 u8 addr1[ETH_ALEN]; 1143 u8 addr1[ETH_ALEN];
1144 u8 addr2[ETH_ALEN]; 1144 u8 addr2[ETH_ALEN];
1145 u8 payload[0]; 1145 u8 payload[0];
1146} __attribute__ ((packed)); 1146} __attribute__ ((packed));
1147 1147
1148struct ieee80211_hdr_3addr { 1148struct ieee80211_hdr_3addr {
@@ -1152,7 +1152,7 @@ struct ieee80211_hdr_3addr {
1152 u8 addr2[ETH_ALEN]; 1152 u8 addr2[ETH_ALEN];
1153 u8 addr3[ETH_ALEN]; 1153 u8 addr3[ETH_ALEN];
1154 __le16 seq_ctl; 1154 __le16 seq_ctl;
1155 u8 payload[0]; 1155 u8 payload[0];
1156} __attribute__ ((packed)); 1156} __attribute__ ((packed));
1157 1157
1158struct ieee80211_hdr_4addr { 1158struct ieee80211_hdr_4addr {
@@ -1163,7 +1163,7 @@ struct ieee80211_hdr_4addr {
1163 u8 addr3[ETH_ALEN]; 1163 u8 addr3[ETH_ALEN];
1164 __le16 seq_ctl; 1164 __le16 seq_ctl;
1165 u8 addr4[ETH_ALEN]; 1165 u8 addr4[ETH_ALEN];
1166 u8 payload[0]; 1166 u8 payload[0];
1167} __attribute__ ((packed)); 1167} __attribute__ ((packed));
1168 1168
1169struct ieee80211_hdr_3addrqos { 1169struct ieee80211_hdr_3addrqos {
@@ -1173,7 +1173,7 @@ struct ieee80211_hdr_3addrqos {
1173 u8 addr2[ETH_ALEN]; 1173 u8 addr2[ETH_ALEN];
1174 u8 addr3[ETH_ALEN]; 1174 u8 addr3[ETH_ALEN];
1175 __le16 seq_ctl; 1175 __le16 seq_ctl;
1176 u8 payload[0]; 1176 u8 payload[0];
1177 __le16 qos_ctl; 1177 __le16 qos_ctl;
1178} __attribute__ ((packed)); 1178} __attribute__ ((packed));
1179 1179
@@ -1185,7 +1185,7 @@ struct ieee80211_hdr_4addrqos {
1185 u8 addr3[ETH_ALEN]; 1185 u8 addr3[ETH_ALEN];
1186 __le16 seq_ctl; 1186 __le16 seq_ctl;
1187 u8 addr4[ETH_ALEN]; 1187 u8 addr4[ETH_ALEN];
1188 u8 payload[0]; 1188 u8 payload[0];
1189 __le16 qos_ctl; 1189 __le16 qos_ctl;
1190} __attribute__ ((packed)); 1190} __attribute__ ((packed));
1191 1191
@@ -1205,14 +1205,14 @@ struct ieee80211_authentication {
1205} __attribute__ ((packed)); 1205} __attribute__ ((packed));
1206 1206
1207struct ieee80211_disassoc { 1207struct ieee80211_disassoc {
1208 struct ieee80211_hdr_3addr header; 1208 struct ieee80211_hdr_3addr header;
1209 __le16 reason; 1209 __le16 reason;
1210} __attribute__ ((packed)); 1210} __attribute__ ((packed));
1211 1211
1212struct ieee80211_probe_request { 1212struct ieee80211_probe_request {
1213 struct ieee80211_hdr_3addr header; 1213 struct ieee80211_hdr_3addr header;
1214 /* SSID, supported rates */ 1214 /* SSID, supported rates */
1215 struct ieee80211_info_element info_element[0]; 1215 struct ieee80211_info_element info_element[0];
1216} __attribute__ ((packed)); 1216} __attribute__ ((packed));
1217 1217
1218struct ieee80211_probe_response { 1218struct ieee80211_probe_response {
@@ -1220,9 +1220,9 @@ struct ieee80211_probe_response {
1220 u32 time_stamp[2]; 1220 u32 time_stamp[2];
1221 __le16 beacon_interval; 1221 __le16 beacon_interval;
1222 __le16 capability; 1222 __le16 capability;
1223 /* SSID, supported rates, FH params, DS params, 1223 /* SSID, supported rates, FH params, DS params,
1224 * CF params, IBSS params, TIM (if beacon), RSN */ 1224 * CF params, IBSS params, TIM (if beacon), RSN */
1225 struct ieee80211_info_element info_element[0]; 1225 struct ieee80211_info_element info_element[0];
1226} __attribute__ ((packed)); 1226} __attribute__ ((packed));
1227 1227
1228/* Alias beacon for probe_response */ 1228/* Alias beacon for probe_response */
@@ -1233,7 +1233,7 @@ struct ieee80211_assoc_request_frame {
1233 __le16 capability; 1233 __le16 capability;
1234 __le16 listen_interval; 1234 __le16 listen_interval;
1235 /* SSID, supported rates, RSN */ 1235 /* SSID, supported rates, RSN */
1236 struct ieee80211_info_element info_element[0]; 1236 struct ieee80211_info_element info_element[0];
1237} __attribute__ ((packed)); 1237} __attribute__ ((packed));
1238 1238
1239struct ieee80211_reassoc_request_frame { 1239struct ieee80211_reassoc_request_frame {
@@ -1242,7 +1242,7 @@ struct ieee80211_reassoc_request_frame {
1242 __le16 listen_interval; 1242 __le16 listen_interval;
1243 u8 current_ap[ETH_ALEN]; 1243 u8 current_ap[ETH_ALEN];
1244 /* SSID, supported rates, RSN */ 1244 /* SSID, supported rates, RSN */
1245 struct ieee80211_info_element info_element[0]; 1245 struct ieee80211_info_element info_element[0];
1246} __attribute__ ((packed)); 1246} __attribute__ ((packed));
1247 1247
1248struct ieee80211_assoc_response_frame { 1248struct ieee80211_assoc_response_frame {
@@ -1318,7 +1318,7 @@ typedef union _frameqos {
1318#define NETWORK_HAS_QOS_PARAMETERS (1<<3) 1318#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
1319#define NETWORK_HAS_QOS_INFORMATION (1<<4) 1319#define NETWORK_HAS_QOS_INFORMATION (1<<4)
1320#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \ 1320#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \
1321 NETWORK_HAS_QOS_INFORMATION) 1321 NETWORK_HAS_QOS_INFORMATION)
1322/* 802.11h */ 1322/* 802.11h */
1323#define NETWORK_HAS_POWER_CONSTRAINT (1<<5) 1323#define NETWORK_HAS_POWER_CONSTRAINT (1<<5)
1324#define NETWORK_HAS_CSA (1<<6) 1324#define NETWORK_HAS_CSA (1<<6)
@@ -1338,46 +1338,46 @@ typedef union _frameqos {
1338#define QOS_AIFSN_MIN_VALUE 2 1338#define QOS_AIFSN_MIN_VALUE 2
1339#if 1 1339#if 1
1340struct ieee80211_qos_information_element { 1340struct ieee80211_qos_information_element {
1341 u8 elementID; 1341 u8 elementID;
1342 u8 length; 1342 u8 length;
1343 u8 qui[QOS_OUI_LEN]; 1343 u8 qui[QOS_OUI_LEN];
1344 u8 qui_type; 1344 u8 qui_type;
1345 u8 qui_subtype; 1345 u8 qui_subtype;
1346 u8 version; 1346 u8 version;
1347 u8 ac_info; 1347 u8 ac_info;
1348} __attribute__ ((packed)); 1348} __attribute__ ((packed));
1349 1349
1350struct ieee80211_qos_ac_parameter { 1350struct ieee80211_qos_ac_parameter {
1351 u8 aci_aifsn; 1351 u8 aci_aifsn;
1352 u8 ecw_min_max; 1352 u8 ecw_min_max;
1353 __le16 tx_op_limit; 1353 __le16 tx_op_limit;
1354} __attribute__ ((packed)); 1354} __attribute__ ((packed));
1355 1355
1356struct ieee80211_qos_parameter_info { 1356struct ieee80211_qos_parameter_info {
1357 struct ieee80211_qos_information_element info_element; 1357 struct ieee80211_qos_information_element info_element;
1358 u8 reserved; 1358 u8 reserved;
1359 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; 1359 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
1360} __attribute__ ((packed)); 1360} __attribute__ ((packed));
1361 1361
1362struct ieee80211_qos_parameters { 1362struct ieee80211_qos_parameters {
1363 __le16 cw_min[QOS_QUEUE_NUM]; 1363 __le16 cw_min[QOS_QUEUE_NUM];
1364 __le16 cw_max[QOS_QUEUE_NUM]; 1364 __le16 cw_max[QOS_QUEUE_NUM];
1365 u8 aifs[QOS_QUEUE_NUM]; 1365 u8 aifs[QOS_QUEUE_NUM];
1366 u8 flag[QOS_QUEUE_NUM]; 1366 u8 flag[QOS_QUEUE_NUM];
1367 __le16 tx_op_limit[QOS_QUEUE_NUM]; 1367 __le16 tx_op_limit[QOS_QUEUE_NUM];
1368} __attribute__ ((packed)); 1368} __attribute__ ((packed));
1369 1369
1370struct ieee80211_qos_data { 1370struct ieee80211_qos_data {
1371 struct ieee80211_qos_parameters parameters; 1371 struct ieee80211_qos_parameters parameters;
1372 int active; 1372 int active;
1373 int supported; 1373 int supported;
1374 u8 param_count; 1374 u8 param_count;
1375 u8 old_param_count; 1375 u8 old_param_count;
1376}; 1376};
1377 1377
1378struct ieee80211_tim_parameters { 1378struct ieee80211_tim_parameters {
1379 u8 tim_count; 1379 u8 tim_count;
1380 u8 tim_period; 1380 u8 tim_period;
1381} __attribute__ ((packed)); 1381} __attribute__ ((packed));
1382 1382
1383//#else 1383//#else
@@ -1598,10 +1598,10 @@ struct ieee80211_network {
1598 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 1598 u8 ssid[IW_ESSID_MAX_SIZE + 1];
1599 u8 ssid_len; 1599 u8 ssid_len;
1600#if 1 1600#if 1
1601 struct ieee80211_qos_data qos_data; 1601 struct ieee80211_qos_data qos_data;
1602#else 1602#else
1603 // Qos related. Added by Annie, 2005-11-01. 1603 // Qos related. Added by Annie, 2005-11-01.
1604 BSS_QOS BssQos; 1604 BSS_QOS BssQos;
1605#endif 1605#endif
1606 //added by amy for LEAP 1606 //added by amy for LEAP
1607 bool bWithAironetIE; 1607 bool bWithAironetIE;
@@ -1636,15 +1636,15 @@ struct ieee80211_network {
1636 u8 rsn_ie[MAX_WPA_IE_LEN]; 1636 u8 rsn_ie[MAX_WPA_IE_LEN];
1637 size_t rsn_ie_len; 1637 size_t rsn_ie_len;
1638 1638
1639 struct ieee80211_tim_parameters tim; 1639 struct ieee80211_tim_parameters tim;
1640 u8 dtim_period; 1640 u8 dtim_period;
1641 u8 dtim_data; 1641 u8 dtim_data;
1642 u32 last_dtim_sta_time[2]; 1642 u32 last_dtim_sta_time[2];
1643 1643
1644 //appeded for QoS 1644 //appeded for QoS
1645 u8 wmm_info; 1645 u8 wmm_info;
1646 struct ieee80211_wmm_ac_param wmm_param[4]; 1646 struct ieee80211_wmm_ac_param wmm_param[4];
1647 u8 QoS_Enable; 1647 u8 QoS_Enable;
1648#ifdef THOMAS_TURBO 1648#ifdef THOMAS_TURBO
1649 u8 Turbo_Enable;//enable turbo mode, added by thomas 1649 u8 Turbo_Enable;//enable turbo mode, added by thomas
1650#endif 1650#endif
@@ -1652,7 +1652,7 @@ struct ieee80211_network {
1652 u16 CountryIeLen; 1652 u16 CountryIeLen;
1653 u8 CountryIeBuf[MAX_IE_LEN]; 1653 u8 CountryIeBuf[MAX_IE_LEN];
1654#endif 1654#endif
1655 // HT Related, by amy, 2008.04.29 1655 // HT Related, by amy, 2008.04.29
1656 BSS_HT bssht; 1656 BSS_HT bssht;
1657 // Add to handle broadcom AP management frame CCK rate. 1657 // Add to handle broadcom AP management frame CCK rate.
1658 bool broadcom_cap_exist; 1658 bool broadcom_cap_exist;
@@ -1708,13 +1708,13 @@ enum ieee80211_state {
1708}; 1708};
1709#else 1709#else
1710enum ieee80211_state { 1710enum ieee80211_state {
1711 IEEE80211_UNINITIALIZED = 0, 1711 IEEE80211_UNINITIALIZED = 0,
1712 IEEE80211_INITIALIZED, 1712 IEEE80211_INITIALIZED,
1713 IEEE80211_ASSOCIATING, 1713 IEEE80211_ASSOCIATING,
1714 IEEE80211_ASSOCIATED, 1714 IEEE80211_ASSOCIATED,
1715 IEEE80211_AUTHENTICATING, 1715 IEEE80211_AUTHENTICATING,
1716 IEEE80211_AUTHENTICATED, 1716 IEEE80211_AUTHENTICATED,
1717 IEEE80211_SHUTDOWN 1717 IEEE80211_SHUTDOWN
1718}; 1718};
1719#endif 1719#endif
1720 1720
@@ -1728,17 +1728,17 @@ enum ieee80211_state {
1728#define IEEE80211_24GHZ_MIN_CHANNEL 1 1728#define IEEE80211_24GHZ_MIN_CHANNEL 1
1729#define IEEE80211_24GHZ_MAX_CHANNEL 14 1729#define IEEE80211_24GHZ_MAX_CHANNEL 14
1730#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ 1730#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \
1731 IEEE80211_24GHZ_MIN_CHANNEL + 1) 1731 IEEE80211_24GHZ_MIN_CHANNEL + 1)
1732 1732
1733#define IEEE80211_52GHZ_MIN_CHANNEL 34 1733#define IEEE80211_52GHZ_MIN_CHANNEL 34
1734#define IEEE80211_52GHZ_MAX_CHANNEL 165 1734#define IEEE80211_52GHZ_MAX_CHANNEL 165
1735#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ 1735#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
1736 IEEE80211_52GHZ_MIN_CHANNEL + 1) 1736 IEEE80211_52GHZ_MIN_CHANNEL + 1)
1737 1737
1738#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) 1738#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11))
1739extern inline int is_multicast_ether_addr(const u8 *addr) 1739extern inline int is_multicast_ether_addr(const u8 *addr)
1740{ 1740{
1741 return ((addr[0] != 0xff) && (0x01 & addr[0])); 1741 return ((addr[0] != 0xff) && (0x01 & addr[0]));
1742} 1742}
1743#endif 1743#endif
1744 1744
@@ -1910,7 +1910,7 @@ typedef struct _RT_LINK_DETECT_T{
1910 1910
1911struct ieee80211_device { 1911struct ieee80211_device {
1912 struct net_device *dev; 1912 struct net_device *dev;
1913 struct ieee80211_security sec; 1913 struct ieee80211_security sec;
1914 1914
1915 //hw security related 1915 //hw security related
1916// u8 hwsec_support; //support? 1916// u8 hwsec_support; //support?
@@ -2000,15 +2000,15 @@ struct ieee80211_device {
2000 int host_encrypt; 2000 int host_encrypt;
2001 int host_encrypt_msdu; 2001 int host_encrypt_msdu;
2002 int host_decrypt; 2002 int host_decrypt;
2003 /* host performs multicast decryption */ 2003 /* host performs multicast decryption */
2004 int host_mc_decrypt; 2004 int host_mc_decrypt;
2005 2005
2006 /* host should strip IV and ICV from protected frames */ 2006 /* host should strip IV and ICV from protected frames */
2007 /* meaningful only when hardware decryption is being used */ 2007 /* meaningful only when hardware decryption is being used */
2008 int host_strip_iv_icv; 2008 int host_strip_iv_icv;
2009 2009
2010 int host_open_frag; 2010 int host_open_frag;
2011 int host_build_iv; 2011 int host_build_iv;
2012 int ieee802_1x; /* is IEEE 802.1X used */ 2012 int ieee802_1x; /* is IEEE 802.1X used */
2013 2013
2014 /* WPA data */ 2014 /* WPA data */
@@ -2026,7 +2026,7 @@ struct ieee80211_device {
2026 struct ieee80211_crypt_data *crypt[WEP_KEYS]; 2026 struct ieee80211_crypt_data *crypt[WEP_KEYS];
2027 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ 2027 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
2028 struct timer_list crypt_deinit_timer; 2028 struct timer_list crypt_deinit_timer;
2029 int crypt_quiesced; 2029 int crypt_quiesced;
2030 2030
2031 int bcrx_sta_key; /* use individual keys to override default keys even 2031 int bcrx_sta_key; /* use individual keys to override default keys even
2032 * with RX of broad/multicast frames */ 2032 * with RX of broad/multicast frames */
@@ -2039,10 +2039,10 @@ struct ieee80211_device {
2039#define DEFAULT_RTS_THRESHOLD 2346U 2039#define DEFAULT_RTS_THRESHOLD 2346U
2040#define MIN_RTS_THRESHOLD 1 2040#define MIN_RTS_THRESHOLD 1
2041#define MAX_RTS_THRESHOLD 2346U 2041#define MAX_RTS_THRESHOLD 2346U
2042 u16 rts; /* RTS threshold */ 2042 u16 rts; /* RTS threshold */
2043 2043
2044 /* Association info */ 2044 /* Association info */
2045 u8 bssid[ETH_ALEN]; 2045 u8 bssid[ETH_ALEN];
2046 2046
2047 /* This stores infos for the current network. 2047 /* This stores infos for the current network.
2048 * Either the network we are associated in INFRASTRUCTURE 2048 * Either the network we are associated in INFRASTRUCTURE
@@ -2068,10 +2068,10 @@ struct ieee80211_device {
2068 */ 2068 */
2069 short sync_scan_hurryup; 2069 short sync_scan_hurryup;
2070 2070
2071 int perfect_rssi; 2071 int perfect_rssi;
2072 int worst_rssi; 2072 int worst_rssi;
2073 2073
2074 u16 prev_seq_ctl; /* used to drop duplicate frames */ 2074 u16 prev_seq_ctl; /* used to drop duplicate frames */
2075 2075
2076 /* map of allowed channels. 0 is dummy */ 2076 /* map of allowed channels. 0 is dummy */
2077 // FIXME: remeber to default to a basic channel plan depending of the PHY type 2077 // FIXME: remeber to default to a basic channel plan depending of the PHY type
@@ -2184,7 +2184,7 @@ struct ieee80211_device {
2184 2184
2185 //added by amy for AP roaming 2185 //added by amy for AP roaming
2186 RT_LINK_DETECT_T LinkDetectInfo; 2186 RT_LINK_DETECT_T LinkDetectInfo;
2187 //added by amy for ps 2187 //added by amy for ps
2188 RT_POWER_SAVE_CONTROL PowerSaveControl; 2188 RT_POWER_SAVE_CONTROL PowerSaveControl;
2189//} 2189//}
2190 /* used if IEEE_SOFTMAC_TX_QUEUE is set */ 2190 /* used if IEEE_SOFTMAC_TX_QUEUE is set */
@@ -2196,19 +2196,19 @@ struct ieee80211_device {
2196 /* used if IEEE_SOFTMAC_BEACONS is set */ 2196 /* used if IEEE_SOFTMAC_BEACONS is set */
2197 struct timer_list beacon_timer; 2197 struct timer_list beacon_timer;
2198#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2198#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
2199 struct work_struct associate_complete_wq; 2199 struct work_struct associate_complete_wq;
2200 struct work_struct associate_procedure_wq; 2200 struct work_struct associate_procedure_wq;
2201#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2201#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
2202 struct delayed_work softmac_scan_wq; 2202 struct delayed_work softmac_scan_wq;
2203 struct delayed_work associate_retry_wq; 2203 struct delayed_work associate_retry_wq;
2204 struct delayed_work start_ibss_wq; 2204 struct delayed_work start_ibss_wq;
2205#else 2205#else
2206 struct work_struct softmac_scan_wq; 2206 struct work_struct softmac_scan_wq;
2207 struct work_struct associate_retry_wq; 2207 struct work_struct associate_retry_wq;
2208 struct work_struct start_ibss_wq; 2208 struct work_struct start_ibss_wq;
2209#endif 2209#endif
2210 struct work_struct wx_sync_scan_wq; 2210 struct work_struct wx_sync_scan_wq;
2211 struct workqueue_struct *wq; 2211 struct workqueue_struct *wq;
2212#else 2212#else
2213 /* used for periodly scan */ 2213 /* used for periodly scan */
2214 struct timer_list scan_timer; 2214 struct timer_list scan_timer;
@@ -2221,10 +2221,10 @@ struct ieee80211_device {
2221 struct tq_struct wx_sync_scan_wq; 2221 struct tq_struct wx_sync_scan_wq;
2222 2222
2223#endif 2223#endif
2224 // Qos related. Added by Annie, 2005-11-01. 2224 // Qos related. Added by Annie, 2005-11-01.
2225 //STA_QOS StaQos; 2225 //STA_QOS StaQos;
2226 2226
2227 //u32 STA_EDCA_PARAM[4]; 2227 //u32 STA_EDCA_PARAM[4];
2228 //CHANNEL_ACCESS_SETTING ChannelAccessSetting; 2228 //CHANNEL_ACCESS_SETTING ChannelAccessSetting;
2229 2229
2230 2230
@@ -2240,11 +2240,11 @@ struct ieee80211_device {
2240 struct net_device *dev); 2240 struct net_device *dev);
2241 2241
2242 int (*reset_port)(struct net_device *dev); 2242 int (*reset_port)(struct net_device *dev);
2243 int (*is_queue_full) (struct net_device * dev, int pri); 2243 int (*is_queue_full) (struct net_device * dev, int pri);
2244 2244
2245 int (*handle_management) (struct net_device * dev, 2245 int (*handle_management) (struct net_device * dev,
2246 struct ieee80211_network * network, u16 type); 2246 struct ieee80211_network * network, u16 type);
2247 int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); 2247 int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb);
2248 2248
2249 /* Softmac-generated frames (mamagement) are TXed via this 2249 /* Softmac-generated frames (mamagement) are TXed via this
2250 * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is 2250 * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is
@@ -2322,32 +2322,32 @@ struct ieee80211_device {
2322 short (*ps_is_queue_empty) (struct net_device *dev); 2322 short (*ps_is_queue_empty) (struct net_device *dev);
2323#if 0 2323#if 0
2324 /* Typical STA methods */ 2324 /* Typical STA methods */
2325 int (*handle_auth) (struct net_device * dev, 2325 int (*handle_auth) (struct net_device * dev,
2326 struct ieee80211_auth * auth); 2326 struct ieee80211_auth * auth);
2327 int (*handle_deauth) (struct net_device * dev, 2327 int (*handle_deauth) (struct net_device * dev,
2328 struct ieee80211_deauth * auth); 2328 struct ieee80211_deauth * auth);
2329 int (*handle_action) (struct net_device * dev, 2329 int (*handle_action) (struct net_device * dev,
2330 struct ieee80211_action * action, 2330 struct ieee80211_action * action,
2331 struct ieee80211_rx_stats * stats); 2331 struct ieee80211_rx_stats * stats);
2332 int (*handle_disassoc) (struct net_device * dev, 2332 int (*handle_disassoc) (struct net_device * dev,
2333 struct ieee80211_disassoc * assoc); 2333 struct ieee80211_disassoc * assoc);
2334#endif 2334#endif
2335 int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); 2335 int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network);
2336#if 0 2336#if 0
2337 int (*handle_probe_response) (struct net_device * dev, 2337 int (*handle_probe_response) (struct net_device * dev,
2338 struct ieee80211_probe_response * resp, 2338 struct ieee80211_probe_response * resp,
2339 struct ieee80211_network * network); 2339 struct ieee80211_network * network);
2340 int (*handle_probe_request) (struct net_device * dev, 2340 int (*handle_probe_request) (struct net_device * dev,
2341 struct ieee80211_probe_request * req, 2341 struct ieee80211_probe_request * req,
2342 struct ieee80211_rx_stats * stats); 2342 struct ieee80211_rx_stats * stats);
2343#endif 2343#endif
2344 int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); 2344 int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network);
2345 2345
2346#if 0 2346#if 0
2347 /* Typical AP methods */ 2347 /* Typical AP methods */
2348 int (*handle_assoc_request) (struct net_device * dev); 2348 int (*handle_assoc_request) (struct net_device * dev);
2349 int (*handle_reassoc_request) (struct net_device * dev, 2349 int (*handle_reassoc_request) (struct net_device * dev,
2350 struct ieee80211_reassoc_request * req); 2350 struct ieee80211_reassoc_request * req);
2351#endif 2351#endif
2352 2352
2353 /* check whether Tx hw resouce available */ 2353 /* check whether Tx hw resouce available */
@@ -2484,45 +2484,45 @@ extern inline int ieee80211_get_hdrlen(u16 fc)
2484 2484
2485static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) 2485static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
2486{ 2486{
2487 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { 2487 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
2488 case IEEE80211_1ADDR_LEN: 2488 case IEEE80211_1ADDR_LEN:
2489 return ((struct ieee80211_hdr_1addr *)hdr)->payload; 2489 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
2490 case IEEE80211_2ADDR_LEN: 2490 case IEEE80211_2ADDR_LEN:
2491 return ((struct ieee80211_hdr_2addr *)hdr)->payload; 2491 return ((struct ieee80211_hdr_2addr *)hdr)->payload;
2492 case IEEE80211_3ADDR_LEN: 2492 case IEEE80211_3ADDR_LEN:
2493 return ((struct ieee80211_hdr_3addr *)hdr)->payload; 2493 return ((struct ieee80211_hdr_3addr *)hdr)->payload;
2494 case IEEE80211_4ADDR_LEN: 2494 case IEEE80211_4ADDR_LEN:
2495 return ((struct ieee80211_hdr_4addr *)hdr)->payload; 2495 return ((struct ieee80211_hdr_4addr *)hdr)->payload;
2496 } 2496 }
2497 return NULL; 2497 return NULL;
2498} 2498}
2499 2499
2500static inline int ieee80211_is_ofdm_rate(u8 rate) 2500static inline int ieee80211_is_ofdm_rate(u8 rate)
2501{ 2501{
2502 switch (rate & ~IEEE80211_BASIC_RATE_MASK) { 2502 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
2503 case IEEE80211_OFDM_RATE_6MB: 2503 case IEEE80211_OFDM_RATE_6MB:
2504 case IEEE80211_OFDM_RATE_9MB: 2504 case IEEE80211_OFDM_RATE_9MB:
2505 case IEEE80211_OFDM_RATE_12MB: 2505 case IEEE80211_OFDM_RATE_12MB:
2506 case IEEE80211_OFDM_RATE_18MB: 2506 case IEEE80211_OFDM_RATE_18MB:
2507 case IEEE80211_OFDM_RATE_24MB: 2507 case IEEE80211_OFDM_RATE_24MB:
2508 case IEEE80211_OFDM_RATE_36MB: 2508 case IEEE80211_OFDM_RATE_36MB:
2509 case IEEE80211_OFDM_RATE_48MB: 2509 case IEEE80211_OFDM_RATE_48MB:
2510 case IEEE80211_OFDM_RATE_54MB: 2510 case IEEE80211_OFDM_RATE_54MB:
2511 return 1; 2511 return 1;
2512 } 2512 }
2513 return 0; 2513 return 0;
2514} 2514}
2515 2515
2516static inline int ieee80211_is_cck_rate(u8 rate) 2516static inline int ieee80211_is_cck_rate(u8 rate)
2517{ 2517{
2518 switch (rate & ~IEEE80211_BASIC_RATE_MASK) { 2518 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
2519 case IEEE80211_CCK_RATE_1MB: 2519 case IEEE80211_CCK_RATE_1MB:
2520 case IEEE80211_CCK_RATE_2MB: 2520 case IEEE80211_CCK_RATE_2MB:
2521 case IEEE80211_CCK_RATE_5MB: 2521 case IEEE80211_CCK_RATE_5MB:
2522 case IEEE80211_CCK_RATE_11MB: 2522 case IEEE80211_CCK_RATE_11MB:
2523 return 1; 2523 return 1;
2524 } 2524 }
2525 return 0; 2525 return 0;
2526} 2526}
2527 2527
2528 2528
@@ -2563,17 +2563,17 @@ extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
2563 union iwreq_data *wrqu, char *key); 2563 union iwreq_data *wrqu, char *key);
2564#if WIRELESS_EXT >= 18 2564#if WIRELESS_EXT >= 18
2565extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, 2565extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
2566 struct iw_request_info *info, 2566 struct iw_request_info *info,
2567 union iwreq_data* wrqu, char *extra); 2567 union iwreq_data* wrqu, char *extra);
2568extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, 2568extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
2569 struct iw_request_info *info, 2569 struct iw_request_info *info,
2570 union iwreq_data* wrqu, char *extra); 2570 union iwreq_data* wrqu, char *extra);
2571extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee, 2571extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
2572 struct iw_request_info *info, 2572 struct iw_request_info *info,
2573 struct iw_param *data, char *extra); 2573 struct iw_param *data, char *extra);
2574extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, 2574extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
2575 struct iw_request_info *info, 2575 struct iw_request_info *info,
2576 union iwreq_data *wrqu, char *extra); 2576 union iwreq_data *wrqu, char *extra);
2577#endif 2577#endif
2578extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len); 2578extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len);
2579 2579
@@ -2730,13 +2730,13 @@ extern void RxBaInactTimeout(unsigned long data);
2730extern void ResetBaEntry( PBA_RECORD pBA); 2730extern void ResetBaEntry( PBA_RECORD pBA);
2731//function in TS.c 2731//function in TS.c
2732extern bool GetTs( 2732extern bool GetTs(
2733 struct ieee80211_device* ieee, 2733 struct ieee80211_device* ieee,
2734 PTS_COMMON_INFO *ppTS, 2734 PTS_COMMON_INFO *ppTS,
2735 u8* Addr, 2735 u8* Addr,
2736 u8 TID, 2736 u8 TID,
2737 TR_SELECT TxRxSelect, //Rx:1, Tx:0 2737 TR_SELECT TxRxSelect, //Rx:1, Tx:0
2738 bool bAddNewTs 2738 bool bAddNewTs
2739 ); 2739 );
2740extern void TSInitialize(struct ieee80211_device *ieee); 2740extern void TSInitialize(struct ieee80211_device *ieee);
2741extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS); 2741extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS);
2742extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr); 2742extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr);
diff --git a/drivers/staging/rtl8192u/ieee80211/aes.c b/drivers/staging/rtl8192u/ieee80211/aes.c
index 0c176e29a79..a6bb6c9207d 100644
--- a/drivers/staging/rtl8192u/ieee80211/aes.c
+++ b/drivers/staging/rtl8192u/ieee80211/aes.c
@@ -126,15 +126,15 @@ f_mult (u8 a, u8 b)
126 126
127#define f_rn(bo, bi, n, k) \ 127#define f_rn(bo, bi, n, k) \
128 bo[n] = ft_tab[0][byte(bi[n],0)] ^ \ 128 bo[n] = ft_tab[0][byte(bi[n],0)] ^ \
129 ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ 129 ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
130 ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ 130 ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
131 ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) 131 ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
132 132
133#define i_rn(bo, bi, n, k) \ 133#define i_rn(bo, bi, n, k) \
134 bo[n] = it_tab[0][byte(bi[n],0)] ^ \ 134 bo[n] = it_tab[0][byte(bi[n],0)] ^ \
135 it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ 135 it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
136 it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ 136 it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
137 it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) 137 it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
138 138
139#define ls_box(x) \ 139#define ls_box(x) \
140 ( fl_tab[0][byte(x, 0)] ^ \ 140 ( fl_tab[0][byte(x, 0)] ^ \
@@ -144,15 +144,15 @@ f_mult (u8 a, u8 b)
144 144
145#define f_rl(bo, bi, n, k) \ 145#define f_rl(bo, bi, n, k) \
146 bo[n] = fl_tab[0][byte(bi[n],0)] ^ \ 146 bo[n] = fl_tab[0][byte(bi[n],0)] ^ \
147 fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ 147 fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \
148 fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ 148 fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
149 fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) 149 fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n)
150 150
151#define i_rl(bo, bi, n, k) \ 151#define i_rl(bo, bi, n, k) \
152 bo[n] = il_tab[0][byte(bi[n],0)] ^ \ 152 bo[n] = il_tab[0][byte(bi[n],0)] ^ \
153 il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ 153 il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \
154 il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ 154 il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \
155 il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) 155 il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n)
156 156
157static void __init 157static void __init
158gen_tabs (void) 158gen_tabs (void)
@@ -234,8 +234,8 @@ gen_tabs (void)
234 t = w ^ (x); \ 234 t = w ^ (x); \
235 (y) = u ^ v ^ w; \ 235 (y) = u ^ v ^ w; \
236 (y) ^= rotr(u ^ t, 8) ^ \ 236 (y) ^= rotr(u ^ t, 8) ^ \
237 rotr(v ^ t, 16) ^ \ 237 rotr(v ^ t, 16) ^ \
238 rotr(t,24) 238 rotr(t,24)
239 239
240/* initialise the key schedule from the user supplied key */ 240/* initialise the key schedule from the user supplied key */
241 241
@@ -443,9 +443,9 @@ static struct crypto_alg aes_alg = {
443 .cipher = { 443 .cipher = {
444 .cia_min_keysize = AES_MIN_KEY_SIZE, 444 .cia_min_keysize = AES_MIN_KEY_SIZE,
445 .cia_max_keysize = AES_MAX_KEY_SIZE, 445 .cia_max_keysize = AES_MAX_KEY_SIZE,
446 .cia_setkey = aes_set_key, 446 .cia_setkey = aes_set_key,
447 .cia_encrypt = aes_encrypt, 447 .cia_encrypt = aes_encrypt,
448 .cia_decrypt = aes_decrypt 448 .cia_decrypt = aes_decrypt
449 } 449 }
450 } 450 }
451}; 451};
diff --git a/drivers/staging/rtl8192u/ieee80211/arc4.c b/drivers/staging/rtl8192u/ieee80211/arc4.c
index e408472af30..e3ad8d2f415 100644
--- a/drivers/staging/rtl8192u/ieee80211/arc4.c
+++ b/drivers/staging/rtl8192u/ieee80211/arc4.c
@@ -79,9 +79,9 @@ static struct crypto_alg arc4_alg = {
79 .cra_u = { .cipher = { 79 .cra_u = { .cipher = {
80 .cia_min_keysize = ARC4_MIN_KEY_SIZE, 80 .cia_min_keysize = ARC4_MIN_KEY_SIZE,
81 .cia_max_keysize = ARC4_MAX_KEY_SIZE, 81 .cia_max_keysize = ARC4_MAX_KEY_SIZE,
82 .cia_setkey = arc4_set_key, 82 .cia_setkey = arc4_set_key,
83 .cia_encrypt = arc4_crypt, 83 .cia_encrypt = arc4_crypt,
84 .cia_decrypt = arc4_crypt } } 84 .cia_decrypt = arc4_crypt } }
85}; 85};
86 86
87static int __init arc4_init(void) 87static int __init arc4_init(void)
diff --git a/drivers/staging/rtl8192u/ieee80211/cipher.c b/drivers/staging/rtl8192u/ieee80211/cipher.c
index 1968acfe32b..0b9e8a4ae7b 100644
--- a/drivers/staging/rtl8192u/ieee80211/cipher.c
+++ b/drivers/staging/rtl8192u/ieee80211/cipher.c
@@ -23,7 +23,7 @@
23 23
24typedef void (cryptfn_t)(void *, u8 *, const u8 *); 24typedef void (cryptfn_t)(void *, u8 *, const u8 *);
25typedef void (procfn_t)(struct crypto_tfm *, u8 *, 25typedef void (procfn_t)(struct crypto_tfm *, u8 *,
26 u8*, cryptfn_t, int enc, void *, int); 26 u8*, cryptfn_t, int enc, void *, int);
27 27
28static inline void xor_64(u8 *a, const u8 *b) 28static inline void xor_64(u8 *a, const u8 *b)
29{ 29{
@@ -48,8 +48,8 @@ static inline void xor_128(u8 *a, const u8 *b)
48static int crypt(struct crypto_tfm *tfm, 48static int crypt(struct crypto_tfm *tfm,
49 struct scatterlist *dst, 49 struct scatterlist *dst,
50 struct scatterlist *src, 50 struct scatterlist *src,
51 unsigned int nbytes, cryptfn_t crfn, 51 unsigned int nbytes, cryptfn_t crfn,
52 procfn_t prfn, int enc, void *info) 52 procfn_t prfn, int enc, void *info)
53{ 53{
54 struct scatter_walk walk_in, walk_out; 54 struct scatter_walk walk_in, walk_out;
55 const unsigned int bsize = crypto_tfm_alg_blocksize(tfm); 55 const unsigned int bsize = crypto_tfm_alg_blocksize(tfm);
@@ -136,80 +136,80 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
136 return -EINVAL; 136 return -EINVAL;
137 } else 137 } else
138 return cia->cia_setkey(crypto_tfm_ctx(tfm), key, keylen, 138 return cia->cia_setkey(crypto_tfm_ctx(tfm), key, keylen,
139 &tfm->crt_flags); 139 &tfm->crt_flags);
140} 140}
141 141
142static int ecb_encrypt(struct crypto_tfm *tfm, 142static int ecb_encrypt(struct crypto_tfm *tfm,
143 struct scatterlist *dst, 143 struct scatterlist *dst,
144 struct scatterlist *src, unsigned int nbytes) 144 struct scatterlist *src, unsigned int nbytes)
145{ 145{
146 return crypt(tfm, dst, src, nbytes, 146 return crypt(tfm, dst, src, nbytes,
147 tfm->__crt_alg->cra_cipher.cia_encrypt, 147 tfm->__crt_alg->cra_cipher.cia_encrypt,
148 ecb_process, 1, NULL); 148 ecb_process, 1, NULL);
149} 149}
150 150
151static int ecb_decrypt(struct crypto_tfm *tfm, 151static int ecb_decrypt(struct crypto_tfm *tfm,
152 struct scatterlist *dst, 152 struct scatterlist *dst,
153 struct scatterlist *src, 153 struct scatterlist *src,
154 unsigned int nbytes) 154 unsigned int nbytes)
155{ 155{
156 return crypt(tfm, dst, src, nbytes, 156 return crypt(tfm, dst, src, nbytes,
157 tfm->__crt_alg->cra_cipher.cia_decrypt, 157 tfm->__crt_alg->cra_cipher.cia_decrypt,
158 ecb_process, 1, NULL); 158 ecb_process, 1, NULL);
159} 159}
160 160
161static int cbc_encrypt(struct crypto_tfm *tfm, 161static int cbc_encrypt(struct crypto_tfm *tfm,
162 struct scatterlist *dst, 162 struct scatterlist *dst,
163 struct scatterlist *src, 163 struct scatterlist *src,
164 unsigned int nbytes) 164 unsigned int nbytes)
165{ 165{
166 return crypt(tfm, dst, src, nbytes, 166 return crypt(tfm, dst, src, nbytes,
167 tfm->__crt_alg->cra_cipher.cia_encrypt, 167 tfm->__crt_alg->cra_cipher.cia_encrypt,
168 cbc_process, 1, tfm->crt_cipher.cit_iv); 168 cbc_process, 1, tfm->crt_cipher.cit_iv);
169} 169}
170 170
171static int cbc_encrypt_iv(struct crypto_tfm *tfm, 171static int cbc_encrypt_iv(struct crypto_tfm *tfm,
172 struct scatterlist *dst, 172 struct scatterlist *dst,
173 struct scatterlist *src, 173 struct scatterlist *src,
174 unsigned int nbytes, u8 *iv) 174 unsigned int nbytes, u8 *iv)
175{ 175{
176 return crypt(tfm, dst, src, nbytes, 176 return crypt(tfm, dst, src, nbytes,
177 tfm->__crt_alg->cra_cipher.cia_encrypt, 177 tfm->__crt_alg->cra_cipher.cia_encrypt,
178 cbc_process, 1, iv); 178 cbc_process, 1, iv);
179} 179}
180 180
181static int cbc_decrypt(struct crypto_tfm *tfm, 181static int cbc_decrypt(struct crypto_tfm *tfm,
182 struct scatterlist *dst, 182 struct scatterlist *dst,
183 struct scatterlist *src, 183 struct scatterlist *src,
184 unsigned int nbytes) 184 unsigned int nbytes)
185{ 185{
186 return crypt(tfm, dst, src, nbytes, 186 return crypt(tfm, dst, src, nbytes,
187 tfm->__crt_alg->cra_cipher.cia_decrypt, 187 tfm->__crt_alg->cra_cipher.cia_decrypt,
188 cbc_process, 0, tfm->crt_cipher.cit_iv); 188 cbc_process, 0, tfm->crt_cipher.cit_iv);
189} 189}
190 190
191static int cbc_decrypt_iv(struct crypto_tfm *tfm, 191static int cbc_decrypt_iv(struct crypto_tfm *tfm,
192 struct scatterlist *dst, 192 struct scatterlist *dst,
193 struct scatterlist *src, 193 struct scatterlist *src,
194 unsigned int nbytes, u8 *iv) 194 unsigned int nbytes, u8 *iv)
195{ 195{
196 return crypt(tfm, dst, src, nbytes, 196 return crypt(tfm, dst, src, nbytes,
197 tfm->__crt_alg->cra_cipher.cia_decrypt, 197 tfm->__crt_alg->cra_cipher.cia_decrypt,
198 cbc_process, 0, iv); 198 cbc_process, 0, iv);
199} 199}
200 200
201static int nocrypt(struct crypto_tfm *tfm, 201static int nocrypt(struct crypto_tfm *tfm,
202 struct scatterlist *dst, 202 struct scatterlist *dst,
203 struct scatterlist *src, 203 struct scatterlist *src,
204 unsigned int nbytes) 204 unsigned int nbytes)
205{ 205{
206 return -ENOSYS; 206 return -ENOSYS;
207} 207}
208 208
209static int nocrypt_iv(struct crypto_tfm *tfm, 209static int nocrypt_iv(struct crypto_tfm *tfm,
210 struct scatterlist *dst, 210 struct scatterlist *dst,
211 struct scatterlist *src, 211 struct scatterlist *src,
212 unsigned int nbytes, u8 *iv) 212 unsigned int nbytes, u8 *iv)
213{ 213{
214 return -ENOSYS; 214 return -ENOSYS;
215} 215}
@@ -265,25 +265,25 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm)
265 265
266 if (ops->cit_mode == CRYPTO_TFM_MODE_CBC) { 266 if (ops->cit_mode == CRYPTO_TFM_MODE_CBC) {
267 267
268 switch (crypto_tfm_alg_blocksize(tfm)) { 268 switch (crypto_tfm_alg_blocksize(tfm)) {
269 case 8: 269 case 8:
270 ops->cit_xor_block = xor_64; 270 ops->cit_xor_block = xor_64;
271 break; 271 break;
272 272
273 case 16: 273 case 16:
274 ops->cit_xor_block = xor_128; 274 ops->cit_xor_block = xor_128;
275 break; 275 break;
276 276
277 default: 277 default:
278 printk(KERN_WARNING "%s: block size %u not supported\n", 278 printk(KERN_WARNING "%s: block size %u not supported\n",
279 crypto_tfm_alg_name(tfm), 279 crypto_tfm_alg_name(tfm),
280 crypto_tfm_alg_blocksize(tfm)); 280 crypto_tfm_alg_blocksize(tfm));
281 ret = -EINVAL; 281 ret = -EINVAL;
282 goto out; 282 goto out;
283 } 283 }
284 284
285 ops->cit_ivsize = crypto_tfm_alg_blocksize(tfm); 285 ops->cit_ivsize = crypto_tfm_alg_blocksize(tfm);
286 ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL); 286 ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL);
287 if (ops->cit_iv == NULL) 287 if (ops->cit_iv == NULL)
288 ret = -ENOMEM; 288 ret = -ENOMEM;
289 } 289 }
diff --git a/drivers/staging/rtl8192u/ieee80211/compress.c b/drivers/staging/rtl8192u/ieee80211/compress.c
index c2df80e2ed9..86c23c9223f 100644
--- a/drivers/staging/rtl8192u/ieee80211/compress.c
+++ b/drivers/staging/rtl8192u/ieee80211/compress.c
@@ -20,21 +20,21 @@
20#include "internal.h" 20#include "internal.h"
21 21
22static int crypto_compress(struct crypto_tfm *tfm, 22static int crypto_compress(struct crypto_tfm *tfm,
23 const u8 *src, unsigned int slen, 23 const u8 *src, unsigned int slen,
24 u8 *dst, unsigned int *dlen) 24 u8 *dst, unsigned int *dlen)
25{ 25{
26 return tfm->__crt_alg->cra_compress.coa_compress(crypto_tfm_ctx(tfm), 26 return tfm->__crt_alg->cra_compress.coa_compress(crypto_tfm_ctx(tfm),
27 src, slen, dst, 27 src, slen, dst,
28 dlen); 28 dlen);
29} 29}
30 30
31static int crypto_decompress(struct crypto_tfm *tfm, 31static int crypto_decompress(struct crypto_tfm *tfm,
32 const u8 *src, unsigned int slen, 32 const u8 *src, unsigned int slen,
33 u8 *dst, unsigned int *dlen) 33 u8 *dst, unsigned int *dlen)
34{ 34{
35 return tfm->__crt_alg->cra_compress.coa_decompress(crypto_tfm_ctx(tfm), 35 return tfm->__crt_alg->cra_compress.coa_decompress(crypto_tfm_ctx(tfm),
36 src, slen, dst, 36 src, slen, dst,
37 dlen); 37 dlen);
38} 38}
39 39
40int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags) 40int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags)
diff --git a/drivers/staging/rtl8192u/ieee80211/crypto_compat.h b/drivers/staging/rtl8192u/ieee80211/crypto_compat.h
index 587e8bb2db6..c7f26ffa248 100644
--- a/drivers/staging/rtl8192u/ieee80211/crypto_compat.h
+++ b/drivers/staging/rtl8192u/ieee80211/crypto_compat.h
@@ -12,9 +12,9 @@
12#include <linux/crypto.h> 12#include <linux/crypto.h>
13 13
14static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, 14static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
15 struct scatterlist *dst, 15 struct scatterlist *dst,
16 struct scatterlist *src, 16 struct scatterlist *src,
17 unsigned int nbytes) 17 unsigned int nbytes)
18{ 18{
19 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 19 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
20 return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); 20 return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
@@ -22,9 +22,9 @@ static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
22 22
23 23
24static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, 24static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
25 struct scatterlist *dst, 25 struct scatterlist *dst,
26 struct scatterlist *src, 26 struct scatterlist *src,
27 unsigned int nbytes) 27 unsigned int nbytes)
28{ 28{
29 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 29 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
30 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); 30 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
diff --git a/drivers/staging/rtl8192u/ieee80211/digest.c b/drivers/staging/rtl8192u/ieee80211/digest.c
index 1a95f2d3783..301ed514ac9 100644
--- a/drivers/staging/rtl8192u/ieee80211/digest.c
+++ b/drivers/staging/rtl8192u/ieee80211/digest.c
@@ -25,7 +25,7 @@ static void init(struct crypto_tfm *tfm)
25} 25}
26 26
27static void update(struct crypto_tfm *tfm, 27static void update(struct crypto_tfm *tfm,
28 struct scatterlist *sg, unsigned int nsg) 28 struct scatterlist *sg, unsigned int nsg)
29{ 29{
30 unsigned int i; 30 unsigned int i;
31 31
@@ -68,7 +68,7 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
68} 68}
69 69
70static void digest(struct crypto_tfm *tfm, 70static void digest(struct crypto_tfm *tfm,
71 struct scatterlist *sg, unsigned int nsg, u8 *out) 71 struct scatterlist *sg, unsigned int nsg, u8 *out)
72{ 72{
73 unsigned int i; 73 unsigned int i;
74 74
@@ -77,7 +77,7 @@ static void digest(struct crypto_tfm *tfm,
77 for (i = 0; i < nsg; i++) { 77 for (i = 0; i < nsg; i++) {
78 char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset; 78 char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset;
79 tfm->__crt_alg->cra_digest.dia_update(crypto_tfm_ctx(tfm), 79 tfm->__crt_alg->cra_digest.dia_update(crypto_tfm_ctx(tfm),
80 p, sg[i].length); 80 p, sg[i].length);
81 crypto_kunmap(p, 0); 81 crypto_kunmap(p, 0);
82 crypto_yield(tfm); 82 crypto_yield(tfm);
83 } 83 }
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index e99c6ede42a..0dd773733f6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -86,8 +86,8 @@ struct iw_spy_data{
86 * 86 *
87 */ 87 */
88#define container_of(ptr, type, member) ({ \ 88#define container_of(ptr, type, member) ({ \
89 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 89 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
90 (type *)( (char *)__mptr - offsetof(type,member) );}) 90 (type *)( (char *)__mptr - offsetof(type,member) );})
91#endif 91#endif
92 92
93#define KEY_TYPE_NA 0x0 93#define KEY_TYPE_NA 0x0
@@ -125,61 +125,61 @@ struct iw_spy_data{
125/* defined for skb cb field */ 125/* defined for skb cb field */
126/* At most 28 byte */ 126/* At most 28 byte */
127typedef struct cb_desc { 127typedef struct cb_desc {
128 /* Tx Desc Related flags (8-9) */ 128 /* Tx Desc Related flags (8-9) */
129 u8 bLastIniPkt:1; 129 u8 bLastIniPkt:1;
130 u8 bCmdOrInit:1; 130 u8 bCmdOrInit:1;
131 u8 bFirstSeg:1; 131 u8 bFirstSeg:1;
132 u8 bLastSeg:1; 132 u8 bLastSeg:1;
133 u8 bEncrypt:1; 133 u8 bEncrypt:1;
134 u8 bTxDisableRateFallBack:1; 134 u8 bTxDisableRateFallBack:1;
135 u8 bTxUseDriverAssingedRate:1; 135 u8 bTxUseDriverAssingedRate:1;
136 u8 bHwSec:1; //indicate whether use Hw security. WB 136 u8 bHwSec:1; //indicate whether use Hw security. WB
137 137
138 u8 reserved1; 138 u8 reserved1;
139 139
140 /* Tx Firmware Relaged flags (10-11)*/ 140 /* Tx Firmware Relaged flags (10-11)*/
141 u8 bCTSEnable:1; 141 u8 bCTSEnable:1;
142 u8 bRTSEnable:1; 142 u8 bRTSEnable:1;
143 u8 bUseShortGI:1; 143 u8 bUseShortGI:1;
144 u8 bUseShortPreamble:1; 144 u8 bUseShortPreamble:1;
145 u8 bTxEnableFwCalcDur:1; 145 u8 bTxEnableFwCalcDur:1;
146 u8 bAMPDUEnable:1; 146 u8 bAMPDUEnable:1;
147 u8 bRTSSTBC:1; 147 u8 bRTSSTBC:1;
148 u8 RTSSC:1; 148 u8 RTSSC:1;
149 149
150 u8 bRTSBW:1; 150 u8 bRTSBW:1;
151 u8 bPacketBW:1; 151 u8 bPacketBW:1;
152 u8 bRTSUseShortPreamble:1; 152 u8 bRTSUseShortPreamble:1;
153 u8 bRTSUseShortGI:1; 153 u8 bRTSUseShortGI:1;
154 u8 bMulticast:1; 154 u8 bMulticast:1;
155 u8 bBroadcast:1; 155 u8 bBroadcast:1;
156 //u8 reserved2:2; 156 //u8 reserved2:2;
157 u8 drv_agg_enable:1; 157 u8 drv_agg_enable:1;
158 u8 reserved2:1; 158 u8 reserved2:1;
159 159
160 /* Tx Desc related element(12-19) */ 160 /* Tx Desc related element(12-19) */
161 u8 rata_index; 161 u8 rata_index;
162 u8 queue_index; 162 u8 queue_index;
163 //u8 reserved3; 163 //u8 reserved3;
164 //u8 reserved4; 164 //u8 reserved4;
165 u16 txbuf_size; 165 u16 txbuf_size;
166 //u8 reserved5; 166 //u8 reserved5;
167 u8 RATRIndex; 167 u8 RATRIndex;
168 u8 reserved6; 168 u8 reserved6;
169 u8 reserved7; 169 u8 reserved7;
170 u8 reserved8; 170 u8 reserved8;
171 171
172 /* Tx firmware related element(20-27) */ 172 /* Tx firmware related element(20-27) */
173 u8 data_rate; 173 u8 data_rate;
174 u8 rts_rate; 174 u8 rts_rate;
175 u8 ampdu_factor; 175 u8 ampdu_factor;
176 u8 ampdu_density; 176 u8 ampdu_density;
177 //u8 reserved9; 177 //u8 reserved9;
178 //u8 reserved10; 178 //u8 reserved10;
179 //u8 reserved11; 179 //u8 reserved11;
180 u8 DrvAggrNum; 180 u8 DrvAggrNum;
181 u16 pkt_size; 181 u16 pkt_size;
182 u8 reserved12; 182 u8 reserved12;
183}cb_desc, *pcb_desc; 183}cb_desc, *pcb_desc;
184 184
185/*--------------------------Define -------------------------------------------*/ 185/*--------------------------Define -------------------------------------------*/
@@ -389,7 +389,7 @@ enum _ReasonCode{
389typedef struct ieee_param { 389typedef struct ieee_param {
390 u32 cmd; 390 u32 cmd;
391 u8 sta_addr[ETH_ALEN]; 391 u8 sta_addr[ETH_ALEN];
392 union { 392 union {
393 struct { 393 struct {
394 u8 name; 394 u8 name;
395 u32 value; 395 u32 value;
@@ -399,9 +399,9 @@ typedef struct ieee_param {
399 u8 reserved[32]; 399 u8 reserved[32];
400 u8 data[0]; 400 u8 data[0];
401 } wpa_ie; 401 } wpa_ie;
402 struct{ 402 struct{
403 int command; 403 int command;
404 int reason_code; 404 int reason_code;
405 } mlme; 405 } mlme;
406 struct { 406 struct {
407 u8 alg[IEEE_CRYPT_ALG_NAME_LEN]; 407 u8 alg[IEEE_CRYPT_ALG_NAME_LEN];
@@ -442,23 +442,23 @@ static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *d
442#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) 442#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
443static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) 443static inline unsigned long msleep_interruptible_rsl(unsigned int msecs)
444{ 444{
445 unsigned long timeout = MSECS(msecs) + 1; 445 unsigned long timeout = MSECS(msecs) + 1;
446 446
447 while (timeout) { 447 while (timeout) {
448 set_current_state(TASK_INTERRUPTIBLE); 448 set_current_state(TASK_INTERRUPTIBLE);
449 timeout = schedule_timeout(timeout); 449 timeout = schedule_timeout(timeout);
450 } 450 }
451 return timeout; 451 return timeout;
452} 452}
453#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) 453#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31))
454static inline void msleep(unsigned int msecs) 454static inline void msleep(unsigned int msecs)
455{ 455{
456 unsigned long timeout = MSECS(msecs) + 1; 456 unsigned long timeout = MSECS(msecs) + 1;
457 457
458 while (timeout) { 458 while (timeout) {
459 set_current_state(TASK_UNINTERRUPTIBLE); 459 set_current_state(TASK_UNINTERRUPTIBLE);
460 timeout = schedule_timeout(timeout); 460 timeout = schedule_timeout(timeout);
461 } 461 }
462} 462}
463#endif 463#endif
464#else 464#else
@@ -559,24 +559,24 @@ static inline void msleep(unsigned int msecs)
559#define SN_EQUAL(a, b) (a == b) 559#define SN_EQUAL(a, b) (a == b)
560#define MAX_DEV_ADDR_SIZE 8 560#define MAX_DEV_ADDR_SIZE 8
561typedef enum _ACT_CATEGORY{ 561typedef enum _ACT_CATEGORY{
562 ACT_CAT_QOS = 1, 562 ACT_CAT_QOS = 1,
563 ACT_CAT_DLS = 2, 563 ACT_CAT_DLS = 2,
564 ACT_CAT_BA = 3, 564 ACT_CAT_BA = 3,
565 ACT_CAT_HT = 7, 565 ACT_CAT_HT = 7,
566 ACT_CAT_WMM = 17, 566 ACT_CAT_WMM = 17,
567} ACT_CATEGORY, *PACT_CATEGORY; 567} ACT_CATEGORY, *PACT_CATEGORY;
568 568
569typedef enum _TS_ACTION{ 569typedef enum _TS_ACTION{
570 ACT_ADDTSREQ = 0, 570 ACT_ADDTSREQ = 0,
571 ACT_ADDTSRSP = 1, 571 ACT_ADDTSRSP = 1,
572 ACT_DELTS = 2, 572 ACT_DELTS = 2,
573 ACT_SCHEDULE = 3, 573 ACT_SCHEDULE = 3,
574} TS_ACTION, *PTS_ACTION; 574} TS_ACTION, *PTS_ACTION;
575 575
576typedef enum _BA_ACTION{ 576typedef enum _BA_ACTION{
577 ACT_ADDBAREQ = 0, 577 ACT_ADDBAREQ = 0,
578 ACT_ADDBARSP = 1, 578 ACT_ADDBARSP = 1,
579 ACT_DELBA = 2, 579 ACT_DELBA = 2,
580} BA_ACTION, *PBA_ACTION; 580} BA_ACTION, *PBA_ACTION;
581 581
582typedef enum _InitialGainOpType{ 582typedef enum _InitialGainOpType{
@@ -687,22 +687,22 @@ do { if (ieee80211_debug_level & (level)) \
687/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/ 687/* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/
688#define PRINTABLE(_ch) (_ch>'!' && _ch<'~') 688#define PRINTABLE(_ch) (_ch>'!' && _ch<'~')
689#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \ 689#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \
690 if((_Comp) & level) \ 690 if((_Comp) & level) \
691 { \ 691 { \
692 int __i; \ 692 int __i; \
693 u8 buffer[MAX_STR_LEN]; \ 693 u8 buffer[MAX_STR_LEN]; \
694 int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \ 694 int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
695 memset(buffer, 0, MAX_STR_LEN); \ 695 memset(buffer, 0, MAX_STR_LEN); \
696 memcpy(buffer, (u8 *)_Ptr, length ); \ 696 memcpy(buffer, (u8 *)_Ptr, length ); \
697 for( __i=0; __i<MAX_STR_LEN; __i++ ) \ 697 for( __i=0; __i<MAX_STR_LEN; __i++ ) \
698 { \ 698 { \
699 if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \ 699 if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
700 } \ 700 } \
701 buffer[length] = '\0'; \ 701 buffer[length] = '\0'; \
702 printk("Rtl819x: "); \ 702 printk("Rtl819x: "); \
703 printk(_TitleString); \ 703 printk(_TitleString); \
704 printk(": %d, <%s>\n", _Len, buffer); \ 704 printk(": %d, <%s>\n", _Len, buffer); \
705 } 705 }
706#else 706#else
707#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0) 707#define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0)
708#endif 708#endif
@@ -731,10 +731,10 @@ do { if (ieee80211_debug_level & (level)) \
731 731
732struct ieee80211_snap_hdr { 732struct ieee80211_snap_hdr {
733 733
734 u8 dsap; /* always 0xAA */ 734 u8 dsap; /* always 0xAA */
735 u8 ssap; /* always 0xAA */ 735 u8 ssap; /* always 0xAA */
736 u8 ctrl; /* always 0x03 */ 736 u8 ctrl; /* always 0x03 */
737 u8 oui[P80211_OUI_LEN]; /* organizational universal id */ 737 u8 oui[P80211_OUI_LEN]; /* organizational universal id */
738 738
739} __attribute__ ((packed)); 739} __attribute__ ((packed));
740 740
@@ -775,65 +775,65 @@ struct ieee80211_snap_hdr {
775 775
776/* Status codes */ 776/* Status codes */
777enum ieee80211_statuscode { 777enum ieee80211_statuscode {
778 WLAN_STATUS_SUCCESS = 0, 778 WLAN_STATUS_SUCCESS = 0,
779 WLAN_STATUS_UNSPECIFIED_FAILURE = 1, 779 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
780 WLAN_STATUS_CAPS_UNSUPPORTED = 10, 780 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
781 WLAN_STATUS_REASSOC_NO_ASSOC = 11, 781 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
782 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, 782 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
783 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, 783 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
784 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, 784 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
785 WLAN_STATUS_CHALLENGE_FAIL = 15, 785 WLAN_STATUS_CHALLENGE_FAIL = 15,
786 WLAN_STATUS_AUTH_TIMEOUT = 16, 786 WLAN_STATUS_AUTH_TIMEOUT = 16,
787 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, 787 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
788 WLAN_STATUS_ASSOC_DENIED_RATES = 18, 788 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
789 /* 802.11b */ 789 /* 802.11b */
790 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, 790 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
791 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, 791 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
792 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, 792 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
793 /* 802.11h */ 793 /* 802.11h */
794 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, 794 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
795 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, 795 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
796 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, 796 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
797 /* 802.11g */ 797 /* 802.11g */
798 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, 798 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
799 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, 799 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
800 /* 802.11i */ 800 /* 802.11i */
801 WLAN_STATUS_INVALID_IE = 40, 801 WLAN_STATUS_INVALID_IE = 40,
802 WLAN_STATUS_INVALID_GROUP_CIPHER = 41, 802 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
803 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, 803 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
804 WLAN_STATUS_INVALID_AKMP = 43, 804 WLAN_STATUS_INVALID_AKMP = 43,
805 WLAN_STATUS_UNSUPP_RSN_VERSION = 44, 805 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
806 WLAN_STATUS_INVALID_RSN_IE_CAP = 45, 806 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
807 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, 807 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
808}; 808};
809 809
810/* Reason codes */ 810/* Reason codes */
811enum ieee80211_reasoncode { 811enum ieee80211_reasoncode {
812 WLAN_REASON_UNSPECIFIED = 1, 812 WLAN_REASON_UNSPECIFIED = 1,
813 WLAN_REASON_PREV_AUTH_NOT_VALID = 2, 813 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
814 WLAN_REASON_DEAUTH_LEAVING = 3, 814 WLAN_REASON_DEAUTH_LEAVING = 3,
815 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, 815 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
816 WLAN_REASON_DISASSOC_AP_BUSY = 5, 816 WLAN_REASON_DISASSOC_AP_BUSY = 5,
817 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, 817 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
818 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, 818 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
819 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, 819 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
820 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, 820 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
821 /* 802.11h */ 821 /* 802.11h */
822 WLAN_REASON_DISASSOC_BAD_POWER = 10, 822 WLAN_REASON_DISASSOC_BAD_POWER = 10,
823 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, 823 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
824 /* 802.11i */ 824 /* 802.11i */
825 WLAN_REASON_INVALID_IE = 13, 825 WLAN_REASON_INVALID_IE = 13,
826 WLAN_REASON_MIC_FAILURE = 14, 826 WLAN_REASON_MIC_FAILURE = 14,
827 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, 827 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
828 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, 828 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
829 WLAN_REASON_IE_DIFFERENT = 17, 829 WLAN_REASON_IE_DIFFERENT = 17,
830 WLAN_REASON_INVALID_GROUP_CIPHER = 18, 830 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
831 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, 831 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
832 WLAN_REASON_INVALID_AKMP = 20, 832 WLAN_REASON_INVALID_AKMP = 20,
833 WLAN_REASON_UNSUPP_RSN_VERSION = 21, 833 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
834 WLAN_REASON_INVALID_RSN_IE_CAP = 22, 834 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
835 WLAN_REASON_IEEE8021X_FAILED = 23, 835 WLAN_REASON_IEEE8021X_FAILED = 23,
836 WLAN_REASON_CIPHER_SUITE_REJECTED = 24, 836 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
837}; 837};
838 838
839#define IEEE80211_STATMASK_SIGNAL (1<<0) 839#define IEEE80211_STATMASK_SIGNAL (1<<0)
@@ -849,13 +849,13 @@ enum ieee80211_reasoncode {
849#define IEEE80211_52GHZ_BAND (1<<1) 849#define IEEE80211_52GHZ_BAND (1<<1)
850 850
851#define IEEE80211_CCK_RATE_LEN 4 851#define IEEE80211_CCK_RATE_LEN 4
852#define IEEE80211_CCK_RATE_1MB 0x02 852#define IEEE80211_CCK_RATE_1MB 0x02
853#define IEEE80211_CCK_RATE_2MB 0x04 853#define IEEE80211_CCK_RATE_2MB 0x04
854#define IEEE80211_CCK_RATE_5MB 0x0B 854#define IEEE80211_CCK_RATE_5MB 0x0B
855#define IEEE80211_CCK_RATE_11MB 0x16 855#define IEEE80211_CCK_RATE_11MB 0x16
856#define IEEE80211_OFDM_RATE_LEN 8 856#define IEEE80211_OFDM_RATE_LEN 8
857#define IEEE80211_OFDM_RATE_6MB 0x0C 857#define IEEE80211_OFDM_RATE_6MB 0x0C
858#define IEEE80211_OFDM_RATE_9MB 0x12 858#define IEEE80211_OFDM_RATE_9MB 0x12
859#define IEEE80211_OFDM_RATE_12MB 0x18 859#define IEEE80211_OFDM_RATE_12MB 0x18
860#define IEEE80211_OFDM_RATE_18MB 0x24 860#define IEEE80211_OFDM_RATE_18MB 0x24
861#define IEEE80211_OFDM_RATE_24MB 0x30 861#define IEEE80211_OFDM_RATE_24MB 0x30
@@ -877,12 +877,12 @@ enum ieee80211_reasoncode {
877#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) 877#define IEEE80211_OFDM_RATE_48MB_MASK (1<<10)
878#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) 878#define IEEE80211_OFDM_RATE_54MB_MASK (1<<11)
879 879
880#define IEEE80211_CCK_RATES_MASK 0x0000000F 880#define IEEE80211_CCK_RATES_MASK 0x0000000F
881#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ 881#define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \
882 IEEE80211_CCK_RATE_2MB_MASK) 882 IEEE80211_CCK_RATE_2MB_MASK)
883#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ 883#define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \
884 IEEE80211_CCK_RATE_5MB_MASK | \ 884 IEEE80211_CCK_RATE_5MB_MASK | \
885 IEEE80211_CCK_RATE_11MB_MASK) 885 IEEE80211_CCK_RATE_11MB_MASK)
886 886
887#define IEEE80211_OFDM_RATES_MASK 0x00000FF0 887#define IEEE80211_OFDM_RATES_MASK 0x00000FF0
888#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ 888#define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \
@@ -895,10 +895,10 @@ enum ieee80211_reasoncode {
895 IEEE80211_OFDM_RATE_48MB_MASK | \ 895 IEEE80211_OFDM_RATE_48MB_MASK | \
896 IEEE80211_OFDM_RATE_54MB_MASK) 896 IEEE80211_OFDM_RATE_54MB_MASK)
897#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ 897#define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \
898 IEEE80211_CCK_DEFAULT_RATES_MASK) 898 IEEE80211_CCK_DEFAULT_RATES_MASK)
899 899
900#define IEEE80211_NUM_OFDM_RATES 8 900#define IEEE80211_NUM_OFDM_RATES 8
901#define IEEE80211_NUM_CCK_RATES 4 901#define IEEE80211_NUM_CCK_RATES 4
902#define IEEE80211_OFDM_SHIFT_MASK_A 4 902#define IEEE80211_OFDM_SHIFT_MASK_A 4
903 903
904 904
@@ -1064,10 +1064,10 @@ struct ieee80211_device;
1064 1064
1065struct ieee80211_security { 1065struct ieee80211_security {
1066 u16 active_key:2, 1066 u16 active_key:2,
1067 enabled:1, 1067 enabled:1,
1068 auth_mode:2, 1068 auth_mode:2,
1069 auth_algo:4, 1069 auth_algo:4,
1070 unicast_uses_group:1, 1070 unicast_uses_group:1,
1071 encrypt:1; 1071 encrypt:1;
1072 u8 key_sizes[WEP_KEYS]; 1072 u8 key_sizes[WEP_KEYS];
1073 u8 keys[WEP_KEYS][SCM_KEY_LEN]; 1073 u8 keys[WEP_KEYS][SCM_KEY_LEN];
@@ -1089,60 +1089,60 @@ Total: 28-2340 bytes
1089 1089
1090/* Management Frame Information Element Types */ 1090/* Management Frame Information Element Types */
1091enum ieee80211_mfie { 1091enum ieee80211_mfie {
1092 MFIE_TYPE_SSID = 0, 1092 MFIE_TYPE_SSID = 0,
1093 MFIE_TYPE_RATES = 1, 1093 MFIE_TYPE_RATES = 1,
1094 MFIE_TYPE_FH_SET = 2, 1094 MFIE_TYPE_FH_SET = 2,
1095 MFIE_TYPE_DS_SET = 3, 1095 MFIE_TYPE_DS_SET = 3,
1096 MFIE_TYPE_CF_SET = 4, 1096 MFIE_TYPE_CF_SET = 4,
1097 MFIE_TYPE_TIM = 5, 1097 MFIE_TYPE_TIM = 5,
1098 MFIE_TYPE_IBSS_SET = 6, 1098 MFIE_TYPE_IBSS_SET = 6,
1099 MFIE_TYPE_COUNTRY = 7, 1099 MFIE_TYPE_COUNTRY = 7,
1100 MFIE_TYPE_HOP_PARAMS = 8, 1100 MFIE_TYPE_HOP_PARAMS = 8,
1101 MFIE_TYPE_HOP_TABLE = 9, 1101 MFIE_TYPE_HOP_TABLE = 9,
1102 MFIE_TYPE_REQUEST = 10, 1102 MFIE_TYPE_REQUEST = 10,
1103 MFIE_TYPE_CHALLENGE = 16, 1103 MFIE_TYPE_CHALLENGE = 16,
1104 MFIE_TYPE_POWER_CONSTRAINT = 32, 1104 MFIE_TYPE_POWER_CONSTRAINT = 32,
1105 MFIE_TYPE_POWER_CAPABILITY = 33, 1105 MFIE_TYPE_POWER_CAPABILITY = 33,
1106 MFIE_TYPE_TPC_REQUEST = 34, 1106 MFIE_TYPE_TPC_REQUEST = 34,
1107 MFIE_TYPE_TPC_REPORT = 35, 1107 MFIE_TYPE_TPC_REPORT = 35,
1108 MFIE_TYPE_SUPP_CHANNELS = 36, 1108 MFIE_TYPE_SUPP_CHANNELS = 36,
1109 MFIE_TYPE_CSA = 37, 1109 MFIE_TYPE_CSA = 37,
1110 MFIE_TYPE_MEASURE_REQUEST = 38, 1110 MFIE_TYPE_MEASURE_REQUEST = 38,
1111 MFIE_TYPE_MEASURE_REPORT = 39, 1111 MFIE_TYPE_MEASURE_REPORT = 39,
1112 MFIE_TYPE_QUIET = 40, 1112 MFIE_TYPE_QUIET = 40,
1113 MFIE_TYPE_IBSS_DFS = 41, 1113 MFIE_TYPE_IBSS_DFS = 41,
1114 MFIE_TYPE_ERP = 42, 1114 MFIE_TYPE_ERP = 42,
1115 MFIE_TYPE_RSN = 48, 1115 MFIE_TYPE_RSN = 48,
1116 MFIE_TYPE_RATES_EX = 50, 1116 MFIE_TYPE_RATES_EX = 50,
1117 MFIE_TYPE_HT_CAP= 45, 1117 MFIE_TYPE_HT_CAP= 45,
1118 MFIE_TYPE_HT_INFO= 61, 1118 MFIE_TYPE_HT_INFO= 61,
1119 MFIE_TYPE_AIRONET=133, 1119 MFIE_TYPE_AIRONET=133,
1120 MFIE_TYPE_GENERIC = 221, 1120 MFIE_TYPE_GENERIC = 221,
1121 MFIE_TYPE_QOS_PARAMETER = 222, 1121 MFIE_TYPE_QOS_PARAMETER = 222,
1122}; 1122};
1123 1123
1124/* Minimal header; can be used for passing 802.11 frames with sufficient 1124/* Minimal header; can be used for passing 802.11 frames with sufficient
1125 * information to determine what type of underlying data type is actually 1125 * information to determine what type of underlying data type is actually
1126 * stored in the data. */ 1126 * stored in the data. */
1127struct ieee80211_hdr { 1127struct ieee80211_hdr {
1128 __le16 frame_ctl; 1128 __le16 frame_ctl;
1129 __le16 duration_id; 1129 __le16 duration_id;
1130 u8 payload[0]; 1130 u8 payload[0];
1131} __attribute__ ((packed)); 1131} __attribute__ ((packed));
1132 1132
1133struct ieee80211_hdr_1addr { 1133struct ieee80211_hdr_1addr {
1134 __le16 frame_ctl; 1134 __le16 frame_ctl;
1135 __le16 duration_id; 1135 __le16 duration_id;
1136 u8 addr1[ETH_ALEN]; 1136 u8 addr1[ETH_ALEN];
1137 u8 payload[0]; 1137 u8 payload[0];
1138} __attribute__ ((packed)); 1138} __attribute__ ((packed));
1139 1139
1140struct ieee80211_hdr_2addr { 1140struct ieee80211_hdr_2addr {
1141 __le16 frame_ctl; 1141 __le16 frame_ctl;
1142 __le16 duration_id; 1142 __le16 duration_id;
1143 u8 addr1[ETH_ALEN]; 1143 u8 addr1[ETH_ALEN];
1144 u8 addr2[ETH_ALEN]; 1144 u8 addr2[ETH_ALEN];
1145 u8 payload[0]; 1145 u8 payload[0];
1146} __attribute__ ((packed)); 1146} __attribute__ ((packed));
1147 1147
1148struct ieee80211_hdr_3addr { 1148struct ieee80211_hdr_3addr {
@@ -1152,7 +1152,7 @@ struct ieee80211_hdr_3addr {
1152 u8 addr2[ETH_ALEN]; 1152 u8 addr2[ETH_ALEN];
1153 u8 addr3[ETH_ALEN]; 1153 u8 addr3[ETH_ALEN];
1154 __le16 seq_ctl; 1154 __le16 seq_ctl;
1155 u8 payload[0]; 1155 u8 payload[0];
1156} __attribute__ ((packed)); 1156} __attribute__ ((packed));
1157 1157
1158struct ieee80211_hdr_4addr { 1158struct ieee80211_hdr_4addr {
@@ -1163,7 +1163,7 @@ struct ieee80211_hdr_4addr {
1163 u8 addr3[ETH_ALEN]; 1163 u8 addr3[ETH_ALEN];
1164 __le16 seq_ctl; 1164 __le16 seq_ctl;
1165 u8 addr4[ETH_ALEN]; 1165 u8 addr4[ETH_ALEN];
1166 u8 payload[0]; 1166 u8 payload[0];
1167} __attribute__ ((packed)); 1167} __attribute__ ((packed));
1168 1168
1169struct ieee80211_hdr_3addrqos { 1169struct ieee80211_hdr_3addrqos {
@@ -1173,7 +1173,7 @@ struct ieee80211_hdr_3addrqos {
1173 u8 addr2[ETH_ALEN]; 1173 u8 addr2[ETH_ALEN];
1174 u8 addr3[ETH_ALEN]; 1174 u8 addr3[ETH_ALEN];
1175 __le16 seq_ctl; 1175 __le16 seq_ctl;
1176 u8 payload[0]; 1176 u8 payload[0];
1177 __le16 qos_ctl; 1177 __le16 qos_ctl;
1178} __attribute__ ((packed)); 1178} __attribute__ ((packed));
1179 1179
@@ -1185,7 +1185,7 @@ struct ieee80211_hdr_4addrqos {
1185 u8 addr3[ETH_ALEN]; 1185 u8 addr3[ETH_ALEN];
1186 __le16 seq_ctl; 1186 __le16 seq_ctl;
1187 u8 addr4[ETH_ALEN]; 1187 u8 addr4[ETH_ALEN];
1188 u8 payload[0]; 1188 u8 payload[0];
1189 __le16 qos_ctl; 1189 __le16 qos_ctl;
1190} __attribute__ ((packed)); 1190} __attribute__ ((packed));
1191 1191
@@ -1205,14 +1205,14 @@ struct ieee80211_authentication {
1205} __attribute__ ((packed)); 1205} __attribute__ ((packed));
1206 1206
1207struct ieee80211_disassoc { 1207struct ieee80211_disassoc {
1208 struct ieee80211_hdr_3addr header; 1208 struct ieee80211_hdr_3addr header;
1209 __le16 reason; 1209 __le16 reason;
1210} __attribute__ ((packed)); 1210} __attribute__ ((packed));
1211 1211
1212struct ieee80211_probe_request { 1212struct ieee80211_probe_request {
1213 struct ieee80211_hdr_3addr header; 1213 struct ieee80211_hdr_3addr header;
1214 /* SSID, supported rates */ 1214 /* SSID, supported rates */
1215 struct ieee80211_info_element info_element[0]; 1215 struct ieee80211_info_element info_element[0];
1216} __attribute__ ((packed)); 1216} __attribute__ ((packed));
1217 1217
1218struct ieee80211_probe_response { 1218struct ieee80211_probe_response {
@@ -1220,9 +1220,9 @@ struct ieee80211_probe_response {
1220 u32 time_stamp[2]; 1220 u32 time_stamp[2];
1221 __le16 beacon_interval; 1221 __le16 beacon_interval;
1222 __le16 capability; 1222 __le16 capability;
1223 /* SSID, supported rates, FH params, DS params, 1223 /* SSID, supported rates, FH params, DS params,
1224 * CF params, IBSS params, TIM (if beacon), RSN */ 1224 * CF params, IBSS params, TIM (if beacon), RSN */
1225 struct ieee80211_info_element info_element[0]; 1225 struct ieee80211_info_element info_element[0];
1226} __attribute__ ((packed)); 1226} __attribute__ ((packed));
1227 1227
1228/* Alias beacon for probe_response */ 1228/* Alias beacon for probe_response */
@@ -1233,7 +1233,7 @@ struct ieee80211_assoc_request_frame {
1233 __le16 capability; 1233 __le16 capability;
1234 __le16 listen_interval; 1234 __le16 listen_interval;
1235 /* SSID, supported rates, RSN */ 1235 /* SSID, supported rates, RSN */
1236 struct ieee80211_info_element info_element[0]; 1236 struct ieee80211_info_element info_element[0];
1237} __attribute__ ((packed)); 1237} __attribute__ ((packed));
1238 1238
1239struct ieee80211_reassoc_request_frame { 1239struct ieee80211_reassoc_request_frame {
@@ -1242,7 +1242,7 @@ struct ieee80211_reassoc_request_frame {
1242 __le16 listen_interval; 1242 __le16 listen_interval;
1243 u8 current_ap[ETH_ALEN]; 1243 u8 current_ap[ETH_ALEN];
1244 /* SSID, supported rates, RSN */ 1244 /* SSID, supported rates, RSN */
1245 struct ieee80211_info_element info_element[0]; 1245 struct ieee80211_info_element info_element[0];
1246} __attribute__ ((packed)); 1246} __attribute__ ((packed));
1247 1247
1248struct ieee80211_assoc_response_frame { 1248struct ieee80211_assoc_response_frame {
@@ -1318,7 +1318,7 @@ typedef union _frameqos {
1318#define NETWORK_HAS_QOS_PARAMETERS (1<<3) 1318#define NETWORK_HAS_QOS_PARAMETERS (1<<3)
1319#define NETWORK_HAS_QOS_INFORMATION (1<<4) 1319#define NETWORK_HAS_QOS_INFORMATION (1<<4)
1320#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \ 1320#define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \
1321 NETWORK_HAS_QOS_INFORMATION) 1321 NETWORK_HAS_QOS_INFORMATION)
1322/* 802.11h */ 1322/* 802.11h */
1323#define NETWORK_HAS_POWER_CONSTRAINT (1<<5) 1323#define NETWORK_HAS_POWER_CONSTRAINT (1<<5)
1324#define NETWORK_HAS_CSA (1<<6) 1324#define NETWORK_HAS_CSA (1<<6)
@@ -1338,46 +1338,46 @@ typedef union _frameqos {
1338#define QOS_AIFSN_MIN_VALUE 2 1338#define QOS_AIFSN_MIN_VALUE 2
1339#if 1 1339#if 1
1340struct ieee80211_qos_information_element { 1340struct ieee80211_qos_information_element {
1341 u8 elementID; 1341 u8 elementID;
1342 u8 length; 1342 u8 length;
1343 u8 qui[QOS_OUI_LEN]; 1343 u8 qui[QOS_OUI_LEN];
1344 u8 qui_type; 1344 u8 qui_type;
1345 u8 qui_subtype; 1345 u8 qui_subtype;
1346 u8 version; 1346 u8 version;
1347 u8 ac_info; 1347 u8 ac_info;
1348} __attribute__ ((packed)); 1348} __attribute__ ((packed));
1349 1349
1350struct ieee80211_qos_ac_parameter { 1350struct ieee80211_qos_ac_parameter {
1351 u8 aci_aifsn; 1351 u8 aci_aifsn;
1352 u8 ecw_min_max; 1352 u8 ecw_min_max;
1353 __le16 tx_op_limit; 1353 __le16 tx_op_limit;
1354} __attribute__ ((packed)); 1354} __attribute__ ((packed));
1355 1355
1356struct ieee80211_qos_parameter_info { 1356struct ieee80211_qos_parameter_info {
1357 struct ieee80211_qos_information_element info_element; 1357 struct ieee80211_qos_information_element info_element;
1358 u8 reserved; 1358 u8 reserved;
1359 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; 1359 struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM];
1360} __attribute__ ((packed)); 1360} __attribute__ ((packed));
1361 1361
1362struct ieee80211_qos_parameters { 1362struct ieee80211_qos_parameters {
1363 __le16 cw_min[QOS_QUEUE_NUM]; 1363 __le16 cw_min[QOS_QUEUE_NUM];
1364 __le16 cw_max[QOS_QUEUE_NUM]; 1364 __le16 cw_max[QOS_QUEUE_NUM];
1365 u8 aifs[QOS_QUEUE_NUM]; 1365 u8 aifs[QOS_QUEUE_NUM];
1366 u8 flag[QOS_QUEUE_NUM]; 1366 u8 flag[QOS_QUEUE_NUM];
1367 __le16 tx_op_limit[QOS_QUEUE_NUM]; 1367 __le16 tx_op_limit[QOS_QUEUE_NUM];
1368} __attribute__ ((packed)); 1368} __attribute__ ((packed));
1369 1369
1370struct ieee80211_qos_data { 1370struct ieee80211_qos_data {
1371 struct ieee80211_qos_parameters parameters; 1371 struct ieee80211_qos_parameters parameters;
1372 int active; 1372 int active;
1373 int supported; 1373 int supported;
1374 u8 param_count; 1374 u8 param_count;
1375 u8 old_param_count; 1375 u8 old_param_count;
1376}; 1376};
1377 1377
1378struct ieee80211_tim_parameters { 1378struct ieee80211_tim_parameters {
1379 u8 tim_count; 1379 u8 tim_count;
1380 u8 tim_period; 1380 u8 tim_period;
1381} __attribute__ ((packed)); 1381} __attribute__ ((packed));
1382 1382
1383//#else 1383//#else
@@ -1598,10 +1598,10 @@ struct ieee80211_network {
1598 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 1598 u8 ssid[IW_ESSID_MAX_SIZE + 1];
1599 u8 ssid_len; 1599 u8 ssid_len;
1600#if 1 1600#if 1
1601 struct ieee80211_qos_data qos_data; 1601 struct ieee80211_qos_data qos_data;
1602#else 1602#else
1603 // Qos related. Added by Annie, 2005-11-01. 1603 // Qos related. Added by Annie, 2005-11-01.
1604 BSS_QOS BssQos; 1604 BSS_QOS BssQos;
1605#endif 1605#endif
1606 1606
1607 //added by amy for LEAP 1607 //added by amy for LEAP
@@ -1637,15 +1637,15 @@ struct ieee80211_network {
1637 u8 rsn_ie[MAX_WPA_IE_LEN]; 1637 u8 rsn_ie[MAX_WPA_IE_LEN];
1638 size_t rsn_ie_len; 1638 size_t rsn_ie_len;
1639 1639
1640 struct ieee80211_tim_parameters tim; 1640 struct ieee80211_tim_parameters tim;
1641 u8 dtim_period; 1641 u8 dtim_period;
1642 u8 dtim_data; 1642 u8 dtim_data;
1643 u32 last_dtim_sta_time[2]; 1643 u32 last_dtim_sta_time[2];
1644 1644
1645 //appeded for QoS 1645 //appeded for QoS
1646 u8 wmm_info; 1646 u8 wmm_info;
1647 struct ieee80211_wmm_ac_param wmm_param[4]; 1647 struct ieee80211_wmm_ac_param wmm_param[4];
1648 u8 QoS_Enable; 1648 u8 QoS_Enable;
1649#ifdef THOMAS_TURBO 1649#ifdef THOMAS_TURBO
1650 u8 Turbo_Enable;//enable turbo mode, added by thomas 1650 u8 Turbo_Enable;//enable turbo mode, added by thomas
1651#endif 1651#endif
@@ -1653,7 +1653,7 @@ struct ieee80211_network {
1653 u16 CountryIeLen; 1653 u16 CountryIeLen;
1654 u8 CountryIeBuf[MAX_IE_LEN]; 1654 u8 CountryIeBuf[MAX_IE_LEN];
1655#endif 1655#endif
1656 // HT Related, by amy, 2008.04.29 1656 // HT Related, by amy, 2008.04.29
1657 BSS_HT bssht; 1657 BSS_HT bssht;
1658 // Add to handle broadcom AP management frame CCK rate. 1658 // Add to handle broadcom AP management frame CCK rate.
1659 bool broadcom_cap_exist; 1659 bool broadcom_cap_exist;
@@ -1709,13 +1709,13 @@ enum ieee80211_state {
1709}; 1709};
1710#else 1710#else
1711enum ieee80211_state { 1711enum ieee80211_state {
1712 IEEE80211_UNINITIALIZED = 0, 1712 IEEE80211_UNINITIALIZED = 0,
1713 IEEE80211_INITIALIZED, 1713 IEEE80211_INITIALIZED,
1714 IEEE80211_ASSOCIATING, 1714 IEEE80211_ASSOCIATING,
1715 IEEE80211_ASSOCIATED, 1715 IEEE80211_ASSOCIATED,
1716 IEEE80211_AUTHENTICATING, 1716 IEEE80211_AUTHENTICATING,
1717 IEEE80211_AUTHENTICATED, 1717 IEEE80211_AUTHENTICATED,
1718 IEEE80211_SHUTDOWN 1718 IEEE80211_SHUTDOWN
1719}; 1719};
1720#endif 1720#endif
1721 1721
@@ -1729,17 +1729,17 @@ enum ieee80211_state {
1729#define IEEE80211_24GHZ_MIN_CHANNEL 1 1729#define IEEE80211_24GHZ_MIN_CHANNEL 1
1730#define IEEE80211_24GHZ_MAX_CHANNEL 14 1730#define IEEE80211_24GHZ_MAX_CHANNEL 14
1731#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ 1731#define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \
1732 IEEE80211_24GHZ_MIN_CHANNEL + 1) 1732 IEEE80211_24GHZ_MIN_CHANNEL + 1)
1733 1733
1734#define IEEE80211_52GHZ_MIN_CHANNEL 34 1734#define IEEE80211_52GHZ_MIN_CHANNEL 34
1735#define IEEE80211_52GHZ_MAX_CHANNEL 165 1735#define IEEE80211_52GHZ_MAX_CHANNEL 165
1736#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ 1736#define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \
1737 IEEE80211_52GHZ_MIN_CHANNEL + 1) 1737 IEEE80211_52GHZ_MIN_CHANNEL + 1)
1738 1738
1739#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) 1739#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11))
1740extern inline int is_multicast_ether_addr(const u8 *addr) 1740extern inline int is_multicast_ether_addr(const u8 *addr)
1741{ 1741{
1742 return ((addr[0] != 0xff) && (0x01 & addr[0])); 1742 return ((addr[0] != 0xff) && (0x01 & addr[0]));
1743} 1743}
1744#endif 1744#endif
1745 1745
@@ -1911,7 +1911,7 @@ typedef struct _RT_LINK_DETECT_T{
1911 1911
1912struct ieee80211_device { 1912struct ieee80211_device {
1913 struct net_device *dev; 1913 struct net_device *dev;
1914 struct ieee80211_security sec; 1914 struct ieee80211_security sec;
1915 1915
1916 //hw security related 1916 //hw security related
1917// u8 hwsec_support; //support? 1917// u8 hwsec_support; //support?
@@ -2001,15 +2001,15 @@ struct ieee80211_device {
2001 int host_encrypt; 2001 int host_encrypt;
2002 int host_encrypt_msdu; 2002 int host_encrypt_msdu;
2003 int host_decrypt; 2003 int host_decrypt;
2004 /* host performs multicast decryption */ 2004 /* host performs multicast decryption */
2005 int host_mc_decrypt; 2005 int host_mc_decrypt;
2006 2006
2007 /* host should strip IV and ICV from protected frames */ 2007 /* host should strip IV and ICV from protected frames */
2008 /* meaningful only when hardware decryption is being used */ 2008 /* meaningful only when hardware decryption is being used */
2009 int host_strip_iv_icv; 2009 int host_strip_iv_icv;
2010 2010
2011 int host_open_frag; 2011 int host_open_frag;
2012 int host_build_iv; 2012 int host_build_iv;
2013 int ieee802_1x; /* is IEEE 802.1X used */ 2013 int ieee802_1x; /* is IEEE 802.1X used */
2014 2014
2015 /* WPA data */ 2015 /* WPA data */
@@ -2027,7 +2027,7 @@ struct ieee80211_device {
2027 struct ieee80211_crypt_data *crypt[WEP_KEYS]; 2027 struct ieee80211_crypt_data *crypt[WEP_KEYS];
2028 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ 2028 int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */
2029 struct timer_list crypt_deinit_timer; 2029 struct timer_list crypt_deinit_timer;
2030 int crypt_quiesced; 2030 int crypt_quiesced;
2031 2031
2032 int bcrx_sta_key; /* use individual keys to override default keys even 2032 int bcrx_sta_key; /* use individual keys to override default keys even
2033 * with RX of broad/multicast frames */ 2033 * with RX of broad/multicast frames */
@@ -2040,10 +2040,10 @@ struct ieee80211_device {
2040#define DEFAULT_RTS_THRESHOLD 2346U 2040#define DEFAULT_RTS_THRESHOLD 2346U
2041#define MIN_RTS_THRESHOLD 1 2041#define MIN_RTS_THRESHOLD 1
2042#define MAX_RTS_THRESHOLD 2346U 2042#define MAX_RTS_THRESHOLD 2346U
2043 u16 rts; /* RTS threshold */ 2043 u16 rts; /* RTS threshold */
2044 2044
2045 /* Association info */ 2045 /* Association info */
2046 u8 bssid[ETH_ALEN]; 2046 u8 bssid[ETH_ALEN];
2047 2047
2048 /* This stores infos for the current network. 2048 /* This stores infos for the current network.
2049 * Either the network we are associated in INFRASTRUCTURE 2049 * Either the network we are associated in INFRASTRUCTURE
@@ -2069,10 +2069,10 @@ struct ieee80211_device {
2069 */ 2069 */
2070 short sync_scan_hurryup; 2070 short sync_scan_hurryup;
2071 2071
2072 int perfect_rssi; 2072 int perfect_rssi;
2073 int worst_rssi; 2073 int worst_rssi;
2074 2074
2075 u16 prev_seq_ctl; /* used to drop duplicate frames */ 2075 u16 prev_seq_ctl; /* used to drop duplicate frames */
2076 2076
2077 /* map of allowed channels. 0 is dummy */ 2077 /* map of allowed channels. 0 is dummy */
2078 // FIXME: remeber to default to a basic channel plan depending of the PHY type 2078 // FIXME: remeber to default to a basic channel plan depending of the PHY type
@@ -2185,7 +2185,7 @@ struct ieee80211_device {
2185 2185
2186 //added by amy for AP roaming 2186 //added by amy for AP roaming
2187 RT_LINK_DETECT_T LinkDetectInfo; 2187 RT_LINK_DETECT_T LinkDetectInfo;
2188 //added by amy for ps 2188 //added by amy for ps
2189 RT_POWER_SAVE_CONTROL PowerSaveControl; 2189 RT_POWER_SAVE_CONTROL PowerSaveControl;
2190//} 2190//}
2191 /* used if IEEE_SOFTMAC_TX_QUEUE is set */ 2191 /* used if IEEE_SOFTMAC_TX_QUEUE is set */
@@ -2197,19 +2197,19 @@ struct ieee80211_device {
2197 /* used if IEEE_SOFTMAC_BEACONS is set */ 2197 /* used if IEEE_SOFTMAC_BEACONS is set */
2198 struct timer_list beacon_timer; 2198 struct timer_list beacon_timer;
2199#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2199#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
2200 struct work_struct associate_complete_wq; 2200 struct work_struct associate_complete_wq;
2201 struct work_struct associate_procedure_wq; 2201 struct work_struct associate_procedure_wq;
2202#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2202#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
2203 struct delayed_work softmac_scan_wq; 2203 struct delayed_work softmac_scan_wq;
2204 struct delayed_work associate_retry_wq; 2204 struct delayed_work associate_retry_wq;
2205 struct delayed_work start_ibss_wq; 2205 struct delayed_work start_ibss_wq;
2206#else 2206#else
2207 struct work_struct softmac_scan_wq; 2207 struct work_struct softmac_scan_wq;
2208 struct work_struct associate_retry_wq; 2208 struct work_struct associate_retry_wq;
2209 struct work_struct start_ibss_wq; 2209 struct work_struct start_ibss_wq;
2210#endif 2210#endif
2211 struct work_struct wx_sync_scan_wq; 2211 struct work_struct wx_sync_scan_wq;
2212 struct workqueue_struct *wq; 2212 struct workqueue_struct *wq;
2213#else 2213#else
2214 /* used for periodly scan */ 2214 /* used for periodly scan */
2215 struct timer_list scan_timer; 2215 struct timer_list scan_timer;
@@ -2323,32 +2323,32 @@ struct ieee80211_device {
2323 short (*ps_is_queue_empty) (struct net_device *dev); 2323 short (*ps_is_queue_empty) (struct net_device *dev);
2324#if 0 2324#if 0
2325 /* Typical STA methods */ 2325 /* Typical STA methods */
2326 int (*handle_auth) (struct net_device * dev, 2326 int (*handle_auth) (struct net_device * dev,
2327 struct ieee80211_auth * auth); 2327 struct ieee80211_auth * auth);
2328 int (*handle_deauth) (struct net_device * dev, 2328 int (*handle_deauth) (struct net_device * dev,
2329 struct ieee80211_deauth * auth); 2329 struct ieee80211_deauth * auth);
2330 int (*handle_action) (struct net_device * dev, 2330 int (*handle_action) (struct net_device * dev,
2331 struct ieee80211_action * action, 2331 struct ieee80211_action * action,
2332 struct ieee80211_rx_stats * stats); 2332 struct ieee80211_rx_stats * stats);
2333 int (*handle_disassoc) (struct net_device * dev, 2333 int (*handle_disassoc) (struct net_device * dev,
2334 struct ieee80211_disassoc * assoc); 2334 struct ieee80211_disassoc * assoc);
2335#endif 2335#endif
2336 int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); 2336 int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network);
2337#if 0 2337#if 0
2338 int (*handle_probe_response) (struct net_device * dev, 2338 int (*handle_probe_response) (struct net_device * dev,
2339 struct ieee80211_probe_response * resp, 2339 struct ieee80211_probe_response * resp,
2340 struct ieee80211_network * network); 2340 struct ieee80211_network * network);
2341 int (*handle_probe_request) (struct net_device * dev, 2341 int (*handle_probe_request) (struct net_device * dev,
2342 struct ieee80211_probe_request * req, 2342 struct ieee80211_probe_request * req,
2343 struct ieee80211_rx_stats * stats); 2343 struct ieee80211_rx_stats * stats);
2344#endif 2344#endif
2345 int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); 2345 int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network);
2346 2346
2347#if 0 2347#if 0
2348 /* Typical AP methods */ 2348 /* Typical AP methods */
2349 int (*handle_assoc_request) (struct net_device * dev); 2349 int (*handle_assoc_request) (struct net_device * dev);
2350 int (*handle_reassoc_request) (struct net_device * dev, 2350 int (*handle_reassoc_request) (struct net_device * dev,
2351 struct ieee80211_reassoc_request * req); 2351 struct ieee80211_reassoc_request * req);
2352#endif 2352#endif
2353 2353
2354 /* check whether Tx hw resouce available */ 2354 /* check whether Tx hw resouce available */
@@ -2485,45 +2485,45 @@ extern inline int ieee80211_get_hdrlen(u16 fc)
2485 2485
2486static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) 2486static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
2487{ 2487{
2488 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { 2488 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) {
2489 case IEEE80211_1ADDR_LEN: 2489 case IEEE80211_1ADDR_LEN:
2490 return ((struct ieee80211_hdr_1addr *)hdr)->payload; 2490 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
2491 case IEEE80211_2ADDR_LEN: 2491 case IEEE80211_2ADDR_LEN:
2492 return ((struct ieee80211_hdr_2addr *)hdr)->payload; 2492 return ((struct ieee80211_hdr_2addr *)hdr)->payload;
2493 case IEEE80211_3ADDR_LEN: 2493 case IEEE80211_3ADDR_LEN:
2494 return ((struct ieee80211_hdr_3addr *)hdr)->payload; 2494 return ((struct ieee80211_hdr_3addr *)hdr)->payload;
2495 case IEEE80211_4ADDR_LEN: 2495 case IEEE80211_4ADDR_LEN:
2496 return ((struct ieee80211_hdr_4addr *)hdr)->payload; 2496 return ((struct ieee80211_hdr_4addr *)hdr)->payload;
2497 } 2497 }
2498 return NULL; 2498 return NULL;
2499} 2499}
2500 2500
2501static inline int ieee80211_is_ofdm_rate(u8 rate) 2501static inline int ieee80211_is_ofdm_rate(u8 rate)
2502{ 2502{
2503 switch (rate & ~IEEE80211_BASIC_RATE_MASK) { 2503 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
2504 case IEEE80211_OFDM_RATE_6MB: 2504 case IEEE80211_OFDM_RATE_6MB:
2505 case IEEE80211_OFDM_RATE_9MB: 2505 case IEEE80211_OFDM_RATE_9MB:
2506 case IEEE80211_OFDM_RATE_12MB: 2506 case IEEE80211_OFDM_RATE_12MB:
2507 case IEEE80211_OFDM_RATE_18MB: 2507 case IEEE80211_OFDM_RATE_18MB:
2508 case IEEE80211_OFDM_RATE_24MB: 2508 case IEEE80211_OFDM_RATE_24MB:
2509 case IEEE80211_OFDM_RATE_36MB: 2509 case IEEE80211_OFDM_RATE_36MB:
2510 case IEEE80211_OFDM_RATE_48MB: 2510 case IEEE80211_OFDM_RATE_48MB:
2511 case IEEE80211_OFDM_RATE_54MB: 2511 case IEEE80211_OFDM_RATE_54MB:
2512 return 1; 2512 return 1;
2513 } 2513 }
2514 return 0; 2514 return 0;
2515} 2515}
2516 2516
2517static inline int ieee80211_is_cck_rate(u8 rate) 2517static inline int ieee80211_is_cck_rate(u8 rate)
2518{ 2518{
2519 switch (rate & ~IEEE80211_BASIC_RATE_MASK) { 2519 switch (rate & ~IEEE80211_BASIC_RATE_MASK) {
2520 case IEEE80211_CCK_RATE_1MB: 2520 case IEEE80211_CCK_RATE_1MB:
2521 case IEEE80211_CCK_RATE_2MB: 2521 case IEEE80211_CCK_RATE_2MB:
2522 case IEEE80211_CCK_RATE_5MB: 2522 case IEEE80211_CCK_RATE_5MB:
2523 case IEEE80211_CCK_RATE_11MB: 2523 case IEEE80211_CCK_RATE_11MB:
2524 return 1; 2524 return 1;
2525 } 2525 }
2526 return 0; 2526 return 0;
2527} 2527}
2528 2528
2529 2529
@@ -2564,17 +2564,17 @@ extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
2564 union iwreq_data *wrqu, char *key); 2564 union iwreq_data *wrqu, char *key);
2565#if WIRELESS_EXT >= 18 2565#if WIRELESS_EXT >= 18
2566extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, 2566extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
2567 struct iw_request_info *info, 2567 struct iw_request_info *info,
2568 union iwreq_data* wrqu, char *extra); 2568 union iwreq_data* wrqu, char *extra);
2569extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, 2569extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
2570 struct iw_request_info *info, 2570 struct iw_request_info *info,
2571 union iwreq_data* wrqu, char *extra); 2571 union iwreq_data* wrqu, char *extra);
2572extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee, 2572extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
2573 struct iw_request_info *info, 2573 struct iw_request_info *info,
2574 struct iw_param *data, char *extra); 2574 struct iw_param *data, char *extra);
2575extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, 2575extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
2576 struct iw_request_info *info, 2576 struct iw_request_info *info,
2577 union iwreq_data *wrqu, char *extra); 2577 union iwreq_data *wrqu, char *extra);
2578#endif 2578#endif
2579extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len); 2579extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len);
2580 2580
@@ -2731,13 +2731,13 @@ extern void RxBaInactTimeout(unsigned long data);
2731extern void ResetBaEntry( PBA_RECORD pBA); 2731extern void ResetBaEntry( PBA_RECORD pBA);
2732//function in TS.c 2732//function in TS.c
2733extern bool GetTs( 2733extern bool GetTs(
2734 struct ieee80211_device* ieee, 2734 struct ieee80211_device* ieee,
2735 PTS_COMMON_INFO *ppTS, 2735 PTS_COMMON_INFO *ppTS,
2736 u8* Addr, 2736 u8* Addr,
2737 u8 TID, 2737 u8 TID,
2738 TR_SELECT TxRxSelect, //Rx:1, Tx:0 2738 TR_SELECT TxRxSelect, //Rx:1, Tx:0
2739 bool bAddNewTs 2739 bool bAddNewTs
2740 ); 2740 );
2741extern void TSInitialize(struct ieee80211_device *ieee); 2741extern void TSInitialize(struct ieee80211_device *ieee);
2742extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS); 2742extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS);
2743extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr); 2743extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr);
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 181edc46909..0b33bf46332 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -131,7 +131,7 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
131 /* 131 /*
132 qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) && 132 qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
133 (WLAN_FC_GET_STYPE(fc) & 0x08)); 133 (WLAN_FC_GET_STYPE(fc) & 0x08));
134 */ 134 */
135 // fixed by David :2006.9.6 135 // fixed by David :2006.9.6
136 qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) && 136 qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) &&
137 (WLAN_FC_GET_STYPE(fc) & 0x80)); 137 (WLAN_FC_GET_STYPE(fc) & 0x80));
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 58af7c83449..841b99955b7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -24,7 +24,7 @@
24#include "ieee80211.h" 24#include "ieee80211.h"
25 25
26#include <linux/crypto.h> 26#include <linux/crypto.h>
27 #include <linux/scatterlist.h> 27 #include <linux/scatterlist.h>
28#include <linux/crc32.h> 28#include <linux/crc32.h>
29 29
30MODULE_AUTHOR("Jouni Malinen"); 30MODULE_AUTHOR("Jouni Malinen");
@@ -382,7 +382,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
382 if (!tcb_desc->bHwSec) 382 if (!tcb_desc->bHwSec)
383 return ret; 383 return ret;
384 else 384 else
385 return 0; 385 return 0;
386 386
387 387
388} 388}
@@ -502,26 +502,26 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
502} 502}
503 503
504static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr, 504static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr,
505 u8 * data, size_t data_len, u8 * mic) 505 u8 * data, size_t data_len, u8 * mic)
506{ 506{
507 struct hash_desc desc; 507 struct hash_desc desc;
508 struct scatterlist sg[2]; 508 struct scatterlist sg[2];
509 509
510 if (tfm_michael == NULL) { 510 if (tfm_michael == NULL) {
511 printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); 511 printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n");
512 return -1; 512 return -1;
513 } 513 }
514 514
515 sg_init_table(sg, 2); 515 sg_init_table(sg, 2);
516 sg_set_buf(&sg[0], hdr, 16); 516 sg_set_buf(&sg[0], hdr, 16);
517 sg_set_buf(&sg[1], data, data_len); 517 sg_set_buf(&sg[1], data, data_len);
518 518
519 if (crypto_hash_setkey(tfm_michael, key, 8)) 519 if (crypto_hash_setkey(tfm_michael, key, 8))
520 return -1; 520 return -1;
521 521
522 desc.tfm = tfm_michael; 522 desc.tfm = tfm_michael;
523 desc.flags = 0; 523 desc.flags = 0;
524 return crypto_hash_digest(&desc, sg, data_len + 16, mic); 524 return crypto_hash_digest(&desc, sg, data_len + 16, mic);
525} 525}
526 526
527static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) 527static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr)
@@ -630,7 +630,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
630 630
631 if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr, 631 if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
632 skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) 632 skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
633 return -1; 633 return -1;
634 if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { 634 if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
635 struct ieee80211_hdr_4addr *hdr; 635 struct ieee80211_hdr_4addr *hdr;
636 hdr = (struct ieee80211_hdr_4addr *) skb->data; 636 hdr = (struct ieee80211_hdr_4addr *) skb->data;
@@ -760,7 +760,7 @@ static struct ieee80211_crypto_ops ieee80211_crypt_tkip = {
760 .print_stats = ieee80211_tkip_print_stats, 760 .print_stats = ieee80211_tkip_print_stats,
761 .extra_prefix_len = 4 + 4, /* IV + ExtIV */ 761 .extra_prefix_len = 4 + 4, /* IV + ExtIV */
762 .extra_postfix_len = 8 + 4, /* MIC + ICV */ 762 .extra_postfix_len = 8 + 4, /* MIC + ICV */
763 .owner = THIS_MODULE, 763 .owner = THIS_MODULE,
764}; 764};
765 765
766int __init ieee80211_crypto_tkip_init(void) 766int __init ieee80211_crypto_tkip_init(void)
@@ -776,5 +776,5 @@ void __exit ieee80211_crypto_tkip_exit(void)
776void ieee80211_tkip_null(void) 776void ieee80211_tkip_null(void)
777{ 777{
778// printk("============>%s()\n", __FUNCTION__); 778// printk("============>%s()\n", __FUNCTION__);
779 return; 779 return;
780} 780}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
index 39c74d1533c..61ad11cae38 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
@@ -34,8 +34,8 @@ struct prism2_wep_data {
34 u8 key[WEP_KEY_LEN + 1]; 34 u8 key[WEP_KEY_LEN + 1];
35 u8 key_len; 35 u8 key_len;
36 u8 key_idx; 36 u8 key_idx;
37 struct crypto_blkcipher *tx_tfm; 37 struct crypto_blkcipher *tx_tfm;
38 struct crypto_blkcipher *rx_tfm; 38 struct crypto_blkcipher *rx_tfm;
39}; 39};
40 40
41 41
@@ -50,19 +50,19 @@ static void * prism2_wep_init(int keyidx)
50 priv->key_idx = keyidx; 50 priv->key_idx = keyidx;
51 51
52 priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); 52 priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
53 if (IS_ERR(priv->tx_tfm)) { 53 if (IS_ERR(priv->tx_tfm)) {
54 printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " 54 printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
55 "crypto API arc4\n"); 55 "crypto API arc4\n");
56 priv->tx_tfm = NULL; 56 priv->tx_tfm = NULL;
57 goto fail; 57 goto fail;
58 } 58 }
59 priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); 59 priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
60 if (IS_ERR(priv->rx_tfm)) { 60 if (IS_ERR(priv->rx_tfm)) {
61 printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " 61 printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate "
62 "crypto API arc4\n"); 62 "crypto API arc4\n");
63 priv->rx_tfm = NULL; 63 priv->rx_tfm = NULL;
64 goto fail; 64 goto fail;
65 } 65 }
66 66
67 /* start WEP IV from a random value */ 67 /* start WEP IV from a random value */
68 get_random_bytes(&priv->iv, 4); 68 get_random_bytes(&priv->iv, 4);
@@ -71,12 +71,12 @@ static void * prism2_wep_init(int keyidx)
71 71
72fail: 72fail:
73 if (priv) { 73 if (priv) {
74 if (priv->tx_tfm) 74 if (priv->tx_tfm)
75 crypto_free_blkcipher(priv->tx_tfm); 75 crypto_free_blkcipher(priv->tx_tfm);
76 if (priv->rx_tfm) 76 if (priv->rx_tfm)
77 crypto_free_blkcipher(priv->rx_tfm); 77 crypto_free_blkcipher(priv->rx_tfm);
78 kfree(priv); 78 kfree(priv);
79 } 79 }
80 80
81 return NULL; 81 return NULL;
82} 82}
@@ -87,11 +87,11 @@ static void prism2_wep_deinit(void *priv)
87 struct prism2_wep_data *_priv = priv; 87 struct prism2_wep_data *_priv = priv;
88 88
89 if (_priv) { 89 if (_priv) {
90 if (_priv->tx_tfm) 90 if (_priv->tx_tfm)
91 crypto_free_blkcipher(_priv->tx_tfm); 91 crypto_free_blkcipher(_priv->tx_tfm);
92 if (_priv->rx_tfm) 92 if (_priv->rx_tfm)
93 crypto_free_blkcipher(_priv->rx_tfm); 93 crypto_free_blkcipher(_priv->rx_tfm);
94 } 94 }
95 kfree(priv); 95 kfree(priv);
96} 96}
97 97
@@ -293,5 +293,5 @@ void __exit ieee80211_crypto_wep_exit(void)
293void ieee80211_wep_null(void) 293void ieee80211_wep_null(void)
294{ 294{
295// printk("============>%s()\n", __FUNCTION__); 295// printk("============>%s()\n", __FUNCTION__);
296 return; 296 return;
297} 297}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index c3383bb8b76..bbaec949bb8 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -150,11 +150,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
150 atomic_set(&(ieee->atm_swbw), 0); 150 atomic_set(&(ieee->atm_swbw), 0);
151 151
152 ieee->wpax_type_set = 0; 152 ieee->wpax_type_set = 0;
153 ieee->wpa_enabled = 0; 153 ieee->wpa_enabled = 0;
154 ieee->tkip_countermeasures = 0; 154 ieee->tkip_countermeasures = 0;
155 ieee->drop_unencrypted = 0; 155 ieee->drop_unencrypted = 0;
156 ieee->privacy_invoked = 0; 156 ieee->privacy_invoked = 0;
157 ieee->ieee802_1x = 1; 157 ieee->ieee802_1x = 1;
158 ieee->raw_tx = 0; 158 ieee->raw_tx = 0;
159 //ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead. 159 //ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead.
160 ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary. 160 ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary.
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 7792aa808c6..1629b0f33f0 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -133,14 +133,14 @@ void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p) {
133void ieee80211_TURBO_Info(struct ieee80211_device *ieee, u8 **tag_p) { 133void ieee80211_TURBO_Info(struct ieee80211_device *ieee, u8 **tag_p) {
134 u8 *tag = *tag_p; 134 u8 *tag = *tag_p;
135 135
136 *tag++ = MFIE_TYPE_GENERIC; //0 136 *tag++ = MFIE_TYPE_GENERIC; //0
137 *tag++ = 7; 137 *tag++ = 7;
138 *tag++ = 0x00; 138 *tag++ = 0x00;
139 *tag++ = 0xe0; 139 *tag++ = 0xe0;
140 *tag++ = 0x4c; 140 *tag++ = 0x4c;
141 *tag++ = 0x01;//5 141 *tag++ = 0x01;//5
142 *tag++ = 0x02; 142 *tag++ = 0x02;
143 *tag++ = 0x11; 143 *tag++ = 0x11;
144 *tag++ = 0x00; 144 *tag++ = 0x00;
145 145
146 *tag_p = tag; 146 *tag_p = tag;
@@ -238,9 +238,9 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee
238 238
239 tcb_desc->queue_index = MGNT_QUEUE; 239 tcb_desc->queue_index = MGNT_QUEUE;
240 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); 240 tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee);
241 tcb_desc->RATRIndex = 7; 241 tcb_desc->RATRIndex = 7;
242 tcb_desc->bTxDisableRateFallBack = 1; 242 tcb_desc->bTxDisableRateFallBack = 1;
243 tcb_desc->bTxUseDriverAssingedRate = 1; 243 tcb_desc->bTxUseDriverAssingedRate = 1;
244 244
245 if(single){ 245 if(single){
246 if(ieee->queue_stop){ 246 if(ieee->queue_stop){
@@ -525,8 +525,8 @@ void ieee80211_softmac_scan(struct ieee80211_device *ieee)
525#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 525#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
526void ieee80211_softmac_scan_wq(struct work_struct *work) 526void ieee80211_softmac_scan_wq(struct work_struct *work)
527{ 527{
528 struct delayed_work *dwork = container_of(work, struct delayed_work, work); 528 struct delayed_work *dwork = container_of(work, struct delayed_work, work);
529 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq); 529 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq);
530#else 530#else
531void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) 531void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
532{ 532{
@@ -546,7 +546,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
546 { 546 {
547 //if current channel is not in channel map, set to default channel. 547 //if current channel is not in channel map, set to default channel.
548 #ifdef ENABLE_DOT11D 548 #ifdef ENABLE_DOT11D
549 if (!channel_map[ieee->current_network.channel]); 549 if (!channel_map[ieee->current_network.channel]);
550 #else 550 #else
551 if (!ieee->channel_map[ieee->current_network.channel]); 551 if (!ieee->channel_map[ieee->current_network.channel]);
552 #endif 552 #endif
@@ -554,7 +554,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee)
554 goto out; /* no good chans */ 554 goto out; /* no good chans */
555 } 555 }
556#ifdef ENABLE_DOT11D 556#ifdef ENABLE_DOT11D
557 }while(!channel_map[ieee->current_network.channel]); 557 }while(!channel_map[ieee->current_network.channel]);
558#else 558#else
559 }while(!ieee->channel_map[ieee->current_network.channel]); 559 }while(!ieee->channel_map[ieee->current_network.channel]);
560#endif 560#endif
@@ -582,7 +582,7 @@ out:
582 if(IS_DOT11D_ENABLE(ieee)) 582 if(IS_DOT11D_ENABLE(ieee))
583 DOT11D_ScanComplete(ieee); 583 DOT11D_ScanComplete(ieee);
584#endif 584#endif
585 ieee->actscanning = false; 585 ieee->actscanning = false;
586 watchdog = 0; 586 watchdog = 0;
587 ieee->scanning = 0; 587 ieee->scanning = 0;
588 up(&ieee->scan_sem); 588 up(&ieee->scan_sem);
@@ -619,7 +619,7 @@ void ieee80211_beacons_stop(struct ieee80211_device *ieee)
619 spin_lock_irqsave(&ieee->beacon_lock,flags); 619 spin_lock_irqsave(&ieee->beacon_lock,flags);
620 620
621 ieee->beacon_txing = 0; 621 ieee->beacon_txing = 0;
622 del_timer_sync(&ieee->beacon_timer); 622 del_timer_sync(&ieee->beacon_timer);
623 623
624 spin_unlock_irqrestore(&ieee->beacon_lock,flags); 624 spin_unlock_irqrestore(&ieee->beacon_lock,flags);
625 625
@@ -807,12 +807,12 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
807 erp_len = 0; 807 erp_len = 0;
808#else 808#else
809 if((ieee->current_network.mode == IEEE_G) 809 if((ieee->current_network.mode == IEEE_G)
810 ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) { 810 ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) {
811 erp_len = 3; 811 erp_len = 3;
812 erpinfo_content = 0; 812 erpinfo_content = 0;
813 if(ieee->current_network.buseprotection) 813 if(ieee->current_network.buseprotection)
814 erpinfo_content |= ERP_UseProtection; 814 erpinfo_content |= ERP_UseProtection;
815 } 815 }
816 else 816 else
817 erp_len = 0; 817 erp_len = 0;
818#endif 818#endif
@@ -833,12 +833,12 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
833 HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt); 833 HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
834 834
835 835
836 if(pHTInfo->bRegRT2RTAggregation) 836 if(pHTInfo->bRegRT2RTAggregation)
837 { 837 {
838 tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer; 838 tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
839 tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer); 839 tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer);
840 HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len); 840 HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len);
841 } 841 }
842// printk("===============>tmp_ht_cap_len is %d,tmp_ht_info_len is %d, tmp_generic_ie_len is %d\n",tmp_ht_cap_len,tmp_ht_info_len,tmp_generic_ie_len); 842// printk("===============>tmp_ht_cap_len is %d,tmp_ht_info_len is %d, tmp_generic_ie_len is %d\n",tmp_ht_cap_len,tmp_ht_info_len,tmp_generic_ie_len);
843#endif 843#endif
844 beacon_size = sizeof(struct ieee80211_probe_response)+2+ 844 beacon_size = sizeof(struct ieee80211_probe_response)+2+
@@ -848,7 +848,7 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
848 +rate_ex_len 848 +rate_ex_len
849 +atim_len 849 +atim_len
850 +erp_len 850 +erp_len
851 +wpa_ie_len 851 +wpa_ie_len
852 // +tmp_ht_cap_len 852 // +tmp_ht_cap_len
853 // +tmp_ht_info_len 853 // +tmp_ht_info_len
854 // +tmp_generic_ie_len 854 // +tmp_generic_ie_len
@@ -1187,7 +1187,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
1187 + wpa_ie_len 1187 + wpa_ie_len
1188 + wmm_info_len 1188 + wmm_info_len
1189 + turbo_info_len 1189 + turbo_info_len
1190 + ht_cap_len 1190 + ht_cap_len
1191 + realtek_ie_len 1191 + realtek_ie_len
1192 + ckip_ie_len 1192 + ckip_ie_len
1193 + ccxrm_ie_len 1193 + ccxrm_ie_len
@@ -1199,7 +1199,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
1199 + rate_len//rates tagged val 1199 + rate_len//rates tagged val
1200 + wpa_ie_len 1200 + wpa_ie_len
1201 + wmm_info_len 1201 + wmm_info_len
1202 + ht_cap_len 1202 + ht_cap_len
1203 + realtek_ie_len 1203 + realtek_ie_len
1204 + ckip_ie_len 1204 + ckip_ie_len
1205 + ccxrm_ie_len 1205 + ccxrm_ie_len
@@ -1235,7 +1235,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
1235 1235
1236 if(ieee->short_slot) 1236 if(ieee->short_slot)
1237 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT); 1237 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT);
1238 if (wmm_info_len) //QOS 1238 if (wmm_info_len) //QOS
1239 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS); 1239 hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS);
1240 1240
1241 hdr->listen_interval = 0xa; //FIXME 1241 hdr->listen_interval = 0xa; //FIXME
@@ -1304,7 +1304,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
1304 memcpy(tag,osCcxVerNum.Octet,osCcxVerNum.Length); 1304 memcpy(tag,osCcxVerNum.Octet,osCcxVerNum.Length);
1305 tag += osCcxVerNum.Length; 1305 tag += osCcxVerNum.Length;
1306 } 1306 }
1307 //HT cap element 1307 //HT cap element
1308 if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){ 1308 if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){
1309 if(ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) 1309 if(ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC)
1310 { 1310 {
@@ -1329,9 +1329,9 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco
1329 } 1329 }
1330#ifdef THOMAS_TURBO 1330#ifdef THOMAS_TURBO
1331 tag = skb_put(skb,turbo_info_len); 1331 tag = skb_put(skb,turbo_info_len);
1332 if(turbo_info_len) { 1332 if(turbo_info_len) {
1333 ieee80211_TURBO_Info(ieee, &tag); 1333 ieee80211_TURBO_Info(ieee, &tag);
1334 } 1334 }
1335#endif 1335#endif
1336 1336
1337 if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){ 1337 if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){
@@ -1382,7 +1382,7 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee)
1382 1382
1383#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1383#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
1384 queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \ 1384 queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \
1385 IEEE80211_SOFTMAC_ASSOC_RETRY_TIME); 1385 IEEE80211_SOFTMAC_ASSOC_RETRY_TIME);
1386#else 1386#else
1387 schedule_task(&ieee->associate_retry_wq); 1387 schedule_task(&ieee->associate_retry_wq);
1388#endif 1388#endif
@@ -1482,7 +1482,7 @@ void ieee80211_associate_step2(struct ieee80211_device *ieee)
1482#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 1482#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
1483void ieee80211_associate_complete_wq(struct work_struct *work) 1483void ieee80211_associate_complete_wq(struct work_struct *work)
1484{ 1484{
1485 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq); 1485 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq);
1486#else 1486#else
1487void ieee80211_associate_complete_wq(struct ieee80211_device *ieee) 1487void ieee80211_associate_complete_wq(struct ieee80211_device *ieee)
1488{ 1488{
@@ -1567,7 +1567,7 @@ void ieee80211_associate_complete(struct ieee80211_device *ieee)
1567#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 1567#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
1568void ieee80211_associate_procedure_wq(struct work_struct *work) 1568void ieee80211_associate_procedure_wq(struct work_struct *work)
1569{ 1569{
1570 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq); 1570 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq);
1571#else 1571#else
1572void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee) 1572void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee)
1573{ 1573{
@@ -1623,7 +1623,7 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee
1623 1623
1624 1624
1625 if ( /* if the user set the AP check if match. 1625 if ( /* if the user set the AP check if match.
1626 * if the network does not broadcast essid we check the user supplyed ANY essid 1626 * if the network does not broadcast essid we check the user supplyed ANY essid
1627 * if the network does broadcast and the user does not set essid it is OK 1627 * if the network does broadcast and the user does not set essid it is OK
1628 * if the network does broadcast and the user did set essid chech if essid match 1628 * if the network does broadcast and the user did set essid chech if essid match
1629 */ 1629 */
@@ -1837,8 +1837,8 @@ static inline u16 assoc_parse(struct ieee80211_device *ieee, struct sk_buff *skb
1837 status_code==WLAN_STATUS_CAPS_UNSUPPORTED)&& 1837 status_code==WLAN_STATUS_CAPS_UNSUPPORTED)&&
1838 ((ieee->mode == IEEE_G) && 1838 ((ieee->mode == IEEE_G) &&
1839 (ieee->current_network.mode == IEEE_N_24G) && 1839 (ieee->current_network.mode == IEEE_N_24G) &&
1840 (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { 1840 (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) {
1841 ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE; 1841 ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE;
1842 }else { 1842 }else {
1843 ieee->AsocRetryCount = 0; 1843 ieee->AsocRetryCount = 0;
1844 } 1844 }
@@ -2535,8 +2535,8 @@ void ieee80211_start_monitor_mode(struct ieee80211_device *ieee)
2535void ieee80211_start_ibss_wq(struct work_struct *work) 2535void ieee80211_start_ibss_wq(struct work_struct *work)
2536{ 2536{
2537 2537
2538 struct delayed_work *dwork = container_of(work, struct delayed_work, work); 2538 struct delayed_work *dwork = container_of(work, struct delayed_work, work);
2539 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq); 2539 struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq);
2540#else 2540#else
2541void ieee80211_start_ibss_wq(struct ieee80211_device *ieee) 2541void ieee80211_start_ibss_wq(struct ieee80211_device *ieee)
2542{ 2542{
@@ -2843,7 +2843,7 @@ void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee)
2843void ieee80211_start_protocol(struct ieee80211_device *ieee) 2843void ieee80211_start_protocol(struct ieee80211_device *ieee)
2844{ 2844{
2845 short ch = 0; 2845 short ch = 0;
2846 int i = 0; 2846 int i = 0;
2847 if (ieee->proto_started) 2847 if (ieee->proto_started)
2848 return; 2848 return;
2849 2849
@@ -2867,7 +2867,7 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
2867// printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel); 2867// printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel);
2868// ieee->set_chan(ieee->dev,ieee->current_network.channel); 2868// ieee->set_chan(ieee->dev,ieee->current_network.channel);
2869 2869
2870 for(i = 0; i < 17; i++) { 2870 for(i = 0; i < 17; i++) {
2871 ieee->last_rxseq_num[i] = -1; 2871 ieee->last_rxseq_num[i] = -1;
2872 ieee->last_rxfrag_num[i] = -1; 2872 ieee->last_rxfrag_num[i] = -1;
2873 ieee->last_packet_time[i] = 0; 2873 ieee->last_packet_time[i] = 0;
@@ -2915,7 +2915,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
2915 //added for AP roaming 2915 //added for AP roaming
2916 ieee->LinkDetectInfo.SlotNum = 2; 2916 ieee->LinkDetectInfo.SlotNum = 2;
2917 ieee->LinkDetectInfo.NumRecvBcnInPeriod=0; 2917 ieee->LinkDetectInfo.NumRecvBcnInPeriod=0;
2918 ieee->LinkDetectInfo.NumRecvDataInPeriod=0; 2918 ieee->LinkDetectInfo.NumRecvDataInPeriod=0;
2919 2919
2920 ieee->assoc_id = 0; 2920 ieee->assoc_id = 0;
2921 ieee->queue_stop = 0; 2921 ieee->queue_stop = 0;
@@ -2968,12 +2968,12 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
2968 2968
2969#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 2969#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
2970#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 2970#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
2971 INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq); 2971 INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq);
2972 INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq); 2972 INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq);
2973 INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq); 2973 INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq);
2974 INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq); 2974 INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq);
2975 INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq); 2975 INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq);
2976 INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq); 2976 INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq);
2977 2977
2978#else 2978#else
2979 INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); 2979 INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee);
@@ -3165,7 +3165,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v
3165 .flags = SEC_ENABLED, 3165 .flags = SEC_ENABLED,
3166 .enabled = value, 3166 .enabled = value,
3167 }; 3167 };
3168 ieee->drop_unencrypted = value; 3168 ieee->drop_unencrypted = value;
3169 /* We only change SEC_LEVEL for open mode. Others 3169 /* We only change SEC_LEVEL for open mode. Others
3170 * are set by ipw_wpa_set_encryption. 3170 * are set by ipw_wpa_set_encryption.
3171 */ 3171 */
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index b96acf5546b..d395fc65b70 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -316,7 +316,7 @@ out:
316#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 316#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
317void ieee80211_wx_sync_scan_wq(struct work_struct *work) 317void ieee80211_wx_sync_scan_wq(struct work_struct *work)
318{ 318{
319 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); 319 struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq);
320#else 320#else
321void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee) 321void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
322{ 322{
@@ -641,7 +641,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee,
641 } 641 }
642 642
643 if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) 643 if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST))
644 wrqu->power.flags |= IW_POWER_ALL_R; 644 wrqu->power.flags |= IW_POWER_ALL_R;
645 else if (ieee->ps & IEEE80211_PS_MBCAST) 645 else if (ieee->ps & IEEE80211_PS_MBCAST)
646 wrqu->power.flags |= IW_POWER_MULTICAST_R; 646 wrqu->power.flags |= IW_POWER_MULTICAST_R;
647 else 647 else
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
index 118dfe1c977..3b248cd3ce1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c
@@ -56,18 +56,18 @@ struct modes_unit ieee80211_modes[] = {
56#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) 56#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
57static inline char * 57static inline char *
58iwe_stream_add_event_rsl(char * stream, /* Stream of events */ 58iwe_stream_add_event_rsl(char * stream, /* Stream of events */
59 char * ends, /* End of stream */ 59 char * ends, /* End of stream */
60 struct iw_event *iwe, /* Payload */ 60 struct iw_event *iwe, /* Payload */
61 int event_len) /* Real size of payload */ 61 int event_len) /* Real size of payload */
62{ 62{
63 /* Check if it's possible */ 63 /* Check if it's possible */
64 if((stream + event_len) < ends) { 64 if((stream + event_len) < ends) {
65 iwe->len = event_len; 65 iwe->len = event_len;
66 ndelay(1); //new 66 ndelay(1); //new
67 memcpy(stream, (char *) iwe, event_len); 67 memcpy(stream, (char *) iwe, event_len);
68 stream += event_len; 68 stream += event_len;
69 } 69 }
70 return stream; 70 return stream;
71} 71}
72#else 72#else
73#define iwe_stream_add_event_rsl iwe_stream_add_event 73#define iwe_stream_add_event_rsl iwe_stream_add_event
@@ -75,9 +75,9 @@ iwe_stream_add_event_rsl(char * stream, /* Stream of events */
75 75
76#define MAX_CUSTOM_LEN 64 76#define MAX_CUSTOM_LEN 64
77static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, 77static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
78 char *start, char *stop, 78 char *start, char *stop,
79 struct ieee80211_network *network, 79 struct ieee80211_network *network,
80 struct iw_request_info *info) 80 struct iw_request_info *info)
81{ 81{
82 char custom[MAX_CUSTOM_LEN]; 82 char custom[MAX_CUSTOM_LEN];
83 char proto_name[IFNAMSIZ]; 83 char proto_name[IFNAMSIZ];
@@ -106,18 +106,18 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
106 if (network->ssid_len == 0) { 106 if (network->ssid_len == 0) {
107 iwe.u.data.length = sizeof("<hidden>"); 107 iwe.u.data.length = sizeof("<hidden>");
108#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 108#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
109 start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>"); 109 start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>");
110#else 110#else
111 start = iwe_stream_add_point(start, stop, &iwe, "<hidden>"); 111 start = iwe_stream_add_point(start, stop, &iwe, "<hidden>");
112#endif 112#endif
113 } else { 113 } else {
114 iwe.u.data.length = min(network->ssid_len, (u8)32); 114 iwe.u.data.length = min(network->ssid_len, (u8)32);
115#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 115#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
116 start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); 116 start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
117#else 117#else
118 start = iwe_stream_add_point(start, stop, &iwe, network->ssid); 118 start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
119#endif 119#endif
120 } 120 }
121 /* Add the protocol name */ 121 /* Add the protocol name */
122 iwe.cmd = SIOCGIWNAME; 122 iwe.cmd = SIOCGIWNAME;
123 for(i=0; i<(sizeof(ieee80211_modes)/sizeof(ieee80211_modes[0])); i++) { 123 for(i=0; i<(sizeof(ieee80211_modes)/sizeof(ieee80211_modes[0])); i++) {
@@ -129,26 +129,26 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
129 *pname = '\0'; 129 *pname = '\0';
130 snprintf(iwe.u.name, IFNAMSIZ, "IEEE802.11%s", proto_name); 130 snprintf(iwe.u.name, IFNAMSIZ, "IEEE802.11%s", proto_name);
131#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 131#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
132 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN); 132 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN);
133#else 133#else
134 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN); 134 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN);
135#endif 135#endif
136 /* Add mode */ 136 /* Add mode */
137 iwe.cmd = SIOCGIWMODE; 137 iwe.cmd = SIOCGIWMODE;
138 if (network->capability & 138 if (network->capability &
139 (WLAN_CAPABILITY_BSS | WLAN_CAPABILITY_IBSS)) { 139 (WLAN_CAPABILITY_BSS | WLAN_CAPABILITY_IBSS)) {
140 if (network->capability & WLAN_CAPABILITY_BSS) 140 if (network->capability & WLAN_CAPABILITY_BSS)
141 iwe.u.mode = IW_MODE_MASTER; 141 iwe.u.mode = IW_MODE_MASTER;
142 else 142 else
143 iwe.u.mode = IW_MODE_ADHOC; 143 iwe.u.mode = IW_MODE_ADHOC;
144#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 144#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
145 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN); 145 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN);
146#else 146#else
147 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN); 147 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN);
148#endif 148#endif
149 } 149 }
150 150
151 /* Add frequency/channel */ 151 /* Add frequency/channel */
152 iwe.cmd = SIOCGIWFREQ; 152 iwe.cmd = SIOCGIWFREQ;
153/* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode); 153/* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode);
154 iwe.u.freq.e = 3; */ 154 iwe.u.freq.e = 3; */
@@ -156,9 +156,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
156 iwe.u.freq.e = 0; 156 iwe.u.freq.e = 0;
157 iwe.u.freq.i = 0; 157 iwe.u.freq.i = 0;
158#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 158#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
159 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN); 159 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN);
160#else 160#else
161 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN); 161 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN);
162#endif 162#endif
163 /* Add encryption capability */ 163 /* Add encryption capability */
164 iwe.cmd = SIOCGIWENCODE; 164 iwe.cmd = SIOCGIWENCODE;
@@ -168,9 +168,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
168 iwe.u.data.flags = IW_ENCODE_DISABLED; 168 iwe.u.data.flags = IW_ENCODE_DISABLED;
169 iwe.u.data.length = 0; 169 iwe.u.data.length = 0;
170#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 170#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
171 start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); 171 start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid);
172#else 172#else
173 start = iwe_stream_add_point(start, stop, &iwe, network->ssid); 173 start = iwe_stream_add_point(start, stop, &iwe, network->ssid);
174#endif 174#endif
175 /* Add basic and extended rates */ 175 /* Add basic and extended rates */
176 max_rate = 0; 176 max_rate = 0;
@@ -228,19 +228,19 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
228 iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0; 228 iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0;
229 iwe.u.bitrate.value = max_rate * 500000; 229 iwe.u.bitrate.value = max_rate * 500000;
230#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 230#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
231 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, 231 start = iwe_stream_add_event_rsl(info, start, stop, &iwe,
232 IW_EV_PARAM_LEN); 232 IW_EV_PARAM_LEN);
233#else 233#else
234 start = iwe_stream_add_event_rsl(start, stop, &iwe, 234 start = iwe_stream_add_event_rsl(start, stop, &iwe,
235 IW_EV_PARAM_LEN); 235 IW_EV_PARAM_LEN);
236#endif 236#endif
237 iwe.cmd = IWEVCUSTOM; 237 iwe.cmd = IWEVCUSTOM;
238 iwe.u.data.length = p - custom; 238 iwe.u.data.length = p - custom;
239 if (iwe.u.data.length) 239 if (iwe.u.data.length)
240#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 240#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
241 start = iwe_stream_add_point(info, start, stop, &iwe, custom); 241 start = iwe_stream_add_point(info, start, stop, &iwe, custom);
242#else 242#else
243 start = iwe_stream_add_point(start, stop, &iwe, custom); 243 start = iwe_stream_add_point(start, stop, &iwe, custom);
244#endif 244#endif
245 /* Add quality statistics */ 245 /* Add quality statistics */
246 /* TODO: Fix these values... */ 246 /* TODO: Fix these values... */
@@ -257,9 +257,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
257 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID; 257 iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID;
258 iwe.u.qual.updated = 7; 258 iwe.u.qual.updated = 7;
259#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 259#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
260 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN); 260 start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN);
261#else 261#else
262 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN); 262 start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN);
263#endif 263#endif
264 iwe.cmd = IWEVCUSTOM; 264 iwe.cmd = IWEVCUSTOM;
265 p = custom; 265 p = custom;
@@ -267,9 +267,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
267 iwe.u.data.length = p - custom; 267 iwe.u.data.length = p - custom;
268 if (iwe.u.data.length) 268 if (iwe.u.data.length)
269#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 269#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
270 start = iwe_stream_add_point(info, start, stop, &iwe, custom); 270 start = iwe_stream_add_point(info, start, stop, &iwe, custom);
271#else 271#else
272 start = iwe_stream_add_point(start, stop, &iwe, custom); 272 start = iwe_stream_add_point(start, stop, &iwe, custom);
273#endif 273#endif
274#if (WIRELESS_EXT < 18) 274#if (WIRELESS_EXT < 18)
275 if (ieee->wpa_enabled && network->wpa_ie_len){ 275 if (ieee->wpa_enabled && network->wpa_ie_len){
@@ -285,11 +285,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
285 iwe.cmd = IWEVCUSTOM; 285 iwe.cmd = IWEVCUSTOM;
286 iwe.u.data.length = strlen(buf); 286 iwe.u.data.length = strlen(buf);
287#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 287#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
288 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 288 start = iwe_stream_add_point(info, start, stop, &iwe, buf);
289#else 289#else
290 start = iwe_stream_add_point(start, stop, &iwe, buf); 290 start = iwe_stream_add_point(start, stop, &iwe, buf);
291#endif 291#endif
292 } 292 }
293 293
294 if (ieee->wpa_enabled && network->rsn_ie_len){ 294 if (ieee->wpa_enabled && network->rsn_ie_len){
295 char buf[MAX_WPA_IE_LEN * 2 + 30]; 295 char buf[MAX_WPA_IE_LEN * 2 + 30];
@@ -304,11 +304,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
304 iwe.cmd = IWEVCUSTOM; 304 iwe.cmd = IWEVCUSTOM;
305 iwe.u.data.length = strlen(buf); 305 iwe.u.data.length = strlen(buf);
306#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 306#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
307 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 307 start = iwe_stream_add_point(info, start, stop, &iwe, buf);
308#else 308#else
309 start = iwe_stream_add_point(start, stop, &iwe, buf); 309 start = iwe_stream_add_point(start, stop, &iwe, buf);
310#endif 310#endif
311 } 311 }
312#else 312#else
313 memset(&iwe, 0, sizeof(iwe)); 313 memset(&iwe, 0, sizeof(iwe));
314 if (network->wpa_ie_len) 314 if (network->wpa_ie_len)
@@ -318,11 +318,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
318 iwe.cmd = IWEVGENIE; 318 iwe.cmd = IWEVGENIE;
319 iwe.u.data.length = network->wpa_ie_len; 319 iwe.u.data.length = network->wpa_ie_len;
320#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 320#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
321 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 321 start = iwe_stream_add_point(info, start, stop, &iwe, buf);
322#else 322#else
323 start = iwe_stream_add_point(start, stop, &iwe, buf); 323 start = iwe_stream_add_point(start, stop, &iwe, buf);
324#endif 324#endif
325 } 325 }
326 memset(&iwe, 0, sizeof(iwe)); 326 memset(&iwe, 0, sizeof(iwe));
327 if (network->rsn_ie_len) 327 if (network->rsn_ie_len)
328 { 328 {
@@ -331,11 +331,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
331 iwe.cmd = IWEVGENIE; 331 iwe.cmd = IWEVGENIE;
332 iwe.u.data.length = network->rsn_ie_len; 332 iwe.u.data.length = network->rsn_ie_len;
333#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 333#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
334 start = iwe_stream_add_point(info, start, stop, &iwe, buf); 334 start = iwe_stream_add_point(info, start, stop, &iwe, buf);
335#else 335#else
336 start = iwe_stream_add_point(start, stop, &iwe, buf); 336 start = iwe_stream_add_point(start, stop, &iwe, buf);
337#endif 337#endif
338 } 338 }
339#endif 339#endif
340 340
341 341
@@ -348,9 +348,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee,
348 iwe.u.data.length = p - custom; 348 iwe.u.data.length = p - custom;
349 if (iwe.u.data.length) 349 if (iwe.u.data.length)
350#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) 350#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
351 start = iwe_stream_add_point(info, start, stop, &iwe, custom); 351 start = iwe_stream_add_point(info, start, stop, &iwe, custom);
352#else 352#else
353 start = iwe_stream_add_point(start, stop, &iwe, custom); 353 start = iwe_stream_add_point(start, stop, &iwe, custom);
354#endif 354#endif
355 355
356 return start; 356 return start;
@@ -516,7 +516,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
516 key, escape_essid(sec.keys[key], len), 516 key, escape_essid(sec.keys[key], len),
517 erq->length, len); 517 erq->length, len);
518 sec.key_sizes[key] = len; 518 sec.key_sizes[key] = len;
519 (*crypt)->ops->set_key(sec.keys[key], len, NULL, 519 (*crypt)->ops->set_key(sec.keys[key], len, NULL,
520 (*crypt)->priv); 520 (*crypt)->priv);
521 sec.flags |= (1 << key); 521 sec.flags |= (1 << key);
522 /* This ensures a key will be activated if no key is 522 /* This ensures a key will be activated if no key is
@@ -634,192 +634,192 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee,
634} 634}
635#if (WIRELESS_EXT >= 18) 635#if (WIRELESS_EXT >= 18)
636int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, 636int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
637 struct iw_request_info *info, 637 struct iw_request_info *info,
638 union iwreq_data *wrqu, char *extra) 638 union iwreq_data *wrqu, char *extra)
639{ 639{
640 int ret = 0; 640 int ret = 0;
641#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 641#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
642 struct net_device *dev = ieee->dev; 642 struct net_device *dev = ieee->dev;
643 struct iw_point *encoding = &wrqu->encoding; 643 struct iw_point *encoding = &wrqu->encoding;
644 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; 644 struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
645 int i, idx; 645 int i, idx;
646 int group_key = 0; 646 int group_key = 0;
647 const char *alg, *module; 647 const char *alg, *module;
648 struct ieee80211_crypto_ops *ops; 648 struct ieee80211_crypto_ops *ops;
649 struct ieee80211_crypt_data **crypt; 649 struct ieee80211_crypt_data **crypt;
650 650
651 struct ieee80211_security sec = { 651 struct ieee80211_security sec = {
652 .flags = 0, 652 .flags = 0,
653 }; 653 };
654 //printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg); 654 //printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg);
655 idx = encoding->flags & IW_ENCODE_INDEX; 655 idx = encoding->flags & IW_ENCODE_INDEX;
656 if (idx) { 656 if (idx) {
657 if (idx < 1 || idx > WEP_KEYS) 657 if (idx < 1 || idx > WEP_KEYS)
658 return -EINVAL; 658 return -EINVAL;
659 idx--; 659 idx--;
660 } else 660 } else
661 idx = ieee->tx_keyidx; 661 idx = ieee->tx_keyidx;
662 662
663 if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { 663 if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) {
664 664
665 crypt = &ieee->crypt[idx]; 665 crypt = &ieee->crypt[idx];
666 666
667 group_key = 1; 667 group_key = 1;
668 } else { 668 } else {
669 /* some Cisco APs use idx>0 for unicast in dynamic WEP */ 669 /* some Cisco APs use idx>0 for unicast in dynamic WEP */
670 //printk("not group key, flags:%x, ext->alg:%d\n", ext->ext_flags, ext->alg); 670 //printk("not group key, flags:%x, ext->alg:%d\n", ext->ext_flags, ext->alg);
671 if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP) 671 if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP)
672 return -EINVAL; 672 return -EINVAL;
673 if (ieee->iw_mode == IW_MODE_INFRA) 673 if (ieee->iw_mode == IW_MODE_INFRA)
674 674
675 crypt = &ieee->crypt[idx]; 675 crypt = &ieee->crypt[idx];
676 676
677 else 677 else
678 return -EINVAL; 678 return -EINVAL;
679 } 679 }
680 680
681 sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT; 681 sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT;
682 if ((encoding->flags & IW_ENCODE_DISABLED) || 682 if ((encoding->flags & IW_ENCODE_DISABLED) ||
683 ext->alg == IW_ENCODE_ALG_NONE) { 683 ext->alg == IW_ENCODE_ALG_NONE) {
684 if (*crypt) 684 if (*crypt)
685 ieee80211_crypt_delayed_deinit(ieee, crypt); 685 ieee80211_crypt_delayed_deinit(ieee, crypt);
686 686
687 for (i = 0; i < WEP_KEYS; i++) 687 for (i = 0; i < WEP_KEYS; i++)
688 688
689 if (ieee->crypt[i] != NULL) 689 if (ieee->crypt[i] != NULL)
690 690
691 break; 691 break;
692 692
693 if (i == WEP_KEYS) { 693 if (i == WEP_KEYS) {
694 sec.enabled = 0; 694 sec.enabled = 0;
695 // sec.encrypt = 0; 695 // sec.encrypt = 0;
696 sec.level = SEC_LEVEL_0; 696 sec.level = SEC_LEVEL_0;
697 sec.flags |= SEC_LEVEL; 697 sec.flags |= SEC_LEVEL;
698 } 698 }
699 //printk("disabled: flag:%x\n", encoding->flags); 699 //printk("disabled: flag:%x\n", encoding->flags);
700 goto done; 700 goto done;
701 } 701 }
702 702
703 sec.enabled = 1; 703 sec.enabled = 1;
704 // sec.encrypt = 1; 704 // sec.encrypt = 1;
705#if 0 705#if 0
706 if (group_key ? !ieee->host_mc_decrypt : 706 if (group_key ? !ieee->host_mc_decrypt :
707 !(ieee->host_encrypt || ieee->host_decrypt || 707 !(ieee->host_encrypt || ieee->host_decrypt ||
708 ieee->host_encrypt_msdu)) 708 ieee->host_encrypt_msdu))
709 goto skip_host_crypt; 709 goto skip_host_crypt;
710#endif 710#endif
711 switch (ext->alg) { 711 switch (ext->alg) {
712 case IW_ENCODE_ALG_WEP: 712 case IW_ENCODE_ALG_WEP:
713 alg = "WEP"; 713 alg = "WEP";
714 module = "ieee80211_crypt_wep"; 714 module = "ieee80211_crypt_wep";
715 break; 715 break;
716 case IW_ENCODE_ALG_TKIP: 716 case IW_ENCODE_ALG_TKIP:
717 alg = "TKIP"; 717 alg = "TKIP";
718 module = "ieee80211_crypt_tkip"; 718 module = "ieee80211_crypt_tkip";
719 break; 719 break;
720 case IW_ENCODE_ALG_CCMP: 720 case IW_ENCODE_ALG_CCMP:
721 alg = "CCMP"; 721 alg = "CCMP";
722 module = "ieee80211_crypt_ccmp"; 722 module = "ieee80211_crypt_ccmp";
723 break; 723 break;
724 default: 724 default:
725 IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", 725 IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n",
726 dev->name, ext->alg); 726 dev->name, ext->alg);
727 ret = -EINVAL; 727 ret = -EINVAL;
728 goto done; 728 goto done;
729 } 729 }
730 printk("alg name:%s\n",alg); 730 printk("alg name:%s\n",alg);
731 731
732 ops = ieee80211_get_crypto_ops(alg); 732 ops = ieee80211_get_crypto_ops(alg);
733 if (ops == NULL) { 733 if (ops == NULL) {
734 request_module(module); 734 request_module(module);
735 ops = ieee80211_get_crypto_ops(alg); 735 ops = ieee80211_get_crypto_ops(alg);
736 } 736 }
737 if (ops == NULL) { 737 if (ops == NULL) {
738 IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", 738 IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n",
739 dev->name, ext->alg); 739 dev->name, ext->alg);
740 printk("========>unknown crypto alg %d\n", ext->alg); 740 printk("========>unknown crypto alg %d\n", ext->alg);
741 ret = -EINVAL; 741 ret = -EINVAL;
742 goto done; 742 goto done;
743 } 743 }
744 744
745 if (*crypt == NULL || (*crypt)->ops != ops) { 745 if (*crypt == NULL || (*crypt)->ops != ops) {
746 struct ieee80211_crypt_data *new_crypt; 746 struct ieee80211_crypt_data *new_crypt;
747 747
748 ieee80211_crypt_delayed_deinit(ieee, crypt); 748 ieee80211_crypt_delayed_deinit(ieee, crypt);
749 749
750#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)) 750#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13))
751 new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); 751 new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL);
752#else 752#else
753 new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); 753 new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL);
754 memset(new_crypt,0,sizeof(*new_crypt)); 754 memset(new_crypt,0,sizeof(*new_crypt));
755#endif 755#endif
756 if (new_crypt == NULL) { 756 if (new_crypt == NULL) {
757 ret = -ENOMEM; 757 ret = -ENOMEM;
758 goto done; 758 goto done;
759 } 759 }
760 new_crypt->ops = ops; 760 new_crypt->ops = ops;
761 if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) 761 if (new_crypt->ops && try_module_get(new_crypt->ops->owner))
762 new_crypt->priv = new_crypt->ops->init(idx); 762 new_crypt->priv = new_crypt->ops->init(idx);
763 if (new_crypt->priv == NULL) { 763 if (new_crypt->priv == NULL) {
764 kfree(new_crypt); 764 kfree(new_crypt);
765 ret = -EINVAL; 765 ret = -EINVAL;
766 goto done; 766 goto done;
767 } 767 }
768 *crypt = new_crypt; 768 *crypt = new_crypt;
769 769
770 } 770 }
771 771
772 if (ext->key_len > 0 && (*crypt)->ops->set_key && 772 if (ext->key_len > 0 && (*crypt)->ops->set_key &&
773 (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq, 773 (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq,
774 (*crypt)->priv) < 0) { 774 (*crypt)->priv) < 0) {
775 IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name); 775 IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name);
776 printk("key setting failed\n"); 776 printk("key setting failed\n");
777 ret = -EINVAL; 777 ret = -EINVAL;
778 goto done; 778 goto done;
779 } 779 }
780#if 1 780#if 1
781 //skip_host_crypt: 781 //skip_host_crypt:
782 //printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags); 782 //printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags);
783 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { 783 if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
784 ieee->tx_keyidx = idx; 784 ieee->tx_keyidx = idx;
785 sec.active_key = idx; 785 sec.active_key = idx;
786 sec.flags |= SEC_ACTIVE_KEY; 786 sec.flags |= SEC_ACTIVE_KEY;
787 } 787 }
788 788
789 if (ext->alg != IW_ENCODE_ALG_NONE) { 789 if (ext->alg != IW_ENCODE_ALG_NONE) {
790 //memcpy(sec.keys[idx], ext->key, ext->key_len); 790 //memcpy(sec.keys[idx], ext->key, ext->key_len);
791 sec.key_sizes[idx] = ext->key_len; 791 sec.key_sizes[idx] = ext->key_len;
792 sec.flags |= (1 << idx); 792 sec.flags |= (1 << idx);
793 if (ext->alg == IW_ENCODE_ALG_WEP) { 793 if (ext->alg == IW_ENCODE_ALG_WEP) {
794 // sec.encode_alg[idx] = SEC_ALG_WEP; 794 // sec.encode_alg[idx] = SEC_ALG_WEP;
795 sec.flags |= SEC_LEVEL; 795 sec.flags |= SEC_LEVEL;
796 sec.level = SEC_LEVEL_1; 796 sec.level = SEC_LEVEL_1;
797 } else if (ext->alg == IW_ENCODE_ALG_TKIP) { 797 } else if (ext->alg == IW_ENCODE_ALG_TKIP) {
798 // sec.encode_alg[idx] = SEC_ALG_TKIP; 798 // sec.encode_alg[idx] = SEC_ALG_TKIP;
799 sec.flags |= SEC_LEVEL; 799 sec.flags |= SEC_LEVEL;
800 sec.level = SEC_LEVEL_2; 800 sec.level = SEC_LEVEL_2;
801 } else if (ext->alg == IW_ENCODE_ALG_CCMP) { 801 } else if (ext->alg == IW_ENCODE_ALG_CCMP) {
802 // sec.encode_alg[idx] = SEC_ALG_CCMP; 802 // sec.encode_alg[idx] = SEC_ALG_CCMP;
803 sec.flags |= SEC_LEVEL; 803 sec.flags |= SEC_LEVEL;
804 sec.level = SEC_LEVEL_3; 804 sec.level = SEC_LEVEL_3;
805 } 805 }
806 /* Don't set sec level for group keys. */ 806 /* Don't set sec level for group keys. */
807 if (group_key) 807 if (group_key)
808 sec.flags &= ~SEC_LEVEL; 808 sec.flags &= ~SEC_LEVEL;
809 } 809 }
810#endif 810#endif
811done: 811done:
812 if (ieee->set_security) 812 if (ieee->set_security)
813 ieee->set_security(ieee->dev, &sec); 813 ieee->set_security(ieee->dev, &sec);
814 814
815 if (ieee->reset_on_keychange && 815 if (ieee->reset_on_keychange &&
816 ieee->iw_mode != IW_MODE_INFRA && 816 ieee->iw_mode != IW_MODE_INFRA &&
817 ieee->reset_port && ieee->reset_port(dev)) { 817 ieee->reset_port && ieee->reset_port(dev)) {
818 IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); 818 IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name);
819 return -EINVAL; 819 return -EINVAL;
820 } 820 }
821#endif 821#endif
822 return ret; 822 return ret;
823} 823}
824 824
825int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, 825int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
@@ -878,46 +878,46 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee,
878} 878}
879 879
880int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, 880int ieee80211_wx_set_mlme(struct ieee80211_device *ieee,
881 struct iw_request_info *info, 881 struct iw_request_info *info,
882 union iwreq_data *wrqu, char *extra) 882 union iwreq_data *wrqu, char *extra)
883{ 883{
884#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 884#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
885 struct iw_mlme *mlme = (struct iw_mlme *) extra; 885 struct iw_mlme *mlme = (struct iw_mlme *) extra;
886 switch (mlme->cmd) { 886 switch (mlme->cmd) {
887 case IW_MLME_DEAUTH: 887 case IW_MLME_DEAUTH:
888 case IW_MLME_DISASSOC: 888 case IW_MLME_DISASSOC:
889 ieee80211_disassociate(ieee); 889 ieee80211_disassociate(ieee);
890 break; 890 break;
891 default: 891 default:
892 return -EOPNOTSUPP; 892 return -EOPNOTSUPP;
893 } 893 }
894#endif 894#endif
895 return 0; 895 return 0;
896} 896}
897 897
898int ieee80211_wx_set_auth(struct ieee80211_device *ieee, 898int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
899 struct iw_request_info *info, 899 struct iw_request_info *info,
900 struct iw_param *data, char *extra) 900 struct iw_param *data, char *extra)
901{ 901{
902#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 902#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
903 switch (data->flags & IW_AUTH_INDEX) { 903 switch (data->flags & IW_AUTH_INDEX) {
904 case IW_AUTH_WPA_VERSION: 904 case IW_AUTH_WPA_VERSION:
905 /*need to support wpa2 here*/ 905 /*need to support wpa2 here*/
906 //printk("wpa version:%x\n", data->value); 906 //printk("wpa version:%x\n", data->value);
907 break; 907 break;
908 case IW_AUTH_CIPHER_PAIRWISE: 908 case IW_AUTH_CIPHER_PAIRWISE:
909 case IW_AUTH_CIPHER_GROUP: 909 case IW_AUTH_CIPHER_GROUP:
910 case IW_AUTH_KEY_MGMT: 910 case IW_AUTH_KEY_MGMT:
911 /* 911 /*
912 * * Host AP driver does not use these parameters and allows 912 * * Host AP driver does not use these parameters and allows
913 * * wpa_supplicant to control them internally. 913 * * wpa_supplicant to control them internally.
914 * */ 914 * */
915 break; 915 break;
916 case IW_AUTH_TKIP_COUNTERMEASURES: 916 case IW_AUTH_TKIP_COUNTERMEASURES:
917 ieee->tkip_countermeasures = data->value; 917 ieee->tkip_countermeasures = data->value;
918 break; 918 break;
919 case IW_AUTH_DROP_UNENCRYPTED: 919 case IW_AUTH_DROP_UNENCRYPTED:
920 ieee->drop_unencrypted = data->value; 920 ieee->drop_unencrypted = data->value;
921 break; 921 break;
922 922
923 case IW_AUTH_80211_AUTH_ALG: 923 case IW_AUTH_80211_AUTH_ALG:
@@ -949,13 +949,13 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee,
949 949
950#endif 950#endif
951 case IW_AUTH_RX_UNENCRYPTED_EAPOL: 951 case IW_AUTH_RX_UNENCRYPTED_EAPOL:
952 ieee->ieee802_1x = data->value; 952 ieee->ieee802_1x = data->value;
953 break; 953 break;
954 case IW_AUTH_PRIVACY_INVOKED: 954 case IW_AUTH_PRIVACY_INVOKED:
955 ieee->privacy_invoked = data->value; 955 ieee->privacy_invoked = data->value;
956 break; 956 break;
957 default: 957 default:
958 return -EOPNOTSUPP; 958 return -EOPNOTSUPP;
959 } 959 }
960#endif 960#endif
961 return 0; 961 return 0;
diff --git a/drivers/staging/rtl8192u/ieee80211/proc.c b/drivers/staging/rtl8192u/ieee80211/proc.c
index 4f3f9ed7751..6eda928e409 100644
--- a/drivers/staging/rtl8192u/ieee80211/proc.c
+++ b/drivers/staging/rtl8192u/ieee80211/proc.c
@@ -73,7 +73,7 @@ static int c_show(struct seq_file *m, void *p)
73 seq_printf(m, "type : digest\n"); 73 seq_printf(m, "type : digest\n");
74 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); 74 seq_printf(m, "blocksize : %u\n", alg->cra_blocksize);
75 seq_printf(m, "digestsize : %u\n", 75 seq_printf(m, "digestsize : %u\n",
76 alg->cra_digest.dia_digestsize); 76 alg->cra_digest.dia_digestsize);
77 break; 77 break;
78 case CRYPTO_ALG_TYPE_COMPRESS: 78 case CRYPTO_ALG_TYPE_COMPRESS:
79 seq_printf(m, "type : compression\n"); 79 seq_printf(m, "type : compression\n");
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
index 992b71825a8..cde603f67f4 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h
@@ -437,7 +437,7 @@ extern u8 MCS_FILTER_1SS[16];
437 437
438// MCS Bw 40 {1~7, 12~15,32} 438// MCS Bw 40 {1~7, 12~15,32}
439#define RATE_ADPT_1SS_MASK 0xFF 439#define RATE_ADPT_1SS_MASK 0xFF
440#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily 440#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily
441#define RATE_ADPT_MCS32_MASK 0x01 441#define RATE_ADPT_MCS32_MASK 0x01
442 442
443#define IS_11N_MCS_RATE(rate) (rate&0x80) 443#define IS_11N_MCS_RATE(rate) (rate&0x80)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
index 87074eec2e1..7c0e489b6c7 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c
@@ -361,11 +361,11 @@ bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee)
361 (net->ralink_cap_exist)) 361 (net->ralink_cap_exist))
362 retValue = true; 362 retValue = true;
363 else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) || 363 else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) ||
364 (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| 364 (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)||
365 (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| 365 (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)||
366 (memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) || 366 (memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) ||
367 (net->broadcom_cap_exist)) 367 (net->broadcom_cap_exist))
368 retValue = true; 368 retValue = true;
369 else if(net->bssht.bdRT2RTAggregation) 369 else if(net->bssht.bdRT2RTAggregation)
370 retValue = true; 370 retValue = true;
371 else 371 else
@@ -425,7 +425,7 @@ u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr)
425 // Apply for 819u only 425 // Apply for 819u only
426#if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE) 426#if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE)
427 if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || 427 if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) ||
428 (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) 428 (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)
429 ) 429 )
430 { 430 {
431 ret = 1; 431 ret = 1;
@@ -569,8 +569,8 @@ u8 HTIOTActIsCCDFsync(u8* PeerMacAddr)
569{ 569{
570 u8 retValue = 0; 570 u8 retValue = 0;
571 if( (memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || 571 if( (memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) ||
572 (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) || 572 (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) ||
573 (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0)) 573 (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0))
574 { 574 {
575 retValue = 1; 575 retValue = 1;
576 } 576 }
@@ -648,7 +648,7 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u
648 648
649 649
650 //MAC HT parameters info 650 //MAC HT parameters info
651 // TODO: Nedd to take care of this part 651 // TODO: Nedd to take care of this part
652 IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk); 652 IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk);
653 653
654 if( IsEncrypt) 654 if( IsEncrypt)
@@ -1662,7 +1662,7 @@ void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidt
1662 //if in half N mode, set to 20M bandwidth please 09.08.2008 WB. 1662 //if in half N mode, set to 20M bandwidth please 09.08.2008 WB.
1663 if(Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))) 1663 if(Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)))
1664 { 1664 {
1665 // Handle Illegal extention channel offset!! 1665 // Handle Illegal extention channel offset!!
1666 if(ieee->current_network.channel<2 && Offset==HT_EXTCHNL_OFFSET_LOWER) 1666 if(ieee->current_network.channel<2 && Offset==HT_EXTCHNL_OFFSET_LOWER)
1667 Offset = HT_EXTCHNL_OFFSET_NO_EXT; 1667 Offset = HT_EXTCHNL_OFFSET_NO_EXT;
1668 if(Offset==HT_EXTCHNL_OFFSET_UPPER || Offset==HT_EXTCHNL_OFFSET_LOWER) { 1668 if(Offset==HT_EXTCHNL_OFFSET_UPPER || Offset==HT_EXTCHNL_OFFSET_LOWER) {
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
index f7b882b99d1..7ecfe68ddd5 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h
@@ -647,18 +647,18 @@ typedef struct _QOS_TSTREAM{
647// 802.11 Management frame Status Code field 647// 802.11 Management frame Status Code field
648//---------------------------------------------------------------------------- 648//----------------------------------------------------------------------------
649typedef struct _OCTET_STRING{ 649typedef struct _OCTET_STRING{
650 u8 *Octet; 650 u8 *Octet;
651 u16 Length; 651 u16 Length;
652}OCTET_STRING, *POCTET_STRING; 652}OCTET_STRING, *POCTET_STRING;
653#if 0 653#if 0
654#define FillOctetString(_os,_octet,_len) \ 654#define FillOctetString(_os,_octet,_len) \
655 (_os).Octet=(u8 *)(_octet); \ 655 (_os).Octet=(u8 *)(_octet); \
656 (_os).Length=(_len); 656 (_os).Length=(_len);
657 657
658#define WMM_ELEM_HDR_LEN 6 658#define WMM_ELEM_HDR_LEN 6
659#define WMMElemSkipHdr(_osWMMElem) \ 659#define WMMElemSkipHdr(_osWMMElem) \
660 (_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \ 660 (_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \
661 (_osWMMElem).Length -= WMM_ELEM_HDR_LEN; 661 (_osWMMElem).Length -= WMM_ELEM_HDR_LEN;
662#endif 662#endif
663// 663//
664// STA QoS data. 664// STA QoS data.
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 5aa4c8db438..ecf24b9edb1 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -509,31 +509,31 @@ void RemoveTsEntry(
509 if(timer_pending(&pRxTS->RxPktPendingTimer)) 509 if(timer_pending(&pRxTS->RxPktPendingTimer))
510 del_timer_sync(&pRxTS->RxPktPendingTimer); 510 del_timer_sync(&pRxTS->RxPktPendingTimer);
511 511
512 while(!list_empty(&pRxTS->RxPendingPktList)) 512 while(!list_empty(&pRxTS->RxPendingPktList))
513 { 513 {
514 // PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK); 514 // PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK);
515 spin_lock_irqsave(&(ieee->reorder_spinlock), flags); 515 spin_lock_irqsave(&(ieee->reorder_spinlock), flags);
516 //pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); 516 //pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
517 pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); 517 pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List);
518 list_del_init(&pRxReorderEntry->List); 518 list_del_init(&pRxReorderEntry->List);
519 { 519 {
520 int i = 0; 520 int i = 0;
521 struct ieee80211_rxb * prxb = pRxReorderEntry->prxb; 521 struct ieee80211_rxb * prxb = pRxReorderEntry->prxb;
522 if (unlikely(!prxb)) 522 if (unlikely(!prxb))
523 { 523 {
524 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); 524 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
525 return; 525 return;
526 } 526 }
527 for(i =0; i < prxb->nr_subframes; i++) { 527 for(i =0; i < prxb->nr_subframes; i++) {
528 dev_kfree_skb(prxb->subframes[i]); 528 dev_kfree_skb(prxb->subframes[i]);
529 } 529 }
530 kfree(prxb); 530 kfree(prxb);
531 prxb = NULL; 531 prxb = NULL;
532 } 532 }
533 list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); 533 list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List);
534 //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); 534 //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
535 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); 535 spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags);
536 } 536 }
537 537
538//#endif 538//#endif
539 } 539 }
diff --git a/drivers/staging/rtl8192u/r8180_pm.c b/drivers/staging/rtl8192u/r8180_pm.c
index fdb2eb66519..0c58d0ed502 100644
--- a/drivers/staging/rtl8192u/r8180_pm.c
+++ b/drivers/staging/rtl8192u/r8180_pm.c
@@ -17,28 +17,28 @@
17 17
18int rtl8180_save_state (struct pci_dev *dev, u32 state) 18int rtl8180_save_state (struct pci_dev *dev, u32 state)
19{ 19{
20 printk(KERN_NOTICE "r8180 save state call (state %u).\n", state); 20 printk(KERN_NOTICE "r8180 save state call (state %u).\n", state);
21 return(-EAGAIN); 21 return(-EAGAIN);
22} 22}
23 23
24 24
25int rtl8180_suspend (struct pci_dev *dev, u32 state) 25int rtl8180_suspend (struct pci_dev *dev, u32 state)
26{ 26{
27 printk(KERN_NOTICE "r8180 suspend call (state %u).\n", state); 27 printk(KERN_NOTICE "r8180 suspend call (state %u).\n", state);
28 return(-EAGAIN); 28 return(-EAGAIN);
29} 29}
30 30
31 31
32int rtl8180_resume (struct pci_dev *dev) 32int rtl8180_resume (struct pci_dev *dev)
33{ 33{
34 printk(KERN_NOTICE "r8180 resume call.\n"); 34 printk(KERN_NOTICE "r8180 resume call.\n");
35 return(-EAGAIN); 35 return(-EAGAIN);
36} 36}
37 37
38 38
39int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable) 39int rtl8180_enable_wake (struct pci_dev *dev, u32 state, int enable)
40{ 40{
41 printk(KERN_NOTICE "r8180 enable wake call (state %u, enable %d).\n", 41 printk(KERN_NOTICE "r8180 enable wake call (state %u, enable %d).\n",
42 state, enable); 42 state, enable);
43 return(-EAGAIN); 43 return(-EAGAIN);
44} 44}
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 15999e850b6..7aa464224d1 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -97,7 +97,7 @@ u32 rt_global_debug_component = \
97 // COMP_TRACE | 97 // COMP_TRACE |
98 COMP_DOWN | 98 COMP_DOWN |
99 // COMP_RECV | 99 // COMP_RECV |
100 // COMP_SWBW | 100 // COMP_SWBW |
101 COMP_SEC | 101 COMP_SEC |
102 // COMP_RESET | 102 // COMP_RESET |
103 // COMP_SEND | 103 // COMP_SEND |
@@ -175,17 +175,17 @@ static struct usb_driver rtl8192_usb_driver = {
175#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15) 175#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 15)
176 .owner = THIS_MODULE, 176 .owner = THIS_MODULE,
177#endif 177#endif
178 .name = RTL819xU_MODULE_NAME, /* Driver name */ 178 .name = RTL819xU_MODULE_NAME, /* Driver name */
179 .id_table = rtl8192_usb_id_tbl, /* PCI_ID table */ 179 .id_table = rtl8192_usb_id_tbl, /* PCI_ID table */
180 .probe = rtl8192_usb_probe, /* probe fn */ 180 .probe = rtl8192_usb_probe, /* probe fn */
181 .disconnect = rtl8192_usb_disconnect, /* remove fn */ 181 .disconnect = rtl8192_usb_disconnect, /* remove fn */
182#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0) 182#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)
183#ifdef CONFIG_RTL8192_PM 183#ifdef CONFIG_RTL8192_PM
184 .suspend = rtl8192_suspend, /* PM suspend fn */ 184 .suspend = rtl8192_suspend, /* PM suspend fn */
185 .resume = rtl8192_resume, /* PM resume fn */ 185 .resume = rtl8192_resume, /* PM resume fn */
186#else 186#else
187 .suspend = NULL, /* PM suspend fn */ 187 .suspend = NULL, /* PM suspend fn */
188 .resume = NULL, /* PM resume fn */ 188 .resume = NULL, /* PM resume fn */
189#endif 189#endif
190#endif 190#endif
191}; 191};
@@ -282,22 +282,22 @@ void CamResetAllEntry(struct net_device *dev)
282{ 282{
283#if 1 283#if 1
284 u32 ulcommand = 0; 284 u32 ulcommand = 0;
285 //2004/02/11 In static WEP, OID_ADD_KEY or OID_ADD_WEP are set before STA associate to AP. 285 //2004/02/11 In static WEP, OID_ADD_KEY or OID_ADD_WEP are set before STA associate to AP.
286 // However, ResetKey is called on OID_802_11_INFRASTRUCTURE_MODE and MlmeAssociateRequest 286 // However, ResetKey is called on OID_802_11_INFRASTRUCTURE_MODE and MlmeAssociateRequest
287 // In this condition, Cam can not be reset because upper layer will not set this static key again. 287 // In this condition, Cam can not be reset because upper layer will not set this static key again.
288 //if(Adapter->EncAlgorithm == WEP_Encryption) 288 //if(Adapter->EncAlgorithm == WEP_Encryption)
289 // return; 289 // return;
290//debug 290//debug
291 //DbgPrint("========================================\n"); 291 //DbgPrint("========================================\n");
292 //DbgPrint(" Call ResetAllEntry \n"); 292 //DbgPrint(" Call ResetAllEntry \n");
293 //DbgPrint("========================================\n\n"); 293 //DbgPrint("========================================\n\n");
294 ulcommand |= BIT31|BIT30; 294 ulcommand |= BIT31|BIT30;
295 write_nic_dword(dev, RWCAM, ulcommand); 295 write_nic_dword(dev, RWCAM, ulcommand);
296#else 296#else
297 for(ucIndex=0;ucIndex<TOTAL_CAM_ENTRY;ucIndex++) 297 for(ucIndex=0;ucIndex<TOTAL_CAM_ENTRY;ucIndex++)
298 CAM_mark_invalid(dev, ucIndex); 298 CAM_mark_invalid(dev, ucIndex);
299 for(ucIndex=0;ucIndex<TOTAL_CAM_ENTRY;ucIndex++) 299 for(ucIndex=0;ucIndex<TOTAL_CAM_ENTRY;ucIndex++)
300 CAM_empty_entry(dev, ucIndex); 300 CAM_empty_entry(dev, ucIndex);
301#endif 301#endif
302 302
303} 303}
@@ -305,14 +305,14 @@ void CamResetAllEntry(struct net_device *dev)
305 305
306void write_cam(struct net_device *dev, u8 addr, u32 data) 306void write_cam(struct net_device *dev, u8 addr, u32 data)
307{ 307{
308 write_nic_dword(dev, WCAMI, data); 308 write_nic_dword(dev, WCAMI, data);
309 write_nic_dword(dev, RWCAM, BIT31|BIT16|(addr&0xff) ); 309 write_nic_dword(dev, RWCAM, BIT31|BIT16|(addr&0xff) );
310} 310}
311 311
312u32 read_cam(struct net_device *dev, u8 addr) 312u32 read_cam(struct net_device *dev, u8 addr)
313{ 313{
314 write_nic_dword(dev, RWCAM, 0x80000000|(addr&0xff) ); 314 write_nic_dword(dev, RWCAM, 0x80000000|(addr&0xff) );
315 return read_nic_dword(dev, 0xa8); 315 return read_nic_dword(dev, 0xa8);
316} 316}
317 317
318void write_nic_byte_E(struct net_device *dev, int indx, u8 data) 318void write_nic_byte_E(struct net_device *dev, int indx, u8 data)
@@ -342,10 +342,10 @@ u8 read_nic_byte_E(struct net_device *dev, int indx)
342 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ, 342 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
343 indx|0xfe00, 0, &data, 1, HZ / 2); 343 indx|0xfe00, 0, &data, 1, HZ / 2);
344 344
345 if (status < 0) 345 if (status < 0)
346 { 346 {
347 printk("read_nic_byte_E TimeOut! status:%d\n", status); 347 printk("read_nic_byte_E TimeOut! status:%d\n", status);
348 } 348 }
349 349
350 return data; 350 return data;
351} 351}
@@ -361,10 +361,10 @@ void write_nic_byte(struct net_device *dev, int indx, u8 data)
361 RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE, 361 RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE,
362 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 1, HZ / 2); 362 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 1, HZ / 2);
363 363
364 if (status < 0) 364 if (status < 0)
365 { 365 {
366 printk("write_nic_byte TimeOut! status:%d\n", status); 366 printk("write_nic_byte TimeOut! status:%d\n", status);
367 } 367 }
368 368
369 369
370} 370}
@@ -382,10 +382,10 @@ void write_nic_word(struct net_device *dev, int indx, u16 data)
382 RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE, 382 RTL8187_REQ_SET_REGS, RTL8187_REQT_WRITE,
383 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 2, HZ / 2); 383 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 2, HZ / 2);
384 384
385 if (status < 0) 385 if (status < 0)
386 { 386 {
387 printk("write_nic_word TimeOut! status:%d\n", status); 387 printk("write_nic_word TimeOut! status:%d\n", status);
388 } 388 }
389 389
390} 390}
391 391
@@ -403,10 +403,10 @@ void write_nic_dword(struct net_device *dev, int indx, u32 data)
403 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 4, HZ / 2); 403 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 4, HZ / 2);
404 404
405 405
406 if (status < 0) 406 if (status < 0)
407 { 407 {
408 printk("write_nic_dword TimeOut! status:%d\n", status); 408 printk("write_nic_dword TimeOut! status:%d\n", status);
409 } 409 }
410 410
411} 411}
412 412
@@ -423,10 +423,10 @@ u8 read_nic_byte(struct net_device *dev, int indx)
423 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ, 423 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
424 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 1, HZ / 2); 424 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 1, HZ / 2);
425 425
426 if (status < 0) 426 if (status < 0)
427 { 427 {
428 printk("read_nic_byte TimeOut! status:%d\n", status); 428 printk("read_nic_byte TimeOut! status:%d\n", status);
429 } 429 }
430 430
431 return data; 431 return data;
432} 432}
@@ -444,10 +444,10 @@ u16 read_nic_word(struct net_device *dev, int indx)
444 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ, 444 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
445 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 2, HZ / 2); 445 (indx&0xff)|0xff00, (indx>>8)&0x0f, &data, 2, HZ / 2);
446 446
447 if (status < 0) 447 if (status < 0)
448 { 448 {
449 printk("read_nic_word TimeOut! status:%d\n", status); 449 printk("read_nic_word TimeOut! status:%d\n", status);
450 } 450 }
451 451
452 452
453 return data; 453 return data;
@@ -464,10 +464,10 @@ u16 read_nic_word_E(struct net_device *dev, int indx)
464 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ, 464 RTL8187_REQ_GET_REGS, RTL8187_REQT_READ,
465 indx|0xfe00, 0, &data, 2, HZ / 2); 465 indx|0xfe00, 0, &data, 2, HZ / 2);
466 466
467 if (status < 0) 467 if (status < 0)
468 { 468 {
469 printk("read_nic_word TimeOut! status:%d\n", status); 469 printk("read_nic_word TimeOut! status:%d\n", status);
470 } 470 }
471 471
472 472
473 return data; 473 return data;
@@ -489,10 +489,10 @@ u32 read_nic_dword(struct net_device *dev, int indx)
489// printk(KERN_WARNING "read size of data = %d\, date = %d\n", result, data); 489// printk(KERN_WARNING "read size of data = %d\, date = %d\n", result, data);
490// } 490// }
491 491
492 if (status < 0) 492 if (status < 0)
493 { 493 {
494 printk("read_nic_dword TimeOut! status:%d\n", status); 494 printk("read_nic_dword TimeOut! status:%d\n", status);
495 } 495 }
496 496
497 497
498 498
@@ -542,21 +542,21 @@ static int proc_get_stats_ap(char *page, char **start,
542 542
543 int len = 0; 543 int len = 0;
544 544
545 list_for_each_entry(target, &ieee->network_list, list) { 545 list_for_each_entry(target, &ieee->network_list, list) {
546 546
547 len += snprintf(page + len, count - len, 547 len += snprintf(page + len, count - len,
548 "%s ", target->ssid); 548 "%s ", target->ssid);
549 549
550 if(target->wpa_ie_len>0 || target->rsn_ie_len>0){ 550 if(target->wpa_ie_len>0 || target->rsn_ie_len>0){
551 len += snprintf(page + len, count - len, 551 len += snprintf(page + len, count - len,
552 "WPA\n"); 552 "WPA\n");
553 } 553 }
554 else{ 554 else{
555 len += snprintf(page + len, count - len, 555 len += snprintf(page + len, count - len,
556 "non_WPA\n"); 556 "non_WPA\n");
557 } 557 }
558 558
559 } 559 }
560 560
561 *eof = 1; 561 *eof = 1;
562 return len; 562 return len;
@@ -576,7 +576,7 @@ static int proc_get_registers(char *page, char **start,
576 576
577 /* This dump the current register page */ 577 /* This dump the current register page */
578len += snprintf(page + len, count - len, 578len += snprintf(page + len, count - len,
579 "\n####################page 0##################\n "); 579 "\n####################page 0##################\n ");
580 580
581 for(n=0;n<=max;) 581 for(n=0;n<=max;)
582 { 582 {
@@ -592,33 +592,33 @@ len += snprintf(page + len, count - len,
592 } 592 }
593#if 1 593#if 1
594len += snprintf(page + len, count - len, 594len += snprintf(page + len, count - len,
595 "\n####################page 1##################\n "); 595 "\n####################page 1##################\n ");
596 for(n=0;n<=max;) 596 for(n=0;n<=max;)
597 { 597 {
598 //printk( "\nD: %2x> ", n); 598 //printk( "\nD: %2x> ", n);
599 len += snprintf(page + len, count - len, 599 len += snprintf(page + len, count - len,
600 "\nD: %2x > ",n); 600 "\nD: %2x > ",n);
601 601
602 for(i=0;i<16 && n<=max;i++,n++) 602 for(i=0;i<16 && n<=max;i++,n++)
603 len += snprintf(page + len, count - len, 603 len += snprintf(page + len, count - len,
604 "%2x ",read_nic_byte(dev,0x100|n)); 604 "%2x ",read_nic_byte(dev,0x100|n));
605 605
606 // printk("%2x ",read_nic_byte(dev,n)); 606 // printk("%2x ",read_nic_byte(dev,n));
607 } 607 }
608len += snprintf(page + len, count - len, 608len += snprintf(page + len, count - len,
609 "\n####################page 3##################\n "); 609 "\n####################page 3##################\n ");
610 for(n=0;n<=max;) 610 for(n=0;n<=max;)
611 { 611 {
612 //printk( "\nD: %2x> ", n); 612 //printk( "\nD: %2x> ", n);
613 len += snprintf(page + len, count - len, 613 len += snprintf(page + len, count - len,
614 "\nD: %2x > ",n); 614 "\nD: %2x > ",n);
615 615
616 for(i=0;i<16 && n<=max;i++,n++) 616 for(i=0;i<16 && n<=max;i++,n++)
617 len += snprintf(page + len, count - len, 617 len += snprintf(page + len, count - len,
618 "%2x ",read_nic_byte(dev,0x300|n)); 618 "%2x ",read_nic_byte(dev,0x300|n));
619 619
620 // printk("%2x ",read_nic_byte(dev,n)); 620 // printk("%2x ",read_nic_byte(dev,n));
621 } 621 }
622 622
623#endif 623#endif
624 624
@@ -1154,64 +1154,64 @@ u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats)
1154} 1154}
1155static int rtl8192_rx_initiate(struct net_device*dev) 1155static int rtl8192_rx_initiate(struct net_device*dev)
1156{ 1156{
1157 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1157 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
1158 struct urb *entry; 1158 struct urb *entry;
1159 struct sk_buff *skb; 1159 struct sk_buff *skb;
1160 struct rtl8192_rx_info *info; 1160 struct rtl8192_rx_info *info;
1161 1161
1162 /* nomal packet rx procedure */ 1162 /* nomal packet rx procedure */
1163 while (skb_queue_len(&priv->rx_queue) < MAX_RX_URB) { 1163 while (skb_queue_len(&priv->rx_queue) < MAX_RX_URB) {
1164 skb = __dev_alloc_skb(RX_URB_SIZE, GFP_KERNEL); 1164 skb = __dev_alloc_skb(RX_URB_SIZE, GFP_KERNEL);
1165 if (!skb) 1165 if (!skb)
1166 break; 1166 break;
1167#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1167#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
1168 entry = usb_alloc_urb(0, GFP_KERNEL); 1168 entry = usb_alloc_urb(0, GFP_KERNEL);
1169#else 1169#else
1170 entry = usb_alloc_urb(0); 1170 entry = usb_alloc_urb(0);
1171#endif 1171#endif
1172 if (!entry) { 1172 if (!entry) {
1173 kfree_skb(skb); 1173 kfree_skb(skb);
1174 break; 1174 break;
1175 } 1175 }
1176// printk("nomal packet IN request!\n"); 1176// printk("nomal packet IN request!\n");
1177 usb_fill_bulk_urb(entry, priv->udev, 1177 usb_fill_bulk_urb(entry, priv->udev,
1178 usb_rcvbulkpipe(priv->udev, 3), skb_tail_pointer(skb), 1178 usb_rcvbulkpipe(priv->udev, 3), skb_tail_pointer(skb),
1179 RX_URB_SIZE, rtl8192_rx_isr, skb); 1179 RX_URB_SIZE, rtl8192_rx_isr, skb);
1180 info = (struct rtl8192_rx_info *) skb->cb; 1180 info = (struct rtl8192_rx_info *) skb->cb;
1181 info->urb = entry; 1181 info->urb = entry;
1182 info->dev = dev; 1182 info->dev = dev;
1183 info->out_pipe = 3; //denote rx normal packet queue 1183 info->out_pipe = 3; //denote rx normal packet queue
1184 skb_queue_tail(&priv->rx_queue, skb); 1184 skb_queue_tail(&priv->rx_queue, skb);
1185 usb_submit_urb(entry, GFP_KERNEL); 1185 usb_submit_urb(entry, GFP_KERNEL);
1186 } 1186 }
1187 1187
1188 /* command packet rx procedure */ 1188 /* command packet rx procedure */
1189 while (skb_queue_len(&priv->rx_queue) < MAX_RX_URB + 3) { 1189 while (skb_queue_len(&priv->rx_queue) < MAX_RX_URB + 3) {
1190// printk("command packet IN request!\n"); 1190// printk("command packet IN request!\n");
1191 skb = __dev_alloc_skb(RX_URB_SIZE ,GFP_KERNEL); 1191 skb = __dev_alloc_skb(RX_URB_SIZE ,GFP_KERNEL);
1192 if (!skb) 1192 if (!skb)
1193 break; 1193 break;
1194#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1194#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
1195 entry = usb_alloc_urb(0, GFP_KERNEL); 1195 entry = usb_alloc_urb(0, GFP_KERNEL);
1196#else 1196#else
1197 entry = usb_alloc_urb(0); 1197 entry = usb_alloc_urb(0);
1198#endif 1198#endif
1199 if (!entry) { 1199 if (!entry) {
1200 kfree_skb(skb); 1200 kfree_skb(skb);
1201 break; 1201 break;
1202 } 1202 }
1203 usb_fill_bulk_urb(entry, priv->udev, 1203 usb_fill_bulk_urb(entry, priv->udev,
1204 usb_rcvbulkpipe(priv->udev, 9), skb_tail_pointer(skb), 1204 usb_rcvbulkpipe(priv->udev, 9), skb_tail_pointer(skb),
1205 RX_URB_SIZE, rtl8192_rx_isr, skb); 1205 RX_URB_SIZE, rtl8192_rx_isr, skb);
1206 info = (struct rtl8192_rx_info *) skb->cb; 1206 info = (struct rtl8192_rx_info *) skb->cb;
1207 info->urb = entry; 1207 info->urb = entry;
1208 info->dev = dev; 1208 info->dev = dev;
1209 info->out_pipe = 9; //denote rx cmd packet queue 1209 info->out_pipe = 9; //denote rx cmd packet queue
1210 skb_queue_tail(&priv->rx_queue, skb); 1210 skb_queue_tail(&priv->rx_queue, skb);
1211 usb_submit_urb(entry, GFP_KERNEL); 1211 usb_submit_urb(entry, GFP_KERNEL);
1212 } 1212 }
1213 1213
1214 return 0; 1214 return 0;
1215} 1215}
1216 1216
1217void rtl8192_set_rxconf(struct net_device *dev) 1217void rtl8192_set_rxconf(struct net_device *dev)
@@ -1543,53 +1543,53 @@ static void rtl8192_rx_isr(struct urb *urb, struct pt_regs *regs)
1543static void rtl8192_rx_isr(struct urb *urb) 1543static void rtl8192_rx_isr(struct urb *urb)
1544#endif 1544#endif
1545{ 1545{
1546 struct sk_buff *skb = (struct sk_buff *) urb->context; 1546 struct sk_buff *skb = (struct sk_buff *) urb->context;
1547 struct rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb; 1547 struct rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
1548 struct net_device *dev = info->dev; 1548 struct net_device *dev = info->dev;
1549 struct r8192_priv *priv = ieee80211_priv(dev); 1549 struct r8192_priv *priv = ieee80211_priv(dev);
1550 int out_pipe = info->out_pipe; 1550 int out_pipe = info->out_pipe;
1551 int err; 1551 int err;
1552 if(!priv->up) 1552 if(!priv->up)
1553 return; 1553 return;
1554 if (unlikely(urb->status)) { 1554 if (unlikely(urb->status)) {
1555 info->urb = NULL; 1555 info->urb = NULL;
1556 priv->stats.rxstaterr++; 1556 priv->stats.rxstaterr++;
1557 priv->ieee80211->stats.rx_errors++; 1557 priv->ieee80211->stats.rx_errors++;
1558 usb_free_urb(urb); 1558 usb_free_urb(urb);
1559 // printk("%s():rx status err\n",__FUNCTION__); 1559 // printk("%s():rx status err\n",__FUNCTION__);
1560 return; 1560 return;
1561 } 1561 }
1562#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14) 1562#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
1563 skb_unlink(skb, &priv->rx_queue); 1563 skb_unlink(skb, &priv->rx_queue);
1564#else 1564#else
1565 __skb_unlink(skb,&priv->rx_queue); 1565 __skb_unlink(skb,&priv->rx_queue);
1566#endif 1566#endif
1567 skb_put(skb, urb->actual_length); 1567 skb_put(skb, urb->actual_length);
1568 1568
1569 skb_queue_tail(&priv->skb_queue, skb); 1569 skb_queue_tail(&priv->skb_queue, skb);
1570 tasklet_schedule(&priv->irq_rx_tasklet); 1570 tasklet_schedule(&priv->irq_rx_tasklet);
1571 1571
1572 skb = dev_alloc_skb(RX_URB_SIZE); 1572 skb = dev_alloc_skb(RX_URB_SIZE);
1573 if (unlikely(!skb)) { 1573 if (unlikely(!skb)) {
1574 usb_free_urb(urb); 1574 usb_free_urb(urb);
1575 printk("%s():can,t alloc skb\n",__FUNCTION__); 1575 printk("%s():can,t alloc skb\n",__FUNCTION__);
1576 /* TODO check rx queue length and refill *somewhere* */ 1576 /* TODO check rx queue length and refill *somewhere* */
1577 return; 1577 return;
1578 } 1578 }
1579 1579
1580 usb_fill_bulk_urb(urb, priv->udev, 1580 usb_fill_bulk_urb(urb, priv->udev,
1581 usb_rcvbulkpipe(priv->udev, out_pipe), skb_tail_pointer(skb), 1581 usb_rcvbulkpipe(priv->udev, out_pipe), skb_tail_pointer(skb),
1582 RX_URB_SIZE, rtl8192_rx_isr, skb); 1582 RX_URB_SIZE, rtl8192_rx_isr, skb);
1583 1583
1584 info = (struct rtl8192_rx_info *) skb->cb; 1584 info = (struct rtl8192_rx_info *) skb->cb;
1585 info->urb = urb; 1585 info->urb = urb;
1586 info->dev = dev; 1586 info->dev = dev;
1587 info->out_pipe = out_pipe; 1587 info->out_pipe = out_pipe;
1588 1588
1589 urb->transfer_buffer = skb_tail_pointer(skb); 1589 urb->transfer_buffer = skb_tail_pointer(skb);
1590 urb->context = skb; 1590 urb->context = skb;
1591 skb_queue_tail(&priv->rx_queue, skb); 1591 skb_queue_tail(&priv->rx_queue, skb);
1592 err = usb_submit_urb(urb, GFP_ATOMIC); 1592 err = usb_submit_urb(urb, GFP_ATOMIC);
1593 if(err && err != EPERM) 1593 if(err && err != EPERM)
1594 printk("can not submit rxurb, err is %x,URB status is %x\n",err,urb->status); 1594 printk("can not submit rxurb, err is %x,URB status is %x\n",err,urb->status);
1595} 1595}
@@ -1674,7 +1674,7 @@ void rtl8192_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, int rat
1674 1674
1675 spin_lock_irqsave(&priv->tx_lock,flags); 1675 spin_lock_irqsave(&priv->tx_lock,flags);
1676 1676
1677 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); 1677 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
1678// tcb_desc->RATRIndex = 7; 1678// tcb_desc->RATRIndex = 7;
1679// tcb_desc->bTxDisableRateFallBack = 1; 1679// tcb_desc->bTxDisableRateFallBack = 1;
1680// tcb_desc->bTxUseDriverAssingedRate = 1; 1680// tcb_desc->bTxUseDriverAssingedRate = 1;
@@ -1701,18 +1701,18 @@ int rtl8192_hard_start_xmit(struct sk_buff *skb,struct net_device *dev)
1701 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 1701 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
1702 int ret; 1702 int ret;
1703 unsigned long flags; 1703 unsigned long flags;
1704 cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); 1704 cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
1705 u8 queue_index = tcb_desc->queue_index; 1705 u8 queue_index = tcb_desc->queue_index;
1706 1706
1707 1707
1708 spin_lock_irqsave(&priv->tx_lock,flags); 1708 spin_lock_irqsave(&priv->tx_lock,flags);
1709 1709
1710 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev)); 1710 memcpy((unsigned char *)(skb->cb),&dev,sizeof(dev));
1711 if(queue_index == TXCMD_QUEUE) { 1711 if(queue_index == TXCMD_QUEUE) {
1712 skb_push(skb, USB_HWDESC_HEADER_LEN); 1712 skb_push(skb, USB_HWDESC_HEADER_LEN);
1713 rtl819xU_tx_cmd(dev, skb); 1713 rtl819xU_tx_cmd(dev, skb);
1714 ret = 1; 1714 ret = 1;
1715 spin_unlock_irqrestore(&priv->tx_lock,flags); 1715 spin_unlock_irqrestore(&priv->tx_lock,flags);
1716 return ret; 1716 return ret;
1717 } else { 1717 } else {
1718 skb_push(skb, priv->ieee80211->tx_headroom); 1718 skb_push(skb, priv->ieee80211->tx_headroom);
@@ -1780,7 +1780,7 @@ struct sk_buff *DrvAggr_Aggregation(struct net_device *dev, struct ieee80211_drv
1780 tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); 1780 tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
1781 tcb_desc->drv_agg_enable = 1; 1781 tcb_desc->drv_agg_enable = 1;
1782 tcb_desc->pkt_size = skb->len; 1782 tcb_desc->pkt_size = skb->len;
1783 tcb_desc->DrvAggrNum = pSendList->nr_drv_agg_frames; 1783 tcb_desc->DrvAggrNum = pSendList->nr_drv_agg_frames;
1784 printk("DrvAggNum = %d\n", tcb_desc->DrvAggrNum); 1784 printk("DrvAggNum = %d\n", tcb_desc->DrvAggrNum);
1785// RT_DEBUG_DATA(COMP_SEND, skb->cb, sizeof(skb->cb)); 1785// RT_DEBUG_DATA(COMP_SEND, skb->cb, sizeof(skb->cb));
1786// printk("========>skb->data ======> \n"); 1786// printk("========>skb->data ======> \n");
@@ -2061,7 +2061,7 @@ static void rtl8192_tx_isr(struct urb *tx_urb)
2061 } 2061 }
2062#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE 2062#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
2063 else if ((skb_queue_len(&priv->ieee80211->skb_drv_aggQ[queue_index])!= 0)&&\ 2063 else if ((skb_queue_len(&priv->ieee80211->skb_drv_aggQ[queue_index])!= 0)&&\
2064 (!(priv->ieee80211->queue_stop))) { 2064 (!(priv->ieee80211->queue_stop))) {
2065 // Tx Driver Aggregation process 2065 // Tx Driver Aggregation process
2066 /* The driver will aggregation the packets according to the following stets 2066 /* The driver will aggregation the packets according to the following stets
2067 * 1. check whether there's tx irq available, for it's a completion return 2067 * 1. check whether there's tx irq available, for it's a completion return
@@ -2083,7 +2083,7 @@ static void rtl8192_tx_isr(struct urb *tx_urb)
2083 u8* pHeader = skb->data; 2083 u8* pHeader = skb->data;
2084 2084
2085 if(IsMgntQosData(pHeader) || 2085 if(IsMgntQosData(pHeader) ||
2086 IsMgntQData_Ack(pHeader) || 2086 IsMgntQData_Ack(pHeader) ||
2087 IsMgntQData_Poll(pHeader) || 2087 IsMgntQData_Poll(pHeader) ||
2088 IsMgntQData_Poll_Ack(pHeader) 2088 IsMgntQData_Poll_Ack(pHeader)
2089 ) 2089 )
@@ -2253,7 +2253,7 @@ void rtl8192_net_update(struct net_device *dev)
2253 write_nic_byte(dev, BCN_ERR_THRESH, 100); 2253 write_nic_byte(dev, BCN_ERR_THRESH, 100);
2254 BcnTimeCfg |= (BcnCW<<BCN_TCFG_CW_SHIFT); 2254 BcnTimeCfg |= (BcnCW<<BCN_TCFG_CW_SHIFT);
2255 // TODO: BcnIFS may required to be changed on ASIC 2255 // TODO: BcnIFS may required to be changed on ASIC
2256 BcnTimeCfg |= BcnIFS<<BCN_TCFG_IFS; 2256 BcnTimeCfg |= BcnIFS<<BCN_TCFG_IFS;
2257 2257
2258 write_nic_word(dev, BCN_TCFG, BcnTimeCfg); 2258 write_nic_word(dev, BCN_TCFG, BcnTimeCfg);
2259 } 2259 }
@@ -2641,7 +2641,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
2641// RT_DEBUG_DATA(COMP_SEND, tcb_desc, sizeof(cb_desc)); 2641// RT_DEBUG_DATA(COMP_SEND, tcb_desc, sizeof(cb_desc));
2642#if 0 2642#if 0
2643 /* Added by Annie for filling Len_Adjust field. 2005-12-14. */ 2643 /* Added by Annie for filling Len_Adjust field. 2005-12-14. */
2644 RT_ENC_ALG EncAlg = NO_Encryption; 2644 RT_ENC_ALG EncAlg = NO_Encryption;
2645#endif 2645#endif
2646// printk("=============> %s\n", __FUNCTION__); 2646// printk("=============> %s\n", __FUNCTION__);
2647 pend = atomic_read(&priv->tx_pending[tcb_desc->queue_index]); 2647 pend = atomic_read(&priv->tx_pending[tcb_desc->queue_index]);
@@ -2735,9 +2735,9 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
2735 /* Fill Tx descriptor */ 2735 /* Fill Tx descriptor */
2736 memset(tx_desc, 0, sizeof(tx_desc_819x_usb)); 2736 memset(tx_desc, 0, sizeof(tx_desc_819x_usb));
2737 /* DWORD 0 */ 2737 /* DWORD 0 */
2738 tx_desc->LINIP = 0; 2738 tx_desc->LINIP = 0;
2739 tx_desc->CmdInit = 1; 2739 tx_desc->CmdInit = 1;
2740 tx_desc->Offset = sizeof(tx_fwinfo_819x_usb) + 8; 2740 tx_desc->Offset = sizeof(tx_fwinfo_819x_usb) + 8;
2741 2741
2742#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE 2742#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
2743 if (tcb_desc->drv_agg_enable) { 2743 if (tcb_desc->drv_agg_enable) {
@@ -2828,16 +2828,16 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff* skb)
2828 tx_desc->DISFB = tcb_desc->bTxDisableRateFallBack; 2828 tx_desc->DISFB = tcb_desc->bTxDisableRateFallBack;
2829 tx_desc->USERATE = tcb_desc->bTxUseDriverAssingedRate; 2829 tx_desc->USERATE = tcb_desc->bTxUseDriverAssingedRate;
2830 2830
2831 /* Fill fields that are required to be initialized in all of the descriptors */ 2831 /* Fill fields that are required to be initialized in all of the descriptors */
2832 //DWORD 0 2832 //DWORD 0
2833#if 0 2833#if 0
2834 tx_desc->FirstSeg = (tcb_desc->bFirstSeg)? 1:0; 2834 tx_desc->FirstSeg = (tcb_desc->bFirstSeg)? 1:0;
2835 tx_desc->LastSeg = (tcb_desc->bLastSeg)?1:0; 2835 tx_desc->LastSeg = (tcb_desc->bLastSeg)?1:0;
2836#else 2836#else
2837 tx_desc->FirstSeg = 1; 2837 tx_desc->FirstSeg = 1;
2838 tx_desc->LastSeg = 1; 2838 tx_desc->LastSeg = 1;
2839#endif 2839#endif
2840 tx_desc->OWN = 1; 2840 tx_desc->OWN = 1;
2841 2841
2842#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE 2842#ifdef USB_TX_DRIVER_AGGREGATION_ENABLE
2843 if (tcb_desc->drv_agg_enable) { 2843 if (tcb_desc->drv_agg_enable) {
@@ -2959,29 +2959,29 @@ short rtl8192_usb_initendpoints(struct net_device *dev)
2959} 2959}
2960#endif 2960#endif
2961 2961
2962 memset(priv->rx_urb, 0, sizeof(struct urb*) * MAX_RX_URB); 2962 memset(priv->rx_urb, 0, sizeof(struct urb*) * MAX_RX_URB);
2963 priv->pp_rxskb = (struct sk_buff **)kmalloc(sizeof(struct sk_buff *) * MAX_RX_URB, GFP_KERNEL); 2963 priv->pp_rxskb = (struct sk_buff **)kmalloc(sizeof(struct sk_buff *) * MAX_RX_URB, GFP_KERNEL);
2964 if (priv->pp_rxskb == NULL) 2964 if (priv->pp_rxskb == NULL)
2965 goto destroy; 2965 goto destroy;
2966 2966
2967 memset(priv->pp_rxskb, 0, sizeof(struct sk_buff*) * MAX_RX_URB); 2967 memset(priv->pp_rxskb, 0, sizeof(struct sk_buff*) * MAX_RX_URB);
2968 2968
2969 goto _middle; 2969 goto _middle;
2970 2970
2971 2971
2972destroy: 2972destroy:
2973 if (priv->pp_rxskb) { 2973 if (priv->pp_rxskb) {
2974 kfree(priv->pp_rxskb); 2974 kfree(priv->pp_rxskb);
2975 } 2975 }
2976 if (priv->rx_urb) { 2976 if (priv->rx_urb) {
2977 kfree(priv->rx_urb); 2977 kfree(priv->rx_urb);
2978 } 2978 }
2979 2979
2980 priv->pp_rxskb = NULL; 2980 priv->pp_rxskb = NULL;
2981 priv->rx_urb = NULL; 2981 priv->rx_urb = NULL;
2982 2982
2983 DMESGE("Endpoint Alloc Failure"); 2983 DMESGE("Endpoint Alloc Failure");
2984 return -ENOMEM; 2984 return -ENOMEM;
2985 2985
2986 2986
2987_middle: 2987_middle:
@@ -3008,9 +3008,9 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev)
3008 kfree(priv->oldaddr); 3008 kfree(priv->oldaddr);
3009 priv->oldaddr = NULL; 3009 priv->oldaddr = NULL;
3010 } 3010 }
3011 if (priv->pp_rxskb) { 3011 if (priv->pp_rxskb) {
3012 kfree(priv->pp_rxskb); 3012 kfree(priv->pp_rxskb);
3013 priv->pp_rxskb = 0; 3013 priv->pp_rxskb = 0;
3014 } 3014 }
3015} 3015}
3016#else 3016#else
@@ -3033,18 +3033,18 @@ void rtl8192_usb_deleteendpoints(struct net_device *dev)
3033 } 3033 }
3034#else 3034#else
3035 if(priv->rx_urb){ 3035 if(priv->rx_urb){
3036 kfree(priv->rx_urb); 3036 kfree(priv->rx_urb);
3037 priv->rx_urb = NULL; 3037 priv->rx_urb = NULL;
3038 } 3038 }
3039 if(priv->oldaddr){ 3039 if(priv->oldaddr){
3040 kfree(priv->oldaddr); 3040 kfree(priv->oldaddr);
3041 priv->oldaddr = NULL; 3041 priv->oldaddr = NULL;
3042 } 3042 }
3043 if (priv->pp_rxskb) { 3043 if (priv->pp_rxskb) {
3044 kfree(priv->pp_rxskb); 3044 kfree(priv->pp_rxskb);
3045 priv->pp_rxskb = 0; 3045 priv->pp_rxskb = 0;
3046 3046
3047 } 3047 }
3048 3048
3049#endif 3049#endif
3050} 3050}
@@ -3157,29 +3157,29 @@ int WDCAPARA_ADD[] = {EDCAPARA_BE,EDCAPARA_BK,EDCAPARA_VI,EDCAPARA_VO};
3157#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20) 3157#if LINUX_VERSION_CODE >=KERNEL_VERSION(2,6,20)
3158void rtl8192_qos_activate(struct work_struct * work) 3158void rtl8192_qos_activate(struct work_struct * work)
3159{ 3159{
3160 struct r8192_priv *priv = container_of(work, struct r8192_priv, qos_activate); 3160 struct r8192_priv *priv = container_of(work, struct r8192_priv, qos_activate);
3161 struct net_device *dev = priv->ieee80211->dev; 3161 struct net_device *dev = priv->ieee80211->dev;
3162#else 3162#else
3163void rtl8192_qos_activate(struct net_device *dev) 3163void rtl8192_qos_activate(struct net_device *dev)
3164{ 3164{
3165 struct r8192_priv *priv = ieee80211_priv(dev); 3165 struct r8192_priv *priv = ieee80211_priv(dev);
3166#endif 3166#endif
3167 struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters; 3167 struct ieee80211_qos_parameters *qos_parameters = &priv->ieee80211->current_network.qos_data.parameters;
3168 u8 mode = priv->ieee80211->current_network.mode; 3168 u8 mode = priv->ieee80211->current_network.mode;
3169 //u32 size = sizeof(struct ieee80211_qos_parameters); 3169 //u32 size = sizeof(struct ieee80211_qos_parameters);
3170 u8 u1bAIFS; 3170 u8 u1bAIFS;
3171 u32 u4bAcParam; 3171 u32 u4bAcParam;
3172 int i; 3172 int i;
3173 3173
3174 if (priv == NULL) 3174 if (priv == NULL)
3175 return; 3175 return;
3176 3176
3177#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) 3177#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16))
3178 down(&priv->mutex); 3178 down(&priv->mutex);
3179#else 3179#else
3180 mutex_lock(&priv->mutex); 3180 mutex_lock(&priv->mutex);
3181#endif 3181#endif
3182 if(priv->ieee80211->state != IEEE80211_LINKED) 3182 if(priv->ieee80211->state != IEEE80211_LINKED)
3183 goto success; 3183 goto success;
3184 RT_TRACE(COMP_QOS,"qos active process with associate response received\n"); 3184 RT_TRACE(COMP_QOS,"qos active process with associate response received\n");
3185 /* It better set slot time at first */ 3185 /* It better set slot time at first */
@@ -3213,10 +3213,10 @@ static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv,
3213 u32 size = sizeof(struct ieee80211_qos_parameters); 3213 u32 size = sizeof(struct ieee80211_qos_parameters);
3214 3214
3215 if(priv->ieee80211->state !=IEEE80211_LINKED) 3215 if(priv->ieee80211->state !=IEEE80211_LINKED)
3216 return ret; 3216 return ret;
3217 3217
3218 if ((priv->ieee80211->iw_mode != IW_MODE_INFRA)) 3218 if ((priv->ieee80211->iw_mode != IW_MODE_INFRA))
3219 return ret; 3219 return ret;
3220 3220
3221 if (network->flags & NETWORK_HAS_QOS_MASK) { 3221 if (network->flags & NETWORK_HAS_QOS_MASK) {
3222 if (active_network && 3222 if (active_network &&
@@ -3258,8 +3258,8 @@ static int rtl8192_qos_handle_probe_response(struct r8192_priv *priv,
3258 3258
3259/* handle manage frame frame beacon and probe response */ 3259/* handle manage frame frame beacon and probe response */
3260static int rtl8192_handle_beacon(struct net_device * dev, 3260static int rtl8192_handle_beacon(struct net_device * dev,
3261 struct ieee80211_beacon * beacon, 3261 struct ieee80211_beacon * beacon,
3262 struct ieee80211_network * network) 3262 struct ieee80211_network * network)
3263{ 3263{
3264 struct r8192_priv *priv = ieee80211_priv(dev); 3264 struct r8192_priv *priv = ieee80211_priv(dev);
3265 3265
@@ -3284,23 +3284,23 @@ static int rtl8192_handle_beacon(struct net_device * dev,
3284* setting 3284* setting
3285*/ 3285*/
3286static int rtl8192_qos_association_resp(struct r8192_priv *priv, 3286static int rtl8192_qos_association_resp(struct r8192_priv *priv,
3287 struct ieee80211_network *network) 3287 struct ieee80211_network *network)
3288{ 3288{
3289 int ret = 0; 3289 int ret = 0;
3290 unsigned long flags; 3290 unsigned long flags;
3291 u32 size = sizeof(struct ieee80211_qos_parameters); 3291 u32 size = sizeof(struct ieee80211_qos_parameters);
3292 int set_qos_param = 0; 3292 int set_qos_param = 0;
3293 3293
3294 if ((priv == NULL) || (network == NULL)) 3294 if ((priv == NULL) || (network == NULL))
3295 return ret; 3295 return ret;
3296 3296
3297 if(priv->ieee80211->state !=IEEE80211_LINKED) 3297 if(priv->ieee80211->state !=IEEE80211_LINKED)
3298 return ret; 3298 return ret;
3299 3299
3300 if ((priv->ieee80211->iw_mode != IW_MODE_INFRA)) 3300 if ((priv->ieee80211->iw_mode != IW_MODE_INFRA))
3301 return ret; 3301 return ret;
3302 3302
3303 spin_lock_irqsave(&priv->ieee80211->lock, flags); 3303 spin_lock_irqsave(&priv->ieee80211->lock, flags);
3304 if(network->flags & NETWORK_HAS_QOS_PARAMETERS) { 3304 if(network->flags & NETWORK_HAS_QOS_PARAMETERS) {
3305 memcpy(&priv->ieee80211->current_network.qos_data.parameters,\ 3305 memcpy(&priv->ieee80211->current_network.qos_data.parameters,\
3306 &network->qos_data.parameters,\ 3306 &network->qos_data.parameters,\
@@ -3311,22 +3311,22 @@ static int rtl8192_qos_association_resp(struct r8192_priv *priv,
3311 network->qos_data.param_count)) 3311 network->qos_data.param_count))
3312#endif 3312#endif
3313 { 3313 {
3314 set_qos_param = 1; 3314 set_qos_param = 1;
3315 /* update qos parameter for current network */ 3315 /* update qos parameter for current network */
3316 priv->ieee80211->current_network.qos_data.old_param_count = \ 3316 priv->ieee80211->current_network.qos_data.old_param_count = \
3317 priv->ieee80211->current_network.qos_data.param_count; 3317 priv->ieee80211->current_network.qos_data.param_count;
3318 priv->ieee80211->current_network.qos_data.param_count = \ 3318 priv->ieee80211->current_network.qos_data.param_count = \
3319 network->qos_data.param_count; 3319 network->qos_data.param_count;
3320 } 3320 }
3321 } else { 3321 } else {
3322 memcpy(&priv->ieee80211->current_network.qos_data.parameters,\ 3322 memcpy(&priv->ieee80211->current_network.qos_data.parameters,\
3323 &def_qos_parameters, size); 3323 &def_qos_parameters, size);
3324 priv->ieee80211->current_network.qos_data.active = 0; 3324 priv->ieee80211->current_network.qos_data.active = 0;
3325 priv->ieee80211->current_network.qos_data.supported = 0; 3325 priv->ieee80211->current_network.qos_data.supported = 0;
3326 set_qos_param = 1; 3326 set_qos_param = 1;
3327 } 3327 }
3328 3328
3329 spin_unlock_irqrestore(&priv->ieee80211->lock, flags); 3329 spin_unlock_irqrestore(&priv->ieee80211->lock, flags);
3330 3330
3331 RT_TRACE(COMP_QOS, "%s: network->flags = %d,%d\n",__FUNCTION__,network->flags ,priv->ieee80211->current_network.qos_data.active); 3331 RT_TRACE(COMP_QOS, "%s: network->flags = %d,%d\n",__FUNCTION__,network->flags ,priv->ieee80211->current_network.qos_data.active);
3332 if (set_qos_param == 1) 3332 if (set_qos_param == 1)
@@ -3337,17 +3337,17 @@ static int rtl8192_qos_association_resp(struct r8192_priv *priv,
3337#endif 3337#endif
3338 3338
3339 3339
3340 return ret; 3340 return ret;
3341} 3341}
3342 3342
3343 3343
3344static int rtl8192_handle_assoc_response(struct net_device *dev, 3344static int rtl8192_handle_assoc_response(struct net_device *dev,
3345 struct ieee80211_assoc_response_frame *resp, 3345 struct ieee80211_assoc_response_frame *resp,
3346 struct ieee80211_network *network) 3346 struct ieee80211_network *network)
3347{ 3347{
3348 struct r8192_priv *priv = ieee80211_priv(dev); 3348 struct r8192_priv *priv = ieee80211_priv(dev);
3349 rtl8192_qos_association_resp(priv, network); 3349 rtl8192_qos_association_resp(priv, network);
3350 return 0; 3350 return 0;
3351} 3351}
3352 3352
3353 3353
@@ -3408,13 +3408,13 @@ bool GetNmodeSupportBySecCfg8192(struct net_device*dev)
3408 struct r8192_priv* priv = ieee80211_priv(dev); 3408 struct r8192_priv* priv = ieee80211_priv(dev);
3409 struct ieee80211_device* ieee = priv->ieee80211; 3409 struct ieee80211_device* ieee = priv->ieee80211;
3410 struct ieee80211_network * network = &ieee->current_network; 3410 struct ieee80211_network * network = &ieee->current_network;
3411 int wpa_ie_len= ieee->wpa_ie_len; 3411 int wpa_ie_len= ieee->wpa_ie_len;
3412 struct ieee80211_crypt_data* crypt; 3412 struct ieee80211_crypt_data* crypt;
3413 int encrypt; 3413 int encrypt;
3414 3414
3415 crypt = ieee->crypt[ieee->tx_keyidx]; 3415 crypt = ieee->crypt[ieee->tx_keyidx];
3416 //we use connecting AP's capability instead of only security config on our driver to distinguish whether it should use N mode or G mode 3416 //we use connecting AP's capability instead of only security config on our driver to distinguish whether it should use N mode or G mode
3417 encrypt = (network->capability & WLAN_CAPABILITY_PRIVACY) || (ieee->host_encrypt && crypt && crypt->ops && (0 == strcmp(crypt->ops->name,"WEP"))); 3417 encrypt = (network->capability & WLAN_CAPABILITY_PRIVACY) || (ieee->host_encrypt && crypt && crypt->ops && (0 == strcmp(crypt->ops->name,"WEP")));
3418 3418
3419 /* simply judge */ 3419 /* simply judge */
3420 if(encrypt && (wpa_ie_len == 0)) { 3420 if(encrypt && (wpa_ie_len == 0)) {
@@ -3433,16 +3433,16 @@ bool GetNmodeSupportBySecCfg8192(struct net_device*dev)
3433 } 3433 }
3434 3434
3435#if 0 3435#if 0
3436 //In here we discuss with SD4 David. He think we still can send TKIP in broadcast group key in MCS rate. 3436 //In here we discuss with SD4 David. He think we still can send TKIP in broadcast group key in MCS rate.
3437 //We can't force in G mode if Pairwie key is AES and group key is TKIP 3437 //We can't force in G mode if Pairwie key is AES and group key is TKIP
3438 if((pSecInfo->GroupEncAlgorithm == WEP104_Encryption) || (pSecInfo->GroupEncAlgorithm == WEP40_Encryption) || 3438 if((pSecInfo->GroupEncAlgorithm == WEP104_Encryption) || (pSecInfo->GroupEncAlgorithm == WEP40_Encryption) ||
3439 (pSecInfo->PairwiseEncAlgorithm == WEP104_Encryption) || 3439 (pSecInfo->PairwiseEncAlgorithm == WEP104_Encryption) ||
3440 (pSecInfo->PairwiseEncAlgorithm == WEP40_Encryption) || (pSecInfo->PairwiseEncAlgorithm == TKIP_Encryption)) 3440 (pSecInfo->PairwiseEncAlgorithm == WEP40_Encryption) || (pSecInfo->PairwiseEncAlgorithm == TKIP_Encryption))
3441 { 3441 {
3442 return false; 3442 return false;
3443 } 3443 }
3444 else 3444 else
3445 return true; 3445 return true;
3446#endif 3446#endif
3447 return true; 3447 return true;
3448#endif 3448#endif
@@ -3608,10 +3608,10 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
3608 priv->card_type = USB; 3608 priv->card_type = USB;
3609#ifdef TO_DO_LIST 3609#ifdef TO_DO_LIST
3610 if(Adapter->bInHctTest) 3610 if(Adapter->bInHctTest)
3611 { 3611 {
3612 pHalData->ShortRetryLimit = 7; 3612 pHalData->ShortRetryLimit = 7;
3613 pHalData->LongRetryLimit = 7; 3613 pHalData->LongRetryLimit = 7;
3614 } 3614 }
3615#endif 3615#endif
3616 { 3616 {
3617 priv->ShortRetryLimit = 0x30; 3617 priv->ShortRetryLimit = 0x30;
@@ -3622,7 +3622,7 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
3622 priv->TransmitConfig = 3622 priv->TransmitConfig =
3623 // TCR_DurProcMode | //for RTL8185B, duration setting by HW 3623 // TCR_DurProcMode | //for RTL8185B, duration setting by HW
3624 //? TCR_DISReqQsize | 3624 //? TCR_DISReqQsize |
3625 (TCR_MXDMA_2048<<TCR_MXDMA_OFFSET)| // Max DMA Burst Size per Tx DMA Burst, 7: reservied. 3625 (TCR_MXDMA_2048<<TCR_MXDMA_OFFSET)| // Max DMA Burst Size per Tx DMA Burst, 7: reservied.
3626 (priv->ShortRetryLimit<<TCR_SRL_OFFSET)| // Short retry limit 3626 (priv->ShortRetryLimit<<TCR_SRL_OFFSET)| // Short retry limit
3627 (priv->LongRetryLimit<<TCR_LRL_OFFSET) | // Long retry limit 3627 (priv->LongRetryLimit<<TCR_LRL_OFFSET) | // Long retry limit
3628 (false ? TCR_SAT: 0); // FALSE: HW provies PLCP length and LENGEXT, TURE: SW proiveds them 3628 (false ? TCR_SAT: 0); // FALSE: HW provies PLCP length and LENGEXT, TURE: SW proiveds them
@@ -3655,7 +3655,7 @@ static void rtl8192_init_priv_variable(struct net_device* dev)
3655 memset(priv->pFirmware, 0, sizeof(rt_firmware)); 3655 memset(priv->pFirmware, 0, sizeof(rt_firmware));
3656 3656
3657 /* rx related queue */ 3657 /* rx related queue */
3658 skb_queue_head_init(&priv->rx_queue); 3658 skb_queue_head_init(&priv->rx_queue);
3659 skb_queue_head_init(&priv->skb_queue); 3659 skb_queue_head_init(&priv->skb_queue);
3660 3660
3661 /* Tx related queue */ 3661 /* Tx related queue */
@@ -3984,7 +3984,7 @@ static void rtl8192_read_eeprom_info(struct net_device* dev)
3984 priv->LedStrategy = SW_LED_MODE2; 3984 priv->LedStrategy = SW_LED_MODE2;
3985 break; 3985 break;
3986 3986
3987 case RT_CID_DLINK: 3987 case RT_CID_DLINK:
3988 priv->LedStrategy = SW_LED_MODE4; 3988 priv->LedStrategy = SW_LED_MODE4;
3989 break; 3989 break;
3990 3990
@@ -4655,7 +4655,7 @@ RxCheckStuck(struct net_device *dev)
4655 //PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK); 4655 //PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK);
4656 4656
4657 if(priv->IrpPendingCount > 1) 4657 if(priv->IrpPendingCount > 1)
4658 bRxCheck = TRUE; 4658 bRxCheck = TRUE;
4659 //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); 4659 //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK);
4660 4660
4661// RT_TRACE(COMP_RESET,"bRxCheck is %d \n",bRxCheck); 4661// RT_TRACE(COMP_RESET,"bRxCheck is %d \n",bRxCheck);
@@ -5022,13 +5022,13 @@ void CAM_read_entry(
5022 } 5022 }
5023 } 5023 }
5024#endif 5024#endif
5025 write_nic_dword(dev, RWCAM, target_command); 5025 write_nic_dword(dev, RWCAM, target_command);
5026 RT_TRACE(COMP_SEC,"CAM_read_entry(): WRITE A0: %x \n",target_command); 5026 RT_TRACE(COMP_SEC,"CAM_read_entry(): WRITE A0: %x \n",target_command);
5027 // printk("CAM_read_entry(): WRITE A0: %lx \n",target_command); 5027 // printk("CAM_read_entry(): WRITE A0: %lx \n",target_command);
5028 target_content = read_nic_dword(dev, RCAMO); 5028 target_content = read_nic_dword(dev, RCAMO);
5029 RT_TRACE(COMP_SEC, "CAM_read_entry(): WRITE A8: %x \n",target_content); 5029 RT_TRACE(COMP_SEC, "CAM_read_entry(): WRITE A8: %x \n",target_content);
5030 // printk("CAM_read_entry(): WRITE A8: %lx \n",target_content); 5030 // printk("CAM_read_entry(): WRITE A8: %lx \n",target_content);
5031 } 5031 }
5032 printk("\n"); 5032 printk("\n");
5033} 5033}
5034 5034
@@ -5067,7 +5067,7 @@ extern void rtl819x_watchdog_wqcallback(struct net_device *dev)
5067#endif 5067#endif
5068 struct ieee80211_device* ieee = priv->ieee80211; 5068 struct ieee80211_device* ieee = priv->ieee80211;
5069 RESET_TYPE ResetType = RESET_TYPE_NORESET; 5069 RESET_TYPE ResetType = RESET_TYPE_NORESET;
5070 static u8 check_reset_cnt=0; 5070 static u8 check_reset_cnt=0;
5071 bool bBusyTraffic = false; 5071 bool bBusyTraffic = false;
5072 5072
5073 if(!priv->up) 5073 if(!priv->up)
@@ -5247,18 +5247,18 @@ int rtl8192_down(struct net_device *dev)
5247 //rtl8192_irq_disable(dev); 5247 //rtl8192_irq_disable(dev);
5248 5248
5249 /* Tx related queue release */ 5249 /* Tx related queue release */
5250 for(i = 0; i < MAX_QUEUE_SIZE; i++) { 5250 for(i = 0; i < MAX_QUEUE_SIZE; i++) {
5251 skb_queue_purge(&priv->ieee80211->skb_waitQ [i]); 5251 skb_queue_purge(&priv->ieee80211->skb_waitQ [i]);
5252 } 5252 }
5253 for(i = 0; i < MAX_QUEUE_SIZE; i++) { 5253 for(i = 0; i < MAX_QUEUE_SIZE; i++) {
5254 skb_queue_purge(&priv->ieee80211->skb_aggQ [i]); 5254 skb_queue_purge(&priv->ieee80211->skb_aggQ [i]);
5255 } 5255 }
5256 5256
5257 for(i = 0; i < MAX_QUEUE_SIZE; i++) { 5257 for(i = 0; i < MAX_QUEUE_SIZE; i++) {
5258 skb_queue_purge(&priv->ieee80211->skb_drv_aggQ [i]); 5258 skb_queue_purge(&priv->ieee80211->skb_drv_aggQ [i]);
5259 } 5259 }
5260 5260
5261 //as cancel_delayed_work will del work->timer, so if work is not definedas struct delayed_work, it will corrupt 5261 //as cancel_delayed_work will del work->timer, so if work is not definedas struct delayed_work, it will corrupt
5262// flush_scheduled_work(); 5262// flush_scheduled_work();
5263 rtl8192_cancel_deferred_work(priv); 5263 rtl8192_cancel_deferred_work(priv);
5264 deinit_hal_dm(dev); 5264 deinit_hal_dm(dev);
@@ -5301,13 +5301,13 @@ void rtl8192_restart(struct net_device *dev)
5301#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) 5301#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))
5302void rtl8192_restart(struct work_struct *work) 5302void rtl8192_restart(struct work_struct *work)
5303{ 5303{
5304 struct r8192_priv *priv = container_of(work, struct r8192_priv, reset_wq); 5304 struct r8192_priv *priv = container_of(work, struct r8192_priv, reset_wq);
5305 struct net_device *dev = priv->ieee80211->dev; 5305 struct net_device *dev = priv->ieee80211->dev;
5306#else 5306#else
5307void rtl8192_restart(struct net_device *dev) 5307void rtl8192_restart(struct net_device *dev)
5308{ 5308{
5309 5309
5310 struct r8192_priv *priv = ieee80211_priv(dev); 5310 struct r8192_priv *priv = ieee80211_priv(dev);
5311#endif 5311#endif
5312 5312
5313 down(&priv->wx_sem); 5313 down(&priv->wx_sem);
@@ -5373,19 +5373,19 @@ int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
5373 5373
5374 5374
5375 if (p->length < sizeof(struct ieee_param) || !p->pointer){ 5375 if (p->length < sizeof(struct ieee_param) || !p->pointer){
5376 ret = -EINVAL; 5376 ret = -EINVAL;
5377 goto out; 5377 goto out;
5378 } 5378 }
5379 5379
5380 ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL); 5380 ipw = (struct ieee_param *)kmalloc(p->length, GFP_KERNEL);
5381 if (ipw == NULL){ 5381 if (ipw == NULL){
5382 ret = -ENOMEM; 5382 ret = -ENOMEM;
5383 goto out; 5383 goto out;
5384 } 5384 }
5385 if (copy_from_user(ipw, p->pointer, p->length)) { 5385 if (copy_from_user(ipw, p->pointer, p->length)) {
5386 kfree(ipw); 5386 kfree(ipw);
5387 ret = -EFAULT; 5387 ret = -EFAULT;
5388 goto out; 5388 goto out;
5389 } 5389 }
5390 5390
5391 switch (cmd) { 5391 switch (cmd) {
@@ -5466,7 +5466,7 @@ int rtl8192_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
5466 break; 5466 break;
5467 } 5467 }
5468 kfree(ipw); 5468 kfree(ipw);
5469 ipw = NULL; 5469 ipw = NULL;
5470out: 5470out:
5471 up(&priv->wx_sem); 5471 up(&priv->wx_sem);
5472 return ret; 5472 return ret;
@@ -5660,8 +5660,8 @@ void rtl8192_process_phyinfo(struct r8192_priv * priv,u8* buffer, struct ieee802
5660 { 5660 {
5661 for (rfpath = RF90_PATH_A; rfpath < priv->NumTotalRFPath; rfpath++) 5661 for (rfpath = RF90_PATH_A; rfpath < priv->NumTotalRFPath; rfpath++)
5662 { 5662 {
5663 if (!rtl8192_phy_CheckIsLegalRFPath(priv->ieee80211->dev, rfpath)) 5663 if (!rtl8192_phy_CheckIsLegalRFPath(priv->ieee80211->dev, rfpath))
5664 continue; 5664 continue;
5665 5665
5666 //Fixed by Jacken 2008-03-20 5666 //Fixed by Jacken 2008-03-20
5667 if(priv->stats.rx_rssi_percentage[rfpath] == 0) 5667 if(priv->stats.rx_rssi_percentage[rfpath] == 0)
@@ -6117,7 +6117,7 @@ static void rtl8192_query_rxphystatus(
6117 // (3)EVM of HT rate 6117 // (3)EVM of HT rate
6118 // 6118 //
6119 if(pdrvinfo->RxHT && pdrvinfo->RxRate>=DESC90_RATEMCS8 && 6119 if(pdrvinfo->RxHT && pdrvinfo->RxRate>=DESC90_RATEMCS8 &&
6120 pdrvinfo->RxRate<=DESC90_RATEMCS15) 6120 pdrvinfo->RxRate<=DESC90_RATEMCS15)
6121 max_spatial_stream = 2; //both spatial stream make sense 6121 max_spatial_stream = 2; //both spatial stream make sense
6122 else 6122 else
6123 max_spatial_stream = 1; //only spatial stream 1 makes sense 6123 max_spatial_stream = 1; //only spatial stream 1 makes sense
@@ -6184,7 +6184,7 @@ rtl8192_record_rxdesc_forlateruse(
6184 6184
6185void TranslateRxSignalStuff819xUsb(struct sk_buff *skb, 6185void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
6186 struct ieee80211_rx_stats * pstats, 6186 struct ieee80211_rx_stats * pstats,
6187 rx_drvinfo_819x_usb *pdrvinfo) 6187 rx_drvinfo_819x_usb *pdrvinfo)
6188{ 6188{
6189 // TODO: We must only check packet for current MAC address. Not finish 6189 // TODO: We must only check packet for current MAC address. Not finish
6190 rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb; 6190 rtl8192_rx_info *info = (struct rtl8192_rx_info *)skb->cb;
@@ -6212,8 +6212,8 @@ void TranslateRxSignalStuff819xUsb(struct sk_buff *skb,
6212 6212
6213 /* Check if the received packet is acceptabe. */ 6213 /* Check if the received packet is acceptabe. */
6214 bpacket_match_bssid = ((IEEE80211_FTYPE_CTL != type) && 6214 bpacket_match_bssid = ((IEEE80211_FTYPE_CTL != type) &&
6215 (eqMacAddr(priv->ieee80211->current_network.bssid, (fc & IEEE80211_FCTL_TODS)? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS )? hdr->addr2 : hdr->addr3)) 6215 (eqMacAddr(priv->ieee80211->current_network.bssid, (fc & IEEE80211_FCTL_TODS)? hdr->addr1 : (fc & IEEE80211_FCTL_FROMDS )? hdr->addr2 : hdr->addr3))
6216 && (!pstats->bHwError) && (!pstats->bCRC)&& (!pstats->bICV)); 6216 && (!pstats->bHwError) && (!pstats->bCRC)&& (!pstats->bICV));
6217 bpacket_toself = bpacket_match_bssid & (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr)); 6217 bpacket_toself = bpacket_match_bssid & (eqMacAddr(praddr, priv->ieee80211->dev->dev_addr));
6218 6218
6219#if 1//cosa 6219#if 1//cosa
@@ -6271,20 +6271,20 @@ UpdateReceivedRateHistogramStatistics8190(
6271 ) 6271 )
6272{ 6272{
6273 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 6273 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
6274 u32 rcvType=1; //0: Total, 1:OK, 2:CRC, 3:ICV 6274 u32 rcvType=1; //0: Total, 1:OK, 2:CRC, 3:ICV
6275 u32 rateIndex; 6275 u32 rateIndex;
6276 u32 preamble_guardinterval; //1: short preamble/GI, 0: long preamble/GI 6276 u32 preamble_guardinterval; //1: short preamble/GI, 0: long preamble/GI
6277 6277
6278 6278
6279 if(stats->bCRC) 6279 if(stats->bCRC)
6280 rcvType = 2; 6280 rcvType = 2;
6281 else if(stats->bICV) 6281 else if(stats->bICV)
6282 rcvType = 3; 6282 rcvType = 3;
6283 6283
6284 if(stats->bShortPreamble) 6284 if(stats->bShortPreamble)
6285 preamble_guardinterval = 1;// short 6285 preamble_guardinterval = 1;// short
6286 else 6286 else
6287 preamble_guardinterval = 0;// long 6287 preamble_guardinterval = 0;// long
6288 6288
6289 switch(stats->rate) 6289 switch(stats->rate)
6290 { 6290 {
@@ -6784,12 +6784,12 @@ void rtl8192_rx_cmd(struct sk_buff *skb)
6784 6784
6785void rtl8192_irq_rx_tasklet(struct r8192_priv *priv) 6785void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
6786{ 6786{
6787 struct sk_buff *skb; 6787 struct sk_buff *skb;
6788 struct rtl8192_rx_info *info; 6788 struct rtl8192_rx_info *info;
6789 6789
6790 while (NULL != (skb = skb_dequeue(&priv->skb_queue))) { 6790 while (NULL != (skb = skb_dequeue(&priv->skb_queue))) {
6791 info = (struct rtl8192_rx_info *)skb->cb; 6791 info = (struct rtl8192_rx_info *)skb->cb;
6792 switch (info->out_pipe) { 6792 switch (info->out_pipe) {
6793 /* Nomal packet pipe */ 6793 /* Nomal packet pipe */
6794 case 3: 6794 case 3:
6795 //RT_TRACE(COMP_RECV, "normal in-pipe index(%d)\n",info->out_pipe); 6795 //RT_TRACE(COMP_RECV, "normal in-pipe index(%d)\n",info->out_pipe);
@@ -6812,7 +6812,7 @@ void rtl8192_irq_rx_tasklet(struct r8192_priv *priv)
6812 break; 6812 break;
6813 6813
6814 } 6814 }
6815 } 6815 }
6816} 6816}
6817 6817
6818static const struct net_device_ops rtl8192_netdev_ops = { 6818static const struct net_device_ops rtl8192_netdev_ops = {
@@ -6838,8 +6838,8 @@ static int __devinit rtl8192_usb_probe(struct usb_interface *intf,
6838 const struct usb_device_id *id) 6838 const struct usb_device_id *id)
6839#else 6839#else
6840static void * __devinit rtl8192_usb_probe(struct usb_device *udev, 6840static void * __devinit rtl8192_usb_probe(struct usb_device *udev,
6841 unsigned int ifnum, 6841 unsigned int ifnum,
6842 const struct usb_device_id *id) 6842 const struct usb_device_id *id)
6843#endif 6843#endif
6844{ 6844{
6845// unsigned long ioaddr = 0; 6845// unsigned long ioaddr = 0;
@@ -6848,7 +6848,7 @@ static void * __devinit rtl8192_usb_probe(struct usb_device *udev,
6848#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 6848#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
6849 struct usb_device *udev = interface_to_usbdev(intf); 6849 struct usb_device *udev = interface_to_usbdev(intf);
6850#endif 6850#endif
6851 RT_TRACE(COMP_INIT, "Oops: i'm coming\n"); 6851 RT_TRACE(COMP_INIT, "Oops: i'm coming\n");
6852 6852
6853 dev = alloc_ieee80211(sizeof(struct r8192_priv)); 6853 dev = alloc_ieee80211(sizeof(struct r8192_priv));
6854 6854
@@ -6868,24 +6868,24 @@ static void * __devinit rtl8192_usb_probe(struct usb_device *udev,
6868#endif 6868#endif
6869 priv->udev=udev; 6869 priv->udev=udev;
6870 6870
6871 dev->netdev_ops = &rtl8192_netdev_ops; 6871 dev->netdev_ops = &rtl8192_netdev_ops;
6872 6872
6873 //DMESG("Oops: i'm coming\n"); 6873 //DMESG("Oops: i'm coming\n");
6874#if WIRELESS_EXT >= 12 6874#if WIRELESS_EXT >= 12
6875#if WIRELESS_EXT < 17 6875#if WIRELESS_EXT < 17
6876 dev->get_wireless_stats = r8192_get_wireless_stats; 6876 dev->get_wireless_stats = r8192_get_wireless_stats;
6877#endif 6877#endif
6878 dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def; 6878 dev->wireless_handlers = (struct iw_handler_def *) &r8192_wx_handlers_def;
6879#endif 6879#endif
6880 dev->type=ARPHRD_ETHER; 6880 dev->type=ARPHRD_ETHER;
6881 6881
6882 dev->watchdog_timeo = HZ*3; //modified by john, 0805 6882 dev->watchdog_timeo = HZ*3; //modified by john, 0805
6883 6883
6884 if (dev_alloc_name(dev, ifname) < 0){ 6884 if (dev_alloc_name(dev, ifname) < 0){
6885 RT_TRACE(COMP_INIT, "Oops: devname already taken! Trying wlan%%d...\n"); 6885 RT_TRACE(COMP_INIT, "Oops: devname already taken! Trying wlan%%d...\n");
6886 ifname = "wlan%d"; 6886 ifname = "wlan%d";
6887 dev_alloc_name(dev, ifname); 6887 dev_alloc_name(dev, ifname);
6888 } 6888 }
6889 6889
6890 RT_TRACE(COMP_INIT, "Driver probe completed1\n"); 6890 RT_TRACE(COMP_INIT, "Driver probe completed1\n");
6891#if 1 6891#if 1
@@ -6960,7 +6960,7 @@ static void __devexit rtl8192_usb_disconnect(struct usb_device *udev, void *ptr)
6960#endif 6960#endif
6961 6961
6962 struct r8192_priv *priv = ieee80211_priv(dev); 6962 struct r8192_priv *priv = ieee80211_priv(dev);
6963 if(dev){ 6963 if(dev){
6964 6964
6965 unregister_netdev(dev); 6965 unregister_netdev(dev);
6966 6966
@@ -7002,40 +7002,40 @@ extern void ieee80211_crypto_wep_exit(void);
7002 7002
7003static int __init rtl8192_usb_module_init(void) 7003static int __init rtl8192_usb_module_init(void)
7004{ 7004{
7005 int ret; 7005 int ret;
7006 7006
7007#ifdef CONFIG_IEEE80211_DEBUG 7007#ifdef CONFIG_IEEE80211_DEBUG
7008 ret = ieee80211_debug_init(); 7008 ret = ieee80211_debug_init();
7009 if (ret) { 7009 if (ret) {
7010 printk(KERN_ERR "ieee80211_debug_init() failed %d\n", ret); 7010 printk(KERN_ERR "ieee80211_debug_init() failed %d\n", ret);
7011 return ret; 7011 return ret;
7012 } 7012 }
7013#endif 7013#endif
7014 ret = ieee80211_crypto_init(); 7014 ret = ieee80211_crypto_init();
7015 if (ret) { 7015 if (ret) {
7016 printk(KERN_ERR "ieee80211_crypto_init() failed %d\n", ret); 7016 printk(KERN_ERR "ieee80211_crypto_init() failed %d\n", ret);
7017 return ret; 7017 return ret;
7018 } 7018 }
7019 7019
7020 ret = ieee80211_crypto_tkip_init(); 7020 ret = ieee80211_crypto_tkip_init();
7021 if (ret) { 7021 if (ret) {
7022 printk(KERN_ERR "ieee80211_crypto_tkip_init() failed %d\n", 7022 printk(KERN_ERR "ieee80211_crypto_tkip_init() failed %d\n",
7023 ret); 7023 ret);
7024 return ret; 7024 return ret;
7025 } 7025 }
7026 7026
7027 ret = ieee80211_crypto_ccmp_init(); 7027 ret = ieee80211_crypto_ccmp_init();
7028 if (ret) { 7028 if (ret) {
7029 printk(KERN_ERR "ieee80211_crypto_ccmp_init() failed %d\n", 7029 printk(KERN_ERR "ieee80211_crypto_ccmp_init() failed %d\n",
7030 ret); 7030 ret);
7031 return ret; 7031 return ret;
7032 } 7032 }
7033 7033
7034 ret = ieee80211_crypto_wep_init(); 7034 ret = ieee80211_crypto_wep_init();
7035 if (ret) { 7035 if (ret) {
7036 printk(KERN_ERR "ieee80211_crypto_wep_init() failed %d\n", ret); 7036 printk(KERN_ERR "ieee80211_crypto_wep_init() failed %d\n", ret);
7037 return ret; 7037 return ret;
7038 } 7038 }
7039 7039
7040 printk(KERN_INFO "\nLinux kernel driver for RTL8192 based WLAN cards\n"); 7040 printk(KERN_INFO "\nLinux kernel driver for RTL8192 based WLAN cards\n");
7041 printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan\n"); 7041 printk(KERN_INFO "Copyright (c) 2007-2008, Realsil Wlan\n");
@@ -7063,7 +7063,7 @@ void rtl8192_try_wake_queue(struct net_device *dev, int pri)
7063 7063
7064 spin_lock_irqsave(&priv->tx_lock,flags); 7064 spin_lock_irqsave(&priv->tx_lock,flags);
7065 enough_desc = check_nic_enough_desc(dev,pri); 7065 enough_desc = check_nic_enough_desc(dev,pri);
7066 spin_unlock_irqrestore(&priv->tx_lock,flags); 7066 spin_unlock_irqrestore(&priv->tx_lock,flags);
7067 7067
7068 if(enough_desc) 7068 if(enough_desc)
7069 ieee80211_wake_queue(priv->ieee80211); 7069 ieee80211_wake_queue(priv->ieee80211);
@@ -7071,7 +7071,7 @@ void rtl8192_try_wake_queue(struct net_device *dev, int pri)
7071 7071
7072void EnableHWSecurityConfig8192(struct net_device *dev) 7072void EnableHWSecurityConfig8192(struct net_device *dev)
7073{ 7073{
7074 u8 SECR_value = 0x0; 7074 u8 SECR_value = 0x0;
7075 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); 7075 struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev);
7076 struct ieee80211_device* ieee = priv->ieee80211; 7076 struct ieee80211_device* ieee = priv->ieee80211;
7077 SECR_value = SCR_TxEncEnable | SCR_RxDecEnable; 7077 SECR_value = SCR_TxEncEnable | SCR_RxDecEnable;
@@ -7087,7 +7087,7 @@ void EnableHWSecurityConfig8192(struct net_device *dev)
7087 SECR_value |= SCR_TxUseDK; 7087 SECR_value |= SCR_TxUseDK;
7088 } 7088 }
7089#endif 7089#endif
7090 //add HWSec active enable here. 7090 //add HWSec active enable here.
7091//default using hwsec. when peer AP is in N mode only and pairwise_key_type is none_aes(which HT_IOT_ACT_PURE_N_MODE indicates it), use software security. when peer AP is in b,g,n mode mixed and pairwise_key_type is none_aes, use g mode hw security. WB on 2008.7.4 7091//default using hwsec. when peer AP is in N mode only and pairwise_key_type is none_aes(which HT_IOT_ACT_PURE_N_MODE indicates it), use software security. when peer AP is in b,g,n mode mixed and pairwise_key_type is none_aes, use g mode hw security. WB on 2008.7.4
7092 7092
7093 ieee->hwsec_active = 1; 7093 ieee->hwsec_active = 1;
@@ -7100,8 +7100,8 @@ void EnableHWSecurityConfig8192(struct net_device *dev)
7100 RT_TRACE(COMP_SEC,"%s:, hwsec:%d, pairwise_key:%d, SECR_value:%x\n", __FUNCTION__, \ 7100 RT_TRACE(COMP_SEC,"%s:, hwsec:%d, pairwise_key:%d, SECR_value:%x\n", __FUNCTION__, \
7101 ieee->hwsec_active, ieee->pairwise_key_type, SECR_value); 7101 ieee->hwsec_active, ieee->pairwise_key_type, SECR_value);
7102 { 7102 {
7103 write_nic_byte(dev, SECR, SECR_value);//SECR_value | SCR_UseDK ); 7103 write_nic_byte(dev, SECR, SECR_value);//SECR_value | SCR_UseDK );
7104 } 7104 }
7105} 7105}
7106 7106
7107 7107
@@ -7143,10 +7143,10 @@ void setKey( struct net_device *dev,
7143 // printk("setkey cam =%8x\n", read_cam(dev, i+6*EntryNo)); 7143 // printk("setkey cam =%8x\n", read_cam(dev, i+6*EntryNo));
7144 } 7144 }
7145 else if(i==1){//MAC 7145 else if(i==1){//MAC
7146 TargetContent = (u32)(*(MacAddr+2)) | 7146 TargetContent = (u32)(*(MacAddr+2)) |
7147 (u32)(*(MacAddr+3)) << 8| 7147 (u32)(*(MacAddr+3)) << 8|
7148 (u32)(*(MacAddr+4)) << 16| 7148 (u32)(*(MacAddr+4)) << 16|
7149 (u32)(*(MacAddr+5)) << 24; 7149 (u32)(*(MacAddr+5)) << 24;
7150 write_nic_dword(dev, WCAMI, TargetContent); 7150 write_nic_dword(dev, WCAMI, TargetContent);
7151 write_nic_dword(dev, RWCAM, TargetCommand); 7151 write_nic_dword(dev, RWCAM, TargetCommand);
7152 } 7152 }
diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 07ea40fd971..9c2505a0015 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -282,7 +282,7 @@ void dm_CheckRxAggregation(struct net_device *dev) {
282 282
283extern void hal_dm_watchdog(struct net_device *dev) 283extern void hal_dm_watchdog(struct net_device *dev)
284{ 284{
285 //struct r8192_priv *priv = ieee80211_priv(dev); 285 //struct r8192_priv *priv = ieee80211_priv(dev);
286 286
287 //static u8 previous_bssid[6] ={0}; 287 //static u8 previous_bssid[6] ={0};
288 288
@@ -621,7 +621,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device * dev)
621 bool bHighpowerstate, viviflag = FALSE; 621 bool bHighpowerstate, viviflag = FALSE;
622 DCMD_TXCMD_T tx_cmd; 622 DCMD_TXCMD_T tx_cmd;
623 u8 powerlevelOFDM24G; 623 u8 powerlevelOFDM24G;
624 int i =0, j = 0, k = 0; 624 int i =0, j = 0, k = 0;
625 u8 RF_Type, tmp_report[5]={0, 0, 0, 0, 0}; 625 u8 RF_Type, tmp_report[5]={0, 0, 0, 0, 0};
626 u32 Value; 626 u32 Value;
627 u8 Pwr_Flag; 627 u8 Pwr_Flag;
@@ -1010,13 +1010,13 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev)
1010 struct r8192_priv *priv = ieee80211_priv(dev); 1010 struct r8192_priv *priv = ieee80211_priv(dev);
1011 1011
1012 //Initial the Tx BB index and mapping value 1012 //Initial the Tx BB index and mapping value
1013 priv->txbbgain_table[0].txbb_iq_amplifygain = 12; 1013 priv->txbbgain_table[0].txbb_iq_amplifygain = 12;
1014 priv->txbbgain_table[0].txbbgain_value=0x7f8001fe; 1014 priv->txbbgain_table[0].txbbgain_value=0x7f8001fe;
1015 priv->txbbgain_table[1].txbb_iq_amplifygain = 11; 1015 priv->txbbgain_table[1].txbb_iq_amplifygain = 11;
1016 priv->txbbgain_table[1].txbbgain_value=0x788001e2; 1016 priv->txbbgain_table[1].txbbgain_value=0x788001e2;
1017 priv->txbbgain_table[2].txbb_iq_amplifygain = 10; 1017 priv->txbbgain_table[2].txbb_iq_amplifygain = 10;
1018 priv->txbbgain_table[2].txbbgain_value=0x71c001c7; 1018 priv->txbbgain_table[2].txbbgain_value=0x71c001c7;
1019 priv->txbbgain_table[3].txbb_iq_amplifygain = 9; 1019 priv->txbbgain_table[3].txbb_iq_amplifygain = 9;
1020 priv->txbbgain_table[3].txbbgain_value=0x6b8001ae; 1020 priv->txbbgain_table[3].txbbgain_value=0x6b8001ae;
1021 priv->txbbgain_table[4].txbb_iq_amplifygain = 8; 1021 priv->txbbgain_table[4].txbb_iq_amplifygain = 8;
1022 priv->txbbgain_table[4].txbbgain_value=0x65400195; 1022 priv->txbbgain_table[4].txbbgain_value=0x65400195;
@@ -1046,7 +1046,7 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev)
1046 priv->txbbgain_table[16].txbbgain_value=0x32c000cb; 1046 priv->txbbgain_table[16].txbbgain_value=0x32c000cb;
1047 priv->txbbgain_table[17].txbb_iq_amplifygain = -5; 1047 priv->txbbgain_table[17].txbb_iq_amplifygain = -5;
1048 priv->txbbgain_table[17].txbbgain_value=0x300000c0; 1048 priv->txbbgain_table[17].txbbgain_value=0x300000c0;
1049 priv->txbbgain_table[18].txbb_iq_amplifygain = -6; 1049 priv->txbbgain_table[18].txbb_iq_amplifygain = -6;
1050 priv->txbbgain_table[18].txbbgain_value=0x2d4000b5; 1050 priv->txbbgain_table[18].txbbgain_value=0x2d4000b5;
1051 priv->txbbgain_table[19].txbb_iq_amplifygain = -7; 1051 priv->txbbgain_table[19].txbb_iq_amplifygain = -7;
1052 priv->txbbgain_table[19].txbbgain_value=0x2ac000ab; 1052 priv->txbbgain_table[19].txbbgain_value=0x2ac000ab;
@@ -1548,9 +1548,9 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
1548 return; 1548 return;
1549 else 1549 else
1550 { 1550 {
1551 if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0)) 1551 if((tx_power_track_counter % 30 == 0)&&(tx_power_track_counter != 0))
1552 { 1552 {
1553 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) 1553 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
1554 queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0); 1554 queue_delayed_work(priv->priv_wq,&priv->txpower_tracking_wq,0);
1555 #else 1555 #else
1556 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 1556 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
@@ -1559,7 +1559,7 @@ static void dm_CheckTXPowerTracking_TSSI(struct net_device *dev)
1559 queue_work(priv->priv_wq,&priv->txpower_tracking_wq); 1559 queue_work(priv->priv_wq,&priv->txpower_tracking_wq);
1560 #endif 1560 #endif
1561 #endif 1561 #endif
1562 } 1562 }
1563 tx_power_track_counter++; 1563 tx_power_track_counter++;
1564 } 1564 }
1565 1565
@@ -3065,7 +3065,7 @@ static void dm_check_rfctrl_gpio(struct net_device * dev)
3065 #else 3065 #else
3066 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) 3066 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
3067 schedule_task(&priv->gpio_change_rf_wq); 3067 schedule_task(&priv->gpio_change_rf_wq);
3068 #else 3068 #else
3069 queue_work(priv->priv_wq,&priv->gpio_change_rf_wq); 3069 queue_work(priv->priv_wq,&priv->gpio_change_rf_wq);
3070 #endif 3070 #endif
3071 #endif 3071 #endif
@@ -3602,7 +3602,7 @@ extern void dm_fsync_timer_callback(unsigned long data)
3602 { 3602 {
3603 rate_bitmap = 1 << rate_index; 3603 rate_bitmap = 1 << rate_index;
3604 if(priv->ieee80211->fsync_rate_bitmap & rate_bitmap) 3604 if(priv->ieee80211->fsync_rate_bitmap & rate_bitmap)
3605 rate_count+= priv->stats.received_rate_histogram[1][rate_index]; 3605 rate_count+= priv->stats.received_rate_histogram[1][rate_index];
3606 } 3606 }
3607 3607
3608 if(rate_count < priv->rate_record) 3608 if(rate_count < priv->rate_record)
@@ -4036,7 +4036,7 @@ extern void dm_shadow_init(struct net_device *dev)
4036 * Function: DM_DynamicTxPower() 4036 * Function: DM_DynamicTxPower()
4037 * 4037 *
4038 * Overview: Detect Signal strength to control TX Registry 4038 * Overview: Detect Signal strength to control TX Registry
4039 Tx Power Control For Near/Far Range 4039 Tx Power Control For Near/Far Range
4040 * 4040 *
4041 * Input: NONE 4041 * Input: NONE
4042 * 4042 *
diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
index 1e05d757988..1a619d239dc 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.h
+++ b/drivers/staging/rtl8192u/r8192U_dm.h
@@ -283,7 +283,7 @@ extern void dm_txpower_trackingcallback(struct net_device *dev);
283extern void dm_restore_dynamic_mechanism_state(struct net_device *dev); 283extern void dm_restore_dynamic_mechanism_state(struct net_device *dev);
284extern void dm_backup_dynamic_mechanism_state(struct net_device *dev); 284extern void dm_backup_dynamic_mechanism_state(struct net_device *dev);
285extern void dm_change_dynamic_initgain_thresh(struct net_device *dev, 285extern void dm_change_dynamic_initgain_thresh(struct net_device *dev,
286 u32 dm_type, u32 dm_value); 286 u32 dm_type, u32 dm_value);
287extern void dm_force_tx_fw_info(struct net_device *dev,u32 force_type, u32 force_value); 287extern void dm_force_tx_fw_info(struct net_device *dev,u32 force_type, u32 force_value);
288extern void dm_init_edca_turbo(struct net_device *dev); 288extern void dm_init_edca_turbo(struct net_device *dev);
289extern void dm_rf_operation_test_callback(unsigned long data); 289extern void dm_rf_operation_test_callback(unsigned long data);
diff --git a/drivers/staging/rtl8192u/r8192U_hw.h b/drivers/staging/rtl8192u/r8192U_hw.h
index 1ebacc9c66f..0f959eda859 100644
--- a/drivers/staging/rtl8192u/r8192U_hw.h
+++ b/drivers/staging/rtl8192u/r8192U_hw.h
@@ -226,7 +226,7 @@ enum _RTL8192Usb_HW {
226#define CPU_GEN_NO_LOOPBACK_SET 0x00080000 // Set BIT19 to 1 226#define CPU_GEN_NO_LOOPBACK_SET 0x00080000 // Set BIT19 to 1
227 CPU_GEN = 0x100, // CPU Reset Register 227 CPU_GEN = 0x100, // CPU Reset Register
228 LED1Cfg = 0x154,// LED1 Configuration Register 228 LED1Cfg = 0x154,// LED1 Configuration Register
229 LED0Cfg = 0x155,// LED0 Configuration Register 229 LED0Cfg = 0x155,// LED0 Configuration Register
230 230
231 AcmAvg = 0x170, // ACM Average Period Register 231 AcmAvg = 0x170, // ACM Average Period Register
232 AcmHwCtrl = 0x171, // ACM Hardware Control Register 232 AcmHwCtrl = 0x171, // ACM Hardware Control Register
diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c
index 490c994af30..1c953c73f73 100644
--- a/drivers/staging/rtl8192u/r8192U_wx.c
+++ b/drivers/staging/rtl8192u/r8192U_wx.c
@@ -193,15 +193,15 @@ static int r8192_wx_write_regs(struct net_device *dev,
193 struct iw_request_info *info, 193 struct iw_request_info *info,
194 union iwreq_data *wrqu, char *extra) 194 union iwreq_data *wrqu, char *extra)
195{ 195{
196 struct r8192_priv *priv = ieee80211_priv(dev); 196 struct r8192_priv *priv = ieee80211_priv(dev);
197 u8 addr; 197 u8 addr;
198 198
199 down(&priv->wx_sem); 199 down(&priv->wx_sem);
200 200
201 get_user(addr, (u8*)wrqu->data.pointer); 201 get_user(addr, (u8*)wrqu->data.pointer);
202 write_rtl8225(dev, addr, wrqu->data.length); 202 write_rtl8225(dev, addr, wrqu->data.length);
203 203
204 up(&priv->wx_sem); 204 up(&priv->wx_sem);
205 return 0; 205 return 0;
206 206
207} 207}
@@ -213,14 +213,14 @@ static int r8192_wx_read_bb(struct net_device *dev,
213 struct iw_request_info *info, 213 struct iw_request_info *info,
214 union iwreq_data *wrqu, char *extra) 214 union iwreq_data *wrqu, char *extra)
215{ 215{
216 struct r8192_priv *priv = ieee80211_priv(dev); 216 struct r8192_priv *priv = ieee80211_priv(dev);
217 u8 databb; 217 u8 databb;
218#if 0 218#if 0
219 int i; 219 int i;
220 for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) ); 220 for(i=0;i<12;i++) printk("%8x\n", read_cam(dev, i) );
221#endif 221#endif
222 222
223 down(&priv->wx_sem); 223 down(&priv->wx_sem);
224 224
225 databb = rtl8187_read_phy(dev, (u8)wrqu->data.length, 0x00000000); 225 databb = rtl8187_read_phy(dev, (u8)wrqu->data.length, 0x00000000);
226 wrqu->data.length = databb; 226 wrqu->data.length = databb;
@@ -231,74 +231,74 @@ static int r8192_wx_read_bb(struct net_device *dev,
231 231
232void rtl8187_write_phy(struct net_device *dev, u8 adr, u32 data); 232void rtl8187_write_phy(struct net_device *dev, u8 adr, u32 data);
233static int r8192_wx_write_bb(struct net_device *dev, 233static int r8192_wx_write_bb(struct net_device *dev,
234 struct iw_request_info *info, 234 struct iw_request_info *info,
235 union iwreq_data *wrqu, char *extra) 235 union iwreq_data *wrqu, char *extra)
236{ 236{
237 struct r8192_priv *priv = ieee80211_priv(dev); 237 struct r8192_priv *priv = ieee80211_priv(dev);
238 u8 databb; 238 u8 databb;
239 239
240 down(&priv->wx_sem); 240 down(&priv->wx_sem);
241 241
242 get_user(databb, (u8*)wrqu->data.pointer); 242 get_user(databb, (u8*)wrqu->data.pointer);
243 rtl8187_write_phy(dev, wrqu->data.length, databb); 243 rtl8187_write_phy(dev, wrqu->data.length, databb);
244 244
245 up(&priv->wx_sem); 245 up(&priv->wx_sem);
246 return 0; 246 return 0;
247 247
248} 248}
249 249
250 250
251static int r8192_wx_write_nicb(struct net_device *dev, 251static int r8192_wx_write_nicb(struct net_device *dev,
252 struct iw_request_info *info, 252 struct iw_request_info *info,
253 union iwreq_data *wrqu, char *extra) 253 union iwreq_data *wrqu, char *extra)
254{ 254{
255 struct r8192_priv *priv = ieee80211_priv(dev); 255 struct r8192_priv *priv = ieee80211_priv(dev);
256 u32 addr; 256 u32 addr;
257 257
258 down(&priv->wx_sem); 258 down(&priv->wx_sem);
259 259
260 get_user(addr, (u32*)wrqu->data.pointer); 260 get_user(addr, (u32*)wrqu->data.pointer);
261 write_nic_byte(dev, addr, wrqu->data.length); 261 write_nic_byte(dev, addr, wrqu->data.length);
262 262
263 up(&priv->wx_sem); 263 up(&priv->wx_sem);
264 return 0; 264 return 0;
265 265
266} 266}
267static int r8192_wx_read_nicb(struct net_device *dev, 267static int r8192_wx_read_nicb(struct net_device *dev,
268 struct iw_request_info *info, 268 struct iw_request_info *info,
269 union iwreq_data *wrqu, char *extra) 269 union iwreq_data *wrqu, char *extra)
270{ 270{
271 struct r8192_priv *priv = ieee80211_priv(dev); 271 struct r8192_priv *priv = ieee80211_priv(dev);
272 u32 addr; 272 u32 addr;
273 u16 data1; 273 u16 data1;
274 274
275 down(&priv->wx_sem); 275 down(&priv->wx_sem);
276 276
277 get_user(addr,(u32*)wrqu->data.pointer); 277 get_user(addr,(u32*)wrqu->data.pointer);
278 data1 = read_nic_byte(dev, addr); 278 data1 = read_nic_byte(dev, addr);
279 wrqu->data.length = data1; 279 wrqu->data.length = data1;
280 280
281 up(&priv->wx_sem); 281 up(&priv->wx_sem);
282 return 0; 282 return 0;
283} 283}
284 284
285static int r8192_wx_get_ap_status(struct net_device *dev, 285static int r8192_wx_get_ap_status(struct net_device *dev,
286 struct iw_request_info *info, 286 struct iw_request_info *info,
287 union iwreq_data *wrqu, char *extra) 287 union iwreq_data *wrqu, char *extra)
288{ 288{
289 struct r8192_priv *priv = ieee80211_priv(dev); 289 struct r8192_priv *priv = ieee80211_priv(dev);
290 struct ieee80211_device *ieee = priv->ieee80211; 290 struct ieee80211_device *ieee = priv->ieee80211;
291 struct ieee80211_network *target; 291 struct ieee80211_network *target;
292 int name_len; 292 int name_len;
293 293
294 down(&priv->wx_sem); 294 down(&priv->wx_sem);
295 295
296 //count the length of input ssid 296 //count the length of input ssid
297 for(name_len=0 ; ((char*)wrqu->data.pointer)[name_len]!='\0' ; name_len++); 297 for(name_len=0 ; ((char*)wrqu->data.pointer)[name_len]!='\0' ; name_len++);
298 298
299 //search for the correspoding info which is received 299 //search for the correspoding info which is received
300 list_for_each_entry(target, &ieee->network_list, list) { 300 list_for_each_entry(target, &ieee->network_list, list) {
301 if ( (target->ssid_len == name_len) && 301 if ( (target->ssid_len == name_len) &&
302 (strncmp(target->ssid, (char*)wrqu->data.pointer, name_len)==0)){ 302 (strncmp(target->ssid, (char*)wrqu->data.pointer, name_len)==0)){
303 if(target->wpa_ie_len>0 || target->rsn_ie_len>0 ) 303 if(target->wpa_ie_len>0 || target->rsn_ie_len>0 )
304 //set flags=1 to indicate this ap is WPA 304 //set flags=1 to indicate this ap is WPA
@@ -307,11 +307,11 @@ static int r8192_wx_get_ap_status(struct net_device *dev,
307 307
308 308
309 break; 309 break;
310 } 310 }
311 } 311 }
312 312
313 up(&priv->wx_sem); 313 up(&priv->wx_sem);
314 return 0; 314 return 0;
315} 315}
316 316
317 317
@@ -404,25 +404,25 @@ static int r8192_wx_set_mode(struct net_device *dev, struct iw_request_info *a,
404 404
405struct iw_range_with_scan_capa 405struct iw_range_with_scan_capa
406{ 406{
407 /* Informative stuff (to choose between different interface) */ 407 /* Informative stuff (to choose between different interface) */
408 __u32 throughput; /* To give an idea... */ 408 __u32 throughput; /* To give an idea... */
409 /* In theory this value should be the maximum benchmarked 409 /* In theory this value should be the maximum benchmarked
410 * TCP/IP throughput, because with most of these devices the 410 * TCP/IP throughput, because with most of these devices the
411 * bit rate is meaningless (overhead an co) to estimate how 411 * bit rate is meaningless (overhead an co) to estimate how
412 * fast the connection will go and pick the fastest one. 412 * fast the connection will go and pick the fastest one.
413 * I suggest people to play with Netperf or any benchmark... 413 * I suggest people to play with Netperf or any benchmark...
414 */ 414 */
415 415
416 /* NWID (or domain id) */ 416 /* NWID (or domain id) */
417 __u32 min_nwid; /* Minimal NWID we are able to set */ 417 __u32 min_nwid; /* Minimal NWID we are able to set */
418 __u32 max_nwid; /* Maximal NWID we are able to set */ 418 __u32 max_nwid; /* Maximal NWID we are able to set */
419 419
420 /* Old Frequency (backward compat - moved lower ) */ 420 /* Old Frequency (backward compat - moved lower ) */
421 __u16 old_num_channels; 421 __u16 old_num_channels;
422 __u8 old_num_frequency; 422 __u8 old_num_frequency;
423 423
424 /* Scan capabilities */ 424 /* Scan capabilities */
425 __u8 scan_capa; 425 __u8 scan_capa;
426}; 426};
427static int rtl8180_wx_get_range(struct net_device *dev, 427static int rtl8180_wx_get_range(struct net_device *dev,
428 struct iw_request_info *info, 428 struct iw_request_info *info,
@@ -453,7 +453,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
453 // TODO: Not used in 802.11b? 453 // TODO: Not used in 802.11b?
454// range->max_nwid; /* Maximal NWID we are able to set */ 454// range->max_nwid; /* Maximal NWID we are able to set */
455 455
456 /* Old Frequency (backward compat - moved lower ) */ 456 /* Old Frequency (backward compat - moved lower ) */
457// range->old_num_channels; 457// range->old_num_channels;
458// range->old_num_frequency; 458// range->old_num_frequency;
459// range->old_freq[6]; /* Filler to keep "version" at the same offset */ 459// range->old_freq[6]; /* Filler to keep "version" at the same offset */
@@ -509,7 +509,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
509#else 509#else
510 if ((priv->ieee80211->channel_map)[i+1]) { 510 if ((priv->ieee80211->channel_map)[i+1]) {
511#endif 511#endif
512 range->freq[val].i = i + 1; 512 range->freq[val].i = i + 1;
513 range->freq[val].m = ieee80211_wlan_frequencies[i] * 100000; 513 range->freq[val].m = ieee80211_wlan_frequencies[i] * 100000;
514 range->freq[val].e = 1; 514 range->freq[val].e = 1;
515 val++; 515 val++;
@@ -522,7 +522,7 @@ static int rtl8180_wx_get_range(struct net_device *dev,
522 break; 522 break;
523 } 523 }
524 range->num_frequency = val; 524 range->num_frequency = val;
525 range->num_channels = val; 525 range->num_channels = val;
526#if WIRELESS_EXT > 17 526#if WIRELESS_EXT > 17
527 range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2| 527 range->enc_capa = IW_ENC_CAPA_WPA|IW_ENC_CAPA_WPA2|
528 IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP; 528 IW_ENC_CAPA_CIPHER_TKIP|IW_ENC_CAPA_CIPHER_CCMP;
@@ -557,10 +557,10 @@ static int r8192_wx_set_scan(struct net_device *dev, struct iw_request_info *a,
557 557
558 down(&priv->wx_sem); 558 down(&priv->wx_sem);
559 if(priv->ieee80211->state != IEEE80211_LINKED){ 559 if(priv->ieee80211->state != IEEE80211_LINKED){
560 priv->ieee80211->scanning = 0; 560 priv->ieee80211->scanning = 0;
561 ieee80211_softmac_scan_syncro(priv->ieee80211); 561 ieee80211_softmac_scan_syncro(priv->ieee80211);
562 ret = 0; 562 ret = 0;
563 } 563 }
564 else 564 else
565 ret = ieee80211_wx_set_scan(priv->ieee80211,a,wrqu,b); 565 ret = ieee80211_wx_set_scan(priv->ieee80211,a,wrqu,b);
566 up(&priv->wx_sem); 566 up(&priv->wx_sem);
@@ -809,7 +809,7 @@ static int r8192_wx_set_enc(struct net_device *dev,
809static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa, union 809static int r8192_wx_set_scan_type(struct net_device *dev, struct iw_request_info *aa, union
810 iwreq_data *wrqu, char *p){ 810 iwreq_data *wrqu, char *p){
811 811
812 struct r8192_priv *priv = ieee80211_priv(dev); 812 struct r8192_priv *priv = ieee80211_priv(dev);
813 int *parms=(int*)p; 813 int *parms=(int*)p;
814 int mode=parms[0]; 814 int mode=parms[0];
815 815
@@ -858,7 +858,7 @@ static int r8192_wx_set_retry(struct net_device *dev,
858 * I'm unsure if whole reset is really needed 858 * I'm unsure if whole reset is really needed
859 */ 859 */
860 860
861 rtl8192_commit(dev); 861 rtl8192_commit(dev);
862 /* 862 /*
863 if(priv->up){ 863 if(priv->up){
864 rtl8180_rtx_disable(dev); 864 rtl8180_rtx_disable(dev);
@@ -939,8 +939,8 @@ exit:
939#if (WIRELESS_EXT >= 18) 939#if (WIRELESS_EXT >= 18)
940#if 0 940#if 0
941static int r8192_wx_get_enc_ext(struct net_device *dev, 941static int r8192_wx_get_enc_ext(struct net_device *dev,
942 struct iw_request_info *info, 942 struct iw_request_info *info,
943 union iwreq_data *wrqu, char *extra) 943 union iwreq_data *wrqu, char *extra)
944{ 944{
945 struct r8192_priv *priv = ieee80211_priv(dev); 945 struct r8192_priv *priv = ieee80211_priv(dev);
946 int ret = 0; 946 int ret = 0;
@@ -950,8 +950,8 @@ static int r8192_wx_get_enc_ext(struct net_device *dev,
950#endif 950#endif
951//hw security need to reorganized. 951//hw security need to reorganized.
952static int r8192_wx_set_enc_ext(struct net_device *dev, 952static int r8192_wx_set_enc_ext(struct net_device *dev,
953 struct iw_request_info *info, 953 struct iw_request_info *info,
954 union iwreq_data *wrqu, char *extra) 954 union iwreq_data *wrqu, char *extra)
955{ 955{
956 int ret=0; 956 int ret=0;
957 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 957 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
@@ -1040,8 +1040,8 @@ end_hw_sec:
1040 1040
1041} 1041}
1042static int r8192_wx_set_auth(struct net_device *dev, 1042static int r8192_wx_set_auth(struct net_device *dev,
1043 struct iw_request_info *info, 1043 struct iw_request_info *info,
1044 union iwreq_data *data, char *extra) 1044 union iwreq_data *data, char *extra)
1045{ 1045{
1046 int ret=0; 1046 int ret=0;
1047#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1047#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
@@ -1055,8 +1055,8 @@ static int r8192_wx_set_auth(struct net_device *dev,
1055} 1055}
1056 1056
1057static int r8192_wx_set_mlme(struct net_device *dev, 1057static int r8192_wx_set_mlme(struct net_device *dev,
1058 struct iw_request_info *info, 1058 struct iw_request_info *info,
1059 union iwreq_data *wrqu, char *extra) 1059 union iwreq_data *wrqu, char *extra)
1060{ 1060{
1061 //printk("====>%s()\n", __FUNCTION__); 1061 //printk("====>%s()\n", __FUNCTION__);
1062 1062
@@ -1072,21 +1072,21 @@ static int r8192_wx_set_mlme(struct net_device *dev,
1072} 1072}
1073#endif 1073#endif
1074static int r8192_wx_set_gen_ie(struct net_device *dev, 1074static int r8192_wx_set_gen_ie(struct net_device *dev,
1075 struct iw_request_info *info, 1075 struct iw_request_info *info,
1076 union iwreq_data *data, char *extra) 1076 union iwreq_data *data, char *extra)
1077{ 1077{
1078 //printk("====>%s(), len:%d\n", __FUNCTION__, data->length); 1078 //printk("====>%s(), len:%d\n", __FUNCTION__, data->length);
1079 int ret=0; 1079 int ret=0;
1080#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) 1080#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
1081 struct r8192_priv *priv = ieee80211_priv(dev); 1081 struct r8192_priv *priv = ieee80211_priv(dev);
1082 down(&priv->wx_sem); 1082 down(&priv->wx_sem);
1083#if 1 1083#if 1
1084 ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length); 1084 ret = ieee80211_wx_set_gen_ie(priv->ieee80211, extra, data->data.length);
1085#endif 1085#endif
1086 up(&priv->wx_sem); 1086 up(&priv->wx_sem);
1087 //printk("<======%s(), ret:%d\n", __FUNCTION__, ret); 1087 //printk("<======%s(), ret:%d\n", __FUNCTION__, ret);
1088#endif 1088#endif
1089 return ret; 1089 return ret;
1090 1090
1091 1091
1092} 1092}
@@ -1100,56 +1100,56 @@ static int dummy(struct net_device *dev, struct iw_request_info *a,
1100 1100
1101static iw_handler r8192_wx_handlers[] = 1101static iw_handler r8192_wx_handlers[] =
1102{ 1102{
1103 NULL, /* SIOCSIWCOMMIT */ 1103 NULL, /* SIOCSIWCOMMIT */
1104 r8192_wx_get_name, /* SIOCGIWNAME */ 1104 r8192_wx_get_name, /* SIOCGIWNAME */
1105 dummy, /* SIOCSIWNWID */ 1105 dummy, /* SIOCSIWNWID */
1106 dummy, /* SIOCGIWNWID */ 1106 dummy, /* SIOCGIWNWID */
1107 r8192_wx_set_freq, /* SIOCSIWFREQ */ 1107 r8192_wx_set_freq, /* SIOCSIWFREQ */
1108 r8192_wx_get_freq, /* SIOCGIWFREQ */ 1108 r8192_wx_get_freq, /* SIOCGIWFREQ */
1109 r8192_wx_set_mode, /* SIOCSIWMODE */ 1109 r8192_wx_set_mode, /* SIOCSIWMODE */
1110 r8192_wx_get_mode, /* SIOCGIWMODE */ 1110 r8192_wx_get_mode, /* SIOCGIWMODE */
1111 r8192_wx_set_sens, /* SIOCSIWSENS */ 1111 r8192_wx_set_sens, /* SIOCSIWSENS */
1112 r8192_wx_get_sens, /* SIOCGIWSENS */ 1112 r8192_wx_get_sens, /* SIOCGIWSENS */
1113 NULL, /* SIOCSIWRANGE */ 1113 NULL, /* SIOCSIWRANGE */
1114 rtl8180_wx_get_range, /* SIOCGIWRANGE */ 1114 rtl8180_wx_get_range, /* SIOCGIWRANGE */
1115 NULL, /* SIOCSIWPRIV */ 1115 NULL, /* SIOCSIWPRIV */
1116 NULL, /* SIOCGIWPRIV */ 1116 NULL, /* SIOCGIWPRIV */
1117 NULL, /* SIOCSIWSTATS */ 1117 NULL, /* SIOCSIWSTATS */
1118 NULL, /* SIOCGIWSTATS */ 1118 NULL, /* SIOCGIWSTATS */
1119 dummy, /* SIOCSIWSPY */ 1119 dummy, /* SIOCSIWSPY */
1120 dummy, /* SIOCGIWSPY */ 1120 dummy, /* SIOCGIWSPY */
1121 NULL, /* SIOCGIWTHRSPY */ 1121 NULL, /* SIOCGIWTHRSPY */
1122 NULL, /* SIOCWIWTHRSPY */ 1122 NULL, /* SIOCWIWTHRSPY */
1123 r8192_wx_set_wap, /* SIOCSIWAP */ 1123 r8192_wx_set_wap, /* SIOCSIWAP */
1124 r8192_wx_get_wap, /* SIOCGIWAP */ 1124 r8192_wx_get_wap, /* SIOCGIWAP */
1125#if (WIRELESS_EXT >= 18) 1125#if (WIRELESS_EXT >= 18)
1126 r8192_wx_set_mlme, /* MLME-- */ 1126 r8192_wx_set_mlme, /* MLME-- */
1127#else 1127#else
1128 NULL, 1128 NULL,
1129#endif 1129#endif
1130 dummy, /* SIOCGIWAPLIST -- depricated */ 1130 dummy, /* SIOCGIWAPLIST -- depricated */
1131 r8192_wx_set_scan, /* SIOCSIWSCAN */ 1131 r8192_wx_set_scan, /* SIOCSIWSCAN */
1132 r8192_wx_get_scan, /* SIOCGIWSCAN */ 1132 r8192_wx_get_scan, /* SIOCGIWSCAN */
1133 r8192_wx_set_essid, /* SIOCSIWESSID */ 1133 r8192_wx_set_essid, /* SIOCSIWESSID */
1134 r8192_wx_get_essid, /* SIOCGIWESSID */ 1134 r8192_wx_get_essid, /* SIOCGIWESSID */
1135 dummy, /* SIOCSIWNICKN */ 1135 dummy, /* SIOCSIWNICKN */
1136 dummy, /* SIOCGIWNICKN */ 1136 dummy, /* SIOCGIWNICKN */
1137 NULL, /* -- hole -- */ 1137 NULL, /* -- hole -- */
1138 NULL, /* -- hole -- */ 1138 NULL, /* -- hole -- */
1139 r8192_wx_set_rate, /* SIOCSIWRATE */ 1139 r8192_wx_set_rate, /* SIOCSIWRATE */
1140 r8192_wx_get_rate, /* SIOCGIWRATE */ 1140 r8192_wx_get_rate, /* SIOCGIWRATE */
1141 r8192_wx_set_rts, /* SIOCSIWRTS */ 1141 r8192_wx_set_rts, /* SIOCSIWRTS */
1142 r8192_wx_get_rts, /* SIOCGIWRTS */ 1142 r8192_wx_get_rts, /* SIOCGIWRTS */
1143 r8192_wx_set_frag, /* SIOCSIWFRAG */ 1143 r8192_wx_set_frag, /* SIOCSIWFRAG */
1144 r8192_wx_get_frag, /* SIOCGIWFRAG */ 1144 r8192_wx_get_frag, /* SIOCGIWFRAG */
1145 dummy, /* SIOCSIWTXPOW */ 1145 dummy, /* SIOCSIWTXPOW */
1146 dummy, /* SIOCGIWTXPOW */ 1146 dummy, /* SIOCGIWTXPOW */
1147 r8192_wx_set_retry, /* SIOCSIWRETRY */ 1147 r8192_wx_set_retry, /* SIOCSIWRETRY */
1148 r8192_wx_get_retry, /* SIOCGIWRETRY */ 1148 r8192_wx_get_retry, /* SIOCGIWRETRY */
1149 r8192_wx_set_enc, /* SIOCSIWENCODE */ 1149 r8192_wx_set_enc, /* SIOCSIWENCODE */
1150 r8192_wx_get_enc, /* SIOCGIWENCODE */ 1150 r8192_wx_get_enc, /* SIOCGIWENCODE */
1151 r8192_wx_set_power, /* SIOCSIWPOWER */ 1151 r8192_wx_set_power, /* SIOCSIWPOWER */
1152 r8192_wx_get_power, /* SIOCGIWPOWER */ 1152 r8192_wx_get_power, /* SIOCGIWPOWER */
1153 NULL, /*---hole---*/ 1153 NULL, /*---hole---*/
1154 NULL, /*---hole---*/ 1154 NULL, /*---hole---*/
1155 r8192_wx_set_gen_ie,//NULL, /* SIOCSIWGENIE */ 1155 r8192_wx_set_gen_ie,//NULL, /* SIOCSIWGENIE */
@@ -1192,38 +1192,38 @@ static const struct iw_priv_args r8192_private_args[] = {
1192 , 1192 ,
1193 { 1193 {
1194 SIOCIWFIRSTPRIV + 0x3, 1194 SIOCIWFIRSTPRIV + 0x3,
1195 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readRF" 1195 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readRF"
1196 } 1196 }
1197 , 1197 ,
1198 { 1198 {
1199 SIOCIWFIRSTPRIV + 0x4, 1199 SIOCIWFIRSTPRIV + 0x4,
1200 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeRF" 1200 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeRF"
1201 } 1201 }
1202 , 1202 ,
1203 { 1203 {
1204 SIOCIWFIRSTPRIV + 0x5, 1204 SIOCIWFIRSTPRIV + 0x5,
1205 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readBB" 1205 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readBB"
1206 } 1206 }
1207 , 1207 ,
1208 { 1208 {
1209 SIOCIWFIRSTPRIV + 0x6, 1209 SIOCIWFIRSTPRIV + 0x6,
1210 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeBB" 1210 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writeBB"
1211 }
1212 ,
1213 {
1214 SIOCIWFIRSTPRIV + 0x7,
1215 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readnicb"
1216 }
1217 ,
1218 {
1219 SIOCIWFIRSTPRIV + 0x8,
1220 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writenicb"
1221 }
1222 ,
1223 {
1224 SIOCIWFIRSTPRIV + 0x9,
1225 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "apinfo"
1211 } 1226 }
1212 ,
1213 {
1214 SIOCIWFIRSTPRIV + 0x7,
1215 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "readnicb"
1216 }
1217 ,
1218 {
1219 SIOCIWFIRSTPRIV + 0x8,
1220 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "writenicb"
1221 }
1222 ,
1223 {
1224 SIOCIWFIRSTPRIV + 0x9,
1225 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "apinfo"
1226 }
1227 1227
1228#endif 1228#endif
1229 , 1229 ,
@@ -1249,8 +1249,8 @@ static iw_handler r8192_private_handler[] = {
1249 r8192_wx_write_regs, 1249 r8192_wx_write_regs,
1250 r8192_wx_read_bb, 1250 r8192_wx_read_bb,
1251 r8192_wx_write_bb, 1251 r8192_wx_write_bb,
1252 r8192_wx_read_nicb, 1252 r8192_wx_read_nicb,
1253 r8192_wx_write_nicb, 1253 r8192_wx_write_nicb,
1254 r8192_wx_get_ap_status, 1254 r8192_wx_get_ap_status,
1255#endif 1255#endif
1256 //r8192_wx_null, 1256 //r8192_wx_null,
@@ -1290,7 +1290,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev)
1290#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)) 1290#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
1291 wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM; 1291 wstats->qual.updated = IW_QUAL_ALL_UPDATED| IW_QUAL_DBM;
1292#else 1292#else
1293 wstats->qual.updated = 0x0f; 1293 wstats->qual.updated = 0x0f;
1294#endif 1294#endif
1295 return wstats; 1295 return wstats;
1296} 1296}
@@ -1302,7 +1302,7 @@ struct iw_handler_def r8192_wx_handlers_def={
1302 .num_standard = sizeof(r8192_wx_handlers) / sizeof(iw_handler), 1302 .num_standard = sizeof(r8192_wx_handlers) / sizeof(iw_handler),
1303 .private = r8192_private_handler, 1303 .private = r8192_private_handler,
1304 .num_private = sizeof(r8192_private_handler) / sizeof(iw_handler), 1304 .num_private = sizeof(r8192_private_handler) / sizeof(iw_handler),
1305 .num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args), 1305 .num_private_args = sizeof(r8192_private_args) / sizeof(struct iw_priv_args),
1306#if WIRELESS_EXT >= 17 1306#if WIRELESS_EXT >= 17
1307 .get_wireless_stats = r8192_get_wireless_stats, 1307 .get_wireless_stats = r8192_get_wireless_stats,
1308#endif 1308#endif
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.c b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
index 2f87503cd30..e9a0eb83283 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.c
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.c
@@ -5,9 +5,9 @@
5 Module: r819xusb_cmdpkt.c (RTL8190 TX/RX command packet handler Source C File) 5 Module: r819xusb_cmdpkt.c (RTL8190 TX/RX command packet handler Source C File)
6 6
7 Note: The module is responsible for handling TX and RX command packet. 7 Note: The module is responsible for handling TX and RX command packet.
8 1. TX : Send set and query configuration command packet. 8 1. TX : Send set and query configuration command packet.
9 2. RX : Receive tx feedback, beacon state, query configuration 9 2. RX : Receive tx feedback, beacon state, query configuration
10 command packet. 10 command packet.
11 11
12 Function: 12 Function:
13 13
@@ -158,7 +158,7 @@ SendTxCommandPacket(
158 seg_ptr = skb_put(skb, buffer_len); 158 seg_ptr = skb_put(skb, buffer_len);
159 /* 159 /*
160 * Transform from little endian to big endian 160 * Transform from little endian to big endian
161 * and pending zero 161 * and pending zero
162 */ 162 */
163 memcpy(seg_ptr,codevirtualaddress,buffer_len); 163 memcpy(seg_ptr,codevirtualaddress,buffer_len);
164 tcb_desc->txbuf_size= (u16)buffer_len; 164 tcb_desc->txbuf_size= (u16)buffer_len;
@@ -349,7 +349,7 @@ cmpk_handle_tx_feedback(
349 pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F); 349 pMgntInfo->CurrentOperaRate = (rx_tx_fb.F_Rate & 0x7F);
350 } 350 }
351 else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G || 351 else if (pAdapter->RegWirelessMode == WIRELESS_MODE_N_24G ||
352 pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G) 352 pAdapter->RegWirelessMode == WIRELESS_MODE_N_5G)
353 { 353 {
354 pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F); 354 pMgntInfo->HTCurrentOperaRate = (rx_tx_fb.F_Rate & 0x8F);
355 } 355 }
@@ -802,7 +802,7 @@ cmpk_message_handle_rx(
802 802
803 default: 803 default:
804 804
805 RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknow CMD Element\n"); 805 RT_TRACE(COMP_ERR, "---->cmpk_message_handle_rx():unknow CMD Element\n");
806 return 1; /* This is a command packet. */ 806 return 1; /* This is a command packet. */
807 } 807 }
808 // 2007/01/22 MH Display received rx command packet info. 808 // 2007/01/22 MH Display received rx command packet info.
diff --git a/drivers/staging/rtl8192u/r819xU_cmdpkt.h b/drivers/staging/rtl8192u/r819xU_cmdpkt.h
index 162959f55f9..34fbdcf1be7 100644
--- a/drivers/staging/rtl8192u/r819xU_cmdpkt.h
+++ b/drivers/staging/rtl8192u/r819xU_cmdpkt.h
@@ -202,10 +202,10 @@ typedef enum tag_command_packet_directories
202}cmpk_element_e; 202}cmpk_element_e;
203 203
204typedef enum _rt_status{ 204typedef enum _rt_status{
205 RT_STATUS_SUCCESS, 205 RT_STATUS_SUCCESS,
206 RT_STATUS_FAILURE, 206 RT_STATUS_FAILURE,
207 RT_STATUS_PENDING, 207 RT_STATUS_PENDING,
208 RT_STATUS_RESOURCE 208 RT_STATUS_RESOURCE
209}rt_status,*prt_status; 209}rt_status,*prt_status;
210 210
211extern rt_status cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len); 211extern rt_status cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, u32 packettype, u32 buffer_len);
diff --git a/drivers/staging/rtl8192u/r819xU_firmware.c b/drivers/staging/rtl8192u/r819xU_firmware.c
index 5e09b4668c0..20d78f46112 100644
--- a/drivers/staging/rtl8192u/r819xU_firmware.c
+++ b/drivers/staging/rtl8192u/r819xU_firmware.c
@@ -80,7 +80,7 @@ bool fw_download_code(struct net_device *dev, u8 *code_virtual_address, u32 buff
80 seg_ptr = skb->data; 80 seg_ptr = skb->data;
81 /* 81 /*
82 * Transform from little endian to big endian 82 * Transform from little endian to big endian
83 * and pending zero 83 * and pending zero
84 */ 84 */
85 for(i=0 ; i < frag_length; i+=4) { 85 for(i=0 ; i < frag_length; i+=4) {
86 *seg_ptr++ = ((i+0)<frag_length)?code_virtual_address[i+3]:0; 86 *seg_ptr++ = ((i+0)<frag_length)?code_virtual_address[i+3]:0;
@@ -218,7 +218,7 @@ bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
218{ 218{
219 bool rt_status = true; 219 bool rt_status = true;
220 int check_putcodeOK_time = 200000, check_bootOk_time = 200000; 220 int check_putcodeOK_time = 200000, check_bootOk_time = 200000;
221 u32 CPU_status = 0; 221 u32 CPU_status = 0;
222 222
223 /* Check whether put code OK */ 223 /* Check whether put code OK */
224 do { 224 do {
@@ -299,12 +299,12 @@ bool init_firmware(struct net_device *dev)
299 bool rt_status = TRUE; 299 bool rt_status = TRUE;
300 300
301 u8 *firmware_img_buf[3] = { &rtl8190_fwboot_array[0], 301 u8 *firmware_img_buf[3] = { &rtl8190_fwboot_array[0],
302 &rtl8190_fwmain_array[0], 302 &rtl8190_fwmain_array[0],
303 &rtl8190_fwdata_array[0]}; 303 &rtl8190_fwdata_array[0]};
304 304
305 u32 firmware_img_len[3] = { sizeof(rtl8190_fwboot_array), 305 u32 firmware_img_len[3] = { sizeof(rtl8190_fwboot_array),
306 sizeof(rtl8190_fwmain_array), 306 sizeof(rtl8190_fwmain_array),
307 sizeof(rtl8190_fwdata_array)}; 307 sizeof(rtl8190_fwdata_array)};
308 u32 file_length = 0; 308 u32 file_length = 0;
309 u8 *mapped_file = NULL; 309 u8 *mapped_file = NULL;
310 u32 init_step = 0; 310 u32 init_step = 0;
@@ -314,7 +314,7 @@ bool init_firmware(struct net_device *dev)
314 rt_firmware *pfirmware = priv->pFirmware; 314 rt_firmware *pfirmware = priv->pFirmware;
315 const struct firmware *fw_entry; 315 const struct firmware *fw_entry;
316 const char *fw_name[3] = { "RTL8192U/boot.img", 316 const char *fw_name[3] = { "RTL8192U/boot.img",
317 "RTL8192U/main.img", 317 "RTL8192U/main.img",
318 "RTL8192U/data.img"}; 318 "RTL8192U/data.img"};
319 int rc; 319 int rc;
320 320
@@ -490,8 +490,8 @@ download_firmware_fail:
490#if 0 490#if 0
491/* 491/*
492 * Procedure: (1) Transform firmware code from little endian to big endian if required. 492 * Procedure: (1) Transform firmware code from little endian to big endian if required.
493 * (2) Number of bytes in Firmware downloading should be multiple 493 * (2) Number of bytes in Firmware downloading should be multiple
494 * of 4 bytes. If length is not multiple of 4 bytes, appending of zeros is required 494 * of 4 bytes. If length is not multiple of 4 bytes, appending of zeros is required
495 * 495 *
496 */ 496 */
497void CmdAppendZeroAndEndianTransform( 497void CmdAppendZeroAndEndianTransform(
diff --git a/drivers/staging/rtl8192u/r819xU_phy.c b/drivers/staging/rtl8192u/r819xU_phy.c
index 00497d313f9..beeab51a2c3 100644
--- a/drivers/staging/rtl8192u/r819xU_phy.c
+++ b/drivers/staging/rtl8192u/r819xU_phy.c
@@ -94,7 +94,7 @@ void rtl8192_setBBreg(struct net_device* dev, u32 dwRegAddr, u32 dwBitMask, u32
94 {//if not "double word" write 94 {//if not "double word" write
95 OriginalValue = read_nic_dword(dev, dwRegAddr); 95 OriginalValue = read_nic_dword(dev, dwRegAddr);
96 BitShift = rtl8192_CalculateBitShift(dwBitMask); 96 BitShift = rtl8192_CalculateBitShift(dwBitMask);
97 NewValue = (((OriginalValue) & (~dwBitMask)) | (dwData << BitShift)); 97 NewValue = (((OriginalValue) & (~dwBitMask)) | (dwData << BitShift));
98 write_nic_dword(dev, dwRegAddr, NewValue); 98 write_nic_dword(dev, dwRegAddr, NewValue);
99 }else 99 }else
100 write_nic_dword(dev, dwRegAddr, dwData); 100 write_nic_dword(dev, dwRegAddr, dwData);
@@ -265,7 +265,7 @@ void rtl8192_phy_RFSerialWrite(struct net_device* dev, RF90_RADIO_PATH_E eRFPath
265 priv->RfReg0Value[eRFPath] = Data; 265 priv->RfReg0Value[eRFPath] = Data;
266 266
267 // Switch back to Reg_Mode0; 267 // Switch back to Reg_Mode0;
268 if(priv->rf_chip == RF_8256) 268 if(priv->rf_chip == RF_8256)
269 { 269 {
270 if(Offset != 0) 270 if(Offset != 0)
271 { 271 {
@@ -320,13 +320,13 @@ void rtl8192_phy_SetRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u32
320 else 320 else
321 { 321 {
322 if (BitMask != bMask12Bits) // RF data is 12 bits only 322 if (BitMask != bMask12Bits) // RF data is 12 bits only
323 { 323 {
324 Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr); 324 Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr);
325 BitShift = rtl8192_CalculateBitShift(BitMask); 325 BitShift = rtl8192_CalculateBitShift(BitMask);
326 New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift)); 326 New_Value = (((Original_Value) & (~BitMask)) | (Data<< BitShift));
327 327
328 rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, New_Value); 328 rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, New_Value);
329 }else 329 }else
330 rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, Data); 330 rtl8192_phy_RFSerialWrite(dev, eRFPath, RegAddr, Data);
331 } 331 }
332 return; 332 return;
@@ -360,8 +360,8 @@ u32 rtl8192_phy_QueryRFReg(struct net_device* dev, RF90_RADIO_PATH_E eRFPath, u3
360 else 360 else
361 { 361 {
362 Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr); 362 Original_Value = rtl8192_phy_RFSerialRead(dev, eRFPath, RegAddr);
363 BitShift = rtl8192_CalculateBitShift(BitMask); 363 BitShift = rtl8192_CalculateBitShift(BitMask);
364 Readback_Value = (Original_Value & BitMask) >> BitShift; 364 Readback_Value = (Original_Value & BitMask) >> BitShift;
365 return (Readback_Value); 365 return (Readback_Value);
366 } 366 }
367} 367}
@@ -800,7 +800,7 @@ void rtl8192_BB_Config_ParaFile(struct net_device* dev)
800 dwRegValue = read_nic_dword(dev, CPU_GEN); 800 dwRegValue = read_nic_dword(dev, CPU_GEN);
801 write_nic_dword(dev, CPU_GEN, (dwRegValue|CPU_GEN_BB_RST)); 801 write_nic_dword(dev, CPU_GEN, (dwRegValue|CPU_GEN_BB_RST));
802 802
803 /*----BB AGC table Initialization----*/ 803 /*----BB AGC table Initialization----*/
804 //==m==>Set PHY REG From Header<==m== 804 //==m==>Set PHY REG From Header<==m==
805 rtl8192_phyConfigBB(dev, BaseBand_Config_AGC_TAB); 805 rtl8192_phyConfigBB(dev, BaseBand_Config_AGC_TAB);
806 806
@@ -1563,7 +1563,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
1563 1563
1564 case HT_CHANNEL_WIDTH_20_40: 1564 case HT_CHANNEL_WIDTH_20_40:
1565 regBwOpMode &= ~BW_OPMODE_20MHZ; 1565 regBwOpMode &= ~BW_OPMODE_20MHZ;
1566 // 2007/02/07 Mark by Emily becasue we have not verify whether this register works 1566 // 2007/02/07 Mark by Emily becasue we have not verify whether this register works
1567 write_nic_byte(dev, BW_OPMODE, regBwOpMode); 1567 write_nic_byte(dev, BW_OPMODE, regBwOpMode);
1568 break; 1568 break;
1569 1569
@@ -1615,7 +1615,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
1615 rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x1); 1615 rtl8192_setBBreg(dev, rFPGA0_RFMOD, bRFMOD, 0x1);
1616 rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x1); 1616 rtl8192_setBBreg(dev, rFPGA1_RFMOD, bRFMOD, 0x1);
1617 rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1)); 1617 rtl8192_setBBreg(dev, rCCK0_System, bCCKSideBand, (priv->nCur40MhzPrimeSC>>1));
1618 rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0); 1618 rtl8192_setBBreg(dev, rFPGA0_AnalogParameter1, 0x00100000, 0);
1619 rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC); 1619 rtl8192_setBBreg(dev, rOFDM1_LSTF, 0xC00, priv->nCur40MhzPrimeSC);
1620#if 0 1620#if 0
1621 // Correct the tx power for CCK rate in 40M. Suggest by YN, 20071207 1621 // Correct the tx power for CCK rate in 40M. Suggest by YN, 20071207
diff --git a/drivers/staging/rtl8192u/r819xU_phyreg.h b/drivers/staging/rtl8192u/r819xU_phyreg.h
index b62f1a6fb1e..06b0b539e1b 100644
--- a/drivers/staging/rtl8192u/r819xU_phyreg.h
+++ b/drivers/staging/rtl8192u/r819xU_phyreg.h
@@ -204,7 +204,7 @@
204#define rZebra1_AGC 0x4 204#define rZebra1_AGC 0x4
205#define rZebra1_ChargePump 0x5 205#define rZebra1_ChargePump 0x5
206#define rZebra1_Channel 0x7 206#define rZebra1_Channel 0x7
207#define rZebra1_TxGain 0x8 207#define rZebra1_TxGain 0x8
208#define rZebra1_TxLPF 0x9 208#define rZebra1_TxLPF 0x9
209#define rZebra1_RxLPF 0xb 209#define rZebra1_RxLPF 0xb
210#define rZebra1_RxHPFCorner 0xc 210#define rZebra1_RxHPFCorner 0xc
@@ -360,7 +360,7 @@
360#define bAFEWatchDogEnable 0x20000000 360#define bAFEWatchDogEnable 0x20000000
361#define bXtalCap 0x0f000000 361#define bXtalCap 0x0f000000
362#define bIntDifClkEnable 0x400 362#define bIntDifClkEnable 0x400
363#define bExtSigClkEnable 0x800 363#define bExtSigClkEnable 0x800
364#define bBandgapMbiasPowerUp 0x10000 364#define bBandgapMbiasPowerUp 0x10000
365#define bAD11SHGain 0xc0000 365#define bAD11SHGain 0xc0000
366#define bAD11InputRange 0x700000 366#define bAD11InputRange 0x700000
@@ -401,8 +401,8 @@
401#define bOFDMTxOn 0x2 401#define bOFDMTxOn 0x2
402#define bDebugPage 0xfff //reset debug page and also HWord, LWord 402#define bDebugPage 0xfff //reset debug page and also HWord, LWord
403#define bDebugItem 0xff //reset debug page and LWord 403#define bDebugItem 0xff //reset debug page and LWord
404#define bAntL 0x10 404#define bAntL 0x10
405#define bAntNonHT 0x100 405#define bAntNonHT 0x100
406#define bAntHT1 0x1000 406#define bAntHT1 0x1000
407#define bAntHT2 0x10000 407#define bAntHT2 0x10000
408#define bAntHT1S1 0x100000 408#define bAntHT1S1 0x100000
@@ -414,26 +414,26 @@
414#define bCCKRxPowerSaving 0x40 414#define bCCKRxPowerSaving 0x40
415#define bCCKSideBand 0x10 415#define bCCKSideBand 0x10
416#define bCCKScramble 0x8 416#define bCCKScramble 0x8
417#define bCCKAntDiversity 0x8000 417#define bCCKAntDiversity 0x8000
418#define bCCKCarrierRecovery 0x4000 418#define bCCKCarrierRecovery 0x4000
419#define bCCKTxRate 0x3000 419#define bCCKTxRate 0x3000
420#define bCCKDCCancel 0x0800 420#define bCCKDCCancel 0x0800
421#define bCCKISICancel 0x0400 421#define bCCKISICancel 0x0400
422#define bCCKMatchFilter 0x0200 422#define bCCKMatchFilter 0x0200
423#define bCCKEqualizer 0x0100 423#define bCCKEqualizer 0x0100
424#define bCCKPreambleDetect 0x800000 424#define bCCKPreambleDetect 0x800000
425#define bCCKFastFalseCCA 0x400000 425#define bCCKFastFalseCCA 0x400000
426#define bCCKChEstStart 0x300000 426#define bCCKChEstStart 0x300000
427#define bCCKCCACount 0x080000 427#define bCCKCCACount 0x080000
428#define bCCKcs_lim 0x070000 428#define bCCKcs_lim 0x070000
429#define bCCKBistMode 0x80000000 429#define bCCKBistMode 0x80000000
430#define bCCKCCAMask 0x40000000 430#define bCCKCCAMask 0x40000000
431#define bCCKTxDACPhase 0x4 431#define bCCKTxDACPhase 0x4
432#define bCCKRxADCPhase 0x20000000 //r_rx_clk 432#define bCCKRxADCPhase 0x20000000 //r_rx_clk
433#define bCCKr_cp_mode0 0x0100 433#define bCCKr_cp_mode0 0x0100
434#define bCCKTxDCOffset 0xf0 434#define bCCKTxDCOffset 0xf0
435#define bCCKRxDCOffset 0xf 435#define bCCKRxDCOffset 0xf
436#define bCCKCCAMode 0xc000 436#define bCCKCCAMode 0xc000
437#define bCCKFalseCS_lim 0x3f00 437#define bCCKFalseCS_lim 0x3f00
438#define bCCKCS_ratio 0xc00000 438#define bCCKCS_ratio 0xc00000
439#define bCCKCorgBit_sel 0x300000 439#define bCCKCorgBit_sel 0x300000
@@ -444,18 +444,18 @@
444#define bCCKLNAPolarity 0x800000 444#define bCCKLNAPolarity 0x800000
445#define bCCKRx1stGain 0x7f0000 445#define bCCKRx1stGain 0x7f0000
446#define bCCKRFExtend 0x20000000 //CCK Rx Iinital gain polarity 446#define bCCKRFExtend 0x20000000 //CCK Rx Iinital gain polarity
447#define bCCKRxAGCSatLevel 0x1f000000 447#define bCCKRxAGCSatLevel 0x1f000000
448#define bCCKRxAGCSatCount 0xe0 448#define bCCKRxAGCSatCount 0xe0
449#define bCCKRxRFSettle 0x1f //AGCsamp_dly 449#define bCCKRxRFSettle 0x1f //AGCsamp_dly
450#define bCCKFixedRxAGC 0x8000 450#define bCCKFixedRxAGC 0x8000
451//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824 451//#define bCCKRxAGCFormat 0x4000 //remove to HSSI register 0x824
452#define bCCKAntennaPolarity 0x2000 452#define bCCKAntennaPolarity 0x2000
453#define bCCKTxFilterType 0x0c00 453#define bCCKTxFilterType 0x0c00
454#define bCCKRxAGCReportType 0x0300 454#define bCCKRxAGCReportType 0x0300
455#define bCCKRxDAGCEn 0x80000000 455#define bCCKRxDAGCEn 0x80000000
456#define bCCKRxDAGCPeriod 0x20000000 456#define bCCKRxDAGCPeriod 0x20000000
457#define bCCKRxDAGCSatLevel 0x1f000000 457#define bCCKRxDAGCSatLevel 0x1f000000
458#define bCCKTimingRecovery 0x800000 458#define bCCKTimingRecovery 0x800000
459#define bCCKTxC0 0x3f0000 459#define bCCKTxC0 0x3f0000
460#define bCCKTxC1 0x3f000000 460#define bCCKTxC1 0x3f000000
461#define bCCKTxC2 0x3f 461#define bCCKTxC2 0x3f