linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Use of IEEE80211_VHT_CAP_RXSTBC_* in mac80211_hwsim
@ 2018-08-17 21:21 Danek Duvall
  2018-08-22 11:46 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Danek Duvall @ 2018-08-17 21:21 UTC (permalink / raw)
  To: linux-wireless; +Cc: Johannes Berg

The mac80211_hwsim driver puts this in its VHT capabilities info field:

    IEEE80211_VHT_CAP_RXSTBC_1 | 
    IEEE80211_VHT_CAP_RXSTBC_2 |
    IEEE80211_VHT_CAP_RXSTBC_3 |
    IEEE80211_VHT_CAP_RXSTBC_4

and I don't understand what that's supposed to mean.  According to
802.11-2016, the three-bit field isn't a series of boolean values, but a
single numerical value in its three bits, where the value is the maximum
number of STBC streams, and the maximum defined value is 4.

But the way that the code treats it, we end up with a value of 7.

There seems to be a similar issue in mac80211/main.c, in the definition of
mac80211_vht_capa_mod_mask.

Is that a bug in the code, or a misunderstanding on my part?  No other
(in-tree) drivers use any of the macros other than _1, so I don't have any
other references for how the other values might be used.

Thanks,
Danek

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

* Re: Use of IEEE80211_VHT_CAP_RXSTBC_* in mac80211_hwsim
  2018-08-17 21:21 Use of IEEE80211_VHT_CAP_RXSTBC_* in mac80211_hwsim Danek Duvall
@ 2018-08-22 11:46 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2018-08-22 11:46 UTC (permalink / raw)
  To: Danek Duvall, linux-wireless

On Fri, 2018-08-17 at 14:21 -0700, Danek Duvall wrote:
> The mac80211_hwsim driver puts this in its VHT capabilities info field:
> 
>     IEEE80211_VHT_CAP_RXSTBC_1 | 
>     IEEE80211_VHT_CAP_RXSTBC_2 |
>     IEEE80211_VHT_CAP_RXSTBC_3 |
>     IEEE80211_VHT_CAP_RXSTBC_4

Uh, yeah, that's garbage.

> and I don't understand what that's supposed to mean.  According to
> 802.11-2016, the three-bit field isn't a series of boolean values, but a
> single numerical value in its three bits, where the value is the maximum
> number of STBC streams, and the maximum defined value is 4.

Yeah ...

> But the way that the code treats it, we end up with a value of 7.

Indeed.

> There seems to be a similar issue in mac80211/main.c, in the definition of
> mac80211_vht_capa_mod_mask.

I guess this one is sort of fine - you can override here and the 7 is
actually the right result, but we should put there
IEEE80211_VHT_CAP_RXSTBC_MASK.

> Is that a bug in the code, or a misunderstanding on my part?  No other
> (in-tree) drivers use any of the macros other than _1, so I don't have any
> other references for how the other values might be used.

It's a bug.

I think it should be two changes - one, in hwsim, to just set _4 (it's
fake anyway), and in mac80211/main.c to use
IEEE80211_VHT_CAP_RXSTBC_MASK instead of the four values ORed together.

Want to prepare such patches? Otherwise I can too.

johannes

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

end of thread, other threads:[~2018-08-22 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-17 21:21 Use of IEEE80211_VHT_CAP_RXSTBC_* in mac80211_hwsim Danek Duvall
2018-08-22 11:46 ` 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).