cfg80211: remove enum ieee80211_band
[cascardo/linux.git] / net / mac80211 / cfg.c
index fe1704c..0c12e40 100644 (file)
@@ -65,11 +65,13 @@ static int ieee80211_change_iface(struct wiphy *wiphy,
                return ret;
 
        if (type == NL80211_IFTYPE_AP_VLAN &&
-           params && params->use_4addr == 0)
+           params && params->use_4addr == 0) {
                RCU_INIT_POINTER(sdata->u.vlan.sta, NULL);
-       else if (type == NL80211_IFTYPE_STATION &&
-                params && params->use_4addr >= 0)
+               ieee80211_check_fast_rx_iface(sdata);
+       } else if (type == NL80211_IFTYPE_STATION &&
+                  params && params->use_4addr >= 0) {
                sdata->u.mgd.use_4addr = params->use_4addr;
+       }
 
        if (sdata->vif.type == NL80211_IFTYPE_MONITOR && flags) {
                struct ieee80211_local *local = sdata->local;
@@ -732,6 +734,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
        sdata->vif.bss_conf.beacon_int = params->beacon_interval;
        sdata->vif.bss_conf.dtim_period = params->dtim_period;
        sdata->vif.bss_conf.enable_beacon = true;
+       sdata->vif.bss_conf.allow_p2p_go_ps = sdata->vif.p2p;
 
        sdata->vif.bss_conf.ssid_len = params->ssid_len;
        if (params->ssid_len)
@@ -1046,7 +1049,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
        int ret = 0;
        struct ieee80211_supported_band *sband;
        struct ieee80211_sub_if_data *sdata = sta->sdata;
-       enum ieee80211_band band = ieee80211_get_sdata_band(sdata);
+       enum nl80211_band band = ieee80211_get_sdata_band(sdata);
        u32 mask, set;
 
        sband = local->hw.wiphy->bands[band];
@@ -1202,6 +1205,9 @@ static int sta_apply_parameters(struct ieee80211_local *local,
                                              params->opmode_notif, band);
        }
 
+       if (params->support_p2p_ps >= 0)
+               sta->sta.support_p2p_ps = params->support_p2p_ps;
+
        if (ieee80211_vif_is_mesh(&sdata->vif))
                sta_apply_mesh_params(local, sta, params);
 
@@ -1363,6 +1369,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
 
                        rcu_assign_pointer(vlansdata->u.vlan.sta, sta);
                        new_4addr = true;
+                       __ieee80211_check_fast_rx_iface(vlansdata);
                }
 
                if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
@@ -1499,7 +1506,7 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
 
        memset(pinfo, 0, sizeof(*pinfo));
 
-       pinfo->generation = mesh_paths_generation;
+       pinfo->generation = mpath->sdata->u.mesh.mesh_paths_generation;
 
        pinfo->filled = MPATH_INFO_FRAME_QLEN |
                        MPATH_INFO_SN |
@@ -1577,7 +1584,7 @@ static void mpp_set_pinfo(struct mesh_path *mpath, u8 *mpp,
        memset(pinfo, 0, sizeof(*pinfo));
        memcpy(mpp, mpath->mpp, ETH_ALEN);
 
-       pinfo->generation = mpp_paths_generation;
+       pinfo->generation = mpath->sdata->u.mesh.mpp_paths_generation;
 }
 
 static int ieee80211_get_mpp(struct wiphy *wiphy, struct net_device *dev,
@@ -1841,7 +1848,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
                                struct bss_parameters *params)
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-       enum ieee80211_band band;
+       enum nl80211_band band;
        u32 changed = 0;
 
        if (!sdata_dereference(sdata->u.ap.beacon, sdata))
@@ -1860,7 +1867,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
        }
 
        if (!sdata->vif.bss_conf.use_short_slot &&
-           band == IEEE80211_BAND_5GHZ) {
+           band == NL80211_BAND_5GHZ) {
                sdata->vif.bss_conf.use_short_slot = true;
                changed |= BSS_CHANGED_ERP_SLOT;
        }
@@ -1885,6 +1892,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
                        sdata->flags |= IEEE80211_SDATA_DONT_BRIDGE_PACKETS;
                else
                        sdata->flags &= ~IEEE80211_SDATA_DONT_BRIDGE_PACKETS;
+               ieee80211_check_fast_rx_iface(sdata);
        }
 
        if (params->ht_opmode >= 0) {
@@ -2089,12 +2097,12 @@ static int ieee80211_leave_ocb(struct wiphy *wiphy, struct net_device *dev)
 }
 
 static int ieee80211_set_mcast_rate(struct wiphy *wiphy, struct net_device *dev,
-                                   int rate[IEEE80211_NUM_BANDS])
+                                   int rate[NUM_NL80211_BANDS])
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
        memcpy(sdata->vif.bss_conf.mcast_rate, rate,
-              sizeof(int) * IEEE80211_NUM_BANDS);
+              sizeof(int) * NUM_NL80211_BANDS);
 
        return 0;
 }
@@ -2499,7 +2507,7 @@ static int ieee80211_set_bitrate_mask(struct wiphy *wiphy,
                        return ret;
        }
 
-       for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
+       for (i = 0; i < NUM_NL80211_BANDS; i++) {
                struct ieee80211_supported_band *sband = wiphy->bands[i];
                int j;
 
@@ -3127,7 +3135,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev,
        struct ieee80211_tx_info *info;
        struct sta_info *sta;
        struct ieee80211_chanctx_conf *chanctx_conf;
-       enum ieee80211_band band;
+       enum nl80211_band band;
        int ret;
 
        /* the lock is needed to assign the cookie later */