2021-03-26 10:32:01

by Luca Coelho

[permalink] [raw]
Subject: [PATCH for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26

From: Luca Coelho <[email protected]>

Hi,

This is the first patchset with fixes for v5.12.

The changes are:

* A few locking fixes;
* Fix a workaround for devices of the 22000 family;
* Fix the position of a bit in the regulatory capabilities;
* Add support to some devices that were missing.

As usual, I'm pushing this to a pending branch, for kbuild bot. And
since these are fixes for the rc series, please take them directly to
wireless-drivers.git, as we agreed. I'll assign them to you.

Cheers,
Luca.


Gregory Greenman (1):
mvm: rfi: don't lock mvm->mutex when sending config command

Johannes Berg (3):
iwlwifi: pcie: properly set LTR workarounds on 22000 devices
iwlwifi: fw: fix notification wait locking
iwlwifi: mvm: fix beacon protection checks

Luca Coelho (2):
iwlwifi: fix 11ax disabled bit in the regulatory capability flags
iwlwifi: pcie: add support for So-F devices

Matt Chen (1):
iwlwifi: add support for Qu with AX201 device

.../wireless/intel/iwlwifi/fw/notif-wait.c | 10 +++---
.../net/wireless/intel/iwlwifi/iwl-config.h | 1 +
.../wireless/intel/iwlwifi/iwl-nvm-parse.c | 2 +-
.../net/wireless/intel/iwlwifi/mvm/debugfs.c | 7 ++--
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c | 6 ++--
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 17 ++++++---
.../intel/iwlwifi/pcie/ctxt-info-gen3.c | 31 +---------------
.../wireless/intel/iwlwifi/pcie/ctxt-info.c | 3 +-
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 27 +++++++++++++-
.../wireless/intel/iwlwifi/pcie/trans-gen2.c | 35 +++++++++++++++++++
10 files changed, 90 insertions(+), 49 deletions(-)

--
2.31.0


2021-03-26 10:32:11

by Luca Coelho

[permalink] [raw]
Subject: [PATCH for v5.12 5/7] iwlwifi: pcie: add support for So-F devices

From: Luca Coelho <[email protected]>

We have a new type of device that has a different MAC ID, but is
otherwise identical to So devices. Add rules to match this new ID
accordingly.

Change-Id: I2b6ef794c2073a18779dd40fb53f8c942d1ab42d
Signed-off-by: Luca Coelho <[email protected]>
---
.../net/wireless/intel/iwlwifi/iwl-config.h | 1 +
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 26 ++++++++++++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 75f99ff7f908..c4f5da76f1c0 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -414,6 +414,7 @@ struct iwl_cfg {
#define IWL_CFG_MAC_TYPE_QNJ 0x36
#define IWL_CFG_MAC_TYPE_SO 0x37
#define IWL_CFG_MAC_TYPE_SNJ 0x42
+#define IWL_CFG_MAC_TYPE_SOF 0x43
#define IWL_CFG_MAC_TYPE_MA 0x44

#define IWL_CFG_RF_TYPE_TH 0x105
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 4e2219b46db2..558a0b2ef0fc 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1041,7 +1041,31 @@ static const struct iwl_dev_info iwl_dev_info_table[] = {
IWL_CFG_MAC_TYPE_SO, IWL_CFG_ANY,
IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
- iwl_cfg_so_a0_hr_a0, iwl_ax201_name)
+ iwl_cfg_so_a0_hr_a0, iwl_ax201_name),
+
+/* So-F with Hr */
+ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+ IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+ IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
+ IWL_CFG_NO_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+ iwl_cfg_so_a0_hr_a0, iwl_ax203_name),
+ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+ IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+ IWL_CFG_RF_TYPE_HR1, IWL_CFG_ANY,
+ IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+ iwl_cfg_so_a0_hr_a0, iwl_ax101_name),
+ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+ IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+ IWL_CFG_RF_TYPE_HR2, IWL_CFG_ANY,
+ IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+ iwl_cfg_so_a0_hr_a0, iwl_ax201_name),
+
+/* So-F with Gf */
+ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+ IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY,
+ IWL_CFG_RF_TYPE_GF, IWL_CFG_ANY,
+ IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_NO_CDB,
+ iwlax211_2ax_cfg_so_gf_a0, iwl_ax211_name),

#endif /* CONFIG_IWLMVM */
};
--
2.31.0

2021-03-26 10:32:14

by Luca Coelho

[permalink] [raw]
Subject: [PATCH for v5.12 6/7] mvm: rfi: don't lock mvm->mutex when sending config command

From: Gregory Greenman <[email protected]>

The mutex is already locked in iwl_mvm_mac_start.

Change-Id: I82a0312389032d07c3b478bef3e938e06bfa7df6
Signed-off-by: Gregory Greenman <[email protected]>
Fixes: 21254908cbe9 ("iwlwifi: mvm: add RFI-M support")
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 7 +++++--
drivers/net/wireless/intel/iwlwifi/mvm/rfi.c | 6 +++---
2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 130760572262..34ddef97b099 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1786,10 +1786,13 @@ static ssize_t iwl_dbgfs_rfi_freq_table_write(struct iwl_mvm *mvm, char *buf,
return -EINVAL;

/* value zero triggers re-sending the default table to the device */
- if (!op_id)
+ if (!op_id) {
+ mutex_lock(&mvm->mutex);
ret = iwl_rfi_send_config_cmd(mvm, NULL);
- else
+ mutex_unlock(&mvm->mutex);
+ } else {
ret = -EOPNOTSUPP; /* in the future a new table will be added */
+ }

return ret ?: count;
}
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c b/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
index 873919048143..0b818067067c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rfi.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright (C) 2020 Intel Corporation
+ * Copyright (C) 2020 - 2021 Intel Corporation
*/

