* [PATCH 01/14] iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation Miri Korenblit
` (12 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg, Luciano Coelho
From: Johannes Berg <johannes.berg@intel.com>
The firmware changed their mind, don't set the chains to zero,
instead set them to 1 as we normally would for connections to
APs that don't use MIMO.
Fixes: 2a7ce54ccc23 ("iwlwifi: mvm: honour firmware SMPS requests")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
index 4e1fccff3987..334d1f59f6e4 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c
@@ -99,17 +99,6 @@ static void iwl_mvm_phy_ctxt_set_rxchain(struct iwl_mvm *mvm,
active_cnt = 2;
}
- /*
- * If the firmware requested it, then we know that it supports
- * getting zero for the values to indicate "use one, but pick
- * which one yourself", which means it can dynamically pick one
- * that e.g. has better RSSI.
- */
- if (mvm->fw_static_smps_request && active_cnt == 1 && idle_cnt == 1) {
- idle_cnt = 0;
- active_cnt = 0;
- }
-
*rxchain_info = cpu_to_le32(iwl_mvm_get_valid_rx_ant(mvm) <<
PHY_RX_CHAIN_VALID_POS);
*rxchain_info |= cpu_to_le32(idle_cnt << PHY_RX_CHAIN_CNT_POS);
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
2023-12-19 19:58 ` [PATCH 01/14] iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-20 19:42 ` kernel test robot
2023-12-20 20:02 ` kernel test robot
2023-12-19 19:58 ` [PATCH 03/14] wifi: iwlwifi: Don't mark DFS channels as NO-IR Miri Korenblit
` (11 subsequent siblings)
13 siblings, 2 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Andrei Otcheretianski, Gregory Greenman
From: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
AX210 devices allow concurrent P2P operation on DFS channels.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 10 ++++++----
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ++++
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 480f8edbfd35..1bccbbe9a5ea 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -1609,10 +1609,12 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
/* Set the GO concurrent flag only in case that NO_IR is set.
* Otherwise it is meaningless
*/
- if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT) &&
- (flags & NL80211_RRF_NO_IR))
- flags |= NL80211_RRF_GO_CONCURRENT;
-
+ if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT)) {
+ if (flags & NL80211_RRF_NO_IR)
+ flags |= NL80211_RRF_GO_CONCURRENT;
+ if (flags & NL80211_RRF_DFS)
+ flags |= NL80211_RRF_DFS_CONCURRENT;
+ }
/*
* reg_capa is per regulatory domain so apply it for every channel
*/
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index a64600f0ed9f..06de4dc2a915 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -517,6 +517,10 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
hw->wiphy->regulatory_flags |= REGULATORY_CUSTOM_REG |
REGULATORY_DISABLE_BEACON_HINTS;
+ if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210)
+ wiphy_ext_feature_set(hw->wiphy,
+ NL80211_EXT_FEATURE_DFS_CONCURRENT);
+
hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
hw->wiphy->flags |= WIPHY_FLAG_SPLIT_SCAN_6GHZ;
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* Re: [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation
2023-12-19 19:58 ` [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation Miri Korenblit
@ 2023-12-20 19:42 ` kernel test robot
2023-12-20 20:02 ` kernel test robot
1 sibling, 0 replies; 18+ messages in thread
From: kernel test robot @ 2023-12-20 19:42 UTC (permalink / raw)
To: Miri Korenblit, johannes
Cc: llvm, oe-kbuild-all, linux-wireless, Andrei Otcheretianski,
Gregory Greenman
Hi Miri,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.7-rc6 next-20231220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/iwlwifi-mvm-set-siso-mimo-chains-to-1-in-FW-SMPS-request/20231220-040247
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/r/20231219215605.dc39b33bf507.I04dfda24d73091fb75701279d10ac400314de488%40changeid
patch subject: [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20231221/202312210330.BRAWF2Tp-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231221/202312210330.BRAWF2Tp-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312210330.BRAWF2Tp-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:1616:13: error: use of undeclared identifier 'NL80211_RRF_DFS_CONCURRENT'; did you mean 'NL80211_RRF_IR_CONCURRENT'?
flags |= NL80211_RRF_DFS_CONCURRENT;
^~~~~~~~~~~~~~~~~~~~~~~~~~
NL80211_RRF_IR_CONCURRENT
include/uapi/linux/nl80211.h:4515:2: note: 'NL80211_RRF_IR_CONCURRENT' declared here
NL80211_RRF_IR_CONCURRENT = 1<<12,
^
1 error generated.
--
>> drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:522:11: error: use of undeclared identifier 'NL80211_EXT_FEATURE_DFS_CONCURRENT'
NL80211_EXT_FEATURE_DFS_CONCURRENT);
^
1 error generated.
vim +1616 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
1574
1575 static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
1576 int ch_idx, u16 nvm_flags,
1577 struct iwl_reg_capa reg_capa,
1578 const struct iwl_cfg *cfg)
1579 {
1580 u32 flags = NL80211_RRF_NO_HT40;
1581
1582 if (ch_idx < NUM_2GHZ_CHANNELS &&
1583 (nvm_flags & NVM_CHANNEL_40MHZ)) {
1584 if (nvm_chan[ch_idx] <= LAST_2GHZ_HT_PLUS)
1585 flags &= ~NL80211_RRF_NO_HT40PLUS;
1586 if (nvm_chan[ch_idx] >= FIRST_2GHZ_HT_MINUS)
1587 flags &= ~NL80211_RRF_NO_HT40MINUS;
1588 } else if (nvm_flags & NVM_CHANNEL_40MHZ) {
1589 if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0)
1590 flags &= ~NL80211_RRF_NO_HT40PLUS;
1591 else
1592 flags &= ~NL80211_RRF_NO_HT40MINUS;
1593 }
1594
1595 if (!(nvm_flags & NVM_CHANNEL_80MHZ))
1596 flags |= NL80211_RRF_NO_80MHZ;
1597 if (!(nvm_flags & NVM_CHANNEL_160MHZ))
1598 flags |= NL80211_RRF_NO_160MHZ;
1599
1600 if (!(nvm_flags & NVM_CHANNEL_ACTIVE))
1601 flags |= NL80211_RRF_NO_IR;
1602
1603 if (nvm_flags & NVM_CHANNEL_RADAR)
1604 flags |= NL80211_RRF_DFS;
1605
1606 if (nvm_flags & NVM_CHANNEL_INDOOR_ONLY)
1607 flags |= NL80211_RRF_NO_OUTDOOR;
1608
1609 /* Set the GO concurrent flag only in case that NO_IR is set.
1610 * Otherwise it is meaningless
1611 */
1612 if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT)) {
1613 if (flags & NL80211_RRF_NO_IR)
1614 flags |= NL80211_RRF_GO_CONCURRENT;
1615 if (flags & NL80211_RRF_DFS)
> 1616 flags |= NL80211_RRF_DFS_CONCURRENT;
1617 }
1618 /*
1619 * reg_capa is per regulatory domain so apply it for every channel
1620 */
1621 if (ch_idx >= NUM_2GHZ_CHANNELS) {
1622 if (!reg_capa.allow_40mhz)
1623 flags |= NL80211_RRF_NO_HT40;
1624
1625 if (!reg_capa.allow_80mhz)
1626 flags |= NL80211_RRF_NO_80MHZ;
1627
1628 if (!reg_capa.allow_160mhz)
1629 flags |= NL80211_RRF_NO_160MHZ;
1630
1631 if (!reg_capa.allow_320mhz)
1632 flags |= NL80211_RRF_NO_320MHZ;
1633 }
1634
1635 if (reg_capa.disable_11ax)
1636 flags |= NL80211_RRF_NO_HE;
1637
1638 if (reg_capa.disable_11be)
1639 flags |= NL80211_RRF_NO_EHT;
1640
1641 return flags;
1642 }
1643
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 18+ messages in thread* Re: [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation
2023-12-19 19:58 ` [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation Miri Korenblit
2023-12-20 19:42 ` kernel test robot
@ 2023-12-20 20:02 ` kernel test robot
1 sibling, 0 replies; 18+ messages in thread
From: kernel test robot @ 2023-12-20 20:02 UTC (permalink / raw)
To: Miri Korenblit, johannes
Cc: oe-kbuild-all, linux-wireless, Andrei Otcheretianski,
Gregory Greenman
Hi Miri,
kernel test robot noticed the following build errors:
[auto build test ERROR on wireless-next/main]
[also build test ERROR on wireless/main linus/master v6.7-rc6 next-20231220]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/iwlwifi-mvm-set-siso-mimo-chains-to-1-in-FW-SMPS-request/20231220-040247
base: https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link: https://lore.kernel.org/r/20231219215605.dc39b33bf507.I04dfda24d73091fb75701279d10ac400314de488%40changeid
patch subject: [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation
config: loongarch-allmodconfig (https://download.01.org/0day-ci/archive/20231221/202312210343.J7eedmDf-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231221/202312210343.J7eedmDf-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312210343.J7eedmDf-lkp@intel.com/
All errors (new ones prefixed by >>):
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c: In function 'iwl_nvm_get_regdom_bw_flags':
>> drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:1616:34: error: 'NL80211_RRF_DFS_CONCURRENT' undeclared (first use in this function); did you mean 'NL80211_RRF_IR_CONCURRENT'?
1616 | flags |= NL80211_RRF_DFS_CONCURRENT;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| NL80211_RRF_IR_CONCURRENT
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c:1616:34: note: each undeclared identifier is reported only once for each function it appears in
--
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c: In function 'iwl_mvm_mac_setup_register':
>> drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:522:39: error: 'NL80211_EXT_FEATURE_DFS_CONCURRENT' undeclared (first use in this function); did you mean 'NL80211_EXT_FEATURE_BSS_COLOR'?
522 | NL80211_EXT_FEATURE_DFS_CONCURRENT);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| NL80211_EXT_FEATURE_BSS_COLOR
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:522:39: note: each undeclared identifier is reported only once for each function it appears in
vim +1616 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
1574
1575 static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
1576 int ch_idx, u16 nvm_flags,
1577 struct iwl_reg_capa reg_capa,
1578 const struct iwl_cfg *cfg)
1579 {
1580 u32 flags = NL80211_RRF_NO_HT40;
1581
1582 if (ch_idx < NUM_2GHZ_CHANNELS &&
1583 (nvm_flags & NVM_CHANNEL_40MHZ)) {
1584 if (nvm_chan[ch_idx] <= LAST_2GHZ_HT_PLUS)
1585 flags &= ~NL80211_RRF_NO_HT40PLUS;
1586 if (nvm_chan[ch_idx] >= FIRST_2GHZ_HT_MINUS)
1587 flags &= ~NL80211_RRF_NO_HT40MINUS;
1588 } else if (nvm_flags & NVM_CHANNEL_40MHZ) {
1589 if ((ch_idx - NUM_2GHZ_CHANNELS) % 2 == 0)
1590 flags &= ~NL80211_RRF_NO_HT40PLUS;
1591 else
1592 flags &= ~NL80211_RRF_NO_HT40MINUS;
1593 }
1594
1595 if (!(nvm_flags & NVM_CHANNEL_80MHZ))
1596 flags |= NL80211_RRF_NO_80MHZ;
1597 if (!(nvm_flags & NVM_CHANNEL_160MHZ))
1598 flags |= NL80211_RRF_NO_160MHZ;
1599
1600 if (!(nvm_flags & NVM_CHANNEL_ACTIVE))
1601 flags |= NL80211_RRF_NO_IR;
1602
1603 if (nvm_flags & NVM_CHANNEL_RADAR)
1604 flags |= NL80211_RRF_DFS;
1605
1606 if (nvm_flags & NVM_CHANNEL_INDOOR_ONLY)
1607 flags |= NL80211_RRF_NO_OUTDOOR;
1608
1609 /* Set the GO concurrent flag only in case that NO_IR is set.
1610 * Otherwise it is meaningless
1611 */
1612 if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT)) {
1613 if (flags & NL80211_RRF_NO_IR)
1614 flags |= NL80211_RRF_GO_CONCURRENT;
1615 if (flags & NL80211_RRF_DFS)
> 1616 flags |= NL80211_RRF_DFS_CONCURRENT;
1617 }
1618 /*
1619 * reg_capa is per regulatory domain so apply it for every channel
1620 */
1621 if (ch_idx >= NUM_2GHZ_CHANNELS) {
1622 if (!reg_capa.allow_40mhz)
1623 flags |= NL80211_RRF_NO_HT40;
1624
1625 if (!reg_capa.allow_80mhz)
1626 flags |= NL80211_RRF_NO_80MHZ;
1627
1628 if (!reg_capa.allow_160mhz)
1629 flags |= NL80211_RRF_NO_160MHZ;
1630
1631 if (!reg_capa.allow_320mhz)
1632 flags |= NL80211_RRF_NO_320MHZ;
1633 }
1634
1635 if (reg_capa.disable_11ax)
1636 flags |= NL80211_RRF_NO_HE;
1637
1638 if (reg_capa.disable_11be)
1639 flags |= NL80211_RRF_NO_EHT;
1640
1641 return flags;
1642 }
1643
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 03/14] wifi: iwlwifi: Don't mark DFS channels as NO-IR
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
2023-12-19 19:58 ` [PATCH 01/14] iwlwifi: mvm: set siso/mimo chains to 1 in FW SMPS request Miri Korenblit
2023-12-19 19:58 ` [PATCH 02/14] wifi: iwlwifi: mvm: Allow DFS concurrent operation Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 04/14] wifi: iwlwifi: mvm: send TX path flush in rfkill Miri Korenblit
` (10 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Andrei Otcheretianski, Gregory Greenman
From: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
The NVM_CHANNEL_ACTIVE bit means that active scanning/beaconing is
allowed, however it's not an exact opposite of IEEE80211_CHAN_NO_IR.
For example, NVM_CHANNEL_ACTIVE bit is not set on DFS channels, while
cfg80211 doesn't really expect NO-IR on DFS channels.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index 1bccbbe9a5ea..402896988686 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -1612,8 +1612,13 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
if ((nvm_flags & NVM_CHANNEL_GO_CONCURRENT)) {
if (flags & NL80211_RRF_NO_IR)
flags |= NL80211_RRF_GO_CONCURRENT;
- if (flags & NL80211_RRF_DFS)
+ if (flags & NL80211_RRF_DFS) {
flags |= NL80211_RRF_DFS_CONCURRENT;
+ /* Our device doesn't set active bit for DFS channels
+ * however, once marked as DFS no-ir is not needed.
+ */
+ flags &= ~NL80211_RRF_NO_IR;
+ }
}
/*
* reg_capa is per regulatory domain so apply it for every channel
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 04/14] wifi: iwlwifi: mvm: send TX path flush in rfkill
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (2 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 03/14] wifi: iwlwifi: Don't mark DFS channels as NO-IR Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 05/14] wifi: iwlwifi: mvm: d3: avoid intermediate/early mutex unlock Miri Korenblit
` (9 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman
From: Johannes Berg <johannes.berg@intel.com>
If we want to drop packets, that's surely a good thing to
do when we want to enter rfkill. Send this command despite
rfkill so we can successfully clean up everything, we need
to handle it separately since it has CMD_WANT_SKB, so it's
not going to automatically return success when in rfkill.
Fixes: d4e3a341b87b ("iwlwifi: mvm: add support for new flush queue response")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index ae5cd13cd6dd..db986bfc4dc3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -2256,7 +2256,7 @@ int iwl_mvm_flush_sta_tids(struct iwl_mvm *mvm, u32 sta_id, u16 tids)
WARN_ON(!iwl_mvm_has_new_tx_api(mvm));
if (iwl_fw_lookup_notif_ver(mvm->fw, LONG_GROUP, TXPATH_FLUSH, 0) > 0)
- cmd.flags |= CMD_WANT_SKB;
+ cmd.flags |= CMD_WANT_SKB | CMD_SEND_IN_RFKILL;
IWL_DEBUG_TX_QUEUES(mvm, "flush for sta id %d tid mask 0x%x\n",
sta_id, tids);
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 05/14] wifi: iwlwifi: mvm: d3: avoid intermediate/early mutex unlock
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (3 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 04/14] wifi: iwlwifi: mvm: send TX path flush in rfkill Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 06/14] wifi: iwlwifi: mvm: Do not warn if valid link pair was not found Miri Korenblit
` (8 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman
From: Johannes Berg <johannes.berg@intel.com>
Now with the mac80211 locking model changed, we no longer can
cause any bad dependencies here between mvm->mutex and other
mutexes in mac80211, so we no longer need to drop the mutex
early or even temporarily. Clean this up.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 92c45571bd69..4582afb149d7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -1130,14 +1130,7 @@ iwl_mvm_wowlan_config(struct iwl_mvm *mvm,
return ret;
}
- /*
- * This needs to be unlocked due to lock ordering
- * constraints. Since we're in the suspend path
- * that isn't really a problem though.
- */
- mutex_unlock(&mvm->mutex);
ret = iwl_mvm_wowlan_config_key_params(mvm, vif);
- mutex_lock(&mvm->mutex);
if (ret)
return ret;
@@ -2497,7 +2490,7 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
struct iwl_wowlan_status_data *status)
{
int i;
- bool keep;
+ bool keep = false;
struct iwl_mvm_sta *mvm_ap_sta;
if (!status)
@@ -2525,18 +2518,12 @@ static bool iwl_mvm_query_wakeup_reasons(struct iwl_mvm *mvm,
mvm_ap_sta->tid_data[i].seq_number >> 4);
}
- /* now we have all the data we need, unlock to avoid mac80211 issues */
- mutex_unlock(&mvm->mutex);
-
iwl_mvm_report_wakeup_reasons(mvm, vif, status);
keep = iwl_mvm_setup_connection_keep(mvm, vif, status);
-
- return keep;
-
out_unlock:
mutex_unlock(&mvm->mutex);
- return false;
+ return keep;
}
#define ND_QUERY_BUF_LEN (sizeof(struct iwl_scan_offload_profile_match) * \
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 06/14] wifi: iwlwifi: mvm: Do not warn if valid link pair was not found
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (4 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 05/14] wifi: iwlwifi: mvm: d3: avoid intermediate/early mutex unlock Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 07/14] wifi: iwlwifi: fix out of bound copy_from_user Miri Korenblit
` (7 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Ilan Peer, Gregory Greenman
From: Ilan Peer <ilan.peer@intel.com>
It is possible that though multiple links are enabled we cannot enabled
EMLSR enable more than a single link, e.g., all valid links are on the
same band etc. Thus, do not warn in case no valid link pair is found.
Fixes: b9be67fb4207 ("wifi: iwlwifi: mvm: Add basic link selection logic")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index ff6cb064051b..8e263acbc763 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -716,7 +716,7 @@ void iwl_mvm_mld_select_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
}
}
- if (WARN_ON(!new_active_links))
+ if (!new_active_links)
return;
if (vif->active_links != new_active_links)
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 07/14] wifi: iwlwifi: fix out of bound copy_from_user
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (5 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 06/14] wifi: iwlwifi: mvm: Do not warn if valid link pair was not found Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 08/14] wifi: iwlwifi: assign phy_ctxt before eSR activation Miri Korenblit
` (6 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Anjaneyulu, Gregory Greenman, Benjamin Berg
From: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
The driver copies the userspace buffer into an internal NUL
byte terminated buffer. While doing so, it was reading beyond
the end of the userspace buffer, overwriting its own NUL
termination in the process.
Fix this by only copying the correct number of bytes.
Fixes: 3f244876ef73 ("wifi: iwlwifi: make debugfs entries link specific")
Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index e016fce7ab24..16a104de8371 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1829,7 +1829,7 @@ static ssize_t _iwl_dbgfs_link_sta_##name##_write(struct file *file, \
char buf[buflen] = {}; \
size_t buf_size = min(count, sizeof(buf) - 1); \
\
- if (copy_from_user(buf, user_buf, sizeof(buf))) \
+ if (copy_from_user(buf, user_buf, buf_size)) \
return -EFAULT; \
\
return _iwl_dbgfs_link_sta_wrap_write(iwl_dbgfs_##name##_write, \
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 08/14] wifi: iwlwifi: assign phy_ctxt before eSR activation
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (6 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 07/14] wifi: iwlwifi: fix out of bound copy_from_user Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 09/14] wifi: iwlwifi: cleanup BT Shared Single Antenna code Miri Korenblit
` (5 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Gregory Greenman
eSR is activated when a chanctx is assigned to more than one link.
During eSR activation we should disable RLC for both phys, and configure
the FW with a special phy command for both phys.
Currently we assign the phy_ctxt to the link only after eSR activation,
so RLC is not disabled for the new phy_ctxt, and a cmd is not sent to FW.
Fix this by first assigning the new phy_ctxt to the link and then
doing the eSR activation.
Fixes: 12bacfc2c065 ("wifi: iwlwifi: handle eSR transitions")
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index 8e263acbc763..61170173f917 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -271,17 +271,17 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm,
}
}
+ mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
+
if (iwl_mvm_is_esr_supported(mvm->fwrt.trans) && n_active > 1) {
mvmvif->link[link_id]->listen_lmac = true;
ret = iwl_mvm_esr_mode_active(mvm, vif);
if (ret) {
IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret);
- return ret;
+ goto out;
}
}
- mvmvif->link[link_id]->phy_ctxt = phy_ctxt;
-
if (switching_chanctx) {
/* reactivate if we turned this off during channel switch */
if (vif->type == NL80211_IFTYPE_AP)
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 09/14] wifi: iwlwifi: cleanup BT Shared Single Antenna code
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (7 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 08/14] wifi: iwlwifi: assign phy_ctxt before eSR activation Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 10/14] wifi: iwlwifi: Add rf_mapping of new wifi7 devices Miri Korenblit
` (4 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Gregory Greenman
We don't support such device.
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
e
---
.../net/wireless/intel/iwlwifi/iwl-config.h | 1 -
drivers/net/wireless/intel/iwlwifi/mvm/coex.c | 22 ++++---------------
2 files changed, 4 insertions(+), 19 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 02ded22295c1..ae6f1cd4d660 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -377,7 +377,6 @@ struct iwl_cfg {
u16 nvm_calib_ver;
u32 rx_with_siso_diversity:1,
tx_with_siso_diversity:1,
- bt_shared_single_ant:1,
internal_wimax_coex:1,
host_interrupt_operation_mode:1,
high_temp:1,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/coex.c b/drivers/net/wireless/intel/iwlwifi/mvm/coex.c
index 5a5b1128e75c..9fe1761691ec 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/coex.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/coex.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright (C) 2013-2014, 2018-2020, 2022 Intel Corporation
+ * Copyright (C) 2013-2014, 2018-2020, 2022-2023 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
*/
#include <linux/ieee80211.h>
@@ -116,11 +116,6 @@ iwl_get_coex_type(struct iwl_mvm *mvm, const struct ieee80211_vif *vif)
ret = BT_COEX_TX_DIS_LUT;
- if (mvm->cfg->bt_shared_single_ant) {
- rcu_read_unlock();
- return ret;
- }
-
phy_ctx_id = *((u16 *)chanctx_conf->drv_priv);
primary_ch_phy_id = le32_to_cpu(mvm->last_bt_ci_cmd.primary_ch_phy_id);
secondary_ch_phy_id =
@@ -383,13 +378,12 @@ static void iwl_mvm_bt_notif_per_link(struct iwl_mvm *mvm,
/*
* don't reduce the Tx power if one of these is true:
* we are in LOOSE
- * single share antenna product
* BT is inactive
* we are not associated
*/
if (iwl_get_coex_type(mvm, vif) == BT_COEX_LOOSE_LUT ||
- mvm->cfg->bt_shared_single_ant || !vif->cfg.assoc ||
- le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) == BT_OFF) {
+ le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) == BT_OFF ||
+ !vif->cfg.assoc) {
iwl_mvm_bt_coex_reduced_txp(mvm, link_info->ap_sta_id, false);
/* FIXME: should this be per link? */
iwl_mvm_bt_coex_enable_rssi_event(mvm, vif, false, 0);
@@ -570,7 +564,7 @@ void iwl_mvm_bt_rssi_event(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
* Check if rssi is good enough for reduced Tx power, but not in loose
* scheme.
*/
- if (rssi_event == RSSI_EVENT_LOW || mvm->cfg->bt_shared_single_ant ||
+ if (rssi_event == RSSI_EVENT_LOW ||
iwl_get_coex_type(mvm, vif) == BT_COEX_LOOSE_LUT)
ret = iwl_mvm_bt_coex_reduced_txp(mvm,
mvmvif->deflink.ap_sta_id,
@@ -639,10 +633,6 @@ bool iwl_mvm_bt_coex_is_mimo_allowed(struct iwl_mvm *mvm,
bool iwl_mvm_bt_coex_is_ant_avail(struct iwl_mvm *mvm, u8 ant)
{
- /* there is no other antenna, shared antenna is always available */
- if (mvm->cfg->bt_shared_single_ant)
- return true;
-
if (ant & mvm->cfg->non_shared_ant)
return true;
@@ -652,10 +642,6 @@ bool iwl_mvm_bt_coex_is_ant_avail(struct iwl_mvm *mvm, u8 ant)
bool iwl_mvm_bt_coex_is_shared_ant_avail(struct iwl_mvm *mvm)
{
- /* there is no other antenna, shared antenna is always available */
- if (mvm->cfg->bt_shared_single_ant)
- return true;
-
return le32_to_cpu(mvm->last_bt_notif.bt_activity_grading) < BT_HIGH_TRAFFIC;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 10/14] wifi: iwlwifi: Add rf_mapping of new wifi7 devices
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (8 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 09/14] wifi: iwlwifi: cleanup BT Shared Single Antenna code Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:58 ` [PATCH 11/14] wifi: iwlwifi: mvm: add US/Canada MCC to API Miri Korenblit
` (3 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Mukesh Sisodiya, Gregory Greenman
From: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Add the CSR register details for new wifi7 devices and
correctly set rf_name for devices with FM and WP radios.
Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-csr.h | 2 ++
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c | 10 ++++++++++
2 files changed, 12 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
index a4df67ff21ba..4511d7fb2279 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-csr.h
@@ -354,6 +354,8 @@ enum {
#define CSR_HW_RF_ID_TYPE_GF (0x0010D000)
#define CSR_HW_RF_ID_TYPE_GF4 (0x0010E000)
#define CSR_HW_RF_ID_TYPE_MS (0x00111000)
+#define CSR_HW_RF_ID_TYPE_FM (0x00112000)
+#define CSR_HW_RF_ID_TYPE_WP (0x00113000)
/* HW_RF CHIP STEP */
#define CSR_HW_RF_STEP(_val) (((_val) >> 8) & 0xF)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
index c9e5bda8f0b7..a4a4772330cf 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
@@ -290,6 +290,16 @@ static void iwl_pcie_get_rf_name(struct iwl_trans *trans)
case CSR_HW_RFID_TYPE(CSR_HW_RF_ID_TYPE_MS):
pos = scnprintf(buf, buflen, "MS");
break;
+ case CSR_HW_RFID_TYPE(CSR_HW_RF_ID_TYPE_FM):
+ pos = scnprintf(buf, buflen, "FM");
+ break;
+ case CSR_HW_RFID_TYPE(CSR_HW_RF_ID_TYPE_WP):
+ if (SILICON_Z_STEP ==
+ CSR_HW_RFID_STEP(trans->hw_rf_id))
+ pos = scnprintf(buf, buflen, "WHTC");
+ else
+ pos = scnprintf(buf, buflen, "WH");
+ break;
default:
return;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 11/14] wifi: iwlwifi: mvm: add US/Canada MCC to API
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (9 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 10/14] wifi: iwlwifi: Add rf_mapping of new wifi7 devices Miri Korenblit
@ 2023-12-19 19:58 ` Miri Korenblit
2023-12-19 19:59 ` [PATCH 12/14] wifi: iwlwifi: mvm: disallow puncturing in US/Canada Miri Korenblit
` (2 subsequent siblings)
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:58 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman
From: Johannes Berg <johannes.berg@intel.com>
We don't want to duplicate the definitions later,
so add them to the API.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 3 +++
drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 7 ++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
index dfe0bebabc81..7ec959244ffc 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
@@ -269,6 +269,9 @@ struct iwl_nvm_access_complete_cmd {
__le32 reserved;
} __packed; /* NVM_ACCESS_COMPLETE_CMD_API_S_VER_1 */
+#define IWL_MCC_US 0x5553
+#define IWL_MCC_CANADA 0x4341
+
/**
* struct iwl_mcc_update_cmd - Request the device to update geographic
* regulatory profile according to the given MCC (Mobile Country Code).
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 403bd17b8b7a..1252084662c6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -27,9 +27,6 @@
#define MVM_UCODE_ALIVE_TIMEOUT (2 * HZ)
#define MVM_UCODE_CALIB_TIMEOUT (2 * HZ)
-#define IWL_TAS_US_MCC 0x5553
-#define IWL_TAS_CANADA_MCC 0x4341
-
#define IWL_UATS_VLP_AP_SUPPORTED BIT(29)
#define IWL_UATS_AFC_AP_SUPPORTED BIT(30)
@@ -1234,10 +1231,10 @@ static void iwl_mvm_tas_init(struct iwl_mvm *mvm)
dmi_get_system_info(DMI_SYS_VENDOR));
if ((!iwl_mvm_add_to_tas_block_list(cmd.v4.block_list_array,
&cmd.v4.block_list_size,
- IWL_TAS_US_MCC)) ||
+ IWL_MCC_US)) ||
(!iwl_mvm_add_to_tas_block_list(cmd.v4.block_list_array,
&cmd.v4.block_list_size,
- IWL_TAS_CANADA_MCC))) {
+ IWL_MCC_CANADA))) {
IWL_DEBUG_RADIO(mvm,
"Unable to add US/Canada to TAS block list, disabling TAS\n");
return;
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 12/14] wifi: iwlwifi: mvm: disallow puncturing in US/Canada
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (10 preceding siblings ...)
2023-12-19 19:58 ` [PATCH 11/14] wifi: iwlwifi: mvm: add US/Canada MCC to API Miri Korenblit
@ 2023-12-19 19:59 ` Miri Korenblit
2023-12-19 19:59 ` [PATCH 13/14] wifi: iwlwifi: mvm: use the new command to clear the internal buffer Miri Korenblit
2023-12-19 19:59 ` [PATCH 14/14] wifi: iwlwifi: replace ENOTSUPP with EOPNOTSUPP Miri Korenblit
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:59 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman
From: Johannes Berg <johannes.berg@intel.com>
For now, this isn't allowed. The API to mac80211 isn't great
for this, but we need to change the API to move puncturing
into the chanctx/chandef, and will do it better then.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 06de4dc2a915..5276df717ca1 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -152,6 +152,16 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy,
mvm->lar_regdom_set = true;
mvm->mcc_src = src_id;
+ /* Some kind of regulatory mess means we need to currently disallow
+ * puncturing in the US and Canada. Do that here, at least until we
+ * figure out the new chanctx APIs for puncturing.
+ */
+ if (resp->mcc == cpu_to_le16(IWL_MCC_US) ||
+ resp->mcc == cpu_to_le16(IWL_MCC_CANADA))
+ ieee80211_hw_set(mvm->hw, DISALLOW_PUNCTURING);
+ else
+ __clear_bit(IEEE80211_HW_DISALLOW_PUNCTURING, mvm->hw->flags);
+
iwl_mei_set_country_code(__le16_to_cpu(resp->mcc));
out:
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 13/14] wifi: iwlwifi: mvm: use the new command to clear the internal buffer
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (11 preceding siblings ...)
2023-12-19 19:59 ` [PATCH 12/14] wifi: iwlwifi: mvm: disallow puncturing in US/Canada Miri Korenblit
@ 2023-12-19 19:59 ` Miri Korenblit
2023-12-19 19:59 ` [PATCH 14/14] wifi: iwlwifi: replace ENOTSUPP with EOPNOTSUPP Miri Korenblit
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:59 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach, Gregory Greenman
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
The firmware can allow to clear the internal debug buffer. This can be
used to sanitize the data when requested to.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/fw/api/debug.h | 6 ++++++
drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 9 +++++++++
drivers/net/wireless/intel/iwlwifi/fw/file.h | 4 ++++
3 files changed, 19 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
index 7b18e098b125..798731ecbefd 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h
@@ -59,6 +59,12 @@ enum iwl_debug_cmds {
* &struct iwl_dbg_dump_complete_cmd
*/
FW_DUMP_COMPLETE_CMD = 0xB,
+ /**
+ * @FW_CLEAR_BUFFER:
+ * clears the firmware's internal buffer
+ * no payload
+ */
+ FW_CLEAR_BUFFER = 0xD,
/**
* @MFU_ASSERT_DUMP_NTF:
* &struct iwl_mfu_assert_dump_notif
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index f6e399d1e95c..e27774e7ed74 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -3401,6 +3401,15 @@ void iwl_fw_dbg_clear_monitor_buf(struct iwl_fw_runtime *fwrt)
struct iwl_fw_dbg_params params = {0};
iwl_fw_dbg_stop_sync(fwrt);
+
+ if (fw_has_api(&fwrt->fw->ucode_capa,
+ IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR)) {
+ struct iwl_host_cmd hcmd = {
+ .id = WIDE_ID(DEBUG_GROUP, FW_CLEAR_BUFFER),
+ };
+ iwl_trans_send_cmd(fwrt->trans, &hcmd);
+ }
+
iwl_dbg_tlv_init_cfg(fwrt);
iwl_fw_dbg_stop_restart_recording(fwrt, ¶ms, false);
}
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index c38e5194c55f..bfc39bd5bbc6 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -245,6 +245,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
* SCAN_CONFIG_DB_CMD_API_S.
* @IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX: Firmware offloaded the station disable tx
* logic.
+ * @IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR: Firmware supports clearing the debug
+ * internal buffer
*
* @NUM_IWL_UCODE_TLV_API: number of bits used
*/
@@ -282,7 +284,9 @@ enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_ADWELL_HB_DEF_N_AP = (__force iwl_ucode_tlv_api_t)57,
IWL_UCODE_TLV_API_SCAN_EXT_CHAN_VER = (__force iwl_ucode_tlv_api_t)58,
IWL_UCODE_TLV_API_BAND_IN_RX_DATA = (__force iwl_ucode_tlv_api_t)59,
+ /* API Set 2 */
IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX = (__force iwl_ucode_tlv_api_t)66,
+ IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR = (__force iwl_ucode_tlv_api_t)67,
NUM_IWL_UCODE_TLV_API
/*
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread* [PATCH 14/14] wifi: iwlwifi: replace ENOTSUPP with EOPNOTSUPP
2023-12-19 19:58 [PATCH 00/14] wifi: iwlwifi: updates - 2023-12-06 Miri Korenblit
` (12 preceding siblings ...)
2023-12-19 19:59 ` [PATCH 13/14] wifi: iwlwifi: mvm: use the new command to clear the internal buffer Miri Korenblit
@ 2023-12-19 19:59 ` Miri Korenblit
13 siblings, 0 replies; 18+ messages in thread
From: Miri Korenblit @ 2023-12-19 19:59 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Andrei Otcheretianski, Gregory Greenman
From: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
ENOTSUPP isn't a standard error code, don't use it. Replace with
EOPNOTSUPP instead.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 8 ++++----
drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c | 8 ++++----
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 ++--
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
index ef7dc0a7b56c..5789a8735976 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
@@ -1316,7 +1316,7 @@ iwl_trans_get_rxq_dma_data(struct iwl_trans *trans, int queue,
struct iwl_trans_rxq_dma_data *data)
{
if (WARN_ON_ONCE(!trans->ops->rxq_dma_data))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
return trans->ops->rxq_dma_data(trans, queue, data);
}
@@ -1338,7 +1338,7 @@ iwl_trans_txq_alloc(struct iwl_trans *trans,
might_sleep();
if (WARN_ON_ONCE(!trans->ops->txq_alloc))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) {
IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state);
@@ -1404,7 +1404,7 @@ static inline int iwl_trans_wait_tx_queues_empty(struct iwl_trans *trans,
u32 txqs)
{
if (WARN_ON_ONCE(!trans->ops->wait_tx_queues_empty))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
/* No need to wait if the firmware is not alive */
if (trans->state != IWL_TRANS_FW_ALIVE) {
@@ -1418,7 +1418,7 @@ static inline int iwl_trans_wait_tx_queues_empty(struct iwl_trans *trans,
static inline int iwl_trans_wait_txq_empty(struct iwl_trans *trans, int queue)
{
if (WARN_ON_ONCE(!trans->ops->wait_txq_empty))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
if (WARN_ON_ONCE(trans->state != IWL_TRANS_FW_ALIVE)) {
IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
index 16a104de8371..edc8204f7c0e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
@@ -1521,7 +1521,7 @@ static ssize_t iwl_dbgfs_inject_packet_write(struct iwl_mvm *mvm,
/* supporting only MQ RX */
if (!mvm->trans->trans_cfg->mq_rx_supported)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
rxb._page = alloc_pages(GFP_ATOMIC, 0);
if (!rxb._page)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
index 10b9219b3bfd..8f10590f9cdd 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
@@ -39,7 +39,7 @@ static int iwl_mvm_ftm_responder_set_bw_v1(struct cfg80211_chan_def *chandef,
*ctrl_ch_position = iwl_mvm_get_ctrl_pos(chandef);
break;
default:
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
return 0;
@@ -77,7 +77,7 @@ static int iwl_mvm_ftm_responder_set_bw_v2(struct cfg80211_chan_def *chandef,
}
fallthrough;
default:
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
return 0;
@@ -291,7 +291,7 @@ iwl_mvm_ftm_responder_dyn_cfg_cmd(struct iwl_mvm *mvm,
default:
IWL_ERR(mvm, "Unsupported DYN_CONFIG_CMD version %u\n",
cmd_ver);
- ret = -ENOTSUPP;
+ ret = -EOPNOTSUPP;
}
return ret;
@@ -333,7 +333,7 @@ int iwl_mvm_ftm_respoder_add_pasn_sta(struct iwl_mvm *mvm,
if (cmd_ver < 3) {
IWL_ERR(mvm, "Adding PASN station not supported by FW\n");
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
}
if ((!hltk || !hltk_len) && (!tk || !tk_len)) {
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 5276df717ca1..7f13dff04b26 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -298,7 +298,7 @@ int iwl_mvm_op_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)
/* This has been tested on those devices only */
if (mvm->trans->trans_cfg->device_family != IWL_DEVICE_FAMILY_9000 &&
mvm->trans->trans_cfg->device_family != IWL_DEVICE_FAMILY_22000)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
if (!mvm->nvm_data)
return -EBUSY;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index efe3e111ea0a..2a3ca9785974 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -2550,7 +2550,7 @@ int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
if (WARN_ON(vif->type != NL80211_IFTYPE_AP &&
vif->type != NL80211_IFTYPE_ADHOC))
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
/*
* In IBSS, ieee80211_check_queues() sets the cab_queue to be
@@ -3234,7 +3234,7 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
* should be updated as well.
*/
if (buf_size < IWL_FRAME_LIMIT)
- return -ENOTSUPP;
+ return -EOPNOTSUPP;
ret = iwl_mvm_sta_tx_agg(mvm, sta, tid, queue, true);
if (ret)
--
2.34.1
^ permalink raw reply related [flat|nested] 18+ messages in thread