diff options
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211.h | 118 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 27 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 1 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 15 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 16 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 46 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 20 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.c | 9 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.h | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_wx.c | 2 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_wx.h | 2 |
14 files changed, 127 insertions, 141 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index b062cad..3addaa6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -323,7 +323,7 @@ typedef struct ieee_param { u8 key[0]; } crypt; } u; -}ieee_param; +} ieee_param; // linux under 2.6.9 release may not support it, so modify it for common use @@ -412,15 +412,15 @@ typedef struct ieee_param { #define IEEE80211_QCTL_TID 0x000F #define FC_QOS_BIT BIT(7) -#define IsDataFrame(pdu) ( ((pdu[0] & 0x0C)==0x08) ? true : false ) -#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0]&FC_QOS_BIT)) ) +#define IsDataFrame(pdu) (((pdu[0] & 0x0C) == 0x08) ? true : false) +#define IsLegacyDataFrame(pdu) (IsDataFrame(pdu) && (!(pdu[0] & FC_QOS_BIT))) //added by wb. Is this right? -#define IsQoSDataFrame(pframe) ((*(u16 *)pframe&(IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA|IEEE80211_FTYPE_DATA)) -#define Frame_Order(pframe) (*(u16 *)pframe&IEEE80211_FCTL_ORDER) -#define SN_LESS(a, b) (((a-b)&0x800)!=0) +#define IsQoSDataFrame(pframe) ((*(u16 *)pframe & (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) == (IEEE80211_STYPE_QOS_DATA | IEEE80211_FTYPE_DATA)) +#define Frame_Order(pframe) (*(u16 *)pframe & IEEE80211_FCTL_ORDER) +#define SN_LESS(a, b) (((a - b) & 0x800) != 0) #define SN_EQUAL(a, b) (a == b) #define MAX_DEV_ADDR_SIZE 8 -typedef enum _ACT_CATEGORY{ +typedef enum _ACT_CATEGORY { ACT_CAT_QOS = 1, ACT_CAT_DLS = 2, ACT_CAT_BA = 3, @@ -428,24 +428,24 @@ typedef enum _ACT_CATEGORY{ ACT_CAT_WMM = 17, } ACT_CATEGORY, *PACT_CATEGORY; -typedef enum _TS_ACTION{ +typedef enum _TS_ACTION { ACT_ADDTSREQ = 0, ACT_ADDTSRSP = 1, ACT_DELTS = 2, ACT_SCHEDULE = 3, } TS_ACTION, *PTS_ACTION; -typedef enum _BA_ACTION{ +typedef enum _BA_ACTION { ACT_ADDBAREQ = 0, ACT_ADDBARSP = 1, ACT_DELBA = 2, } BA_ACTION, *PBA_ACTION; -typedef enum _InitialGainOpType{ - IG_Backup=0, +typedef enum _InitialGainOpType { + IG_Backup = 0, IG_Restore, IG_Max -}InitialGainOpType; +} InitialGainOpType; /* debug macros */ #define CONFIG_IEEE80211_DEBUG @@ -457,22 +457,22 @@ do { if (ieee80211_debug_level & (level)) \ //wb added to debug out data buf //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)) \ + do { if ((ieee80211_debug_level & (level)) == (level)) \ { \ int i; \ u8 *pdata = (u8 *) data; \ printk(KERN_DEBUG "ieee80211: %s()\n", __func__); \ - for(i=0; i<(int)(datalen); i++) \ + for (i = 0; i < (int)(datalen); i++) \ { \ printk("%2x ", pdata[i]); \ - if ((i+1)%16 == 0) printk("\n"); \ + if ((i + 1) % 16 == 0) printk("\n"); \ } \ printk("\n"); \ } \ } while (0) #else -#define IEEE80211_DEBUG(level, fmt, args...) do {} while (0) -#define IEEE80211_DEBUG_DATA(level, data, datalen) do {} while(0) +#define IEEE80211_DEBUG (level, fmt, args...) do {} while (0) +#define IEEE80211_DEBUG_DATA (level, data, datalen) do {} while(0) #endif /* CONFIG_IEEE80211_DEBUG */ /* debug macros not dependent on CONFIG_IEEE80211_DEBUG */ @@ -876,9 +876,9 @@ enum ieee80211_mfie { MFIE_TYPE_ERP = 42, MFIE_TYPE_RSN = 48, MFIE_TYPE_RATES_EX = 50, - MFIE_TYPE_HT_CAP= 45, - MFIE_TYPE_HT_INFO= 61, - MFIE_TYPE_AIRONET=133, + MFIE_TYPE_HT_CAP = 45, + MFIE_TYPE_HT_INFO = 61, + MFIE_TYPE_AIRONET = 133, MFIE_TYPE_GENERIC = 221, MFIE_TYPE_QOS_PARAMETER = 222, }; @@ -1051,7 +1051,7 @@ typedef union _frameqos { u16 ack_policy:2; u16 reserved:1; u16 txop:8; - }field; + } field; } frameqos, *pframeqos; /* SWEEP TABLE ENTRIES NUMBER*/ @@ -1196,7 +1196,7 @@ static inline u8 Frame_QoSTID(u8 *buf) u16 fc; hdr = (struct rtl_80211_hdr_3addr *)buf; fc = le16_to_cpu(hdr->frame_ctl); - return (u8)((frameqos *)(buf + (((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24)))->field.tid; + return (u8)((frameqos *)(buf + (((fc & IEEE80211_FCTL_TODS) && (fc & IEEE80211_FCTL_FROMDS)) ? 30 : 24)))->field.tid; } //added by amy for reorder @@ -1209,7 +1209,7 @@ struct eapol { u16 length; } __packed; -struct ieee80211_softmac_stats{ +struct ieee80211_softmac_stats { unsigned int rx_ass_ok; unsigned int rx_ass_err; unsigned int rx_probe_rq; @@ -1320,7 +1320,7 @@ struct ether_header { #define ETHERTYPE_IP 0x0800 /* IP protocol */ #endif -typedef enum _erp_t{ +typedef enum _erp_t { ERP_NonERPpresent = 0x01, ERP_UseProtection = 0x02, ERP_BarkerPreambleMode = 0x04, @@ -1479,37 +1479,35 @@ typedef struct _RX_REORDER_ENTRY { struct ieee80211_rxb *prxb; } RX_REORDER_ENTRY, *PRX_REORDER_ENTRY; //added by amy for order -typedef enum _Fsync_State{ +typedef enum _Fsync_State { Default_Fsync, HW_Fsync, SW_Fsync -}Fsync_State; +} Fsync_State; // Power save mode configured. -typedef enum _RT_PS_MODE -{ +typedef enum _RT_PS_MODE { eActive, // Active/Continuous access. eMaxPs, // Max power save mode. eFastPs // Fast power save mode. -}RT_PS_MODE; +} RT_PS_MODE; -typedef enum _IPS_CALLBACK_FUNCION -{ +typedef enum _IPS_CALLBACK_FUNCION { IPS_CALLBACK_NONE = 0, IPS_CALLBACK_MGNT_LINK_REQUEST = 1, IPS_CALLBACK_JOIN_REQUEST = 2, -}IPS_CALLBACK_FUNCION; +} IPS_CALLBACK_FUNCION; -typedef enum _RT_JOIN_ACTION{ +typedef enum _RT_JOIN_ACTION { RT_JOIN_INFRA = 1, RT_JOIN_IBSS = 2, RT_START_IBSS = 3, RT_NO_ACTION = 4, -}RT_JOIN_ACTION; +} RT_JOIN_ACTION; -typedef struct _IbssParms{ +typedef struct _IbssParms { u16 atimWin; -}IbssParms, *PIbssParms; +} IbssParms, *PIbssParms; #define MAX_NUM_RATES 264 // Max num of support rates element: 8, Max num of ext. support rate: 255. 061122, by rcnjko. // RF state. @@ -1517,7 +1515,7 @@ typedef enum _RT_RF_POWER_STATE { eRfOn, eRfSleep, eRfOff -}RT_RF_POWER_STATE; +} RT_RF_POWER_STATE; typedef struct _RT_POWER_SAVE_CONTROL { @@ -1572,8 +1570,7 @@ typedef u32 RT_RF_CHANGE_SOURCE; #define RF_CHANGE_BY_IPS BIT(28) #define RF_CHANGE_BY_INIT 0 // Do not change the RFOff reason. Defined by Bruce, 2008-01-17. -typedef enum -{ +typedef enum { COUNTRY_CODE_FCC = 0, COUNTRY_CODE_IC = 1, COUNTRY_CODE_ETSI = 2, @@ -1585,10 +1582,10 @@ typedef enum COUNTRY_CODE_TELEC, COUNTRY_CODE_MIC, COUNTRY_CODE_GLOBAL_DOMAIN -}country_code_type_t; +} country_code_type_t; #define RT_MAX_LD_SLOT_NUM 10 -typedef struct _RT_LINK_DETECT_T{ +typedef struct _RT_LINK_DETECT_T { u32 NumRecvBcnInPeriod; u32 NumRecvDataInPeriod; @@ -1601,7 +1598,7 @@ typedef struct _RT_LINK_DETECT_T{ u32 NumTxOkInPeriod; u32 NumRxOkInPeriod; bool bBusyTraffic; -}RT_LINK_DETECT_T, *PRT_LINK_DETECT_T; +} RT_LINK_DETECT_T, *PRT_LINK_DETECT_T; struct ieee80211_device { @@ -1917,11 +1914,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, + 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 (*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 @@ -1989,16 +1986,16 @@ struct ieee80211_device { * stop_send_bacons is NOT guaranteed to be called only * after start_send_beacons. */ - void (*start_send_beacons) (struct net_device *dev,u16 tx_rate); - void (*stop_send_beacons) (struct net_device *dev); + void (*start_send_beacons)(struct net_device *dev, u16 tx_rate); + void (*stop_send_beacons)(struct net_device *dev); /* power save mode related */ - void (*sta_wake_up) (struct net_device *dev); - void (*ps_request_tx_ack) (struct net_device *dev); - void (*enter_sleep_state) (struct net_device *dev, u32 th, u32 tl); - short (*ps_is_queue_empty) (struct net_device *dev); - int (*handle_beacon) (struct net_device *dev, struct ieee80211_beacon *beacon, struct ieee80211_network *network); - int (*handle_assoc_response) (struct net_device *dev, struct ieee80211_assoc_response_frame *resp, struct ieee80211_network *network); + void (*sta_wake_up)(struct net_device *dev); + void (*ps_request_tx_ack)(struct net_device *dev); + void (*enter_sleep_state)(struct net_device *dev, u32 th, u32 tl); + short (*ps_is_queue_empty)(struct net_device *dev); + int (*handle_beacon)(struct net_device *dev, struct ieee80211_beacon *beacon, struct ieee80211_network *network); + int (*handle_assoc_response)(struct net_device *dev, struct ieee80211_assoc_response_frame *resp, struct ieee80211_network *network); /* check whether Tx hw resource available */ @@ -2023,7 +2020,7 @@ struct ieee80211_device { #define IEEE_G (1<<2) #define IEEE_N_24G (1<<4) #define IEEE_N_5G (1<<5) -#define IEEE_MODE_MASK (IEEE_A|IEEE_B|IEEE_G) +#define IEEE_MODE_MASK (IEEE_A | IEEE_B | IEEE_G) /* Generate a 802.11 header */ @@ -2112,7 +2109,7 @@ static inline int ieee80211_get_hdrlen(u16 fc) case IEEE80211_FTYPE_DATA: if ((fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS)) hdrlen = IEEE80211_4ADDR_LEN; /* Addr4 */ - if(IEEE80211_QOS_HAS_SEQ(fc)) + if (IEEE80211_QOS_HAS_SEQ(fc)) hdrlen += 2; /* QOS ctrl*/ break; case IEEE80211_FTYPE_CTL: @@ -2379,7 +2376,7 @@ void HTUpdateSelfAndPeerSetting(struct ieee80211_device *ieee, u8 HTGetHighestMCSRate(struct ieee80211_device *ieee, u8 *pMCSRateSet, u8 *pMCSFilter); extern u8 MCS_FILTER_ALL[]; -extern u16 MCS_DATA_RATE[2][2][77] ; +extern u16 MCS_DATA_RATE[2][2][77]; u8 HTCCheck(struct ieee80211_device *ieee, u8 *pFrame); //extern void HTSetConnectBwModeCallback(unsigned long data); void HTResetIOTSetting(PRT_HIGH_THROUGHPUT pHTInfo); @@ -2395,9 +2392,9 @@ void TsInitAddBA(struct ieee80211_device *ieee, PTX_TS_RECORD pTS, u8 Policy, u8 bOverwritePending); void TsInitDelBA(struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SELECT TxRxSelect); -void BaSetupTimeOut(unsigned long data); -void TxBaInactTimeout(unsigned long data); -void RxBaInactTimeout(unsigned long data); +void BaSetupTimeOut(struct timer_list *t); +void TxBaInactTimeout(struct timer_list *t); +void RxBaInactTimeout(struct timer_list *t); void ResetBaEntry(PBA_RECORD pBA); //function in TS.c bool GetTs( @@ -2426,7 +2423,8 @@ static inline int ieee80211_get_scans(struct ieee80211_device *ieee) return ieee->scans; } -static inline const char *escape_essid(const char *essid, u8 essid_len) { +static inline const char *escape_essid(const char *essid, u8 essid_len) +{ static char escaped[IW_ESSID_MAX_SIZE * 2 + 1]; if (ieee80211_is_empty_essid(essid, essid_len)) { diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c index 48e80be..6f45781 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c @@ -57,9 +57,9 @@ void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, } } -void ieee80211_crypt_deinit_handler(unsigned long data) +void ieee80211_crypt_deinit_handler(struct timer_list *t) { - struct ieee80211_device *ieee = (struct ieee80211_device *)data; + struct ieee80211_device *ieee = from_timer(ieee, t, crypt_deinit_timer); unsigned long flags; spin_lock_irqsave(&ieee->lock, flags); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h index a0aa0f5..1f2aea7 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.h @@ -83,7 +83,7 @@ int ieee80211_register_crypto_ops(struct ieee80211_crypto_ops *ops); int ieee80211_unregister_crypto_ops(struct ieee80211_crypto_ops *ops); struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const char *name); void ieee80211_crypt_deinit_entries(struct ieee80211_device *ieee, int force); -void ieee80211_crypt_deinit_handler(unsigned long data); +void ieee80211_crypt_deinit_handler(struct timer_list *t); void ieee80211_crypt_delayed_deinit(struct ieee80211_device *ieee, struct ieee80211_crypt_data **crypt); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index 8f236b3..90a097f 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -133,8 +133,8 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ieee->ieee802_1x = 1; /* Default to supporting 802.1x */ INIT_LIST_HEAD(&ieee->crypt_deinit_list); - setup_timer(&ieee->crypt_deinit_timer, - ieee80211_crypt_deinit_handler, (unsigned long)ieee); + timer_setup(&ieee->crypt_deinit_timer, ieee80211_crypt_deinit_handler, + 0); spin_lock_init(&ieee->lock); spin_lock_init(&ieee->wpax_suitlist_lock); diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index fe6f38b..4e79083 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -2948,8 +2948,9 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, struct ieee_param *param, int param_len) { int ret = 0; + const char *module = NULL; - struct ieee80211_crypto_ops *ops; + struct ieee80211_crypto_ops *ops = NULL; struct ieee80211_crypt_data **crypt; struct ieee80211_security sec = { @@ -2995,19 +2996,17 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, strcmp(param->u.crypt.alg, "TKIP")) goto skip_host_crypt; - ops = ieee80211_get_crypto_ops(param->u.crypt.alg); - if (ops == NULL && strcmp(param->u.crypt.alg, "WEP") == 0) { - request_module("ieee80211_crypt_wep"); - ops = ieee80211_get_crypto_ops(param->u.crypt.alg); - //set WEP40 first, it will be modified according to WEP104 or WEP40 at other place - } else if (ops == NULL && strcmp(param->u.crypt.alg, "TKIP") == 0) { - request_module("ieee80211_crypt_tkip"); - ops = ieee80211_get_crypto_ops(param->u.crypt.alg); - } else if (ops == NULL && strcmp(param->u.crypt.alg, "CCMP") == 0) { - request_module("ieee80211_crypt_ccmp"); - ops = ieee80211_get_crypto_ops(param->u.crypt.alg); - } - if (ops == NULL) { + //set WEP40 first, it will be modified according to WEP104 or WEP40 at other place + if (!strcmp(param->u.crypt.alg, "WEP")) + module = "ieee80211_crypt_wep"; + else if (!strcmp(param->u.crypt.alg, "TKIP")) + module = "ieee80211_crypt_tkip"; + else if (!strcmp(param->u.crypt.alg, "CCMP")) + module = "ieee80211_crypt_ccmp"; + if (module) + ops = try_then_request_module(ieee80211_get_crypto_ops(param->u.crypt.alg), + module); + if (!ops) { printk("unknown crypto alg '%s'\n", param->u.crypt.alg); param->u.crypt.err = IEEE_CRYPT_ERR_UNKNOWN_ALG; ret = -EINVAL; diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index f58971a..9a1a845 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -302,7 +302,6 @@ ieee80211_classify(struct sk_buff *skb, struct ieee80211_network *network) } } -#define SN_LESS(a, b) (((a-b)&0x800)!=0) static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, struct sk_buff *skb, struct cb_desc *tcb_desc) { diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index c925e53..f2fcdec 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -364,11 +364,8 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, GFP_KERNEL); if (!new_crypt) return -ENOMEM; - new_crypt->ops = ieee80211_get_crypto_ops("WEP"); - if (!new_crypt->ops) { - request_module("ieee80211_crypt_wep"); - new_crypt->ops = ieee80211_get_crypto_ops("WEP"); - } + new_crypt->ops = try_then_request_module(ieee80211_get_crypto_ops("WEP"), + "ieee80211_crypt_wep"); if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) new_crypt->priv = new_crypt->ops->init(key); @@ -591,12 +588,8 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, } printk("alg name:%s\n",alg); - ops = ieee80211_get_crypto_ops(alg); - if (ops == NULL) { - request_module(module); - ops = ieee80211_get_crypto_ops(alg); - } - if (ops == NULL) { + ops = try_then_request_module(ieee80211_get_crypto_ops(alg), module); + if (!ops) { IEEE80211_DEBUG_WX("%s: unknown crypto alg %d\n", dev->name, ext->alg); printk("========>unknown crypto alg %d\n", ext->alg); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 4b92bb5..21b55fd 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -144,7 +144,7 @@ static struct sk_buff *ieee80211_ADDBA(struct ieee80211_device *ieee, u8 *Dst, P if (ACT_ADDBARSP == type) { // Status Code - printk(KERN_INFO "=====>to send ADDBARSP\n"); + netdev_info(ieee->dev, "=====>to send ADDBARSP\n"); put_unaligned_le16(StatusCode, tag); tag += 2; @@ -346,7 +346,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb) pBaTimeoutVal = (u16 *)(tag + 5); pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7); - printk(KERN_INFO "====================>rx ADDBAREQ from :%pM\n", dst); + netdev_info(ieee->dev, "====================>rx ADDBAREQ from :%pM\n", dst); //some other capability is not ready now. if ((ieee->current_network.qos_data.active == 0) || (!ieee->pHTInfo->bCurrentHTSupport)) //|| @@ -673,18 +673,18 @@ TsInitDelBA( struct ieee80211_device *ieee, PTS_COMMON_INFO pTsCommonInfo, TR_SE * return: NULL * notice: ********************************************************************************************************************/ -void BaSetupTimeOut(unsigned long data) +void BaSetupTimeOut(struct timer_list *t) { - PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)data; + PTX_TS_RECORD pTxTs = from_timer(pTxTs, t, TxPendingBARecord.Timer); pTxTs->bAddBaReqInProgress = false; pTxTs->bAddBaReqDelayed = true; pTxTs->TxPendingBARecord.bValid = false; } -void TxBaInactTimeout(unsigned long data) +void TxBaInactTimeout(struct timer_list *t) { - PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)data; + PTX_TS_RECORD pTxTs = from_timer(pTxTs, t, TxAdmittedBARecord.Timer); struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[pTxTs->num]); TxTsDeleteBA(ieee, pTxTs); ieee80211_send_DELBA( @@ -695,9 +695,9 @@ void TxBaInactTimeout(unsigned long data) DELBA_REASON_TIMEOUT); } -void RxBaInactTimeout(unsigned long data) +void RxBaInactTimeout(struct timer_list *t) { - PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; + PRX_TS_RECORD pRxTs = from_timer(pRxTs, t, RxAdmittedBARecord.Timer); struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]); RxTsDeleteBA(ieee, pRxTs); diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index f4921ab..e60a262 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -4,13 +4,13 @@ #include <linux/slab.h> #include "rtl819x_TS.h" -static void TsSetupTimeOut(unsigned long data) +static void TsSetupTimeOut(struct timer_list *unused) { // Not implement yet // This is used for WMMSA and ACM , that would send ADDTSReq frame. } -static void TsInactTimeout(unsigned long data) +static void TsInactTimeout(struct timer_list *unused) { // Not implement yet // This is used for WMMSA and ACM. @@ -23,9 +23,9 @@ static void TsInactTimeout(unsigned long data) * return: NULL * notice: ********************************************************************************************************************/ -static void RxPktPendingTimeout(unsigned long data) +static void RxPktPendingTimeout(struct timer_list *t) { - PRX_TS_RECORD pRxTs = (PRX_TS_RECORD)data; + PRX_TS_RECORD pRxTs = from_timer(pRxTs, t, RxPktPendingTimer); struct ieee80211_device *ieee = container_of(pRxTs, struct ieee80211_device, RxTsRecord[pRxTs->num]); PRX_REORDER_ENTRY pReorderEntry = NULL; @@ -90,9 +90,9 @@ static void RxPktPendingTimeout(unsigned long data) * return: NULL * notice: ********************************************************************************************************************/ -static void TsAddBaProcess(unsigned long data) +static void TsAddBaProcess(struct timer_list *t) { - PTX_TS_RECORD pTxTs = (PTX_TS_RECORD)data; + PTX_TS_RECORD pTxTs = from_timer(pTxTs, t, TsAddBaTimer); u8 num = pTxTs->num; struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[num]); @@ -146,16 +146,15 @@ void TSInitialize(struct ieee80211_device *ieee) pTxTS->num = count; // The timers for the operation of Traffic Stream and Block Ack. // DLS related timer will be add here in the future!! - setup_timer(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, - (unsigned long)pTxTS); - setup_timer(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout, - (unsigned long)pTxTS); - setup_timer(&pTxTS->TsAddBaTimer, TsAddBaProcess, - (unsigned long)pTxTS); - setup_timer(&pTxTS->TxPendingBARecord.Timer, BaSetupTimeOut, - (unsigned long)pTxTS); - setup_timer(&pTxTS->TxAdmittedBARecord.Timer, - TxBaInactTimeout, (unsigned long)pTxTS); + timer_setup(&pTxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, + 0); + timer_setup(&pTxTS->TsCommonInfo.InactTimer, TsInactTimeout, + 0); + timer_setup(&pTxTS->TsAddBaTimer, TsAddBaProcess, 0); + timer_setup(&pTxTS->TxPendingBARecord.Timer, BaSetupTimeOut, + 0); + timer_setup(&pTxTS->TxAdmittedBARecord.Timer, + TxBaInactTimeout, 0); ResetTxTsEntry(pTxTS); list_add_tail(&pTxTS->TsCommonInfo.List, &ieee->Tx_TS_Unused_List); pTxTS++; @@ -168,14 +167,13 @@ void TSInitialize(struct ieee80211_device *ieee) for(count = 0; count < TOTAL_TS_NUM; count++) { pRxTS->num = count; INIT_LIST_HEAD(&pRxTS->RxPendingPktList); - setup_timer(&pRxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, - (unsigned long)pRxTS); - setup_timer(&pRxTS->TsCommonInfo.InactTimer, TsInactTimeout, - (unsigned long)pRxTS); - setup_timer(&pRxTS->RxAdmittedBARecord.Timer, - RxBaInactTimeout, (unsigned long)pRxTS); - setup_timer(&pRxTS->RxPktPendingTimer, RxPktPendingTimeout, - (unsigned long)pRxTS); + timer_setup(&pRxTS->TsCommonInfo.SetupTimer, TsSetupTimeOut, + 0); + timer_setup(&pRxTS->TsCommonInfo.InactTimer, TsInactTimeout, + 0); + timer_setup(&pRxTS->RxAdmittedBARecord.Timer, + RxBaInactTimeout, 0); + timer_setup(&pRxTS->RxPktPendingTimer, RxPktPendingTimeout, 0); ResetRxTsEntry(pRxTS); list_add_tail(&pRxTS->TsCommonInfo.List, &ieee->Rx_TS_Unused_List); pRxTS++; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 46b3f19..09f66b3 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -497,7 +497,7 @@ inline void force_pci_posting(struct net_device *dev) static struct net_device_stats *rtl8192_stats(struct net_device *dev); static void rtl8192_restart(struct work_struct *work); -static void watch_dog_timer_callback(unsigned long data); +static void watch_dog_timer_callback(struct timer_list *t); /**************************************************************************** * -----------------------------PROCFS STUFF------------------------- @@ -1687,9 +1687,13 @@ static short rtl8192_usb_initendpoints(struct net_device *dev) #ifndef JACKSON_NEW_RX for (i = 0; i < (MAX_RX_URB + 1); i++) { priv->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL); + if (!priv->rx_urb[i]) + return -ENOMEM; priv->rx_urb[i]->transfer_buffer = kmalloc(RX_URB_SIZE, GFP_KERNEL); + if (!priv->rx_urb[i]->transfer_buffer) + return -ENOMEM; priv->rx_urb[i]->transfer_buffer_length = RX_URB_SIZE; } @@ -2690,15 +2694,11 @@ static short rtl8192_init(struct net_device *dev) err = rtl8192_read_eeprom_info(dev); if (err) { DMESG("Reading EEPROM info failed"); - kfree(priv->pFirmware); - priv->pFirmware = NULL; - free_ieee80211(dev); return err; } rtl8192_get_channel_map(dev); init_hal_dm(dev); - setup_timer(&priv->watch_dog_timer, watch_dog_timer_callback, - (unsigned long)dev); + timer_setup(&priv->watch_dog_timer, watch_dog_timer_callback, 0); if (rtl8192_usb_initendpoints(dev) != 0) { DMESG("Endopoints initialization failed"); return -ENOMEM; @@ -3499,9 +3499,9 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) RT_TRACE(COMP_TRACE, " <==RtUsbCheckForHangWorkItemCallback()\n"); } -static void watch_dog_timer_callback(unsigned long data) +static void watch_dog_timer_callback(struct timer_list *t) { - struct r8192_priv *priv = ieee80211_priv((struct net_device *)data); + struct r8192_priv *priv = from_timer(priv, t, watch_dog_timer); schedule_delayed_work(&priv->watch_dog_wq, 0); mod_timer(&priv->watch_dog_timer, @@ -3528,7 +3528,7 @@ static int _rtl8192_up(struct net_device *dev) if (priv->ieee80211->state != IEEE80211_LINKED) ieee80211_softmac_start_protocol(priv->ieee80211); ieee80211_reset_queue(priv->ieee80211); - watch_dog_timer_callback((unsigned long)dev); + watch_dog_timer_callback(&priv->watch_dog_timer); if (!netif_queue_stopped(dev)) netif_start_queue(dev); else @@ -4994,11 +4994,11 @@ static int rtl8192_usb_probe(struct usb_interface *intf, fail2: rtl8192_down(dev); +fail: kfree(priv->pFirmware); priv->pFirmware = NULL; rtl8192_usb_deleteendpoints(dev); mdelay(10); -fail: free_ieee80211(dev); RT_TRACE(COMP_ERR, "wlan driver load failed\n"); diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 4c241a0..e1b81d34 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -2730,8 +2730,7 @@ static void dm_init_fsync(struct net_device *dev) priv->ieee80211->fsync_seconddiff_ratethreshold = 200; priv->ieee80211->fsync_state = Default_Fsync; priv->framesyncMonitor = 1; /* current default 0xc38 monitor on */ - setup_timer(&priv->fsync_timer, dm_fsync_timer_callback, - (unsigned long)dev); + timer_setup(&priv->fsync_timer, dm_fsync_timer_callback, 0); } static void dm_deInit_fsync(struct net_device *dev) @@ -2741,10 +2740,10 @@ static void dm_deInit_fsync(struct net_device *dev) del_timer_sync(&priv->fsync_timer); } -void dm_fsync_timer_callback(unsigned long data) +void dm_fsync_timer_callback(struct timer_list *t) { - struct net_device *dev = (struct net_device *)data; - struct r8192_priv *priv = ieee80211_priv((struct net_device *)data); + struct r8192_priv *priv = from_timer(priv, t, fsync_timer); + struct net_device *dev = priv->ieee80211->dev; u32 rate_index, rate_count = 0, rate_count_diff = 0; bool bSwitchFromCountDiff = false; bool bDoubleTimeInterval = false; diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h index 98137f6..8f3d618 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.h +++ b/drivers/staging/rtl8192u/r8192U_dm.h @@ -227,7 +227,7 @@ void dm_force_tx_fw_info(struct net_device *dev, void dm_init_edca_turbo(struct net_device *dev); void dm_rf_operation_test_callback(unsigned long data); void dm_rf_pathcheck_workitemcallback(struct work_struct *work); -void dm_fsync_timer_callback(unsigned long data); +void dm_fsync_timer_callback(struct timer_list *t); void dm_cck_txpower_adjust(struct net_device *dev, bool binch14); void dm_shadow_init(struct net_device *dev); void dm_initialize_txpower_tracking(struct net_device *dev); diff --git a/drivers/staging/rtl8192u/r8192U_wx.c b/drivers/staging/rtl8192u/r8192U_wx.c index a954538..e4e6c97 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.c +++ b/drivers/staging/rtl8192u/r8192U_wx.c @@ -964,7 +964,7 @@ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev) return wstats; } -struct iw_handler_def r8192_wx_handlers_def = { +const struct iw_handler_def r8192_wx_handlers_def = { .standard = r8192_wx_handlers, .num_standard = ARRAY_SIZE(r8192_wx_handlers), .private = r8192_private_handler, diff --git a/drivers/staging/rtl8192u/r8192U_wx.h b/drivers/staging/rtl8192u/r8192U_wx.h index fb5f808..a6c2b95 100644 --- a/drivers/staging/rtl8192u/r8192U_wx.h +++ b/drivers/staging/rtl8192u/r8192U_wx.h @@ -17,7 +17,7 @@ #ifndef R8180_WX_H #define R8180_WX_H -extern struct iw_handler_def r8192_wx_handlers_def; +extern const struct iw_handler_def r8192_wx_handlers_def; /* Enable the rtl819x_core.c to share this function, david 2008.9.22 */ struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev); |