aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f9258707b15a..8b3e852d6032 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1661,20 +1661,17 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1661 rcu_read_lock(); 1661 rcu_read_lock();
1662 ies = rcu_dereference(cbss->ies); 1662 ies = rcu_dereference(cbss->ies);
1663 if (ies) { 1663 if (ies) {
1664 struct ieee80211_p2p_noa_attr noa;
1665 int ret; 1664 int ret;
1666 1665
1667 ret = cfg80211_get_p2p_attr( 1666 ret = cfg80211_get_p2p_attr(
1668 ies->data, ies->len, 1667 ies->data, ies->len,
1669 IEEE80211_P2P_ATTR_ABSENCE_NOTICE, 1668 IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
1670 (u8 *) &noa, sizeof(noa)); 1669 (u8 *) &bss_conf->p2p_noa_attr,
1670 sizeof(bss_conf->p2p_noa_attr));
1671 if (ret >= 2) { 1671 if (ret >= 2) {
1672 bss_conf->p2p_oppps = noa.oppps_ctwindow & 1672 sdata->u.mgd.p2p_noa_index =
1673 IEEE80211_P2P_OPPPS_ENABLE_BIT; 1673 bss_conf->p2p_noa_attr.index;
1674 bss_conf->p2p_ctwindow = noa.oppps_ctwindow &
1675 IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
1676 bss_info_changed |= BSS_CHANGED_P2P_PS; 1674 bss_info_changed |= BSS_CHANGED_P2P_PS;
1677 sdata->u.mgd.p2p_noa_index = noa.index;
1678 } 1675 }
1679 } 1676 }
1680 rcu_read_unlock(); 1677 rcu_read_unlock();
@@ -1799,8 +1796,9 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
1799 changed |= BSS_CHANGED_ASSOC; 1796 changed |= BSS_CHANGED_ASSOC;
1800 sdata->vif.bss_conf.assoc = false; 1797 sdata->vif.bss_conf.assoc = false;
1801 1798
1802 sdata->vif.bss_conf.p2p_ctwindow = 0; 1799 ifmgd->p2p_noa_index = -1;
1803 sdata->vif.bss_conf.p2p_oppps = false; 1800 memset(&sdata->vif.bss_conf.p2p_noa_attr, 0,
1801 sizeof(sdata->vif.bss_conf.p2p_noa_attr));
1804 1802
1805 /* on the next assoc, re-program HT/VHT parameters */ 1803 /* on the next assoc, re-program HT/VHT parameters */
1806 memset(&ifmgd->ht_capa, 0, sizeof(ifmgd->ht_capa)); 1804 memset(&ifmgd->ht_capa, 0, sizeof(ifmgd->ht_capa));
@@ -2963,24 +2961,30 @@ ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
2963 } 2961 }
2964 2962
2965 if (sdata->vif.p2p) { 2963 if (sdata->vif.p2p) {
2966 struct ieee80211_p2p_noa_attr noa; 2964 struct ieee80211_p2p_noa_attr noa = {};
2967 int ret; 2965 int ret;
2968 2966
2969 ret = cfg80211_get_p2p_attr(mgmt->u.beacon.variable, 2967 ret = cfg80211_get_p2p_attr(mgmt->u.beacon.variable,
2970 len - baselen, 2968 len - baselen,
2971 IEEE80211_P2P_ATTR_ABSENCE_NOTICE, 2969 IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
2972 (u8 *) &noa, sizeof(noa)); 2970 (u8 *) &noa, sizeof(noa));
2973 if (ret >= 2 && sdata->u.mgd.p2p_noa_index != noa.index) { 2971 if (ret >= 2) {
2974 bss_conf->p2p_oppps = noa.oppps_ctwindow & 2972 if (sdata->u.mgd.p2p_noa_index != noa.index) {
2975 IEEE80211_P2P_OPPPS_ENABLE_BIT; 2973 /* valid noa_attr and index changed */
2976 bss_conf->p2p_ctwindow = noa.oppps_ctwindow & 2974 sdata->u.mgd.p2p_noa_index = noa.index;
2977 IEEE80211_P2P_OPPPS_CTWINDOW_MASK; 2975 memcpy(&bss_conf->p2p_noa_attr, &noa, sizeof(noa));
2976 changed |= BSS_CHANGED_P2P_PS;
2977 /*
2978 * make sure we update all information, the CRC
2979 * mechanism doesn't look at P2P attributes.
2980 */
2981 ifmgd->beacon_crc_valid = false;
2982 }
2983 } else if (sdata->u.mgd.p2p_noa_index != -1) {
2984 /* noa_attr not found and we had valid noa_attr before */
2985 sdata->u.mgd.p2p_noa_index = -1;
2986 memset(&bss_conf->p2p_noa_attr, 0, sizeof(bss_conf->p2p_noa_attr));
2978 changed |= BSS_CHANGED_P2P_PS; 2987 changed |= BSS_CHANGED_P2P_PS;
2979 sdata->u.mgd.p2p_noa_index = noa.index;
2980 /*
2981 * make sure we update all information, the CRC
2982 * mechanism doesn't look at P2P attributes.
2983 */
2984 ifmgd->beacon_crc_valid = false; 2988 ifmgd->beacon_crc_valid = false;
2985 } 2989 }
2986 } 2990 }
@@ -3523,6 +3527,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
3523 ifmgd->powersave = sdata->wdev.ps; 3527 ifmgd->powersave = sdata->wdev.ps;
3524 ifmgd->uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES; 3528 ifmgd->uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
3525 ifmgd->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN; 3529 ifmgd->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
3530 ifmgd->p2p_noa_index = -1;
3526 3531
3527 mutex_init(&ifmgd->mtx); 3532 mutex_init(&ifmgd->mtx);
3528 3533