aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c50c19402588..764dd9a6a072 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -805,8 +805,7 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
805 IEEE80211_CHANCTX_EXCLUSIVE); 805 IEEE80211_CHANCTX_EXCLUSIVE);
806 } 806 }
807 } else if (local->open_count == local->monitors) { 807 } else if (local->open_count == local->monitors) {
808 local->_oper_channel = chandef->chan; 808 local->_oper_chandef = *chandef;
809 local->_oper_channel_type = cfg80211_get_chandef_type(chandef);
810 ieee80211_hw_config(local, 0); 809 ieee80211_hw_config(local, 0);
811 } 810 }
812 811
@@ -965,8 +964,13 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
965 sdata->vif.bss_conf.hidden_ssid = 964 sdata->vif.bss_conf.hidden_ssid =
966 (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE); 965 (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE);
967 966
968 sdata->vif.bss_conf.p2p_ctwindow = params->p2p_ctwindow; 967 memset(&sdata->vif.bss_conf.p2p_noa_attr, 0,
969 sdata->vif.bss_conf.p2p_oppps = params->p2p_opp_ps; 968 sizeof(sdata->vif.bss_conf.p2p_noa_attr));
969 sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow =
970 params->p2p_ctwindow & IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
971 if (params->p2p_opp_ps)
972 sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
973 IEEE80211_P2P_OPPPS_ENABLE_BIT;
970 974
971 err = ieee80211_assign_beacon(sdata, &params->beacon); 975 err = ieee80211_assign_beacon(sdata, &params->beacon);
972 if (err < 0) 976 if (err < 0)
@@ -1536,7 +1540,6 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
1536 struct ieee80211_sub_if_data *sdata; 1540 struct ieee80211_sub_if_data *sdata;
1537 struct mesh_path *mpath; 1541 struct mesh_path *mpath;
1538 struct sta_info *sta; 1542 struct sta_info *sta;
1539 int err;
1540 1543
1541 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1544 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1542 1545
@@ -1547,17 +1550,12 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
1547 return -ENOENT; 1550 return -ENOENT;
1548 } 1551 }
1549 1552
1550 err = mesh_path_add(sdata, dst); 1553 mpath = mesh_path_add(sdata, dst);
1551 if (err) { 1554 if (IS_ERR(mpath)) {
1552 rcu_read_unlock(); 1555 rcu_read_unlock();
1553 return err; 1556 return PTR_ERR(mpath);
1554 } 1557 }
1555 1558
1556 mpath = mesh_path_lookup(sdata, dst);
1557 if (!mpath) {
1558 rcu_read_unlock();
1559 return -ENXIO;
1560 }
1561 mesh_path_fix_nexthop(mpath, sta); 1559 mesh_path_fix_nexthop(mpath, sta);
1562 1560
1563 rcu_read_unlock(); 1561 rcu_read_unlock();
@@ -1961,12 +1959,20 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
1961 } 1959 }
1962 1960
1963 if (params->p2p_ctwindow >= 0) { 1961 if (params->p2p_ctwindow >= 0) {
1964 sdata->vif.bss_conf.p2p_ctwindow = params->p2p_ctwindow; 1962 sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow &=
1963 ~IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
1964 sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
1965 params->p2p_ctwindow & IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
1965 changed |= BSS_CHANGED_P2P_PS; 1966 changed |= BSS_CHANGED_P2P_PS;
1966 } 1967 }
1967 1968
1968 if (params->p2p_opp_ps >= 0) { 1969 if (params->p2p_opp_ps > 0) {
1969 sdata->vif.bss_conf.p2p_oppps = params->p2p_opp_ps; 1970 sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
1971 IEEE80211_P2P_OPPPS_ENABLE_BIT;
1972 changed |= BSS_CHANGED_P2P_PS;
1973 } else if (params->p2p_opp_ps == 0) {
1974 sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow &=
1975 ~IEEE80211_P2P_OPPPS_ENABLE_BIT;
1970 changed |= BSS_CHANGED_P2P_PS; 1976 changed |= BSS_CHANGED_P2P_PS;
1971 } 1977 }
1972 1978
@@ -3362,9 +3368,7 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy,
3362 if (local->use_chanctx) 3368 if (local->use_chanctx)
3363 *chandef = local->monitor_chandef; 3369 *chandef = local->monitor_chandef;
3364 else 3370 else
3365 cfg80211_chandef_create(chandef, 3371 *chandef = local->_oper_chandef;
3366 local->_oper_channel,
3367 local->_oper_channel_type);
3368 ret = 0; 3372 ret = 0;
3369 } 3373 }
3370 rcu_read_unlock(); 3374 rcu_read_unlock();