]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / drivers / staging / rtl8192u / ieee80211 / ieee80211_softmac.c
index bc8c4253369367335cbfe66d5ceb56281e187d15..20f8c347cae432522a5af6acd618cd9ea8e393f5 100644 (file)
@@ -21,9 +21,7 @@
 #include <linux/slab.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
@@ -430,10 +428,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
        down(&ieee->scan_sem);
 
        while(1)
@@ -443,11 +439,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 function can be called in two situations
                 * 1- We have switched to ad-hoc mode and we are
@@ -471,9 +463,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
@@ -496,10 +486,8 @@ out:
        }
        else{
        ieee->sync_scan_hurryup = 0;
-#ifdef ENABLE_DOT11D
        if(IS_DOT11D_ENABLE(ieee))
                DOT11D_ScanComplete(ieee);
-#endif
        up(&ieee->scan_sem);
 }
 }
@@ -510,10 +498,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);
        static short watchdog = 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
        if(!ieee->ieee_up)
                return;
        down(&ieee->scan_sem);
@@ -523,25 +509,16 @@ void ieee80211_softmac_scan_wq(struct work_struct *work)
                if (watchdog++ > 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
+                       if (!channel_map[ieee->current_network.channel]) {
                                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);
 
 
@@ -550,10 +527,8 @@ void ieee80211_softmac_scan_wq(struct work_struct *work)
        up(&ieee->scan_sem);
        return;
 out:
-#ifdef ENABLE_DOT11D
        if(IS_DOT11D_ENABLE(ieee))
                DOT11D_ScanComplete(ieee);
-#endif
        ieee->actscanning = false;
        watchdog = 0;
        ieee->scanning = 0;
@@ -635,7 +610,6 @@ 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))
@@ -643,7 +617,6 @@ void ieee80211_start_scan(struct ieee80211_device *ieee)
                        RESET_CIE_WATCHDOG(ieee);
                }
        }
-#endif
        if (ieee->softmac_features & IEEE_SOFTMAC_SCAN){
                if (ieee->scanning == 0){
                        ieee->scanning = 1;
@@ -657,7 +630,6 @@ 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))
@@ -665,7 +637,6 @@ void ieee80211_start_scan_syncro(struct ieee80211_device *ieee)
                        RESET_CIE_WATCHDOG(ieee);
                }
        }
-#endif
        ieee->sync_scan_hurryup = 0;
        if (ieee->softmac_features & IEEE_SOFTMAC_SCAN)
                ieee80211_softmac_scan_syncro(ieee);
@@ -2390,11 +2361,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
@@ -2483,7 +2452,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.
@@ -2495,7 +2463,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
@@ -2530,10 +2497,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;
        ieee->link_change(ieee->dev);
@@ -2669,11 +2634,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;
        }
 
@@ -2721,11 +2682,9 @@ void ieee80211_softmac_init(struct ieee80211_device *ieee)
        for(i = 0; i < 5; i++) {
          ieee->seq_ctrl[i] = 0;
        }
-#ifdef ENABLE_DOT11D
        ieee->pDot11dInfo = kzalloc(sizeof(RT_DOT11D_INFO), GFP_ATOMIC);
        if (!ieee->pDot11dInfo)
                IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc memory for DOT11D\n");
-#endif
        //added for  AP roaming
        ieee->LinkDetectInfo.SlotNum = 2;
        ieee->LinkDetectInfo.NumRecvBcnInPeriod=0;
@@ -2796,13 +2755,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);