linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Cc: Janusz.Dziedzic@tieto.com, linux-wireless@vger.kernel.org
Subject: Re: [RFC 3/3] mac80211: P2P add NOA settings
Date: Tue, 19 Mar 2013 21:33:42 +0100	[thread overview]
Message-ID: <1363725222.8336.27.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <CAFED-jndqjMFjNLBadFV1W9+5QZJF649BhFKy5zSjw3pnSQh1w@mail.gmail.com> (sfid-20130319_163844_201066_D1B1CD5A)

On Tue, 2013-03-19 at 16:38 +0100, Janusz Dziedzic wrote:

> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -960,8 +960,12 @@ static int ieee80211_start_ap(struct wiphy
> *wiphy, struct net_device *dev,
>  	sdata->vif.bss_conf.hidden_ssid =
>  		(params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE);
> 
> -	sdata->vif.bss_conf.p2p_ctwindow = params->p2p_ctwindow;
> -	sdata->vif.bss_conf.p2p_oppps = params->p2p_opp_ps;
> +	sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow =
> +						params->p2p_ctwindow & 0x7F;
> +	if (params->p2p_opp_ps)
> +		sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |= BIT(7);
> +	else
> +		sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow &= ~BIT(7);

That else branch isn't really needed.

> @@ -1956,12 +1960,17 @@ static int ieee80211_change_bss(struct wiphy *wiphy,
>  	}
> 
>  	if (params->p2p_ctwindow >= 0) {
> -		sdata->vif.bss_conf.p2p_ctwindow = params->p2p_ctwindow;
> +		sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow &= ~0x7f;
> +		sdata->vif.bss_conf.p2p_noa_attr.oppps_ctwindow |=
> +						params->p2p_ctwindow & 0x7f;

You have this BIT(7) and 0x7f a lot now, I think you should add
constants next to the struct definition and use them everywhere.

Otherwise looks fine, thanks for fixing my bugs too :-)

One more thing -- you need to update the iwlwifi/mvm driver that uses
this already. I'd prefer to also use the constants I asked for above
there.

johannes


      reply	other threads:[~2013-03-19 20:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14  7:33 [RFC 3/3] mac80211: P2P add NOA settings Janusz.Dziedzic
2013-03-15 15:35 ` Johannes Berg
2013-03-17  8:26   ` Janusz Dziedzic
2013-03-18 20:21     ` Johannes Berg
2013-03-19 15:38       ` Janusz Dziedzic
2013-03-19 20:33         ` Johannes Berg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363725222.8336.27.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=Janusz.Dziedzic@tieto.com \
    --cc=janusz.dziedzic@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).