Merge branch 'master' of git://git.infradead.org/users/linville/wireless-next into...
[pandora-kernel.git] / net / mac80211 / cfg.c
index 3d1b091..9b1a95e 100644 (file)
@@ -62,7 +62,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
 
        if (type == NL80211_IFTYPE_AP_VLAN &&
            params && params->use_4addr == 0)
-               rcu_assign_pointer(sdata->u.vlan.sta, NULL);
+               RCU_INIT_POINTER(sdata->u.vlan.sta, NULL);
        else if (type == NL80211_IFTYPE_STATION &&
                 params && params->use_4addr >= 0)
                sdata->u.mgd.use_4addr = params->use_4addr;
@@ -455,6 +455,20 @@ static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
        return ret;
 }
 
+static void ieee80211_config_ap_ssid(struct ieee80211_sub_if_data *sdata,
+                                    struct beacon_parameters *params)
+{
+       struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
+
+       bss_conf->ssid_len = params->ssid_len;
+
+       if (params->ssid_len)
+               memcpy(bss_conf->ssid, params->ssid, params->ssid_len);
+
+       bss_conf->hidden_ssid =
+               (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE);
+}
+
 /*
  * This handles both adding a beacon and setting new beacon info
  */
@@ -542,14 +556,17 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
 
        sdata->vif.bss_conf.dtim_period = new->dtim_period;
 
-       rcu_assign_pointer(sdata->u.ap.beacon, new);
+       RCU_INIT_POINTER(sdata->u.ap.beacon, new);
 
        synchronize_rcu();
 
        kfree(old);
 
+       ieee80211_config_ap_ssid(sdata, params);
+
        ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
-                                               BSS_CHANGED_BEACON);
+                                               BSS_CHANGED_BEACON |
+                                               BSS_CHANGED_SSID);
        return 0;
 }
 
@@ -594,7 +611,7 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
        if (!old)
                return -ENOENT;
 
-       rcu_assign_pointer(sdata->u.ap.beacon, NULL);
+       RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
        synchronize_rcu();
        kfree(old);
 
@@ -697,6 +714,9 @@ static void sta_apply_parameters(struct ieee80211_local *local,
        }
        spin_unlock_irqrestore(&sta->flaglock, flags);
 
+       sta->sta.uapsd_queues = params->uapsd_queues;
+       sta->sta.max_sp = params->max_sp;
+
        /*
         * cfg80211 validates this (1-2007) and allows setting the AID
         * only when creating a new station entry
@@ -857,7 +877,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
                                return -EBUSY;
                        }
 
-                       rcu_assign_pointer(vlansdata->u.vlan.sta, sta);
+                       RCU_INIT_POINTER(vlansdata->u.vlan.sta, sta);
                }
 
                sta->sdata = vlansdata;
@@ -918,7 +938,7 @@ static int ieee80211_del_mpath(struct wiphy *wiphy, struct net_device *dev,
        if (dst)
                return mesh_path_del(dst, sdata);
 
-       mesh_path_flush(sdata);
+       mesh_path_flush_by_iface(sdata);
        return 0;
 }
 
@@ -1137,6 +1157,22 @@ static int ieee80211_update_mesh_config(struct wiphy *wiphy,
                conf->dot11MeshHWMPRootMode = nconf->dot11MeshHWMPRootMode;
                ieee80211_mesh_root_setup(ifmsh);
        }
+       if (_chg_mesh_attr(NL80211_MESHCONF_GATE_ANNOUNCEMENTS, mask)) {
+               /* our current gate announcement implementation rides on root
+                * announcements, so require this ifmsh to also be a root node
+                * */
+               if (nconf->dot11MeshGateAnnouncementProtocol &&
+                   !conf->dot11MeshHWMPRootMode) {
+                       conf->dot11MeshHWMPRootMode = 1;
+                       ieee80211_mesh_root_setup(ifmsh);
+               }
+               conf->dot11MeshGateAnnouncementProtocol =
+                       nconf->dot11MeshGateAnnouncementProtocol;
+       }
+       if (_chg_mesh_attr(NL80211_MESHCONF_HWMP_RANN_INTERVAL, mask)) {
+               conf->dot11MeshHWMPRannInterval =
+                       nconf->dot11MeshHWMPRannInterval;
+       }
        return 0;
 }
 
@@ -1235,9 +1271,11 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
 }
 
 static int ieee80211_set_txq_params(struct wiphy *wiphy,
+                                   struct net_device *dev,
                                    struct ieee80211_txq_params *params)
 {
        struct ieee80211_local *local = wiphy_priv(wiphy);
+       struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_tx_queue_params p;
 
        if (!local->ops->conf_tx)
@@ -1258,8 +1296,8 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
        if (params->queue >= local->hw.queues)
                return -EINVAL;
 
-       local->tx_conf[params->queue] = p;
-       if (drv_conf_tx(local, params->queue, &p)) {
+       sdata->tx_conf[params->queue] = p;
+       if (drv_conf_tx(local, sdata, params->queue, &p)) {
                wiphy_debug(local->hw.wiphy,
                            "failed to set TX queue parameters for queue %d\n",
                            params->queue);
@@ -1833,7 +1871,8 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
                             struct ieee80211_channel *chan, bool offchan,
                             enum nl80211_channel_type channel_type,
                             bool channel_type_valid, unsigned int wait,
-                            const u8 *buf, size_t len, u64 *cookie)
+                            const u8 *buf, size_t len, bool no_cck,
+                            u64 *cookie)
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
        struct ieee80211_local *local = sdata->local;
@@ -1860,6 +1899,9 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
                flags |= IEEE80211_TX_CTL_TX_OFFCHAN;
        }
 
+       if (no_cck)
+               flags |= IEEE80211_TX_CTL_NO_CCK_RATE;
+
        if (is_offchan && !offchan)
                return -EBUSY;
 
@@ -1898,33 +1940,6 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct net_device *dev,
 
        *cookie = (unsigned long) skb;
 
-       if (is_offchan && local->ops->offchannel_tx) {
-               int ret;
-
-               IEEE80211_SKB_CB(skb)->band = chan->band;
-
-               mutex_lock(&local->mtx);
-
-               if (local->hw_offchan_tx_cookie) {
-                       mutex_unlock(&local->mtx);
-                       return -EBUSY;
-               }
-
-               /* TODO: bitrate control, TX processing? */
-               ret = drv_offchannel_tx(local, skb, chan, channel_type, wait);
-
-               if (ret == 0)
-                       local->hw_offchan_tx_cookie = *cookie;
-               mutex_unlock(&local->mtx);
-
-               /*
-                * Allow driver to return 1 to indicate it wants to have the
-                * frame transmitted with a remain_on_channel + regular TX.
-                */
-               if (ret != 1)
-                       return ret;
-       }
-
        if (is_offchan && local->ops->remain_on_channel) {
                unsigned int duration;
                int ret;
@@ -2011,18 +2026,6 @@ static int ieee80211_mgmt_tx_cancel_wait(struct wiphy *wiphy,
 
        mutex_lock(&local->mtx);
 
-       if (local->ops->offchannel_tx_cancel_wait &&
-           local->hw_offchan_tx_cookie == cookie) {
-               ret = drv_offchannel_tx_cancel_wait(local);
-
-               if (!ret)
-                       local->hw_offchan_tx_cookie = 0;
-
-               mutex_unlock(&local->mtx);
-
-               return ret;
-       }
-
        if (local->ops->cancel_remain_on_channel) {
                cookie ^= 2;
                ret = ieee80211_cancel_remain_on_channel_hw(local, cookie);