Skip to content

Commit

Permalink
Staging: rtl8192su: remove ENABLE_DOT11D ifdefs
Browse files Browse the repository at this point in the history
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent fe4f699 commit 622d501
Show file tree
Hide file tree
Showing 12 changed files with 1 addition and 113 deletions.
1 change: 0 additions & 1 deletion drivers/staging/rtl8192su/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ EXTRA_CFLAGS += -mhard-float -DCONFIG_FORCE_HARD_FLOAT=y
EXTRA_CFLAGS += -DJACKSON_NEW_RX
EXTRA_CFLAGS += -DTHOMAS_BEACON -DTHOMAS_TURBO
#EXTRA_CFLAGS += -DUSE_ONE_PIPE
EXTRA_CFLAGS += -DENABLE_DOT11D

EXTRA_CFLAGS += -DRTL8192SU
EXTRA_CFLAGS += -DRTL8190_Download_Firmware_From_Header=1
Expand Down
3 changes: 1 addition & 2 deletions drivers/staging/rtl8192su/ieee80211/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ EXTRA_CFLAGS += -DRTL8192S_DISABLE_FW_DM=0
EXTRA_CFLAGS += -DRTL8192SU
#EXTRA_CFLAGS += -DJOHN_NOCPY
EXTRA_CFLAGS += -DTHOMAS_TURBO
#flags to enable or disble 80211D feature
EXTRA_CFLAGS += -DENABLE_DOT11D

ieee80211-rsl-objs := ieee80211_rx.o \
ieee80211_softmac.o \
ieee80211_tx.o \
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/rtl8192su/ieee80211/dot11d.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#ifdef ENABLE_DOT11D
//-----------------------------------------------------------------------------
// File:
// Dot11d.c
Expand Down Expand Up @@ -227,4 +226,3 @@ EXPORT_SYMBOL(DOT11D_ScanComplete);
EXPORT_SYMBOL(IsLegalChannel);
EXPORT_SYMBOL(ToLegalChannel);

#endif
4 changes: 0 additions & 4 deletions drivers/staging/rtl8192su/ieee80211/dot11d.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
#ifndef __INC_DOT11D_H
#define __INC_DOT11D_H

#ifdef ENABLE_DOT11D
#include "ieee80211.h"

//#define ENABLE_DOT11D

//#define DOT11D_MAX_CHNL_NUM 83

