Skip to contentSkip to conversation

wifi: iwlwifi: updates intended for v6.5 2023-06-15

PATCH New [email protected] 1 participant 6 messages Jun 15, 2023 Intel wireless wifi link (iwlwifi)

lore
Share & tools
lore
#0 lore raw

cover wifi: iwlwifi: updates intended for v6.5 2023-06-15

From: Gregory Greenman <[email protected]>

Hi,

This patch set includes iwlwifi patches intended for v6.5.

It contains the continuation of MLO work and bumping FW API to 81.

It depends on the previous patch sets I've sent for v6.5.

Thanks,
Gregory

Gregory Greenman (1):
wifi: iwlwifi: bump FW API to 81 for AX devices

Ilan Peer (2):
wifi: iwlwifi: mvm: Don't access vif valid links directly
wifi: iwlwifi: mvm: Add support for SCAN API version 16

Miri Korenblit (2):
wifi: iwlwifi: fix max number of fw active links
wifi: iwlwifi: handle eSR transitions

 .../net/wireless/intel/iwlwifi/cfg/22000.c    |   4 +-
 .../net/wireless/intel/iwlwifi/fw/api/scan.h  |  23 +--
 drivers/net/wireless/intel/iwlwifi/mvm/link.c |  25 +--
 .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c |   2 +-
 .../net/wireless/intel/iwlwifi/mvm/mld-key.c  |   2 +-
 .../net/wireless/intel/iwlwifi/mvm/mld-mac.c  |   4 +-
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 150 +++++++++++++++---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  32 ++++
 .../net/wireless/intel/iwlwifi/mvm/phy-ctxt.c |  13 +-
 drivers/net/wireless/intel/iwlwifi/mvm/scan.c |  46 ++++--
 .../net/wireless/intel/iwlwifi/mvm/utils.c    |   6 +-
 11 files changed, 229 insertions(+), 78 deletions(-)
Signature · 1 line
2.38.1
#1 lore raw

PATCH 1/5 wifi: iwlwifi: fix max number of fw active links

From: Miri Korenblit <[email protected]>

The max active links that are supported by the FW is hard coded. This is wrong since this value is HW-dependent. Fix this by determining according to the actual HW.

Also remove a redundant check that the number of active links doesn't exceeds the maximum.

---
 drivers/net/wireless/intel/iwlwifi/mvm/link.c | 18 ---------------
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c |  6 ++---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  | 22 +++++++++++++++++++
 3 files changed, 24 insertions(+), 22 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/link.c +0 -18
index 563396dfd3cd..69ebd844de2a 100644
@@ -118,24 +118,6 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 		if (!link_info->phy_ctxt)
 			return 0;
 
-		/* check there aren't too many active links */
-		if (!link_info->active && active) {
-			int i, count = 0;
-
-			/* link with phy_ctxt is active in FW */
-			for_each_mvm_vif_valid_link(mvmvif, i)
-				if (mvmvif->link[i]->phy_ctxt)
-					count++;
-
-			if (vif->type == NL80211_IFTYPE_AP) {
-				if (count > mvm->fw->ucode_capa.num_beacons)
-					return -EOPNOTSUPP;
-			/* this should be per HW or such */
-			} else if (count >= IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM) {
-				return -EOPNOTSUPP;
-			}
-		}
-
 		/* Catch early if driver tries to activate or deactivate a link
 		 * twice.
 		 */
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +2 -4
index 8cd03357ce79..37b5b7f1f153 100644
@@ -900,9 +900,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
 	u16 added = new_links & ~old_links;
 	int err, i;
 
