Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: rtl8192u: remove bad whitespaces

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Mauro Carvalho Chehab and committed by
Greg Kroah-Hartman
e406322b f61fb935

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