All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: ignore VHT membership selector when parsing rates
@ 2017-03-06 22:01 Johannes Berg
  2017-03-07  8:39 ` Arend Van Spriel
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2017-03-06 22:01 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

There isn't really much harm in not ignoring, since it doesn't
represent a valid rate, but since we already ignore the HT one
also ignore VHT. Also simplify the code a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/mac80211/mlme.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 1568a74757bc..6340127a71c6 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -2823,15 +2823,15 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
 			*have_higher_than_11mbit = true;
 
 		/*
-		 * BSS_MEMBERSHIP_SELECTOR_HT_PHY is defined in 802.11n-2009
-		 * 7.3.2.2 as a magic value instead of a rate. Hence, skip it.
+		 * Skip HT and VHT BSS membership selectors since they're not
+		 * rates.
 		 *
 		 * Note: Even through the membership selector and the basic
 		 *	 rate flag share the same bit, they are not exactly
 		 *	 the same.
 		 */
-		if (!!(supp_rates[i] & 0x80) &&
-		    (supp_rates[i] & 0x7f) == BSS_MEMBERSHIP_SELECTOR_HT_PHY)
+		if (supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY) ||
+		    supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY))
 			continue;
 
 		for (j = 0; j < sband->n_bitrates; j++) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: ignore VHT membership selector when parsing rates
  2017-03-06 22:01 [PATCH] mac80211: ignore VHT membership selector when parsing rates Johannes Berg
@ 2017-03-07  8:39 ` Arend Van Spriel
  2017-03-07  8:42   ` Johannes Berg
  0 siblings, 1 reply; 4+ messages in thread
From: Arend Van Spriel @ 2017-03-07  8:39 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless; +Cc: Johannes Berg

On 6-3-2017 23:01, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> There isn't really much harm in not ignoring, since it doesn't
> represent a valid rate, but since we already ignore the HT one
> also ignore VHT. Also simplify the code a bit.
> 
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  net/mac80211/mlme.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 1568a74757bc..6340127a71c6 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -2823,15 +2823,15 @@ static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
>  			*have_higher_than_11mbit = true;
>  
>  		/*
> -		 * BSS_MEMBERSHIP_SELECTOR_HT_PHY is defined in 802.11n-2009
> -		 * 7.3.2.2 as a magic value instead of a rate. Hence, skip it.
> +		 * Skip HT and VHT BSS membership selectors since they're not
> +		 * rates.
>  		 *
>  		 * Note: Even through the membership selector and the basic

typo: through -> though.

Regards,
Arend

>  		 *	 rate flag share the same bit, they are not exactly
>  		 *	 the same.
>  		 */
> -		if (!!(supp_rates[i] & 0x80) &&
> -		    (supp_rates[i] & 0x7f) == BSS_MEMBERSHIP_SELECTOR_HT_PHY)
> +		if (supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_HT_PHY) ||
> +		    supp_rates[i] == (0x80 | BSS_MEMBERSHIP_SELECTOR_VHT_PHY))
>  			continue;
>  
>  		for (j = 0; j < sband->n_bitrates; j++) {
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: ignore VHT membership selector when parsing rates
  2017-03-07  8:39 ` Arend Van Spriel
@ 2017-03-07  8:42   ` Johannes Berg
  2017-03-07  9:49     ` Arend Van Spriel
  0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2017-03-07  8:42 UTC (permalink / raw)
  To: Arend Van Spriel, linux-wireless


> >  
> >  		/*
> > -		 * BSS_MEMBERSHIP_SELECTOR_HT_PHY is defined in
> > 802.11n-2009
> > -		 * 7.3.2.2 as a magic value instead of a rate.
> > Hence, skip it.
> > +		 * Skip HT and VHT BSS membership selectors since
> > they're not
> > +		 * rates.
> >  		 *
> >  		 * Note: Even through the membership selector and
> > the basic
> 
> typo: through -> though.

That's just existing context ;-)

Will fix here.

johannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] mac80211: ignore VHT membership selector when parsing rates
  2017-03-07  8:42   ` Johannes Berg
@ 2017-03-07  9:49     ` Arend Van Spriel
  0 siblings, 0 replies; 4+ messages in thread
From: Arend Van Spriel @ 2017-03-07  9:49 UTC (permalink / raw)
  To: Johannes Berg, linux-wireless



On 7-3-2017 9:42, Johannes Berg wrote:
> 
>>>  
>>>  		/*
>>> -		 * BSS_MEMBERSHIP_SELECTOR_HT_PHY is defined in
>>> 802.11n-2009
>>> -		 * 7.3.2.2 as a magic value instead of a rate.
>>> Hence, skip it.
>>> +		 * Skip HT and VHT BSS membership selectors since
>>> they're not
>>> +		 * rates.
>>>  		 *
>>>  		 * Note: Even through the membership selector and
>>> the basic
>>
>> typo: through -> though.
> 
> That's just existing context ;-)
> 
> Will fix here.

I noticed and indeed could create a patch for it, but this is easier
(for me :-p ).

Gr. AvS

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-07 10:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-06 22:01 [PATCH] mac80211: ignore VHT membership selector when parsing rates Johannes Berg
2017-03-07  8:39 ` Arend Van Spriel
2017-03-07  8:42   ` Johannes Berg
2017-03-07  9:49     ` Arend Van Spriel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.