Search Linux Wireless

Re: [RFC 3/3] mac80211: P2P add NOA settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux