diff options
Diffstat (limited to 'drivers/staging/rtl8192u')
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 3 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 33 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 13 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c | 4 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 58 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 36 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 10 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_core.c | 10 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.c | 109 | ||||
-rw-r--r-- | drivers/staging/rtl8192u/r8192U_dm.h | 1 |
10 files changed, 105 insertions, 172 deletions
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c index d7975aa335b2..4a6c3f674431 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c @@ -109,7 +109,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv) } ieee = netdev_priv(dev); - memset(ieee, 0, sizeof(struct ieee80211_device) + sizeof_priv); ieee->dev = dev; err = ieee80211_networks_allocate(ieee); @@ -155,7 +154,7 @@ struct net_device *alloc_ieee80211(int sizeof_priv) ieee80211_softmac_init(ieee); ieee->pHTInfo = kzalloc(sizeof(RT_HIGH_THROUGHPUT), GFP_KERNEL); - if (ieee->pHTInfo == NULL) { + if (!ieee->pHTInfo) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for HTInfo\n"); /* By this point in code ieee80211_networks_allocate() has been diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 0e762e559675..0a3e478fccd6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -67,7 +67,7 @@ ieee80211_frag_cache_find(struct ieee80211_device *ieee, unsigned int seq, for (i = 0; i < IEEE80211_FRAG_CACHE_LEN; i++) { entry = &ieee->frag_cache[tid][i]; - if (entry->skb != NULL && + if (entry->skb && time_after(jiffies, entry->first_frag_time + 2 * HZ)) { IEEE80211_DEBUG_FRAG( "expiring fragment cache entry " @@ -77,7 +77,7 @@ ieee80211_frag_cache_find(struct ieee80211_device *ieee, unsigned int seq, entry->skb = NULL; } - if (entry->skb != NULL && entry->seq == seq && + if (entry->skb && entry->seq == seq && (entry->last_frag + 1 == frag || frag == -1) && memcmp(entry->src_addr, src, ETH_ALEN) == 0 && memcmp(entry->dst_addr, dst, ETH_ALEN) == 0) @@ -102,7 +102,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee, struct rtl_80211_hdr_4addrqos *hdr_4addrqos; u8 tid; - if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { + if (((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && IEEE80211_QOS_HAS_SEQ(fc)) { hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr; tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID; tid = UP2AC(tid); @@ -133,7 +133,7 @@ ieee80211_frag_cache_get(struct ieee80211_device *ieee, if (ieee->frag_next_idx[tid] >= IEEE80211_FRAG_CACHE_LEN) ieee->frag_next_idx[tid] = 0; - if (entry->skb != NULL) + if (entry->skb) dev_kfree_skb_any(entry->skb); entry->first_frag_time = jiffies; @@ -169,7 +169,7 @@ static int ieee80211_frag_cache_invalidate(struct ieee80211_device *ieee, struct rtl_80211_hdr_4addrqos *hdr_4addrqos; u8 tid; - if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { + if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && IEEE80211_QOS_HAS_SEQ(fc)) { hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)hdr; tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID; tid = UP2AC(tid); @@ -426,7 +426,7 @@ static int is_duplicate_packet(struct ieee80211_device *ieee, //TO2DS and QoS - if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS)&&IEEE80211_QOS_HAS_SEQ(fc)) { + if(((fc & IEEE80211_FCTL_DSTODS) == IEEE80211_FCTL_DSTODS) && IEEE80211_QOS_HAS_SEQ(fc)) { hdr_4addrqos = (struct rtl_80211_hdr_4addrqos *)header; tid = le16_to_cpu(hdr_4addrqos->qos_ctl) & IEEE80211_QCTL_TID; tid = UP2AC(tid); @@ -557,7 +557,7 @@ void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_ //stats->rx_packets++; //stats->rx_bytes += sub_skb->len; - /* Indicat the packets to upper layer */ + /* Indicate the packets to upper layer */ if (sub_skb) { sub_skb->protocol = eth_type_trans(sub_skb, ieee->dev); memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); @@ -773,7 +773,7 @@ static u8 parse_subframe(struct sk_buff *skb, /* just for debug purpose */ SeqNum = WLAN_GET_SEQ_SEQ(le16_to_cpu(hdr->seq_ctl)); - if ((IEEE80211_QOS_HAS_SEQ(fc))&&\ + if ((IEEE80211_QOS_HAS_SEQ(fc)) && \ (((frameqos *)(skb->data + IEEE80211_3ADDR_LEN))->field.reserved)) { bIsAggregateFrame = true; } @@ -1092,7 +1092,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ieee->iw_mode == IW_MODE_REPEAT) && !from_assoc_ap) { switch (hostap_handle_sta_rx(ieee, dev, skb, rx_stats, - wds != NULL)) { + wds)) { case AP_RX_CONTINUE_NOT_AUTHORIZED: case AP_RX_CONTINUE: break; @@ -1109,7 +1109,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, if (stype != IEEE80211_STYPE_DATA && stype != IEEE80211_STYPE_DATA_CFACK && stype != IEEE80211_STYPE_DATA_CFPOLL && - stype != IEEE80211_STYPE_DATA_CFACKPOLL&& + stype != IEEE80211_STYPE_DATA_CFACKPOLL && stype != IEEE80211_STYPE_QOS_DATA//add by David,2006.8.4 ) { if (stype != IEEE80211_STYPE_NULLFUNC) @@ -1311,7 +1311,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, stats->multicast++; } - /* Indicat the packets to upper layer */ + /* Indicate the packets to upper layer */ sub_skb->protocol = eth_type_trans(sub_skb, dev); memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); sub_skb->dev = dev; @@ -1388,7 +1388,7 @@ static int ieee80211_read_qos_param_element(struct ieee80211_qos_parameter_info int ret = 0; u16 size = sizeof(struct ieee80211_qos_parameter_info) - 2; - if ((info_element == NULL) || (element_param == NULL)) + if (!info_element || !element_param) return -1; if (info_element->id == QOS_ELEMENT_ID && info_element->len == size) { @@ -2508,7 +2508,7 @@ static inline void ieee80211_process_probe_response( list_for_each_entry(target, &ieee->network_list, list) { if (is_same_network(target, network, ieee)) break; - if ((oldest == NULL) || + if (!oldest || (target->last_scanned < oldest->last_scanned)) oldest = target; } @@ -2565,7 +2565,7 @@ static inline void ieee80211_process_probe_response( // printk("====>2 network->ssid=%s FLAG=%d target.ssid=%s FLAG=%d\n", network->ssid, network->flags, target->ssid, target->flags); if(((network->flags & NETWORK_EMPTY_ESSID) == NETWORK_EMPTY_ESSID) \ && (((network->ssid_len > 0) && (strncmp(target->ssid, network->ssid, network->ssid_len)))\ - ||((ieee->current_network.ssid_len == network->ssid_len)&&(strncmp(ieee->current_network.ssid, network->ssid, network->ssid_len) == 0)&&(ieee->state == IEEE80211_NOLINK)))) + ||((ieee->current_network.ssid_len == network->ssid_len) && (strncmp(ieee->current_network.ssid, network->ssid, network->ssid_len) == 0) && (ieee->state == IEEE80211_NOLINK)))) renew = 1; //YJ,add,080819,for hidden ap,end @@ -2575,11 +2575,10 @@ static inline void ieee80211_process_probe_response( } spin_unlock_irqrestore(&ieee->lock, flags); - if (is_beacon(beacon->header.frame_ctl)&&is_same_network(&ieee->current_network, network, ieee)&&\ + if (is_beacon(beacon->header.frame_ctl) && is_same_network(&ieee->current_network, network, ieee) && \ (ieee->state == IEEE80211_LINKED)) { - if (ieee->handle_beacon != NULL) { + if (ieee->handle_beacon) ieee->handle_beacon(ieee->dev,beacon,&ieee->current_network); - } } out: diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index 944c8894f9ff..e0da0900a4f7 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1796,7 +1796,7 @@ static void ieee80211_process_action(struct ieee80211_device *ieee, u8 *act = ieee80211_get_payload(header); u8 tmp = 0; // IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA|IEEE80211_DL_BA, skb->data, skb->len); - if (act == NULL) { + if (!act) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of action frame\n"); return; } @@ -1929,7 +1929,7 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, 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) + if (ieee->handle_assoc_response) ieee->handle_assoc_response(ieee->dev, (struct ieee80211_assoc_response_frame *)header, network); } ieee80211_associate_complete(ieee); @@ -2659,14 +2659,13 @@ static int ieee80211_wpa_set_wpa_ie(struct ieee80211_device *ieee, { u8 *buf; - if (param->u.wpa_ie.len > MAX_WPA_IE_LEN || - (param->u.wpa_ie.len && param->u.wpa_ie.data == NULL)) + if (param->u.wpa_ie.len > MAX_WPA_IE_LEN) return -EINVAL; if (param->u.wpa_ie.len) { buf = kmemdup(param->u.wpa_ie.data, param->u.wpa_ie.len, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; kfree(ieee->wpa_ie); @@ -2856,7 +2855,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, goto done; } - if (*crypt == NULL || (*crypt)->ops != ops) { + if (!*crypt || (*crypt)->ops != ops) { struct ieee80211_crypt_data *new_crypt; ieee80211_crypt_delayed_deinit(ieee, crypt); @@ -2871,7 +2870,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, new_crypt->priv = new_crypt->ops->init(param->u.crypt.idx); - if (new_crypt->priv == NULL) { + if (!new_crypt->priv) { kfree(new_crypt); param->u.crypt.err = IEEE_CRYPT_ERR_CRYPT_INIT_FAILED; ret = -EINVAL; diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c index aab1586fe0dd..4a8d16a45fc5 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c @@ -244,9 +244,9 @@ int ieee80211_wx_set_rts(struct ieee80211_device *ieee, struct iw_request_info *info, union iwreq_data *wrqu, char *extra) { - if (wrqu->rts.disabled || !wrqu->rts.fixed) + if (wrqu->rts.disabled || !wrqu->rts.fixed) { ieee->rts = DEFAULT_RTS_THRESHOLD; - else { + } else { if (wrqu->rts.value < MIN_RTS_THRESHOLD || wrqu->rts.value > MAX_RTS_THRESHOLD) return -EINVAL; diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 8e1ec4409b4f..fc6eb97801e1 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -169,8 +169,7 @@ int ieee80211_encrypt_fragment( struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx]; int res; - if (!(crypt && crypt->ops)) - { + if (!(crypt && crypt->ops)) { printk("=========>%s(), crypt is null\n", __func__); return -1; } @@ -309,32 +308,25 @@ static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, if (!Adapter->HalFunc.GetNmodeSupportBySecCfgHandler(Adapter)) return; #endif - if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) - { + if (!ieee->GetNmodeSupportBySecCfg(ieee->dev)) { return; } - if (pHTInfo->bCurrentAMPDUEnable) - { - if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true)) - { + if (pHTInfo->bCurrentAMPDUEnable) { + if (!GetTs(ieee, (struct ts_common_info **)(&pTxTs), hdr->addr1, skb->priority, TX_DIR, true)) { printk("===>can't get TS\n"); return; } - if (!pTxTs->tx_admitted_ba_record.valid) - { + if (!pTxTs->tx_admitted_ba_record.valid) { TsStartAddBaProcess(ieee, pTxTs); goto FORCED_AGG_SETTING; - } - else if (!pTxTs->using_ba) - { + } else if (!pTxTs->using_ba) { if (SN_LESS(pTxTs->tx_admitted_ba_record.start_seq_ctrl.field.seq_num, (pTxTs->tx_cur_seq + 1) % 4096)) pTxTs->using_ba = true; else goto FORCED_AGG_SETTING; } - if (ieee->iw_mode == IW_MODE_INFRA) - { + if (ieee->iw_mode == IW_MODE_INFRA) { tcb_desc->bAMPDUEnable = true; tcb_desc->ampdu_factor = pHTInfo->CurrentAMPDUFactor; tcb_desc->ampdu_density = pHTInfo->CurrentMPDUDensity; @@ -366,12 +358,9 @@ static void ieee80211_qurey_ShortPreambleMode(struct ieee80211_device *ieee, struct cb_desc *tcb_desc) { tcb_desc->bUseShortPreamble = false; - if (tcb_desc->data_rate == 2) - {//// 1M can only use Long Preamble. 11B spec + if (tcb_desc->data_rate == 2) {//// 1M can only use Long Preamble. 11B spec return; - } - else if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) - { + } else if (ieee->current_network.capability & WLAN_CAPABILITY_SHORT_PREAMBLE) { tcb_desc->bUseShortPreamble = true; } return; @@ -386,8 +375,7 @@ ieee80211_query_HTCapShortGI(struct ieee80211_device *ieee, struct cb_desc *tcb_ if (!pHTInfo->bCurrentHTSupport||!pHTInfo->bEnableHT) return; - if (pHTInfo->bForcedShortGI) - { + if (pHTInfo->bForcedShortGI) { tcb_desc->bUseShortGI = true; return; } @@ -535,27 +523,25 @@ static void ieee80211_txrate_selectmode(struct ieee80211_device *ieee, struct cb_desc *tcb_desc) { #ifdef TO_DO_LIST - if(!IsDataFrame(pFrame)) - { + if (!IsDataFrame(pFrame)) { pTcb->bTxDisableRateFallBack = true; pTcb->bTxUseDriverAssingedRate = true; pTcb->RATRIndex = 7; return; } - if(pMgntInfo->ForcedDataRate!= 0) - { + if (pMgntInfo->ForcedDataRate!= 0) { pTcb->bTxDisableRateFallBack = true; pTcb->bTxUseDriverAssingedRate = true; return; } #endif - if(ieee->bTxDisableRateFallBack) + if (ieee->bTxDisableRateFallBack) tcb_desc->bTxDisableRateFallBack = true; - if(ieee->bTxUseDriverAssingedRate) + if (ieee->bTxUseDriverAssingedRate) tcb_desc->bTxUseDriverAssingedRate = true; - if(!tcb_desc->bTxDisableRateFallBack || !tcb_desc->bTxUseDriverAssingedRate) + if (!tcb_desc->bTxDisableRateFallBack || !tcb_desc->bTxUseDriverAssingedRate) { if (ieee->iw_mode == IW_MODE_INFRA || ieee->iw_mode == IW_MODE_ADHOC) tcb_desc->RATRIndex = 0; @@ -614,7 +600,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) } - if(likely(ieee->raw_tx == 0)){ + if (likely(ieee->raw_tx == 0)) { if (unlikely(skb->len < SNAP_SIZE + sizeof(u16))) { printk(KERN_WARNING "%s: skb too small (%d).\n", ieee->dev->name, skb->len); @@ -690,15 +676,13 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) if (is_multicast_ether_addr(header.addr1)) { frag_size = MAX_FRAG_THRESHOLD; qos_ctl |= QOS_CTL_NOTCONTAIN_ACK; - } - else { + } else { frag_size = ieee->fts;//default:392 qos_ctl = 0; } //if (ieee->current_network.QoS_Enable) - if(qos_actived) - { + if (qos_actived) { hdr_len = IEEE80211_3ADDR_LEN + 2; skb->priority = ieee80211_classify(skb, &ieee->current_network); @@ -746,12 +730,10 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) txb->payload_size = __cpu_to_le16(bytes); //if (ieee->current_network.QoS_Enable) - if(qos_actived) - { + if (qos_actived) txb->queue_index = UP2AC(skb->priority); - } else { + else txb->queue_index = WME_AC_BK; - } diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index dead134f6de0..be08cd1d37a7 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -243,8 +243,7 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee, list_for_each_entry(network, &ieee->network_list, list) { i++; - if((stop-ev)<200) - { + if((stop-ev)<200) { err = -E2BIG; break; } @@ -312,7 +311,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, /* Check all the keys to see if any are still configured, * and if no key index was provided, de-init them all */ for (i = 0; i < WEP_KEYS; i++) { - if (ieee->crypt[i] != NULL) { + if (ieee->crypt[i]) { if (key_provided) break; ieee80211_crypt_delayed_deinit( @@ -334,14 +333,14 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, sec.enabled = 1; sec.flags |= SEC_ENABLED; - if (*crypt != NULL && (*crypt)->ops != NULL && + if (*crypt && (*crypt)->ops && strcmp((*crypt)->ops->name, "WEP") != 0) { /* changing to use WEP; deinit previously used algorithm * on this key */ ieee80211_crypt_delayed_deinit(ieee, crypt); } - if (*crypt == NULL) { + if (!*crypt) { struct ieee80211_crypt_data *new_crypt; /* take WEP into use */ @@ -469,7 +468,7 @@ int ieee80211_wx_get_encode(struct ieee80211_device *ieee, crypt = ieee->crypt[key]; erq->flags = key + 1; - if (crypt == NULL || crypt->ops == NULL) { + if (!crypt || !crypt->ops) { erq->length = 0; erq->flags |= IW_ENCODE_DISABLED; return 0; @@ -538,7 +537,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, for (i = 0; i < WEP_KEYS; i++) - if (ieee->crypt[i] != NULL) + if (ieee->crypt[i]) break; @@ -583,7 +582,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, goto done; } - if (*crypt == NULL || (*crypt)->ops != ops) { + if (!*crypt || (*crypt)->ops != ops) { struct ieee80211_crypt_data *new_crypt; ieee80211_crypt_delayed_deinit(ieee, crypt); @@ -596,7 +595,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, new_crypt->ops = ops; if (new_crypt->ops && try_module_get(new_crypt->ops->owner)) new_crypt->priv = new_crypt->ops->init(idx); - if (new_crypt->priv == NULL) { + if (!new_crypt->priv) { kfree(new_crypt); ret = -EINVAL; goto done; @@ -684,7 +683,7 @@ int ieee80211_wx_get_encode_ext(struct ieee80211_device *ieee, encoding->flags = idx + 1; memset(ext, 0, sizeof(*ext)); - if (crypt == NULL || crypt->ops == NULL ) { + if (!crypt || !crypt->ops) { ext->alg = IW_ENCODE_ALG_NONE; ext->key_len = 0; encoding->flags |= IW_ENCODE_DISABLED; @@ -761,8 +760,7 @@ int ieee80211_wx_set_auth(struct ieee80211_device *ieee, } else if (data->value & IW_AUTH_ALG_LEAP) { ieee->open_wep = 1; ieee->auth_mode = 2; - } - else + } else return -EINVAL; break; @@ -787,28 +785,24 @@ int ieee80211_wx_set_gen_ie(struct ieee80211_device *ieee, u8 *ie, size_t len) { u8 *buf; - if (len>MAX_WPA_IE_LEN || (len && ie == NULL)) - { + if (len>MAX_WPA_IE_LEN || (len && !ie)) { // printk("return error out, len:%d\n", len); return -EINVAL; } - if (len) - { - if (len != ie[1]+2) - { + if (len) { + if (len != ie[1]+2) { printk("len:%zu, ie:%d\n", len, ie[1]); return -EINVAL; } buf = kmemdup(ie, len, GFP_KERNEL); - if (buf == NULL) + if (!buf) return -ENOMEM; kfree(ieee->wpa_ie); ieee->wpa_ie = buf; ieee->wpa_ie_len = len; - } - else{ + } else { kfree(ieee->wpa_ie); ieee->wpa_ie = NULL; ieee->wpa_ie_len = 0; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c index 7cac668bfb0b..59d179ae7ad2 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c @@ -51,7 +51,7 @@ static void RxPktPendingTimeout(struct timer_list *t) if (SN_EQUAL(pReorderEntry->SeqNum, pRxTs->rx_indicate_seq)) pRxTs->rx_indicate_seq = (pRxTs->rx_indicate_seq + 1) % 4096; - IEEE80211_DEBUG(IEEE80211_DL_REORDER, "RxPktPendingTimeout(): IndicateSeq: %d\n", pReorderEntry->SeqNum); + IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s: IndicateSeq: %d\n", __func__, pReorderEntry->SeqNum); ieee->stats_IndicateArray[index] = pReorderEntry->prxb; index++; @@ -97,7 +97,7 @@ static void TsAddBaProcess(struct timer_list *t) struct ieee80211_device *ieee = container_of(pTxTs, struct ieee80211_device, TxTsRecord[num]); TsInitAddBA(ieee, pTxTs, BA_POLICY_IMMEDIATE, false); - IEEE80211_DEBUG(IEEE80211_DL_BA, "TsAddBaProcess(): ADDBA Req is started!! \n"); + IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: ADDBA Req is started!! \n", __func__); } @@ -456,7 +456,7 @@ void RemovePeerTS(struct ieee80211_device *ieee, u8 *Addr) { struct ts_common_info *pTS, *pTmpTS; - printk("===========>RemovePeerTS,%pM\n", Addr); + printk("===========>%s,%pM\n", __func__, Addr); list_for_each_entry_safe(pTS, pTmpTS, &ieee->Tx_TS_Pending_List, list) { if (memcmp(pTS->addr, Addr, 6) == 0) { RemoveTsEntry(ieee, pTS, TX_DIR); @@ -525,11 +525,11 @@ void TsStartAddBaProcess(struct ieee80211_device *ieee, struct tx_ts_record *pTx if (!pTxTS->add_ba_req_in_progress) { pTxTS->add_ba_req_in_progress = true; if (pTxTS->add_ba_req_delayed) { - IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Delayed Start ADDBA after 60 sec!!\n"); + IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: Delayed Start ADDBA after 60 sec!!\n", __func__); mod_timer(&pTxTS->ts_add_ba_timer, jiffies + msecs_to_jiffies(TS_ADDBA_DELAY)); } else { - IEEE80211_DEBUG(IEEE80211_DL_BA, "TsStartAddBaProcess(): Immediately Start ADDBA now!!\n"); + IEEE80211_DEBUG(IEEE80211_DL_BA, "%s: Immediately Start ADDBA now!!\n", __func__); mod_timer(&pTxTS->ts_add_ba_timer, jiffies+10); //set 10 ticks } } else { diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index 4065a4710142..fe1f279ca368 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -713,7 +713,7 @@ static u32 get_rxpacket_shiftbytes_819xusb(struct ieee80211_rx_stats *pstats) + pstats->RxBufShift); } -static int rtl8192_rx_initiate(struct net_device *dev) +void rtl8192_rx_enable(struct net_device *dev) { struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); struct urb *entry; @@ -763,8 +763,6 @@ static int rtl8192_rx_initiate(struct net_device *dev) skb_queue_tail(&priv->rx_queue, skb); usb_submit_urb(entry, GFP_KERNEL); } - - return 0; } void rtl8192_set_rxconf(struct net_device *dev) @@ -810,12 +808,6 @@ void rtl8192_set_rxconf(struct net_device *dev) write_nic_dword(dev, RCR, rxconf); } -/* wait to be removed */ -void rtl8192_rx_enable(struct net_device *dev) -{ - rtl8192_rx_initiate(dev); -} - void rtl8192_rtx_disable(struct net_device *dev) { u8 cmd; diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 2ba01041406b..ade14ef05730 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -99,8 +99,7 @@ static void dm_dynamic_txpower(struct net_device *dev); static void dm_send_rssi_tofw(struct net_device *dev); static void dm_ctstoself(struct net_device *dev); /*---------------------------Define function prototype------------------------*/ -/* - * ================================================================================ +/* ================================================================================ * HW Dynamic mechanism interface. * ================================================================================ * @@ -178,8 +177,7 @@ void dm_CheckRxAggregation(struct net_device *dev) ulValue = (pHTInfo->UsbRxFwAggrEn<<24) | (pHTInfo->UsbRxFwAggrPageNum<<16) | (pHTInfo->UsbRxFwAggrPacketNum<<8) | (pHTInfo->UsbRxFwAggrTimeout); - /* - * If usb rx firmware aggregation is enabled, + /* If usb rx firmware aggregation is enabled, * when anyone of three threshold conditions above is reached, * firmware will send aggregated packet to driver. */ @@ -219,8 +217,7 @@ void hal_dm_watchdog(struct net_device *dev) #endif } /* HalDmWatchDog */ -/* - * Decide Rate Adaptive Set according to distance (signal strength) +/* Decide Rate Adaptive Set according to distance (signal strength) * 01/11/2008 MHC Modify input arguments and RATR table level. * 01/16/2008 MHC RF_Type is assigned in ReadAdapterInfo(). We must call * the function after making sure RF_Type. @@ -246,8 +243,7 @@ void init_rate_adaptive(struct net_device *dev) pra->ping_rssi_thresh_for_ra = 15; if (priv->rf_type == RF_2T4R) { - /* - * 07/10/08 MH Modify for RA smooth scheme. + /* 07/10/08 MH Modify for RA smooth scheme. * 2008/01/11 MH Modify 2T RATR table for different RSSI. 080515 porting by amy from windows code. */ pra->upper_rssi_threshold_ratr = 0x8f0f0000; @@ -336,9 +332,10 @@ static void dm_check_rate_adaptive(struct net_device *dev) ((bshort_gi_enabled) ? BIT(31) : 0); /* 2007/10/08 MH We support RA smooth scheme now. When it is the first - time to link with AP. We will not change upper/lower threshold. If - STA stay in high or low level, we must change two different threshold - to prevent jumping frequently. */ + * time to link with AP. We will not change upper/lower threshold. If + * STA stay in high or low level, we must change two different threshold + * to prevent jumping frequently. + */ if (pra->ratr_state == DM_RATR_STA_HIGH) { HighRSSIThreshForRA = pra->high2low_rssi_thresh_for_ra; LowRSSIThreshForRA = (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) ? @@ -387,8 +384,7 @@ static void dm_check_rate_adaptive(struct net_device *dev) } } - /* - * 2008.04.01 + /* 2008.04.01 * For RTL819X, if pairwisekey = wep/tkip, we support only MCS0~7. */ if (priv->ieee80211->GetHalfNmodeSupportByAPsHandler(dev)) @@ -683,8 +679,7 @@ static void dm_TXPowerTrackingCallback_ThermalMeter(struct net_device *dev) return; } - /* - * ========================== + /* ========================== * this is only for test, should be masked * ========================== */ @@ -850,8 +845,7 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev) priv->txbbgain_table[36].txbb_iq_amplifygain = -24; priv->txbbgain_table[36].txbbgain_value = 0x10000040; - /* - * ccktxbb_valuearray[0] is 0xA22 [1] is 0xA24 ...[7] is 0xA29 + /* ccktxbb_valuearray[0] is 0xA22 [1] is 0xA24 ...[7] is 0xA29 * This Table is for CH1~CH13 */ priv->cck_txbbgain_table[0].ccktxbb_valuearray[0] = 0x36; @@ -1061,8 +1055,7 @@ static void dm_InitializeTXPowerTracking_TSSI(struct net_device *dev) priv->cck_txbbgain_table[22].ccktxbb_valuearray[6] = 0x03; priv->cck_txbbgain_table[22].ccktxbb_valuearray[7] = 0x01; - /* - * ccktxbb_valuearray[0] is 0xA22 [1] is 0xA24 ...[7] is 0xA29 + /* ccktxbb_valuearray[0] is 0xA22 [1] is 0xA24 ...[7] is 0xA29 * This Table is for CH14 */ priv->cck_txbbgain_ch14_table[0].ccktxbb_valuearray[0] = 0x36; @@ -1282,8 +1275,7 @@ static void dm_InitializeTXPowerTracking_ThermalMeter(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - /* - * Tx Power tracking by Thermal Meter requires Firmware R/W 3-wire. This mechanism + /* Tx Power tracking by Thermal Meter requires Firmware R/W 3-wire. This mechanism * can be enabled only when Firmware R/W 3-wire is enabled. Otherwise, frequent r/w * 3-wire by driver causes RF to go into a wrong state. */ @@ -1330,8 +1322,7 @@ static void dm_CheckTXPowerTracking_ThermalMeter(struct net_device *dev) } if (!TM_Trigger) { - /* - * Attention!! You have to write all 12bits of data to RF, or it may cause RF to crash + /* Attention!! You have to write all 12bits of data to RF, or it may cause RF to crash * actually write reg0x02 bit1=0, then bit1=1. * DbgPrint("Trigger ThermalMeter, write RF reg0x2 = 0x4d to 0x4f\n"); */ @@ -1563,18 +1554,6 @@ static void dm_bb_initialgain_restore(struct net_device *dev) } /* dm_BBInitialGainRestore */ -void dm_backup_dynamic_mechanism_state(struct net_device *dev) -{ - struct r8192_priv *priv = ieee80211_priv(dev); - - /* Fsync to avoid reset */ - priv->bswitch_fsync = false; - priv->bfsync_processing = false; - /* Backup BB InitialGain */ - dm_bb_initialgain_backup(dev); - -} /* DM_BackupDynamicMechanismState */ - static void dm_bb_initialgain_backup(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); @@ -1748,10 +1727,12 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( pHalData->UndecoratedSmoothedPWDB, DM_DigTable.RssiLowThresh, DM_DigTable.RssiHighThresh, DM_DigTable.Dig_State);*/ /* 1. When RSSI decrease, We have to judge if it is smaller than a threshold - and then execute the step below. */ + * and then execute the step below. + */ if (priv->undecorated_smoothed_pwdb <= dm_digtable.rssi_low_thresh) { /* 2008/02/05 MH When we execute silent reset, the DIG PHY parameters - will be reset to init value. We must prevent the condition. */ + * will be reset to init value. We must prevent the condition. + */ if (dm_digtable.dig_state == DM_STA_DIG_OFF && (priv->reset_count == reset_cnt)) { return; @@ -1773,8 +1754,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( /* 1.3 Lower PD_TH for OFDM. */ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) { - /* - * 2008/01/11 MH 40MHZ 90/92 register are not the same. + /* 2008/01/11 MH 40MHZ 90/92 register are not the same. * 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. */ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x00); @@ -1797,7 +1777,8 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( } /* 2. When RSSI increase, We have to judge if it is larger than a threshold - and then execute the step below. */ + * and then execute the step below. + */ if (priv->undecorated_smoothed_pwdb >= dm_digtable.rssi_high_thresh) { u8 reset_flag = 0; @@ -1814,8 +1795,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( dm_digtable.dig_state = DM_STA_DIG_ON; /*DbgPrint("DIG ON\n\r");*/ - /* - * 2.1 Set initial gain. + /* 2.1 Set initial gain. * 2008/02/26 MH SD3-Jerry suggest to prevent dirty environment. */ if (reset_flag == 1) { @@ -1832,8 +1812,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( /* 2.2 Higher PD_TH for OFDM. */ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) { - /* - * 2008/01/11 MH 40MHZ 90/92 register are not the same. + /* 2008/01/11 MH 40MHZ 90/92 register are not the same. * 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. */ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20); @@ -1850,8 +1829,7 @@ static void dm_ctrl_initgain_byrssi_by_fwfalse_alarm( /* 2.3 Higher CS ratio for CCK. */ write_nic_byte(dev, 0xa0a, 0xcd); - /* - * 2.4 Lower EDCCA. + /* 2.4 Lower EDCCA. * 2008/01/11 MH 90/92 series are the same. */ /*PlatformEFIOWrite4Byte(pAdapter, rOFDM0_ECCAThreshold, 0x346);*/ @@ -1892,8 +1870,7 @@ static void dm_ctrl_initgain_byrssi_highpwr( (priv->undecorated_smoothed_pwdb < dm_digtable.rssi_high_power_highthresh)) return; - /* - * 3. When RSSI >75% or <70%, it is a high power issue. We have to judge if + /* 3. When RSSI >75% or <70%, it is a high power issue. We have to judge if * it is larger than a threshold and then execute the step below. * * 2008/02/05 MH SD3-Jerry Modify PD_TH for high power issue. @@ -2042,8 +2019,7 @@ static void dm_pd_th( if (dm_digtable.curpd_thstate == DIG_PD_AT_LOW_POWER) { /* Lower PD_TH for OFDM. */ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) { - /* - * 2008/01/11 MH 40MHZ 90/92 register are not the same. + /* 2008/01/11 MH 40MHZ 90/92 register are not the same. * 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. */ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x00); @@ -2055,8 +2031,7 @@ static void dm_pd_th( } else if (dm_digtable.curpd_thstate == DIG_PD_AT_NORMAL_POWER) { /* Higher PD_TH for OFDM. */ if (priv->CurrentChannelBW != HT_CHANNEL_WIDTH_20) { - /* - * 2008/01/11 MH 40MHZ 90/92 register are not the same. + /* 2008/01/11 MH 40MHZ 90/92 register are not the same. * 2008/02/05 MH SD3-Jerry 92U/92E PD_TH are the same. */ write_nic_byte(dev, (rOFDM0_XATxAFE+3), 0x20); @@ -2155,8 +2130,7 @@ static void dm_check_edca_turbo( unsigned long curTxOkCnt = 0; unsigned long curRxOkCnt = 0; - /* - * Do not be Turbo if it's under WiFi config and Qos Enabled, because the EDCA parameters + /* Do not be Turbo if it's under WiFi config and Qos Enabled, because the EDCA parameters * should follow the settings from QAP. By Bruce, 2007-12-07. */ if (priv->ieee80211->state != IEEE80211_LINKED) @@ -2188,8 +2162,7 @@ static void dm_check_edca_turbo( priv->bcurrent_turbo_EDCA = true; } else { - /* - * Turn Off EDCA turbo here. + /* Turn Off EDCA turbo here. * Restore original EDCA according to the declaration of AP. */ if (priv->bcurrent_turbo_EDCA) { @@ -2219,8 +2192,7 @@ static void dm_check_edca_turbo( write_nic_dword(dev, EDCAPARA_BE, u4bAcParam); - /* - * Check ACM bit. + /* Check ACM bit. * If it is set, immediately set ACM control bit to downgrading AC for passing WMM testplan. Annie, 2005-12-13. */ { @@ -2272,11 +2244,10 @@ static void dm_ctstoself(struct net_device *dev) pHTInfo->IOTAction &= ~HT_IOT_ACT_FORCED_CTS2SELF; return; } - /* - 1. Uplink - 2. Linksys350/Linksys300N - 3. <50 disable, >55 enable - */ + /* 1. Uplink + * 2. Linksys350/Linksys300N + * 3. <50 disable, >55 enable + */ if (pHTInfo->IOTPeer == HT_IOT_PEER_BROADCOM) { curTxOkCnt = priv->stats.txbytesunicast - lastTxOkCnt; @@ -2319,8 +2290,7 @@ static void dm_check_pbc_gpio(struct net_device *dev) return; if (tmp1byte & BIT(6) || tmp1byte & BIT(0)) { - /* - * Here we only set bPbcPressed to TRUE + /* Here we only set bPbcPressed to TRUE * After trigger PBC, the variable will be set to FALSE */ RT_TRACE(COMP_IO, "CheckPbcGPIO - PBC is pressed\n"); @@ -2354,7 +2324,8 @@ void dm_rf_pathcheck_workitemcallback(struct work_struct *work) u8 rfpath = 0, i; /* 2008/01/30 MH After discussing with SD3 Jerry, 0xc04/0xd04 register will - always be the same. We only read 0xc04 now. */ + * always be the same. We only read 0xc04 now. + */ read_nic_byte(dev, 0xc04, &rfpath); /* Check Bit 0-3, it means if RF A-D is enabled. */ @@ -2529,8 +2500,7 @@ static void dm_rxpath_sel_byrssi(struct net_device *dev) } } - /* - * Set CCK Rx path + /* Set CCK Rx path * reg0xA07[3:2]=cck default rx path, reg0xa07[1:0]=cck optional rx path. */ update_cck_rx_path = 0; @@ -3049,8 +3019,7 @@ static void dm_send_rssi_tofw(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - /* - * If we test chariot, we should stop the TX command ? + /* If we test chariot, we should stop the TX command ? * Because 92E will always silent reset when we send tx command. We use register * 0x1e0(byte) to notify driver. */ diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h index 0de0332906bd..0b2a1c688597 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.h +++ b/drivers/staging/rtl8192u/r8192U_dm.h @@ -161,7 +161,6 @@ void hal_dm_watchdog(struct net_device *dev); void init_rate_adaptive(struct net_device *dev); void dm_txpower_trackingcallback(struct work_struct *work); void dm_restore_dynamic_mechanism_state(struct net_device *dev); -void dm_backup_dynamic_mechanism_state(struct net_device *dev); void dm_force_tx_fw_info(struct net_device *dev, u32 force_type, u32 force_value); void dm_init_edca_turbo(struct net_device *dev); |