-	if (hweight16(new_links) > 2) {
-		return -EOPNOTSUPP;
-	} else if (hweight16(new_links) > 1) {
+	if (hweight16(new_links) > 1) {
 		unsigned int n_active = 0;
 
 		for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
@@ -917,7 +915,7 @@ iwl_mvm_mld_change_vif_links(struct ieee80211_hw *hw,
 		if (vif->type == NL80211_IFTYPE_AP) {
 			if (n_active > mvm->fw->ucode_capa.num_beacons)
 				return -EOPNOTSUPP;
-		} else if (n_active > 1) {
+		} else if (n_active > iwl_mvm_max_active_links(mvm)) {
 			return -EOPNOTSUPP;
 		}
 	}
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +22 -0
index de7aa4713c93..35cf0015b362 100644
@@ -1544,6 +1544,28 @@ static inline bool iwl_mvm_is_ctdp_supported(struct iwl_mvm *mvm)
 			   IWL_UCODE_TLV_CAPA_CTDP_SUPPORT);
 }
 
+static inline bool iwl_mvm_is_esr_supported(struct iwl_trans *trans)
+{
+	if ((CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM) &&
+	    !CSR_HW_RFID_IS_CDB(trans->hw_rf_id))
+		/* Step A doesn't support eSR */
+		return CSR_HW_RFID_STEP(trans->hw_rf_id);
+
+	return false;
+}
+
+static inline int iwl_mvm_max_active_links(struct iwl_mvm *mvm)
+{
+	struct iwl_trans *trans = mvm->fwrt.trans;
+
+	if (iwl_mvm_is_esr_supported(trans) ||
+	    (CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM &&
+	     CSR_HW_RFID_IS_CDB(trans->hw_rf_id)))
+		return IWL_MVM_FW_MAX_ACTIVE_LINKS_NUM;
+
+	return 1;
+}
+
 extern const u8 iwl_mvm_ac_to_tx_fifo[];
 extern const u8 iwl_mvm_ac_to_gen2_tx_fifo[];
 
Signature · 1 line
2.38.1
#2 lore raw

PATCH 2/5 wifi: iwlwifi: handle eSR transitions

In reply to [email protected]

From: Miri Korenblit <[email protected]>

There several transitions to handle in eSR mode:
* SMPS should be disabled when in eSR mode
* indicate to the fw whether the new added link should use the listen lmac or the main lmac
* RLC is offloaded when in eSR mode; adjust RLC command accordingly

---
 drivers/net/wireless/intel/iwlwifi/mvm/link.c |   7 +-
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 150 +++++++++++++++---
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  12 +-
 .../net/wireless/intel/iwlwifi/mvm/phy-ctxt.c |  13 +-
 .../net/wireless/intel/iwlwifi/mvm/utils.c    |   6 +-
 5 files changed, 155 insertions(+), 33 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/link.c +3 -4
index 69ebd844de2a..5fdebb911f7b 100644
@@ -89,6 +89,8 @@ int iwl_mvm_add_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	if (vif->type == NL80211_IFTYPE_ADHOC && link_conf->bssid)
 		memcpy(cmd.ibss_bssid_addr, link_conf->bssid, ETH_ALEN);
 
+	cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac);
+
 	return iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_ADD);
 }
 
@@ -149,10 +151,6 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	if (vif->type == NL80211_IFTYPE_ADHOC && link_conf->bssid)
 		memcpy(cmd.ibss_bssid_addr, link_conf->bssid, ETH_ALEN);
 
-	/* TODO: set a value to cmd.listen_lmac when system requiremens
-	 * will define it
-	 */
-
 	iwl_mvm_set_fw_basic_rates(mvm, vif, link_conf,
 				   &cmd.cck_rates, &cmd.ofdm_rates);
 
@@ -228,6 +226,7 @@ int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	cmd.flags = cpu_to_le32(flags);
 	cmd.flags_mask = cpu_to_le32(flags_mask);
 	cmd.spec_link_id = link_conf->link_id;
+	cmd.listen_lmac = cpu_to_le32(link_info->listen_lmac);
 
 	ret = iwl_mvm_link_cmd_send(mvm, &cmd, FW_CTXT_ACTION_MODIFY);
 	if (!ret && (changes & LINK_CONTEXT_MODIFY_ACTIVE))
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +128 -22

