summaryrefslogtreecommitdiff
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@gmail.com>2013-03-21 15:47:55 +0100
committerJohannes Berg <johannes.berg@intel.com>2013-03-22 11:33:12 +0100
commit934457eeb0bbe9af1849d9201cb3fb81fd9fa4d0 (patch)
treecb52950e195f8f82277f73e3fbc59e57ed237916 /net/mac80211/mlme.c
parent19dde0bd71e3dffb03ddc509019e22250f4e20c0 (diff)
downloadlwn-934457eeb0bbe9af1849d9201cb3fb81fd9fa4d0.tar.gz
lwn-934457eeb0bbe9af1849d9201cb3fb81fd9fa4d0.zip
mac80211: use ieee80211_p2p_noa_attr structure
Use ieee80211_p2p_noa_attr structure during P2P_PS (oppps) detection. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r--net/mac80211/mlme.c26
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,
rcu_read_lock();
ies = rcu_dereference(cbss->ies);
if (ies) {
- u8 noa[2];
+ struct ieee80211_p2p_noa_attr noa;
int ret;
ret = cfg80211_get_p2p_attr(
ies->data, ies->len,
IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
- noa, sizeof(noa));
+ (u8 *) &noa, sizeof(noa));
if (ret >= 2) {
- bss_conf->p2p_oppps = noa[1] & 0x80;
- bss_conf->p2p_ctwindow = noa[1] & 0x7f;
+ bss_conf->p2p_oppps = noa.oppps_ctwindow &
+ IEEE80211_P2P_OPPPS_ENABLE_BIT;
+ bss_conf->p2p_ctwindow = noa.oppps_ctwindow &
+ IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
bss_info_changed |= BSS_CHANGED_P2P_PS;
- sdata->u.mgd.p2p_noa_index = noa[0];
+ sdata->u.mgd.p2p_noa_index = noa.index;
}
}
rcu_read_unlock();
@@ -2961,18 +2963,20 @@ ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
}
if (sdata->vif.p2p) {
- u8 noa[2];
+ struct ieee80211_p2p_noa_attr noa;
int ret;
ret = cfg80211_get_p2p_attr(mgmt->u.beacon.variable,
len - baselen,
IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
- noa, sizeof(noa));
- if (ret >= 2 && sdata->u.mgd.p2p_noa_index != noa[0]) {
- bss_conf->p2p_oppps = noa[1] & 0x80;
- bss_conf->p2p_ctwindow = noa[1] & 0x7f;
+ (u8 *) &noa, sizeof(noa));
+ if (ret >= 2 && sdata->u.mgd.p2p_noa_index != noa.index) {
+ bss_conf->p2p_oppps = noa.oppps_ctwindow &
+ IEEE80211_P2P_OPPPS_ENABLE_BIT;
+ bss_conf->p2p_ctwindow = noa.oppps_ctwindow &
+ IEEE80211_P2P_OPPPS_CTWINDOW_MASK;
changed |= BSS_CHANGED_P2P_PS;
- sdata->u.mgd.p2p_noa_index = noa[0];
+ sdata->u.mgd.p2p_noa_index = noa.index;
/*
* make sure we update all information, the CRC
* mechanism doesn't look at P2P attributes.