Commit 85c876e4 authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman

staging: rtl8192e: Delete dead code in ieee80211 lib

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c8881632
......@@ -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;i<skb->len;i++){
if( (i%24)==0 ) printk("\n");
printk("%2x ", ((u8*)skb->data)[i]);
}
printk("\n");
}
#endif /*JOHN_DUMP*/
return keyidx;
}
......
......@@ -9,7 +9,6 @@
* more details.
*/
//#include <linux/config.h>
#include <linux/version.h>
#include <linux/module.h>
#include <linux/init.h>
......
......@@ -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 | */
......
......@@ -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))
......
......@@ -32,7 +32,6 @@
******************************************************************************/
#include <linux/compiler.h>
//#include <linux/config.h>
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/in6.h>
......@@ -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);
......@@ -36,11 +36,7 @@
#include <linux/module.h>
#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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment