From: Luciano Coelho <luciano.coelho@intel.com>
To: gregkh@linuxfoundation.org
Cc: stable@vger.kernel.org, stable-commits@vger.kernel.org
Subject: Re: [PATCH for v4.4] iwlwifi: add workaround to disable wide channels in 5GHz
Date: Tue, 10 Oct 2017 11:16:32 +0300 [thread overview]
Message-ID: <1507623392.908.169.camel@intel.com> (raw)
In-Reply-To: <20171010081237.30724-1-luca@coelho.fi>
On Tue, 2017-10-10 at 11:12 +0300, Luca Coelho wrote:
> From: Luca Coelho <luciano.coelho@intel.com>
>
> commit 01a9c948a09348950515bf2abb6113ed83e696d8 upstream.
>
> The OTP in some SKUs have erroneously allowed 40MHz and 80MHz channels
> in the 5.2GHz band. The firmware has been modified to not allow this
> in those SKUs, so the driver needs to do the same otherwise the
> firmware will assert when we try to use it.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> drivers/net/wireless/iwlwifi/iwl-nvm-parse.c | 65 +++++++++++++++++++++++-----
> 1 file changed, 55 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
> index d82984912e04..e7f58e00b5fb 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
> @@ -73,6 +73,7 @@
> /* NVM offsets (in words) definitions */
> enum wkp_nvm_offsets {
> /* NVM HW-Section offset (in words) definitions */
> + SUBSYSTEM_ID = 0x0A,
> HW_ADDR = 0x15,
>
> /* NVM SW-Section offset (in words) definitions */
> @@ -257,13 +258,12 @@ static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, bool is_5ghz,
> static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
> struct iwl_nvm_data *data,
> const __le16 * const nvm_ch_flags,
> - bool lar_supported)
> + bool lar_supported, bool no_wide_in_5ghz)
> {
> int ch_idx;
> int n_channels = 0;
> struct ieee80211_channel *channel;
> u16 ch_flags;
> - bool is_5ghz;
> int num_of_ch, num_2ghz_channels;
> const u8 *nvm_chan;
>
> @@ -278,12 +278,20 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
> }
>
> for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) {
> + bool is_5ghz = (ch_idx >= num_2ghz_channels);
> +
> ch_flags = __le16_to_cpup(nvm_ch_flags + ch_idx);
>
> - if (ch_idx >= num_2ghz_channels &&
> - !data->sku_cap_band_52GHz_enable)
> + if (is_5ghz && !data->sku_cap_band_52GHz_enable)
> continue;
>
> + /* workaround to disable wide channels in 5GHz */
> + if (no_wide_in_5ghz && is_5ghz) {
> + ch_flags &= ~(NVM_CHANNEL_40MHZ |
> + NVM_CHANNEL_80MHZ |
> + NVM_CHANNEL_160MHZ);
> + }
> +
> if (!lar_supported && !(ch_flags & NVM_CHANNEL_VALID)) {
> /*
> * Channels might become valid later if lar is
> @@ -303,7 +311,7 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
> n_channels++;
>
> channel->hw_value = nvm_chan[ch_idx];
> - channel->band = (ch_idx < num_2ghz_channels) ?
> + channel->band = is_5ghz ?
> IEEE80211_BAND_2GHZ : IEEE80211_BAND_5GHZ;
Ooops, sorry, I made a mistake here. I'll send v2.
--
Luca.
next prev parent reply other threads:[~2017-10-10 8:16 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-22 9:36 Patch "iwlwifi: add workaround to disable wide channels in 5GHz" has been added to the 4.13-stable tree gregkh
2017-09-22 9:50 ` Greg KH
2017-09-22 12:17 ` [PATCH] iwlwifi: add workaround to disable wide channels in 5GHz Luca Coelho
2017-09-22 16:20 ` Greg KH
2017-09-22 16:36 ` Coelho, Luciano
2017-10-10 7:57 ` [PATCH for v4.9] " Luca Coelho
2017-10-10 15:27 ` Greg KH
2017-10-10 8:12 ` [PATCH for v4.4] " Luca Coelho
2017-10-10 8:16 ` Luciano Coelho [this message]
2017-10-10 8:20 ` [PATCH v2 " Luca Coelho
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=1507623392.908.169.camel@intel.com \
--to=luciano.coelho@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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).