]> err.no Git - linux-2.6/blobdiff - net/mac80211/ieee80211_sta.c
the scheduled ieee80211 softmac removal
[linux-2.6] / net / mac80211 / ieee80211_sta.c
index 892b5f96a427f50dd98517dc25888063524b2321..8b991ebcbb4ed7b682fd1dbad4663d3a6ca3c466 100644 (file)
@@ -1930,16 +1930,16 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
 
        if (elems.wmm_param && (ifsta->flags & IEEE80211_STA_WMM_ENABLED)) {
                sta->flags |= WLAN_STA_WME;
+               rcu_read_unlock();
                ieee80211_sta_wmm_params(dev, ifsta, elems.wmm_param,
                                         elems.wmm_param_len);
-       }
+       } else
+               rcu_read_unlock();
 
        /* set AID, ieee80211_set_associated() will tell the driver */
        bss_conf->aid = aid;
        ieee80211_set_associated(dev, ifsta, 1);
 
-       rcu_read_unlock();
-
        ieee80211_associated(dev, ifsta);
 }
 
@@ -3576,6 +3576,13 @@ static void ieee80211_send_nullfunc(struct ieee80211_local *local,
 }
 
 
+static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
+{
+       if (sdata->vif.type == IEEE80211_IF_TYPE_STA ||
+           ieee80211_vif_is_mesh(&sdata->vif))
+               ieee80211_sta_timer((unsigned long)sdata);
+}
+
 void ieee80211_scan_completed(struct ieee80211_hw *hw)
 {
        struct ieee80211_local *local = hw_to_local(hw);
@@ -3589,6 +3596,12 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
 
        if (local->sta_hw_scanning) {
                local->sta_hw_scanning = 0;
+               /* Restart STA timer for HW scan case */
+               rcu_read_lock();
+               list_for_each_entry_rcu(sdata, &local->interfaces, list)
+                       ieee80211_restart_sta_timer(sdata);
+               rcu_read_unlock();
+
                goto done;
        }
 
@@ -3615,14 +3628,12 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw)
                if (sdata->dev == local->mdev)
                        continue;
 
-               if (sdata->vif.type == IEEE80211_IF_TYPE_STA) {
-                       if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)
-                               ieee80211_send_nullfunc(local, sdata, 0);
-                       ieee80211_sta_timer((unsigned long)sdata);
-               }
+               /* Tell AP we're back */
+               if (sdata->vif.type == IEEE80211_IF_TYPE_STA &&
+                   sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED)
+                       ieee80211_send_nullfunc(local, sdata, 0);
 
-               if (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT)
-                       ieee80211_sta_timer((unsigned long)sdata);
+               ieee80211_restart_sta_timer(sdata);
 
                netif_wake_queue(sdata->dev);
        }
@@ -3878,8 +3889,8 @@ ieee80211_sta_scan_result(struct net_device *dev,
                                                  bss->ssid);
        }
 
-       if (bss->capability & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS
-           || bss_mesh_cfg(bss))) {
+       if (bss->capability & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)
+           || bss_mesh_cfg(bss)) {
                memset(&iwe, 0, sizeof(iwe));
                iwe.cmd = SIOCGIWMODE;
                if (bss_mesh_cfg(bss))
@@ -3976,18 +3987,35 @@ ieee80211_sta_scan_result(struct net_device *dev,
        if (bss_mesh_cfg(bss)) {
                char *buf;
                u8 *cfg = bss_mesh_cfg(bss);
-               buf = kmalloc(200, GFP_ATOMIC);
+               buf = kmalloc(50, GFP_ATOMIC);
                if (buf) {
                        memset(&iwe, 0, sizeof(iwe));
                        iwe.cmd = IWEVCUSTOM;
-                       sprintf(buf, "Mesh network (version %d)\n"
-                       "\t\t\tPath Selection Protocol ID: 0x%02X%02X%02X%02X\n"
-                       "\t\t\tPath Selection Metric ID: 0x%02X%02X%02X%02X\n"
-                       "\t\t\tCongestion Control Mode ID: 0x%02X%02X%02X%02X\n"
-                       "\t\t\tChannel Precedence: 0x%02X%02X%02X%02X",
-                       cfg[0], cfg[1], cfg[2], cfg[3], cfg[4], cfg[5], cfg[6],
-                       cfg[7], cfg[8], cfg[9], cfg[10], cfg[11], cfg[12],
-                       cfg[13], cfg[14], cfg[15], cfg[16]);
+                       sprintf(buf, "Mesh network (version %d)", cfg[0]);
+                       iwe.u.data.length = strlen(buf);
+                       current_ev = iwe_stream_add_point(current_ev, end_buf,
+                                                         &iwe, buf);
+                       sprintf(buf, "Path Selection Protocol ID: "
+                               "0x%02X%02X%02X%02X", cfg[1], cfg[2], cfg[3],
+                                                       cfg[4]);
+                       iwe.u.data.length = strlen(buf);
+                       current_ev = iwe_stream_add_point(current_ev, end_buf,
+                                                         &iwe, buf);
+                       sprintf(buf, "Path Selection Metric ID: "
+                               "0x%02X%02X%02X%02X", cfg[5], cfg[6], cfg[7],
+                                                       cfg[8]);
+                       iwe.u.data.length = strlen(buf);
+                       current_ev = iwe_stream_add_point(current_ev, end_buf,
+                                                         &iwe, buf);
+                       sprintf(buf, "Congestion Control Mode ID: "
+                               "0x%02X%02X%02X%02X", cfg[9], cfg[10],
+                                                       cfg[11], cfg[12]);
+                       iwe.u.data.length = strlen(buf);
+                       current_ev = iwe_stream_add_point(current_ev, end_buf,
+                                                         &iwe, buf);
+                       sprintf(buf, "Channel Precedence: "
+                               "0x%02X%02X%02X%02X", cfg[13], cfg[14],
+                                                       cfg[15], cfg[16]);
                        iwe.u.data.length = strlen(buf);
                        current_ev = iwe_stream_add_point(current_ev, end_buf,
                                                          &iwe, buf);