From: Kalle Valo <kvalo@codeaurora.org>
To: John Crispin <john@phrozen.org>
Cc: ath11k@lists.infradead.org,
Shashidhar Lakkavalli <slakkavalli@datto.com>
Subject: Re: [PATCH V4 1/5] ath11k: move phymode selection from function to array lookup
Date: Mon, 13 May 2019 17:26:54 +0300 [thread overview]
Message-ID: <87tvdyig5t.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20190509201550.3977-2-john@phrozen.org> (John Crispin's message of "Thu, 9 May 2019 22:15:46 +0200")
John Crispin <john@phrozen.org> writes:
> With HE support getting added, the approach of using functions will quickly
> get convoluted. Change the code to use an array lookup function instead.
>
> Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com>
> Signed-off-by: John Crispin <john@phrozen.org>
> ---
> drivers/net/wireless/ath/ath11k/mac.c | 116 +++++++++++++++-------------------
> include/uapi/linux/nl80211.h | 4 ++
> 2 files changed, 56 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
> index 94a87d0fb08e..cd7fb9a13639 100644
> --- a/drivers/net/wireless/ath/ath11k/mac.c
> +++ b/drivers/net/wireless/ath/ath11k/mac.c
> @@ -105,6 +105,51 @@ static struct ieee80211_rate ath11k_legacy_rates[] = {
> { .bitrate = 540, .hw_value = ATH11K_HW_RATE_OFDM_54M },
> };
>
> +static int ath11k_phymodes[NUM_NL80211_BANDS][2][__NL80211_CHAN_WIDTH_NUM] = {
static const?
> @@ -3889,7 +3872,12 @@ ath11k_mac_vdev_start_restart(struct ath11k_vif *arvif,
> arg.channel.freq = chandef->chan->center_freq;
> arg.channel.band_center_freq1 = chandef->center_freq1;
> arg.channel.band_center_freq2 = chandef->center_freq2;
> - arg.channel.mode = chan_to_phymode(chandef);
> + arg.channel.mode =
> + ath11k_phymodes[chandef->chan->band][he_support][chandef->width];
> + if (arg.channel.mode == MODE_11G &&
> + chandef->chan->flags & IEEE80211_CHAN_NO_OFDM)
> + arg.channel.mode = MODE_11B;
> + WARN_ON(arg.channel.mode == MODE_UNKNOWN);
What happens when mode is MODE_UNKNOWN? Should we assign some default
value after the warning message?
--
Kalle Valo
_______________________________________________
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
next prev parent reply other threads:[~2019-05-13 14:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-09 20:15 [PATCH V4 0/5] ath11k: add HE support John Crispin
2019-05-09 20:15 ` [PATCH V4 1/5] ath11k: move phymode selection from function to array lookup John Crispin
2019-05-13 14:26 ` Kalle Valo [this message]
2019-05-15 9:39 ` John Crispin
2019-05-13 17:07 ` Kalle Valo
2019-05-09 20:15 ` [PATCH V4 2/5] ath11k: add HE handling to the debug code John Crispin
2019-05-09 20:15 ` [PATCH V4 3/5] ath11k: extend reading of FW capabilities John Crispin
2019-05-09 20:15 ` [PATCH V4 4/5] ath11k: handle rx status for HE frames John Crispin
2019-05-13 14:28 ` Kalle Valo
2019-05-09 20:15 ` [PATCH V4 5/5] ath11k: add HE support John Crispin
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=87tvdyig5t.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=ath11k@lists.infradead.org \
--cc=john@phrozen.org \
--cc=slakkavalli@datto.com \
/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