On Thu, 2023-01-19 at 12:31 +0100, Jonas Jelonek wrote: > > On 12. Jan 2023, at 11:26, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> > > wrote: > > > > > +void ieee80211_rate_get_rate_info(const struct ieee80211_tx_rate > > > *rate, > > > + struct wiphy > > > *wiphy, u8 band, > > > + struct rate_info > > > *rate_info) > > > +{ > > > + memset(rate_info, 0, sizeof(struct rate_info)); > > > + > > > + if (rate->flags & IEEE80211_TX_RC_MCS) { /* 802.11n */ > > > + rate_info->flags |= RATE_INFO_FLAGS_MCS; > > > + rate_info->mcs = rate->idx; > > > + } else if (rate->flags & IEEE80211_TX_RC_VHT_MCS) { /* > > > 802.11ac */ > > > + rate_info->flags |= RATE_INFO_FLAGS_VHT_MCS; > > > + rate_info->mcs = > > > ieee80211_rate_get_vht_mcs(rate); > > > + rate_info->nss = > > > ieee80211_rate_get_vht_nss(rate); > > > + } else { /* 802.11a/b/g */ > > > > what about HE/EHT? > > ieee80211_tx_rate uses an s8 for rate/MCS index, so only up to VHT > rates fit in there. > For rates above VHT, rate_info is needed, thus are are no HE/EHT rates > occuring in > ieee80211_tx_rate. Same applies to your comment on the hwsim > conversion. I guess I should've read the commit message more closely ;-) But please add kernel-doc to the function; both in general it'd be good to have, and in particular explaining that this is more for older drivers I guess? johannes