From: Mike McCormack Date: Mon, 24 Jan 2011 14:15:40 +0000 (+0900) Subject: staging: rtl8192e: Delete dead code in ieee80211 lib X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=85c876e412c18d95cd430598255f829e64ae9141;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git staging: rtl8192e: Delete dead code in ieee80211 lib Signed-off-by: Mike McCormack Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c index 2ad9501801b4..b32b7e67f688 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_tkip.c @@ -324,18 +324,6 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv) hdr = (struct ieee80211_hdr_4addr *) skb->data; -#if 0 -printk("@@ tkey\n"); -printk("%x|", ((u32*)tkey->key)[0]); -printk("%x|", ((u32*)tkey->key)[1]); -printk("%x|", ((u32*)tkey->key)[2]); -printk("%x|", ((u32*)tkey->key)[3]); -printk("%x|", ((u32*)tkey->key)[4]); -printk("%x|", ((u32*)tkey->key)[5]); -printk("%x|", ((u32*)tkey->key)[6]); -printk("%x\n", ((u32*)tkey->key)[7]); -#endif - if (!tcb_desc->bHwSec) { if (!tkey->tx_phase1_done) { @@ -512,18 +500,6 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv) skb_pull(skb, 8); skb_trim(skb, skb->len - 4); -//john's test -#ifdef JOHN_DUMP -if( ((u16*)skb->data)[0] & 0x4000){ - printk("@@ rx decrypted skb->data"); - int i; - for(i=0;ilen;i++){ - if( (i%24)==0 ) printk("\n"); - printk("%2x ", ((u8*)skb->data)[i]); - } - printk("\n"); -} -#endif /*JOHN_DUMP*/ return keyidx; } diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c index 5dc976498aae..e6264727d94d 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_crypt_wep.c @@ -9,7 +9,6 @@ * more details. */ -//#include #include #include #include diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c index 08bfdb1a4c6e..67bcd41e66b1 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_module.c @@ -222,7 +222,7 @@ void free_ieee80211(struct net_device *dev) #ifdef CONFIG_IEEE80211_DEBUG u32 ieee80211_debug_level = 0; -static int debug = \ +static int debug = /* IEEE80211_DL_INFO | */ /* IEEE80211_DL_WX | */ /* IEEE80211_DL_SCAN | */ diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c index 4db6944cb6dc..e2eac7cadf4f 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c @@ -22,7 +22,6 @@ #include -//#include #include #include #include @@ -225,7 +224,6 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, 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); @@ -243,9 +241,6 @@ ieee80211_rx_frame_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb, printk(KERN_DEBUG "%s: Master mode not yet suppported.\n", ieee->dev->name); return 0; -/* - hostap_update_sta_ps(ieee, (struct hostap_ieee80211_hdr_4addr *) - skb->data);*/ } if (ieee->hostapd && type == IEEE80211_TYPE_MGMT) { @@ -308,7 +303,6 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, if (skb->len < 24) return 0; -#if 1 if (ieee->hwsec_active) { cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE); @@ -317,7 +311,6 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, if(ieee->need_sw_enc) tcb_desc->bHwSec = 0; } -#endif hdr = (struct ieee80211_hdr_4addr *) skb->data; fc = le16_to_cpu(hdr->frame_ctl); @@ -339,7 +332,6 @@ static int ieee80211_is_eapol_frame(struct ieee80211_device *ieee, return 0; /* check for port access entity Ethernet type */ -// pos = skb->data + 24; pos = skb->data + hdrlen; ethertype = (pos[6] << 8) | pos[7]; if (ethertype == ETH_P_PAE) @@ -358,13 +350,13 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device* ieee, struct sk_buff *skb, if (crypt == NULL || crypt->ops->decrypt_mpdu == NULL) return 0; -#if 1 + if (ieee->hwsec_active) { cb_desc *tcb_desc = (cb_desc *)(skb->cb+ MAX_DEV_ADDR_SIZE); tcb_desc->bHwSec = 1; } -#endif + hdr = (struct ieee80211_hdr_4addr *) skb->data; hdrlen = ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl)); @@ -474,14 +466,13 @@ static int is_duplicate_packet(struct ieee80211_device *ieee, struct ieee_ibss_seq *entry = NULL; u8 *mac = header->addr2; int index = mac[5] % IEEE_IBSS_MAC_HASH_SIZE; - //for (pos = (head)->next; pos != (head); pos = pos->next) - //__list_for_each(p, &ieee->ibss_mac_hash[index]) { + list_for_each(p, &ieee->ibss_mac_hash[index]) { entry = list_entry(p, struct ieee_ibss_seq, list); if (!memcmp(entry->mac, mac, ETH_ALEN)) break; } - // if (memcmp(entry->mac, mac, ETH_ALEN)){ + if (p == &ieee->ibss_mac_hash[index]) { entry = kmalloc(sizeof(struct ieee_ibss_seq), GFP_ATOMIC); if (!entry) { @@ -537,7 +528,7 @@ AddReorderEntry( ) { struct list_head *pList = &pTS->RxPendingPktList; -#if 1 + while(pList->next != &pTS->RxPendingPktList) { if( SN_LESS(pReorderEntry->SeqNum, ((PRX_REORDER_ENTRY)list_entry(pList->next,RX_REORDER_ENTRY,List))->SeqNum) ) @@ -553,7 +544,7 @@ AddReorderEntry( break; } } -#endif + pReorderEntry->List.next = pList->next; pReorderEntry->List.next->prev = &pReorderEntry->List; pReorderEntry->List.prev = pList; @@ -566,8 +557,7 @@ void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_ { u8 i = 0 , j=0; u16 ethertype; -// if(index > 1) -// IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): hahahahhhh, We indicate packet from reorder list, index is %u\n",__FUNCTION__,index); + for(j = 0; jsrc, ETH_ALEN); memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, ETH_ALEN); } - //stats->rx_packets++; - //stats->rx_bytes += sub_skb->len; /* Indicat the packets to upper layer */ if (sub_skb) { @@ -603,7 +591,6 @@ void ieee80211_indicate_packets(struct ieee80211_device *ieee, struct ieee80211_ memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); sub_skb->dev = ieee->dev; sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */ - //skb->ip_summed = CHECKSUM_UNNECESSARY; /* 802.11 crc not sufficient */ ieee->last_rx_ps_time = jiffies; netif_rx(sub_skb); } @@ -627,10 +614,7 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, u8 index = 0; bool bMatchWinStart = false, bPktInBuf = false; IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): Seq is %d,pTS->RxIndicateSeq is %d, WinSize is %d\n",__FUNCTION__,SeqNum,pTS->RxIndicateSeq,WinSize); -#if 0 - if(!list_empty(&ieee->RxReorder_Unused_List)) - IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): ieee->RxReorder_Unused_List is nut NULL\n"); -#endif + /* Rx Reorder initialize condition.*/ if(pTS->RxIndicateSeq == 0xffff) { pTS->RxIndicateSeq = SeqNum; @@ -686,7 +670,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, index = 1; } else { /* Current packet is going to be inserted into pending list.*/ - //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): We RX no ordered packed, insert to orderd list\n",__FUNCTION__); if(!list_empty(&ieee->RxReorder_Unused_List)) { pReorderEntry = (PRX_REORDER_ENTRY)list_entry(ieee->RxReorder_Unused_List.next,RX_REORDER_ENTRY,List); list_del_init(&pReorderEntry->List); @@ -694,9 +677,7 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, /* Make a reorder entry and insert into a the packet list.*/ pReorderEntry->SeqNum = SeqNum; pReorderEntry->prxb = prxb; - // IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): pREorderEntry->SeqNum is %d\n",__FUNCTION__,pReorderEntry->SeqNum); -#if 1 if(!AddReorderEntry(pTS, pReorderEntry)) { IEEE80211_DEBUG(IEEE80211_DL_REORDER, "%s(): Duplicate packet is dropped!! IndicateSeq: %d, NewSeq: %d\n", __FUNCTION__, pTS->RxIndicateSeq, SeqNum); @@ -713,7 +694,6 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, IEEE80211_DEBUG(IEEE80211_DL_REORDER, "Pkt insert into buffer!! IndicateSeq: %d, NewSeq: %d\n",pTS->RxIndicateSeq, SeqNum); } -#endif } else { /* @@ -781,21 +761,13 @@ void RxReorderIndicatePacket( struct ieee80211_device *ieee, bPktInBuf = false; } -#if 1 if(bPktInBuf && pTS->RxTimeoutIndicateSeq==0xffff) { // Set new pending timer. IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): SET rx timeout timer\n", __FUNCTION__); pTS->RxTimeoutIndicateSeq = pTS->RxIndicateSeq; -#if 0 - if(timer_pending(&pTS->RxPktPendingTimer)) - del_timer_sync(&pTS->RxPktPendingTimer); - pTS->RxPktPendingTimer.expires = jiffies + MSECS(pHTInfo->RxReorderPendingTime); - add_timer(&pTS->RxPktPendingTimer); -#else + mod_timer(&pTS->RxPktPendingTimer, jiffies + MSECS(pHTInfo->RxReorderPendingTime)); -#endif } -#endif } u8 parse_subframe(struct ieee80211_device* ieee,struct sk_buff *skb, @@ -862,11 +834,6 @@ u8 parse_subframe(struct ieee80211_device* ieee,struct sk_buff *skb, nSubframe_Length = (nSubframe_Length>>8) + (nSubframe_Length<<8); if(skb->len<(ETHERNET_HEADER_SIZE + nSubframe_Length)) { -#if 0//cosa - RT_ASSERT( - (nRemain_Length>=(ETHERNET_HEADER_SIZE + nSubframe_Length)), - ("ParseSubframe(): A-MSDU subframe parse error!! Subframe Length: %d\n", nSubframe_Length) ); -#endif printk("%s: A-MSDU parse error!! pRfd->nTotalSubframe : %d\n",\ __FUNCTION__,rxb->nr_subframes); printk("%s: A-MSDU parse error!! Subframe Length: %d\n",__FUNCTION__, nSubframe_Length); @@ -924,7 +891,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, { struct net_device *dev = ieee->dev; struct ieee80211_hdr_4addr *hdr; - //struct ieee80211_hdr_3addrqos *hdr; size_t hdrlen; u16 fc, type, stype, sc; @@ -937,7 +903,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, u16 SeqNum = 0; PRX_TS_RECORD pTS = NULL; bool unicast_packet = false; - //bool bIsAggregateFrame = false; //added by amy for reorder #ifdef NOT_YET struct net_device *wds = NULL; @@ -947,7 +912,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, int from_assoc_ap = 0; void *sta = NULL; #endif -// u16 qos_ctl = 0; u8 dst[ETH_ALEN]; u8 src[ETH_ALEN]; u8 bssid[ETH_ALEN]; @@ -982,7 +946,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, rx_stats->bContainHTC = 1; } - //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); #ifdef NOT_YET #if WIRELESS_EXT > 15 /* Put this code here so that we avoid duplicating it in all @@ -1061,19 +1024,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, else { PRX_TS_RECORD pRxTS = NULL; - #if 0 - struct ieee80211_hdr_3addr *hdr; - u16 fc; - hdr = (struct ieee80211_hdr_3addr *)skb->data; - fc = le16_to_cpu(hdr->frame_ctl); - u8 tmp = (fc & IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS); - - u8 tid = (*((u8*)skb->data + (((fc& IEEE80211_FCTL_FROMDS) && (fc & IEEE80211_FCTL_TODS))?30:24)))&0xf; - printk("====================>fc:%x, tid:%d, tmp:%d\n", fc, tid, tmp); - //u8 tid = (u8)((frameqos*)(buf + ((fc & IEEE80211_FCTL_TODS)&&(fc & IEEE80211_FCTL_FROMDS))? 30 : 24))->field.tid; - #endif - //IEEE80211_DEBUG(IEEE80211_DL_REORDER,"%s(): QOS ENABLE AND RECEIVE QOS DATA , we will get Ts, tid:%d\n",__FUNCTION__, tid); -#if 1 + if(GetTs( ieee, (PTS_COMMON_INFO*) &pRxTS, @@ -1083,7 +1034,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, true)) { - // 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)) && (frag == pRxTS->RxLastFragNum) && (WLAN_GET_SEQ_SEQ(sc) == pRxTS->RxLastSeqNum) ) @@ -1102,24 +1052,9 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, goto rx_dropped; } } -#endif - if (type == IEEE80211_FTYPE_MGMT) { - #if 0 - if ( stype == IEEE80211_STYPE_AUTH && - fc & IEEE80211_FCTL_WEP && ieee->host_decrypt && - (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) - { - printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " - "from %pM\n", dev->name, - hdr->addr2); - /* TODO: could inform hostapd about this so that it - * could send auth failure report */ - goto rx_dropped; - } - #endif + if (type == IEEE80211_FTYPE_MGMT) { - //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); if (ieee80211_rx_frame_mgmt(ieee, skb, rx_stats, type, stype)) goto rx_dropped; else @@ -1192,7 +1127,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, } } #endif - //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, skb->data, skb->len); /* Nullfunc frames may have PS-bit set, so they must be passed to * hostap_handle_sta_rx() before being dropped here. */ if (stype != IEEE80211_STYPE_DATA && @@ -1354,13 +1288,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, hdr->addr2); goto rx_dropped; } -/* - if(ieee80211_is_eapol_frame(ieee, skb, hdrlen)) { - printk(KERN_WARNING "RX: IEEE802.1X EPAOL frame!\n"); - } -*/ //added by amy for reorder -#if 1 if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data) && !is_multicast_ether_addr(hdr->addr1) && !is_broadcast_ether_addr(hdr->addr1)) { @@ -1372,11 +1300,11 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ieee->bis_any_nonbepkts = true; } } -#endif + //added by amy for reorder /* skb: hdr + (possible reassembled) full plaintext payload */ payload = skb->data + hdrlen; - //ethertype = (payload[6] << 8) | payload[7]; + rxb = kmalloc(sizeof(struct ieee80211_rxb), GFP_ATOMIC); if(rxb == NULL) { @@ -1407,7 +1335,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ieee->LinkDetectInfo.NumRxUnicastOkInPeriod++; // 2009.03.03 Leave DC mode immediately when detect high traffic - // DbgPrint("ending Seq %d\n", Frame_SeqNum(pduOS)); if((ieee->state == IEEE80211_LINKED) /*&& !MgntInitAdapterInProgress(pMgntInfo)*/) { if( ((ieee->LinkDetectInfo.NumRxUnicastOkInPeriod +ieee->LinkDetectInfo.NumTxOkInPeriod) > 8 ) || @@ -1460,7 +1387,6 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, memset(sub_skb->cb, 0, sizeof(sub_skb->cb)); sub_skb->dev = dev; sub_skb->ip_summed = CHECKSUM_NONE; /* 802.11 crc not sufficient */ - //skb->ip_summed = CHECKSUM_UNNECESSARY; /* 802.11 crc not sufficient */ netif_rx(sub_skb); } } @@ -1593,8 +1519,6 @@ static int ieee80211_qos_convert_ac_to_parameters(struct int i; struct ieee80211_qos_ac_parameter *ac_params; u8 aci; - //u8 cw_min; - //u8 cw_max; for (i = 0; i < QOS_QUEUE_NUM; i++) { ac_params = &(param_elm->ac_params_record[i]); @@ -1745,7 +1669,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, u16 tmp_htinfo_len=0; u16 ht_realtek_agg_len=0; u8 ht_realtek_agg_buf[MAX_IE_LEN]; -// u16 broadcom_len = 0; #ifdef CONFIG_IEEE80211_DEBUG char rates_str[64]; char *p; @@ -1862,12 +1785,8 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, network->dtim_period = info_element->data[1]; if(ieee->state != IEEE80211_LINKED) break; -#if 0 - network->last_dtim_sta_time[0] = stats->mac_time[0]; -#else //we use jiffies for legacy Power save network->last_dtim_sta_time[0] = jiffies; -#endif network->last_dtim_sta_time[1] = stats->mac_time[1]; network->dtim_data = IEEE80211_DTIM_VALID; @@ -2004,8 +1923,6 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, } - //if(tmp_htcap_len !=0 || tmp_htinfo_len != 0) - { if((info_element->len >= 3 && info_element->data[0] == 0x00 && info_element->data[1] == 0x05 && @@ -2022,17 +1939,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, network->broadcom_cap_exist = true; } - } -#if 0 - if (tmp_htcap_len !=0) - { - u16 cap_ext = ((PHT_CAPABILITY_ELE)&info_element->data[0])->ExtHTCapInfo; - if ((cap_ext & 0x0c00) == 0x0c00) - { - network->ralink_cap_exist = true; - } - } -#endif + if(info_element->len >= 3 && info_element->data[0] == 0x00 && info_element->data[1] == 0x0c && @@ -2211,45 +2118,7 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee, ieee80211_extract_country_ie(ieee, info_element, network, network->bssid);//addr2 is same as addr3 when from an AP break; #endif -/* TODO */ -#if 0 - /* 802.11h */ - case MFIE_TYPE_POWER_CONSTRAINT: - network->power_constraint = info_element->data[0]; - network->flags |= NETWORK_HAS_POWER_CONSTRAINT; - break; - case MFIE_TYPE_CSA: - network->power_constraint = info_element->data[0]; - network->flags |= NETWORK_HAS_CSA; - break; - - case MFIE_TYPE_QUIET: - network->quiet.count = info_element->data[0]; - network->quiet.period = info_element->data[1]; - network->quiet.duration = info_element->data[2]; - network->quiet.offset = info_element->data[3]; - network->flags |= NETWORK_HAS_QUIET; - break; - - case MFIE_TYPE_IBSS_DFS: - if (network->ibss_dfs) - break; - network->ibss_dfs = kmemdup(info_element->data, - info_element->len, - GFP_ATOMIC); - if (!network->ibss_dfs) - return 1; - network->flags |= NETWORK_HAS_IBSS_DFS; - break; - - case MFIE_TYPE_TPC_REPORT: - network->tpc_report.transmit_power = - info_element->data[0]; - network->tpc_report.link_margin = info_element->data[1]; - network->flags |= NETWORK_HAS_TPC_REPORT; - break; -#endif default: IEEE80211_DEBUG_MGMT ("Unsupported info element: %s (%d)\n", @@ -2324,11 +2193,6 @@ static inline u8 ieee80211_SignalStrengthTranslate( { RetSS = CurrSS; } - //RT_TRACE(COMP_DBG, DBG_LOUD, ("##### After Mapping: LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS)); - - // Step 2. Smoothing. - - //RT_TRACE(COMP_DBG, DBG_LOUD, ("$$$$$ After Smoothing: LastSS: %d, CurrSS: %d, RetSS: %d\n", LastSS, CurrSS, RetSS)); return RetSS; } @@ -2350,11 +2214,6 @@ static inline int ieee80211_network_init( struct ieee80211_network *network, struct ieee80211_rx_stats *stats) { -#ifdef CONFIG_IEEE80211_DEBUG - //char rates_str[64]; - //char *p; -#endif - network->qos_data.active = 0; network->qos_data.supported = 0; network->qos_data.param_count = 0; @@ -2391,7 +2250,6 @@ static inline int ieee80211_network_init( memset(network->CountryIeBuf, 0, MAX_IE_LEN); #endif //Initialize HT parameters - //ieee80211_ht_initialize(&network->bssht); HTInitializeBssDesc(&network->bssht); if (stats->freq == IEEE80211_52GHZ_BAND) { /* for A band (No DS info) */ @@ -2434,11 +2292,8 @@ static inline int ieee80211_network_init( if (ieee80211_is_empty_essid(network->ssid, network->ssid_len)) network->flags |= NETWORK_EMPTY_ESSID; -#if 1 stats->signal = 30 + (stats->SignalStrength * 70) / 100; - //stats->signal = ieee80211_SignalStrengthTranslate(stats->signal); stats->noise = ieee80211_translate_todbm((u8)(100-stats->signal)) -25; -#endif memcpy(&network->stats, stats, sizeof(network->stats)); @@ -2452,11 +2307,9 @@ static inline int is_same_network(struct ieee80211_network *src, * and the capability field (in particular IBSS and BSS) all match. * We treat all with the same BSSID and channel * as one network */ - return //((src->ssid_len == dst->ssid_len) && - (((src->ssid_len == dst->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && + return (((src->ssid_len == dst->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && (src->channel == dst->channel) && !memcmp(src->bssid, dst->bssid, ETH_ALEN) && - //!memcmp(src->ssid, dst->ssid, src->ssid_len) && (!memcmp(src->ssid, dst->ssid, src->ssid_len) || (ieee->iw_mode == IW_MODE_INFRA)) && ((src->capability & WLAN_CAPABILITY_IBSS) == (dst->capability & WLAN_CAPABILITY_IBSS)) && @@ -2521,9 +2374,7 @@ static inline void update_network(struct ieee80211_network *dst, dst->last_scanned = jiffies; /* qos related parameters */ - //qos_active = src->qos_data.active; qos_active = dst->qos_data.active; - //old_param = dst->qos_data.old_param_count; old_param = dst->qos_data.param_count; if(dst->flags & NETWORK_HAS_QOS_MASK){ //not update QOS paramter in beacon, as most AP will set all these parameter to 0.//WB @@ -2547,7 +2398,6 @@ static inline void update_network(struct ieee80211_network *dst, dst->qos_data.old_param_count = old_param; /* dst->last_associate is not overwritten */ -#if 1 dst->wmm_info = src->wmm_info; //sure to exist in beacon or probe response frame. if(src->wmm_param[0].ac_aci_acm_aifsn|| \ src->wmm_param[1].ac_aci_acm_aifsn|| \ @@ -2555,10 +2405,6 @@ static inline void update_network(struct ieee80211_network *dst, src->wmm_param[3].ac_aci_acm_aifsn) { memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN); } - //dst->QoS_Enable = src->QoS_Enable; -#else - dst->QoS_Enable = 1;//for Rtl8187 simulation -#endif #ifdef THOMAS_TURBO dst->Turbo_Enable = src->Turbo_Enable; #endif @@ -2599,7 +2445,6 @@ static inline void ieee80211_process_probe_response( #endif unsigned long flags; short renew; - //u8 wmm_info; memset(&network, 0, sizeof(struct ieee80211_network)); IEEE80211_DEBUG_SCAN( @@ -2801,15 +2646,6 @@ void ieee80211_rx_mgt(struct ieee80211_device *ieee, struct ieee80211_hdr_4addr *header, struct ieee80211_rx_stats *stats) { -#if 0 - if(ieee->sta_sleep || (ieee->ps != IEEE80211_PS_DISABLED && - ieee->iw_mode == IW_MODE_INFRA && - ieee->state == IEEE80211_LINKED)) - { - tasklet_schedule(&ieee->ps_task); - } -#endif - if(WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_PROBE_RESP && WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_BEACON) ieee->last_rx_ps_time = jiffies; diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c index 32e5d0aca6c4..c92e8f6c6c3c 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c @@ -163,8 +163,6 @@ void enqueue_mgmt(struct ieee80211_device *ieee, struct sk_buff *skb) */ ieee->mgmt_queue_head = nh; ieee->mgmt_queue_ring[nh] = skb; - - //return 0; } struct sk_buff *dequeue_mgmt(struct ieee80211_device *ieee) @@ -208,16 +206,6 @@ u8 MgntQuery_MgntFrameTxRate(struct ieee80211_device *ieee) rate = 0x02; } - /* - // Data rate of ProbeReq is already decided. Annie, 2005-03-31 - if( pMgntInfo->bScanInProgress || (pMgntInfo->bDualModeScanStep!=0) ) - { - if(pMgntInfo->dot11CurrentWirelessMode==WIRELESS_MODE_A) - rate = 0x0c; - else - rate = 0x02; - } - */ return rate; } @@ -255,9 +243,7 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee ieee->seq_ctrl[0]++; /* avoid watchdog triggers */ - // ieee->dev->trans_start = jiffies; ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); - //dev_kfree_skb_any(skb);//edit by thomas } spin_unlock_irqrestore(&ieee->lock, flags); @@ -283,7 +269,6 @@ inline void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee skb_queue_tail(&ieee->skb_waitQ[tcb_desc->queue_index], skb); } else { ieee->softmac_hard_start_xmit(skb,ieee->dev); - //dev_kfree_skb_any(skb);//edit by thomas } spin_unlock_irqrestore(&ieee->mgmt_tx_lock, flags); } @@ -312,7 +297,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *i ieee->seq_ctrl[0]++; /* avoid watchdog triggers */ - // ieee->dev->trans_start = jiffies; ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); }else{ @@ -327,7 +311,6 @@ inline void softmac_ps_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *i ieee->softmac_hard_start_xmit(skb,ieee->dev); } - //dev_kfree_skb_any(skb);//edit by thomas } inline struct sk_buff *ieee80211_probe_req(struct ieee80211_device *ieee) @@ -374,24 +357,17 @@ void ieee80211_send_beacon(struct ieee80211_device *ieee) struct sk_buff *skb; if(!ieee->ieee_up) return; - //unsigned long flags; + skb = ieee80211_get_beacon_(ieee); if (skb){ softmac_mgmt_xmit(skb, ieee); ieee->softmac_stats.tx_beacons++; - //dev_kfree_skb_any(skb);//edit by thomas } -// ieee->beacon_timer.expires = jiffies + -// (MSECS( ieee->current_network.beacon_interval -5)); - //spin_lock_irqsave(&ieee->beacon_lock,flags); if(ieee->beacon_txing && ieee->ieee_up){ -// if(!timer_pending(&ieee->beacon_timer)) -// add_timer(&ieee->beacon_timer); mod_timer(&ieee->beacon_timer,jiffies+(MSECS(ieee->current_network.beacon_interval-5))); } - //spin_unlock_irqrestore(&ieee->beacon_lock,flags); } @@ -415,7 +391,6 @@ void ieee80211_send_probe(struct ieee80211_device *ieee) if (skb){ softmac_mgmt_xmit(skb, ieee); ieee->softmac_stats.tx_probe_rq++; - //dev_kfree_skb_any(skb);//edit by thomas } } @@ -610,12 +585,7 @@ void ieee80211_start_send_beacons(struct ieee80211_device *ieee) void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee) { -// unsigned long flags; - - //ieee->sync_scan_hurryup = 1; - down(&ieee->scan_sem); -// spin_lock_irqsave(&ieee->lock, flags); if (ieee->scanning == 1){ ieee->scanning = 0; @@ -623,7 +593,6 @@ void ieee80211_softmac_stop_scan(struct ieee80211_device *ieee) cancel_delayed_work(&ieee->softmac_scan_wq); } -// spin_unlock_irqrestore(&ieee->lock, flags); up(&ieee->scan_sem); } @@ -706,7 +675,6 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN); memcpy(auth->header.addr3, beacon->bssid, ETH_ALEN); - //auth->algorithm = ieee->open_wep ? WLAN_AUTH_OPEN : WLAN_AUTH_SHARED_KEY; if(ieee->auth_mode == 0) auth->algorithm = WLAN_AUTH_OPEN; else if(ieee->auth_mode == 1) @@ -756,23 +724,10 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d else atim_len = 0; -#if 1 if(ieee80211_is_54g(ieee->current_network)) erp_len = 3; else erp_len = 0; -#else - if((ieee->current_network.mode == IEEE_G) - ||( ieee->current_network.mode == IEEE_N_24G && ieee->pHTInfo->bCurSuppCCK)) { - erp_len = 3; - erpinfo_content = 0; - if(ieee->current_network.buseprotection) - erpinfo_content |= ERP_UseProtection; - } - else - erp_len = 0; -#endif - crypt = ieee->crypt[ieee->tx_keyidx]; @@ -780,7 +735,7 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d encrypt = ieee->host_encrypt && crypt && crypt->ops && ((0 == strcmp(crypt->ops->name, "WEP") || wpa_ie_len)); //HT ralated element -#if 1 + tmp_ht_cap_buf =(u8*) &(ieee->pHTInfo->SelfHTCap); tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap); tmp_ht_info_buf =(u8*) &(ieee->pHTInfo->SelfHTInfo); @@ -795,7 +750,7 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer); HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len); } -#endif + beacon_size = sizeof(struct ieee80211_probe_response)+2+ ssid_len +3 //channel @@ -804,10 +759,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d +atim_len +erp_len +wpa_ie_len - // +tmp_ht_cap_len - // +tmp_ht_info_len - // +tmp_generic_ie_len -// +wmm_len+2 +ieee->tx_headroom; skb = dev_alloc_skb(beacon_size); if (!skb) @@ -830,10 +781,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d cpu_to_le16((beacon_buf->capability |= WLAN_CAPABILITY_SHORT_SLOT)); crypt = ieee->crypt[ieee->tx_keyidx]; -#if 0 - encrypt = ieee->host_encrypt && crypt && crypt->ops && - (0 == strcmp(crypt->ops->name, "WEP")); -#endif if (encrypt) beacon_buf->capability |= cpu_to_le16(WLAN_CAPABILITY_PRIVACY); @@ -861,7 +808,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d u16 val16; *(tag++) = MFIE_TYPE_IBSS_SET; *(tag++) = 2; - //*((u16*)(tag)) = cpu_to_le16(ieee->current_network.atim_window); val16 = cpu_to_le16(ieee->current_network.atim_window); memcpy((u8 *)tag, (u8 *)&val16, 2); tag+=2; @@ -872,14 +818,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d *(tag++) = 1; *(tag++) = erpinfo_content; } -#if 0 - //Include High Throuput capability - - *(tag++) = MFIE_TYPE_HT_CAP; - *(tag++) = tmp_ht_cap_len - 2; - memcpy(tag, tmp_ht_cap_buf, tmp_ht_cap_len - 2); - tag += tmp_ht_cap_len - 2; -#endif if(rate_ex_len){ *(tag++) = MFIE_TYPE_RATES_EX; *(tag++) = rate_ex_len-2; @@ -887,14 +825,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d tag+=rate_ex_len-2; } -#if 0 - //Include High Throuput info - - *(tag++) = MFIE_TYPE_HT_INFO; - *(tag++) = tmp_ht_info_len - 2; - memcpy(tag, tmp_ht_info_buf, tmp_ht_info_len -2); - tag += tmp_ht_info_len - 2; -#endif if (wpa_ie_len) { if (ieee->iw_mode == IW_MODE_ADHOC) @@ -905,29 +835,6 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d tag += wpa_ie_len; } -#if 0 - // - // Construct Realtek Proprietary Aggregation mode (Set AMPDU Factor to 2, 32k) - // - if(pHTInfo->bRegRT2RTAggregation) - { - (*tag++) = 0xdd; - (*tag++) = tmp_generic_ie_len - 2; - memcpy(tag,tmp_generic_ie_buf,tmp_generic_ie_len -2); - tag += tmp_generic_ie_len -2; - - } -#endif -#if 0 - if(ieee->qos_support) - { - (*tag++) = 0xdd; - (*tag++) = wmm_len; - memcpy(tag,QosOui,wmm_len); - tag += wmm_len; - } -#endif - //skb->dev = ieee->dev; return skb; } @@ -1106,16 +1013,8 @@ void ieee80211_resp_to_probe(struct ieee80211_device *ieee, u8 *dest) inline struct sk_buff *ieee80211_association_req(struct ieee80211_network *beacon,struct ieee80211_device *ieee) { struct sk_buff *skb; - //unsigned long flags; - struct ieee80211_assoc_request_frame *hdr; - u8 *tag;//,*rsn_ie; - //short info_addr = 0; - //int i; - //u16 suite_count = 0; - //u8 suit_select = 0; - //unsigned int wpa_len = beacon->wpa_ie_len; - //for HT + u8 *tag; u8* ht_cap_buf = NULL; u8 ht_cap_len=0; u8* realtek_ie_buf=NULL; @@ -1399,7 +1298,6 @@ void ieee80211_associate_step1(struct ieee80211_device *ieee) ieee->associate_timer.expires = jiffies + (HZ / 2); add_timer(&ieee->associate_timer); } - //dev_kfree_skb_any(skb);//edit by thomas } } @@ -1408,7 +1306,6 @@ void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *challenge, u8 *c; struct sk_buff *skb; struct ieee80211_network *beacon = &ieee->current_network; -// int hlen = sizeof(struct ieee80211_authentication); ieee->associate_seq++; ieee->softmac_stats.tx_auth_rq++; @@ -1428,11 +1325,6 @@ void ieee80211_rtl_auth_challenge(struct ieee80211_device *ieee, u8 *challenge, softmac_mgmt_xmit(skb, ieee); mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); -#if 0 - ieee->associate_timer.expires = jiffies + (HZ / 2); - add_timer(&ieee->associate_timer); -#endif - //dev_kfree_skb_any(skb);//edit by thomas } kfree(challenge); } @@ -1453,11 +1345,6 @@ void ieee80211_associate_step2(struct ieee80211_device *ieee) else{ softmac_mgmt_xmit(skb, ieee); mod_timer(&ieee->associate_timer, jiffies + (HZ/2)); -#if 0 - ieee->associate_timer.expires = jiffies + (HZ / 2); - add_timer(&ieee->associate_timer); -#endif - //dev_kfree_skb_any(skb);//edit by thomas } } void ieee80211_associate_complete_wq(struct work_struct *work) @@ -1483,7 +1370,6 @@ void ieee80211_associate_complete_wq(struct work_struct *work) { printk("Successfully associated, ht not enabled(%d, %d)\n", ieee->pHTInfo->bCurrentHTSupport, ieee->pHTInfo->bEnableHT); memset(ieee->dot11HTOperationalRateSet, 0, 16); - //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); } ieee->LinkDetectInfo.SlotNum = 2 * (1 + ieee->current_network.beacon_interval/500); // To prevent the immediately calling watch_dog after association. @@ -1510,30 +1396,9 @@ void ieee80211_associate_complete_wq(struct work_struct *work) void ieee80211_associate_complete(struct ieee80211_device *ieee) { -// int i; -// struct net_device* dev = ieee->dev; del_timer_sync(&ieee->associate_timer); -#if 0 - for(i = 0; i < 6; i++) { - ieee->seq_ctrl[i] = 0; - } -#endif ieee->state = IEEE80211_LINKED; -#if 0 - if (ieee->pHTInfo->bCurrentHTSupport) - { - printk("Successfully associated, ht enabled\n"); - queue_work(ieee->wq, &ieee->ht_onAssRsp); - } - else - { - printk("Successfully associated, ht not enabled\n"); - memset(ieee->dot11HTOperationalRateSet, 0, 16); - HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); - } -#endif - //ieee->UpdateHalRATRTableHandler(dev, ieee->dot11HTOperationalRateSet); queue_work(ieee->wq, &ieee->associate_complete_wq); } @@ -1553,7 +1418,6 @@ void ieee80211_associate_procedure_wq(struct work_struct *work) ieee80211_stop_scan(ieee); printk("===>%s(), chan:%d\n", __FUNCTION__, ieee->current_network.channel); - //ieee->set_chan(ieee->dev, ieee->current_network.channel); HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); #ifdef ENABLE_IPS @@ -1598,8 +1462,8 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee * This could be obtained by beacons or, if the network does not * broadcast it, it can be put manually. */ - apset = ieee->wap_set;//(memcmp(ieee->current_network.bssid, zero,ETH_ALEN)!=0 ); - ssidset = ieee->ssid_set;//ieee->current_network.ssid[0] != '\0'; + apset = ieee->wap_set; + ssidset = ieee->ssid_set; ssidbroad = !(net->ssid_len == 0 || net->ssid[0]== '\0'); apmatch = (memcmp(ieee->current_network.bssid, net->bssid, ETH_ALEN)==0); ssidmatch = (ieee->current_network.ssid_len == net->ssid_len)&&\ @@ -1633,18 +1497,15 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee } printk(KERN_INFO"Linking with %s,channel:%d, qos:%d, myHT:%d, networkHT:%d\n",ieee->current_network.ssid,ieee->current_network.channel, ieee->current_network.qos_data.supported, ieee->pHTInfo->bEnableHT, ieee->current_network.bssht.bdSupportHT); - //ieee->pHTInfo->IOTAction = 0; HTResetIOTSetting(ieee->pHTInfo); if (ieee->iw_mode == IW_MODE_INFRA){ /* Join the network for the first time */ ieee->AsocRetryCount = 0; //for HT by amy 080514 if((ieee->current_network.qos_data.supported == 1) && - // (ieee->pHTInfo->bEnableHT && ieee->current_network.bssht.bdSupportHT)) ieee->current_network.bssht.bdSupportHT) /*WB, 2008.09.09:bCurrentHTSupport and bEnableHT two flags are going to put together to check whether we are in HT now, so needn't to check bEnableHT flags here. That's is to say we will set to HT support whenever joined AP has the ability to support HT. And whether we are in HT or not, please check bCurrentHTSupport&&bEnableHT now please.*/ { - // ieee->pHTInfo->bCurrentHTSupport = true; HTResetSelfAndSavePeerSetting(ieee, &(ieee->current_network)); } else @@ -1666,7 +1527,6 @@ inline void ieee80211_softmac_new_net(struct ieee80211_device *ieee, struct ieee printk(KERN_INFO"Using B rates\n"); } memset(ieee->dot11HTOperationalRateSet, 0, 16); - //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); ieee->state = IEEE80211_LINKED; } @@ -1773,7 +1633,6 @@ static short probe_rq_parse(struct ieee80211_device *ieee, struct sk_buff *skb, tag++; /* point to the next tag */ } - //IEEE80211DMESG("Card MAC address is "MACSTR, MAC2STR(src)); if (ssidlen == 0) return 1; if (!ssid) return 1; /* ssid not found in tagged param */ @@ -1831,11 +1690,8 @@ ieee80211_rx_probe_rq(struct ieee80211_device *ieee, struct sk_buff *skb) { u8 dest[ETH_ALEN]; - //IEEE80211DMESG("Rx probe"); ieee->softmac_stats.rx_probe_rq++; - //DMESG("Dest is "MACSTR, MAC2STR(dest)); if (probe_rq_parse(ieee, skb, dest)){ - //IEEE80211DMESG("Was for me!"); ieee->softmac_stats.tx_probe_rs++; ieee80211_resp_to_probe(ieee, dest); } @@ -1846,23 +1702,18 @@ ieee80211_rx_auth_rq(struct ieee80211_device *ieee, struct sk_buff *skb) { u8 dest[ETH_ALEN]; int status; - //IEEE80211DMESG("Rx probe"); ieee->softmac_stats.rx_auth_rq++; status = auth_rq_parse(skb, dest); if (status != -1) { ieee80211_resp_to_auth(ieee, status, dest); } - //DMESG("Dest is "MACSTR, MAC2STR(dest)); - } static inline void ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb) { - u8 dest[ETH_ALEN]; - //unsigned long flags; ieee->softmac_stats.rx_ass_rq++; if (assoc_rq_parse(skb,dest) != -1){ @@ -1870,12 +1721,6 @@ ieee80211_rx_assoc_rq(struct ieee80211_device *ieee, struct sk_buff *skb) } printk(KERN_INFO"New client associated: %pM\n", dest); - //FIXME - #if 0 - spin_lock_irqsave(&ieee->lock,flags); - add_associate(ieee,dest); - spin_unlock_irqrestore(&ieee->lock,flags); - #endif } @@ -1939,7 +1784,6 @@ short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, u32 *ti if(pPSC->LPSAwakeIntvl == 0) pPSC->LPSAwakeIntvl = 1; - //pNdisCommon->RegLPSMaxIntvl /// 0x0 - eFastPs, 0xFF -DTIM, 0xNN - 0xNN * BeaconIntvl if(pPSC->RegMaxLPSAwakeIntvl == 0) // Default (0x0 - eFastPs, 0xFF -DTIM, 0xNN - 0xNN * BeaconIntvl) MaxPeriod = 1; // 1 Beacon interval else if(pPSC->RegMaxLPSAwakeIntvl == 0xFF) // DTIM @@ -1962,12 +1806,11 @@ short ieee80211_sta_ps_sleep(struct ieee80211_device *ieee, u32 *time_h, u32 *ti if(pPSC->LPSAwakeIntvl > ieee->current_network.tim.tim_count) LPSAwakeIntvl_tmp = count + (pPSC->LPSAwakeIntvl - count) -((pPSC->LPSAwakeIntvl-count)%period); else - LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl;//ieee->current_network.tim.tim_count;//pPSC->LPSAwakeIntvl; + LPSAwakeIntvl_tmp = pPSC->LPSAwakeIntvl; } *time_l = ieee->current_network.last_dtim_sta_time[0] + MSECS(ieee->current_network.beacon_interval * LPSAwakeIntvl_tmp); - // * ieee->current_network.dtim_period) * 1000; } } @@ -2124,7 +1967,7 @@ void ieee80211_process_action(struct ieee80211_device* ieee, struct sk_buff* skb struct ieee80211_hdr* header = (struct ieee80211_hdr*)skb->data; 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) { IEEE80211_DEBUG(IEEE80211_DL_ERR, "error to get payload of action frame\n"); @@ -2143,8 +1986,6 @@ void ieee80211_process_action(struct ieee80211_device* ieee, struct sk_buff* skb ieee80211_rx_DELBA(ieee, skb); break; default: -// if (net_ratelimit()) -// IEEE80211_DEBUG(IEEE80211_DL_BA, "unknown action frame(%d)\n", tmp); break; } return; @@ -2161,23 +2002,10 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, int chlen=0; int aid; struct ieee80211_assoc_response_frame *assoc_resp; -// struct ieee80211_info_element *info_element; bool bSupportNmode = true, bHalfSupportNmode = false; //default support N mode, disable halfNmode if(!ieee->proto_started) return 0; -#if 0 - printk("%d, %d, %d, %d\n", ieee->sta_sleep, ieee->ps, ieee->iw_mode, ieee->state); - if(ieee->sta_sleep || (ieee->ps != IEEE80211_PS_DISABLED && - ieee->iw_mode == IW_MODE_INFRA && - ieee->state == IEEE80211_LINKED)) - - tasklet_schedule(&ieee->ps_task); - - if(WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_PROBE_RESP && - WLAN_FC_GET_STYPE(header->frame_ctl) != IEEE80211_STYPE_BEACON) - ieee->last_rx_ps_time = jiffies; -#endif switch (WLAN_FC_GET_STYPE(header->frame_ctl)) { @@ -2332,8 +2160,6 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, ieee->softmac_stats.reassoc++; ieee->is_roaming = true; ieee80211_disassociate(ieee); - // 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); } @@ -2346,7 +2172,6 @@ ieee80211_rx_frame_softmac(struct ieee80211_device *ieee, struct sk_buff *skb, break; } - //dev_kfree_skb_any(skb); return 0; } @@ -2382,13 +2207,11 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device * ieee80211_sta_wakeup(ieee,0); /* update the tx status */ -// ieee->stats.tx_bytes += txb->payload_size; -// ieee->stats.tx_packets++; tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); if(tcb_desc->bMulticast) { ieee->stats.multicast++; } -#if 1 + /* if xmit available, just xmit it immediately, else just insert it to the wait queue */ for(i = 0; i < txb->nr_frags; i++) { #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE @@ -2402,7 +2225,6 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device * /* as for the completion function, it does not need * to check it any more. * */ - //ieee80211_rtl_stop_queue(ieee); #ifdef USB_TX_DRIVER_AGGREGATION_ENABLE skb_queue_tail(&ieee->skb_drv_aggQ[queue_index], txb->fragments[i]); #else @@ -2412,15 +2234,11 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, struct ieee80211_device * ieee->softmac_data_hard_start_xmit( txb->fragments[i], ieee->dev,ieee->rate); - //ieee->stats.tx_packets++; - //ieee->stats.tx_bytes += txb->fragments[i]->len; - //ieee->dev->trans_start = jiffies; } } -#endif + ieee80211_txb_free(txb); -//exit: spin_unlock_irqrestore(&ieee->lock,flags); } @@ -2439,9 +2257,7 @@ void ieee80211_resume_tx(struct ieee80211_device *ieee) ieee->softmac_data_hard_start_xmit( ieee->tx_pending.txb->fragments[i], ieee->dev,ieee->rate); - //(i+1)tx_pending.txb->nr_frags); ieee->stats.tx_packets++; - // ieee->dev->trans_start = jiffies; } } @@ -2491,7 +2307,6 @@ void ieee80211_rtl_wake_queue(struct ieee80211_device *ieee) ieee->seq_ctrl[0]++; ieee->softmac_data_hard_start_xmit(skb,ieee->dev,ieee->basic_rate); - //dev_kfree_skb_any(skb);//edit by thomas } } if (!ieee->queue_stop && ieee->tx_pending.txb) @@ -2509,16 +2324,11 @@ exit : void ieee80211_rtl_stop_queue(struct ieee80211_device *ieee) { - //unsigned long flags; - //spin_lock_irqsave(&ieee->lock,flags); - if (! netif_queue_stopped(ieee->dev)){ netif_stop_queue(ieee->dev); ieee->softmac_stats.swtxstop++; } ieee->queue_stop = 1; - //spin_unlock_irqrestore(&ieee->lock,flags); - } @@ -2601,7 +2411,6 @@ void ieee80211_start_ibss_wq(struct work_struct *work) #ifdef ENABLE_DOT11D //if creating an ad-hoc, set its channel to 10 temporarily--this is the requirement for ASUS, not 11D, so disable 11d. -// if((IS_DOT11D_ENABLE(ieee)) && (ieee->state == IEEE80211_NOLINK)) if (ieee->state == IEEE80211_NOLINK) ieee->current_network.channel = 6; #endif @@ -2750,7 +2559,6 @@ void ieee80211_disassociate(struct ieee80211_device *ieee) #endif ieee->is_set_key = false; ieee->link_change(ieee->dev); - //HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); if (ieee->state == IEEE80211_LINKED || ieee->state == IEEE80211_ASSOCIATING) { ieee->state = IEEE80211_NOLINK; @@ -3145,8 +2953,6 @@ static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value) if (ieee->set_security) ieee->set_security(ieee->dev, &sec); - //else - // ret = -EOPNOTSUPP; return ret; } diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c index 5cc74be87463..1456387795bb 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c @@ -98,8 +98,6 @@ int ieee80211_wx_get_freq(struct ieee80211_device *ieee, //NM 0.7.0 will not accept channel any more. fwrq->m = ieee80211_wlan_frequencies[ieee->current_network.channel-1] * 100000; fwrq->e = 1; -// fwrq->m = ieee->current_network.channel; -// fwrq->e = 0; return 0; } @@ -233,23 +231,8 @@ int ieee80211_wx_get_rate(struct ieee80211_device *ieee, union iwreq_data *wrqu, char *extra) { u32 tmp_rate; -#if 0 - printk("===>mode:%d, halfNmode:%d\n", ieee->mode, ieee->bHalfWirelessN24GMode); - if (ieee->mode & (IEEE_A | IEEE_B | IEEE_G)) - tmp_rate = ieee->rate; - else if (ieee->mode & IEEE_N_5G) - tmp_rate = 580; - else if (ieee->mode & IEEE_N_24G) - { - if (ieee->GetHalfNmodeSupportByAPsHandler(ieee->dev)) - tmp_rate = HTHalfMcsToDataRate(ieee, 15); - else - tmp_rate = HTMcsToDataRate(ieee, 15); - } -#else tmp_rate = TxCountToDataRate(ieee, ieee->softmac_stats.CurrentShowTxate); -#endif wrqu->bitrate.value = tmp_rate * 500000; return 0; @@ -531,16 +514,15 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee, union iwreq_data *wrqu, char *extra) { int ret = 0; -#if 1 + if( (!ieee->sta_wake_up) || - // (!ieee->ps_request_tx_ack) || (!ieee->enter_sleep_state) || (!ieee->ps_is_queue_empty)){ return -1; } -#endif + down(&ieee->wx_sem); if (wrqu->power.disabled){ @@ -548,16 +530,11 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee, goto exit; } if (wrqu->power.flags & IW_POWER_TIMEOUT) { - //ieee->ps_period = wrqu->power.value / 1000; ieee->ps_timeout = wrqu->power.value / 1000; } if (wrqu->power.flags & IW_POWER_PERIOD) { - - //ieee->ps_timeout = wrqu->power.value / 1000; ieee->ps_period = wrqu->power.value / 1000; - //wrq->value / 1024; - } switch (wrqu->power.flags & IW_POWER_MODE) { case IW_POWER_UNICAST_R: @@ -571,7 +548,6 @@ int ieee80211_wx_set_power(struct ieee80211_device *ieee, break; case IW_POWER_ON: - // ieee->ps = IEEE80211_PS_DISABLED; break; default: @@ -605,11 +581,8 @@ int ieee80211_wx_get_power(struct ieee80211_device *ieee, wrqu->power.flags = IW_POWER_TIMEOUT; wrqu->power.value = ieee->ps_timeout * 1000; } else { -// ret = -EOPNOTSUPP; -// goto exit; wrqu->power.flags = IW_POWER_PERIOD; wrqu->power.value = ieee->ps_period * 1000; -//ieee->current_network.dtim_period * ieee->current_network.beacon_interval * 1024; } if ((ieee->ps & (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) == (IEEE80211_PS_MBCAST | IEEE80211_PS_UNICAST)) diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c index b26b5a8b5f6b..17535a23c57b 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c @@ -32,7 +32,6 @@ ******************************************************************************/ #include -//#include #include #include #include @@ -232,14 +231,8 @@ int ieee80211_encrypt_fragment( void ieee80211_txb_free(struct ieee80211_txb *txb) { - //int i; if (unlikely(!txb)) return; -#if 0 - for (i = 0; i < txb->nr_frags; i++) - if (txb->fragments[i]) - dev_kfree_skb_any(txb->fragments[i]); -#endif kfree(txb); } @@ -678,22 +671,11 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) const struct iphdr *ip = (struct iphdr *)((u8 *)skb->data+14); if (IPPROTO_UDP == ip->protocol) {//FIXME windows is 11 but here UDP in linux kernel is 17. struct udphdr *udp = (struct udphdr *)((u8 *)ip + (ip->ihl << 2)); - //if(((ntohs(udp->source) == 68) && (ntohs(udp->dest) == 67)) || - /// ((ntohs(udp->source) == 67) && (ntohs(udp->dest) == 68))) { if(((((u8 *)udp)[1] == 68) && (((u8 *)udp)[3] == 67)) || ((((u8 *)udp)[1] == 67) && (((u8 *)udp)[3] == 68))) { // 68 : UDP BOOTP client // 67 : UDP BOOTP server printk("DHCP pkt src port:%d, dest port:%d!!\n", ((u8 *)udp)[1],((u8 *)udp)[3]); - // Use low rate to send DHCP packet. - //if(pMgntInfo->IOTAction & HT_IOT_ACT_WA_IOT_Broadcom) - //{ - // tcb_desc->DataRate = MgntQuery_TxRateExcludeCCKRates(ieee);//0xc;//ofdm 6m - // tcb_desc->bTxDisableRateFallBack = false; - //} - //else - //pTcb->DataRate = Adapter->MgntInfo.LowestBasicRate; - //RTPRINT(FDM, WA_IOT, ("DHCP TranslateHeader(), pTcb->DataRate = 0x%x\n", pTcb->DataRate)); bdhcp = true; #ifdef _RTL8192_EXT_PATCH_ @@ -708,15 +690,6 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) bdhcp = true; ieee->LPSDelayCnt = ieee->current_network.tim.tim_count; - //if(pMgntInfo->IOTAction & HT_IOT_ACT_WA_IOT_Broadcom) - //{ - // tcb_desc->DataRate = MgntQuery_TxRateExcludeCCKRates(Adapter->MgntInfo.mBrates);//0xc;//ofdm 6m - // tcb_desc->bTxDisableRateFallBack = FALSE; - //} - //else - // tcb_desc->DataRate = Adapter->MgntInfo.LowestBasicRate; - //RTPRINT(FDM, WA_IOT, ("ARP TranslateHeader(), pTcb->DataRate = 0x%x\n", pTcb->DataRate)); - } } @@ -736,7 +709,6 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) fc = IEEE80211_FTYPE_DATA; - //if(ieee->current_network.QoS_Enable) if(qos_actived) fc |= IEEE80211_STYPE_QOS_DATA; else @@ -771,7 +743,6 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) qos_ctl = 0; } - //if (ieee->current_network.QoS_Enable) if(qos_actived) { hdr_len = IEEE80211_3ADDR_LEN + 2; @@ -817,7 +788,6 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) txb->encrypted = encrypt; txb->payload_size = bytes; - //if (ieee->current_network.QoS_Enable) if(qos_actived) { txb->queue_index = UP2AC(skb->priority); @@ -864,7 +834,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) /* The last fragment takes the remaining length */ bytes = bytes_last_frag; } - //if(ieee->current_network.QoS_Enable) + if(qos_actived) { // add 1 only indicate to corresponding seq number control 2006/7/12 @@ -930,7 +900,6 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) //WB add to fill data tcb_desc here. only first fragment is considered, need to change, and you may remove to other place. if (txb) { -#if 1 cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE); tcb_desc->bTxEnableFwCalcDur = 1; if (is_multicast_ether_addr(header.addr1)) @@ -941,20 +910,11 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) if ( tcb_desc->bMulticast || tcb_desc->bBroadcast) tcb_desc->data_rate = ieee->basic_rate; else - //tcb_desc->data_rate = CURRENT_RATE(ieee->current_network.mode, ieee->rate, ieee->HTCurrentOperaRate); tcb_desc->data_rate = CURRENT_RATE(ieee->mode, ieee->rate, ieee->HTCurrentOperaRate); if(bdhcp == true){ - // Use low rate to send DHCP packet. - //if(ieee->pHTInfo->IOTAction & HT_IOT_ACT_WA_IOT_Broadcom) { - // tcb_desc->data_rate = MGN_1M;//MgntQuery_TxRateExcludeCCKRates(ieee);//0xc;//ofdm 6m - // tcb_desc->bTxDisableRateFallBack = false; - //} - //else - { tcb_desc->data_rate = MGN_1M; tcb_desc->bTxDisableRateFallBack = 1; - } tcb_desc->RATRIndex = 7; tcb_desc->bTxUseDriverAssingedRate = 1; @@ -968,9 +928,6 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) ieee80211_query_BandwidthMode(ieee, tcb_desc); ieee80211_query_protectionmode(ieee, tcb_desc, txb->fragments[0]); ieee80211_query_seqnum(ieee, txb->fragments[0], header.addr1); -// IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, txb->fragments[0]->data, txb->fragments[0]->len); - //IEEE80211_DEBUG_DATA(IEEE80211_DL_DATA, tcb_desc, sizeof(cb_desc)); -#endif } spin_unlock_irqrestore(&ieee->lock, flags); dev_kfree_skb_any(skb); @@ -997,4 +954,3 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) } -//EXPORT_SYMBOL(ieee80211_txb_free); diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c index 368f669ded81..cac340e5238a 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c @@ -36,11 +36,7 @@ #include #include "ieee80211.h" -#if 0 -static const char *ieee80211_modes[] = { - "?", "a", "b", "ab", "g", "ag", "bg", "abg" -}; -#endif + struct modes_unit { char *mode_string; int mode_size;