]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
staging: rtl8192su: merge changes in ieee80211_authentication_req()
authorFlorian Schilhabel <florian.c.schilhabel@googlemail.com>
Thu, 15 Jul 2010 17:04:00 +0000 (19:04 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 Jul 2010 19:00:21 +0000 (12:00 -0700)
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192su/ieee80211/ieee80211.h
drivers/staging/rtl8192su/ieee80211/ieee80211_softmac.c

index 8a20323cbce68d78d9c09c3978519ae0734ff219..2c860db396c9b2d0074cead04ace99e93090c031 100644 (file)
@@ -168,6 +168,10 @@ typedef struct ieee_param {
 /* QOS control */
 #define IEEE80211_QCTL_TID              0x000F
 
+#define OUI_SUBTYPE_WMM_INFO           0
+#define OUI_SUBTYPE_WMM_PARAM  1
+#define OUI_SUBTYPE_QOS_CAPABI 5
+
 /* debug macros */
 #define CONFIG_IEEE80211_DEBUG
 #ifdef CONFIG_IEEE80211_DEBUG
index 7d4567d6808e69f865a98fd0d53f7c51ccced541..2e2f6a0c8f2dde2e1621470bf617a18deb84719c 100644 (file)
@@ -684,7 +684,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)
@@ -701,6 +700,26 @@ inline struct sk_buff *ieee80211_authentication_req(struct ieee80211_network *be
 
 }
 
+void constructWMMIE(u8* wmmie, u8* wmm_len,u8 oui_subtype)
+{
+       u8      szQoSOUI[] ={221, 0, 0x00, 0x50, 0xf2, 0x02, 0, 1};
+
+       if (oui_subtype == OUI_SUBTYPE_QOS_CAPABI)
+       {
+               szQoSOUI[0] = 46;
+               szQoSOUI[1] = *wmm_len;
+               memcpy(wmmie,szQoSOUI,3);
+               *wmm_len = 3;
+       }
+       else
+       {
+               szQoSOUI[1] = *wmm_len + 6;
+               szQoSOUI[6] = oui_subtype;
+               memcpy(wmmie, szQoSOUI, 8);
+               *(wmmie+8) = 0;
+               *wmm_len = 9;
+       }
+}
 
 static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *dest)
 {
@@ -719,14 +738,18 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
        int wpa_ie_len = ieee->wpa_ie_len;
        u8 erpinfo_content = 0;
 
-       u8* tmp_ht_cap_buf;
+       u8* tmp_ht_cap_buf=NULL;
        u8 tmp_ht_cap_len=0;
-       u8* tmp_ht_info_buf;
+       u8* tmp_ht_info_buf=NULL;
        u8 tmp_ht_info_len=0;
        PRT_HIGH_THROUGHPUT     pHTInfo = ieee->pHTInfo;
        u8* tmp_generic_ie_buf=NULL;
        u8 tmp_generic_ie_len=0;
 
+
+       u8 wmmie[9] = {0};
+       u8 wmm_len = 0;
+
        if(rate_ex_len > 0) rate_ex_len+=2;
 
        if(ieee->current_network.capability & WLAN_CAPABILITY_IBSS)
@@ -734,7 +757,7 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
        else
                atim_len = 0;
 
-#if 1
+#if 0
        if(ieee80211_is_54g(ieee->current_network))
                erp_len = 3;
        else
@@ -759,21 +782,35 @@ static struct sk_buff* ieee80211_probe_resp(struct ieee80211_device *ieee, u8 *d
                ((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);
-       tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo);
-       HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, &tmp_ht_cap_len,encrypt);
-       HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
-
-
-        if(pHTInfo->bRegRT2RTAggregation)
-        {
-               tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
-               tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer);
-               HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len);
-        }
+       if(ieee->pHTInfo->bCurrentHTSupport){
+               tmp_ht_cap_buf =(u8*) &(ieee->pHTInfo->SelfHTCap);
+               tmp_ht_cap_len = sizeof(ieee->pHTInfo->SelfHTCap);
+               tmp_ht_info_buf =(u8*) &(ieee->pHTInfo->SelfHTInfo);
+               tmp_ht_info_len = sizeof(ieee->pHTInfo->SelfHTInfo);
+
+               HTConstructCapabilityElement(ieee, tmp_ht_cap_buf, &tmp_ht_cap_len,encrypt);
+
+               HTConstructInfoElement(ieee,tmp_ht_info_buf,&tmp_ht_info_len, encrypt);
+
+
+               if(pHTInfo->bRegRT2RTAggregation)
+               {
+                       tmp_generic_ie_buf = ieee->pHTInfo->szRT2RTAggBuffer;
+                       tmp_generic_ie_len = sizeof(ieee->pHTInfo->szRT2RTAggBuffer);
+                       HTConstructRT2RTAggElement(ieee, tmp_generic_ie_buf, &tmp_generic_ie_len);
+               }
+       }
 #endif
+
+       if(ieee->qos_support){
+
+               if(ieee->iw_mode == IW_MODE_ADHOC)
+               {
+                       wmm_len = 1;
+                       constructWMMIE(wmmie,&wmm_len,OUI_SUBTYPE_WMM_INFO);
+               }
+       }
+
        beacon_size = sizeof(struct ieee80211_probe_response)+2+
                ssid_len
                +3 //channel