diff options
Diffstat (limited to 'drivers/staging/rtl8192u/ieee80211')
21 files changed, 626 insertions, 658 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/Makefile b/drivers/staging/rtl8192u/ieee80211/Makefile index 51effd6412ac..b5d0c2eb045b 100644 --- a/drivers/staging/rtl8192u/ieee80211/Makefile +++ b/drivers/staging/rtl8192u/ieee80211/Makefile @@ -25,4 +25,3 @@ obj-m +=ieee80211_crypt-rsl.o obj-m +=ieee80211_crypt_wep-rsl.o obj-m +=ieee80211_crypt_tkip-rsl.o obj-m +=ieee80211_crypt_ccmp-rsl.o - diff --git a/drivers/staging/rtl8192u/ieee80211/aes.c b/drivers/staging/rtl8192u/ieee80211/aes.c index a6bb6c9207d3..abc1023cef65 100644 --- a/drivers/staging/rtl8192u/ieee80211/aes.c +++ b/drivers/staging/rtl8192u/ieee80211/aes.c @@ -443,7 +443,7 @@ 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_setkey = aes_set_key, .cia_encrypt = aes_encrypt, .cia_decrypt = aes_decrypt } @@ -466,4 +466,3 @@ module_exit(aes_fini); MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); MODULE_LICENSE("Dual BSD/GPL"); - diff --git a/drivers/staging/rtl8192u/ieee80211/arc4.c b/drivers/staging/rtl8192u/ieee80211/arc4.c index e3ad8d2f415e..b790e9ad104c 100644 --- a/drivers/staging/rtl8192u/ieee80211/arc4.c +++ b/drivers/staging/rtl8192u/ieee80211/arc4.c @@ -79,7 +79,7 @@ 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_setkey = arc4_set_key, .cia_encrypt = arc4_crypt, .cia_decrypt = arc4_crypt } } }; diff --git a/drivers/staging/rtl8192u/ieee80211/crypto_compat.h b/drivers/staging/rtl8192u/ieee80211/crypto_compat.h index da486588f1c0..2ba374a64178 100644 --- a/drivers/staging/rtl8192u/ieee80211/crypto_compat.h +++ b/drivers/staging/rtl8192u/ieee80211/crypto_compat.h @@ -56,5 +56,3 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, } //EXPORT_SYMBOL_GPL(crypto_alloc_tfm); //EXPORT_SYMBOL_GPL(crypto_free_tfm); - - diff --git a/drivers/staging/rtl8192u/ieee80211/dot11d.c b/drivers/staging/rtl8192u/ieee80211/dot11d.c index ce63fc341c6e..f10fd5a93c38 100644 --- a/drivers/staging/rtl8192u/ieee80211/dot11d.c +++ b/drivers/staging/rtl8192u/ieee80211/dot11d.c @@ -218,4 +218,3 @@ EXPORT_SYMBOL(DOT11D_GetMaxTxPwrInDbm); EXPORT_SYMBOL(DOT11D_ScanComplete); EXPORT_SYMBOL(IsLegalChannel); EXPORT_SYMBOL(ToLegalChannel); - diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index 502bfdbcc84b..210898c8e66c 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -64,7 +64,7 @@ #endif #define KEY_TYPE_NA 0x0 -#define KEY_TYPE_WEP40 0x1 +#define KEY_TYPE_WEP40 0x1 #define KEY_TYPE_TKIP 0x2 #define KEY_TYPE_CCMP 0x4 #define KEY_TYPE_WEP104 0x5 @@ -195,21 +195,21 @@ enum _ReasonCode{ auth_not_valid = 0x2, deauth_lv_ss = 0x3, inactivity = 0x4, - ap_overload = 0x5, + ap_overload = 0x5, class2_err = 0x6, class3_err = 0x7, - disas_lv_ss = 0x8, + disas_lv_ss = 0x8, asoc_not_auth = 0x9, //----MIC_CHECK - mic_failure = 0xe, + mic_failure = 0xe, //----END MIC_CHECK // Reason code defined in 802.11i D10.0 p.28. invalid_IE = 0x0d, four_way_tmout = 0x0f, two_way_tmout = 0x10, - IE_dismatch = 0x11, + IE_dismatch = 0x11, invalid_Gcipher = 0x12, invalid_Pcipher = 0x13, invalid_AKMP = 0x14, @@ -222,7 +222,7 @@ enum _ReasonCode{ QoS_unspec = 0x20, // 32 QAP_bandwidth = 0x21, // 33 poor_condition = 0x22, // 34 - no_facility = 0x23, // 35 + no_facility = 0x23, // 35 // Where is 36??? req_declined = 0x25, // 37 invalid_param = 0x26, // 38 @@ -265,7 +265,7 @@ enum _ReasonCode{ #define IEEE_WPAX_USEGROUP 0 #define IEEE_WPAX_WEP40 1 #define IEEE_WPAX_TKIP 2 -#define IEEE_WPAX_WRAP 3 +#define IEEE_WPAX_WRAP 3 #define IEEE_WPAX_CCMP 4 #define IEEE_WPAX_WEP104 5 @@ -289,12 +289,12 @@ enum _ReasonCode{ #define MAX_IE_LEN 0xff // added for kernel conflict -#define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl -#define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl -#define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl -#define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl +#define ieee80211_crypt_deinit_entries ieee80211_crypt_deinit_entries_rsl +#define ieee80211_crypt_deinit_handler ieee80211_crypt_deinit_handler_rsl +#define ieee80211_crypt_delayed_deinit ieee80211_crypt_delayed_deinit_rsl +#define ieee80211_register_crypto_ops ieee80211_register_crypto_ops_rsl #define ieee80211_unregister_crypto_ops ieee80211_unregister_crypto_ops_rsl -#define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl +#define ieee80211_get_crypto_ops ieee80211_get_crypto_ops_rsl #define ieee80211_ccmp_null ieee80211_ccmp_null_rsl @@ -302,10 +302,10 @@ enum _ReasonCode{ #define ieee80211_wep_null ieee80211_wep_null_rsl -#define free_ieee80211 free_ieee80211_rsl -#define alloc_ieee80211 alloc_ieee80211_rsl +#define free_ieee80211 free_ieee80211_rsl +#define alloc_ieee80211 alloc_ieee80211_rsl -#define ieee80211_rx ieee80211_rx_rsl +#define ieee80211_rx ieee80211_rx_rsl #define ieee80211_rx_mgt ieee80211_rx_mgt_rsl #define ieee80211_get_beacon ieee80211_get_beacon_rsl @@ -450,7 +450,7 @@ typedef struct ieee_param { /* management */ #define IEEE80211_STYPE_ASSOC_REQ 0x0000 -#define IEEE80211_STYPE_ASSOC_RESP 0x0010 +#define IEEE80211_STYPE_ASSOC_RESP 0x0010 #define IEEE80211_STYPE_REASSOC_REQ 0x0020 #define IEEE80211_STYPE_REASSOC_RESP 0x0030 #define IEEE80211_STYPE_PROBE_REQ 0x0040 @@ -536,7 +536,7 @@ do { if (ieee80211_debug_level & (level)) \ //if you want print DATA buffer related BA, please set ieee80211_debug_level to DATA|BA #define IEEE80211_DEBUG_DATA(level, data, datalen) \ do{ if ((ieee80211_debug_level & (level)) == (level)) \ - { \ + { \ int i; \ u8* pdata = (u8*) data; \ printk(KERN_DEBUG "ieee80211: %s()\n", __FUNCTION__); \ @@ -623,20 +623,20 @@ do { if (ieee80211_debug_level & (level)) \ #define MAX_STR_LEN 64 /* 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) \ +#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 ); \ + 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] = '?'; \ + if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \ } \ buffer[length] = '\0'; \ - printk("Rtl819x: "); \ + printk("Rtl819x: "); \ printk(_TitleString); \ printk(": %d, <%s>\n", _Len, buffer); \ } @@ -785,12 +785,12 @@ enum ieee80211_reasoncode { #define IEEE80211_24GHZ_BAND (1<<0) #define IEEE80211_52GHZ_BAND (1<<1) -#define IEEE80211_CCK_RATE_LEN 4 +#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_OFDM_RATE_LEN 8 +#define IEEE80211_OFDM_RATE_LEN 8 #define IEEE80211_OFDM_RATE_6MB 0x0C #define IEEE80211_OFDM_RATE_9MB 0x12 #define IEEE80211_OFDM_RATE_12MB 0x18 @@ -919,10 +919,10 @@ struct ieee80211_rx_stats { u16 fraglength; // FragLength should equal to PacketLength in non-fragment case u16 fragoffset; // Data offset for this fragment u16 ntotalfrag; - bool bisrxaggrsubframe; + bool bisrxaggrsubframe; bool bPacketBeacon; //cosa add for rssi bool bToSelfBA; //cosa add for rssi - char cck_adc_pwdb[4]; //cosa add for rx path selection + char cck_adc_pwdb[4]; //cosa add for rx path selection u16 Seq_Num; }; @@ -992,7 +992,7 @@ struct ieee80211_device; #define SEC_ALG_TKIP 2 #define SEC_ALG_CCMP 3 -#define WEP_KEYS 4 +#define WEP_KEYS 4 #define WEP_KEY_LEN 13 #define SCM_KEY_LEN 32 #define SCM_TEMPORAL_KEY_LENGTH 16 @@ -1205,7 +1205,7 @@ struct ieee80211_drv_agg_txb { struct sk_buff *tx_agg_frames[MAX_TX_AGG_COUNT]; }__attribute__((packed)); -#define MAX_SUBFRAME_COUNT 64 +#define MAX_SUBFRAME_COUNT 64 struct ieee80211_rxb { u8 nr_subframes; struct sk_buff *subframes[MAX_SUBFRAME_COUNT]; @@ -1534,7 +1534,7 @@ struct ieee80211_network { bool bWithAironetIE; bool bCkipSupported; bool bCcxRmEnable; - u16 CcxRmState[2]; + u16 CcxRmState[2]; // CCXv4 S59, MBSSID. bool bMBssidValid; u8 MBssidMask; @@ -1655,8 +1655,7 @@ typedef struct tx_pending_t{ struct ieee80211_txb *txb; }tx_pending_t; -typedef struct _bandwidth_autoswitch -{ +typedef struct _bandwidth_autoswitch { long threshold_20Mhzto40Mhz; long threshold_40Mhzto20Mhz; bool bforced_tx20Mhz; @@ -1668,8 +1667,7 @@ typedef struct _bandwidth_autoswitch #define REORDER_WIN_SIZE 128 #define REORDER_ENTRY_NUM 128 -typedef struct _RX_REORDER_ENTRY -{ +typedef struct _RX_REORDER_ENTRY { struct list_head List; u16 SeqNum; struct ieee80211_rxb* prxb; @@ -1709,15 +1707,13 @@ typedef struct _IbssParms{ #define MAX_NUM_RATES 264 // Max num of support rates element: 8, Max num of ext. support rate: 255. 061122, by rcnjko. // RF state. -typedef enum _RT_RF_POWER_STATE -{ +typedef enum _RT_RF_POWER_STATE { eRfOn, eRfSleep, eRfOff }RT_RF_POWER_STATE; -typedef struct _RT_POWER_SAVE_CONTROL -{ +typedef struct _RT_POWER_SAVE_CONTROL { // // Inactive Power Save(IPS) : Disable RF when disconnected @@ -1726,7 +1722,7 @@ typedef struct _RT_POWER_SAVE_CONTROL bool bIPSModeBackup; bool bSwRfProcessing; RT_RF_POWER_STATE eInactivePowerState; - struct work_struct InactivePsWorkItem; + struct work_struct InactivePsWorkItem; struct timer_list InactivePsTimer; // Return point for join action @@ -1837,11 +1833,11 @@ struct ieee80211_device { u8 HTHighestOperaRate; //wb added for rate operation mode to firmware u8 bTxDisableRateFallBack; - u8 bTxUseDriverAssingedRate; + u8 bTxUseDriverAssingedRate; atomic_t atm_chnlop; atomic_t atm_swbw; // u8 HTHighestOperaRate; -// u8 HTCurrentOperaRate; +// u8 HTCurrentOperaRate; // 802.11e and WMM Traffic Stream Info (TX) struct list_head Tx_TS_Admit_List; @@ -2055,9 +2051,9 @@ struct ieee80211_device { bool bdynamic_txpower_enable; bool bCTSToSelfEnable; - u8 CTSToSelfTH; + u8 CTSToSelfTH; - u32 fsync_time_interval; + u32 fsync_time_interval; u32 fsync_rate_bitmap; u8 fsync_rssi_threshold; bool bfsync_enable; @@ -2092,10 +2088,10 @@ struct ieee80211_device { struct delayed_work start_ibss_wq; struct work_struct wx_sync_scan_wq; struct workqueue_struct *wq; - // Qos related. Added by Annie, 2005-11-01. - //STA_QOS StaQos; + // Qos related. Added by Annie, 2005-11-01. + //STA_QOS StaQos; - //u32 STA_EDCA_PARAM[4]; + //u32 STA_EDCA_PARAM[4]; //CHANNEL_ACCESS_SETTING ChannelAccessSetting; @@ -2111,11 +2107,11 @@ struct ieee80211_device { struct net_device *dev); int (*reset_port)(struct net_device *dev); - int (*is_queue_full) (struct net_device * dev, int pri); + int (*is_queue_full) (struct net_device * dev, int pri); - int (*handle_management) (struct net_device * dev, - struct ieee80211_network * network, u16 type); - int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); + int (*handle_management) (struct net_device * dev, + struct ieee80211_network * network, u16 type); + int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); /* Softmac-generated frames (management) are TXed via this * callback if the flag IEEE_SOFTMAC_SINGLE_QUEUE is @@ -2214,7 +2210,7 @@ struct ieee80211_device { #define IEEE_A (1<<0) #define IEEE_B (1<<1) #define IEEE_G (1<<2) -#define IEEE_N_24G (1<<4) +#define IEEE_N_24G (1<<4) #define IEEE_N_5G (1<<5) #define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 82d4bf6a86a5..76c56e5aed79 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -220,7 +220,7 @@ void free_ieee80211(struct net_device *dev) #ifdef CONFIG_IEEE80211_DEBUG -u32 ieee80211_debug_level = 0; +u32 ieee80211_debug_level; static int debug = \ // IEEE80211_DL_INFO | // IEEE80211_DL_WX | @@ -233,15 +233,15 @@ static int debug = \ // IEEE80211_DL_TX | // IEEE80211_DL_RX | //IEEE80211_DL_QOS | - // IEEE80211_DL_HT | + // IEEE80211_DL_HT | // IEEE80211_DL_TS | -// IEEE80211_DL_BA | +// IEEE80211_DL_BA | // IEEE80211_DL_REORDER| // IEEE80211_DL_TRACE | //IEEE80211_DL_DATA | IEEE80211_DL_ERR //awayls open this flags to show error out ; -struct proc_dir_entry *ieee80211_proc = NULL; +struct proc_dir_entry *ieee80211_proc; static int show_debug_level(char *page, char **start, off_t offset, int count, int *eof, void *data) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index e3cf7a45b900..ee7ce5fca462 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -52,7 +52,7 @@ static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee, u16 fc = le16_to_cpu(hdr->frame_ctl); skb->dev = ieee->dev; - skb_reset_mac_header(skb); + skb_reset_mac_header(skb); skb_pull(skb, ieee80211_get_hdrlen(fc)); skb->pkt_type = PACKET_OTHERHOST; @@ -218,16 +218,16 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, * this is not mandatory.... but seems that the probe * response parser uses it */ - struct ieee80211_hdr_3addr * hdr = (struct ieee80211_hdr_3addr *)skb->data; + struct ieee80211_hdr_3addr * hdr = (struct ieee80211_hdr_3addr *)skb->data; rx_stats->len = skb->len; ieee80211_rx_mgt(ieee,(struct ieee80211_hdr_4addr *)skb->data,rx_stats); - //if ((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, ieee->current_network.bssid, ETH_ALEN))) - if ((memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN)))//use ADDR1 to perform address matching for Management frames - { - dev_kfree_skb_any(skb); - return 0; - } + //if ((ieee->state == IEEE80211_LINKED) && (memcmp(hdr->addr3, ieee->current_network.bssid, ETH_ALEN))) + if ((memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN)))//use ADDR1 to perform address matching for Management frames + { + dev_kfree_skb_any(skb); + return 0; + } ieee80211_rx_frame_softmac(ieee, skb, rx_stats, type, stype); @@ -608,7 +608,7 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, u16 SeqNum) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - PRX_REORDER_ENTRY pReorderEntry = NULL; + PRX_REORDER_ENTRY pReorderEntry = NULL; struct ieee80211_rxb* prxbIndicateArray[REORDER_WIN_SIZE]; u8 WinSize = pHTInfo->RxReorderWinSize; u16 WinEnd = (pTS->RxIndicateSeq + WinSize -1)%4096; @@ -773,7 +773,7 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, } u8 parse_subframe(struct sk_buff *skb, - struct ieee80211_rx_stats *rx_stats, + struct ieee80211_rx_stats *rx_stats, struct ieee80211_rxb *rxb,u8* src,u8* dst) { struct ieee80211_hdr_3addr *hdr = (struct ieee80211_hdr_3addr* )skb->data; @@ -1043,7 +1043,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, { // IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pRxTS->RxLastFragNum is %d,frag is %d,pRxTS->RxLastSeqNum is %d,seq is %d\n",__FUNCTION__,pRxTS->RxLastFragNum,frag,pRxTS->RxLastSeqNum,WLAN_GET_SEQ_SEQ(sc)); - if( (fc & (1<<11)) && + if( (fc & (1<<11)) && (frag == pRxTS->RxLastFragNum) && (WLAN_GET_SEQ_SEQ(sc) == pRxTS->RxLastSeqNum) ) { @@ -1154,8 +1154,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, type, stype, skb->len); goto rx_dropped; } - if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN)) - goto rx_dropped; + if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN)) + goto rx_dropped; /* skb: hdr + (possibly fragmented, possibly encrypted) payload */ @@ -1402,19 +1402,19 @@ static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 }; * the right values */ static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element - *info_element, int sub_type) + *info_element, int sub_type) { - if (info_element->qui_subtype != sub_type) - return -1; - if (memcmp(info_element->qui, qos_oui, QOS_OUI_LEN)) - return -1; - if (info_element->qui_type != QOS_OUI_TYPE) - return -1; - if (info_element->version != QOS_VERSION_1) - return -1; + if (info_element->qui_subtype != sub_type) + return -1; + if (memcmp(info_element->qui, qos_oui, QOS_OUI_LEN)) + return -1; + if (info_element->qui_type != QOS_OUI_TYPE) + return -1; + if (info_element->version != QOS_VERSION_1) + return -1; - return 0; + return 0; } @@ -1422,56 +1422,56 @@ static int ieee80211_verify_qos_info(struct ieee80211_qos_information_element * Parse a QoS parameter element */ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info - *element_param, struct ieee80211_info_element - *info_element) + *element_param, struct ieee80211_info_element + *info_element) { - int ret = 0; - u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2; - - if ((info_element == NULL) || (element_param == NULL)) - return -1; - - if (info_element->id == QOS_ELEMENT_ID && info_element->len == size) { - memcpy(element_param->info_element.qui, info_element->data, - info_element->len); - element_param->info_element.elementID = info_element->id; - element_param->info_element.length = info_element->len; - } else - ret = -1; - if (ret == 0) - ret = ieee80211_verify_qos_info(&element_param->info_element, - QOS_OUI_PARAM_SUB_TYPE); - return ret; + int ret = 0; + u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2; + + if ((info_element == NULL) || (element_param == NULL)) + return -1; + + if (info_element->id == QOS_ELEMENT_ID && info_element->len == size) { + memcpy(element_param->info_element.qui, info_element->data, + info_element->len); + element_param->info_element.elementID = info_element->id; + element_param->info_element.length = info_element->len; + } else + ret = -1; + if (ret == 0) + ret = ieee80211_verify_qos_info(&element_param->info_element, + QOS_OUI_PARAM_SUB_TYPE); + return ret; } /* * Parse a QoS information element */ static int ieee80211_read_qos_info_element(struct - ieee80211_qos_information_element - *element_info, struct ieee80211_info_element - *info_element) + ieee80211_qos_information_element + *element_info, struct ieee80211_info_element + *info_element) { - int ret = 0; - u16 size = sizeof(struct ieee80211_qos_information_element) - 2; - - if (element_info == NULL) - return -1; - if (info_element == NULL) - return -1; - - if ((info_element->id == QOS_ELEMENT_ID) && (info_element->len == size)) { - memcpy(element_info->qui, info_element->data, - info_element->len); - element_info->elementID = info_element->id; - element_info->length = info_element->len; - } else - ret = -1; - - if (ret == 0) - ret = ieee80211_verify_qos_info(element_info, - QOS_OUI_INFO_SUB_TYPE); - return ret; + int ret = 0; + u16 size = sizeof(struct ieee80211_qos_information_element) - 2; + + if (element_info == NULL) + return -1; + if (info_element == NULL) + return -1; + + if ((info_element->id == QOS_ELEMENT_ID) && (info_element->len == size)) { + memcpy(element_info->qui, info_element->data, + info_element->len); + element_info->elementID = info_element->id; + element_info->length = info_element->len; + } else + ret = -1; + + if (ret == 0) + ret = ieee80211_verify_qos_info(element_info, + QOS_OUI_INFO_SUB_TYPE); + return ret; } @@ -1479,39 +1479,39 @@ static int ieee80211_read_qos_info_element(struct * Write QoS parameters from the ac parameters. */ static int ieee80211_qos_convert_ac_to_parameters(struct - ieee80211_qos_parameter_info - *param_elm, struct - ieee80211_qos_parameters - *qos_param) + ieee80211_qos_parameter_info + *param_elm, struct + ieee80211_qos_parameters + *qos_param) { - int rc = 0; - int i; - struct ieee80211_qos_ac_parameter *ac_params; + int rc = 0; + int i; + struct ieee80211_qos_ac_parameter *ac_params; u8 aci; - //u8 cw_min; - //u8 cw_max; + //u8 cw_min; + //u8 cw_max; - for (i = 0; i < QOS_QUEUE_NUM; i++) { - ac_params = &(param_elm->ac_params_record[i]); + for (i = 0; i < QOS_QUEUE_NUM; i++) { + ac_params = &(param_elm->ac_params_record[i]); aci = (ac_params->aci_aifsn & 0x60) >> 5; if(aci >= QOS_QUEUE_NUM) continue; - qos_param->aifs[aci] = (ac_params->aci_aifsn) & 0x0f; + qos_param->aifs[aci] = (ac_params->aci_aifsn) & 0x0f; /* WMM spec P.11: The minimum value for AIFSN shall be 2 */ - qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2:qos_param->aifs[aci]; + qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 2:qos_param->aifs[aci]; - qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F; + qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F; - qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4; + qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4; - qos_param->flag[aci] = - (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00; - qos_param->tx_op_limit[aci] = le16_to_cpu(ac_params->tx_op_limit); - } - return rc; + qos_param->flag[aci] = + (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00; + qos_param->tx_op_limit[aci] = le16_to_cpu(ac_params->tx_op_limit); + } + return rc; } /* @@ -1520,38 +1520,38 @@ static int ieee80211_qos_convert_ac_to_parameters(struct * which type to read */ static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element - *info_element, - struct ieee80211_network *network) + *info_element, + struct ieee80211_network *network) { - int rc = 0; - struct ieee80211_qos_parameters *qos_param = NULL; - struct ieee80211_qos_information_element qos_info_element; - - rc = ieee80211_read_qos_info_element(&qos_info_element, info_element); - - if (rc == 0) { - network->qos_data.param_count = qos_info_element.ac_info & 0x0F; - network->flags |= NETWORK_HAS_QOS_INFORMATION; - } else { - struct ieee80211_qos_parameter_info param_element; - - rc = ieee80211_read_qos_param_element(¶m_element, - info_element); - if (rc == 0) { - qos_param = &(network->qos_data.parameters); - ieee80211_qos_convert_ac_to_parameters(¶m_element, - qos_param); - network->flags |= NETWORK_HAS_QOS_PARAMETERS; - network->qos_data.param_count = - param_element.info_element.ac_info & 0x0F; - } - } - - if (rc == 0) { - IEEE80211_DEBUG_QOS("QoS is supported\n"); - network->qos_data.supported = 1; - } - return rc; + int rc = 0; + struct ieee80211_qos_parameters *qos_param = NULL; + struct ieee80211_qos_information_element qos_info_element; + + rc = ieee80211_read_qos_info_element(&qos_info_element, info_element); + + if (rc == 0) { + network->qos_data.param_count = qos_info_element.ac_info & 0x0F; + network->flags |= NETWORK_HAS_QOS_INFORMATION; + } else { + struct ieee80211_qos_parameter_info param_element; + + rc = ieee80211_read_qos_param_element(¶m_element, + info_element); + if (rc == 0) { + qos_param = &(network->qos_data.parameters); + ieee80211_qos_convert_ac_to_parameters(¶m_element, + qos_param); + network->flags |= NETWORK_HAS_QOS_PARAMETERS; + network->qos_data.param_count = + param_element.info_element.ac_info & 0x0F; + } + } + + if (rc == 0) { + IEEE80211_DEBUG_QOS("QoS is supported\n"); + network->qos_data.supported = 1; + } + return rc; } #ifdef CONFIG_IEEE80211_DEBUG @@ -1559,37 +1559,37 @@ static int ieee80211_parse_qos_info_param_IE(struct ieee80211_info_element static const char *get_info_element_string(u16 id) { - switch (id) { - MFIE_STRING(SSID); - MFIE_STRING(RATES); - MFIE_STRING(FH_SET); - MFIE_STRING(DS_SET); - MFIE_STRING(CF_SET); - MFIE_STRING(TIM); - MFIE_STRING(IBSS_SET); - MFIE_STRING(COUNTRY); - MFIE_STRING(HOP_PARAMS); - MFIE_STRING(HOP_TABLE); - MFIE_STRING(REQUEST); - MFIE_STRING(CHALLENGE); - MFIE_STRING(POWER_CONSTRAINT); - MFIE_STRING(POWER_CAPABILITY); - MFIE_STRING(TPC_REQUEST); - MFIE_STRING(TPC_REPORT); - MFIE_STRING(SUPP_CHANNELS); - MFIE_STRING(CSA); - MFIE_STRING(MEASURE_REQUEST); - MFIE_STRING(MEASURE_REPORT); - MFIE_STRING(QUIET); - MFIE_STRING(IBSS_DFS); - // MFIE_STRING(ERP_INFO); - MFIE_STRING(RSN); - MFIE_STRING(RATES_EX); - MFIE_STRING(GENERIC); - MFIE_STRING(QOS_PARAMETER); - default: - return "UNKNOWN"; - } + switch (id) { + MFIE_STRING(SSID); + MFIE_STRING(RATES); + MFIE_STRING(FH_SET); + MFIE_STRING(DS_SET); + MFIE_STRING(CF_SET); + MFIE_STRING(TIM); + MFIE_STRING(IBSS_SET); + MFIE_STRING(COUNTRY); + MFIE_STRING(HOP_PARAMS); + MFIE_STRING(HOP_TABLE); + MFIE_STRING(REQUEST); + MFIE_STRING(CHALLENGE); + MFIE_STRING(POWER_CONSTRAINT); + MFIE_STRING(POWER_CAPABILITY); + MFIE_STRING(TPC_REQUEST); + MFIE_STRING(TPC_REPORT); + MFIE_STRING(SUPP_CHANNELS); + MFIE_STRING(CSA); + MFIE_STRING(MEASURE_REQUEST); + MFIE_STRING(MEASURE_REPORT); + MFIE_STRING(QUIET); + MFIE_STRING(IBSS_DFS); + // MFIE_STRING(ERP_INFO); + MFIE_STRING(RSN); + MFIE_STRING(RATES_EX); + MFIE_STRING(GENERIC); + MFIE_STRING(QOS_PARAMETER); + default: + return "UNKNOWN"; + } } #endif @@ -1634,7 +1634,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, { u8 i; short offset; - u16 tmp_htcap_len=0; + u16 tmp_htcap_len=0; u16 tmp_htinfo_len=0; u16 ht_realtek_agg_len=0; u8 ht_realtek_agg_buf[MAX_IE_LEN]; @@ -1752,34 +1752,34 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, network->tim.tim_count = info_element->data[0]; network->tim.tim_period = info_element->data[1]; - network->dtim_period = info_element->data[1]; - if(ieee->state != IEEE80211_LINKED) - break; + network->dtim_period = info_element->data[1]; + if(ieee->state != IEEE80211_LINKED) + break; - network->last_dtim_sta_time[0] = stats->mac_time[0]; - network->last_dtim_sta_time[1] = stats->mac_time[1]; + network->last_dtim_sta_time[0] = stats->mac_time[0]; + network->last_dtim_sta_time[1] = stats->mac_time[1]; - network->dtim_data = IEEE80211_DTIM_VALID; + network->dtim_data = IEEE80211_DTIM_VALID; - if(info_element->data[0] != 0) - break; + if(info_element->data[0] != 0) + break; - if(info_element->data[2] & 1) - network->dtim_data |= IEEE80211_DTIM_MBCAST; + if(info_element->data[2] & 1) + network->dtim_data |= IEEE80211_DTIM_MBCAST; - offset = (info_element->data[2] >> 1)*2; + offset = (info_element->data[2] >> 1)*2; - //printk("offset1:%x aid:%x\n",offset, ieee->assoc_id); + //printk("offset1:%x aid:%x\n",offset, ieee->assoc_id); - if(ieee->assoc_id < 8*offset || - ieee->assoc_id > 8*(offset + info_element->len -3)) + if(ieee->assoc_id < 8*offset || + ieee->assoc_id > 8*(offset + info_element->len -3)) - break; + break; - offset = (ieee->assoc_id / 8) - offset;// + ((aid % 8)? 0 : 1) ; + offset = (ieee->assoc_id / 8) - offset;// + ((aid % 8)? 0 : 1) ; - if(info_element->data[3+offset] & (1<<(ieee->assoc_id%8))) - network->dtim_data |= IEEE80211_DTIM_UCAST; + if(info_element->data[3+offset] & (1<<(ieee->assoc_id%8))) + network->dtim_data |= IEEE80211_DTIM_UCAST; //IEEE80211_DEBUG_MGMT("MFIE_TYPE_TIM: partially ignored\n"); break; @@ -1820,17 +1820,17 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, } #ifdef THOMAS_TURBO - if (info_element->len == 7 && - info_element->data[0] == 0x00 && - info_element->data[1] == 0xe0 && - info_element->data[2] == 0x4c && - info_element->data[3] == 0x01 && - info_element->data[4] == 0x02) { - network->Turbo_Enable = 1; - } + if (info_element->len == 7 && + info_element->data[0] == 0x00 && + info_element->data[1] == 0xe0 && + info_element->data[2] == 0x4c && + info_element->data[3] == 0x01 && + info_element->data[4] == 0x02) { + network->Turbo_Enable = 1; + } #endif - //for HTcap and HTinfo parameters + //for HTcap and HTinfo parameters if(tmp_htcap_len == 0){ if(info_element->len >= 4 && info_element->data[0] == 0x00 && @@ -1839,12 +1839,12 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, info_element->data[3] == 0x033){ tmp_htcap_len = min(info_element->len,(u8)MAX_IE_LEN); - if(tmp_htcap_len != 0){ - network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; + if(tmp_htcap_len != 0){ + network->bssht.bdHTSpecVer = HT_SPEC_VER_EWC; network->bssht.bdHTCapLen = tmp_htcap_len > sizeof(network->bssht.bdHTCapBuf)?\ sizeof(network->bssht.bdHTCapBuf):tmp_htcap_len; memcpy(network->bssht.bdHTCapBuf,info_element->data,network->bssht.bdHTCapLen); - } + } } if(tmp_htcap_len != 0) network->bssht.bdSupportHT = true; @@ -1856,9 +1856,9 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, if(tmp_htinfo_len == 0){ if(info_element->len >= 4 && info_element->data[0] == 0x00 && - info_element->data[1] == 0x90 && - info_element->data[2] == 0x4c && - info_element->data[3] == 0x034){ + info_element->data[1] == 0x90 && + info_element->data[2] == 0x4c && + info_element->data[3] == 0x034){ tmp_htinfo_len = min(info_element->len,(u8)MAX_IE_LEN); if(tmp_htinfo_len != 0){ @@ -2014,7 +2014,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, network->rsn_ie_len); break; - //HT related element. + //HT related element. case MFIE_TYPE_HT_CAP: IEEE80211_DEBUG_SCAN("MFIE_TYPE_HT_CAP: %d bytes\n", info_element->len); @@ -2027,7 +2027,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, //If peer is HT, but not WMM, call QosSetLegacyWMMParamWithHT() // windows driver will update WMM parameters each beacon received once connected - // Linux driver is a bit different. + // Linux driver is a bit different. network->bssht.bdSupportHT = true; } else @@ -2060,7 +2060,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, if( (info_element->data[IE_CISCO_FLAG_POSITION]&SUPPORT_CKIP_MIC) || (info_element->data[IE_CISCO_FLAG_POSITION]&SUPPORT_CKIP_PK) ) { - network->bCkipSupported = true; + network->bCkipSupported = true; } else { @@ -2070,7 +2070,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, else { network->bWithAironetIE = false; - network->bCkipSupported = false; + network->bCkipSupported = false; } break; case MFIE_TYPE_QOS_PARAMETER: @@ -2189,10 +2189,10 @@ static inline int ieee80211_network_init( //char *p; #endif - network->qos_data.active = 0; - network->qos_data.supported = 0; - network->qos_data.param_count = 0; - network->qos_data.old_param_count = 0; + network->qos_data.active = 0; + network->qos_data.supported = 0; + network->qos_data.param_count = 0; + network->qos_data.old_param_count = 0; /* Pull out fixed field data */ memcpy(network->bssid, beacon->header.addr3, ETH_ALEN); @@ -2209,9 +2209,9 @@ static inline int ieee80211_network_init( network->flags = 0; network->atim_window = 0; network->erp_value = (network->capability & WLAN_CAPABILITY_IBSS) ? - 0x3 : 0x0; + 0x3 : 0x0; network->berp_info_valid = false; - network->broadcom_cap_exist = false; + network->broadcom_cap_exist = false; network->ralink_cap_exist = false; network->atheros_cap_exist = false; network->cisco_cap_exist = false; @@ -2230,12 +2230,12 @@ static inline int ieee80211_network_init( } else network->flags |= NETWORK_HAS_CCK; - network->wpa_ie_len = 0; - network->rsn_ie_len = 0; + network->wpa_ie_len = 0; + network->rsn_ie_len = 0; - if (ieee80211_parse_info_param - (ieee,beacon->info_element, stats->len - sizeof(*beacon), network, stats)) - return 1; + if (ieee80211_parse_info_param + (ieee,beacon->info_element, stats->len - sizeof(*beacon), network, stats)) + return 1; network->mode = 0; if (stats->freq == IEEE80211_52GHZ_BAND) @@ -2329,7 +2329,7 @@ static inline void update_network(struct ieee80211_network *dst, dst->last_dtim_sta_time[1] = src->last_dtim_sta_time[1]; memcpy(&dst->tim, &src->tim, sizeof(struct ieee80211_tim_parameters)); - dst->bssht.bdSupportHT = src->bssht.bdSupportHT; + dst->bssht.bdSupportHT = src->bssht.bdSupportHT; dst->bssht.bdRT2RTAggregation = src->bssht.bdRT2RTAggregation; dst->bssht.bdHTCapLen= src->bssht.bdHTCapLen; memcpy(dst->bssht.bdHTCapBuf,src->bssht.bdHTCapBuf,src->bssht.bdHTCapLen); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 7a0707810fd0..454f8895d211 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -498,7 +498,7 @@ 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); - static short watchdog = 0; + static short watchdog; u8 channel_map[MAX_CHANNEL_NUMBER+1]; memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1); if(!ieee->ieee_up) @@ -1948,166 +1948,166 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, switch (WLAN_FC_GET_STYPE(header->frame_ctl)) { - case IEEE80211_STYPE_ASSOC_RESP: - case IEEE80211_STYPE_REASSOC_RESP: - - IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n", - WLAN_FC_GET_STYPE(header->frame_ctl)); - if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && - ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED && - ieee->iw_mode == IW_MODE_INFRA){ - struct ieee80211_network network_resp; - struct ieee80211_network *network = &network_resp; - - if (0 == (errcode=assoc_parse(ieee,skb, &aid))){ - ieee->state=IEEE80211_LINKED; - ieee->assoc_id = aid; - ieee->softmac_stats.rx_ass_ok++; - /* station support qos */ - /* Let the register setting defaultly with Legacy station */ - if(ieee->qos_support) { - assoc_resp = (struct ieee80211_assoc_response_frame*)skb->data; - memset(network, 0, sizeof(*network)); - if (ieee80211_parse_info_param(ieee,assoc_resp->info_element,\ - rx_stats->len - sizeof(*assoc_resp),\ - network,rx_stats)){ - return 1; - } - else - { //filling the PeerHTCap. //maybe not necessary as we can get its info from current_network. - memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, network->bssht.bdHTCapLen); - memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen); - } - if (ieee->handle_assoc_response != NULL) - ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame*)header, network); + case IEEE80211_STYPE_ASSOC_RESP: + case IEEE80211_STYPE_REASSOC_RESP: + + IEEE80211_DEBUG_MGMT("received [RE]ASSOCIATION RESPONSE (%d)\n", + WLAN_FC_GET_STYPE(header->frame_ctl)); + if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && + ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATED && + ieee->iw_mode == IW_MODE_INFRA){ + struct ieee80211_network network_resp; + struct ieee80211_network *network = &network_resp; + + if (0 == (errcode=assoc_parse(ieee,skb, &aid))){ + ieee->state=IEEE80211_LINKED; + ieee->assoc_id = aid; + ieee->softmac_stats.rx_ass_ok++; + /* station support qos */ + /* Let the register setting defaultly with Legacy station */ + if(ieee->qos_support) { + assoc_resp = (struct ieee80211_assoc_response_frame*)skb->data; + memset(network, 0, sizeof(*network)); + if (ieee80211_parse_info_param(ieee,assoc_resp->info_element,\ + rx_stats->len - sizeof(*assoc_resp),\ + network,rx_stats)){ + return 1; } - ieee80211_associate_complete(ieee); - } else { - /* aid could not been allocated */ - ieee->softmac_stats.rx_ass_err++; - printk( - "Association response status code 0x%x\n", - errcode); - IEEE80211_DEBUG_MGMT( - "Association response status code 0x%x\n", - errcode); - if(ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) { - queue_work(ieee->wq, &ieee->associate_procedure_wq); - } else { - ieee80211_associate_abort(ieee); + else + { //filling the PeerHTCap. //maybe not necessary as we can get its info from current_network. + memcpy(ieee->pHTInfo->PeerHTCapBuf, network->bssht.bdHTCapBuf, network->bssht.bdHTCapLen); + memcpy(ieee->pHTInfo->PeerHTInfoBuf, network->bssht.bdHTInfoBuf, network->bssht.bdHTInfoLen); } + if (ieee->handle_assoc_response != NULL) + ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame*)header, network); + } + ieee80211_associate_complete(ieee); + } else { + /* aid could not been allocated */ + ieee->softmac_stats.rx_ass_err++; + printk( + "Association response status code 0x%x\n", + errcode); + IEEE80211_DEBUG_MGMT( + "Association response status code 0x%x\n", + errcode); + if(ieee->AsocRetryCount < RT_ASOC_RETRY_LIMIT) { + queue_work(ieee->wq, &ieee->associate_procedure_wq); + } else { + ieee80211_associate_abort(ieee); } } - break; + } + break; - case IEEE80211_STYPE_ASSOC_REQ: - case IEEE80211_STYPE_REASSOC_REQ: + case IEEE80211_STYPE_ASSOC_REQ: + case IEEE80211_STYPE_REASSOC_REQ: - if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && - ieee->iw_mode == IW_MODE_MASTER) + if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && + ieee->iw_mode == IW_MODE_MASTER) - ieee80211_rx_assoc_rq(ieee, skb); - break; + ieee80211_rx_assoc_rq(ieee, skb); + break; - case IEEE80211_STYPE_AUTH: + case IEEE80211_STYPE_AUTH: - if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE){ - if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING && - ieee->iw_mode == IW_MODE_INFRA){ + if (ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE){ + if (ieee->state == IEEE80211_ASSOCIATING_AUTHENTICATING && + ieee->iw_mode == IW_MODE_INFRA){ - IEEE80211_DEBUG_MGMT("Received authentication response"); + IEEE80211_DEBUG_MGMT("Received authentication response"); - if (0 == (errcode=auth_parse(skb, &challenge, &chlen))){ - if(ieee->open_wep || !challenge){ - ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED; - ieee->softmac_stats.rx_auth_rs_ok++; - if(!(ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE)) + if (0 == (errcode=auth_parse(skb, &challenge, &chlen))){ + if(ieee->open_wep || !challenge){ + ieee->state = IEEE80211_ASSOCIATING_AUTHENTICATED; + ieee->softmac_stats.rx_auth_rs_ok++; + if(!(ieee->pHTInfo->IOTAction&HT_IOT_ACT_PURE_N_MODE)) + { + if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { - if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) + // WEP or TKIP encryption + if(IsHTHalfNmodeAPs(ieee)) { - // WEP or TKIP encryption - if(IsHTHalfNmodeAPs(ieee)) - { - bSupportNmode = true; - bHalfSupportNmode = true; - } - else - { - bSupportNmode = false; - bHalfSupportNmode = false; - } - printk("==========>to link with AP using SEC(%d, %d)", bSupportNmode, bHalfSupportNmode); + bSupportNmode = true; + bHalfSupportNmode = true; } + else + { + bSupportNmode = false; + bHalfSupportNmode = false; + } + printk("==========>to link with AP using SEC(%d, %d)", bSupportNmode, bHalfSupportNmode); } - /* Dummy wirless mode setting to avoid encryption issue */ - if(bSupportNmode) { - //N mode setting - ieee->SetWirelessMode(ieee->dev, \ - ieee->current_network.mode); - }else{ - //b/g mode setting - /*TODO*/ - ieee->SetWirelessMode(ieee->dev, IEEE_G); - } - - if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode == true) - { - printk("===============>entern half N mode\n"); - ieee->bHalfWirelessN24GMode = true; - } - else - ieee->bHalfWirelessN24GMode = false; - - ieee80211_associate_step2(ieee); + } + /* Dummy wirless mode setting to avoid encryption issue */ + if(bSupportNmode) { + //N mode setting + ieee->SetWirelessMode(ieee->dev, \ + ieee->current_network.mode); }else{ - ieee80211_auth_challenge(ieee, challenge, chlen); + //b/g mode setting + /*TODO*/ + ieee->SetWirelessMode(ieee->dev, IEEE_G); } + + if (ieee->current_network.mode == IEEE_N_24G && bHalfSupportNmode == true) + { + printk("===============>entern half N mode\n"); + ieee->bHalfWirelessN24GMode = true; + } + else + ieee->bHalfWirelessN24GMode = false; + + ieee80211_associate_step2(ieee); }else{ - ieee->softmac_stats.rx_auth_rs_err++; - IEEE80211_DEBUG_MGMT("Authentication response status code 0x%x",errcode); - ieee80211_associate_abort(ieee); + ieee80211_auth_challenge(ieee, challenge, chlen); } - - }else if (ieee->iw_mode == IW_MODE_MASTER){ - ieee80211_rx_auth_rq(ieee, skb); + }else{ + ieee->softmac_stats.rx_auth_rs_err++; + IEEE80211_DEBUG_MGMT("Authentication response status code 0x%x",errcode); + ieee80211_associate_abort(ieee); } + + }else if (ieee->iw_mode == IW_MODE_MASTER){ + ieee80211_rx_auth_rq(ieee, skb); } - break; + } + break; - case IEEE80211_STYPE_PROBE_REQ: + case IEEE80211_STYPE_PROBE_REQ: - if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && - ((ieee->iw_mode == IW_MODE_ADHOC || - ieee->iw_mode == IW_MODE_MASTER) && - ieee->state == IEEE80211_LINKED)){ - ieee80211_rx_probe_rq(ieee, skb); - } - break; + if ((ieee->softmac_features & IEEE_SOFTMAC_PROBERS) && + ((ieee->iw_mode == IW_MODE_ADHOC || + ieee->iw_mode == IW_MODE_MASTER) && + ieee->state == IEEE80211_LINKED)){ + ieee80211_rx_probe_rq(ieee, skb); + } + break; - case IEEE80211_STYPE_DISASSOC: - case IEEE80211_STYPE_DEAUTH: - /* FIXME for now repeat all the association procedure - * both for disassociation and deauthentication - */ - if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && - ieee->state == IEEE80211_LINKED && - ieee->iw_mode == IW_MODE_INFRA){ - - ieee->state = IEEE80211_ASSOCIATING; - ieee->softmac_stats.reassoc++; - - notify_wx_assoc_event(ieee); - //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); - RemovePeerTS(ieee, header->addr2); - queue_work(ieee->wq, &ieee->associate_procedure_wq); - } - break; - case IEEE80211_STYPE_MANAGE_ACT: - ieee80211_process_action(ieee,skb); - break; - default: - return -1; - break; + case IEEE80211_STYPE_DISASSOC: + case IEEE80211_STYPE_DEAUTH: + /* FIXME for now repeat all the association procedure + * both for disassociation and deauthentication + */ + if ((ieee->softmac_features & IEEE_SOFTMAC_ASSOCIATE) && + ieee->state == IEEE80211_LINKED && + ieee->iw_mode == IW_MODE_INFRA){ + + ieee->state = IEEE80211_ASSOCIATING; + ieee->softmac_stats.reassoc++; + + notify_wx_assoc_event(ieee); + //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); + RemovePeerTS(ieee, header->addr2); + queue_work(ieee->wq, &ieee->associate_procedure_wq); + } + break; + case IEEE80211_STYPE_MANAGE_ACT: + ieee80211_process_action(ieee,skb); + break; + default: + return -1; + break; } //dev_kfree_skb_any(skb); @@ -2503,8 +2503,8 @@ void ieee80211_disassociate(struct ieee80211_device *ieee) } void ieee80211_associate_retry_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, associate_retry_wq); + struct delayed_work *dwork = container_of(work, struct delayed_work, work); + struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, associate_retry_wq); unsigned long flags; down(&ieee->wx_sem); @@ -3124,7 +3124,7 @@ inline struct sk_buff *ieee80211_disassociate_skb( void SendDisassociation( struct ieee80211_device *ieee, - u8* asSta, + u8* asSta, u8 asRsn ) { diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c index 421da8a07697..60746b8b1eb0 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c @@ -302,7 +302,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) HT_EXTCHNL_OFFSET chan_offset=0; HT_CHANNEL_WIDTH bandwidth=0; int b40M = 0; - static int count = 0; + static int count; chan = ieee->current_network.channel; netif_carrier_off(ieee->dev); @@ -482,22 +482,23 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - strcpy(wrqu->name, "802.11"); - if(ieee->modulation & IEEE80211_CCK_MODULATION){ - strcat(wrqu->name, "b"); - if(ieee->modulation & IEEE80211_OFDM_MODULATION) - strcat(wrqu->name, "/g"); - }else if(ieee->modulation & IEEE80211_OFDM_MODULATION) - strcat(wrqu->name, "g"); - if (ieee->mode & (IEEE_N_24G | IEEE_N_5G)) - strcat(wrqu->name, "/n"); + strlcpy(wrqu->name, "802.11", IFNAMSIZ); + if (ieee->modulation & IEEE80211_CCK_MODULATION) { + strlcat(wrqu->name, "b", IFNAMSIZ); + if (ieee->modulation & IEEE80211_OFDM_MODULATION) + strlcat(wrqu->name, "/g", IFNAMSIZ); + } else if (ieee->modulation & IEEE80211_OFDM_MODULATION) { + strlcat(wrqu->name, "g", IFNAMSIZ); + } - if((ieee->state == IEEE80211_LINKED) || - (ieee->state == IEEE80211_LINKED_SCANNING)) - strcat(wrqu->name," linked"); - else if(ieee->state != IEEE80211_NOLINK) - strcat(wrqu->name," link.."); + if (ieee->mode & (IEEE_N_24G | IEEE_N_5G)) + strlcat(wrqu->name, "/n", IFNAMSIZ); + if ((ieee->state == IEEE80211_LINKED) || + (ieee->state == IEEE80211_LINKED_SCANNING)) + strlcat(wrqu->name, " linked", IFNAMSIZ); + else if (ieee->state != IEEE80211_NOLINK) + strlcat(wrqu->name, " link..", IFNAMSIZ); return 0; } diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 3f5ceeb88b6c..c39e680bb0ac 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -70,7 +70,7 @@ val | 0 | 0 | 0 | 1 | x | 0 | 0 | 0 | 1 | 0 | x | x | x desc | ^-ver-^ | ^type-^ | ^-----subtype-----^ | to |from |more |retry| pwr |more |wep | | | | x=0 data,x=1 data+ack | DS | DS |frag | | mgm |data | | '-----------------------------------------------------------------------------------------' - /\ + /\ | 802.11 Data Frame | ,--------- 'ctrl' expands to >-----------' @@ -283,22 +283,22 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network) // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); ip = ip_hdr(skb); switch (ip->tos & 0xfc) { - case 0x20: - return 2; - case 0x40: - return 1; - case 0x60: - return 3; - case 0x80: - return 4; - case 0xa0: - return 5; - case 0xc0: - return 6; - case 0xe0: - return 7; - default: - return 0; + case 0x20: + return 2; + case 0x40: + return 1; + case 0x60: + return 3; + case 0x80: + return 4; + case 0xa0: + return 5; + case 0xc0: + return 6; + case 0xe0: + return 7; + default: + return 0; } } @@ -395,7 +395,7 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, cb_desc *tcb_desc) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; - tcb_desc->bUseShortGI = false; + tcb_desc->bUseShortGI = false; if(!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) return; @@ -514,7 +514,7 @@ void ieee80211_query_protectionmode(struct ieee80211_device* ieee, cb_desc* tcb_ if(pHTInfo->IOTAction & HT_IOT_ACT_FORCED_CTS2SELF) { tcb_desc->bCTSEnable = true; - tcb_desc->rts_rate = MGN_24M; + tcb_desc->rts_rate = MGN_24M; tcb_desc->bRTSEnable = true; break; } @@ -527,7 +527,7 @@ void ieee80211_query_protectionmode(struct ieee80211_device* ieee, cb_desc* tcb_ { tcb_desc->bCTSEnable = true; tcb_desc->rts_rate = MGN_24M; - tcb_desc->bRTSEnable = true; + tcb_desc->bRTSEnable = true; } if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) tcb_desc->bUseShortPreamble = true; @@ -656,17 +656,17 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) memcpy(&dest, skb->data, ETH_ALEN); memcpy(&src, skb->data+ETH_ALEN, ETH_ALEN); - /* Advance the SKB to the start of the payload */ - skb_pull(skb, sizeof(struct ethhdr)); + /* Advance the SKB to the start of the payload */ + skb_pull(skb, sizeof(struct ethhdr)); - /* Determine total amount of storage required for TXB packets */ - bytes = skb->len + SNAP_SIZE + sizeof(u16); + /* Determine total amount of storage required for TXB packets */ + bytes = skb->len + SNAP_SIZE + sizeof(u16); if (encrypt) fc = IEEE80211_FTYPE_DATA | IEEE80211_FCTL_WEP; else - fc = IEEE80211_FTYPE_DATA; + fc = IEEE80211_FTYPE_DATA; //if(ieee->current_network.QoS_Enable) if(qos_actived) @@ -689,7 +689,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) memcpy(&header.addr3, ieee->current_network.bssid, ETH_ALEN); } - header.frame_ctl = cpu_to_le16(fc); + header.frame_ctl = cpu_to_le16(fc); /* Determine fragmentation size based on destination (multicast * and broadcast are not fragmented) */ @@ -833,7 +833,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) else ieee->seq_ctrl[UP2AC(skb->priority) + 1]++; } else { - if (ieee->seq_ctrl[0] == 0xFFF) + if (ieee->seq_ctrl[0] == 0xFFF) ieee->seq_ctrl[0] = 0; else ieee->seq_ctrl[0]++; diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index f0ba7f467493..e1fe54acb4b8 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -761,7 +761,7 @@ int ieee80211_wx_set_mlme(struct ieee80211_device *ieee, case IW_MLME_DISASSOC: ieee80211_disassociate(ieee); break; - default: + default: return -EOPNOTSUPP; } return 0; diff --git a/drivers/staging/rtl8192u/ieee80211/internal.h b/drivers/staging/rtl8192u/ieee80211/internal.h index bebe13ac53b7..6f54cfe8a467 100644 --- a/drivers/staging/rtl8192u/ieee80211/internal.h +++ b/drivers/staging/rtl8192u/ieee80211/internal.h @@ -79,4 +79,3 @@ void crypto_exit_cipher_ops(struct crypto_tfm *tfm); void crypto_exit_compress_ops(struct crypto_tfm *tfm); #endif /* _CRYPTO_INTERNAL_H */ - diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BA.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_BA.h index 8ddc8bf9dc26..2c398ca9a8ac 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BA.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BA.h @@ -1,7 +1,7 @@ #ifndef _BATYPE_H_ #define _BATYPE_H_ -#define TOTAL_TXBA_NUM 16 +#define TOTAL_TXBA_NUM 16 #define TOTAL_RXBA_NUM 16 #define BA_SETUP_TIMEOUT 200 @@ -28,8 +28,7 @@ struct ieee80211_ADDBA_Req{ //Is this need?I put here just to make it easier to define structure BA_RECORD //WB typedef union _SEQUENCE_CONTROL{ u16 ShortData; - struct - { + struct { u16 FragNum:4; u16 SeqNum:12; }field; @@ -66,4 +65,3 @@ typedef struct _BA_RECORD { } BA_RECORD, *PBA_RECORD; #endif //end _BATYPE_H_ - diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 1ebea3daea2d..69735d320315 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -9,8 +9,8 @@ /******************************************************************************************************************** *function: Activate BA entry. And if Time is nozero, start timer. - * input: PBA_RECORD pBA //BA entry to be enabled - * u16 Time //indicate time delay. + * input: PBA_RECORD pBA //BA entry to be enabled + * u16 Time //indicate time delay. * output: none ********************************************************************************************************************/ void ActivateBAEntry(struct ieee80211_device* ieee, PBA_RECORD pBA, u16 Time) @@ -22,7 +22,7 @@ void ActivateBAEntry(struct ieee80211_device* ieee, PBA_RECORD pBA, u16 Time) /******************************************************************************************************************** *function: deactivate BA entry, including its timer. - * input: PBA_RECORD pBA //BA entry to be disabled + * input: PBA_RECORD pBA //BA entry to be disabled * output: none ********************************************************************************************************************/ void DeActivateBAEntry( struct ieee80211_device* ieee, PBA_RECORD pBA) @@ -33,7 +33,7 @@ void DeActivateBAEntry( struct ieee80211_device* ieee, PBA_RECORD pBA) /******************************************************************************************************************** *function: deactivete BA entry in Tx Ts, and send DELBA. * input: - * PTX_TS_RECORD pTxTs //Tx Ts which is to deactivate BA entry. + * PTX_TS_RECORD pTxTs //Tx Ts which is to deactivate BA entry. * output: none * notice: As PTX_TS_RECORD structure will be defined in QOS, so wait to be merged. //FIXME ********************************************************************************************************************/ @@ -63,7 +63,7 @@ u8 TxTsDeleteBA( struct ieee80211_device* ieee, PTX_TS_RECORD pTxTs) /******************************************************************************************************************** *function: deactivete BA entry in Tx Ts, and send DELBA. * input: - * PRX_TS_RECORD pRxTs //Rx Ts which is to deactivate BA entry. + * PRX_TS_RECORD pRxTs //Rx Ts which is to deactivate BA entry. * output: none * notice: As PRX_TS_RECORD structure will be defined in QOS, so wait to be merged. //FIXME, same with above ********************************************************************************************************************/ @@ -84,7 +84,7 @@ u8 RxTsDeleteBA( struct ieee80211_device* ieee, PRX_TS_RECORD pRxTs) /******************************************************************************************************************** *function: reset BA entry * input: - * PBA_RECORD pBA //entry to be reset + * PBA_RECORD pBA //entry to be reset * output: none ********************************************************************************************************************/ void ResetBaEntry( PBA_RECORD pBA) @@ -98,12 +98,12 @@ void ResetBaEntry( PBA_RECORD pBA) //These functions need porting here or not? /******************************************************************************************************************************* *function: construct ADDBAREQ and ADDBARSP frame here together. - * input: u8* Dst //ADDBA frame's destination - * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA. - * u16 StatusCode //status code in RSP and I will use it to indicate whether it's RSP or REQ(will I?) - * u8 type //indicate whether it's RSP(ACT_ADDBARSP) ow REQ(ACT_ADDBAREQ) + * input: u8* Dst //ADDBA frame's destination + * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA. + * u16 StatusCode //status code in RSP and I will use it to indicate whether it's RSP or REQ(will I?) + * u8 type //indicate whether it's RSP(ACT_ADDBARSP) ow REQ(ACT_ADDBAREQ) * output: none - * return: sk_buff* skb //return constructed skb to xmit + * return: sk_buff* skb //return constructed skb to xmit *******************************************************************************************************************************/ static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, PBA_RECORD pBA, u16 StatusCode, u8 type) { @@ -126,7 +126,7 @@ static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, P return NULL; } - memset(skb->data, 0, sizeof( struct ieee80211_hdr_3addr)); //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb. + memset(skb->data, 0, sizeof( struct ieee80211_hdr_3addr)); //I wonder whether it's necessary. Apparently kernel will not do it when alloc a skb. skb_reserve(skb, ieee->tx_headroom); BAReq = ( struct ieee80211_hdr_3addr *) skb_put(skb,sizeof( struct ieee80211_hdr_3addr)); @@ -177,12 +177,12 @@ static struct sk_buff* ieee80211_ADDBA(struct ieee80211_device* ieee, u8* Dst, P /******************************************************************************************************************** *function: construct DELBA frame - * input: u8* dst //DELBA frame's destination - * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA - * TR_SELECT TxRxSelect //TX RX direction - * u16 ReasonCode //status code. + * input: u8* dst //DELBA frame's destination + * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA + * TR_SELECT TxRxSelect //TX RX direction + * u16 ReasonCode //status code. * output: none - * return: sk_buff* skb //return constructed skb to xmit + * return: sk_buff* skb //return constructed skb to xmit ********************************************************************************************************************/ static struct sk_buff* ieee80211_DELBA( struct ieee80211_device* ieee, @@ -246,8 +246,8 @@ static struct sk_buff* ieee80211_DELBA( /******************************************************************************************************************** *function: send ADDBAReq frame out - * input: u8* dst //ADDBAReq frame's destination - * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA + * input: u8* dst //ADDBAReq frame's destination + * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA * output: none * notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does ********************************************************************************************************************/ @@ -272,9 +272,9 @@ void ieee80211_send_ADDBAReq(struct ieee80211_device* ieee, u8* dst, PBA_RECORD /******************************************************************************************************************** *function: send ADDBARSP frame out - * input: u8* dst //DELBA frame's destination - * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA - * u16 StatusCode //RSP StatusCode + * input: u8* dst //DELBA frame's destination + * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA + * u16 StatusCode //RSP StatusCode * output: none * notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does ********************************************************************************************************************/ @@ -297,10 +297,10 @@ void ieee80211_send_ADDBARsp(struct ieee80211_device* ieee, u8* dst, PBA_RECORD } /******************************************************************************************************************** *function: send ADDBARSP frame out - * input: u8* dst //DELBA frame's destination - * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA - * TR_SELECT TxRxSelect //TX or RX - * u16 ReasonCode //DEL ReasonCode + * input: u8* dst //DELBA frame's destination + * PBA_RECORD pBA //BA_RECORD entry which stores the necessary information for BA + * TR_SELECT TxRxSelect //TX or RX + * u16 ReasonCode //DEL ReasonCode * output: none * notice: If any possible, please hide pBA in ieee. And temporarily use Manage Queue as softmac_mgmt_xmit() usually does ********************************************************************************************************************/ @@ -340,7 +340,7 @@ int ieee80211_rx_ADDBAReq( struct ieee80211_device* ieee, struct sk_buff *skb) if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 9) { - IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BAREQ(%d / %zu)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 9)); + IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BAREQ(%d / %zu)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 9)); return -1; } @@ -439,7 +439,7 @@ int ieee80211_rx_ADDBARsp( struct ieee80211_device* ieee, struct sk_buff *skb) if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 9) { - IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BARSP(%d / %zu)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 9)); + IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in BARSP(%d / %zu)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 9)); return -1; } rsp = ( struct ieee80211_hdr_3addr*)skb->data; @@ -569,7 +569,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device* ieee,struct sk_buff *skb) if (skb->len < sizeof( struct ieee80211_hdr_3addr) + 6) { - IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in DELBA(%d / %zu)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 6)); + IEEE80211_DEBUG(IEEE80211_DL_ERR, " Invalid skb len in DELBA(%d / %zu)\n", skb->len, (sizeof( struct ieee80211_hdr_3addr) + 6)); return -1; } @@ -589,7 +589,7 @@ int ieee80211_rx_DELBA(struct ieee80211_device* ieee,struct sk_buff *skb) if(pDelBaParamSet->field.Initiator == 1) { - PRX_TS_RECORD pRxTs; + PRX_TS_RECORD pRxTs; if( !GetTs( ieee, @@ -657,7 +657,7 @@ TsInitAddBA( // BufferSize: This need to be set according to A-MPDU vector pBA->BaParamSet.field.BufferSize = 32; // BufferSize: This need to be set according to A-MPDU vector pBA->BaTimeoutValue = 0; // Timeout value: Set 0 to disable Timer - pBA->BaStartSeqCtrl.field.SeqNum = (pTS->TxCurSeq + 3) % 4096; // Block Ack will start after 3 packets later. + pBA->BaStartSeqCtrl.field.SeqNum = (pTS->TxCurSeq + 3) % 4096; // Block Ack will start after 3 packets later. ActivateBAEntry(ieee, pBA, BA_SETUP_TIMEOUT); @@ -734,4 +734,3 @@ void RxBaInactTimeout(unsigned long data) DELBA_REASON_TIMEOUT); return ; } - diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h index a60b39cdb472..2b8283534be4 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HT.h @@ -121,7 +121,7 @@ typedef union _HT_CAPABILITY_MACPARA{ typedef enum _HT_ACTION{ ACT_RECOMMAND_WIDTH = 0, - ACT_MIMO_PWR_SAVE = 1, + ACT_MIMO_PWR_SAVE = 1, ACT_PSMP = 2, ACT_SET_PCO_PHASE = 3, ACT_MIMO_CHL_MEASURE = 4, @@ -398,9 +398,9 @@ typedef struct _BSS_HT{ typedef struct _MIMO_RSSI{ u32 EnableAntenna; u32 AntennaA; - u32 AntennaB; - u32 AntennaC; - u32 AntennaD; + u32 AntennaB; + u32 AntennaC; + u32 AntennaD; u32 Average; }MIMO_RSSI, *PMIMO_RSSI; @@ -436,11 +436,11 @@ extern u8 MCS_FILTER_1SS[16]; // MCS Bw 40 {1~7, 12~15,32} -#define RATE_ADPT_1SS_MASK 0xFF +#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_MCS32_MASK 0x01 -#define IS_11N_MCS_RATE(rate) (rate&0x80) +#define IS_11N_MCS_RATE(rate) (rate&0x80) typedef enum _HT_AGGRE_SIZE{ HT_AGG_SIZE_8K = 0, @@ -478,4 +478,3 @@ typedef enum _HT_IOT_ACTION{ }HT_IOT_ACTION_E, *PHT_IOT_ACTION_E; #endif //_RTL819XU_HTTYPE_H_ - diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index ebb523904edc..268b270e9495 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c @@ -21,7 +21,7 @@ u16 MCS_DATA_RATE[2][2][77] = 81, 162, 243, 324, 486, 648, 729, 810, 108, 216, 324, 432, 648, 864, 972, 1080, 12, 162, 216, 270, 243, 324, 405, 216, 270, 270, 324, 378, 378, 432, 324, 405, 405, 486, 567, 567, 648, 270, 324, 378, 324, 378, 432, 486, 432, 486, 540, 540, - 594, 405, 486, 567, 486, 567, 648, 729, 648, 729, 810, 810, 891}, // Long GI, 40MHz + 594, 405, 486, 567, 486, 567, 648, 729, 648, 729, 810, 810, 891}, // Long GI, 40MHz {30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600, 90, 180, 270, 360, 540, 720, 810, 900, 120, 240, 360, 480, 720, 960, 1080, 1200, 13, 180, 240, 300, 270, 360, 450, 240, 300, 300, 360, 420, 420, 480, 360, 450, @@ -88,7 +88,7 @@ void HTUpdateDefaultSetting(struct ieee80211_device* ieee) ieee->bTxDisableRateFallBack = 0; ieee->bTxUseDriverAssingedRate = 0; -#ifdef TO_DO_LIST +#ifdef TO_DO_LIST // 8190 only. Assign duration operation mode to firmware pMgntInfo->bTxEnableFwCalcDur = (BOOLEAN)pNdisCommon->bRegTxEnableFwCalcDur; #endif @@ -116,7 +116,7 @@ void HTUpdateDefaultSetting(struct ieee80211_device* ieee) /******************************************************************************************************************** *function: This function print out each field on HT capability IE mainly from (Beacon/ProbeRsp/AssocReq) * input: u8* CapIE //Capability IE to be printed out - * u8* TitleString //mainly print out caller function + * u8* TitleString //mainly print out caller function * output: none * return: none * notice: Driver should not print out this message by default. @@ -125,7 +125,7 @@ void HTDebugHTCapability(u8* CapIE, u8* TitleString ) { static u8 EWC11NHTCap[] = {0x00, 0x90, 0x4c, 0x33}; // For 11n EWC definition, 2007.07.17, by Emily - PHT_CAPABILITY_ELE pCapELE; + PHT_CAPABILITY_ELE pCapELE; if(!memcmp(CapIE, EWC11NHTCap, sizeof(EWC11NHTCap))) { @@ -153,7 +153,7 @@ void HTDebugHTCapability(u8* CapIE, u8* TitleString ) /******************************************************************************************************************** *function: This function print out each field on HT Information IE mainly from (Beacon/ProbeRsp) * input: u8* InfoIE //Capability IE to be printed out - * u8* TitleString //mainly print out caller function + * u8* TitleString //mainly print out caller function * output: none * return: none * notice: Driver should not print out this message by default. @@ -217,7 +217,7 @@ void HTDebugHTInfo(u8* InfoIE, u8* TitleString) } /* -* Return: true if station in half n mode and AP supports 40 bw +* Return: true if station in half n mode and AP supports 40 bw */ bool IsHTHalfNmode40Bandwidth(struct ieee80211_device* ieee) { @@ -228,7 +228,7 @@ bool IsHTHalfNmode40Bandwidth(struct ieee80211_device* ieee) retValue = false; else if(pHTInfo->bRegBW40MHz == false) // station supports 40 bw retValue = false; - else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode + else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode retValue = false; else if(((PHT_CAPABILITY_ELE)(pHTInfo->PeerHTCapBuf))->ChlWidth) // ap support 40 bw retValue = true; @@ -245,7 +245,7 @@ bool IsHTHalfNmodeSGI(struct ieee80211_device* ieee, bool is40MHz) if(pHTInfo->bCurrentHTSupport == false ) // wireless is n mode retValue = false; - else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode + else if(!ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) // station in half n mode retValue = false; else if(is40MHz) // ap support 40 bw { @@ -265,7 +265,7 @@ bool IsHTHalfNmodeSGI(struct ieee80211_device* ieee, bool is40MHz) return retValue; } -u16 HTHalfMcsToDataRate(struct ieee80211_device* ieee, u8 nMcsRate) +u16 HTHalfMcsToDataRate(struct ieee80211_device* ieee, u8 nMcsRate) { u8 is40MHz; @@ -291,8 +291,8 @@ u16 HTMcsToDataRate( struct ieee80211_device* ieee, u8 nMcsRate) /******************************************************************************************************************** *function: This function returns current datarate. - * input: struct ieee80211_device* ieee - * u8 nDataRate + * input: struct ieee80211_device* ieee + * u8 nDataRate * output: none * return: tx rate * notice: quite unsure about how to use this function //wb @@ -371,7 +371,7 @@ bool IsHTHalfNmodeAPs(struct ieee80211_device* ieee) /******************************************************************************************************************** *function: This function returns peer IOT. - * input: struct ieee80211_device* ieee + * input: struct ieee80211_device* ieee * output: none * return: * notice: @@ -408,8 +408,8 @@ void HTIOTPeerDetermine(struct ieee80211_device* ieee) /******************************************************************************************************************** *function: Check whether driver should declare received rate up to MCS13 only since some chipset is not good * at receiving MCS14~15 frame from some AP. - * input: struct ieee80211_device* ieee - * u8 * PeerMacAddr + * input: struct ieee80211_device* ieee + * u8 * PeerMacAddr * output: none * return: return 1 if driver should declare MCS13 only(otherwise return 0) * *****************************************************************************************************************/ @@ -429,7 +429,7 @@ u8 HTIOTActIsDisableMCS14(struct ieee80211_device* ieee, u8* PeerMacAddr) * PADAPTER Adapter, * * Output: None -* Return: true if driver should disable MCS15 +* Return: true if driver should disable MCS15 * 2008.04.15 Emily */ bool HTIOTActIsDisableMCS15(struct ieee80211_device* ieee) @@ -466,7 +466,7 @@ bool HTIOTActIsDisableMCS15(struct ieee80211_device* ieee) * PADAPTER Adapter, * * Output: None -* Return: true if driver should disable all two spatial stream packet +* Return: true if driver should disable all two spatial stream packet * 2008.04.21 Emily */ bool HTIOTActIsDisableMCSTwoSpatialStream(struct ieee80211_device* ieee, u8 *PeerMacAddr) @@ -481,12 +481,12 @@ bool HTIOTActIsDisableMCSTwoSpatialStream(struct ieee80211_device* ieee, u8 *Pee /******************************************************************************************************************** *function: Check whether driver should disable EDCA turbo mode - * input: struct ieee80211_device* ieee - * u8* PeerMacAddr + * input: struct ieee80211_device* ieee + * u8* PeerMacAddr * output: none * return: return 1 if driver should disable EDCA turbo mode(otherwise return 0) * *****************************************************************************************************************/ -u8 HTIOTActIsDisableEDCATurbo(struct ieee80211_device* ieee, u8* PeerMacAddr) +u8 HTIOTActIsDisableEDCATurbo(struct ieee80211_device* ieee, u8* PeerMacAddr) { u8 retValue = false; // default enable EDCA Turbo mode. // Set specific EDCA parameter for different AP in DM handler. @@ -539,10 +539,10 @@ void HTResetIOTSetting( /******************************************************************************************************************** *function: Construct Capablility Element in Beacon... if HTEnable is turned on - * input: struct ieee80211_device* ieee - * u8* posHTCap //pointer to store Capability Ele - * u8* len //store length of CE - * u8 IsEncrypt //whether encrypt, needed further + * input: struct ieee80211_device* ieee + * u8* posHTCap //pointer to store Capability Ele + * u8* len //store length of CE + * u8 IsEncrypt //whether encrypt, needed further * output: none * return: none * notice: posHTCap can't be null and should be initialized before. @@ -550,7 +550,7 @@ void HTResetIOTSetting( void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u8* len, u8 IsEncrypt) { PRT_HIGH_THROUGHPUT pHT = ieee->pHTInfo; - PHT_CAPABILITY_ELE pCapELE = NULL; + PHT_CAPABILITY_ELE pCapELE = NULL; //u8 bIsDeclareMCS13; if ((posHTCap == NULL) || (pHT == NULL)) @@ -571,7 +571,7 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u //HT capability info - pCapELE->AdvCoding = 0; // This feature is not supported now!! + pCapELE->AdvCoding = 0; // This feature is not supported now!! if(ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) { pCapELE->ChlWidth = 0; @@ -581,18 +581,18 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); } -// pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); - pCapELE->MimoPwrSave = pHT->SelfMimoPs; +// pCapELE->ChlWidth = (pHT->bRegBW40MHz?1:0); + pCapELE->MimoPwrSave = pHT->SelfMimoPs; pCapELE->GreenField = 0; // This feature is not supported now!! pCapELE->ShortGI20Mhz = 1; // We can receive Short GI!! pCapELE->ShortGI40Mhz = 1; // We can receive Short GI!! //DbgPrint("TX HT cap/info ele BW=%d SG20=%d SG40=%d\n\r", //pCapELE->ChlWidth, pCapELE->ShortGI20Mhz, pCapELE->ShortGI40Mhz); - pCapELE->TxSTBC = 1; - pCapELE->RxSTBC = 0; + pCapELE->TxSTBC = 1; + pCapELE->RxSTBC = 0; pCapELE->DelayBA = 0; // Do not support now!! pCapELE->MaxAMSDUSize = (MAX_RECEIVE_BUFFER_SIZE>=7935)?1:0; - pCapELE->DssCCk = ((pHT->bRegBW40MHz)?(pHT->bRegSuppCCK?1:0):0); + pCapELE->DssCCk = ((pHT->bRegBW40MHz)?(pHT->bRegSuppCCK?1:0):0); pCapELE->PSMP = 0; // Do not support now!! pCapELE->LSigTxopProtect = 0; // Do not support now!! @@ -603,13 +603,13 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u if( IsEncrypt) { - pCapELE->MPDUDensity = 7; // 8us - pCapELE->MaxRxAMPDUFactor = 2; // 2 is for 32 K and 3 is 64K + pCapELE->MPDUDensity = 7; // 8us + pCapELE->MaxRxAMPDUFactor = 2; // 2 is for 32 K and 3 is 64K } else { - pCapELE->MaxRxAMPDUFactor = 3; // 2 is for 32 K and 3 is 64K - pCapELE->MPDUDensity = 0; // no density + pCapELE->MaxRxAMPDUFactor = 3; // 2 is for 32 K and 3 is 64K + pCapELE->MPDUDensity = 0; // no density } //Supported MCS set @@ -658,10 +658,10 @@ void HTConstructCapabilityElement(struct ieee80211_device* ieee, u8* posHTCap, u } /******************************************************************************************************************** *function: Construct Information Element in Beacon... if HTEnable is turned on - * input: struct ieee80211_device* ieee - * u8* posHTCap //pointer to store Information Ele - * u8* len //store len of - * u8 IsEncrypt //whether encrypt, needed further + * input: struct ieee80211_device* ieee + * u8* posHTCap //pointer to store Information Ele + * u8* len //store len of + * u8 IsEncrypt //whether encrypt, needed further * output: none * return: none * notice: posHTCap can't be null and be initialized before. only AP and IBSS sta should do this @@ -679,12 +679,12 @@ void HTConstructInfoElement(struct ieee80211_device* ieee, u8* posHTInfo, u8* le memset(posHTInfo, 0, *len); if ( (ieee->iw_mode == IW_MODE_ADHOC) || (ieee->iw_mode == IW_MODE_MASTER)) //ap mode is not currently supported { - pHTInfoEle->ControlChl = ieee->current_network.channel; - pHTInfoEle->ExtChlOffset = ((pHT->bRegBW40MHz == false)?HT_EXTCHNL_OFFSET_NO_EXT: + pHTInfoEle->ControlChl = ieee->current_network.channel; + pHTInfoEle->ExtChlOffset = ((pHT->bRegBW40MHz == false)?HT_EXTCHNL_OFFSET_NO_EXT: (ieee->current_network.channel<=6)? HT_EXTCHNL_OFFSET_UPPER:HT_EXTCHNL_OFFSET_LOWER); pHTInfoEle->RecommemdedTxWidth = pHT->bRegBW40MHz; - pHTInfoEle->RIFS = 0; + pHTInfoEle->RIFS = 0; pHTInfoEle->PSMPAccessOnly = 0; pHTInfoEle->SrvIntGranularity = 0; pHTInfoEle->OptMode = pHT->CurrentOpMode; @@ -723,17 +723,17 @@ void HTConstructInfoElement(struct ieee80211_device* ieee, u8* posHTInfo, u8* le * Element ID Length OUI Type1 Reserved * 1 byte 1 byte 3 bytes 1 byte 1 byte * - * OUI = 0x00, 0xe0, 0x4c, - * Type = 0x02 - * Reserved = 0x00 + * OUI = 0x00, 0xe0, 0x4c, + * Type = 0x02 + * Reserved = 0x00 * * 2007.8.21 by Emily */ /******************************************************************************************************************** *function: Construct Information Element in Beacon... in RT2RT condition - * input: struct ieee80211_device* ieee - * u8* posRT2RTAgg //pointer to store Information Ele - * u8* len //store len + * input: struct ieee80211_device* ieee + * u8* posRT2RTAgg //pointer to store Information Ele + * u8* len //store len * output: none * return: none * notice: @@ -787,8 +787,8 @@ void HTConstructRT2RTAggElement(struct ieee80211_device* ieee, u8* posRT2RTAgg, /******************************************************************************************************************** *function: Pick the right Rate Adaptive table to use - * input: struct ieee80211_device* ieee - * u8* pOperateMCS //A pointer to MCS rate bitmap + * input: struct ieee80211_device* ieee + * u8* pOperateMCS //A pointer to MCS rate bitmap * return: always we return true * notice: * *****************************************************************************************************************/ @@ -840,7 +840,7 @@ u8 HT_PickMCSRate(struct ieee80211_device* ieee, u8* pOperateMCS) * Description: * This function will get the highest speed rate in input MCS set. * -* /param Adapter Pionter to Adapter entity +* /param Adapter Pionter to Adapter entity * pMCSRateSet Pointer to MCS rate bitmap * pMCSFilter Pointer to MCS rate filter * @@ -849,9 +849,9 @@ u8 HT_PickMCSRate(struct ieee80211_device* ieee, u8* pOperateMCS) */ /******************************************************************************************************************** *function: This function will get the highest speed rate in input MCS set. - * input: struct ieee80211_device* ieee - * u8* pMCSRateSet //Pointer to MCS rate bitmap - * u8* pMCSFilter //Pointer to MCS rate filter + * input: struct ieee80211_device* ieee + * u8* pMCSRateSet //Pointer to MCS rate bitmap + * u8* pMCSFilter //Pointer to MCS rate filter * return: Highest MCS rate included in pMCSRateSet and filtered by pMCSFilter * notice: * *****************************************************************************************************************/ @@ -1062,7 +1062,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee) else pHTInfo->CurrentMPDUDensity = pPeerHTCap->MPDUDensity; if(ieee->pairwise_key_type != KEY_TYPE_NA ) - pHTInfo->CurrentMPDUDensity = 7; // 8us + pHTInfo->CurrentMPDUDensity = 7; // 8us // Force TX AMSDU // Lanhsin: mark for tmp to avoid deauth by ap from s3 @@ -1118,7 +1118,7 @@ void HTOnAssocRsp(struct ieee80211_device *ieee) void HTSetConnectBwModeCallback(struct ieee80211_device* ieee); /******************************************************************************************************************** *function: initialize HT info(struct PRT_HIGH_THROUGHPUT) - * input: struct ieee80211_device* ieee + * input: struct ieee80211_device* ieee * output: none * return: none * notice: This function is called when * (1) MPInitialization Phase * (2) Receiving of Deauthentication from AP @@ -1208,13 +1208,13 @@ void HTInitializeBssDesc(PBSS_HT pBssHT) } /******************************************************************************************************************** *function: initialize Bss HT structure(struct PBSS_HT) - * input: struct ieee80211_device *ieee - * struct ieee80211_network *pNetwork //usually current network we are live in + * input: struct ieee80211_device *ieee + * struct ieee80211_network *pNetwork //usually current network we are live in * output: none * return: none * notice: This function should ONLY be called before association ********************************************************************************************************************/ -void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork) +void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; // u16 nMaxAMSDUSize; @@ -1235,7 +1235,7 @@ void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80 pHTInfo->ePeerHTSpecVer = pNetwork->bssht.bdHTSpecVer; // Save HTCap and HTInfo information Element - if(pNetwork->bssht.bdHTCapLen > 0 && pNetwork->bssht.bdHTCapLen <= sizeof(pHTInfo->PeerHTCapBuf)) + if(pNetwork->bssht.bdHTCapLen > 0 && pNetwork->bssht.bdHTCapLen <= sizeof(pHTInfo->PeerHTCapBuf)) memcpy(pHTInfo->PeerHTCapBuf, pNetwork->bssht.bdHTCapBuf, pNetwork->bssht.bdHTCapLen); if(pNetwork->bssht.bdHTInfoLen > 0 && pNetwork->bssht.bdHTInfoLen <= sizeof(pHTInfo->PeerHTInfoBuf)) @@ -1297,7 +1297,7 @@ void HTResetSelfAndSavePeerSetting(struct ieee80211_device* ieee, struct ieee80 } -void HTUpdateSelfAndPeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork) +void HTUpdateSelfAndPeerSetting(struct ieee80211_device* ieee, struct ieee80211_network * pNetwork) { PRT_HIGH_THROUGHPUT pHTInfo = ieee->pHTInfo; // PHT_CAPABILITY_ELE pPeerHTCap = (PHT_CAPABILITY_ELE)pNetwork->bssht.bdHTCapBuf; @@ -1364,8 +1364,8 @@ void HTUseDefaultSetting(struct ieee80211_device* ieee) } /******************************************************************************************************************** *function: check whether HT control field exists - * input: struct ieee80211_device *ieee - * u8* pFrame //coming skb->data + * input: struct ieee80211_device *ieee + * u8* pFrame //coming skb->data * output: none * return: return true if HT control field exists(false otherwise) * notice: diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h index 9e4ced15edf5..2348ccd70be0 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h @@ -81,8 +81,7 @@ typedef union _QOS_CTRL_FIELD{ u16 shortData; // WMM spec - struct - { + struct { u8 UP:3; u8 usRsvd1:1; u8 EOSP:1; @@ -92,8 +91,7 @@ typedef union _QOS_CTRL_FIELD{ }WMM; // 802.11e: QoS data type frame sent by non-AP QSTAs. - struct - { + struct { u8 TID:4; u8 bIsQsize:1;// 0: BIT[8:15] is TXOP Duration Requested, 1: BIT[8:15] is Queue Size. u8 AckPolicy:2; @@ -102,8 +100,7 @@ typedef union _QOS_CTRL_FIELD{ }BySta; // 802.11e: QoS data, QoS Null, and QoS Data+CF-Ack frames sent by HC. - struct - { + struct { u8 TID:4; u8 EOSP:1; u8 AckPolicy:2; @@ -112,8 +109,7 @@ typedef union _QOS_CTRL_FIELD{ }ByHc_Data; // 802.11e: QoS (+) CF-Poll frames sent by HC. - struct - { + struct { u8 TID:4; u8 EOSP:1; u8 AckPolicy:2; @@ -133,14 +129,12 @@ typedef union _QOS_CTRL_FIELD{ typedef union _QOS_INFO_FIELD{ u8 charData; - struct - { + struct { u8 ucParameterSetCount:4; u8 ucReserved:4; }WMM; - struct - { + struct { //Ref WMM_Specification_1-1.pdf, 2006-06-13 Isaiah u8 ucAC_VO_UAPSD:1; u8 ucAC_VI_UAPSD:1; @@ -152,16 +146,14 @@ typedef union _QOS_INFO_FIELD{ }ByWmmPsSta; - struct - { + struct { //Ref WMM_Specification_1-1.pdf, 2006-06-13 Isaiah u8 ucParameterSetCount:4; u8 ucReserved:3; u8 ucApUapsd:1; }ByWmmPsAp; - struct - { + struct { u8 ucAC3_UAPSD:1; u8 ucAC2_UAPSD:1; u8 ucAC1_UAPSD:1; @@ -171,8 +163,7 @@ typedef union _QOS_INFO_FIELD{ u8 ucMoreDataAck:1; } By11eSta; - struct - { + struct { u8 ucParameterSetCount:4; u8 ucQAck:1; u8 ucQueueReq:1; @@ -180,16 +171,14 @@ typedef union _QOS_INFO_FIELD{ u8 ucReserved:1; } By11eAp; - struct - { + struct { u8 ucReserved1:4; u8 ucQAck:1; u8 ucReserved2:2; u8 ucMoreDataAck:1; } ByWmmsaSta; - struct - { + struct { u8 ucReserved1:4; u8 ucQAck:1; u8 ucQueueReq:1; @@ -197,8 +186,7 @@ typedef union _QOS_INFO_FIELD{ u8 ucReserved2:1; } ByWmmsaAp; - struct - { + struct { u8 ucAC3_UAPSD:1; u8 ucAC2_UAPSD:1; u8 ucAC1_UAPSD:1; @@ -208,8 +196,7 @@ typedef union _QOS_INFO_FIELD{ u8 ucMoreDataAck:1; } ByAllSta; - struct - { + struct { u8 ucParameterSetCount:4; u8 ucQAck:1; u8 ucQueueReq:1; @@ -246,8 +233,7 @@ typedef u32 AC_CODING; typedef union _ACI_AIFSN{ u8 charData; - struct - { + struct { u8 AIFSN:4; u8 ACM:1; u8 ACI:2; @@ -261,8 +247,7 @@ typedef union _ACI_AIFSN{ // typedef union _ECW{ u8 charData; - struct - { + struct { u8 ECWmin:4; u8 ECWmax:4; }f; // Field @@ -276,8 +261,7 @@ typedef union _AC_PARAM{ u32 longData; u8 charData[4]; - struct - { + struct { ACI_AIFSN AciAifsn; ECW Ecw; u16 TXOPLimit; @@ -336,8 +320,7 @@ typedef union _QOS_TSINFO{ typedef union _TSPEC_BODY{ u8 charData[55]; - struct - { + struct { QOS_TSINFO TSInfo; //u8 TSInfo[3]; u16 NominalMSDUsize; u16 MaxMSDUsize; @@ -412,14 +395,14 @@ typedef union _QOS_TCLAS{ struct _TYPE_GENERAL{ u8 Priority; - u8 ClassifierType; - u8 Mask; + u8 ClassifierType; + u8 Mask; } TYPE_GENERAL; struct _TYPE0_ETH{ u8 Priority; - u8 ClassifierType; - u8 Mask; + u8 ClassifierType; + u8 Mask; u8 SrcAddr[6]; u8 DstAddr[6]; u16 Type; @@ -427,9 +410,9 @@ typedef union _QOS_TCLAS{ struct _TYPE1_IPV4{ u8 Priority; - u8 ClassifierType; - u8 Mask; - u8 Version; + u8 ClassifierType; + u8 Mask; + u8 Version; u8 SrcIP[4]; u8 DstIP[4]; u16 SrcPort; @@ -441,9 +424,9 @@ typedef union _QOS_TCLAS{ struct _TYPE1_IPV6{ u8 Priority; - u8 ClassifierType; - u8 Mask; - u8 Version; + u8 ClassifierType; + u8 Mask; + u8 Version; u8 SrcIP[16]; u8 DstIP[16]; u16 SrcPort; @@ -453,8 +436,8 @@ typedef union _QOS_TCLAS{ struct _TYPE2_8021Q{ u8 Priority; - u8 ClassifierType; - u8 Mask; + u8 ClassifierType; + u8 Mask; u16 TagType; } TYPE2_8021Q; } QOS_TCLAS, *PQOS_TCLAS; @@ -481,7 +464,7 @@ typedef struct _QOS_TSTREAM{ // "Qos control field" and "Qos info field" //typedef struct _QOS_UAPSD{ // u8 bTriggerEnable[4]; -// u8 MaxSPLength; +// u8 MaxSPLength; // u8 HighestBufAC; //} QOS_UAPSD, *PQOS_APSD; @@ -489,7 +472,7 @@ typedef struct _QOS_TSTREAM{ // 802.11 Management frame Status Code field //---------------------------------------------------------------------------- typedef struct _OCTET_STRING{ - u8 *Octet; + u8 *Octet; u16 Length; }OCTET_STRING, *POCTET_STRING; @@ -512,7 +495,7 @@ typedef struct _STA_QOS{ AC_UAPSD Curr4acUapsd; u8 bInServicePeriod; u8 MaxSPLength; - int NumBcnBeforeTrigger; + int NumBcnBeforeTrigger; // Part 2. EDCA Parameter (perAC) u8 * pWMMInfoEle; @@ -523,7 +506,7 @@ typedef struct _STA_QOS{ //2 ToDo: remove the Qos Info Field and replace it by the above WMM Info element. // By Bruce, 2008-01-30. // Part 2. EDCA Parameter (perAC) - QOS_INFO_FIELD QosInfoField_STA; // Maintained by STA + QOS_INFO_FIELD QosInfoField_STA; // Maintained by STA QOS_INFO_FIELD QosInfoField_AP; // Retrieved from AP AC_PARAM CurAcParameters[4]; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h index e7e26fd96395..7ed7243b1fb0 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TS.h @@ -28,7 +28,7 @@ typedef struct _TS_COMMON_INFO{ typedef struct _TX_TS_RECORD{ TS_COMMON_INFO TsCommonInfo; u16 TxCurSeq; - BA_RECORD TxPendingBARecord; // For BA Originator + BA_RECORD TxPendingBARecord; // For BA Originator BA_RECORD TxAdmittedBARecord; // For BA Originator // QOS_DL_RECORD DLRecord; u8 bAddBaReqInProgress; @@ -53,4 +53,3 @@ typedef struct _RX_TS_RECORD { #endif - diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 06a9824bbff1..0310d07287a1 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -27,7 +27,7 @@ void RxPktPendingTimeout(unsigned long data) PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]); - PRX_REORDER_ENTRY pReorderEntry = NULL; + PRX_REORDER_ENTRY pReorderEntry = NULL; //u32 flags = 0; unsigned long flags = 0; @@ -236,8 +236,8 @@ void AdmitTS(struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, u32 I PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee, u8* Addr, u8 TID, TR_SELECT TxRxSelect) { - //DIRECTION_VALUE dir; - u8 dir; + //DIRECTION_VALUE dir; + u8 dir; bool search_dir[4] = {0, 0, 0, 0}; struct list_head* psearch_list; //FIXME PTS_COMMON_INFO pRet = NULL; @@ -250,14 +250,14 @@ PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee, u8* Addr, u8 } else { - search_dir[DIR_UP] = true; + search_dir[DIR_UP] = true; search_dir[DIR_BI_DIR]= true; } } else if(ieee->iw_mode == IW_MODE_ADHOC) { if(TxRxSelect == TX_DIR) - search_dir[DIR_UP] = true; + search_dir[DIR_UP] = true; else search_dir[DIR_DOWN] = true; } @@ -265,7 +265,7 @@ PTS_COMMON_INFO SearchAdmitTRStream(struct ieee80211_device *ieee, u8* Addr, u8 { if(TxRxSelect == TX_DIR) { - search_dir[DIR_UP] = true; + search_dir[DIR_UP] = true; search_dir[DIR_BI_DIR]= true; search_dir[DIR_DIRECT]= true; } @@ -450,8 +450,8 @@ bool GetTs( pTSInfo->field.ucTSID = UP; // TSID pTSInfo->field.ucDirection = Dir; // Direction: if there is DirectLink, this need additional consideration. pTSInfo->field.ucAccessPolicy = 1; // Access policy - pTSInfo->field.ucAggregation = 0; // Aggregation - pTSInfo->field.ucPSB = 0; // Aggregation + pTSInfo->field.ucAggregation = 0; // Aggregation + pTSInfo->field.ucPSB = 0; // Aggregation pTSInfo->field.ucUP = UP; // User priority pTSInfo->field.ucTSInfoAckPolicy = 0; // Ack policy pTSInfo->field.ucSchedule = 0; // Schedule @@ -488,7 +488,7 @@ void RemoveTsEntry( { //#ifdef TO_DO_LIST PRX_REORDER_ENTRY pRxReorderEntry; - PRX_TS_RECORD pRxTS = (PRX_TS_RECORD)pTs; + PRX_TS_RECORD pRxTS = (PRX_TS_RECORD)pTs; if(timer_pending(&pRxTS->RxPktPendingTimer)) del_timer_sync(&pRxTS->RxPktPendingTimer); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl_crypto.h b/drivers/staging/rtl8192u/ieee80211/rtl_crypto.h index ccf6ae763572..c3c87108ee9e 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl_crypto.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl_crypto.h @@ -52,10 +52,10 @@ #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 -#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 -#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 -#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000 -#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000 +#define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 +#define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 +#define CRYPTO_TFM_RES_BAD_BLOCK_LEN 0x00800000 +#define CRYPTO_TFM_RES_BAD_FLAGS 0x01000000 /* * Miscellaneous stuff. @@ -73,7 +73,7 @@ struct cipher_alg { unsigned int cia_min_keysize; unsigned int cia_max_keysize; int (*cia_setkey)(void *ctx, const u8 *key, - unsigned int keylen, u32 *flags); + unsigned int keylen, u32 *flags); void (*cia_encrypt)(void *ctx, u8 *dst, const u8 *src); void (*cia_decrypt)(void *ctx, u8 *dst, const u8 *src); }; @@ -84,16 +84,16 @@ struct digest_alg { void (*dia_update)(void *ctx, const u8 *data, unsigned int len); void (*dia_final)(void *ctx, u8 *out); int (*dia_setkey)(void *ctx, const u8 *key, - unsigned int keylen, u32 *flags); + unsigned int keylen, u32 *flags); }; struct compress_alg { int (*coa_init)(void *ctx); void (*coa_exit)(void *ctx); int (*coa_compress)(void *ctx, const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); + u8 *dst, unsigned int *dlen); int (*coa_decompress)(void *ctx, const u8 *src, unsigned int slen, - u8 *dst, unsigned int *dlen); + u8 *dst, unsigned int *dlen); }; #define cra_cipher cra_u.cipher @@ -139,15 +139,15 @@ struct cipher_tfm { unsigned int cit_ivsize; u32 cit_mode; int (*cit_setkey)(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen); + const u8 *key, unsigned int keylen); int (*cit_encrypt)(struct crypto_tfm *tfm, struct scatterlist *dst, struct scatterlist *src, unsigned int nbytes); int (*cit_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); int (*cit_decrypt)(struct crypto_tfm *tfm, struct scatterlist *dst, struct scatterlist *src, @@ -162,12 +162,12 @@ struct cipher_tfm { struct digest_tfm { void (*dit_init)(struct crypto_tfm *tfm); void (*dit_update)(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg); + struct scatterlist *sg, unsigned int nsg); void (*dit_final)(struct crypto_tfm *tfm, u8 *out); void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, - unsigned int nsg, u8 *out); + unsigned int nsg, u8 *out); int (*dit_setkey)(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen); + const u8 *key, unsigned int keylen); #ifdef CONFIG_CRYPTO_HMAC void *dit_hmac_block; #endif @@ -175,11 +175,11 @@ struct digest_tfm { struct compress_tfm { int (*cot_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); int (*cot_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); }; #define crt_cipher crt_u.cipher @@ -277,8 +277,8 @@ static inline void crypto_digest_init(struct crypto_tfm *tfm) } static inline void crypto_digest_update(struct crypto_tfm *tfm, - struct scatterlist *sg, - unsigned int nsg) + struct scatterlist *sg, + unsigned int nsg) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); tfm->crt_digest.dit_update(tfm, sg, nsg); @@ -291,15 +291,15 @@ static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) } static inline void crypto_digest_digest(struct crypto_tfm *tfm, - struct scatterlist *sg, - unsigned int nsg, u8 *out) + struct scatterlist *sg, + unsigned int nsg, u8 *out) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); tfm->crt_digest.dit_digest(tfm, sg, nsg, out); } static inline int crypto_digest_setkey(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen) + const u8 *key, unsigned int keylen) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); if (tfm->crt_digest.dit_setkey == NULL) @@ -308,25 +308,25 @@ static inline int crypto_digest_setkey(struct crypto_tfm *tfm, } static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, - const u8 *key, unsigned int keylen) + const u8 *key, unsigned int keylen) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); return tfm->crt_cipher.cit_setkey(tfm, key, keylen); } 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); } static inline int crypto_cipher_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) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); @@ -334,18 +334,18 @@ static inline int crypto_cipher_encrypt_iv(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); } static inline int crypto_cipher_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) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB); @@ -353,30 +353,30 @@ static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, } static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, - const u8 *src, unsigned int len) + const u8 *src, unsigned int len) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); memcpy(tfm->crt_cipher.cit_iv, src, len); } static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, - u8 *dst, unsigned int len) + u8 *dst, unsigned int len) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); memcpy(dst, tfm->crt_cipher.cit_iv, len); } static inline int crypto_comp_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) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen); } static inline int crypto_comp_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) { BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen); @@ -388,12 +388,11 @@ static inline int crypto_comp_decompress(struct crypto_tfm *tfm, #ifdef CONFIG_CRYPTO_HMAC void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen); void crypto_hmac_update(struct crypto_tfm *tfm, - struct scatterlist *sg, unsigned int nsg); + struct scatterlist *sg, unsigned int nsg); void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key, - unsigned int *keylen, u8 *out); + unsigned int *keylen, u8 *out); void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen, - struct scatterlist *sg, unsigned int nsg, u8 *out); + struct scatterlist *sg, unsigned int nsg, u8 *out); #endif /* CONFIG_CRYPTO_HMAC */ #endif /* _LINUX_CRYPTO_H */ - |