typedef struct _CHNL_TXPOWER_TRIPLE {
Expand Down Expand Up @@ -98,5 +95,4 @@ int ToLegalChannel(
struct ieee80211_device * dev,
u8 channel
);
#endif //ENABLE_DOT11D
#endif // #ifndef __INC_DOT11D_H
8 changes: 0 additions & 8 deletions drivers/staging/rtl8192su/ieee80211/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1446,10 +1446,8 @@ struct ieee80211_network {
#ifdef THOMAS_TURBO
u8 Turbo_Enable;//enable turbo mode, added by thomas
#endif
#ifdef ENABLE_DOT11D
u16 CountryIeLen;
u8 CountryIeBuf[MAX_IE_LEN];
#endif
// HT Related, by amy, 2008.04.29
BSS_HT bssht;
// Add to handle broadcom AP management frame CCK rate.
Expand Down Expand Up @@ -1674,7 +1672,6 @@ typedef u32 RT_RF_CHANGE_SOURCE;
#define RF_CHANGE_BY_IPS BIT28
#define RF_CHANGE_BY_INIT 0 // Do not change the RFOff reason. Defined by Bruce, 2008-01-17.

#ifdef ENABLE_DOT11D
typedef enum
{
COUNTRY_CODE_FCC = 0,
Expand All @@ -1689,7 +1686,6 @@ typedef enum
COUNTRY_CODE_MIC,
COUNTRY_CODE_GLOBAL_DOMAIN
}country_code_type_t;
#endif
// Firmware realted CMD IO.
typedef enum _FW_CMD_IO_TYPE{
FW_CMD_DIG_ENABLE = 0, // For DIG DM
Expand Down Expand Up @@ -1898,12 +1894,8 @@ struct ieee80211_device {

/* map of allowed channels. 0 is dummy */
// FIXME: remeber to default to a basic channel plan depending of the PHY type
#ifdef ENABLE_DOT11D
void* pDot11dInfo;
bool bGlobalDomain;
#else
int channel_map[MAX_CHANNEL_NUMBER+1];
#endif
int rate; /* current rate */
int basic_rate;
//FIXME: pleace callback, see if redundant with softmac_features
Expand Down
12 changes: 0 additions & 12 deletions drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@
#include <linux/ctype.h>

#include "ieee80211.h"
#ifdef ENABLE_DOT11D
#include "dot11d.h"
#endif
static inline void ieee80211_monitor_rx(struct ieee80211_device *ieee,
struct sk_buff *skb,
struct ieee80211_rx_stats *rx_stats)
Expand Down Expand Up @@ -1652,7 +1650,6 @@ static const char *get_info_element_string(u16 id)
}
#endif

#ifdef ENABLE_DOT11D
static inline void ieee80211_extract_country_ie(
struct ieee80211_device *ieee,
struct ieee80211_info_element *info_element,
Expand Down Expand Up @@ -1685,7 +1682,6 @@ static inline void ieee80211_extract_country_ie(
}

}
#endif

int ieee80211_parse_info_param(struct ieee80211_device *ieee,
struct ieee80211_info_element *info_element,
Expand Down Expand Up @@ -2176,14 +2172,12 @@ int ieee80211_parse_info_param(struct ieee80211_device *ieee,
"QoS Error need to parse QOS_PARAMETER IE\n");
break;

#ifdef ENABLE_DOT11D
case MFIE_TYPE_COUNTRY:
IEEE80211_DEBUG_SCAN("MFIE_TYPE_COUNTRY: %d bytes\n",
info_element->len);
//printk("=====>Receive <%s> Country IE\n",network->ssid);
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 */
Expand Down Expand Up @@ -2359,10 +2353,8 @@ static inline int ieee80211_network_init(
#ifdef THOMAS_TURBO
network->Turbo_Enable = 0;
#endif
#ifdef ENABLE_DOT11D
network->CountryIeLen = 0;
memset(network->CountryIeBuf, 0, MAX_IE_LEN);
#endif
//Initialize HT parameters
//ieee80211_ht_initialize(&network->bssht);
HTInitializeBssDesc(&network->bssht);
Expand Down Expand Up @@ -2540,10 +2532,8 @@ static inline void update_network(struct ieee80211_network *dst,
dst->Turbo_Enable = src->Turbo_Enable;
#endif

#ifdef ENABLE_DOT11D
dst->CountryIeLen = src->CountryIeLen;
memcpy(dst->CountryIeBuf, src->CountryIeBuf, src->CountryIeLen);
#endif

//added by amy for LEAP
dst->bWithAironetIE = src->bWithAironetIE;
Expand Down Expand Up @@ -2611,7 +2601,6 @@ static inline void ieee80211_process_probe_response(
return;
}

#ifdef ENABLE_DOT11D
// For Asus EeePc request,
// (1) if wireless adapter receive get any 802.11d country code in AP beacon,
// wireless adapter should follow the country code.
Expand Down Expand Up @@ -2668,7 +2657,6 @@ static inline void ieee80211_process_probe_response(
}
}
}
#endif

/* The network parsed correctly -- so now we scan our known networks
* to see if we can find it in our list.
Expand Down
44 changes: 0 additions & 44 deletions drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
#include <linux/delay.h>
#include <linux/version.h>
#include <asm/uaccess.h>
#ifdef ENABLE_DOT11D
#include "dot11d.h"
#endif

u8 rsn_authen_cipher_suite[16][4] = {
{0x00,0x0F,0xAC,0x00}, //Use group key, //Reserved
Expand Down Expand Up @@ -435,10 +433,8 @@ void ieee80211_send_probe_requests(struct ieee80211_device *ieee)
void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
{
short ch = 0;
#ifdef ENABLE_DOT11D
u8 channel_map[MAX_CHANNEL_NUMBER+1];
memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
#endif
ieee->be_scan_inprogress = true;
down(&ieee->scan_sem);

Expand All @@ -449,11 +445,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
ch++;
if (ch > MAX_CHANNEL_NUMBER)
goto out; /* scan completed */
#ifdef ENABLE_DOT11D
}while(!channel_map[ch]);
#else
}while(!ieee->channel_map[ch]);
#endif

/* this fuction can be called in two situations
* 1- We have switched to ad-hoc mode and we are
Expand All @@ -477,9 +469,7 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
if (ieee->state == IEEE80211_LINKED)
goto out;
ieee->set_chan(ieee->dev, ch);
#ifdef ENABLE_DOT11D
if(channel_map[ch] == 1)
#endif
ieee80211_send_probe_requests(ieee);

/* this prevent excessive time wait when we
Expand All @@ -503,10 +493,8 @@ void ieee80211_softmac_scan_syncro(struct ieee80211_device *ieee)
}
else{
ieee->sync_scan_hurryup = 0;
#ifdef ENABLE_DOT11D
if(IS_DOT11D_ENABLE(ieee))
DOT11D_ScanComplete(ieee);
#endif
up(&ieee->scan_sem);
ieee->be_scan_inprogress = false;
}
Expand All @@ -517,10 +505,8 @@ void ieee80211_softmac_scan_wq(struct work_struct *work)
struct delayed_work *dwork = container_of(work, struct delayed_work, work);
struct ieee80211_device *ieee = container_of(dwork, struct ieee80211_device, softmac_scan_wq);
u8 last_channel = ieee->current_network.channel; //recored init channel inorder not change current channel when comming out the scan unexpectedly. WB.
#ifdef ENABLE_DOT11D
u8 channel_map[MAX_CHANNEL_NUMBER+1];
memcpy(channel_map, GET_DOT11D_INFO(ieee)->channel_map, MAX_CHANNEL_NUMBER+1);
#endif
if(!ieee->ieee_up)
return;
down(&ieee->scan_sem);
Expand All @@ -530,36 +516,24 @@ void ieee80211_softmac_scan_wq(struct work_struct *work)
if (ieee->scan_watch_dog++ > MAX_CHANNEL_NUMBER)
{
//if current channel is not in channel map, set to default channel.
#ifdef ENABLE_DOT11D
if (!channel_map[ieee->current_network.channel]);
#else
if (!ieee->channel_map[ieee->current_network.channel]);
#endif
ieee->current_network.channel = 6;
goto out; /* no good chans */
}
#ifdef ENABLE_DOT11D
}while(!channel_map[ieee->current_network.channel]);
#else
}while(!ieee->channel_map[ieee->current_network.channel]);
#endif
if (ieee->scanning == 0 )
goto out;
ieee->set_chan(ieee->dev, ieee->current_network.channel);
#ifdef ENABLE_DOT11D
if(channel_map[ieee->current_network.channel] == 1)
#endif
ieee80211_send_probe_requests(ieee);

