Staging: rtl8192su: remove RTL8192SE ifdefs
[safe/jmp/linux-2.6] / drivers / staging / rtl8192su / ieee80211 / ieee80211_softmac_wx.c
index 1f50c46..8591013 100644 (file)
@@ -15,9 +15,7 @@
 
 
 #include "ieee80211.h"
-#ifdef ENABLE_DOT11D
 #include "dot11d.h"
-#endif
 /* FIXME: add A freqs */
 
 const long ieee80211_wlan_frequencies[] = {
@@ -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);
 
@@ -313,14 +309,9 @@ out:
        return 0;
 }
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
 void ieee80211_wx_sync_scan_wq(struct work_struct *work)
 {
         struct ieee80211_device *ieee = container_of(work, struct ieee80211_device, wx_sync_scan_wq);
-#else
-void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
-{
-#endif
        short chan;
        HT_EXTCHNL_OFFSET chan_offset=0;
        HT_CHANNEL_WIDTH bandwidth=0;
@@ -336,16 +327,12 @@ void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
 
        ieee->state = IEEE80211_LINKED_SCANNING;
        ieee->link_change(ieee->dev);
-#ifndef RTL8192SE
        ieee->InitialGainHandler(ieee->dev,IG_Backup);
-#endif
-#if(RTL8192S_DISABLE_FW_DM == 0)
        if (ieee->SetFwCmdHandler)
        {
                ieee->SetFwCmdHandler(ieee->dev, FW_CMD_DIG_HALT);
                ieee->SetFwCmdHandler(ieee->dev, FW_CMD_HIGH_PWR_DISABLE);
        }
-#endif
        if (ieee->pHTInfo->bCurrentHTSupport && ieee->pHTInfo->bEnableHT && ieee->pHTInfo->bCurBW40MHz) {
                b40M = 1;
                chan_offset = ieee->pHTInfo->CurSTAExtChnlOffset;
@@ -367,16 +354,12 @@ void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee)
                ieee->set_chan(ieee->dev, chan);
        }
 
-#ifndef RTL8192SE
        ieee->InitialGainHandler(ieee->dev,IG_Restore);
-#endif
-#if(RTL8192S_DISABLE_FW_DM == 0)
        if (ieee->SetFwCmdHandler)
        {
                ieee->SetFwCmdHandler(ieee->dev, FW_CMD_DIG_RESUME);
                ieee->SetFwCmdHandler(ieee->dev, FW_CMD_HIGH_PWR_ENABLE);
        }
-#endif
        ieee->state = IEEE80211_LINKED;
        ieee->link_change(ieee->dev);
        // To prevent the immediately calling watch_dog after scan.
@@ -410,11 +393,7 @@ int ieee80211_wx_set_scan(struct ieee80211_device *ieee, struct iw_request_info
        }
 
        if ( ieee->state == IEEE80211_LINKED){
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
                queue_work(ieee->wq, &ieee->wx_sync_scan_wq);
-#else
-               schedule_task(&ieee->wx_sync_scan_wq);
-#endif
                /* intentionally forget to up sem */
                return 0;
        }
@@ -460,18 +439,6 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
        if (wrqu->essid.flags && wrqu->essid.length) {
                //first flush current network.ssid
                len = ((wrqu->essid.length-1) < IW_ESSID_MAX_SIZE) ? (wrqu->essid.length-1) : IW_ESSID_MAX_SIZE;
-#if LINUX_VERSION_CODE <  KERNEL_VERSION(2,6,20)
-               strncpy(ieee->current_network.ssid, extra, len);
-               ieee->current_network.ssid_len = len;
-#if 0
-               {
-                       int i;
-                       for (i=0; i<len; i++)
-                               printk("%c ", extra[i]);
-                       printk("\n");
-               }
-#endif
-#else
                strncpy(ieee->current_network.ssid, extra, len+1);
                ieee->current_network.ssid_len = len+1;
 #if 0
@@ -482,7 +449,6 @@ int ieee80211_wx_set_essid(struct ieee80211_device *ieee,
                        printk("\n");
                }
 #endif
-#endif
                ieee->ssid_set = 1;
        }
        else{
@@ -548,21 +514,21 @@ int ieee80211_wx_get_name(struct ieee80211_device *ieee,
                             struct iw_request_info *info,
                             union iwreq_data *wrqu, char *extra)
 {
-       strcpy(wrqu->name, "802.11");
+       strlcpy(wrqu->name, "802.11", IFNAMSIZ);
        if(ieee->modulation & IEEE80211_CCK_MODULATION){
-               strcat(wrqu->name, "b");
+               strlcat(wrqu->name, "b", IFNAMSIZ);
                if(ieee->modulation & IEEE80211_OFDM_MODULATION)
-                       strcat(wrqu->name, "/g");
+                       strlcat(wrqu->name, "/g", IFNAMSIZ);
        }else if(ieee->modulation & IEEE80211_OFDM_MODULATION)
-               strcat(wrqu->name, "g");
+               strlcat(wrqu->name, "g", IFNAMSIZ);
        if (ieee->mode & (IEEE_N_24G | IEEE_N_5G))
-               strcat(wrqu->name, "/n");
+               strlcat(wrqu->name, "/n", IFNAMSIZ);
 
        if((ieee->state == IEEE80211_LINKED) ||
                (ieee->state == IEEE80211_LINKED_SCANNING))
-               strcat(wrqu->name," linked");
+               strlcat(wrqu->name, "  link", IFNAMSIZ);
        else if(ieee->state != IEEE80211_NOLINK)
-               strcat(wrqu->name," link..");
+               strlcat(wrqu->name, " .....", IFNAMSIZ);
 
 
        return 0;
@@ -670,7 +636,7 @@ exit:
        return ret;
 
 }
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+
 EXPORT_SYMBOL(ieee80211_wx_get_essid);
 EXPORT_SYMBOL(ieee80211_wx_set_essid);
 EXPORT_SYMBOL(ieee80211_wx_set_rate);
@@ -689,23 +655,3 @@ EXPORT_SYMBOL(ieee80211_wx_get_power);
 EXPORT_SYMBOL(ieee80211_wlan_frequencies);
 EXPORT_SYMBOL(ieee80211_wx_set_rts);
 EXPORT_SYMBOL(ieee80211_wx_get_rts);
-#else
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_essid);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_essid);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rate);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rate);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_wap);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_wap);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_mode);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_mode);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_scan);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_freq);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_freq);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rawtx);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_name);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_power);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_power);
-EXPORT_SYMBOL_NOVERS(ieee80211_wlan_frequencies);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_set_rts);
-EXPORT_SYMBOL_NOVERS(ieee80211_wx_get_rts);
-#endif