216 lines not on this page · raw message

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +11 -1
index 35cf0015b362..11de81b58515 100644
@@ -104,6 +104,7 @@ struct iwl_mvm_phy_ctxt {
 
 	/* track for RLC config command */
 	u32 center_freq1;
+	bool rlc_disabled;
 };
 
 struct iwl_mvm_time_event_data {
@@ -301,6 +302,7 @@ struct iwl_probe_resp_data {
  * @queue_params: QoS params for this MAC
  * @mgmt_queue: queue number for unbufferable management frames
  * @igtk: the current IGTK programmed into the firmware
+ * @listen_lmac: indicates this link is allocated to the listen LMAC
  */
 struct iwl_mvm_vif_link_info {
 	u8 bssid[ETH_ALEN];
@@ -322,6 +324,7 @@ struct iwl_mvm_vif_link_info {
 
 	bool he_ru_2mhz_block;
 	bool active;
+	bool listen_lmac;
 
 	u16 cab_queue;
 	/* Assigned while mac80211 has the link in a channel context,
@@ -373,6 +376,7 @@ struct iwl_mvm_vif {
 	bool ap_ibss_active;
 	bool pm_enabled;
 	bool monitor_active;
+	bool esr_active;
 
 	u8 low_latency: 6;
 	u8 low_latency_actual: 1;
@@ -1554,10 +1558,14 @@ static inline bool iwl_mvm_is_esr_supported(struct iwl_trans *trans)
 	return false;
 }
 
-static inline int iwl_mvm_max_active_links(struct iwl_mvm *mvm)
+static inline int iwl_mvm_max_active_links(struct iwl_mvm *mvm,
+					   struct ieee80211_vif *vif)
 {
 	struct iwl_trans *trans = mvm->fwrt.trans;
 
+	if (vif->type == NL80211_IFTYPE_AP)
+		return mvm->fw->ucode_capa.num_beacons;
+
 	if (iwl_mvm_is_esr_supported(trans) ||
 	    (CSR_HW_RFID_TYPE(trans->hw_rf_id) == IWL_CFG_RF_TYPE_FM &&
 	     CSR_HW_RFID_IS_CDB(trans->hw_rf_id)))
@@ -1777,6 +1785,8 @@ void iwl_mvm_phy_ctxt_unref(struct iwl_mvm *mvm,
 int iwl_mvm_phy_ctx_count(struct iwl_mvm *mvm);
 u8 iwl_mvm_get_channel_width(struct cfg80211_chan_def *chandef);
 u8 iwl_mvm_get_ctrl_pos(struct cfg80211_chan_def *chandef);
+int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
+			 u8 chains_static, u8 chains_dynamic);
 
 /* MAC (virtual interface) programming */
 
drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c +8 -5
index 55541e90770a..a5b432bc9e2f 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2017 Intel Deutschland GmbH
  */
@@ -163,15 +163,18 @@ static void iwl_mvm_phy_ctxt_cmd_data(struct iwl_mvm *mvm,
 					     chains_static, chains_dynamic);
 }
 
-static int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm,
-				struct iwl_mvm_phy_ctxt *ctxt,
-				u8 chains_static, u8 chains_dynamic)
+int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt,
+			 u8 chains_static, u8 chains_dynamic)
 {
 	struct iwl_rlc_config_cmd cmd = {
 		.phy_id = cpu_to_le32(ctxt->id),
 	};
 
-	if (iwl_fw_lookup_cmd_ver(mvm->fw, WIDE_ID(DATA_PATH_GROUP, RLC_CONFIG_CMD), 0) < 2)
+	if (ctxt->rlc_disabled)
+		return 0;
+
+	if (iwl_fw_lookup_cmd_ver(mvm->fw, WIDE_ID(DATA_PATH_GROUP,
+						   RLC_CONFIG_CMD), 0) < 2)
 		return 0;
 
 	BUILD_BUG_ON(IWL_RLC_CHAIN_INFO_DRIVER_FORCE !=
drivers/net/wireless/intel/iwlwifi/mvm/utils.c +5 -1
index 2a10d851d2e4..48016b4343d2 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
  */
@@ -312,6 +312,10 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			smps_mode = IEEE80211_SMPS_DYNAMIC;
 	}
 
+	/* SMPS is disabled in eSR */
+	if (mvmvif->esr_active)
+		smps_mode = IEEE80211_SMPS_OFF;
+
 	ieee80211_request_smps(vif, link_id, smps_mode);
 }
 
Signature · 1 line
2.38.1
#3 lore raw

PATCH 3/5 wifi: iwlwifi: mvm: Don't access vif valid links directly

In reply to [email protected]

From: Ilan Peer <[email protected]>

And instead use the vif getter functions, as a preparation for supporting disabled/dormant links.

---
 drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c  | 2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +1 -1
index a2583d045525..b8143ae8b403 100644
@@ -893,7 +893,7 @@ u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct iwl_mvm *mvm,
 	u8 rate;
 	u32 i;
 
-	if (link_id == IEEE80211_LINK_UNSPECIFIED && vif->valid_links) {
+	if (link_id == IEEE80211_LINK_UNSPECIFIED && ieee80211_vif_is_mld(vif)) {
 		for (i = 0; i < ARRAY_SIZE(mvmvif->link); i++) {
 			if (!mvmvif->link[i])
 				continue;
drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +1 -1
index b27f6a70f8d1..2c9f2f71b083 100644
@@ -42,7 +42,7 @@ static u32 iwl_mvm_get_sec_sta_mask(struct iwl_mvm *mvm,
 	 * Of course the same can be done during add as well, but we must do
 	 * it during remove, since we don't have the mvmvif->ap_sta pointer.
 	 */
-	if (!sta && (keyconf->link_id >= 0 || !vif->valid_links))
+	if (!sta && (keyconf->link_id >= 0 || !ieee80211_vif_is_mld(vif)))
 		return BIT(link_info->ap_sta_id);
 
 	/* STA should be non-NULL now, but iwl_mvm_sta_fw_id_mask() checks */
drivers/net/wireless/intel/iwlwifi/mvm/mld-mac.c +2 -2
index 0ff99deb0ae7..f313a8d771e4 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2022 Intel Corporation
+ * Copyright (C) 2022 - 2023 Intel Corporation
  */
 #include "mvm.h"
 
@@ -50,7 +50,7 @@ static void iwl_mvm_mld_mac_ctxt_cmd_common(struct iwl_mvm *mvm,
 	 * the association response successfully, so just skip all that
 	 * and enable both when we have MLO.
 	 */
-	if (vif->valid_links) {
+	if (ieee80211_vif_is_mld(vif)) {
 		iwl_mvm_mld_set_he_support(mvm, vif, cmd);
 		cmd->eht_support = cpu_to_le32(1);
 		return;
Signature · 1 line
2.38.1
#4 lore raw

PATCH 4/5 wifi: iwlwifi: mvm: Add support for SCAN API version 16

In reply to [email protected]

From: Ilan Peer <[email protected]>

Scan API version 16 use link ID for reporting the TSF of scan results (instead of MAC ID used in previous versions).

---
 .../net/wireless/intel/iwlwifi/fw/api/scan.h  | 23 +++++-----
 drivers/net/wireless/intel/iwlwifi/mvm/scan.c | 46 +++++++++++++++----
 2 files changed, 48 insertions(+), 21 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/scan.h +12 -11
index ec96ba053a5c..9cbeef16cfe5 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2012-2014, 2018-2022 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -1003,7 +1003,8 @@ struct iwl_scan_channel_params_v6 {
  * struct iwl_scan_general_params_v11
  * @flags: &enum iwl_umac_scan_general_flags_v2
  * @reserved: reserved for future
- * @scan_start_mac_id: report the scan start TSF time according to this mac TSF
+ * @scan_start_mac_or_link_id: report the scan start TSF time according to this
+ *     mac (up to verion 11) or link (starting with version 12) TSF
  * @active_dwell: dwell time for active scan per LMAC
  * @adwell_default_2g: adaptive dwell default number of APs
  *                        for 2.4GHz channel
@@ -1026,7 +1027,7 @@ struct iwl_scan_channel_params_v6 {
 struct iwl_scan_general_params_v11 {
 	__le16 flags;
 	u8 reserved;
-	u8 scan_start_mac_id;
+	u8 scan_start_mac_or_link_id;
 	u8 active_dwell[SCAN_TWO_LMACS];
 	u8 adwell_default_2g;
 	u8 adwell_default_5g;
@@ -1038,7 +1039,7 @@ struct iwl_scan_general_params_v11 {
 	__le32 scan_priority;
 	u8 passive_dwell[SCAN_TWO_LMACS];
 	u8 num_of_fragments[SCAN_TWO_LMACS];
-} __packed; /* SCAN_GENERAL_PARAMS_API_S_VER_11 and *_VER_10 */
+} __packed; /* SCAN_GENERAL_PARAMS_API_S_VER_12, *_VER_11  and *_VER_10 */
 
 /**
  * struct iwl_scan_periodic_parms_v1
@@ -1067,18 +1068,18 @@ struct iwl_scan_req_params_v12 {
 } __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_12 */
 
 /**
- * struct iwl_scan_req_params_v15
+ * struct iwl_scan_req_params_v16
  * @general_params: &struct iwl_scan_general_params_v11
  * @channel_params: &struct iwl_scan_channel_params_v6
  * @periodic_params: &struct iwl_scan_periodic_parms_v1
  * @probe_params: &struct iwl_scan_probe_params_v4
  */
-struct iwl_scan_req_params_v15 {
+struct iwl_scan_req_params_v16 {
 	struct iwl_scan_general_params_v11 general_params;
 	struct iwl_scan_channel_params_v6 channel_params;
 	struct iwl_scan_periodic_parms_v1 periodic_params;
 	struct iwl_scan_probe_params_v4 probe_params;
-} __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_15 and *_VER_14 */
+} __packed; /* SCAN_REQUEST_PARAMS_API_S_VER_16, *_VER_15 and *_VER_14 */
 
 /**
  * struct iwl_scan_req_umac_v12
@@ -1093,16 +1094,16 @@ struct iwl_scan_req_umac_v12 {
 } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_12 */
 
 /**
- * struct iwl_scan_req_umac_v15
+ * struct iwl_scan_req_umac_v16
  * @uid: scan id, &enum iwl_umac_scan_uid_offsets
  * @ooc_priority: out of channel priority - &enum iwl_scan_priority
  * @scan_params: scan parameters
  */
-struct iwl_scan_req_umac_v15 {
+struct iwl_scan_req_umac_v16 {
 	__le32 uid;
 	__le32 ooc_priority;
-	struct iwl_scan_req_params_v15 scan_params;
-} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_15 and *_VER_14 */
+	struct iwl_scan_req_params_v16 scan_params;
+} __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_16, *_VER_15 and *_VER_14 */
 
 /**
  * struct iwl_umac_scan_abort
drivers/net/wireless/intel/iwlwifi/mvm/scan.c +36 -10

99 lines not on this page · raw message

Signature · 1 line
2.38.1
#5 lore raw

PATCH 5/5 wifi: iwlwifi: bump FW API to 81 for AX devices

In reply to [email protected]

From: Gregory Greenman <[email protected]>

Start supporting API version 81 for AX devices.

---
 drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c +2 -2
index 29dded1531a0..5ac9416331de 100644
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2022 Intel Corporation
+ * Copyright (C) 2018-2023 Intel Corporation
  */
 #include <linux/module.h>
 #include <linux/stringify.h>
@@ -10,7 +10,7 @@
 #include "fw/api/txq.h"
 
 /* Highest firmware API version supported */
-#define IWL_22000_UCODE_API_MAX	79
+#define IWL_22000_UCODE_API_MAX	81
 #define IWL_22500_UCODE_API_MAX	77
 
 /* Lowest firmware API version supported */
Signature · 1 line
2.38.1