On Wed, Mar 09, 2022 at 07:16:41PM +0300, Mikhail wrote:
> On Wed, Mar 09, 2022 at 01:07:47PM +0100, Stefan Sperling wrote:
> > /*
> > + * Install received VHT caps information in the node's state block.
> > + */
> > +void
> > +ieee80211_setup_vhtcaps(struct ieee80211_node *ni, const uint8_t *data,
> > + uint8_t len)
> > +{
> > + if (len != 12)
> > + return;
> > +
> > + ni->ni_vhtcaps = (data[0] | (data[1] << 8) | data[2] << 16 |
> > + data[3] << 24);
> > + ni->ni_vht_rxmcs = (data[4] | (data[5] << 8));
> > + ni->ni_vht_rx_max_lgi_mbit_s = ((data[6] | (data[7] << 8)) &
> > + IEEE80211_VHT_MAX_LGI_MBIT_S_MASK);
> > + ni->ni_vht_txmcs = (data[8] | (data[9] << 8));
> > + ni->ni_vht_tx_max_lgi_mbit_s = ((data[10] | (data[11] << 8)) &
> > + IEEE80211_VHT_MAX_LGI_MBIT_S_MASK);
> > +
> > + ni->ni_flags |= IEEE80211_NODE_VHTCAP;
> > +}
>
> I understand that this function do things like ieee80211_setup_htcaps()
> (HT, 802.11n), which is mature, working and stable, but is there a
> reason not to return 0 on error, 1 on success, and check it in the
> caller (like in ieee80211_setup_vhtop())?
Doesn't really matter. We can decide to ignore just the VHT cap IE, or
we can discard the whole beacon. Either way, VHT won't be enabled.
> > +/* Check if the peer supports VHT short guard interval (SGI) on 160 MHz. */
> > +static inline int
> > +ieee80211_node_supports_vht_sgi160(struct ieee80211_node *ni)
> > +{
> > + return ieee80211_node_supports_vht(ni) &&
> > + (ni->ni_vhtcaps & IEEE80211_VHTCAP_SGI160);
> > +}
>
> This function is unused.
I added it for future use.
> The patch for whitespacing:
Thanks. I will keep this for later instead of mixing it in right now.
I can then commit it separately and attribute it to you in the log message.