diff options
-rw-r--r-- | net/mac80211/mlme.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index b86b8d4e02a8..f9258707b15a 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1661,18 +1661,20 @@ 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 | u8 noa[2]; | 1664 | struct ieee80211_p2p_noa_attr noa; |
1665 | int ret; | 1665 | int ret; |
1666 | 1666 | ||
1667 | ret = cfg80211_get_p2p_attr( | 1667 | ret = cfg80211_get_p2p_attr( |
1668 | ies->data, ies->len, | 1668 | ies->data, ies->len, |
1669 | IEEE80211_P2P_ATTR_ABSENCE_NOTICE, | 1669 | IEEE80211_P2P_ATTR_ABSENCE_NOTICE, |
1670 | noa, sizeof(noa)); | 1670 | (u8 *) &noa, sizeof(noa)); |
1671 | if (ret >= 2) { | 1671 | if (ret >= 2) { |
1672 | bss_conf->p2p_oppps = noa[1] & 0x80; | 1672 | bss_conf->p2p_oppps = noa.oppps_ctwindow & |
1673 | bss_conf->p2p_ctwindow = noa[1] & 0x7f; | 1673 | IEEE80211_P2P_OPPPS_ENABLE_BIT; |
1674 | bss_conf->p2p_ctwindow = noa.oppps_ctwindow & | ||
1675 | IEEE80211_P2P_OPPPS_CTWINDOW_MASK; | ||
1674 | bss_info_changed |= BSS_CHANGED_P2P_PS; | 1676 | bss_info_changed |= BSS_CHANGED_P2P_PS; |
1675 | sdata->u.mgd.p2p_noa_index = noa[0]; | 1677 | sdata->u.mgd.p2p_noa_index = noa.index; |
1676 | } | 1678 | } |
1677 | } | 1679 | } |
1678 | rcu_read_unlock(); | 1680 | rcu_read_unlock(); |
@@ -2961,18 +2963,20 @@ ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata, | |||
2961 | } | 2963 | } |
2962 | 2964 | ||
2963 | if (sdata->vif.p2p) { | 2965 | if (sdata->vif.p2p) { |
2964 | u8 noa[2]; | 2966 | struct ieee80211_p2p_noa_attr noa; |
2965 | int ret; | 2967 | int ret; |
2966 | 2968 | ||
2967 | ret = cfg80211_get_p2p_attr(mgmt->u.beacon.variable, | 2969 | ret = cfg80211_get_p2p_attr(mgmt->u.beacon.variable, |
2968 | len - baselen, | 2970 | len - baselen, |
2969 | IEEE80211_P2P_ATTR_ABSENCE_NOTICE, | 2971 | IEEE80211_P2P_ATTR_ABSENCE_NOTICE, |
2970 | noa, sizeof(noa)); | 2972 | (u8 *) &noa, sizeof(noa)); |
2971 | if (ret >= 2 && sdata->u.mgd.p2p_noa_index != noa[0]) { | 2973 | if (ret >= 2 && sdata->u.mgd.p2p_noa_index != noa.index) { |
2972 | bss_conf->p2p_oppps = noa[1] & 0x80; | 2974 | bss_conf->p2p_oppps = noa.oppps_ctwindow & |
2973 | bss_conf->p2p_ctwindow = noa[1] & 0x7f; | 2975 | IEEE80211_P2P_OPPPS_ENABLE_BIT; |
2976 | bss_conf->p2p_ctwindow = noa.oppps_ctwindow & | ||
2977 | IEEE80211_P2P_OPPPS_CTWINDOW_MASK; | ||
2974 | changed |= BSS_CHANGED_P2P_PS; | 2978 | changed |= BSS_CHANGED_P2P_PS; |
2975 | sdata->u.mgd.p2p_noa_index = noa[0]; | 2979 | sdata->u.mgd.p2p_noa_index = noa.index; |
2976 | /* | 2980 | /* |
2977 | * make sure we update all information, the CRC | 2981 | * make sure we update all information, the CRC |
2978 | * mechanism doesn't look at P2P attributes. | 2982 | * mechanism doesn't look at P2P attributes. |