queue_delayed_work(ieee->wq, &ieee->softmac_scan_wq, IEEE80211_SOFTMAC_SCAN_TIME);

up(&ieee->scan_sem);
return;
out:
#ifdef ENABLE_DOT11D
if(IS_DOT11D_ENABLE(ieee))
DOT11D_ScanComplete(ieee);
#endif
ieee->current_network.channel = last_channel;
ieee->actscanning = false;
ieee->scan_watch_dog = 0;
Expand Down Expand Up @@ -640,15 +614,13 @@ void ieee80211_stop_scan(struct ieee80211_device *ieee)
/* called with ieee->lock held */
void ieee80211_start_scan(struct ieee80211_device *ieee)
{
#ifdef ENABLE_DOT11D
if(IS_DOT11D_ENABLE(ieee) )
{
if(IS_COUNTRY_IE_VALID(ieee))
{
RESET_CIE_WATCHDOG(ieee);
}
}
#endif
if (ieee->softmac_features & IEEE_SOFTMAC_SCAN){
if (ieee->scanning == 0){
ieee->scanning = 1;
Expand All @@ -662,15 +634,13 @@ void ieee80211_start_scan(struct ieee80211_device *ieee)
/* called with wx_sem held */
void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
{
#ifdef ENABLE_DOT11D
if(IS_DOT11D_ENABLE(ieee) )
{
if(IS_COUNTRY_IE_VALID(ieee))
{
RESET_CIE_WATCHDOG(ieee);
}
}
#endif
ieee->sync_scan_hurryup = 0;
if (ieee->softmac_features & IEEE_SOFTMAC_SCAN)
ieee80211_softmac_scan_syncro(ieee);
Expand Down Expand Up @@ -2499,11 +2469,9 @@ void ieee80211_start_ibss_wq(struct work_struct *work)
ieee80211_softmac_check_all_nets(ieee);


#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
/* if not then the state is not linked. Maybe the user swithced to
* ad-hoc mode just after being in monitor mode, or just after
* being very few time in managed mode (so the card have had no
Expand Down Expand Up @@ -2593,7 +2561,6 @@ inline void ieee80211_start_ibss(struct ieee80211_device *ieee)
void ieee80211_start_bss(struct ieee80211_device *ieee)
{
unsigned long flags;
#ifdef ENABLE_DOT11D
//
// Ref: 802.11d 11.1.3.3
// STA shall not start a BSS unless properly formed Beacon frame including a Country IE.
Expand All @@ -2605,7 +2572,6 @@ void ieee80211_start_bss(struct ieee80211_device *ieee)
return;
}
}
#endif
/* check if we have already found the net we
* are interested in (if any).
* if not (we are disassociated and we are not
Expand Down Expand Up @@ -2647,10 +2613,8 @@ void ieee80211_disassociate(struct ieee80211_device *ieee)

if (ieee->data_hard_stop)
ieee->data_hard_stop(ieee->dev);
#ifdef ENABLE_DOT11D
if(IS_DOT11D_ENABLE(ieee))
Dot11d_Reset(ieee);
#endif
ieee->state = IEEE80211_NOLINK;
ieee->is_set_key = false;

Expand Down Expand Up @@ -2796,11 +2760,7 @@ void ieee80211_start_protocol(struct ieee80211_device *ieee)
ch++;
if (ch > MAX_CHANNEL_NUMBER)
return; /* no channel found */
#ifdef ENABLE_DOT11D
}while(!GET_DOT11D_INFO(ieee)->channel_map[ch]);
#else
}while(!ieee->channel_map[ch]);
#endif
ieee->current_network.channel = ch;
}

Expand Down Expand Up @@ -2848,12 +2808,10 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
for(i = 0; i < 5; i++) {
ieee->seq_ctrl[i] = 0;
}
#ifdef ENABLE_DOT11D
ieee->pDot11dInfo = kmalloc(sizeof(RT_DOT11D_INFO), GFP_ATOMIC);
if (!ieee->pDot11dInfo)
IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for DOT11D\n");
memset(ieee->pDot11dInfo, 0, sizeof(RT_DOT11D_INFO));
#endif
//added for AP roaming
ieee->LinkDetectInfo.SlotNum = 2;
ieee->LinkDetectInfo.NumRecvBcnInPeriod=0;
Expand Down Expand Up @@ -2924,13 +2882,11 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
void ieee80211_softmac_free(struct ieee80211_device *ieee)
{
down(&ieee->wx_sem);
#ifdef ENABLE_DOT11D
if(NULL != ieee->pDot11dInfo)
{
kfree(ieee->pDot11dInfo);
ieee->pDot11dInfo = NULL;
}
#endif
del_timer_sync(&ieee->associate_timer);

cancel_delayed_work(&ieee->associate_retry_wq);
Expand Down
4 changes: 0 additions & 4 deletions drivers/staging/rtl8192su/ieee80211/ieee80211_softmac_wx.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@


#include "ieee80211.h"
#ifdef ENABLE_DOT11D
#include "dot11d.h"
#endif
/* FIXME: add A freqs */

const long ieee80211_wlan_frequencies[] = {
Expand Down Expand Up @@ -63,12 +61,10 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info

}else { /* Set the channel */

#ifdef ENABLE_DOT11D
if (!(GET_DOT11D_INFO(ieee)->channel_map)[fwrq->m]) {
ret = -EINVAL;
goto out;
}
#endif
ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel);

Expand Down
Loading

0 comments on commit 622d501

Please sign in to comment.