#include "mvm.h"
@@ -66,6 +66,8 @@ int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm, struct iwl_rfi_lut_entry *rfi_t
if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_RFIM_SUPPORT))
return -EOPNOTSUPP;

+ lockdep_assert_held(&mvm->mutex);
+
/* in case no table is passed, use the default one */
if (!rfi_table) {
memcpy(cmd.table, iwl_rfi_table, sizeof(cmd.table));
@@ -75,9 +77,7 @@ int iwl_rfi_send_config_cmd(struct iwl_mvm *mvm, struct iwl_rfi_lut_entry *rfi_t
cmd.oem = 1;
}

- mutex_lock(&mvm->mutex);
ret = iwl_mvm_send_cmd(mvm, &hcmd);
- mutex_unlock(&mvm->mutex);

if (ret)
IWL_ERR(mvm, "Failed to send RFI config cmd %d\n", ret);
--
2.31.0

2021-03-26 10:32:44

by Luca Coelho

[permalink] [raw]
Subject: [PATCH for v5.12 7/7] iwlwifi: mvm: fix beacon protection checks

From: Johannes Berg <[email protected]>

Unfortunately, since beacon protection isn't fully available
yet, we didn't notice that there are problems with it and
that the replay detection isn't working correctly. We were
relying only on mac80211, since iwl_mvm_rx_crypto() exits
when !ieee80211_has_protected(), which is of course true for
protected (but not encrypted) management frames.

Fix this to properly detect protected (but not encrypted)
management frames and handle them - we continue to only care
about beacons since for others everything can and will be
checked in mac80211.

Change-Id: I09c262a8f6f9852cc8f513cdcb31a7f8f87dd8af
Signed-off-by: Johannes Berg <[email protected]>
Fixes: b1fdc2505abc ("iwlwifi: mvm: advertise BIGTK client support if available")
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index c21736f80c29..af5a6dd81c41 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -272,10 +272,10 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,
rx_status->chain_signal[2] = S8_MIN;
}

-static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,
- struct ieee80211_hdr *hdr,
- struct iwl_rx_mpdu_desc *desc,
- u32 status)
+static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,
+ struct ieee80211_hdr *hdr,
+ struct iwl_rx_mpdu_desc *desc,
+ u32 status)
{
struct iwl_mvm_sta *mvmsta;
struct iwl_mvm_vif *mvmvif;
@@ -285,6 +285,9 @@ static int iwl_mvm_rx_mgmt_crypto(struct ieee80211_sta *sta,
u32 len = le16_to_cpu(desc->mpdu_len);
const u8 *frame = (void *)hdr;

+ if ((status & IWL_RX_MPDU_STATUS_SEC_MASK) == IWL_RX_MPDU_STATUS_SEC_NONE)
+ return 0;
+
/*
* For non-beacon, we don't really care. But beacons may
* be filtered out, and we thus need the firmware's replay
@@ -356,6 +359,10 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
IWL_RX_MPDU_STATUS_SEC_UNKNOWN && !mvm->monitor_on)
return -1;

+ if (unlikely(ieee80211_is_mgmt(hdr->frame_control) &&
+ !ieee80211_has_protected(hdr->frame_control)))
+ return iwl_mvm_rx_mgmt_prot(sta, hdr, desc, status);
+
if (!ieee80211_has_protected(hdr->frame_control) ||
(status & IWL_RX_MPDU_STATUS_SEC_MASK) ==
IWL_RX_MPDU_STATUS_SEC_NONE)
@@ -411,7 +418,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
stats->flag |= RX_FLAG_DECRYPTED;
return 0;
case RX_MPDU_RES_STATUS_SEC_CMAC_GMAC_ENC:
- return iwl_mvm_rx_mgmt_crypto(sta, hdr, desc, status);
+ break;
default:
/*
* Sometimes we can get frames that were not decrypted
--
2.31.0

2021-03-26 10:57:18

by Luca Coelho

[permalink] [raw]
Subject: Re: [PATCH for v5.12 0/7] iwlwifi: fixes intended for v5.12 2021-03-26

On Fri, 2021-03-26 at 12:30 +0200, Luca Coelho wrote:
> From: Luca Coelho <[email protected]>
>
> Hi,
>
> This is the first patchset with fixes for v5.12.
>
> The changes are:
>
> * A few locking fixes;
> * Fix a workaround for devices of the 22000 family;
> * Fix the position of a bit in the regulatory capabilities;
> * Add support to some devices that were missing.
>
> As usual, I'm pushing this to a pending branch, for kbuild bot. And
> since these are fixes for the rc series, please take them directly to
> wireless-drivers.git, as we agreed. I'll assign them to you.
>
> Cheers,
> Luca.

Oops, I misinstalled my hooks and ended up sending all the patches with
Change-Id tags. Sorry for that and thanks Johannes for noticing.

I'll mark this series as superseded and send v2.

--
Cheers,
Luca.