diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2009-11-03 09:42:46 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 20:23:22 (GMT) |
commit | e406322b4b963e622f41d76193d8ca9e5435adb8 (patch) | |
tree | a2efb0475b523babe255e1279b841f04f778fe65 /drivers/staging/rtl8192u/ieee80211 | |
parent | f61fb9356d20977258bb59a8d9f1857d2c58ac98 (diff) | |
download | linux-fsl-qoriq-e406322b4b963e622f41d76193d8ca9e5435adb8.tar.xz |
Staging: rtl8192u: remove bad whitespaces
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211')
19 files changed, 796 insertions, 796 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/aes.c b/drivers/staging/rtl8192u/ieee80211/aes.c index 0c176e2..a6bb6c9 100644 --- a/drivers/staging/rtl8192u/ieee80211/aes.c +++ b/drivers/staging/rtl8192u/ieee80211/aes.c @@ -126,15 +126,15 @@ f_mult (u8 a, u8 b) #define f_rn(bo, bi, n, k) \ bo[n] = ft_tab[0][byte(bi[n],0)] ^ \ - ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ - ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ - ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) + ft_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ + ft_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ + ft_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) #define i_rn(bo, bi, n, k) \ bo[n] = it_tab[0][byte(bi[n],0)] ^ \ - it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ - it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ - it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) + it_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ + it_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ + it_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) #define ls_box(x) \ ( fl_tab[0][byte(x, 0)] ^ \ @@ -144,15 +144,15 @@ f_mult (u8 a, u8 b) #define f_rl(bo, bi, n, k) \ bo[n] = fl_tab[0][byte(bi[n],0)] ^ \ - fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ - fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ - fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) + fl_tab[1][byte(bi[(n + 1) & 3],1)] ^ \ + fl_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ + fl_tab[3][byte(bi[(n + 3) & 3],3)] ^ *(k + n) #define i_rl(bo, bi, n, k) \ bo[n] = il_tab[0][byte(bi[n],0)] ^ \ - il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ - il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ - il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) + il_tab[1][byte(bi[(n + 3) & 3],1)] ^ \ + il_tab[2][byte(bi[(n + 2) & 3],2)] ^ \ + il_tab[3][byte(bi[(n + 1) & 3],3)] ^ *(k + n) static void __init gen_tabs (void) @@ -234,8 +234,8 @@ gen_tabs (void) t = w ^ (x); \ (y) = u ^ v ^ w; \ (y) ^= rotr(u ^ t, 8) ^ \ - rotr(v ^ t, 16) ^ \ - rotr(t,24) + rotr(v ^ t, 16) ^ \ + rotr(t,24) /* initialise the key schedule from the user supplied key */ @@ -443,9 +443,9 @@ static struct crypto_alg aes_alg = { .cipher = { .cia_min_keysize = AES_MIN_KEY_SIZE, .cia_max_keysize = AES_MAX_KEY_SIZE, - .cia_setkey = aes_set_key, - .cia_encrypt = aes_encrypt, - .cia_decrypt = aes_decrypt + .cia_setkey = aes_set_key, + .cia_encrypt = aes_encrypt, + .cia_decrypt = aes_decrypt } } }; diff --git a/drivers/staging/rtl8192u/ieee80211/arc4.c b/drivers/staging/rtl8192u/ieee80211/arc4.c index e408472..e3ad8d2 100644 --- a/drivers/staging/rtl8192u/ieee80211/arc4.c +++ b/drivers/staging/rtl8192u/ieee80211/arc4.c @@ -79,9 +79,9 @@ static struct crypto_alg arc4_alg = { .cra_u = { .cipher = { .cia_min_keysize = ARC4_MIN_KEY_SIZE, .cia_max_keysize = ARC4_MAX_KEY_SIZE, - .cia_setkey = arc4_set_key, - .cia_encrypt = arc4_crypt, - .cia_decrypt = arc4_crypt } } + .cia_setkey = arc4_set_key, + .cia_encrypt = arc4_crypt, + .cia_decrypt = arc4_crypt } } }; static int __init arc4_init(void) diff --git a/drivers/staging/rtl8192u/ieee80211/cipher.c b/drivers/staging/rtl8192u/ieee80211/cipher.c index 1968acf..0b9e8a4 100644 --- a/drivers/staging/rtl8192u/ieee80211/cipher.c +++ b/drivers/staging/rtl8192u/ieee80211/cipher.c @@ -23,7 +23,7 @@ typedef void (cryptfn_t)(void *, u8 *, const u8 *); typedef void (procfn_t)(struct crypto_tfm *, u8 *, - u8*, cryptfn_t, int enc, void *, int); + u8*, cryptfn_t, int enc, void *, int); static inline void xor_64(u8 *a, const u8 *b) { @@ -48,8 +48,8 @@ static inline void xor_128(u8 *a, const u8 *b) static int crypt(struct crypto_tfm *tfm, struct scatterlist *dst, struct scatterlist *src, - unsigned int nbytes, cryptfn_t crfn, - procfn_t prfn, int enc, void *info) + unsigned int nbytes, cryptfn_t crfn, + procfn_t prfn, int enc, void *info) { struct scatter_walk walk_in, walk_out; const unsigned int bsize = crypto_tfm_alg_blocksize(tfm); @@ -136,80 +136,80 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) return -EINVAL; } else return cia->cia_setkey(crypto_tfm_ctx(tfm), key, keylen, - &tfm->crt_flags); + &tfm->crt_flags); } static int ecb_encrypt(struct crypto_tfm *tfm, struct scatterlist *dst, - struct scatterlist *src, unsigned int nbytes) + struct scatterlist *src, unsigned int nbytes) { return crypt(tfm, dst, src, nbytes, - tfm->__crt_alg->cra_cipher.cia_encrypt, - ecb_process, 1, NULL); + tfm->__crt_alg->cra_cipher.cia_encrypt, + ecb_process, 1, NULL); } static int ecb_decrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, + struct scatterlist *dst, + struct scatterlist *src, unsigned int nbytes) { return crypt(tfm, dst, src, nbytes, - tfm->__crt_alg->cra_cipher.cia_decrypt, - ecb_process, 1, NULL); + tfm->__crt_alg->cra_cipher.cia_decrypt, + ecb_process, 1, NULL); } static int cbc_encrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, + struct scatterlist *dst, + struct scatterlist *src, unsigned int nbytes) { return crypt(tfm, dst, src, nbytes, - tfm->__crt_alg->cra_cipher.cia_encrypt, - cbc_process, 1, tfm->crt_cipher.cit_iv); + tfm->__crt_alg->cra_cipher.cia_encrypt, + cbc_process, 1, tfm->crt_cipher.cit_iv); } static int cbc_encrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes, u8 *iv) { return crypt(tfm, dst, src, nbytes, - tfm->__crt_alg->cra_cipher.cia_encrypt, - cbc_process, 1, iv); + tfm->__crt_alg->cra_cipher.cia_encrypt, + cbc_process, 1, iv); } static int cbc_decrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, + struct scatterlist *dst, + struct scatterlist *src, unsigned int nbytes) { return crypt(tfm, dst, src, nbytes, - tfm->__crt_alg->cra_cipher.cia_decrypt, - cbc_process, 0, tfm->crt_cipher.cit_iv); + tfm->__crt_alg->cra_cipher.cia_decrypt, + cbc_process, 0, tfm->crt_cipher.cit_iv); } static int cbc_decrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes, u8 *iv) { return crypt(tfm, dst, src, nbytes, - tfm->__crt_alg->cra_cipher.cia_decrypt, - cbc_process, 0, iv); + tfm->__crt_alg->cra_cipher.cia_decrypt, + cbc_process, 0, iv); } static int nocrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, + struct scatterlist *dst, + struct scatterlist *src, unsigned int nbytes) { return -ENOSYS; } static int nocrypt_iv(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes, u8 *iv) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes, u8 *iv) { return -ENOSYS; } @@ -265,25 +265,25 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm) if (ops->cit_mode == CRYPTO_TFM_MODE_CBC) { - switch (crypto_tfm_alg_blocksize(tfm)) { - case 8: - ops->cit_xor_block = xor_64; - break; + switch (crypto_tfm_alg_blocksize(tfm)) { + case 8: + ops->cit_xor_block = xor_64; + break; - case 16: - ops->cit_xor_block = xor_128; - break; + case 16: + ops->cit_xor_block = xor_128; + break; - default: - printk(KERN_WARNING "%s: block size %u not supported\n", - crypto_tfm_alg_name(tfm), - crypto_tfm_alg_blocksize(tfm)); - ret = -EINVAL; - goto out; - } + default: + printk(KERN_WARNING "%s: block size %u not supported\n", + crypto_tfm_alg_name(tfm), + crypto_tfm_alg_blocksize(tfm)); + ret = -EINVAL; + goto out; + } ops->cit_ivsize = crypto_tfm_alg_blocksize(tfm); - ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL); + ops->cit_iv = kmalloc(ops->cit_ivsize, GFP_KERNEL); if (ops->cit_iv == NULL) ret = -ENOMEM; } diff --git a/drivers/staging/rtl8192u/ieee80211/compress.c b/drivers/staging/rtl8192u/ieee80211/compress.c index c2df80e..86c23c9 100644 --- a/drivers/staging/rtl8192u/ieee80211/compress.c +++ b/drivers/staging/rtl8192u/ieee80211/compress.c @@ -20,21 +20,21 @@ #include "internal.h" static int crypto_compress(struct crypto_tfm *tfm, - const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen) + const u8 *src, unsigned int slen, + u8 *dst, unsigned int *dlen) { return tfm->__crt_alg->cra_compress.coa_compress(crypto_tfm_ctx(tfm), - src, slen, dst, - dlen); + src, slen, dst, + dlen); } static int crypto_decompress(struct crypto_tfm *tfm, - const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen) + const u8 *src, unsigned int slen, + u8 *dst, unsigned int *dlen) { return tfm->__crt_alg->cra_compress.coa_decompress(crypto_tfm_ctx(tfm), - src, slen, dst, - dlen); + src, slen, dst, + dlen); } int crypto_init_compress_flags(struct crypto_tfm *tfm, u32 flags) diff --git a/drivers/staging/rtl8192u/ieee80211/crypto_compat.h b/drivers/staging/rtl8192u/ieee80211/crypto_compat.h index 587e8bb..c7f26ff 100644 --- a/drivers/staging/rtl8192u/ieee80211/crypto_compat.h +++ b/drivers/staging/rtl8192u/ieee80211/crypto_compat.h @@ -12,9 +12,9 @@ #include <linux/crypto.h> static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); @@ -22,9 +22,9 @@ static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, - struct scatterlist *dst, - struct scatterlist *src, - unsigned int nbytes) + struct scatterlist *dst, + struct scatterlist *src, + unsigned int nbytes) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); diff --git a/drivers/staging/rtl8192u/ieee80211/digest.c b/drivers/staging/rtl8192u/ieee80211/digest.c index 1a95f2d..301ed51 100644 --- a/drivers/staging/rtl8192u/ieee80211/digest.c +++ b/drivers/staging/rtl8192u/ieee80211/digest.c @@ -25,7 +25,7 @@ static void init(struct crypto_tfm *tfm) } static void update(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg) + struct scatterlist *sg, unsigned int nsg) { unsigned int i; @@ -68,7 +68,7 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) } static void digest(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg, u8 *out) + struct scatterlist *sg, unsigned int nsg, u8 *out) { unsigned int i; @@ -77,7 +77,7 @@ static void digest(struct crypto_tfm *tfm, for (i = 0; i < nsg; i++) { char *p = crypto_kmap(sg[i].page, 0) + sg[i].offset; tfm->__crt_alg->cra_digest.dia_update(crypto_tfm_ctx(tfm), - p, sg[i].length); + p, sg[i].length); crypto_kunmap(p, 0); crypto_yield(tfm); } diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index e99c6ed..0dd7737 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -86,8 +86,8 @@ struct iw_spy_data{ * */ #define container_of(ptr, type, member) ({ \ - const typeof( ((type *)0)->member ) *__mptr = (ptr); \ - (type *)( (char *)__mptr - offsetof(type,member) );}) + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) #endif #define KEY_TYPE_NA 0x0 @@ -125,61 +125,61 @@ struct iw_spy_data{ /* defined for skb cb field */ /* At most 28 byte */ typedef struct cb_desc { - /* Tx Desc Related flags (8-9) */ + /* Tx Desc Related flags (8-9) */ u8 bLastIniPkt:1; u8 bCmdOrInit:1; - u8 bFirstSeg:1; - u8 bLastSeg:1; - u8 bEncrypt:1; - u8 bTxDisableRateFallBack:1; - u8 bTxUseDriverAssingedRate:1; - u8 bHwSec:1; //indicate whether use Hw security. WB - - u8 reserved1; - - /* Tx Firmware Relaged flags (10-11)*/ - u8 bCTSEnable:1; - u8 bRTSEnable:1; - u8 bUseShortGI:1; - u8 bUseShortPreamble:1; - u8 bTxEnableFwCalcDur:1; - u8 bAMPDUEnable:1; - u8 bRTSSTBC:1; - u8 RTSSC:1; - - u8 bRTSBW:1; - u8 bPacketBW:1; + u8 bFirstSeg:1; + u8 bLastSeg:1; + u8 bEncrypt:1; + u8 bTxDisableRateFallBack:1; + u8 bTxUseDriverAssingedRate:1; + u8 bHwSec:1; //indicate whether use Hw security. WB + + u8 reserved1; + + /* Tx Firmware Relaged flags (10-11)*/ + u8 bCTSEnable:1; + u8 bRTSEnable:1; + u8 bUseShortGI:1; + u8 bUseShortPreamble:1; + u8 bTxEnableFwCalcDur:1; + u8 bAMPDUEnable:1; + u8 bRTSSTBC:1; + u8 RTSSC:1; + + u8 bRTSBW:1; + u8 bPacketBW:1; u8 bRTSUseShortPreamble:1; u8 bRTSUseShortGI:1; u8 bMulticast:1; u8 bBroadcast:1; - //u8 reserved2:2; - u8 drv_agg_enable:1; - u8 reserved2:1; - - /* Tx Desc related element(12-19) */ - u8 rata_index; - u8 queue_index; - //u8 reserved3; - //u8 reserved4; - u16 txbuf_size; - //u8 reserved5; + //u8 reserved2:2; + u8 drv_agg_enable:1; + u8 reserved2:1; + + /* Tx Desc related element(12-19) */ + u8 rata_index; + u8 queue_index; + //u8 reserved3; + //u8 reserved4; + u16 txbuf_size; + //u8 reserved5; u8 RATRIndex; - u8 reserved6; - u8 reserved7; - u8 reserved8; - - /* Tx firmware related element(20-27) */ - u8 data_rate; - u8 rts_rate; - u8 ampdu_factor; - u8 ampdu_density; - //u8 reserved9; - //u8 reserved10; - //u8 reserved11; - u8 DrvAggrNum; + u8 reserved6; + u8 reserved7; + u8 reserved8; + + /* Tx firmware related element(20-27) */ + u8 data_rate; + u8 rts_rate; + u8 ampdu_factor; + u8 ampdu_density; + //u8 reserved9; + //u8 reserved10; + //u8 reserved11; + u8 DrvAggrNum; u16 pkt_size; - u8 reserved12; + u8 reserved12; }cb_desc, *pcb_desc; /*--------------------------Define -------------------------------------------*/ @@ -389,7 +389,7 @@ enum _ReasonCode{ typedef struct ieee_param { u32 cmd; u8 sta_addr[ETH_ALEN]; - union { + union { struct { u8 name; u32 value; @@ -399,9 +399,9 @@ typedef struct ieee_param { u8 reserved[32]; u8 data[0]; } wpa_ie; - struct{ + struct{ int command; - int reason_code; + int reason_code; } mlme; struct { u8 alg[IEEE_CRYPT_ALG_NAME_LEN]; @@ -442,23 +442,23 @@ static inline void tq_init(struct tq_struct * task, void(*func)(void *), void *d #define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000) static inline unsigned long msleep_interruptible_rsl(unsigned int msecs) { - unsigned long timeout = MSECS(msecs) + 1; + unsigned long timeout = MSECS(msecs) + 1; - while (timeout) { - set_current_state(TASK_INTERRUPTIBLE); - timeout = schedule_timeout(timeout); - } - return timeout; + while (timeout) { + set_current_state(TASK_INTERRUPTIBLE); + timeout = schedule_timeout(timeout); + } + return timeout; } #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,31)) static inline void msleep(unsigned int msecs) { - unsigned long timeout = MSECS(msecs) + 1; + unsigned long timeout = MSECS(msecs) + 1; - while (timeout) { - set_current_state(TASK_UNINTERRUPTIBLE); - timeout = schedule_timeout(timeout); - } + while (timeout) { + set_current_state(TASK_UNINTERRUPTIBLE); + timeout = schedule_timeout(timeout); + } } #endif #else @@ -559,24 +559,24 @@ static inline void msleep(unsigned int msecs) #define SN_EQUAL(a, b) (a == b) #define MAX_DEV_ADDR_SIZE 8 typedef enum _ACT_CATEGORY{ - ACT_CAT_QOS = 1, - ACT_CAT_DLS = 2, - ACT_CAT_BA = 3, - ACT_CAT_HT = 7, - ACT_CAT_WMM = 17, + ACT_CAT_QOS = 1, + ACT_CAT_DLS = 2, + ACT_CAT_BA = 3, + ACT_CAT_HT = 7, + ACT_CAT_WMM = 17, } ACT_CATEGORY, *PACT_CATEGORY; typedef enum _TS_ACTION{ - ACT_ADDTSREQ = 0, - ACT_ADDTSRSP = 1, - ACT_DELTS = 2, - ACT_SCHEDULE = 3, + ACT_ADDTSREQ = 0, + ACT_ADDTSRSP = 1, + ACT_DELTS = 2, + ACT_SCHEDULE = 3, } TS_ACTION, *PTS_ACTION; typedef enum _BA_ACTION{ - ACT_ADDBAREQ = 0, - ACT_ADDBARSP = 1, - ACT_DELBA = 2, + ACT_ADDBAREQ = 0, + ACT_ADDBARSP = 1, + ACT_DELBA = 2, } BA_ACTION, *PBA_ACTION; typedef enum _InitialGainOpType{ @@ -687,22 +687,22 @@ do { if (ieee80211_debug_level & (level)) \ /* I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.*/ #define PRINTABLE(_ch) (_ch>'!' && _ch<'~') #define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) \ - if((_Comp) & level) \ - { \ - int __i; \ - u8 buffer[MAX_STR_LEN]; \ - int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \ - memset(buffer, 0, MAX_STR_LEN); \ - memcpy(buffer, (u8 *)_Ptr, length ); \ - for( __i=0; __i<MAX_STR_LEN; __i++ ) \ - { \ - if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \ - } \ - buffer[length] = '\0'; \ - printk("Rtl819x: "); \ - printk(_TitleString); \ - printk(": %d, <%s>\n", _Len, buffer); \ - } + if((_Comp) & level) \ + { \ + int __i; \ + u8 buffer[MAX_STR_LEN]; \ + int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \ + memset(buffer, 0, MAX_STR_LEN); \ + memcpy(buffer, (u8 *)_Ptr, length ); \ + for( __i=0; __i<MAX_STR_LEN; __i++ ) \ + { \ + if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \ + } \ + buffer[length] = '\0'; \ + printk("Rtl819x: "); \ + printk(_TitleString); \ + printk(": %d, <%s>\n", _Len, buffer); \ + } #else #define IEEE80211_PRINT_STR(_Comp, _TitleString, _Ptr, _Len) do {} while (0) #endif @@ -731,10 +731,10 @@ do { if (ieee80211_debug_level & (level)) \ struct ieee80211_snap_hdr { - u8 dsap; /* always 0xAA */ - u8 ssap; /* always 0xAA */ - u8 ctrl; /* always 0x03 */ - u8 oui[P80211_OUI_LEN]; /* organizational universal id */ + u8 dsap; /* always 0xAA */ + u8 ssap; /* always 0xAA */ + u8 ctrl; /* always 0x03 */ + u8 oui[P80211_OUI_LEN]; /* organizational universal id */ } __attribute__ ((packed)); @@ -775,65 +775,65 @@ struct ieee80211_snap_hdr { /* Status codes */ enum ieee80211_statuscode { - WLAN_STATUS_SUCCESS = 0, - WLAN_STATUS_UNSPECIFIED_FAILURE = 1, - WLAN_STATUS_CAPS_UNSUPPORTED = 10, - WLAN_STATUS_REASSOC_NO_ASSOC = 11, - WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, - WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, - WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, - WLAN_STATUS_CHALLENGE_FAIL = 15, - WLAN_STATUS_AUTH_TIMEOUT = 16, - WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, - WLAN_STATUS_ASSOC_DENIED_RATES = 18, - /* 802.11b */ - WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, - WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, - WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, - /* 802.11h */ - WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, - WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, - WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, - /* 802.11g */ - WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, - WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, - /* 802.11i */ - WLAN_STATUS_INVALID_IE = 40, - WLAN_STATUS_INVALID_GROUP_CIPHER = 41, - WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, - WLAN_STATUS_INVALID_AKMP = 43, - WLAN_STATUS_UNSUPP_RSN_VERSION = 44, - WLAN_STATUS_INVALID_RSN_IE_CAP = 45, - WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, + WLAN_STATUS_SUCCESS = 0, + WLAN_STATUS_UNSPECIFIED_FAILURE = 1, + WLAN_STATUS_CAPS_UNSUPPORTED = 10, + WLAN_STATUS_REASSOC_NO_ASSOC = 11, + WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, + WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, + WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, + WLAN_STATUS_CHALLENGE_FAIL = 15, + WLAN_STATUS_AUTH_TIMEOUT = 16, + WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, + WLAN_STATUS_ASSOC_DENIED_RATES = 18, + /* 802.11b */ + WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, + WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, + WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, + /* 802.11h */ + WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, + WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, + WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, + /* 802.11g */ + WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, + WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, + /* 802.11i */ + WLAN_STATUS_INVALID_IE = 40, + WLAN_STATUS_INVALID_GROUP_CIPHER = 41, + WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, + WLAN_STATUS_INVALID_AKMP = 43, + WLAN_STATUS_UNSUPP_RSN_VERSION = 44, + WLAN_STATUS_INVALID_RSN_IE_CAP = 45, + WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, }; /* Reason codes */ enum ieee80211_reasoncode { - WLAN_REASON_UNSPECIFIED = 1, - WLAN_REASON_PREV_AUTH_NOT_VALID = 2, - WLAN_REASON_DEAUTH_LEAVING = 3, - WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, - WLAN_REASON_DISASSOC_AP_BUSY = 5, - WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, - WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, - WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, - WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, - /* 802.11h */ - WLAN_REASON_DISASSOC_BAD_POWER = 10, - WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, - /* 802.11i */ - WLAN_REASON_INVALID_IE = 13, - WLAN_REASON_MIC_FAILURE = 14, - WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, - WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, - WLAN_REASON_IE_DIFFERENT = 17, - WLAN_REASON_INVALID_GROUP_CIPHER = 18, - WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, - WLAN_REASON_INVALID_AKMP = 20, - WLAN_REASON_UNSUPP_RSN_VERSION = 21, - WLAN_REASON_INVALID_RSN_IE_CAP = 22, - WLAN_REASON_IEEE8021X_FAILED = 23, - WLAN_REASON_CIPHER_SUITE_REJECTED = 24, + WLAN_REASON_UNSPECIFIED = 1, + WLAN_REASON_PREV_AUTH_NOT_VALID = 2, + WLAN_REASON_DEAUTH_LEAVING = 3, + WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, + WLAN_REASON_DISASSOC_AP_BUSY = 5, + WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, + WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, + WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, + WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, + /* 802.11h */ + WLAN_REASON_DISASSOC_BAD_POWER = 10, + WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, + /* 802.11i */ + WLAN_REASON_INVALID_IE = 13, + WLAN_REASON_MIC_FAILURE = 14, + WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, + WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, + WLAN_REASON_IE_DIFFERENT = 17, + WLAN_REASON_INVALID_GROUP_CIPHER = 18, + WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, + WLAN_REASON_INVALID_AKMP = 20, + WLAN_REASON_UNSUPP_RSN_VERSION = 21, + WLAN_REASON_INVALID_RSN_IE_CAP = 22, + WLAN_REASON_IEEE8021X_FAILED = 23, + WLAN_REASON_CIPHER_SUITE_REJECTED = 24, }; #define IEEE80211_STATMASK_SIGNAL (1<<0) @@ -849,13 +849,13 @@ enum ieee80211_reasoncode { #define IEEE80211_52GHZ_BAND (1<<1) #define IEEE80211_CCK_RATE_LEN 4 -#define IEEE80211_CCK_RATE_1MB 0x02 -#define IEEE80211_CCK_RATE_2MB 0x04 -#define IEEE80211_CCK_RATE_5MB 0x0B -#define IEEE80211_CCK_RATE_11MB 0x16 +#define IEEE80211_CCK_RATE_1MB 0x02 +#define IEEE80211_CCK_RATE_2MB 0x04 +#define IEEE80211_CCK_RATE_5MB 0x0B +#define IEEE80211_CCK_RATE_11MB 0x16 #define IEEE80211_OFDM_RATE_LEN 8 -#define IEEE80211_OFDM_RATE_6MB 0x0C -#define IEEE80211_OFDM_RATE_9MB 0x12 +#define IEEE80211_OFDM_RATE_6MB 0x0C +#define IEEE80211_OFDM_RATE_9MB 0x12 #define IEEE80211_OFDM_RATE_12MB 0x18 #define IEEE80211_OFDM_RATE_18MB 0x24 #define IEEE80211_OFDM_RATE_24MB 0x30 @@ -877,12 +877,12 @@ enum ieee80211_reasoncode { #define IEEE80211_OFDM_RATE_48MB_MASK (1<<10) #define IEEE80211_OFDM_RATE_54MB_MASK (1<<11) -#define IEEE80211_CCK_RATES_MASK 0x0000000F +#define IEEE80211_CCK_RATES_MASK 0x0000000F #define IEEE80211_CCK_BASIC_RATES_MASK (IEEE80211_CCK_RATE_1MB_MASK | \ IEEE80211_CCK_RATE_2MB_MASK) #define IEEE80211_CCK_DEFAULT_RATES_MASK (IEEE80211_CCK_BASIC_RATES_MASK | \ - IEEE80211_CCK_RATE_5MB_MASK | \ - IEEE80211_CCK_RATE_11MB_MASK) + IEEE80211_CCK_RATE_5MB_MASK | \ + IEEE80211_CCK_RATE_11MB_MASK) #define IEEE80211_OFDM_RATES_MASK 0x00000FF0 #define IEEE80211_OFDM_BASIC_RATES_MASK (IEEE80211_OFDM_RATE_6MB_MASK | \ @@ -895,10 +895,10 @@ enum ieee80211_reasoncode { IEEE80211_OFDM_RATE_48MB_MASK | \ IEEE80211_OFDM_RATE_54MB_MASK) #define IEEE80211_DEFAULT_RATES_MASK (IEEE80211_OFDM_DEFAULT_RATES_MASK | \ - IEEE80211_CCK_DEFAULT_RATES_MASK) + IEEE80211_CCK_DEFAULT_RATES_MASK) #define IEEE80211_NUM_OFDM_RATES 8 -#define IEEE80211_NUM_CCK_RATES 4 +#define IEEE80211_NUM_CCK_RATES 4 #define IEEE80211_OFDM_SHIFT_MASK_A 4 @@ -1064,10 +1064,10 @@ struct ieee80211_device; struct ieee80211_security { u16 active_key:2, - enabled:1, + enabled:1, auth_mode:2, - auth_algo:4, - unicast_uses_group:1, + auth_algo:4, + unicast_uses_group:1, encrypt:1; u8 key_sizes[WEP_KEYS]; u8 keys[WEP_KEYS][SCM_KEY_LEN]; @@ -1089,60 +1089,60 @@ Total: 28-2340 bytes /* Management Frame Information Element Types */ enum ieee80211_mfie { - MFIE_TYPE_SSID = 0, - MFIE_TYPE_RATES = 1, - MFIE_TYPE_FH_SET = 2, - MFIE_TYPE_DS_SET = 3, - MFIE_TYPE_CF_SET = 4, - MFIE_TYPE_TIM = 5, - MFIE_TYPE_IBSS_SET = 6, - MFIE_TYPE_COUNTRY = 7, - MFIE_TYPE_HOP_PARAMS = 8, - MFIE_TYPE_HOP_TABLE = 9, - MFIE_TYPE_REQUEST = 10, - MFIE_TYPE_CHALLENGE = 16, - MFIE_TYPE_POWER_CONSTRAINT = 32, - MFIE_TYPE_POWER_CAPABILITY = 33, - MFIE_TYPE_TPC_REQUEST = 34, - MFIE_TYPE_TPC_REPORT = 35, - MFIE_TYPE_SUPP_CHANNELS = 36, - MFIE_TYPE_CSA = 37, - MFIE_TYPE_MEASURE_REQUEST = 38, - MFIE_TYPE_MEASURE_REPORT = 39, - MFIE_TYPE_QUIET = 40, - MFIE_TYPE_IBSS_DFS = 41, - MFIE_TYPE_ERP = 42, - MFIE_TYPE_RSN = 48, - MFIE_TYPE_RATES_EX = 50, - MFIE_TYPE_HT_CAP= 45, + MFIE_TYPE_SSID = 0, + MFIE_TYPE_RATES = 1, + MFIE_TYPE_FH_SET = 2, + MFIE_TYPE_DS_SET = 3, + MFIE_TYPE_CF_SET = 4, + MFIE_TYPE_TIM = 5, + MFIE_TYPE_IBSS_SET = 6, + MFIE_TYPE_COUNTRY = 7, + MFIE_TYPE_HOP_PARAMS = 8, + MFIE_TYPE_HOP_TABLE = 9, + MFIE_TYPE_REQUEST = 10, + MFIE_TYPE_CHALLENGE = 16, + MFIE_TYPE_POWER_CONSTRAINT = 32, + MFIE_TYPE_POWER_CAPABILITY = 33, + MFIE_TYPE_TPC_REQUEST = 34, + MFIE_TYPE_TPC_REPORT = 35, + MFIE_TYPE_SUPP_CHANNELS = 36, + MFIE_TYPE_CSA = 37, + MFIE_TYPE_MEASURE_REQUEST = 38, + MFIE_TYPE_MEASURE_REPORT = 39, + MFIE_TYPE_QUIET = 40, + MFIE_TYPE_IBSS_DFS = 41, + MFIE_TYPE_ERP = 42, + MFIE_TYPE_RSN = 48, + MFIE_TYPE_RATES_EX = 50, + MFIE_TYPE_HT_CAP= 45, MFIE_TYPE_HT_INFO= 61, MFIE_TYPE_AIRONET=133, - MFIE_TYPE_GENERIC = 221, - MFIE_TYPE_QOS_PARAMETER = 222, + MFIE_TYPE_GENERIC = 221, + MFIE_TYPE_QOS_PARAMETER = 222, }; /* Minimal header; can be used for passing 802.11 frames with sufficient * information to determine what type of underlying data type is actually * stored in the data. */ struct ieee80211_hdr { - __le16 frame_ctl; - __le16 duration_id; - u8 payload[0]; + __le16 frame_ctl; + __le16 duration_id; + u8 payload[0]; } __attribute__ ((packed)); struct ieee80211_hdr_1addr { - __le16 frame_ctl; - __le16 duration_id; - u8 addr1[ETH_ALEN]; - u8 payload[0]; + __le16 frame_ctl; + __le16 duration_id; + u8 addr1[ETH_ALEN]; + u8 payload[0]; } __attribute__ ((packed)); struct ieee80211_hdr_2addr { - __le16 frame_ctl; - __le16 duration_id; - u8 addr1[ETH_ALEN]; - u8 addr2[ETH_ALEN]; - u8 payload[0]; + __le16 frame_ctl; + __le16 duration_id; + u8 addr1[ETH_ALEN]; + u8 addr2[ETH_ALEN]; + u8 payload[0]; } __attribute__ ((packed)); struct ieee80211_hdr_3addr { @@ -1152,7 +1152,7 @@ struct ieee80211_hdr_3addr { u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; __le16 seq_ctl; - u8 payload[0]; + u8 payload[0]; } __attribute__ ((packed)); struct ieee80211_hdr_4addr { @@ -1163,7 +1163,7 @@ struct ieee80211_hdr_4addr { u8 addr3[ETH_ALEN]; __le16 seq_ctl; u8 addr4[ETH_ALEN]; - u8 payload[0]; + u8 payload[0]; } __attribute__ ((packed)); struct ieee80211_hdr_3addrqos { @@ -1173,7 +1173,7 @@ struct ieee80211_hdr_3addrqos { u8 addr2[ETH_ALEN]; u8 addr3[ETH_ALEN]; __le16 seq_ctl; - u8 payload[0]; + u8 payload[0]; __le16 qos_ctl; } __attribute__ ((packed)); @@ -1185,7 +1185,7 @@ struct ieee80211_hdr_4addrqos { u8 addr3[ETH_ALEN]; __le16 seq_ctl; u8 addr4[ETH_ALEN]; - u8 payload[0]; + u8 payload[0]; __le16 qos_ctl; } __attribute__ ((packed)); @@ -1205,14 +1205,14 @@ struct ieee80211_authentication { } __attribute__ ((packed)); struct ieee80211_disassoc { - struct ieee80211_hdr_3addr header; - __le16 reason; + struct ieee80211_hdr_3addr header; + __le16 reason; } __attribute__ ((packed)); struct ieee80211_probe_request { struct ieee80211_hdr_3addr header; /* SSID, supported rates */ - struct ieee80211_info_element info_element[0]; + struct ieee80211_info_element info_element[0]; } __attribute__ ((packed)); struct ieee80211_probe_response { @@ -1220,9 +1220,9 @@ struct ieee80211_probe_response { u32 time_stamp[2]; __le16 beacon_interval; __le16 capability; - /* SSID, supported rates, FH params, DS params, - * CF params, IBSS params, TIM (if beacon), RSN */ - struct ieee80211_info_element info_element[0]; + /* SSID, supported rates, FH params, DS params, + * CF params, IBSS params, TIM (if beacon), RSN */ + struct ieee80211_info_element info_element[0]; } __attribute__ ((packed)); /* Alias beacon for probe_response */ @@ -1233,7 +1233,7 @@ struct ieee80211_assoc_request_frame { __le16 capability; __le16 listen_interval; /* SSID, supported rates, RSN */ - struct ieee80211_info_element info_element[0]; + struct ieee80211_info_element info_element[0]; } __attribute__ ((packed)); struct ieee80211_reassoc_request_frame { @@ -1242,7 +1242,7 @@ struct ieee80211_reassoc_request_frame { __le16 listen_interval; u8 current_ap[ETH_ALEN]; /* SSID, supported rates, RSN */ - struct ieee80211_info_element info_element[0]; + struct ieee80211_info_element info_element[0]; } __attribute__ ((packed)); struct ieee80211_assoc_response_frame { @@ -1318,7 +1318,7 @@ typedef union _frameqos { #define NETWORK_HAS_QOS_PARAMETERS (1<<3) #define NETWORK_HAS_QOS_INFORMATION (1<<4) #define NETWORK_HAS_QOS_MASK (NETWORK_HAS_QOS_PARAMETERS | \ - NETWORK_HAS_QOS_INFORMATION) + NETWORK_HAS_QOS_INFORMATION) /* 802.11h */ #define NETWORK_HAS_POWER_CONSTRAINT (1<<5) #define NETWORK_HAS_CSA (1<<6) @@ -1338,46 +1338,46 @@ typedef union _frameqos { #define QOS_AIFSN_MIN_VALUE 2 #if 1 struct ieee80211_qos_information_element { - u8 elementID; - u8 length; - u8 qui[QOS_OUI_LEN]; - u8 qui_type; - u8 qui_subtype; - u8 version; - u8 ac_info; + u8 elementID; + u8 length; + u8 qui[QOS_OUI_LEN]; + u8 qui_type; + u8 qui_subtype; + u8 version; + u8 ac_info; } __attribute__ ((packed)); struct ieee80211_qos_ac_parameter { - u8 aci_aifsn; - u8 ecw_min_max; - __le16 tx_op_limit; + u8 aci_aifsn; + u8 ecw_min_max; + __le16 tx_op_limit; } __attribute__ ((packed)); struct ieee80211_qos_parameter_info { - struct ieee80211_qos_information_element info_element; - u8 reserved; - struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; + struct ieee80211_qos_information_element info_element; + u8 reserved; + struct ieee80211_qos_ac_parameter ac_params_record[QOS_QUEUE_NUM]; } __attribute__ ((packed)); struct ieee80211_qos_parameters { - __le16 cw_min[QOS_QUEUE_NUM]; - __le16 cw_max[QOS_QUEUE_NUM]; - u8 aifs[QOS_QUEUE_NUM]; - u8 flag[QOS_QUEUE_NUM]; - __le16 tx_op_limit[QOS_QUEUE_NUM]; + __le16 cw_min[QOS_QUEUE_NUM]; + __le16 cw_max[QOS_QUEUE_NUM]; + u8 aifs[QOS_QUEUE_NUM]; + u8 flag[QOS_QUEUE_NUM]; + __le16 tx_op_limit[QOS_QUEUE_NUM]; } __attribute__ ((packed)); struct ieee80211_qos_data { - struct ieee80211_qos_parameters parameters; - int active; - int supported; - u8 param_count; - u8 old_param_count; + struct ieee80211_qos_parameters parameters; + int active; + int supported; + u8 param_count; + u8 old_param_count; }; struct ieee80211_tim_parameters { - u8 tim_count; - u8 tim_period; + u8 tim_count; + u8 tim_period; } __attribute__ ((packed)); //#else @@ -1598,10 +1598,10 @@ struct ieee80211_network { u8 ssid[IW_ESSID_MAX_SIZE + 1]; u8 ssid_len; #if 1 - struct ieee80211_qos_data qos_data; + struct ieee80211_qos_data qos_data; #else // Qos related. Added by Annie, 2005-11-01. - BSS_QOS BssQos; + BSS_QOS BssQos; #endif //added by amy for LEAP @@ -1637,15 +1637,15 @@ struct ieee80211_network { u8 rsn_ie[MAX_WPA_IE_LEN]; size_t rsn_ie_len; - struct ieee80211_tim_parameters tim; + struct ieee80211_tim_parameters tim; u8 dtim_period; u8 dtim_data; u32 last_dtim_sta_time[2]; - //appeded for QoS - u8 wmm_info; - struct ieee80211_wmm_ac_param wmm_param[4]; - u8 QoS_Enable; + //appeded for QoS + u8 wmm_info; + struct ieee80211_wmm_ac_param wmm_param[4]; + u8 QoS_Enable; #ifdef THOMAS_TURBO u8 Turbo_Enable;//enable turbo mode, added by thomas #endif @@ -1653,7 +1653,7 @@ struct ieee80211_network { u16 CountryIeLen; u8 CountryIeBuf[MAX_IE_LEN]; #endif - // HT Related, by amy, 2008.04.29 + // HT Related, by amy, 2008.04.29 BSS_HT bssht; // Add to handle broadcom AP management frame CCK rate. bool broadcom_cap_exist; @@ -1709,13 +1709,13 @@ enum ieee80211_state { }; #else enum ieee80211_state { - IEEE80211_UNINITIALIZED = 0, - IEEE80211_INITIALIZED, - IEEE80211_ASSOCIATING, - IEEE80211_ASSOCIATED, - IEEE80211_AUTHENTICATING, - IEEE80211_AUTHENTICATED, - IEEE80211_SHUTDOWN + IEEE80211_UNINITIALIZED = 0, + IEEE80211_INITIALIZED, + IEEE80211_ASSOCIATING, + IEEE80211_ASSOCIATED, + IEEE80211_AUTHENTICATING, + IEEE80211_AUTHENTICATED, + IEEE80211_SHUTDOWN }; #endif @@ -1729,17 +1729,17 @@ enum ieee80211_state { #define IEEE80211_24GHZ_MIN_CHANNEL 1 #define IEEE80211_24GHZ_MAX_CHANNEL 14 #define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ - IEEE80211_24GHZ_MIN_CHANNEL + 1) + IEEE80211_24GHZ_MIN_CHANNEL + 1) #define IEEE80211_52GHZ_MIN_CHANNEL 34 #define IEEE80211_52GHZ_MAX_CHANNEL 165 #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ - IEEE80211_52GHZ_MIN_CHANNEL + 1) + IEEE80211_52GHZ_MIN_CHANNEL + 1) #if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11)) extern inline int is_multicast_ether_addr(const u8 *addr) { - return ((addr[0] != 0xff) && (0x01 & addr[0])); + return ((addr[0] != 0xff) && (0x01 & addr[0])); } #endif @@ -1911,7 +1911,7 @@ typedef struct _RT_LINK_DETECT_T{ struct ieee80211_device { struct net_device *dev; - struct ieee80211_security sec; + struct ieee80211_security sec; //hw security related // u8 hwsec_support; //support? @@ -2001,15 +2001,15 @@ struct ieee80211_device { int host_encrypt; int host_encrypt_msdu; int host_decrypt; - /* host performs multicast decryption */ - int host_mc_decrypt; + /* host performs multicast decryption */ + int host_mc_decrypt; - /* host should strip IV and ICV from protected frames */ - /* meaningful only when hardware decryption is being used */ - int host_strip_iv_icv; + /* host should strip IV and ICV from protected frames */ + /* meaningful only when hardware decryption is being used */ + int host_strip_iv_icv; - int host_open_frag; - int host_build_iv; + int host_open_frag; + int host_build_iv; int ieee802_1x; /* is IEEE 802.1X used */ /* WPA data */ @@ -2027,7 +2027,7 @@ struct ieee80211_device { struct ieee80211_crypt_data *crypt[WEP_KEYS]; int tx_keyidx; /* default TX key index (crypt[tx_keyidx]) */ struct timer_list crypt_deinit_timer; - int crypt_quiesced; + int crypt_quiesced; int bcrx_sta_key; /* use individual keys to override default keys even * with RX of broad/multicast frames */ @@ -2040,10 +2040,10 @@ struct ieee80211_device { #define DEFAULT_RTS_THRESHOLD 2346U #define MIN_RTS_THRESHOLD 1 #define MAX_RTS_THRESHOLD 2346U - u16 rts; /* RTS threshold */ + u16 rts; /* RTS threshold */ - /* Association info */ - u8 bssid[ETH_ALEN]; + /* Association info */ + u8 bssid[ETH_ALEN]; /* This stores infos for the current network. * Either the network we are associated in INFRASTRUCTURE @@ -2069,10 +2069,10 @@ struct ieee80211_device { */ short sync_scan_hurryup; - int perfect_rssi; - int worst_rssi; + int perfect_rssi; + int worst_rssi; - u16 prev_seq_ctl; /* used to drop duplicate frames */ + u16 prev_seq_ctl; /* used to drop duplicate frames */ /* map of allowed channels. 0 is dummy */ // FIXME: remeber to default to a basic channel plan depending of the PHY type @@ -2185,7 +2185,7 @@ struct ieee80211_device { //added by amy for AP roaming RT_LINK_DETECT_T LinkDetectInfo; - //added by amy for ps + //added by amy for ps RT_POWER_SAVE_CONTROL PowerSaveControl; //} /* used if IEEE_SOFTMAC_TX_QUEUE is set */ @@ -2197,19 +2197,19 @@ struct ieee80211_device { /* used if IEEE_SOFTMAC_BEACONS is set */ struct timer_list beacon_timer; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) - struct work_struct associate_complete_wq; - struct work_struct associate_procedure_wq; + struct work_struct associate_complete_wq; + struct work_struct associate_procedure_wq; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) - struct delayed_work softmac_scan_wq; - struct delayed_work associate_retry_wq; + struct delayed_work softmac_scan_wq; + struct delayed_work associate_retry_wq; struct delayed_work start_ibss_wq; #else - struct work_struct softmac_scan_wq; - struct work_struct associate_retry_wq; + struct work_struct softmac_scan_wq; + struct work_struct associate_retry_wq; struct work_struct start_ibss_wq; #endif - struct work_struct wx_sync_scan_wq; - struct workqueue_struct *wq; + struct work_struct wx_sync_scan_wq; + struct workqueue_struct *wq; #else /* used for periodly scan */ struct timer_list scan_timer; @@ -2323,32 +2323,32 @@ struct ieee80211_device { short (*ps_is_queue_empty) (struct net_device *dev); #if 0 /* Typical STA methods */ - int (*handle_auth) (struct net_device * dev, - struct ieee80211_auth * auth); - int (*handle_deauth) (struct net_device * dev, - struct ieee80211_deauth * auth); - int (*handle_action) (struct net_device * dev, - struct ieee80211_action * action, - struct ieee80211_rx_stats * stats); - int (*handle_disassoc) (struct net_device * dev, - struct ieee80211_disassoc * assoc); + int (*handle_auth) (struct net_device * dev, + struct ieee80211_auth * auth); + int (*handle_deauth) (struct net_device * dev, + struct ieee80211_deauth * auth); + int (*handle_action) (struct net_device * dev, + struct ieee80211_action * action, + struct ieee80211_rx_stats * stats); + int (*handle_disassoc) (struct net_device * dev, + struct ieee80211_disassoc * assoc); #endif - int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); + int (*handle_beacon) (struct net_device * dev, struct ieee80211_beacon * beacon, struct ieee80211_network * network); #if 0 - int (*handle_probe_response) (struct net_device * dev, - struct ieee80211_probe_response * resp, - struct ieee80211_network * network); - int (*handle_probe_request) (struct net_device * dev, - struct ieee80211_probe_request * req, - struct ieee80211_rx_stats * stats); + int (*handle_probe_response) (struct net_device * dev, + struct ieee80211_probe_response * resp, + struct ieee80211_network * network); + int (*handle_probe_request) (struct net_device * dev, + struct ieee80211_probe_request * req, + struct ieee80211_rx_stats * stats); #endif - int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); + int (*handle_assoc_response) (struct net_device * dev, struct ieee80211_assoc_response_frame * resp, struct ieee80211_network * network); #if 0 - /* Typical AP methods */ - int (*handle_assoc_request) (struct net_device * dev); - int (*handle_reassoc_request) (struct net_device * dev, - struct ieee80211_reassoc_request * req); + /* Typical AP methods */ + int (*handle_assoc_request) (struct net_device * dev); + int (*handle_reassoc_request) (struct net_device * dev, + struct ieee80211_reassoc_request * req); #endif /* check whether Tx hw resouce available */ @@ -2485,45 +2485,45 @@ extern inline int ieee80211_get_hdrlen(u16 fc) static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) { - switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { - case IEEE80211_1ADDR_LEN: - return ((struct ieee80211_hdr_1addr *)hdr)->payload; - case IEEE80211_2ADDR_LEN: - return ((struct ieee80211_hdr_2addr *)hdr)->payload; - case IEEE80211_3ADDR_LEN: - return ((struct ieee80211_hdr_3addr *)hdr)->payload; - case IEEE80211_4ADDR_LEN: - return ((struct ieee80211_hdr_4addr *)hdr)->payload; - } - return NULL; + switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { + case IEEE80211_1ADDR_LEN: + return ((struct ieee80211_hdr_1addr *)hdr)->payload; + case IEEE80211_2ADDR_LEN: + return ((struct ieee80211_hdr_2addr *)hdr)->payload; + case IEEE80211_3ADDR_LEN: + return ((struct ieee80211_hdr_3addr *)hdr)->payload; + case IEEE80211_4ADDR_LEN: + return ((struct ieee80211_hdr_4addr *)hdr)->payload; + } + return NULL; } static inline int ieee80211_is_ofdm_rate(u8 rate) { - switch (rate & ~IEEE80211_BASIC_RATE_MASK) { - case IEEE80211_OFDM_RATE_6MB: - case IEEE80211_OFDM_RATE_9MB: - case IEEE80211_OFDM_RATE_12MB: - case IEEE80211_OFDM_RATE_18MB: - case IEEE80211_OFDM_RATE_24MB: - case IEEE80211_OFDM_RATE_36MB: - case IEEE80211_OFDM_RATE_48MB: - case IEEE80211_OFDM_RATE_54MB: - return 1; - } - return 0; + switch (rate & ~IEEE80211_BASIC_RATE_MASK) { + case IEEE80211_OFDM_RATE_6MB: + case IEEE80211_OFDM_RATE_9MB: + case IEEE80211_OFDM_RATE_12MB: + case IEEE80211_OFDM_RATE_18MB: + case IEEE80211_OFDM_RATE_24MB: + case IEEE80211_OFDM_RATE_36MB: + case IEEE80211_OFDM_RATE_48MB: + case IEEE80211_OFDM_RATE_54MB: + return 1; + } + return 0; } static inline int ieee80211_is_cck_rate(u8 rate) { - switch (rate & ~IEEE80211_BASIC_RATE_MASK) { - case IEEE80211_CCK_RATE_1MB: - case IEEE80211_CCK_RATE_2MB: - case IEEE80211_CCK_RATE_5MB: - case IEEE80211_CCK_RATE_11MB: - return 1; - } - return 0; + switch (rate & ~IEEE80211_BASIC_RATE_MASK) { + case IEEE80211_CCK_RATE_1MB: + case IEEE80211_CCK_RATE_2MB: + case IEEE80211_CCK_RATE_5MB: + case IEEE80211_CCK_RATE_11MB: + return 1; + } + return 0; } @@ -2564,17 +2564,17 @@ extern int ieee80211_wx_get_encode(struct ieee80211_device *ieee, union iwreq_data *wrqu, char *key); #if WIRELESS_EXT >= 18 extern int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, - struct iw_request_info *info, - union iwreq_data* wrqu, char *extra); + struct iw_request_info *info, + union iwreq_data* wrqu, char *extra); extern int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, - struct iw_request_info *info, - union iwreq_data* wrqu, char *extra); + struct iw_request_info *info, + union iwreq_data* wrqu, char *extra); extern int ieee80211_wx_set_auth(struct ieee80211_device *ieee, - struct iw_request_info *info, - struct iw_param *data, char *extra); + struct iw_request_info *info, + struct iw_param *data, char *extra); extern int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra); + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra); #endif extern int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len); @@ -2731,13 +2731,13 @@ extern void RxBaInactTimeout(unsigned long data); extern void ResetBaEntry( PBA_RECORD pBA); //function in TS.c extern bool GetTs( - struct ieee80211_device* ieee, - PTS_COMMON_INFO *ppTS, - u8* Addr, - u8 TID, - TR_SELECT TxRxSelect, //Rx:1, Tx:0 - bool bAddNewTs - ); + struct ieee80211_device* ieee, + PTS_COMMON_INFO *ppTS, + u8* Addr, + u8 TID, + TR_SELECT TxRxSelect, //Rx:1, Tx:0 + bool bAddNewTs + ); extern void TSInitialize(struct ieee80211_device *ieee); extern void TsStartAddBaProcess(struct ieee80211_device* ieee, PTX_TS_RECORD pTxTS); extern void RemovePeerTS(struct ieee80211_device* ieee, u8* Addr); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c index 181edc4..0b33bf4 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c @@ -131,7 +131,7 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm, /* qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) && (WLAN_FC_GET_STYPE(fc) & 0x08)); - */ + */ // fixed by David :2006.9.6 qc_included = ((WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA) && (WLAN_FC_GET_STYPE(fc) & 0x80)); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c index 58af7c8..841b999 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c @@ -24,7 +24,7 @@ #include "ieee80211.h" #include <linux/crypto.h> - #include <linux/scatterlist.h> + #include <linux/scatterlist.h> #include <linux/crc32.h> MODULE_AUTHOR("Jouni Malinen"); @@ -382,7 +382,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) if (!tcb_desc->bHwSec) return ret; else - return 0; + return 0; } @@ -502,26 +502,26 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) } static int michael_mic(struct crypto_hash *tfm_michael, u8 * key, u8 * hdr, - u8 * data, size_t data_len, u8 * mic) + u8 * data, size_t data_len, u8 * mic) { - struct hash_desc desc; - struct scatterlist sg[2]; + struct hash_desc desc; + struct scatterlist sg[2]; - if (tfm_michael == NULL) { - printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); - return -1; - } + if (tfm_michael == NULL) { + printk(KERN_WARNING "michael_mic: tfm_michael == NULL\n"); + return -1; + } - sg_init_table(sg, 2); - sg_set_buf(&sg[0], hdr, 16); - sg_set_buf(&sg[1], data, data_len); + sg_init_table(sg, 2); + sg_set_buf(&sg[0], hdr, 16); + sg_set_buf(&sg[1], data, data_len); - if (crypto_hash_setkey(tfm_michael, key, 8)) - return -1; + if (crypto_hash_setkey(tfm_michael, key, 8)) + return -1; - desc.tfm = tfm_michael; - desc.flags = 0; - return crypto_hash_digest(&desc, sg, data_len + 16, mic); + desc.tfm = tfm_michael; + desc.flags = 0; + return crypto_hash_digest(&desc, sg, data_len + 16, mic); } static void michael_mic_hdr(struct sk_buff *skb, u8 *hdr) @@ -630,7 +630,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx, if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr, skb->data + hdr_len, skb->len - 8 - hdr_len, mic)) - return -1; + return -1; if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) { struct ieee80211_hdr_4addr *hdr; hdr = (struct ieee80211_hdr_4addr *) skb->data; @@ -760,7 +760,7 @@ static struct ieee80211_crypto_ops ieee80211_crypt_tkip = { .print_stats = ieee80211_tkip_print_stats, .extra_prefix_len = 4 + 4, /* IV + ExtIV */ .extra_postfix_len = 8 + 4, /* MIC + ICV */ - .owner = THIS_MODULE, + .owner = THIS_MODULE, }; int __init ieee80211_crypto_tkip_init(void) @@ -776,5 +776,5 @@ void __exit ieee80211_crypto_tkip_exit(void) void ieee80211_tkip_null(void) { // printk("============>%s()\n", __FUNCTION__); - return; + return; } diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c index 39c74d1..61ad11c 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c @@ -34,8 +34,8 @@ struct prism2_wep_data { u8 key[WEP_KEY_LEN + 1]; u8 key_len; u8 key_idx; - struct crypto_blkcipher *tx_tfm; - struct crypto_blkcipher *rx_tfm; + struct crypto_blkcipher *tx_tfm; + struct crypto_blkcipher *rx_tfm; }; @@ -50,19 +50,19 @@ static void * prism2_wep_init(int keyidx) priv->key_idx = keyidx; priv->tx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); - if (IS_ERR(priv->tx_tfm)) { - printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " - "crypto API arc4\n"); - priv->tx_tfm = NULL; - goto fail; - } - priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); - if (IS_ERR(priv->rx_tfm)) { - printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " - "crypto API arc4\n"); - priv->rx_tfm = NULL; - goto fail; - } + if (IS_ERR(priv->tx_tfm)) { + printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " + "crypto API arc4\n"); + priv->tx_tfm = NULL; + goto fail; + } + priv->rx_tfm = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); + if (IS_ERR(priv->rx_tfm)) { + printk(KERN_DEBUG "ieee80211_crypt_wep: could not allocate " + "crypto API arc4\n"); + priv->rx_tfm = NULL; + goto fail; + } /* start WEP IV from a random value */ get_random_bytes(&priv->iv, 4); @@ -71,12 +71,12 @@ static void * prism2_wep_init(int keyidx) fail: if (priv) { - if (priv->tx_tfm) - crypto_free_blkcipher(priv->tx_tfm); - if (priv->rx_tfm) - crypto_free_blkcipher(priv->rx_tfm); - kfree(priv); - } + if (priv->tx_tfm) + crypto_free_blkcipher(priv->tx_tfm); + if (priv->rx_tfm) + crypto_free_blkcipher(priv->rx_tfm); + kfree(priv); + } return NULL; } @@ -87,11 +87,11 @@ static void prism2_wep_deinit(void *priv) struct prism2_wep_data *_priv = priv; if (_priv) { - if (_priv->tx_tfm) - crypto_free_blkcipher(_priv->tx_tfm); - if (_priv->rx_tfm) - crypto_free_blkcipher(_priv->rx_tfm); - } + if (_priv->tx_tfm) + crypto_free_blkcipher(_priv->tx_tfm); + if (_priv->rx_tfm) + crypto_free_blkcipher(_priv->rx_tfm); + } kfree(priv); } @@ -293,5 +293,5 @@ void __exit ieee80211_crypto_wep_exit(void) void ieee80211_wep_null(void) { // printk("============>%s()\n", __FUNCTION__); - return; + return; } diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index c3383bb..bbaec94 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -150,11 +150,11 @@ struct net_device *alloc_ieee80211(int sizeof_priv) atomic_set(&(ieee->atm_swbw), 0); ieee->wpax_type_set = 0; - ieee->wpa_enabled = 0; - ieee->tkip_countermeasures = 0; - ieee->drop_unencrypted = 0; - ieee->privacy_invoked = 0; - ieee->ieee802_1x = 1; + ieee->wpa_enabled = 0; + ieee->tkip_countermeasures = 0; + ieee->drop_unencrypted = 0; + ieee->privacy_invoked = 0; + ieee->ieee802_1x = 1; ieee->raw_tx = 0; //ieee->hwsec_support = 1; //defalt support hw security. //use module_param instead. ieee->hwsec_active = 0; //disable hwsec, switch it on when necessary. diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 7792aa8..1629b0f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -133,14 +133,14 @@ void ieee80211_WMM_Info(struct ieee80211_device *ieee, u8 **tag_p) { void ieee80211_TURBO_Info(struct ieee80211_device *ieee, u8 **tag_p) { u8 *tag = *tag_p; - *tag++ = MFIE_TYPE_GENERIC; //0 - *tag++ = 7; - *tag++ = 0x00; - *tag++ = 0xe0; - *tag++ = 0x4c; - *tag++ = 0x01;//5 - *tag++ = 0x02; - *tag++ = 0x11; + *tag++ = MFIE_TYPE_GENERIC; //0 + *tag++ = 7; + *tag++ = 0x00; + *tag++ = 0xe0; + *tag++ = 0x4c; + *tag++ = 0x01;//5 + *tag++ = 0x02; + *tag++ = 0x11; *tag++ = 0x00; *tag_p = tag; @@ -238,9 +238,9 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee tcb_desc->queue_index = MGNT_QUEUE; tcb_desc->data_rate = MgntQuery_MgntFrameTxRate(ieee); - tcb_desc->RATRIndex = 7; - tcb_desc->bTxDisableRateFallBack = 1; - tcb_desc->bTxUseDriverAssingedRate = 1; + tcb_desc->RATRIndex = 7; + tcb_desc->bTxDisableRateFallBack = 1; + tcb_desc->bTxUseDriverAssingedRate = 1; if(single){ if(ieee->queue_stop){ @@ -525,8 +525,8 @@ void ieee80211_softmac_scan(struct ieee80211_device *ieee) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) void ieee80211_softmac_scan_wq(struct work_struct *work) { - struct delayed_work *dwork = container_of(work, struct delayed_work, work); - struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq); + struct delayed_work *dwork = container_of(work, struct delayed_work, work); + struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq); #else void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) { @@ -546,7 +546,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) { //if current channel is not in channel map, set to default channel. #ifdef ENABLE_DOT11D - if (!channel_map[ieee->current_network.channel]); + if (!channel_map[ieee->current_network.channel]); #else if (!ieee->channel_map[ieee->current_network.channel]); #endif @@ -554,7 +554,7 @@ void ieee80211_softmac_scan_wq(struct ieee80211_device *ieee) goto out; /* no good chans */ } #ifdef ENABLE_DOT11D - }while(!channel_map[ieee->current_network.channel]); + }while(!channel_map[ieee->current_network.channel]); #else }while(!ieee->channel_map[ieee->current_network.channel]); #endif @@ -582,7 +582,7 @@ out: if(IS_DOT11D_ENABLE(ieee)) DOT11D_ScanComplete(ieee); #endif - ieee->actscanning = false; + ieee->actscanning = false; watchdog = 0; ieee->scanning = 0; up(&ieee->scan_sem); @@ -619,7 +619,7 @@ void ieee80211_beacons_stop(struct ieee80211_device *ieee) spin_lock_irqsave(&ieee->beacon_lock,flags); ieee->beacon_txing = 0; - del_timer_sync(&ieee->beacon_timer); + del_timer_sync(&ieee->beacon_timer); spin_unlock_irqrestore(&ieee->beacon_lock,flags); @@ -807,12 +807,12 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d erp_len = 0; #else if((ieee->current_network.mode == IEEE_G) - ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) { - erp_len = 3; + ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) { + erp_len = 3; erpinfo_content = 0; if(ieee->current_network.buseprotection) erpinfo_content |= ERP_UseProtection; - } + } else erp_len = 0; #endif @@ -833,12 +833,12 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt); - if(pHTInfo->bRegRT2RTAggregation) - { - tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer; + if(pHTInfo->bRegRT2RTAggregation) + { + tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer; tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer); HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len); - } + } // 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); #endif beacon_size = sizeof(struct ieee80211_probe_response)+2+ @@ -848,7 +848,7 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d +rate_ex_len +atim_len +erp_len - +wpa_ie_len + +wpa_ie_len // +tmp_ht_cap_len // +tmp_ht_info_len // +tmp_generic_ie_len @@ -1187,7 +1187,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco + wpa_ie_len + wmm_info_len + turbo_info_len - + ht_cap_len + + ht_cap_len + realtek_ie_len + ckip_ie_len + ccxrm_ie_len @@ -1199,7 +1199,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco + rate_len//rates tagged val + wpa_ie_len + wmm_info_len - + ht_cap_len + + ht_cap_len + realtek_ie_len + ckip_ie_len + ccxrm_ie_len @@ -1235,7 +1235,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco if(ieee->short_slot) hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_SHORT_SLOT); - if (wmm_info_len) //QOS + if (wmm_info_len) //QOS hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS); hdr->listen_interval = 0xa; //FIXME @@ -1304,7 +1304,7 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco memcpy(tag,osCcxVerNum.Octet,osCcxVerNum.Length); tag += osCcxVerNum.Length; } - //HT cap element + //HT cap element if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){ if(ieee->pHTInfo->ePeerHTSpecVer != HT_SPEC_VER_EWC) { @@ -1329,9 +1329,9 @@ inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beaco } #ifdef THOMAS_TURBO tag = skb_put(skb,turbo_info_len); - if(turbo_info_len) { - ieee80211_TURBO_Info(ieee, &tag); - } + if(turbo_info_len) { + ieee80211_TURBO_Info(ieee, &tag); + } #endif if(ieee->pHTInfo->bCurrentHTSupport&&ieee->pHTInfo->bEnableHT){ @@ -1382,7 +1382,7 @@ void ieee80211_associate_abort(struct ieee80211_device *ieee) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) queue_delayed_work(ieee->wq, &ieee->associate_retry_wq, \ - IEEE80211_SOFTMAC_ASSOC_RETRY_TIME); + IEEE80211_SOFTMAC_ASSOC_RETRY_TIME); #else schedule_task(&ieee->associate_retry_wq); #endif @@ -1482,7 +1482,7 @@ void ieee80211_associate_step2(struct ieee80211_device *ieee) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) void ieee80211_associate_complete_wq(struct work_struct *work) { - struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq); + struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_complete_wq); #else void ieee80211_associate_complete_wq(struct ieee80211_device *ieee) { @@ -1567,7 +1567,7 @@ void ieee80211_associate_complete(struct ieee80211_device *ieee) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) void ieee80211_associate_procedure_wq(struct work_struct *work) { - struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq); + struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, associate_procedure_wq); #else void ieee80211_associate_procedure_wq(struct ieee80211_device *ieee) { @@ -1623,7 +1623,7 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee if ( /* if the user set the AP check if match. - * if the network does not broadcast essid we check the user supplyed ANY essid + * if the network does not broadcast essid we check the user supplyed ANY essid * if the network does broadcast and the user does not set essid it is OK * if the network does broadcast and the user did set essid chech if essid match */ @@ -1837,8 +1837,8 @@ static inline u16 assoc_parse(struct ieee80211_device *ieee, struct sk_buff *skb status_code==WLAN_STATUS_CAPS_UNSUPPORTED)&& ((ieee->mode == IEEE_G) && (ieee->current_network.mode == IEEE_N_24G) && - (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { - ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE; + (ieee->AsocRetryCount++ < (RT_ASOC_RETRY_LIMIT-1)))) { + ieee->pHTInfo->IOTAction |= HT_IOT_ACT_PURE_N_MODE; }else { ieee->AsocRetryCount = 0; } @@ -2535,8 +2535,8 @@ void ieee80211_start_monitor_mode(struct ieee80211_device *ieee) void ieee80211_start_ibss_wq(struct work_struct *work) { - struct delayed_work *dwork = container_of(work, struct delayed_work, work); - struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq); + struct delayed_work *dwork = container_of(work, struct delayed_work, work); + struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, start_ibss_wq); #else void ieee80211_start_ibss_wq(struct ieee80211_device *ieee) { @@ -2843,7 +2843,7 @@ void ieee80211_softmac_start_protocol(struct ieee80211_device *ieee) void ieee80211_start_protocol(struct ieee80211_device *ieee) { short ch = 0; - int i = 0; + int i = 0; if (ieee->proto_started) return; @@ -2867,7 +2867,7 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee) // printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel); // ieee->set_chan(ieee->dev,ieee->current_network.channel); - for(i = 0; i < 17; i++) { + for(i = 0; i < 17; i++) { ieee->last_rxseq_num[i] = -1; ieee->last_rxfrag_num[i] = -1; ieee->last_packet_time[i] = 0; @@ -2915,7 +2915,7 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee) //added for AP roaming ieee->LinkDetectInfo.SlotNum = 2; ieee->LinkDetectInfo.NumRecvBcnInPeriod=0; - ieee->LinkDetectInfo.NumRecvDataInPeriod=0; + ieee->LinkDetectInfo.NumRecvDataInPeriod=0; ieee->assoc_id = 0; ieee->queue_stop = 0; @@ -2968,12 +2968,12 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee) #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) - INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq); - INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq); - INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq); - INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq); - INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq); - INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq); + INIT_DELAYED_WORK(&ieee->start_ibss_wq,ieee80211_start_ibss_wq); + INIT_WORK(&ieee->associate_complete_wq, ieee80211_associate_complete_wq); + INIT_WORK(&ieee->associate_procedure_wq, ieee80211_associate_procedure_wq); + INIT_DELAYED_WORK(&ieee->softmac_scan_wq,ieee80211_softmac_scan_wq); + INIT_DELAYED_WORK(&ieee->associate_retry_wq, ieee80211_associate_retry_wq); + INIT_WORK(&ieee->wx_sync_scan_wq,ieee80211_wx_sync_scan_wq); #else INIT_WORK(&ieee->start_ibss_wq,(void(*)(void*)) ieee80211_start_ibss_wq,ieee); @@ -3165,7 +3165,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v .flags = SEC_ENABLED, .enabled = value, }; - ieee->drop_unencrypted = value; + ieee->drop_unencrypted = value; /* We only change SEC_LEVEL for open mode. Others * are set by ipw_wpa_set_encryption. */ diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c index b96acf5..d395fc6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c @@ -316,7 +316,7 @@ out: #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20) void ieee80211_wx_sync_scan_wq(struct work_struct *work) { - struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); + struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq); #else void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee) { @@ -641,7 +641,7 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee, } if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) - wrqu->power.flags |= IW_POWER_ALL_R; + wrqu->power.flags |= IW_POWER_ALL_R; else if (ieee->ps & IEEE80211_PS_MBCAST) wrqu->power.flags |= IW_POWER_MULTICAST_R; else diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index 118dfe1..3b248cd 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -56,18 +56,18 @@ struct modes_unit ieee80211_modes[] = { #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20)) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) static inline char * iwe_stream_add_event_rsl(char * stream, /* Stream of events */ - char * ends, /* End of stream */ - struct iw_event *iwe, /* Payload */ - int event_len) /* Real size of payload */ + char * ends, /* End of stream */ + struct iw_event *iwe, /* Payload */ + int event_len) /* Real size of payload */ { - /* Check if it's possible */ - if((stream + event_len) < ends) { - iwe->len = event_len; + /* Check if it's possible */ + if((stream + event_len) < ends) { + iwe->len = event_len; ndelay(1); //new - memcpy(stream, (char *) iwe, event_len); - stream += event_len; - } - return stream; + memcpy(stream, (char *) iwe, event_len); + stream += event_len; + } + return stream; } #else #define iwe_stream_add_event_rsl iwe_stream_add_event @@ -75,9 +75,9 @@ iwe_stream_add_event_rsl(char * stream, /* Stream of events */ #define MAX_CUSTOM_LEN 64 static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, - char *start, char *stop, + char *start, char *stop, struct ieee80211_network *network, - struct iw_request_info *info) + struct iw_request_info *info) { char custom[MAX_CUSTOM_LEN]; char proto_name[IFNAMSIZ]; @@ -106,18 +106,18 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, if (network->ssid_len == 0) { iwe.u.data.length = sizeof("<hidden>"); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>"); + start = iwe_stream_add_point(info, start, stop, &iwe, "<hidden>"); #else - start = iwe_stream_add_point(start, stop, &iwe, "<hidden>"); + start = iwe_stream_add_point(start, stop, &iwe, "<hidden>"); #endif - } else { + } else { iwe.u.data.length = min(network->ssid_len, (u8)32); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); + start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); #else - start = iwe_stream_add_point(start, stop, &iwe, network->ssid); + start = iwe_stream_add_point(start, stop, &iwe, network->ssid); #endif - } + } /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; for(i=0; i<(sizeof(ieee80211_modes)/sizeof(ieee80211_modes[0])); i++) { @@ -129,26 +129,26 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, *pname = '\0'; snprintf(iwe.u.name, IFNAMSIZ, "IEEE802.11%s", proto_name); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN); + start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_CHAR_LEN); #else - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN); + start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_CHAR_LEN); #endif - /* Add mode */ - iwe.cmd = SIOCGIWMODE; - if (network->capability & + /* Add mode */ + iwe.cmd = SIOCGIWMODE; + if (network->capability & (WLAN_CAPABILITY_BSS | WLAN_CAPABILITY_IBSS)) { if (network->capability & WLAN_CAPABILITY_BSS) iwe.u.mode = IW_MODE_MASTER; else iwe.u.mode = IW_MODE_ADHOC; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN); + start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_UINT_LEN); #else - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN); + start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_UINT_LEN); #endif - } + } - /* Add frequency/channel */ + /* Add frequency/channel */ iwe.cmd = SIOCGIWFREQ; /* iwe.u.freq.m = ieee80211_frequency(network->channel, network->mode); iwe.u.freq.e = 3; */ @@ -156,9 +156,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.freq.e = 0; iwe.u.freq.i = 0; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN); + start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_FREQ_LEN); #else - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN); + start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_FREQ_LEN); #endif /* Add encryption capability */ iwe.cmd = SIOCGIWENCODE; @@ -168,9 +168,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.data.flags = IW_ENCODE_DISABLED; iwe.u.data.length = 0; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); + start = iwe_stream_add_point(info, start, stop, &iwe, network->ssid); #else - start = iwe_stream_add_point(start, stop, &iwe, network->ssid); + start = iwe_stream_add_point(start, stop, &iwe, network->ssid); #endif /* Add basic and extended rates */ max_rate = 0; @@ -228,19 +228,19 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.bitrate.fixed = iwe.u.bitrate.disabled = 0; iwe.u.bitrate.value = max_rate * 500000; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_event_rsl(info, start, stop, &iwe, + start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_PARAM_LEN); #else - start = iwe_stream_add_event_rsl(start, stop, &iwe, + start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_PARAM_LEN); #endif iwe.cmd = IWEVCUSTOM; iwe.u.data.length = p - custom; if (iwe.u.data.length) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, custom); + start = iwe_stream_add_point(info, start, stop, &iwe, custom); #else - start = iwe_stream_add_point(start, stop, &iwe, custom); + start = iwe_stream_add_point(start, stop, &iwe, custom); #endif /* Add quality statistics */ /* TODO: Fix these values... */ @@ -257,9 +257,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.qual.updated |= IW_QUAL_QUAL_INVALID; iwe.u.qual.updated = 7; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN); + start = iwe_stream_add_event_rsl(info, start, stop, &iwe, IW_EV_QUAL_LEN); #else - start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN); + start = iwe_stream_add_event_rsl(start, stop, &iwe, IW_EV_QUAL_LEN); #endif iwe.cmd = IWEVCUSTOM; p = custom; @@ -267,9 +267,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.data.length = p - custom; if (iwe.u.data.length) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, custom); + start = iwe_stream_add_point(info, start, stop, &iwe, custom); #else - start = iwe_stream_add_point(start, stop, &iwe, custom); + start = iwe_stream_add_point(start, stop, &iwe, custom); #endif #if (WIRELESS_EXT < 18) if (ieee->wpa_enabled && network->wpa_ie_len){ @@ -285,11 +285,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.cmd = IWEVCUSTOM; iwe.u.data.length = strlen(buf); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, buf); + start = iwe_stream_add_point(info, start, stop, &iwe, buf); #else - start = iwe_stream_add_point(start, stop, &iwe, buf); + start = iwe_stream_add_point(start, stop, &iwe, buf); #endif - } + } if (ieee->wpa_enabled && network->rsn_ie_len){ char buf[MAX_WPA_IE_LEN * 2 + 30]; @@ -304,11 +304,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.cmd = IWEVCUSTOM; iwe.u.data.length = strlen(buf); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, buf); + start = iwe_stream_add_point(info, start, stop, &iwe, buf); #else - start = iwe_stream_add_point(start, stop, &iwe, buf); + start = iwe_stream_add_point(start, stop, &iwe, buf); #endif - } + } #else memset(&iwe, 0, sizeof(iwe)); if (network->wpa_ie_len) @@ -318,11 +318,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.cmd = IWEVGENIE; iwe.u.data.length = network->wpa_ie_len; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, buf); + start = iwe_stream_add_point(info, start, stop, &iwe, buf); #else - start = iwe_stream_add_point(start, stop, &iwe, buf); + start = iwe_stream_add_point(start, stop, &iwe, buf); #endif - } + } memset(&iwe, 0, sizeof(iwe)); if (network->rsn_ie_len) { @@ -331,11 +331,11 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.cmd = IWEVGENIE; iwe.u.data.length = network->rsn_ie_len; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, buf); + start = iwe_stream_add_point(info, start, stop, &iwe, buf); #else - start = iwe_stream_add_point(start, stop, &iwe, buf); + start = iwe_stream_add_point(start, stop, &iwe, buf); #endif - } + } #endif @@ -348,9 +348,9 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, iwe.u.data.length = p - custom; if (iwe.u.data.length) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) - start = iwe_stream_add_point(info, start, stop, &iwe, custom); + start = iwe_stream_add_point(info, start, stop, &iwe, custom); #else - start = iwe_stream_add_point(start, stop, &iwe, custom); + start = iwe_stream_add_point(start, stop, &iwe, custom); #endif return start; @@ -516,7 +516,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, key, escape_essid(sec.keys[key], len), erq->length, len); sec.key_sizes[key] = len; - (*crypt)->ops->set_key(sec.keys[key], len, NULL, + (*crypt)->ops->set_key(sec.keys[key], len, NULL, (*crypt)->priv); sec.flags |= (1 << key); /* This ensures a key will be activated if no key is @@ -634,192 +634,192 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee, } #if (WIRELESS_EXT >= 18) int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { int ret = 0; #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) struct net_device *dev = ieee->dev; - struct iw_point *encoding = &wrqu->encoding; - struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; - int i, idx; - int group_key = 0; - const char *alg, *module; - struct ieee80211_crypto_ops *ops; - struct ieee80211_crypt_data **crypt; - - struct ieee80211_security sec = { - .flags = 0, - }; + struct iw_point *encoding = &wrqu->encoding; + struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; + int i, idx; + int group_key = 0; + const char *alg, *module; + struct ieee80211_crypto_ops *ops; + struct ieee80211_crypt_data **crypt; + + struct ieee80211_security sec = { + .flags = 0, + }; //printk("======>encoding flag:%x,ext flag:%x, ext alg:%d\n", encoding->flags,ext->ext_flags, ext->alg); - idx = encoding->flags & IW_ENCODE_INDEX; - if (idx) { - if (idx < 1 || idx > WEP_KEYS) - return -EINVAL; - idx--; - } else - idx = ieee->tx_keyidx; + idx = encoding->flags & IW_ENCODE_INDEX; + if (idx) { + if (idx < 1 || idx > WEP_KEYS) + return -EINVAL; + idx--; + } else + idx = ieee->tx_keyidx; - if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { + if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY) { - crypt = &ieee->crypt[idx]; + crypt = &ieee->crypt[idx]; - group_key = 1; - } else { - /* some Cisco APs use idx>0 for unicast in dynamic WEP */ + group_key = 1; + } else { + /* some Cisco APs use idx>0 for unicast in dynamic WEP */ //printk("not group key, flags:%x, ext->alg:%d\n", ext->ext_flags, ext->alg); - if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP) - return -EINVAL; - if (ieee->iw_mode == IW_MODE_INFRA) + if (idx != 0 && ext->alg != IW_ENCODE_ALG_WEP) + return -EINVAL; + if (ieee->iw_mode == IW_MODE_INFRA) - crypt = &ieee->crypt[idx]; + crypt = &ieee->crypt[idx]; - else - return -EINVAL; - } + else + return -EINVAL; + } - sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT; - if ((encoding->flags & IW_ENCODE_DISABLED) || - ext->alg == IW_ENCODE_ALG_NONE) { - if (*crypt) - ieee80211_crypt_delayed_deinit(ieee, crypt); + sec.flags |= SEC_ENABLED;// | SEC_ENCRYPT; + if ((encoding->flags & IW_ENCODE_DISABLED) || + ext->alg == IW_ENCODE_ALG_NONE) { + if (*crypt) + ieee80211_crypt_delayed_deinit(ieee, crypt); - for (i = 0; i < WEP_KEYS; i++) + for (i = 0; i < WEP_KEYS; i++) if (ieee->crypt[i] != NULL) - break; + break; - if (i == WEP_KEYS) { - sec.enabled = 0; - // sec.encrypt = 0; - sec.level = SEC_LEVEL_0; - sec.flags |= SEC_LEVEL; - } + if (i == WEP_KEYS) { + sec.enabled = 0; + // sec.encrypt = 0; + sec.level = SEC_LEVEL_0; + sec.flags |= SEC_LEVEL; + } //printk("disabled: flag:%x\n", encoding->flags); - goto done; - } + goto done; + } sec.enabled = 1; // sec.encrypt = 1; #if 0 - if (group_key ? !ieee->host_mc_decrypt : - !(ieee->host_encrypt || ieee->host_decrypt || - ieee->host_encrypt_msdu)) - goto skip_host_crypt; + if (group_key ? !ieee->host_mc_decrypt : + !(ieee->host_encrypt || ieee->host_decrypt || + ieee->host_encrypt_msdu)) + goto skip_host_crypt; #endif - switch (ext->alg) { - case IW_ENCODE_ALG_WEP: - alg = "WEP"; - module = "ieee80211_crypt_wep"; - break; - case IW_ENCODE_ALG_TKIP: - alg = "TKIP"; - module = "ieee80211_crypt_tkip"; - break; - case IW_ENCODE_ALG_CCMP: - alg = "CCMP"; - module = "ieee80211_crypt_ccmp"; - break; - default: - IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", - dev->name, ext->alg); - ret = -EINVAL; - goto done; - } + switch (ext->alg) { + case IW_ENCODE_ALG_WEP: + alg = "WEP"; + module = "ieee80211_crypt_wep"; + break; + case IW_ENCODE_ALG_TKIP: + alg = "TKIP"; + module = "ieee80211_crypt_tkip"; + break; + case IW_ENCODE_ALG_CCMP: + alg = "CCMP"; + module = "ieee80211_crypt_ccmp"; + break; + default: + IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", + dev->name, ext->alg); + ret = -EINVAL; + goto done; + } printk("alg name:%s\n",alg); ops = ieee80211_get_crypto_ops(alg); - if (ops == NULL) { - request_module(module); - ops = ieee80211_get_crypto_ops(alg); - } - if (ops == NULL) { - IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", - dev->name, ext->alg); + if (ops == NULL) { + request_module(module); + ops = ieee80211_get_crypto_ops(alg); + } + if (ops == NULL) { + IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", + dev->name, ext->alg); printk("========>unknown crypto alg %d\n", ext->alg); - ret = -EINVAL; - goto done; - } + ret = -EINVAL; + goto done; + } - if (*crypt == NULL || (*crypt)->ops != ops) { - struct ieee80211_crypt_data *new_crypt; + if (*crypt == NULL || (*crypt)->ops != ops) { + struct ieee80211_crypt_data *new_crypt; - ieee80211_crypt_delayed_deinit(ieee, crypt); + ieee80211_crypt_delayed_deinit(ieee, crypt); #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)) - new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); + new_crypt = kzalloc(sizeof(*new_crypt), GFP_KERNEL); #else - new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); + new_crypt = kmalloc(sizeof(*new_crypt), GFP_KERNEL); memset(new_crypt,0,sizeof(*new_crypt)); #endif - if (new_crypt == NULL) { - ret = -ENOMEM; - goto done; - } - new_crypt->ops = ops; - if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) - new_crypt->priv = new_crypt->ops->init(idx); - if (new_crypt->priv == NULL) { - kfree(new_crypt); - ret = -EINVAL; - goto done; - } - *crypt = new_crypt; - - } - - if (ext->key_len > 0 && (*crypt)->ops->set_key && - (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq, - (*crypt)->priv) < 0) { - IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name); + if (new_crypt == NULL) { + ret = -ENOMEM; + goto done; + } + new_crypt->ops = ops; + if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) + new_crypt->priv = new_crypt->ops->init(idx); + if (new_crypt->priv == NULL) { + kfree(new_crypt); + ret = -EINVAL; + goto done; + } + *crypt = new_crypt; + + } + + if (ext->key_len > 0 && (*crypt)->ops->set_key && + (*crypt)->ops->set_key(ext->key, ext->key_len, ext->rx_seq, + (*crypt)->priv) < 0) { + IEEE80211_DEBUG_WX("%s: key setting failed\n", dev->name); printk("key setting failed\n"); - ret = -EINVAL; - goto done; - } + ret = -EINVAL; + goto done; + } #if 1 //skip_host_crypt: //printk("skip_host_crypt:ext_flags:%x\n", ext->ext_flags); - if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { - ieee->tx_keyidx = idx; - sec.active_key = idx; - sec.flags |= SEC_ACTIVE_KEY; - } - - if (ext->alg != IW_ENCODE_ALG_NONE) { - //memcpy(sec.keys[idx], ext->key, ext->key_len); - sec.key_sizes[idx] = ext->key_len; - sec.flags |= (1 << idx); - if (ext->alg == IW_ENCODE_ALG_WEP) { - // sec.encode_alg[idx] = SEC_ALG_WEP; - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_1; - } else if (ext->alg == IW_ENCODE_ALG_TKIP) { - // sec.encode_alg[idx] = SEC_ALG_TKIP; - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_2; - } else if (ext->alg == IW_ENCODE_ALG_CCMP) { - // sec.encode_alg[idx] = SEC_ALG_CCMP; - sec.flags |= SEC_LEVEL; - sec.level = SEC_LEVEL_3; - } - /* Don't set sec level for group keys. */ - if (group_key) - sec.flags &= ~SEC_LEVEL; - } + if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) { + ieee->tx_keyidx = idx; + sec.active_key = idx; + sec.flags |= SEC_ACTIVE_KEY; + } + + if (ext->alg != IW_ENCODE_ALG_NONE) { + //memcpy(sec.keys[idx], ext->key, ext->key_len); + sec.key_sizes[idx] = ext->key_len; + sec.flags |= (1 << idx); + if (ext->alg == IW_ENCODE_ALG_WEP) { + // sec.encode_alg[idx] = SEC_ALG_WEP; + sec.flags |= SEC_LEVEL; + sec.level = SEC_LEVEL_1; + } else if (ext->alg == IW_ENCODE_ALG_TKIP) { + // sec.encode_alg[idx] = SEC_ALG_TKIP; + sec.flags |= SEC_LEVEL; + sec.level = SEC_LEVEL_2; + } else if (ext->alg == IW_ENCODE_ALG_CCMP) { + // sec.encode_alg[idx] = SEC_ALG_CCMP; + sec.flags |= SEC_LEVEL; + sec.level = SEC_LEVEL_3; + } + /* Don't set sec level for group keys. */ + if (group_key) + sec.flags &= ~SEC_LEVEL; + } #endif done: - if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); + if (ieee->set_security) + ieee->set_security(ieee->dev, &sec); if (ieee->reset_on_keychange && - ieee->iw_mode != IW_MODE_INFRA && - ieee->reset_port && ieee->reset_port(dev)) { - IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); - return -EINVAL; - } + ieee->iw_mode != IW_MODE_INFRA && + ieee->reset_port && ieee->reset_port(dev)) { + IEEE80211_DEBUG_WX("%s: reset_port failed\n", dev->name); + return -EINVAL; + } #endif - return ret; + return ret; } int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, @@ -878,46 +878,46 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, } int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, - struct iw_request_info *info, - union iwreq_data *wrqu, char *extra) + struct iw_request_info *info, + union iwreq_data *wrqu, char *extra) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) struct iw_mlme *mlme = (struct iw_mlme *) extra; switch (mlme->cmd) { - case IW_MLME_DEAUTH: + case IW_MLME_DEAUTH: case IW_MLME_DISASSOC: ieee80211_disassociate(ieee); break; default: - return -EOPNOTSUPP; - } + return -EOPNOTSUPP; + } #endif return 0; } int ieee80211_wx_set_auth(struct ieee80211_device *ieee, - struct iw_request_info *info, - struct iw_param *data, char *extra) + struct iw_request_info *info, + struct iw_param *data, char *extra) { #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0) switch (data->flags & IW_AUTH_INDEX) { - case IW_AUTH_WPA_VERSION: + case IW_AUTH_WPA_VERSION: /*need to support wpa2 here*/ //printk("wpa version:%x\n", data->value); break; - case IW_AUTH_CIPHER_PAIRWISE: - case IW_AUTH_CIPHER_GROUP: - case IW_AUTH_KEY_MGMT: - /* + case IW_AUTH_CIPHER_PAIRWISE: + case IW_AUTH_CIPHER_GROUP: + case IW_AUTH_KEY_MGMT: + /* * * Host AP driver does not use these parameters and allows * * wpa_supplicant to control them internally. * */ - break; - case IW_AUTH_TKIP_COUNTERMEASURES: - ieee->tkip_countermeasures = data->value; - break; - case IW_AUTH_DROP_UNENCRYPTED: - ieee->drop_unencrypted = data->value; + break; + case IW_AUTH_TKIP_COUNTERMEASURES: + ieee->tkip_countermeasures = data->value; + break; + case IW_AUTH_DROP_UNENCRYPTED: + ieee->drop_unencrypted = data->value; break; case IW_AUTH_80211_AUTH_ALG: @@ -949,13 +949,13 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee, #endif case IW_AUTH_RX_UNENCRYPTED_EAPOL: - ieee->ieee802_1x = data->value; + ieee->ieee802_1x = data->value; break; case IW_AUTH_PRIVACY_INVOKED: ieee->privacy_invoked = data->value; break; default: - return -EOPNOTSUPP; + return -EOPNOTSUPP; } #endif return 0; diff --git a/drivers/staging/rtl8192u/ieee80211/proc.c b/drivers/staging/rtl8192u/ieee80211/proc.c index 4f3f9ed..6eda928 100644 --- a/drivers/staging/rtl8192u/ieee80211/proc.c +++ b/drivers/staging/rtl8192u/ieee80211/proc.c @@ -73,7 +73,7 @@ static int c_show(struct seq_file *m, void *p) seq_printf(m, "type : digest\n"); seq_printf(m, "blocksize : %u\n", alg->cra_blocksize); seq_printf(m, "digestsize : %u\n", - alg->cra_digest.dia_digestsize); + alg->cra_digest.dia_digestsize); break; case CRYPTO_ALG_TYPE_COMPRESS: seq_printf(m, "type : compression\n"); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index 992b718..cde603f 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -437,7 +437,7 @@ extern u8 MCS_FILTER_1SS[16]; // MCS Bw 40 {1~7, 12~15,32} #define RATE_ADPT_1SS_MASK 0xFF -#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily +#define RATE_ADPT_2SS_MASK 0xF0 //Skip MCS8~11 because mcs7 > mcs6, 9, 10, 11. 2007.01.16 by Emily #define RATE_ADPT_MCS32_MASK 0x01 #define IS_11N_MCS_RATE(rate) (rate&0x80) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index 87074ee..7c0e489 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -361,11 +361,11 @@ bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee) (net->ralink_cap_exist)) retValue = true; else if((memcmp(net->bssid, UNKNOWN_BORADCOM, 3)==0) || - (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| - (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| - (memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) || - (net->broadcom_cap_exist)) - retValue = true; + (memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0)|| + (memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3)==0)|| + (memcmp(net->bssid, NETGEAR834Bv2_BROADCOM, 3)==0) || + (net->broadcom_cap_exist)) + retValue = true; else if(net->bssht.bdRT2RTAggregation) retValue = true; else @@ -425,7 +425,7 @@ u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr) // Apply for 819u only #if (HAL_CODE_BASE==RTL8192 && DEV_BUS_TYPE==USB_INTERFACE) if((memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || - (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) + (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) ) { ret = 1; @@ -569,8 +569,8 @@ u8 HTIOTActIsCCDFsync(u8* PeerMacAddr) { u8 retValue = 0; if( (memcmp(PeerMacAddr, UNKNOWN_BORADCOM, 3)==0) || - (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) || - (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0)) + (memcmp(PeerMacAddr, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3)==0) || + (memcmp(PeerMacAddr, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ==0)) { retValue = 1; } @@ -648,7 +648,7 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u //MAC HT parameters info - // TODO: Nedd to take care of this part + // TODO: Nedd to take care of this part IEEE80211_DEBUG(IEEE80211_DL_HT, "TX HT cap/info ele BW=%d MaxAMSDUSize:%d DssCCk:%d\n", pCapELE->ChlWidth, pCapELE->MaxAMSDUSize, pCapELE->DssCCk); if( IsEncrypt) @@ -1662,7 +1662,7 @@ void HTSetConnectBwMode(struct ieee80211_device* ieee, HT_CHANNEL_WIDTH Bandwidt //if in half N mode, set to 20M bandwidth please 09.08.2008 WB. if(Bandwidth==HT_CHANNEL_WIDTH_20_40 && (!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev))) { - // Handle Illegal extention channel offset!! + // Handle Illegal extention channel offset!! if(ieee->current_network.channel<2 && Offset==HT_EXTCHNL_OFFSET_LOWER) Offset = HT_EXTCHNL_OFFSET_NO_EXT; if(Offset==HT_EXTCHNL_OFFSET_UPPER || Offset==HT_EXTCHNL_OFFSET_LOWER) { diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h index f7b882b..7ecfe68 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h @@ -647,18 +647,18 @@ typedef struct _QOS_TSTREAM{ // 802.11 Management frame Status Code field //---------------------------------------------------------------------------- typedef struct _OCTET_STRING{ - u8 *Octet; - u16 Length; + u8 *Octet; + u16 Length; }OCTET_STRING, *POCTET_STRING; #if 0 #define FillOctetString(_os,_octet,_len) \ - (_os).Octet=(u8 *)(_octet); \ - (_os).Length=(_len); + (_os).Octet=(u8 *)(_octet); \ + (_os).Length=(_len); #define WMM_ELEM_HDR_LEN 6 #define WMMElemSkipHdr(_osWMMElem) \ - (_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \ - (_osWMMElem).Length -= WMM_ELEM_HDR_LEN; + (_osWMMElem).Octet += WMM_ELEM_HDR_LEN; \ + (_osWMMElem).Length -= WMM_ELEM_HDR_LEN; #endif // // STA QoS data. diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 5aa4c8d..ecf24b9 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -509,31 +509,31 @@ void RemoveTsEntry( if(timer_pending(&pRxTS->RxPktPendingTimer)) del_timer_sync(&pRxTS->RxPktPendingTimer); - while(!list_empty(&pRxTS->RxPendingPktList)) - { - // PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK); - spin_lock_irqsave(&(ieee->reorder_spinlock), flags); - //pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); + while(!list_empty(&pRxTS->RxPendingPktList)) + { + // PlatformAcquireSpinLock(Adapter, RT_RX_SPINLOCK); + spin_lock_irqsave(&(ieee->reorder_spinlock), flags); + //pRxReorderEntry = list_entry(&pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); pRxReorderEntry = (PRX_REORDER_ENTRY)list_entry(pRxTS->RxPendingPktList.prev,RX_REORDER_ENTRY,List); - list_del_init(&pRxReorderEntry->List); - { - int i = 0; - struct ieee80211_rxb * prxb = pRxReorderEntry->prxb; + list_del_init(&pRxReorderEntry->List); + { + int i = 0; + struct ieee80211_rxb * prxb = pRxReorderEntry->prxb; if (unlikely(!prxb)) { spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); return; } - for(i =0; i < prxb->nr_subframes; i++) { - dev_kfree_skb(prxb->subframes[i]); - } - kfree(prxb); - prxb = NULL; - } - list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); - //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); - spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); - } + for(i =0; i < prxb->nr_subframes; i++) { + dev_kfree_skb(prxb->subframes[i]); + } + kfree(prxb); + prxb = NULL; + } + list_add_tail(&pRxReorderEntry->List,&ieee->RxReorder_Unused_List); + //PlatformReleaseSpinLock(Adapter, RT_RX_SPINLOCK); + spin_unlock_irqrestore(&(ieee->reorder_spinlock), flags); + } //#endif } |