* [PATCH 2/4] mac80211: use ieee80211_p2p_noa_attr structure
@ 2013-03-20 19:13 Janusz Dziedzic
2013-03-20 21:02 ` Johannes Berg
0 siblings, 1 reply; 2+ messages in thread
From: Janusz Dziedzic @ 2013-03-20 19:13 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg
Use ieee80211_p2p_noa_attr structure during
P2P_PS (oppps) detection.
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
---
net/mac80211/mlme.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index fdc06e3..14612cd 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1655,18 +1655,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();
@@ -2953,18 +2955,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.
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/4] mac80211: use ieee80211_p2p_noa_attr structure
2013-03-20 19:13 [PATCH 2/4] mac80211: use ieee80211_p2p_noa_attr structure Janusz Dziedzic
@ 2013-03-20 21:02 ` Johannes Berg
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2013-03-20 21:02 UTC (permalink / raw)
To: Janusz Dziedzic; +Cc: linux-wireless
On Wed, 2013-03-20 at 20:13 +0100, Janusz Dziedzic wrote:
> Use ieee80211_p2p_noa_attr structure during
> P2P_PS (oppps) detection.
>
> Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
> ---
> net/mac80211/mlme.c | 26 +++++++++++++++-----------
> 1 file changed, 15 insertions(+), 11 deletions(-)
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index fdc06e3..14612cd 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -1655,18 +1655,20 @@ static void ieee80211_set_associated(struct
> ieee80211_sub_if_data *sdata,
This is line-break damage, the patch doesn't apply.
johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-03-20 21:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-20 19:13 [PATCH 2/4] mac80211: use ieee80211_p2p_noa_attr structure Janusz Dziedzic
2013-03-20 21:02 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).