Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
[deliverable/linux.git] / net / mac80211 / cfg.c
index c50c19402588807482ef7d7aad715818eed4bb90..764dd9a6a072a0bc8392ea4a2196a344e30c487b 100644 (file)
@@ -805,8 +805,7 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
                                        IEEE80211_CHANCTX_EXCLUSIVE);
                }
        } else if (local->open_count == local->monitors) {
-               local->_oper_channel = chandef->chan;
-               local->_oper_channel_type = cfg80211_get_chandef_type(chandef);
+               local->_oper_chandef = *chandef;
                ieee80211_hw_config(local, 0);
        }
 
@@ -965,8 +964,13 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
        sdata->vif.bss_conf.hidden_ssid =
                (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE);
 
-       sdata->vif.bss_conf.p2p_ctwindow = params->p2p_ctwindow;
-       sdata->vif.bss_conf.p2p_oppps = params->p2p_opp_ps;
+       memset(&sdata->vif.bss_conf.p2p_noa_attr, 0,
+              sizeof(sdata->vif.bss_conf.p2p_noa_attr));
+       sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow =
+               params->p2p_ctwindow & IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
+       if (params->p2p_opp_ps)
+               sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
+                                       IEEE80211_P2P_OPPPS_ENABLE_BIT;
 
        err = ieee80211_assign_beacon(sdata, &params->beacon);
        if (err < 0)
@@ -1536,7 +1540,6 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
        struct ieee80211_sub_if_data *sdata;
        struct mesh_path *mpath;
        struct sta_info *sta;
-       int err;
 
        sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
@@ -1547,17 +1550,12 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
                return -ENOENT;
        }
 
-       err = mesh_path_add(sdata, dst);
-       if (err) {
+       mpath = mesh_path_add(sdata, dst);
+       if (IS_ERR(mpath)) {
                rcu_read_unlock();
-               return err;
+               return PTR_ERR(mpath);
        }
 
-       mpath = mesh_path_lookup(sdata, dst);
-       if (!mpath) {
-               rcu_read_unlock();
-               return -ENXIO;
-       }
        mesh_path_fix_nexthop(mpath, sta);
 
        rcu_read_unlock();
@@ -1961,12 +1959,20 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
        }
 
        if (params->p2p_ctwindow >= 0) {
-               sdata->vif.bss_conf.p2p_ctwindow = params->p2p_ctwindow;
+               sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow &=
+                                       ~IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
+               sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
+                       params->p2p_ctwindow & IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
                changed |= BSS_CHANGED_P2P_PS;
        }
 
-       if (params->p2p_opp_ps >= 0) {
-               sdata->vif.bss_conf.p2p_oppps = params->p2p_opp_ps;
+       if (params->p2p_opp_ps > 0) {
+               sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
+                                       IEEE80211_P2P_OPPPS_ENABLE_BIT;
+               changed |= BSS_CHANGED_P2P_PS;
+       } else if (params->p2p_opp_ps == 0) {
+               sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow &=
+                                       ~IEEE80211_P2P_OPPPS_ENABLE_BIT;
                changed |= BSS_CHANGED_P2P_PS;
        }
 
@@ -3362,9 +3368,7 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
                if (local->use_chanctx)
                        *chandef = local->monitor_chandef;
                else
-                       cfg80211_chandef_create(chandef,
-                                               local->_oper_channel,
-                                               local->_oper_channel_type);
+                       *chandef = local->_oper_chandef;
                ret = 0;
        }
        rcu_read_unlock();
This page took 0.034696 seconds and 5 git commands to generate.