From: Johannes Berg <johannes@sipsolutions.net>
To: Jonas Jelonek <jelonek.jonas@gmail.com>
Cc: linux-wireless@vger.kernel.org, Felix Fietkau <nbd@nbd.name>
Subject: Re: [RFC v2 4/6] mac80211: add utility function for tx_rate - rate_info conversion
Date: Thu, 19 Jan 2023 12:35:18 +0100 [thread overview]
Message-ID: <f364ace23f73e90f9cf62b5c8238e78599b6b7ab.camel@sipsolutions.net> (raw)
In-Reply-To: <9AE44A41-6357-4F3A-BF75-8E3B0A381E9B@gmail.com>
On Thu, 2023-01-19 at 12:31 +0100, Jonas Jelonek wrote:
> > On 12. Jan 2023, at 11:26, Johannes Berg <johannes@sipsolutions.net>
> > 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
next prev parent reply other threads:[~2023-01-19 11:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 10:40 [RFC v2 0/6] mac80211: add TPC support in control path Jonas Jelonek
2022-09-20 10:40 ` [RFC v2 1/6] mac80211: modify tx-power level annotation Jonas Jelonek
2022-09-21 14:54 ` Jeff Johnson
2023-01-12 10:24 ` Johannes Berg
2022-09-20 10:40 ` [RFC v2 2/6] mac80211: add tx-power annotation in control path Jonas Jelonek
2023-01-12 10:31 ` Johannes Berg
2022-09-20 10:40 ` [RFC v2 3/6] mac80211: add hardware flags for TPC support Jonas Jelonek
2022-09-20 10:40 ` [RFC v2 4/6] mac80211: add utility function for tx_rate - rate_info conversion Jonas Jelonek
2023-01-12 10:26 ` Johannes Berg
2023-01-19 11:31 ` Jonas Jelonek
2023-01-19 11:35 ` Johannes Berg [this message]
2023-01-19 14:34 ` Jonas Jelonek
2022-09-20 10:40 ` [RFC v2 5/6] mac80211_hwsim: add TPC per packet support Jonas Jelonek
2022-09-26 7:47 ` [mac80211_hwsim] 14f322748f: WARNING:at_include/net/mac80211.h:#mac80211_hwsim_monitor_rx[mac80211_hwsim] kernel test robot
2023-01-12 10:31 ` [RFC v2 5/6] mac80211_hwsim: add TPC per packet support Johannes Berg
2023-01-19 14:32 ` Jonas Jelonek
2023-01-19 15:09 ` Johannes Berg
2023-01-26 16:52 ` Jonas Jelonek
[not found] ` <195E1629-BC72-4968-8E61-860C80F58D8B@gmail.com>
[not found] ` <386f10e09c17b871df1c86ebc0c2af52938c6fb6.camel@sipsolutions.net>
2023-03-03 7:42 ` Jonas Jelonek
2023-01-26 16:53 ` Jonas Jelonek
2023-02-28 17:44 ` Johannes Berg
2023-03-03 7:46 ` Jonas Jelonek
2022-09-20 10:40 ` [RFC v2 6/6] mac80211: minstrel_ht - add debugfs entry per sta for fixed tx-power Jonas Jelonek
2023-01-12 10:32 ` Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f364ace23f73e90f9cf62b5c8238e78599b6b7ab.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=jelonek.jonas@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).