From patchwork Thu Dec 26 15:44:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854633 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F54D1EEE9 for ; Thu, 26 Dec 2024 15:45:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227919; cv=none; b=qDYslkvoXDKnH/D/qoZuuLsIK38yTy44+G39dUsn9KbSbV2BLKr3mI7ym1006GzGa8xg0QJg/W3oPgB705bZDVa7nseNrZsbKcC+0XHXEcN/+0BK0OwpRv9I2sdjZx03ZM3Fm9QAGQYAkpdb0LIsDZDCCVQzKNIU+Vrhls5bliU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227919; c=relaxed/simple; bh=/m7FfTK+fae122oakqDPoISKqDM1EJw5PK+MO5HEcfg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ut3qaV3H9TK/yHAkSYtsehQtr35IjRTfjhyFDLpZXe3k5LqmTAGw1NC7F0a2ZV+6PLsIWNi2D68/HcbzSJrCQMdXPRzDrcEgToMYUNNyPay2KHZlAbi0RHaEhsi5Pd/EiUO6GIb2mSlHcn6tuDZmLFMjJOFeur9IqmhZq2aGlB8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Go6yy8F+; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Go6yy8F+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227917; x=1766763917; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/m7FfTK+fae122oakqDPoISKqDM1EJw5PK+MO5HEcfg=; b=Go6yy8F+SJT06e9FQd9Rjawm5VQceC1E7PelLZvjdmimRhvOWLvlQmBQ 0a6GqfmTAGJIcITZjULvZ+5HWSx3XZKVeV5TBSAZAYK+fixDjQbFiCbuL H86VL6JIjp8ktJzmeWLslw3cxa/XglYe4imKAm0tQ0nNd5u6nESvQWk9Y cqiZ4YDcxfG1ltFmPWTwmcIe86zZvOt3MRr3LdZeznYkuAJOpSVWSUscQ gGAFlHZ+wj6rkBlfmvdKhFxxLvcnt6PsINMa/LYKnsxGpahS9L6Nl/+Em 92GlchwxXy/MnVwiS7W+8CWVHXsuKTclSul0fsVy0mDIeDt/RPANY4Lr9 g==; X-CSE-ConnectionGUID: x2MDSIlzQ0my24oBUOBWGQ== X-CSE-MsgGUID: AtB97dv0TJeoc+7XTBRoNw== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878126" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878126" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:15 -0800 X-CSE-ConnectionGUID: 3P2Qk+HxT7yjZMs9/7oleg== X-CSE-MsgGUID: mjKk9T44R1C5DsA5WYTqbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777975" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:12 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Yedidya Benshimol Subject: [PATCH 01/15] wifi: iwlwifi: remove mvm from session protection cmd's name Date: Thu, 26 Dec 2024 17:44:42 +0200 Message-Id: <20241226174257.0cd9ae2499b6.If228310b0578e5da88ccb28ff8dceb56e1c61b27@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Yedidya Benshimol As the session protection command will be used in mld, it shouldn't be associated by name to mvm Signed-off-by: Yedidya Benshimol --- .../net/wireless/intel/iwlwifi/fw/api/mac-cfg.h | 2 +- .../wireless/intel/iwlwifi/fw/api/time-event.h | 16 ++++++++-------- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +- .../net/wireless/intel/iwlwifi/mvm/time-event.c | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h index b23d5fc4bbe6..37bb7002c1c9 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h @@ -74,7 +74,7 @@ enum iwl_mac_conf_subcmd_ids { */ ROC_NOTIF = 0xF8, /** - * @SESSION_PROTECTION_NOTIF: &struct iwl_mvm_session_prot_notif + * @SESSION_PROTECTION_NOTIF: &struct iwl_session_prot_notif */ SESSION_PROTECTION_NOTIF = 0xFB, diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h b/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h index f4b827b58bd3..18d030334a6a 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/time-event.h @@ -395,7 +395,7 @@ struct iwl_roc_notif { } __packed; /* ROC_NOTIF_API_S_VER_1 */ /** - * enum iwl_mvm_session_prot_conf_id - session protection's configurations + * enum iwl_session_prot_conf_id - session protection's configurations * @SESSION_PROTECT_CONF_ASSOC: Start a session protection for association. * The firmware will allocate two events. * Valid for BSS_STA and P2P_STA. @@ -424,7 +424,7 @@ struct iwl_roc_notif { * be taken into account. * @SESSION_PROTECT_CONF_MAX_ID: not used */ -enum iwl_mvm_session_prot_conf_id { +enum iwl_session_prot_conf_id { SESSION_PROTECT_CONF_ASSOC, SESSION_PROTECT_CONF_GO_CLIENT_ASSOC, SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV, @@ -433,12 +433,12 @@ enum iwl_mvm_session_prot_conf_id { }; /* SESSION_PROTECTION_CONF_ID_E_VER_1 */ /** - * struct iwl_mvm_session_prot_cmd - configure a session protection + * struct iwl_session_prot_cmd - configure a session protection * @id_and_color: the id and color of the link (or mac, for command version 1) * for which this session protection is sent * @action: can be either FW_CTXT_ACTION_ADD or FW_CTXT_ACTION_REMOVE, * see &enum iwl_ctxt_action - * @conf_id: see &enum iwl_mvm_session_prot_conf_id + * @conf_id: see &enum iwl_session_prot_conf_id * @duration_tu: the duration of the whole protection in TUs. * @repetition_count: not used * @interval: not used @@ -448,7 +448,7 @@ enum iwl_mvm_session_prot_conf_id { * The firmware supports only one concurrent session protection per vif. * Adding a new session protection will remove any currently running session. */ -struct iwl_mvm_session_prot_cmd { +struct iwl_session_prot_cmd { /* COMMON_INDEX_HDR_API_S_VER_1 hdr */ __le32 id_and_color; __le32 action; @@ -462,17 +462,17 @@ struct iwl_mvm_session_prot_cmd { */ /** - * struct iwl_mvm_session_prot_notif - session protection started / ended + * struct iwl_session_prot_notif - session protection started / ended * @mac_link_id: the mac id (or link id, for notif ver > 2) for which the * session protection started / ended * @status: 1 means success, 0 means failure * @start: 1 means the session protection started, 0 means it ended - * @conf_id: see &enum iwl_mvm_session_prot_conf_id + * @conf_id: see &enum iwl_session_prot_conf_id * * Note that any session protection will always get two notifications: start * and end even the firmware could not schedule it. */ -struct iwl_mvm_session_prot_notif { +struct iwl_session_prot_notif { __le32 mac_link_id; __le32 status; __le32 start; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 30fcc733395e..0deaf6ed8994 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -408,7 +408,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { RX_HANDLER_SYNC, struct iwl_time_event_notif), RX_HANDLER_GRP(MAC_CONF_GROUP, SESSION_PROTECTION_NOTIF, iwl_mvm_rx_session_protect_notif, RX_HANDLER_SYNC, - struct iwl_mvm_session_prot_notif), + struct iwl_session_prot_notif), RX_HANDLER(MCC_CHUB_UPDATE_CMD, iwl_mvm_rx_chub_update_mcc, RX_HANDLER_ASYNC_LOCKED, struct iwl_mcc_chub_notif), diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c index 72fa7ac86516..9216c43a35c4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c @@ -751,7 +751,7 @@ static void iwl_mvm_cancel_session_protection(struct iwl_mvm *mvm, u32 id, s8 link_id) { int mac_link_id = iwl_mvm_get_session_prot_id(mvm, vif, link_id); - struct iwl_mvm_session_prot_cmd cmd = { + struct iwl_session_prot_cmd cmd = { .id_and_color = cpu_to_le32(mac_link_id), .action = cpu_to_le32(FW_CTXT_ACTION_REMOVE), .conf_id = cpu_to_le32(id), @@ -955,7 +955,7 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); - struct iwl_mvm_session_prot_notif *notif = (void *)pkt->data; + struct iwl_session_prot_notif *notif = (void *)pkt->data; unsigned int ver = iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, SESSION_PROTECTION_NOTIF, 2); @@ -1148,7 +1148,7 @@ iwl_mvm_start_p2p_roc_session_protection(struct iwl_mvm *mvm, enum ieee80211_roc_type type) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); - struct iwl_mvm_session_prot_cmd cmd = { + struct iwl_session_prot_cmd cmd = { .id_and_color = cpu_to_le32(iwl_mvm_get_session_prot_id(mvm, vif, 0)), .action = cpu_to_le32(FW_CTXT_ACTION_ADD), @@ -1417,7 +1417,7 @@ static bool iwl_mvm_session_prot_notif(struct iwl_notif_wait_data *notif_wait, { struct iwl_mvm *mvm = container_of(notif_wait, struct iwl_mvm, notif_wait); - struct iwl_mvm_session_prot_notif *resp; + struct iwl_session_prot_notif *resp; int resp_len = iwl_rx_packet_payload_len(pkt); if (WARN_ON(pkt->hdr.cmd != SESSION_PROTECTION_NOTIF || @@ -1449,7 +1449,7 @@ void iwl_mvm_schedule_session_protection(struct iwl_mvm *mvm, const u16 notif[] = { WIDE_ID(MAC_CONF_GROUP, SESSION_PROTECTION_NOTIF) }; struct iwl_notification_wait wait_notif; int mac_link_id = iwl_mvm_get_session_prot_id(mvm, vif, (s8)link_id); - struct iwl_mvm_session_prot_cmd cmd = { + struct iwl_session_prot_cmd cmd = { .id_and_color = cpu_to_le32(mac_link_id), .action = cpu_to_le32(FW_CTXT_ACTION_ADD), .conf_id = cpu_to_le32(SESSION_PROTECT_CONF_ASSOC), From patchwork Thu Dec 26 15:44:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853836 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F7E425760 for ; Thu, 26 Dec 2024 15:45:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227920; cv=none; b=o/LMMs464OFrIT0hyZj3V7/531GX33OjGTCxwvp8124iO+R9fDzipF4D8yCrQwwFbn7+d+Rz3W9azhlwqd1304cLPWKJ4b8s8AVA/Pp2+bLVH4gftI/xJJKu58JZ1KkmXY4E6sU7I9NBhpRDnDdd/rDQew/mnZI6BT4rZQZlaLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227920; c=relaxed/simple; bh=BK5ubLpyyBys6V6kJxqdZOGjV/+8nA00B/08+3U/+Bc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=I4mEDL3i4X6cc+1EWNo/MFzg+Gtz2bZgU6sXl2fmTMB09WWgboIURWLylzUPjaNV1IEy1/FeX8gplfMnVQmlAP7EUC3hkvrmGggkMcr9XBiMpKrpO4aQFtobwdrS0Wi+zbL9swBL+3keQCPgJseHgoiacS/SaabP7xymBeG0LD0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=hjy6EoBE; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hjy6EoBE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227918; x=1766763918; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BK5ubLpyyBys6V6kJxqdZOGjV/+8nA00B/08+3U/+Bc=; b=hjy6EoBElpQLNWRDn9f5yL9q5BezMzWMwk+mXIlbv9r9SAgQXTfvgIsj 90L2RTujbZjak6RFF5DICmgxn8k+TL7cdYPAdWmx2bAT3ChNmWpHxM22P KK00YRWjCLnVwQjmFI9Vjyhrsf5eqNspYkHG7hJXvDgT9NajEpyT+Ng6P zzzsIHG72/bvIT5H7W1NH17KQcOOMy76ifALbkOBE5QmTxD7N3vGkIEo0 zdg59yGzuhbX+m996tsjVrAVbEiZK26d9bsWi9NSd+ICVfHjUEkJcREl1 +5HavsAAAfQYVuwCNowWZuXadFKz0Q/g19RERWt25PavkBd4ZjPSljMzO g==; X-CSE-ConnectionGUID: J4/cv3xMSJyLRSZPvqBtBA== X-CSE-MsgGUID: RIBvPYWSTcqNJ7/mtQGteg== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878128" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878128" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:15 -0800 X-CSE-ConnectionGUID: Kc2c1/9ZRw68uBF+RMpQCQ== X-CSE-MsgGUID: v8NqzyVURl2Xg/evTizr6A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777978" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:14 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, "Somashekhar(Som)" Subject: [PATCH 02/15] wifi: mvm: Request periodic system statistics earlier Date: Thu, 26 Dec 2024 17:44:43 +0200 Message-Id: <20241226174257.4ca59fe0e060.Ic46280aad4dc7087a7d6d0773b86c255133cb7d6@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: "Somashekhar(Som)" Currently driver requests periodic statistics after entering EMLSR. This means that when not in EMLSR, link selection decisions will be done based on old statistics, from the association time. Request periodic statistics already at association instead, Signed-off-by: Somashekhar(Som) Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 4 ---- .../net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 15 ++++++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 07778d55878b..cd93fbf40eb6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -4113,10 +4113,6 @@ iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm, wiphy_work_cancel(mvm->hw->wiphy, &mvmvif->unblock_esr_tpt_wk); wiphy_delayed_work_cancel(mvm->hw->wiphy, &mvmvif->unblock_esr_tmp_non_bss_wk); - - /* No need for the periodic statistics anymore */ - if (ieee80211_vif_is_mld(vif) && mvmvif->esr_active) - iwl_mvm_request_periodic_system_statistics(mvm, false); } return 0; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index b807046144c0..cc54c33dcb02 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -267,9 +267,6 @@ static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm, else mvmvif->primary_link = __ffs(vif->active_links); - /* Needed for tracking RSSI */ - iwl_mvm_request_periodic_system_statistics(mvm, true); - /* * Restart the MPDU counters and the counting window, so when the * statistics arrive (which is where we look at the counters) we @@ -323,7 +320,6 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, ret = iwl_mvm_esr_mode_active(mvm, vif); if (ret) { IWL_ERR(mvm, "failed to activate ESR mode (%d)\n", ret); - iwl_mvm_request_periodic_system_statistics(mvm, false); goto out; } } @@ -449,8 +445,6 @@ static int iwl_mvm_esr_mode_inactive(struct iwl_mvm *mvm, break; } - iwl_mvm_request_periodic_system_statistics(mvm, false); - /* Start a new counting window */ iwl_mvm_restart_mpdu_count(mvm, mvmvif); @@ -881,8 +875,13 @@ static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm, if (vif->cfg.assoc) { mvmvif->session_prot_connection_loss = false; - /* clear statistics to get clean beacon counter */ + /* + * Clear statistics to get clean beacon counter, and ask for + * periodic statistics, as they are needed for link + * selection and RX OMI decisions. + */ iwl_mvm_request_statistics(mvm, true); + iwl_mvm_request_periodic_system_statistics(mvm, true); iwl_mvm_sf_update(mvm, vif, false); iwl_mvm_power_vif_assoc(mvm, vif); @@ -930,6 +929,8 @@ static void iwl_mvm_mld_vif_cfg_changed_station(struct iwl_mvm *mvm, } else if (iwl_mvm_mld_vif_have_valid_ap_sta(mvmvif)) { iwl_mvm_mei_host_disassociated(mvm); + iwl_mvm_request_periodic_system_statistics(mvm, false); + /* If update fails - SF might be running in associated * mode while disassociated - which is forbidden. */ From patchwork Thu Dec 26 15:44:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854632 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1704943AA8 for ; Thu, 26 Dec 2024 15:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227920; cv=none; b=go67PwwSsbkGGNqtyORo3hx7j8sL1pmQUZVPCTnVJTtwIpVlxd347jDySCCXz76HVem4cMEQtGL/+B1y3PFHFwdLfgS/oUaNyVgzxb25kLE2HX8yD2xAzRNqh7nlzeTjyZeEepvAjL015P/f9GX9J2B4RGNK2keS1IFy8ZvRi80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227920; c=relaxed/simple; bh=6sZwtlenXHLET9Vc0M9SeEDLGqTDF1iM9Swa5FXOWw8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u7rCXgiweoIa5SlNKMb6I2q5lnR9cXmdccRqZGU3qV0XguY7wqwsdFETIvnZA9Nk7vNbKLYq9wI9dK88ti7ntgE24nrbH4xNL4xtSgTZYG2PIFOyTNZSjiVV5ZVM4eXYyKnkpH6KkIY+vsJFsYldtSQ/bC7ErLgIRX+KeGa83K0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VGJ9pct+; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VGJ9pct+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227919; x=1766763919; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6sZwtlenXHLET9Vc0M9SeEDLGqTDF1iM9Swa5FXOWw8=; b=VGJ9pct+AhxP6mzqDjynWQnLzkffJtrmmogaZr7cmK8OJ6UIrXzwodP6 PkcHY/upRD7mjFp4WuzlMtKXaM1zDRm+sZ4JJlTt6TX2hl/vRS9JuB3Jp myWXdPS5dXIgpVpvrosHbunzkMAqq/bIfw1HturqiGCjEZbdxpCNzYXJ1 6nHH6IMi08ddMDAmnBNKU1YHtFInDOPmWgUF43eUSvwqoj7u/Cu3NDpyC KHqz1TLI+E2I2Z9eTGi80x7uSLn5cAsMUbIvjXOnBzEXvgLh/0+0l94pO /wU8b37rZvwILoSIS0fwuR9FQiLwI7ksN1iReIBnxlp69osqSWh/tX4qP A==; X-CSE-ConnectionGUID: KrVAXiBKQ6yjRFDr/RBv9Q== X-CSE-MsgGUID: Q25CVksrT/y5rkQKJwpy5A== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878131" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878131" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:16 -0800 X-CSE-ConnectionGUID: 2h/W//2fQvCCO9r64UmhUw== X-CSE-MsgGUID: I0lRJrs0TX6uADlyzRtXNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777982" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:15 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay , Emmanuel Grumbach Subject: [PATCH 03/15] wifi: iwlwifi: Remove mvm prefix from iwl_mvm_compressed_ba_notif Date: Thu, 26 Dec 2024 17:44:44 +0200 Message-Id: <20241226174257.9b35dfce796b.Ie61e17a488f6a34bcbe814dd89a138fe1f55585c@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Daniel Gabay This is not MVM specific. Signed-off-by: Daniel Gabay Reviewed-by: Emmanuel Grumbach --- .../wireless/intel/iwlwifi/fw/api/commands.h | 2 +- .../net/wireless/intel/iwlwifi/fw/api/tx.h | 20 +++++++++---------- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 5 ++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h index 2f40e69db318..34a1f97653c0 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h @@ -447,7 +447,7 @@ enum iwl_legacy_cmds { /** * @BA_NOTIF: - * BlockAck notification, uses &struct iwl_mvm_compressed_ba_notif + * BlockAck notification, uses &struct iwl_compressed_ba_notif * or &struct iwl_mvm_ba_notif depending on the HW */ BA_NOTIF = 0xc5, diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h index f3bf2e087a40..04b177b8ef30 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/tx.h @@ -638,14 +638,14 @@ struct iwl_mvm_ba_notif { } __packed; /** - * struct iwl_mvm_compressed_ba_tfd - progress of a TFD queue + * struct iwl_compressed_ba_tfd - progress of a TFD queue * @q_num: TFD queue number * @tfd_index: Index of first un-acked frame in the TFD queue * @scd_queue: For debug only - the physical queue the TFD queue is bound to * @tid: TID of the queue (0-7) * @reserved: reserved for alignment */ -struct iwl_mvm_compressed_ba_tfd { +struct iwl_compressed_ba_tfd { __le16 q_num; __le16 tfd_index; u8 scd_queue; @@ -654,12 +654,12 @@ struct iwl_mvm_compressed_ba_tfd { } __packed; /* COMPRESSED_BA_TFD_API_S_VER_1 */ /** - * struct iwl_mvm_compressed_ba_ratid - progress of a RA TID queue + * struct iwl_compressed_ba_ratid - progress of a RA TID queue * @q_num: RA TID queue number * @tid: TID of the queue * @ssn: BA window current SSN */ -struct iwl_mvm_compressed_ba_ratid { +struct iwl_compressed_ba_ratid { u8 q_num; u8 tid; __le16 ssn; @@ -685,7 +685,7 @@ enum iwl_mvm_ba_resp_flags { }; /** - * struct iwl_mvm_compressed_ba_notif - notifies about reception of BA + * struct iwl_compressed_ba_notif - notifies about reception of BA * ( BA_NOTIF = 0xc5 ) * @flags: status flag, see the &iwl_mvm_ba_resp_flags * @sta_id: Index of recipient (BA-sending) station in fw's station table @@ -704,12 +704,12 @@ enum iwl_mvm_ba_resp_flags { * @tx_rate: the rate the aggregation was sent at * @tfd_cnt: number of TFD-Q elements * @ra_tid_cnt: number of RATID-Q elements - * @tfd: array of TFD queue status updates. See &iwl_mvm_compressed_ba_tfd + * @tfd: array of TFD queue status updates. See &iwl_compressed_ba_tfd * for details. Length in @tfd_cnt. * @ra_tid: array of RA-TID queue status updates. For debug purposes only. See - * &iwl_mvm_compressed_ba_ratid for more details. Length in @ra_tid_cnt. + * &iwl_compressed_ba_ratid for more details. Length in @ra_tid_cnt. */ -struct iwl_mvm_compressed_ba_notif { +struct iwl_compressed_ba_notif { __le32 flags; u8 sta_id; u8 reduced_txp; @@ -726,8 +726,8 @@ struct iwl_mvm_compressed_ba_notif { __le16 tfd_cnt; __le16 ra_tid_cnt; union { - DECLARE_FLEX_ARRAY(struct iwl_mvm_compressed_ba_ratid, ra_tid); - DECLARE_FLEX_ARRAY(struct iwl_mvm_compressed_ba_tfd, tfd); + DECLARE_FLEX_ARRAY(struct iwl_compressed_ba_ratid, ra_tid); + DECLARE_FLEX_ARRAY(struct iwl_compressed_ba_tfd, tfd); }; } __packed; /* COMPRESSED_BA_RES_API_S_VER_4, COMPRESSED_BA_RES_API_S_VER_5 */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index c9867d26361b..f1a8f4ad8b39 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -2193,7 +2193,7 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) ba_info.flags = IEEE80211_TX_STAT_AMPDU; if (iwl_mvm_has_new_tx_api(mvm)) { - struct iwl_mvm_compressed_ba_notif *ba_res = + struct iwl_compressed_ba_notif *ba_res = (void *)pkt->data; u8 lq_color = TX_RES_RATE_TABLE_COL_GET(ba_res->tlc_rate_info); u16 tfd_cnt; @@ -2241,8 +2241,7 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) /* Free per TID */ for (i = 0; i < tfd_cnt; i++) { - struct iwl_mvm_compressed_ba_tfd *ba_tfd = - &ba_res->tfd[i]; + struct iwl_compressed_ba_tfd *ba_tfd = &ba_res->tfd[i]; tid = ba_tfd->tid; if (tid == IWL_MGMT_TID) From patchwork Thu Dec 26 15:44:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853835 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FAA283CC1 for ; Thu, 26 Dec 2024 15:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227921; cv=none; b=KUVPtx5mFE3C25o2vmwHdyfm3KnBJGeF5VJpF1yL32FDFtabcRYvReWCQ7SZ40cjr5VUE0yXl0bw++NNXQyrpRgDVajT0e2zR+JryrQfYFHliJH6JSYc51bpnEBrP4tvYqLikTBemcuijTwYB1NV8qkAk1fCiTQLGqCsxWIc3Og= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227921; c=relaxed/simple; bh=Gtt4abF5FCnYON45c06zytpgSAOqutq7kiaez1iNvXA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=GaHdN1GCSZRPjLt5AYiNnZPo5JsYGTbSa7U8jas29w+PtEwLenb0ciXOgzxmEp1yKkICyaqSV5Q3eW25aF6hU0Eg3aBPak63/X6xQyeRJ6A8K8hig8pu3MrDw/h9if//ZxDZZlULpBMNSDg66TqJxzgvCf3O6sPaWKY99hUTEjQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=STyj1Iii; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="STyj1Iii" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227919; x=1766763919; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Gtt4abF5FCnYON45c06zytpgSAOqutq7kiaez1iNvXA=; b=STyj1Iiicf+hncMWWLXNZKl3PTO3UNePLYjMFHLiBTes+0jscpKBrBP7 zqusRN4uxEaP5V9vOxMeSRgKpxMwwx1Wwom1fih4jxVf10rcNAmB/lweZ rAUhuVvBTNDDaO0tx56urjhgZS/cbt11jfBRzOaPCkEy6mlDIPqxmO8qm chFlF+4OnMl0U1dJArZuz76I7DzYroBcJVJN+BuMUwS5rDkmTUB5vr08e FWaBmda/erRcmVDDK2TWck7JqXnxTAGfqeSUzsM5I9iqb5IFn0QGYTfXw sZUC+h64cHPeR8HUAli7b1reL+XKXvPm5EdOvALtglL0MZSvPZxUBJmL4 w==; X-CSE-ConnectionGUID: L+Z27krDR0KJggTjaENGpw== X-CSE-MsgGUID: rerGGU1fRDiRviRKG/UlZw== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878135" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878135" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:18 -0800 X-CSE-ConnectionGUID: bn8KgYfRTD6fCSVpK0nt8g== X-CSE-MsgGUID: iyhdnedMQGyzAtcEIHa00A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777985" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:17 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu , Johannes Berg Subject: [PATCH 04/15] wifi: iwlwifi: mvm: update documentation for iwl_nvm_channel_flags Date: Thu, 26 Dec 2024 17:44:45 +0200 Message-Id: <20241226174257.d4018e62b2bd.Ie20fe3408bcc358078e3e5bf38edeb6b951c9a40@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Anjaneyulu Enhance the documentation for the enum iwl_nvm_channel_flags to provide better clarity for NVM_CHANNEL_IBSS and NVM_CHANNEL_ACTIVE flags Signed-off-by: Anjaneyulu Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index d902121da009..9f7e013252fe 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -141,8 +141,10 @@ static struct ieee80211_rate iwl_cfg80211_rates[] = { /** * enum iwl_nvm_channel_flags - channel flags in NVM * @NVM_CHANNEL_VALID: channel is usable for this SKU/geo - * @NVM_CHANNEL_IBSS: usable as an IBSS channel - * @NVM_CHANNEL_ACTIVE: active scanning allowed + * @NVM_CHANNEL_IBSS: usable as an IBSS channel and deprecated + * when %IWL_NVM_SBANDS_FLAGS_LAR enabled. + * @NVM_CHANNEL_ACTIVE: active scanning allowed and allows IBSS + * when %IWL_NVM_SBANDS_FLAGS_LAR enabled. * @NVM_CHANNEL_RADAR: radar detection required * @NVM_CHANNEL_INDOOR_ONLY: only indoor use is allowed * @NVM_CHANNEL_GO_CONCURRENT: GO operation is allowed when connected to BSS From patchwork Thu Dec 26 15:44:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854631 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 803D41EEE9 for ; Thu, 26 Dec 2024 15:45:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227922; cv=none; b=UUW2rySD3EpFIuXb9F4Q7ijNvCYBVUWBwtpuem2tzwiqPGfCIjM/ATM9+/h1l9Ez6BF+KxPI6SBbNZTFwCFXLso9yiDg0gQ5BbN/QoGwMCdkzNOPYqkFK3jdmk6aM7GnfqbP/MyKW8lybN1snkQhIV1Q3rP0KYcuqdm/txUID7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227922; c=relaxed/simple; bh=uxmQf6yg8Lr588gUXCDkJeuHyIeQXxy/mdXY+og8alQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r/zzKUCf/Ijj5h9ielCIy0U+A1CbUO8j/mbMiY2Emiijp2zHeD2s6ZSGIpVXJjiHj69kJmGIPVRCNeFaeglArdNdl5gKWbRps7k01hiGwiiY6pGfczqMSe6aDuHPmHoVTkep6Wu9h5gZBPOR7iMjBfESCEnACTUef7cNItFFXvk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=FfrQhqVl; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="FfrQhqVl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227920; x=1766763920; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uxmQf6yg8Lr588gUXCDkJeuHyIeQXxy/mdXY+og8alQ=; b=FfrQhqVlGTj8ctXqO74PBh0yohBMjBlXdmGXfq/b+rlXuP6y8Y4vf4Fn zp35/gwOVSBX4BHeu4FSoTKr3bZ5sVcbfBNvL5E6FqyhAk9UoNFmTvjKB J3SUheB+kdxEgnC9eE7+h7ULdv/CgW8VjURrbpbQ2346EiLcZzSd/Sg64 /cznnd+10wbfATLj73kYRALeTNYLxsSYSr5JL+47Xihw6cDIDE8q4pbqd Qbq3udpDjzQldbNoQ4rA53cYdN048xSYey8iQaeN3uYRCrxoxJfGwXdyo SUdL4+WGPvAOBM7P+7rWWmrf0Vct9qFDExnj84eupz/L0FL0RZVovdsui w==; X-CSE-ConnectionGUID: dukamTfcRmW+eMtrRMQvuA== X-CSE-MsgGUID: zM3lxTT7SqWa9BLoadL1Ow== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878137" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878137" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:19 -0800 X-CSE-ConnectionGUID: k8FphWV4SPixPmJMB0naqQ== X-CSE-MsgGUID: C3MBEafaQV+3tbjBh6G8HQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777988" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:18 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg Subject: [PATCH 05/15] wifi: iwlwifi: mvm: log error for failures after D3 Date: Thu, 26 Dec 2024 17:44:46 +0200 Message-Id: <20241226174257.df1e451d4928.Ibe286bc010ad7fecebba5650097e16ed22a654e4@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Benjamin Berg We only logged an error in the fast resume path. However, as the hardware is being restarted it makes sense to log an error to make it easier to understand what is happening. Add a new error message into the normal resume path and update the error in the fast resume path to match. Signed-off-by: Benjamin Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index f85c01e04ebf..cab11229bd7b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -3533,6 +3533,7 @@ static int __iwl_mvm_resume(struct iwl_mvm *mvm, bool test) iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); if (iwl_mvm_check_rt_status(mvm, vif)) { + IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n"); set_bit(STATUS_FW_ERROR, &mvm->trans->status); iwl_mvm_dump_nic_error_log(mvm); iwl_dbg_tlv_time_point(&mvm->fwrt, @@ -3705,8 +3706,7 @@ int iwl_mvm_fast_resume(struct iwl_mvm *mvm) iwl_fw_dbg_read_d3_debug_data(&mvm->fwrt); if (iwl_mvm_check_rt_status(mvm, NULL)) { - IWL_ERR(mvm, - "iwl_mvm_check_rt_status failed, device is gone during suspend\n"); + IWL_ERR(mvm, "FW Error occurred during suspend. Restarting.\n"); set_bit(STATUS_FW_ERROR, &mvm->trans->status); iwl_mvm_dump_nic_error_log(mvm); iwl_dbg_tlv_time_point(&mvm->fwrt, From patchwork Thu Dec 26 15:44:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853834 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D9551369BB for ; Thu, 26 Dec 2024 15:45:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227922; cv=none; b=aFDT0EOjNc2gVp3IpRwS2hJNFlZcy2HjKzkAa5BWAGOXsz5pIAKq7Z5CxHJrfxgQlIx7CFnoRh+OEI6tEB7YB5KII++Mm9CPBg+KRNFGu6JvDQj0vhWpxDLwcKpPPu4JchEz3j/cFlNVtwj7NO6FEIsZeK2X0V5KxpgEGwwbN5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227922; c=relaxed/simple; bh=6Oh5mSK/HC7vjz0hmssanSRC8MHqVTHjw9gigPqC3to=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nDcg34WN0f1Zeju+Dfr2/iZVn82NYAOjsReUg/vHTAcjUiFSKaPDxaBQGG/RSk2oIVpK6bNHwc7l8w1bR7/VnIVoviZKPZH+I9GjNYYAiUnvPJAGE5hTIXGUkIAfDOL1KlV6mQs6BOTmVmJXuuUcvTjVg5PS13S+yf6p+8eBqTw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GxjIW1W8; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GxjIW1W8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227921; x=1766763921; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6Oh5mSK/HC7vjz0hmssanSRC8MHqVTHjw9gigPqC3to=; b=GxjIW1W8ZEAF8n7ByQkmevew8B/BYF5zRqR8/r1f8Xo1ntvXbEWSx42V MWjQ6Kf2mrOgFBVfhnLSsN1pnIw5gGp10WEEFxr7S2B75T2yk4Ys46wx3 3K1eJNTwUn5G858LV8k5l5aGBxnEm41fgqUxctla48XAbxubchB7m2mXI O2dWbR4J1M6bMIa54ANoe3OwlGSe90towGm+MVHvQPkFOXNNLXebJWSl5 pWivYwIbdQ//KHa2kHH6zanbnuITaMwJWir2h2H4wqzp6CLSmnwGNcpB/ 92nnBbRg7QVJbl5e2RI2xqZh/wb947lqC6XGsQd0U3llBDnsOfwgF2WBt A==; X-CSE-ConnectionGUID: 9Yoyc7AIQeKpnAXDaG+hNg== X-CSE-MsgGUID: obz63UyITsKz67dXUtPNaw== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878140" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878140" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:20 -0800 X-CSE-ConnectionGUID: 9aN6e9gJSyGy1ro+4lvctg== X-CSE-MsgGUID: NxP2frzfTMen0qegCbOC1w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777989" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:20 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH 06/15] wifi: iwlwifi: bump FW API to 95 for BZ/SC devices Date: Thu, 26 Dec 2024 17:44:47 +0200 Message-Id: <20241226174257.d5b73c1e9e17.I121e155b0c1fdfb7fbac934bb2f84fe0e1d13ba0@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Start supporting API version 95 for new devices. Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/cfg/bz.c | 2 +- drivers/net/wireless/intel/iwlwifi/cfg/sc.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/bz.c b/drivers/net/wireless/intel/iwlwifi/cfg/bz.c index cd1fe8490ae5..af6d3c85eb6e 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/bz.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/bz.c @@ -10,7 +10,7 @@ #include "fw/api/txq.h" /* Highest firmware API version supported */ -#define IWL_BZ_UCODE_API_MAX 94 +#define IWL_BZ_UCODE_API_MAX 95 /* Lowest firmware API version supported */ #define IWL_BZ_UCODE_API_MIN 92 diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/sc.c b/drivers/net/wireless/intel/iwlwifi/cfg/sc.c index fc5e6e44c6aa..4b92cd274765 100644 --- a/drivers/net/wireless/intel/iwlwifi/cfg/sc.c +++ b/drivers/net/wireless/intel/iwlwifi/cfg/sc.c @@ -10,7 +10,7 @@ #include "fw/api/txq.h" /* Highest firmware API version supported */ -#define IWL_SC_UCODE_API_MAX 94 +#define IWL_SC_UCODE_API_MAX 95 /* Lowest firmware API version supported */ #define IWL_SC_UCODE_API_MIN 92 From patchwork Thu Dec 26 15:44:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854630 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 012781F94A for ; Thu, 26 Dec 2024 15:45:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227925; cv=none; b=KXTMqVoUJENHU5V/p3QCjN4JFKrdh1hCFervy5BvtRaU9F+WwB/NE+LvqbBb9eCagDUiDyJ1KcrBIvGIou+V270Yp7iiDbMeHOxDWycpdfOUoSDrhxhfwbnimFi4zYWv03UOTrq3tHu+CvvcTE9PBcRTPPscjvVuiH71seajXus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227925; c=relaxed/simple; bh=vV3sYvgq/smtvJWO4Y11v5xEHgydAnQnpoFSZoMWrFg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=imZ8Cfu/+SMnoCkqwUQZriIfKzM1/EBVicc6qai3GqzhdAX/rRuhtV2OPe42GmKxBTw6W0UTsVBF/Xhgvgu9zyjIRQtqcHC//JsICLa9Uq8R/0fUETJV4mhEop7jv3oBEGlrbRnwoouOSQFLYVx+sQ3z9ql1+inHghtdiZRm+Go= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=GHPumL6k; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="GHPumL6k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227922; x=1766763922; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vV3sYvgq/smtvJWO4Y11v5xEHgydAnQnpoFSZoMWrFg=; b=GHPumL6kFxsp7/hgt0BS68P+gwqxmRkmx2dF+K+yCIUtTU/yogSUWvXj ZoKtAf3aICW+IG0d60hIvaMKIuj+8+McJZo1yWPaMf1jRKT50PLb1trvc zW1rcOQ9aPtk7P4Llddi3nOEMy8E2OaXnENomYvvdi4KZnING2/TrTF6a m5FH+Nul3ygKpzhvaGbSARKVCTj72z9B2NWwFlEnMWWF2vhQxuJayNdXY jBLOm6dHvM9f4I5ZLHZAOBzb8UOoVE1H8RA9/T9NdoLijsgH+NHY/tk0v JXVOA4NcFPFogQAYUdAmQjs6BFExtkU6bisKWfO9r/dcRK6vDEdA+h6ag Q==; X-CSE-ConnectionGUID: xDDwHCsCQhevgsNE8uFSDA== X-CSE-MsgGUID: ltEj7pD4Rrq+F7R51Yqx/Q== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878145" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878145" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:22 -0800 X-CSE-ConnectionGUID: earvXQMnQk+olNucZsN/eg== X-CSE-MsgGUID: VjNRlYpAR++p71DkIfx/QA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777992" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:21 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 07/15] wifi: iwlwifi: support BIOS override for UNII4 in CA/US also in LARI versions < 12 Date: Thu, 26 Dec 2024 17:44:48 +0200 Message-Id: <20241226174257.672651ad849c.I67a00d9544c48ad964f8e998ebe8c168071c3d01@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Commit ef7ddf4e2f94 ("iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD v12") added a few bits to iwl_lari_config_change_cmd::chan_state_active_bitmap if the FW has LARI version >= 12. But we also need to send those bits for version 8-11 if the FW is capable of this feature (indicated with capability bits) Add the FW capability bit, and set the additional bits in the cmd when the version is 8 and the FW capability bit is set. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/fw/file.h | 5 +++-- drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index ae05227b6153..784667830816 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h @@ -384,7 +384,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t; * to report the CSI information with (certain) RX frames * @IWL_UCODE_TLV_CAPA_FTM_CALIBRATED: has FTM calibrated and thus supports both * initiator and responder - * @IWL_UCODE_TLV_CAPA_MLME_OFFLOAD: supports MLME offload + * @IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA: supports (de)activating UNII-4 + * for US/CA/WW from BIOS * @IWL_UCODE_TLV_CAPA_PROTECTED_TWT: Supports protection of TWT action frames * @IWL_UCODE_TLV_CAPA_FW_RESET_HANDSHAKE: Supports the firmware handshake in * reset flow @@ -474,7 +475,7 @@ enum iwl_ucode_tlv_capa { IWL_UCODE_TLV_CAPA_DBG_BUF_ALLOC_CMD_SUPP = (__force iwl_ucode_tlv_capa_t)93, /* set 3 */ - IWL_UCODE_TLV_CAPA_MLME_OFFLOAD = (__force iwl_ucode_tlv_capa_t)96, + IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA = (__force iwl_ucode_tlv_capa_t)96, /* * @IWL_UCODE_TLV_CAPA_PSC_CHAN_SUPPORT: supports PSC channels diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c index 4d9a1f83ef8c..5e655adce926 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c @@ -564,7 +564,13 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt, if (!ret) { if (cmd_ver < 8) value &= ~ACTIVATE_5G2_IN_WW_MASK; - if (cmd_ver < 12) + + /* Since version 12, bits 5 and 6 are supported + * regardless of this capability. + */ + if (cmd_ver < 12 && + !fw_has_capa(&fwrt->fw->ucode_capa, + IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_UNII4_US_CA)) value &= CHAN_STATE_ACTIVE_BITMAP_CMD_V11; cmd->chan_state_active_bitmap = cpu_to_le32(value); From patchwork Thu Dec 26 15:44:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853833 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0CA713E028 for ; Thu, 26 Dec 2024 15:45:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227926; cv=none; b=BcoxSbpHmSfNV0cB8AxbWi0ZlNep7pKWIn54uYQWe6k5qn7sZKgfBER3aH3kwhCwxvQcQRMZe08D9HG/zKsGTDvE8ip/LGD8bcqpwDBeFp1imytE8bMAaTrvk5Jfc4H2eznPCj20EVT9tv8WhwfcCKd7iXhU+6mECNC/8wKd4K8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227926; c=relaxed/simple; bh=KOSvsdu91QMZ39cvGBgSPyYOOVAV3RYMEYrbxEwZRMo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s8PaIzS0ELXVWIm0By9wV9eE3yYMHM2S6nq2QkaPvdUaqmIWohi+RC9EnLcNrUKqQ6dbTCnpAFfPDOHHxlCriooi3W1jT0tdEyobxPWk4Ixl/PaDyseOUQOZt9Q+tnBiPQssGbv36N2YA2DNdMXA+MSxSBn/QYZn7x94BSf9cO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ILGh7c3/; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ILGh7c3/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227924; x=1766763924; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KOSvsdu91QMZ39cvGBgSPyYOOVAV3RYMEYrbxEwZRMo=; b=ILGh7c3/qkdj7oiQOG3cqITtHwpWJq8b7Q4N04i8CMPj4RGbrWXgluiN Actjxmb4b+eLC0DLsQCcKbCBbIyQYw7Exbv4UPb2jqBCq82B+EEf1PxG+ 68zv6+ouKH5qOginFfzLOQiGWMSWIeEoETaXoeUQ4G+4/bnU3CCu1G91I 8D05rVZSZMkZlh9xycwvKcC6oKOtY7ALM2p2ThsnNy1Lt4W4Kw2k6BnPF 1wWcuCEPTiIKG9zNq7f3jTXBeBZFR8hT5EO3uZ+MTQ4vGelwMioDS0/rr cxt22/7KUX3mSAvECR9Z6cOvPpfgX6GUAalqU7ctf08eve+TygqGep/Yn g==; X-CSE-ConnectionGUID: UrJ+eK8xSNKNnyylqp41Jw== X-CSE-MsgGUID: 7JJT7LwMQkKqMQctj0wdmQ== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878147" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878147" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:23 -0800 X-CSE-ConnectionGUID: Xc3AXcGUTo6CTSEz+rsx5w== X-CSE-MsgGUID: BfA9BLodTeGOIaU2NY1eMg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777995" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:22 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 08/15] wifi: iwlwifi: support BIOS override for 5G9 in CA also in LARI version 8 Date: Thu, 26 Dec 2024 17:44:49 +0200 Message-Id: <20241226174257.dc5836f84514.I1e38f94465a36731034c94b9811de10cb6ee5921@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Commit 6b3e87cc0ca5 ("iwlwifi: Add support for LARI_CONFIG_CHANGE_CMD cmd v9") added a few bits to iwl_lari_config_change_cmd::oem_unii4_allow_bitmap if the FW has LARI version >= 9. But we also need to send those bits for version 8 if the FW is capable of this feature (indicated with capability bits) Add the FW capability bit, and set the additional bits in the cmd when the version is 8 and the FW capability bit is set. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/fw/file.h | 3 +++ drivers/net/wireless/intel/iwlwifi/fw/regulatory.c | 14 ++++++++++---- drivers/net/wireless/intel/iwlwifi/fw/regulatory.h | 11 +++++------ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index 784667830816..f5fbe7692f6c 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h @@ -398,6 +398,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t; * @IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT: Support secure LTF measurement. * @IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS: Support monitor mode on otherwise * passive channels + * @IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA: supports (de)activating 5G9 + * for CA from BIOS. * * @NUM_IWL_UCODE_TLV_CAPA: number of bits used */ @@ -498,6 +500,7 @@ enum iwl_ucode_tlv_capa { IWL_UCODE_TLV_CAPA_CHINA_22_REG_SUPPORT = (__force iwl_ucode_tlv_capa_t)117, IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT = (__force iwl_ucode_tlv_capa_t)121, IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS = (__force iwl_ucode_tlv_capa_t)122, + IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA = (__force iwl_ucode_tlv_capa_t)123, NUM_IWL_UCODE_TLV_CAPA /* * This construction make both sparse (which cannot increment the previous diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c index 5e655adce926..4b5eeff4a140 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c @@ -552,10 +552,16 @@ int iwl_fill_lari_config(struct iwl_fw_runtime *fwrt, ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_UNII4_CHAN, &value); if (!ret) { - if (cmd_ver < 9) - value &= DSM_UNII4_ALLOW_BITMAP_CMD_V8; - else - value &= DSM_UNII4_ALLOW_BITMAP; + value &= DSM_UNII4_ALLOW_BITMAP; + + /* Since version 9, bits 4 and 5 are supported + * regardless of this capability. + */ + if (cmd_ver < 9 && + !fw_has_capa(&fwrt->fw->ucode_capa, + IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA)) + value &= ~(DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK | + DSM_VALUE_UNII4_CANADA_EN_MSK); cmd->oem_unii4_allow_bitmap = cpu_to_le32(value); } diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h index 81787501d4a4..4ced1711d913 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h @@ -144,12 +144,11 @@ enum iwl_dsm_unii4_bitmap { DSM_VALUE_UNII4_CANADA_EN_MSK = BIT(5), }; -#define DSM_UNII4_ALLOW_BITMAP_CMD_V8 (DSM_VALUE_UNII4_US_OVERRIDE_MSK | \ - DSM_VALUE_UNII4_US_EN_MSK | \ - DSM_VALUE_UNII4_ETSI_OVERRIDE_MSK | \ - DSM_VALUE_UNII4_ETSI_EN_MSK) -#define DSM_UNII4_ALLOW_BITMAP (DSM_UNII4_ALLOW_BITMAP_CMD_V8 | \ - DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK | \ +#define DSM_UNII4_ALLOW_BITMAP (DSM_VALUE_UNII4_US_OVERRIDE_MSK |\ + DSM_VALUE_UNII4_US_EN_MSK |\ + DSM_VALUE_UNII4_ETSI_OVERRIDE_MSK |\ + DSM_VALUE_UNII4_ETSI_EN_MSK |\ + DSM_VALUE_UNII4_CANADA_OVERRIDE_MSK |\ DSM_VALUE_UNII4_CANADA_EN_MSK) enum iwl_dsm_values_rfi { From patchwork Thu Dec 26 15:44:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854629 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275C912E5B for ; Thu, 26 Dec 2024 15:45:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227926; cv=none; b=JEm6TPyBWKCZOPKr9x72fnWVmea9WKGdY+l2iKF7MNQwrnzqw6HfKKFMZ9g8PVTeDN6QjW2oopk6AzsTaVFLNMeTwxMxJiDA7MMSn4+MYKMcY6azXnB0Yy8gtV7O2k2pkJ5n9uHnT9YgpzniFqQpQJGguKWmEL66tTNQYMAWLAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227926; c=relaxed/simple; bh=09uEPtdgMGQnxNQcMg9fm2iCzzPkoU97sdMIi69FNEg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FhRVqcCYNTQ1XmGAEvzCvfZ28snwSMirYfo8BG0yRSVZ/pAcY9tifmbXVgzgy9XGYoY9ivEVzoaRi8GuWabr9SNMJ+TVqYsySJ/fjfGYxYTcRMzQXcwSbSrUEfvTtopjt4RcRTlv2Icde5XuAHvo2Obt6bZlwkMZWBj88OUxj24= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=SkSBeK4a; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="SkSBeK4a" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227925; x=1766763925; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=09uEPtdgMGQnxNQcMg9fm2iCzzPkoU97sdMIi69FNEg=; b=SkSBeK4aSH2ZTi2yz2azqbqi/weUNG1VmLk+D3qvuzFnABOJOTxH0OMe VYOJb+S/ptDYempLR3d/PyshIieINv/LSCJYA2Rg9a5Xw8AnqBmDM+M8b tWG+N/DOi5mWP6Z2qhIMpB7BsyPZMTRT+p0sqoQvjKf0CcfyiHvxgC6XP 4P04uNAu1HV+oKt9yyVqKNslBa7x0sasQAgz7BnRNJXbs5ct+397ujL53 WMkxx4qFjPyaRgRtD5Qspy/Fvk3QjADWl5nVPMIdkJn+tS0wPuzXk4qev fLzR2CNap9DfPP6FO9Prz7i2hLlmIY16knLt+RZ+JrI1D0pBCYRVvd4co g==; X-CSE-ConnectionGUID: yO8cQ0D3QKWFNIGioC8EfQ== X-CSE-MsgGUID: R+xtDpXGSUSyWexI9DqjBA== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878150" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878150" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:24 -0800 X-CSE-ConnectionGUID: jrQzoo2WT9K8ID0zcfsDmA== X-CSE-MsgGUID: sVlf2LqOQdeK0eb9Hiq+pA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99777999" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:23 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay Subject: [PATCH 09/15] wifi: iwlwifi: mvm: Check BAR packet size before accessing data Date: Thu, 26 Dec 2024 17:44:50 +0200 Message-Id: <20241226174257.72161a6c07c3.I4887bad2355213b201fca2da1836c9a3203ab42d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Daniel Gabay Validate the BAR frame release size before using its fields to avoid potential invalid memory access. Signed-off-by: Daniel Gabay Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index a2f16bfaec44..e8ea48936c2d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -2506,19 +2506,21 @@ void iwl_mvm_rx_bar_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, { struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_bar_frame_release *release = (void *)pkt->data; - unsigned int baid = le32_get_bits(release->ba_info, - IWL_BAR_FRAME_RELEASE_BAID_MASK); - unsigned int nssn = le32_get_bits(release->ba_info, - IWL_BAR_FRAME_RELEASE_NSSN_MASK); - unsigned int sta_id = le32_get_bits(release->sta_tid, - IWL_BAR_FRAME_RELEASE_STA_MASK); - unsigned int tid = le32_get_bits(release->sta_tid, - IWL_BAR_FRAME_RELEASE_TID_MASK); struct iwl_mvm_baid_data *baid_data; + unsigned int baid, nssn, sta_id, tid; if (unlikely(iwl_rx_packet_payload_len(pkt) < sizeof(*release))) return; + baid = le32_get_bits(release->ba_info, + IWL_BAR_FRAME_RELEASE_BAID_MASK); + nssn = le32_get_bits(release->ba_info, + IWL_BAR_FRAME_RELEASE_NSSN_MASK); + sta_id = le32_get_bits(release->sta_tid, + IWL_BAR_FRAME_RELEASE_STA_MASK); + tid = le32_get_bits(release->sta_tid, + IWL_BAR_FRAME_RELEASE_TID_MASK); + if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID || baid >= ARRAY_SIZE(mvm->baid_map))) return; From patchwork Thu Dec 26 15:44:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853832 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34FBE14036E for ; Thu, 26 Dec 2024 15:45:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227928; cv=none; b=MyC7itzjulN8XFYdCx9M70NF7GNppylb2+YXYpJSIwubouAGqL1RoGQNFdMjLz/3YOhZTgysLaXFwehhQZ33gbtVLC3BY1VcdlJ/oikIh4149t1BEhNq4K4Wo972ChHqvBrx8dMZPoYIy4t6gTcET0yZSuuPX8ISQ4Xln9XSfXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227928; c=relaxed/simple; bh=zm/+J2BWw1uuh0huLFW2NN/67i2/V4HLAtW1J1Igqbs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=N0bqt6uK/GN/WAVUXYY3kUFBIdVqgLdtfIA3Ao5Sgd6IXAFVHb3NP3Q0fnrEjOsjQLRTirfNVTk5KiO7VBriSH3lmIVRudaiHcEPJ/Y8RNF/aAxcXMIH+YS/RMu69AGLGgI57Lf4pXXq2m7/FiPKIATwGaVQ7fLKfAEU2ID1lt8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=RvBFRBmU; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RvBFRBmU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227926; x=1766763926; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zm/+J2BWw1uuh0huLFW2NN/67i2/V4HLAtW1J1Igqbs=; b=RvBFRBmUvrdXJM4BVoK8zNDMTWSqKfHzjtW3t9s82UOMMgIPulTOJ0fU nKfgsVxe5Of10DIQ9CK8C1iriuTj+Ew9fcqxzKv9FXgQ9KG2DiBAVHxBi 0QvKRu2bQ4J+BSpsM22ozFYnk5cH/ERXwwbWVIDXrfsqthvjQHYYFDmsA qRAU2HsHbvOPKYacUyCc7eL1rZSGFoVzP8w/evzLkghfkNWtTQnn61sht znI+OQRwwpBaGnFkrUoet/fAbrSUk+TpiKe1TPBAVEwCKnU4h7BKiIt2O 1XwdXUFXQGjO2ZcV7/p1H+YfifmIF3haSFowyKsxXlM+sRrmi2apE6FWy A==; X-CSE-ConnectionGUID: quSmK6vJS6StU0VxdP4szw== X-CSE-MsgGUID: dqiwT8pUT4qrAAnPyUORMA== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878152" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878152" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:26 -0800 X-CSE-ConnectionGUID: 9CxsuWoST+i4A3Sfzd253Q== X-CSE-MsgGUID: HMPuexZmSvWzIEBqgqNq6g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99778002" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:25 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay Subject: [PATCH 10/15] wifi: iwlwifi: mvm: Move TSO code to shared utility Date: Thu, 26 Dec 2024 17:44:51 +0200 Message-Id: <20241226174257.3b940175a14b.Ib7188572f18afb31840d193a348c17c9b292c7af@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Daniel Gabay Move TSO segment logic from mvm to the iwlwifi level, as this code is not opmode-dependent and can be shared with the mld driver. Signed-off-by: Daniel Gabay --- drivers/net/wireless/intel/iwlwifi/Makefile | 1 + .../net/wireless/intel/iwlwifi/iwl-utils.c | 85 +++++++++++++++++++ .../net/wireless/intel/iwlwifi/iwl-utils.h | 36 ++++++++ drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 82 ++---------------- 4 files changed, 127 insertions(+), 77 deletions(-) create mode 100644 drivers/net/wireless/intel/iwlwifi/iwl-utils.c create mode 100644 drivers/net/wireless/intel/iwlwifi/iwl-utils.h diff --git a/drivers/net/wireless/intel/iwlwifi/Makefile b/drivers/net/wireless/intel/iwlwifi/Makefile index 64c123314245..8d118ee92698 100644 --- a/drivers/net/wireless/intel/iwlwifi/Makefile +++ b/drivers/net/wireless/intel/iwlwifi/Makefile @@ -5,6 +5,7 @@ iwlwifi-objs += iwl-io.o iwlwifi-objs += iwl-drv.o iwlwifi-objs += iwl-debug.o iwlwifi-objs += iwl-nvm-utils.o +iwlwifi-objs += iwl-utils.o iwlwifi-objs += iwl-phy-db.o iwl-nvm-parse.o iwlwifi-objs += pcie/drv.o pcie/rx.o pcie/tx.o pcie/trans.o iwlwifi-objs += pcie/ctxt-info.o pcie/ctxt-info-gen3.o diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-utils.c b/drivers/net/wireless/intel/iwlwifi/iwl-utils.c new file mode 100644 index 000000000000..b14ec98e28b6 --- /dev/null +++ b/drivers/net/wireless/intel/iwlwifi/iwl-utils.c @@ -0,0 +1,85 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* + * Copyright (C) 2024 Intel Corporation + */ +#include +#include +#include +#include + +#include "iwl-drv.h" +#include "iwl-utils.h" + +#ifdef CONFIG_INET +int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, + netdev_features_t netdev_flags, + struct sk_buff_head *mpdus_skbs) +{ + struct sk_buff *tmp, *next; + struct ieee80211_hdr *hdr = (void *)skb->data; + char cb[sizeof(skb->cb)]; + u16 i = 0; + unsigned int tcp_payload_len; + unsigned int mss = skb_shinfo(skb)->gso_size; + bool ipv4 = (skb->protocol == htons(ETH_P_IP)); + bool qos = ieee80211_is_data_qos(hdr->frame_control); + u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0; + + skb_shinfo(skb)->gso_size = num_subframes * mss; + memcpy(cb, skb->cb, sizeof(cb)); + + next = skb_gso_segment(skb, netdev_flags); + skb_shinfo(skb)->gso_size = mss; + skb_shinfo(skb)->gso_type = ipv4 ? SKB_GSO_TCPV4 : SKB_GSO_TCPV6; + + if (IS_ERR(next) && PTR_ERR(next) == -ENOMEM) + return -ENOMEM; + + if (WARN_ONCE(IS_ERR(next), + "skb_gso_segment error: %d\n", (int)PTR_ERR(next))) + return PTR_ERR(next); + + if (next) + consume_skb(skb); + + skb_list_walk_safe(next, tmp, next) { + memcpy(tmp->cb, cb, sizeof(tmp->cb)); + /* + * Compute the length of all the data added for the A-MSDU. + * This will be used to compute the length to write in the TX + * command. We have: SNAP + IP + TCP for n -1 subframes and + * ETH header for n subframes. + */ + tcp_payload_len = skb_tail_pointer(tmp) - + skb_transport_header(tmp) - + tcp_hdrlen(tmp) + tmp->data_len; + + if (ipv4) + ip_hdr(tmp)->id = htons(ip_base_id + i * num_subframes); + + if (tcp_payload_len > mss) { + skb_shinfo(tmp)->gso_size = mss; + skb_shinfo(tmp)->gso_type = ipv4 ? SKB_GSO_TCPV4 : + SKB_GSO_TCPV6; + } else { + if (qos) { + u8 *qc; + + if (ipv4) + ip_send_check(ip_hdr(tmp)); + + qc = ieee80211_get_qos_ctl((void *)tmp->data); + *qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; + } + skb_shinfo(tmp)->gso_size = 0; + } + + skb_mark_not_on_list(tmp); + __skb_queue_tail(mpdus_skbs, tmp); + i++; + } + + return 0; +} +IWL_EXPORT_SYMBOL(iwl_tx_tso_segment); +#endif /* CONFIG_INET */ diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-utils.h b/drivers/net/wireless/intel/iwlwifi/iwl-utils.h new file mode 100644 index 000000000000..b43703afdff2 --- /dev/null +++ b/drivers/net/wireless/intel/iwlwifi/iwl-utils.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* + * Copyright (C) 2024 Intel Corporation + */ +#ifndef __iwl_utils_h__ +#define __iwl_utils_h__ + +#ifdef CONFIG_INET +/** + * iwl_tx_tso_segment - Segments a TSO packet into subframes for A-MSDU. + * @skb: buffer to segment. + * @num_subframes: number of subframes to create. + * @netdev_flags: netdev feature flags. + * @mpdus_skbs: list to hold the segmented subframes. + * + * This function segments a large TCP packet into subframes. + * subframes are added to the mpdus_skbs list + * + * Returns: 0 on success and negative value on failure. + */ +int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, + netdev_features_t netdev_flags, + struct sk_buff_head *mpdus_skbs); +#else +static inline +int iwl_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, + netdev_features_t netdev_flags, + struct sk_buff_head *mpdus_skbs) +{ + WARN_ON(1) + + return -1; +} +#endif /* CONFIG_INET */ + +#endif /* __iwl_utils_h__ */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c index f1a8f4ad8b39..b5f6bb9cab4a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c @@ -13,6 +13,7 @@ #include "iwl-trans.h" #include "iwl-nvm-utils.h" +#include "iwl-utils.h" #include "mvm.h" #include "sta.h" #include "time-sync.h" @@ -938,78 +939,6 @@ unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm, #ifdef CONFIG_INET -static int -iwl_mvm_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes, - netdev_features_t netdev_flags, - struct sk_buff_head *mpdus_skb) -{ - struct sk_buff *tmp, *next; - struct ieee80211_hdr *hdr = (void *)skb->data; - char cb[sizeof(skb->cb)]; - u16 i = 0; - unsigned int tcp_payload_len; - unsigned int mss = skb_shinfo(skb)->gso_size; - bool ipv4 = (skb->protocol == htons(ETH_P_IP)); - bool qos = ieee80211_is_data_qos(hdr->frame_control); - u16 ip_base_id = ipv4 ? ntohs(ip_hdr(skb)->id) : 0; - - skb_shinfo(skb)->gso_size = num_subframes * mss; - memcpy(cb, skb->cb, sizeof(cb)); - - next = skb_gso_segment(skb, netdev_flags); - skb_shinfo(skb)->gso_size = mss; - skb_shinfo(skb)->gso_type = ipv4 ? SKB_GSO_TCPV4 : SKB_GSO_TCPV6; - - if (IS_ERR(next) && PTR_ERR(next) == -ENOMEM) - return -ENOMEM; - - if (WARN_ONCE(IS_ERR(next), - "skb_gso_segment error: %d\n", (int)PTR_ERR(next))) - return PTR_ERR(next); - - if (next) - consume_skb(skb); - - skb_list_walk_safe(next, tmp, next) { - memcpy(tmp->cb, cb, sizeof(tmp->cb)); - /* - * Compute the length of all the data added for the A-MSDU. - * This will be used to compute the length to write in the TX - * command. We have: SNAP + IP + TCP for n -1 subframes and - * ETH header for n subframes. - */ - tcp_payload_len = skb_tail_pointer(tmp) - - skb_transport_header(tmp) - - tcp_hdrlen(tmp) + tmp->data_len; - - if (ipv4) - ip_hdr(tmp)->id = htons(ip_base_id + i * num_subframes); - - if (tcp_payload_len > mss) { - skb_shinfo(tmp)->gso_size = mss; - skb_shinfo(tmp)->gso_type = ipv4 ? SKB_GSO_TCPV4 : - SKB_GSO_TCPV6; - } else { - if (qos) { - u8 *qc; - - if (ipv4) - ip_send_check(ip_hdr(tmp)); - - qc = ieee80211_get_qos_ctl((void *)tmp->data); - *qc &= ~IEEE80211_QOS_CTL_A_MSDU_PRESENT; - } - skb_shinfo(tmp)->gso_size = 0; - } - - skb_mark_not_on_list(tmp); - __skb_queue_tail(mpdus_skb, tmp); - i++; - } - - return 0; -} - static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, struct ieee80211_tx_info *info, struct ieee80211_sta *sta, @@ -1028,7 +957,7 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, if (!mvmsta->max_amsdu_len || !ieee80211_is_data_qos(hdr->frame_control) || !mvmsta->amsdu_enabled) - return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); + return iwl_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); /* * Do not build AMSDU for IPv6 with extension headers. @@ -1038,7 +967,7 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, ((struct ipv6hdr *)skb_network_header(skb))->nexthdr != IPPROTO_TCP) { netdev_flags &= ~NETIF_F_CSUM_MASK; - return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); + return iwl_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); } tid = ieee80211_get_tid(hdr); @@ -1052,7 +981,7 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, if ((info->flags & IEEE80211_TX_CTL_AMPDU && !mvmsta->tid_data[tid].amsdu_in_ampdu_allowed) || !(mvmsta->amsdu_enabled & BIT(tid))) - return iwl_mvm_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); + return iwl_tx_tso_segment(skb, 1, netdev_flags, mpdus_skb); /* * Take the min of ieee80211 station and mvm station @@ -1110,8 +1039,7 @@ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, * Trick the segmentation function to make it * create SKBs that can fit into one A-MSDU. */ - return iwl_mvm_tx_tso_segment(skb, num_subframes, netdev_flags, - mpdus_skb); + return iwl_tx_tso_segment(skb, num_subframes, netdev_flags, mpdus_skb); } #else /* CONFIG_INET */ static int iwl_mvm_tx_tso(struct iwl_mvm *mvm, struct sk_buff *skb, From patchwork Thu Dec 26 15:44:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854628 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2DAB9143C63 for ; Thu, 26 Dec 2024 15:45:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227929; cv=none; b=TsuCkStTSIeWXBu6v5N19V8V3cRjsoUfxmhQbt3Wdw6OoG1gmeXmBkAIwe8QKcPaCRqtB8EJmAsN88nfu3JQVXsflD54vmCmTuF8jnTuN98aOc2xthR2CNrLh+OXG0i2kTbiZl38MMrjFzkM6YXaxCudZhzKbY4X9NLXVNEZ/MI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227929; c=relaxed/simple; bh=9FSfb8Ar9vfok9GiD2X5SWsG62uWlOCx8E3ANshKuWE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KQUMyBmaS0l3HrjnpdAHuyuC7NLA1WavxR0LrKFjVo+Je5+QKyq2RjfWgocAWDjPGjGsYrxD4FTGqYVPqsXu6I9KTe9BFCmsl10JeQj7hFtIgb8hfOtn03BQLwCy6+KpqxuJFOUXLbFrHyRsVsom2bw2G4sk7xhq8xO2df9R0kI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R7zvURWx; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R7zvURWx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227928; x=1766763928; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9FSfb8Ar9vfok9GiD2X5SWsG62uWlOCx8E3ANshKuWE=; b=R7zvURWx5rlTUEGzMWe33TjcuElFhVcs3mIaCd2uBgiAlEqEnMWfRoZf 8qXqK+Y+Kb4Rqq8Xp4L34zoUtXbzBHoN0rCGEARURhTduXofXgPkoGbmK rKvN70NFbbryR/R1Xb4zir/9IG7S5sJ5zesLDthyxZIiHufB9paiDRLmK b790ZBVjjCoV64i/X/VssQgstAPg8EVEgfx1BuuQ5fmd8nffxjlKBfFdB lF5LhtooBtI2tyIcJqhyX2rKFT1FVLQc29xx6w7wOxol8iGmLpL59aeNd ek5x6+Qnd1Bmsd7VXM9h7XUJDa7hCI+zPkzEvHjebIR40XuyDhLtstZe2 Q==; X-CSE-ConnectionGUID: C7j+8n/DSWC+8a5/qjv9sA== X-CSE-MsgGUID: PWBTo3y8SoiTyW5O4PRp2g== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878154" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878154" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:27 -0800 X-CSE-ConnectionGUID: VqyrCKuKQRSWXdCjjMVsUQ== X-CSE-MsgGUID: tcut56oHSBewyPyLP2d64Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99778005" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:26 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 11/15] wifi: iwlwifi: add a new NMI type Date: Thu, 26 Dec 2024 17:44:52 +0200 Message-Id: <20241226174257.596dfc97f6b1.Iec765d5fe12ac74c6ee0035e9cb62b98c11639cb@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Emmanuel Grumbach 0x88 is not a regular firmware crash but a PREG NMI which means that we access a place we're not supposed to. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/img.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/img.c b/drivers/net/wireless/intel/iwlwifi/fw/img.c index b7deca05a953..c2f4fc83a22c 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/img.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/img.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Copyright(c) 2019 - 2021 Intel Corporation + * Copyright(c) 2024 Intel Corporation */ #include #include "img.h" @@ -75,6 +76,7 @@ static const struct { { "NMI_INTERRUPT_ACTION_PT", 0x7C }, { "NMI_INTERRUPT_UNKNOWN", 0x84 }, { "NMI_INTERRUPT_INST_ACTION_PT", 0x86 }, + { "NMI_INTERRUPT_PREG", 0x88 }, { "PNVM_MISSING", FW_SYSASSERT_PNVM_MISSING }, { "ADVANCED_SYSASSERT", 0 }, }; From patchwork Thu Dec 26 15:44:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853831 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 110C3145335 for ; Thu, 26 Dec 2024 15:45:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227930; cv=none; b=bY/lbkW00lPZK++vAB9hBphirHfP5T09miwVpVXDDPS7QSaVr99QOTCM04+eqJBBIDS4j2qqACE6n2BknuirAJW5mCL/Jc2Xvi5jP0DKn8uVPQgjuiAjhSE4ij/lGDt0AcRylRyL8K5mySeTyLq4u/aYFH2t57b/Plb0iido9Pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227930; c=relaxed/simple; bh=ENb9C85Y/fyyQquoGgEhj2dLMcT6viE35mnzqWKVCqI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LzK1gtE7+hXhUo9Fd/WDfnN+cBeAZYxxw9qapg4jgpnRCVQqELASKD4hYt8IaKa2SxgoOJKLoDjFZqkdrpeHK6VSHa/p6XM4ca91SW12ycqn+Ne4zxpJZFBi/R2l3jKcGoYjEyKN3IF5y2x+1oUCkl283uXDnMZ9YY9aGJNWF+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=HcdSgDpf; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HcdSgDpf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227929; x=1766763929; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ENb9C85Y/fyyQquoGgEhj2dLMcT6viE35mnzqWKVCqI=; b=HcdSgDpfC2Bj9mETCl9pdU7MatzXPhanXfMmZ8nLEbSC3fitO4MMaXL8 CGS/xaFAWo7sWllBL29+JVlEu3zgW90ocFJTtZ6PoCCSPLrTKW0q/2v2O LeOw+cwV75O9rayg6194vslNwbyAaIdtzQ3pejJHuNHaSoLMfUo9DXZY6 k9XpDAPb/aWUDbVAsObHsmcuP4fh44Ii1KqkJt3m4gs+0ZnAlu4GU1/9Y ZLzIgm7KWFAmyKwj5PKcdqc1qUVxhPX96A+xlBC78xXVwvd9Sllfu/P6n 7CLi80fHfNliukubd9KrY3CngciL8axQ2y2DoWRt8G/bAYL/BQX/qk3rA A==; X-CSE-ConnectionGUID: sOPTIWPWSq+xPCKv56f1sg== X-CSE-MsgGUID: td3ZazE0SPG2FXhm4u+G5A== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878158" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878158" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:29 -0800 X-CSE-ConnectionGUID: TyGVkI8yRg63ZhYKP7xGQw== X-CSE-MsgGUID: Uj5RHCnNQVaQ8aXyD4jOhQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99778008" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:28 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, "Somashekhar(Som)" , Johannes Berg Subject: [PATCH 12/15] wifi: iwlwifi: pcie: Add support for new device ids Date: Thu, 26 Dec 2024 17:44:53 +0200 Message-Id: <20241226174257.6a0db60436e7.I50a66544dde6c88acd9abe4b31badab96ef04cfc@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: "Somashekhar(Som)" Add support for new device-ids 0x2730 and 0x272F. Signed-off-by: Somashekhar(Som) Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/Makefile | 2 +- drivers/net/wireless/intel/iwlwifi/cfg/dr.c | 167 ++++++++++++++++++ .../net/wireless/intel/iwlwifi/iwl-config.h | 10 ++ drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 16 ++ 4 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 drivers/net/wireless/intel/iwlwifi/cfg/dr.c diff --git a/drivers/net/wireless/intel/iwlwifi/Makefile b/drivers/net/wireless/intel/iwlwifi/Makefile index 8d118ee92698..19c4ce6f2465 100644 --- a/drivers/net/wireless/intel/iwlwifi/Makefile +++ b/drivers/net/wireless/intel/iwlwifi/Makefile @@ -12,7 +12,7 @@ iwlwifi-objs += pcie/ctxt-info.o pcie/ctxt-info-gen3.o iwlwifi-objs += pcie/trans-gen2.o pcie/tx-gen2.o iwlwifi-$(CONFIG_IWLDVM) += cfg/1000.o cfg/2000.o cfg/5000.o cfg/6000.o iwlwifi-$(CONFIG_IWLMVM) += cfg/7000.o cfg/8000.o cfg/9000.o cfg/22000.o -iwlwifi-$(CONFIG_IWLMVM) += cfg/ax210.o cfg/bz.o cfg/sc.o +iwlwifi-$(CONFIG_IWLMVM) += cfg/ax210.o cfg/bz.o cfg/sc.o cfg/dr.o iwlwifi-objs += iwl-dbg-tlv.o iwlwifi-objs += iwl-trans.o diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/dr.c b/drivers/net/wireless/intel/iwlwifi/cfg/dr.c new file mode 100644 index 000000000000..ab7c0f8d54f4 --- /dev/null +++ b/drivers/net/wireless/intel/iwlwifi/cfg/dr.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* + * Copyright (C) 2024 Intel Corporation + */ +#include +#include +#include "iwl-config.h" +#include "iwl-prph.h" +#include "fw/api/txq.h" + +/* Highest firmware API version supported */ +#define IWL_DR_UCODE_API_MAX 96 + +/* Lowest firmware API version supported */ +#define IWL_DR_UCODE_API_MIN 96 + +/* NVM versions */ +#define IWL_DR_NVM_VERSION 0x0a1d + +/* Memory offsets and lengths */ +#define IWL_DR_DCCM_OFFSET 0x800000 /* LMAC1 */ +#define IWL_DR_DCCM_LEN 0x10000 /* LMAC1 */ +#define IWL_DR_DCCM2_OFFSET 0x880000 +#define IWL_DR_DCCM2_LEN 0x8000 +#define IWL_DR_SMEM_OFFSET 0x400000 +#define IWL_DR_SMEM_LEN 0xD0000 + +#define IWL_DR_A_PE_A_FW_PRE "iwlwifi-dr-a0-pe-a0" +#define IWL_BR_A_PET_A_FW_PRE "iwlwifi-br-a0-petc-a0" +#define IWL_BR_A_PE_A_FW_PRE "iwlwifi-br-a0-pe-a0" + +#define IWL_DR_A_PE_A_FW_MODULE_FIRMWARE(api) \ + IWL_DR_A_PE_A_FW_PRE "-" __stringify(api) ".ucode" +#define IWL_BR_A_PET_A_FW_MODULE_FIRMWARE(api) \ + IWL_BR_A_PET_A_FW_PRE "-" __stringify(api) ".ucode" +#define IWL_BR_A_PE_A_FW_MODULE_FIRMWARE(api) \ + IWL_BR_A_PE_A_FW_PRE "-" __stringify(api) ".ucode" + +static const struct iwl_base_params iwl_dr_base_params = { + .eeprom_size = OTP_LOW_IMAGE_SIZE_32K, + .num_of_queues = 512, + .max_tfd_queue_size = 65536, + .shadow_ram_support = true, + .led_compensation = 57, + .wd_timeout = IWL_LONG_WD_TIMEOUT, + .max_event_log_size = 512, + .shadow_reg_enable = true, + .pcie_l1_allowed = true, +}; + +#define IWL_DEVICE_DR_COMMON \ + .ucode_api_max = IWL_DR_UCODE_API_MAX, \ + .ucode_api_min = IWL_DR_UCODE_API_MIN, \ + .led_mode = IWL_LED_RF_STATE, \ + .nvm_hw_section_num = 10, \ + .non_shared_ant = ANT_B, \ + .dccm_offset = IWL_DR_DCCM_OFFSET, \ + .dccm_len = IWL_DR_DCCM_LEN, \ + .dccm2_offset = IWL_DR_DCCM2_OFFSET, \ + .dccm2_len = IWL_DR_DCCM2_LEN, \ + .smem_offset = IWL_DR_SMEM_OFFSET, \ + .smem_len = IWL_DR_SMEM_LEN, \ + .apmg_not_supported = true, \ + .trans.mq_rx_supported = true, \ + .vht_mu_mimo_supported = true, \ + .mac_addr_from_csr = 0x30, \ + .nvm_ver = IWL_DR_NVM_VERSION, \ + .trans.rf_id = true, \ + .trans.gen2 = true, \ + .nvm_type = IWL_NVM_EXT, \ + .dbgc_supported = true, \ + .min_umac_error_event_table = 0xD0000, \ + .d3_debug_data_base_addr = 0x401000, \ + .d3_debug_data_length = 60 * 1024, \ + .mon_smem_regs = { \ + .write_ptr = { \ + .addr = LDBG_M2S_BUF_WPTR, \ + .mask = LDBG_M2S_BUF_WPTR_VAL_MSK, \ + }, \ + .cycle_cnt = { \ + .addr = LDBG_M2S_BUF_WRAP_CNT, \ + .mask = LDBG_M2S_BUF_WRAP_CNT_VAL_MSK, \ + }, \ + }, \ + .trans.umac_prph_offset = 0x300000, \ + .trans.device_family = IWL_DEVICE_FAMILY_DR, \ + .trans.base_params = &iwl_dr_base_params, \ + .min_txq_size = 128, \ + .gp2_reg_addr = 0xd02c68, \ + .min_ba_txq_size = IWL_DEFAULT_QUEUE_SIZE_EHT, \ + .mon_dram_regs = { \ + .write_ptr = { \ + .addr = DBGC_CUR_DBGBUF_STATUS, \ + .mask = DBGC_CUR_DBGBUF_STATUS_OFFSET_MSK, \ + }, \ + .cycle_cnt = { \ + .addr = DBGC_DBGBUF_WRAP_AROUND, \ + .mask = 0xffffffff, \ + }, \ + .cur_frag = { \ + .addr = DBGC_CUR_DBGBUF_STATUS, \ + .mask = DBGC_CUR_DBGBUF_STATUS_IDX_MSK, \ + }, \ + }, \ + .mon_dbgi_regs = { \ + .write_ptr = { \ + .addr = DBGI_SRAM_FIFO_POINTERS, \ + .mask = DBGI_SRAM_FIFO_POINTERS_WR_PTR_MSK, \ + }, \ + } + +#define IWL_DEVICE_DR \ + IWL_DEVICE_DR_COMMON, \ + .uhb_supported = true, \ + .features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM, \ + .num_rbds = IWL_NUM_RBDS_DR_EHT, \ + .ht_params = &iwl_22000_ht_params + +/* + * This size was picked according to 8 MSDUs inside 512 A-MSDUs in an + * A-MPDU, with additional overhead to account for processing time. + */ +#define IWL_NUM_RBDS_DR_EHT (512 * 16) + +const struct iwl_cfg_trans_params iwl_dr_trans_cfg = { + .device_family = IWL_DEVICE_FAMILY_DR, + .base_params = &iwl_dr_base_params, + .mq_rx_supported = true, + .rf_id = true, + .gen2 = true, + .integrated = true, + .umac_prph_offset = 0x300000, + .xtal_latency = 12000, + .low_latency_xtal = true, + .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US, +}; + +const char iwl_dr_name[] = "Intel(R) TBD Dr device"; + +const struct iwl_cfg iwl_cfg_dr = { + .fw_name_mac = "dr", + IWL_DEVICE_DR, +}; + +const struct iwl_cfg_trans_params iwl_br_trans_cfg = { + .device_family = IWL_DEVICE_FAMILY_DR, + .base_params = &iwl_dr_base_params, + .mq_rx_supported = true, + .rf_id = true, + .gen2 = true, + .integrated = true, + .umac_prph_offset = 0x300000, + .xtal_latency = 12000, + .low_latency_xtal = true, + .ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US, +}; + +const char iwl_br_name[] = "Intel(R) TBD Br device"; + +const struct iwl_cfg iwl_cfg_br = { + .fw_name_mac = "br", + IWL_DEVICE_DR, +}; + +MODULE_FIRMWARE(IWL_DR_A_PE_A_FW_MODULE_FIRMWARE(IWL_DR_UCODE_API_MAX)); +MODULE_FIRMWARE(IWL_BR_A_PET_A_FW_MODULE_FIRMWARE(IWL_DR_UCODE_API_MAX)); +MODULE_FIRMWARE(IWL_BR_A_PE_A_FW_MODULE_FIRMWARE(IWL_DR_UCODE_API_MAX)); diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h index 34c91deca57b..88444d6c10e5 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h @@ -38,6 +38,7 @@ enum iwl_device_family { IWL_DEVICE_FAMILY_AX210, IWL_DEVICE_FAMILY_BZ, IWL_DEVICE_FAMILY_SC, + IWL_DEVICE_FAMILY_DR, }; /* @@ -424,6 +425,8 @@ struct iwl_cfg { #define IWL_CFG_MAC_TYPE_SC2 0x49 #define IWL_CFG_MAC_TYPE_SC2F 0x4A #define IWL_CFG_MAC_TYPE_BZ_W 0x4B +#define IWL_CFG_MAC_TYPE_BR 0x4C +#define IWL_CFG_MAC_TYPE_DR 0x4D #define IWL_CFG_RF_TYPE_TH 0x105 #define IWL_CFG_RF_TYPE_TH1 0x108 @@ -434,6 +437,7 @@ struct iwl_cfg { #define IWL_CFG_RF_TYPE_GF 0x10D #define IWL_CFG_RF_TYPE_FM 0x112 #define IWL_CFG_RF_TYPE_WH 0x113 +#define IWL_CFG_RF_TYPE_PE 0x114 #define IWL_CFG_RF_ID_TH 0x1 #define IWL_CFG_RF_ID_TH1 0x1 @@ -506,6 +510,8 @@ extern const struct iwl_cfg_trans_params iwl_ma_trans_cfg; extern const struct iwl_cfg_trans_params iwl_bz_trans_cfg; extern const struct iwl_cfg_trans_params iwl_gl_trans_cfg; extern const struct iwl_cfg_trans_params iwl_sc_trans_cfg; +extern const struct iwl_cfg_trans_params iwl_dr_trans_cfg; +extern const struct iwl_cfg_trans_params iwl_br_trans_cfg; extern const char iwl9162_name[]; extern const char iwl9260_name[]; extern const char iwl9260_1_name[]; @@ -550,6 +556,8 @@ extern const char iwl_mtp_name[]; extern const char iwl_sc_name[]; extern const char iwl_sc2_name[]; extern const char iwl_sc2f_name[]; +extern const char iwl_dr_name[]; +extern const char iwl_br_name[]; #if IS_ENABLED(CONFIG_IWLDVM) extern const struct iwl_cfg iwl5300_agn_cfg; extern const struct iwl_cfg iwl5100_agn_cfg; @@ -657,6 +665,8 @@ extern const struct iwl_cfg iwl_cfg_gl; extern const struct iwl_cfg iwl_cfg_sc; extern const struct iwl_cfg iwl_cfg_sc2; extern const struct iwl_cfg iwl_cfg_sc2f; +extern const struct iwl_cfg iwl_cfg_dr; +extern const struct iwl_cfg iwl_cfg_br; #endif /* CONFIG_IWLMVM */ #endif /* __IWL_CONFIG_H__ */ diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index 805fb249a0c6..8297d56815fa 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -540,6 +540,9 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = { {IWL_PCI_DEVICE(0xE340, PCI_ANY_ID, iwl_sc_trans_cfg)}, {IWL_PCI_DEVICE(0xD340, PCI_ANY_ID, iwl_sc_trans_cfg)}, {IWL_PCI_DEVICE(0x6E70, PCI_ANY_ID, iwl_sc_trans_cfg)}, + +/* Dr devices */ + {IWL_PCI_DEVICE(0x272F, PCI_ANY_ID, iwl_dr_trans_cfg)}, #endif /* CONFIG_IWLMVM */ {0} @@ -1147,6 +1150,19 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = { IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, iwl_cfg_sc2f, iwl_sc2f_name), +/* Dr */ + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_MAC_TYPE_DR, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + iwl_cfg_dr, iwl_dr_name), + +/* Br */ + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_MAC_TYPE_BR, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + iwl_cfg_br, iwl_br_name), #endif /* CONFIG_IWLMVM */ }; EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_dev_info_table); From patchwork Thu Dec 26 15:44:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854627 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 894071459F6 for ; Thu, 26 Dec 2024 15:45:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227932; cv=none; b=a22e9Nz79ka4fTI4UDByh6fwmz/XYpmlj5Cs8MqCgaTPDYQ+E7gLyaMnz/FmZrTAlBk4mdWZsCSTmztAWDDBfR76E3LtNNp+VD8ePLa8W+M6U+bDaSnCbhREsHTSl9IKS1BaFMGrTUU29L7kWkD42BmwJl9moZM3nWKv8/coFqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227932; c=relaxed/simple; bh=6m9OvXIC+QOct4HYhtzlylE+PVSIpUo2d2WDRQmqSK4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MYX+qzWEkyIhFBy3/TMWZdkeDXPWBl2z1cTrXmUqK7nuieI25tizpqk9buqtFUWgws+6Xl/h4lnerCFEvgttE1nk0sbtoa3+yzH25IjoIxKqyMq9vzzVHgo7PM2E/M8zMgyrUKptUckqxK+sM9lkgWUz8pT6UyfYeQY+ND0WSfo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=QCh0sh6M; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="QCh0sh6M" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227930; x=1766763930; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6m9OvXIC+QOct4HYhtzlylE+PVSIpUo2d2WDRQmqSK4=; b=QCh0sh6MkzMzOLWoiSjx+BpjM+4xGaJEfEX6uGJ40UFJfbfK12D+23ss LpjNBg1gSkWVGUP5V6wqLUTrpxdaPzlFNT9JxSJ/0JgnBV7zLtQiNmLF1 v8+QyJzoebZ4ZNocq2PoqSJukvYQ/cSKc2YA3OHR3EjLs+ZCupvyeRPkq 4j1Rs+X08tBmyrnTg896fmeI9CjVeai+R07DeiqFXro55A3+jI4MbIKIP nunutIYB/D7C1eAg/XmfobAxMYx9fytxa6FIou0rVWVvfYPJBO4QTgZOL cd7Bzuii9hJiOeC2o5GKuj6j7vX5W01pTgK9pTUQ6hJiTDBs1YRc7vqH8 Q==; X-CSE-ConnectionGUID: tw5GtdF+T/2V9gWfcl6MQw== X-CSE-MsgGUID: lf6XS5AaRxaYQAfq8faUtQ== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878162" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878162" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:30 -0800 X-CSE-ConnectionGUID: +f8bfzg8S4aoV5AOtUo5jg== X-CSE-MsgGUID: e+SsLCnuQzOu1AicZhMh3g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99778011" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:29 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay , Johannes Berg Subject: [PATCH 13/15] wifi: iwlwifi: mvm: Use IWL_FW_CHECK() for BAR notif size validation Date: Thu, 26 Dec 2024 17:44:54 +0200 Message-Id: <20241226174257.913d5d476929.I8cd62f45bacc088c309b0152fc392dc2579e82e0@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Daniel Gabay Use IWL_FW_CHECK() for BAR notification size validation, improving diagnostics with a clear error message on failure. Signed-off-by: Daniel Gabay Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index e8ea48936c2d..c03cb7cc2f1c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -2507,9 +2507,12 @@ void iwl_mvm_rx_bar_frame_release(struct iwl_mvm *mvm, struct napi_struct *napi, struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_bar_frame_release *release = (void *)pkt->data; struct iwl_mvm_baid_data *baid_data; + u32 pkt_len = iwl_rx_packet_payload_len(pkt); unsigned int baid, nssn, sta_id, tid; - if (unlikely(iwl_rx_packet_payload_len(pkt) < sizeof(*release))) + if (IWL_FW_CHECK(mvm, pkt_len < sizeof(*release), + "Unexpected frame release notif size %d (expected %zu)\n", + pkt_len, sizeof(*release))) return; baid = le32_get_bits(release->ba_info, From patchwork Thu Dec 26 15:44:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 853830 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A9CF5136351 for ; Thu, 26 Dec 2024 15:45:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227934; cv=none; b=mxgCBGFZXxpaiJTEbLygd6ioHzTJN5yY0F24qWcGCZKKtqhBklq9dBOhQ9x+b0j57XeV7MMLw82FOXJUZwj/+NSJlO/jYdAOOr005HFJSQAz+cCtb1JPT+jrQ7ZtMcoiTU/BSjXJHrkwpxs7pfSYLje9/PH+h/j9HXP6cY+8INg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227934; c=relaxed/simple; bh=z2rktBpXOHvOR8pbr2KNQckboYnWrf7LPwm1WqvKdB0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=TIo+esn++yGeyhG3ZNeHrC8MFC3uw7Ahrr+gKbea9hqXWU4gusiILJvrA+3Q+iu0qdSW+7PR1jiABpa4Hm54L3d8rQbyDu0gVG8Iwfj68FL+ogyKARyQrLGVU8HtzrvKhTXX9kI0aGDQCQNZKQfo3hhZTcPJGZOa8IIWWCDXb3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AAtg6CH/; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AAtg6CH/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227933; x=1766763933; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=z2rktBpXOHvOR8pbr2KNQckboYnWrf7LPwm1WqvKdB0=; b=AAtg6CH/SLCqVETIdgFsG2feRimFF1Gj2Dt1HW2tO7aYpFhyOjExj6OJ P9g8T9UNK4Z1zHFWmSQFW6qQ8gmlMRS1Rbu/fc/ULgWZm7FLESDw8MuEL 6OVy0nGhGM+jNpXH8Hm6y/fIanH0MrmhIOeStsHNRWxNqkwDlLFTB9peA sxb4cG/ASJ6IbPp+seEj3oVi/0JE3hGCuHxwOBcTtAytuv50YeTVfBeVu GrN9GD86u6mEDapClF0pO1xoYNDeIN6vV8d5d4moV4/yx4/ASV5NGeR3I R9ZcPFEfZGpbjMVb5TqqOulPMP7MhEt/8rSGlwg5UiXTP1sF2W9KN8xgr Q==; X-CSE-ConnectionGUID: km/643FjTcSc0NZquanNjA== X-CSE-MsgGUID: R2acjCeLT86nMegxyzoI1g== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878165" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878165" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:32 -0800 X-CSE-ConnectionGUID: Z1cav9VSS+O9VQ5+WRPp8w== X-CSE-MsgGUID: cdBzjmg+QRKjvEDnNTuiiw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99778014" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:31 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu , Johannes Berg Subject: [PATCH 14/15] wifi: iwlwifi: mvm: add UHB canada support in TAS_CONFIG cmd Date: Thu, 26 Dec 2024 17:44:55 +0200 Message-Id: <20241226174257.0b1d92ad59b8.Ib80f8514a64fc2800a2a20131e730c2bd9c4c4af@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Anjaneyulu extend TAS table support to revision 2 for getting UHB canada enablement from BIOS and send to firmware via TAS_CONFIG cmd based on firmware capability. While on it fixed kernel-doc for struct iwl_tas_config_cmd_v4. Signed-off-by: Anjaneyulu Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 6 +++--- .../net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 15 ++++++++++++--- drivers/net/wireless/intel/iwlwifi/fw/file.h | 2 ++ .../net/wireless/intel/iwlwifi/fw/regulatory.c | 7 ++++++- .../net/wireless/intel/iwlwifi/fw/regulatory.h | 10 ++++++---- drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 7 +++++-- drivers/net/wireless/intel/iwlwifi/fw/uefi.h | 3 ++- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 4 ++++ 8 files changed, 40 insertions(+), 14 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index 0bc32291815e..7d6e6c80b892 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -274,13 +274,13 @@ int iwl_acpi_get_tas_table(struct iwl_fw_runtime *fwrt, goto out_free; } - if (tbl_rev == 1 && wifi_pkg->package.elements[1].type == - ACPI_TYPE_INTEGER) { + if ((tbl_rev == 2 || tbl_rev == 1) && + wifi_pkg->package.elements[1].type == ACPI_TYPE_INTEGER) { u32 tas_selection = (u32)wifi_pkg->package.elements[1].integer.value; enabled = iwl_parse_tas_selection(fwrt, tas_data, - tas_selection); + tas_selection, tbl_rev); } else if (tbl_rev == 0 && wifi_pkg->package.elements[1].type == ACPI_TYPE_INTEGER) { 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 d424d0126367..1bf549775c7c 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h @@ -463,19 +463,28 @@ struct iwl_tas_config_cmd_v3 { __le16 enable_tas_iec; } __packed; /* TAS_CONFIG_CMD_API_S_VER_3 */ +/** + * enum iwl_tas_uhb_allowed_flags - per country TAS UHB allowed flags. + * @TAS_UHB_ALLOWED_CANADA: TAS UHB is allowed in Canada. This flag is valid + * only when fw has %IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT capability. + */ +enum iwl_tas_uhb_allowed_flags { + TAS_UHB_ALLOWED_CANADA = BIT(0), +}; + /** * struct iwl_tas_config_cmd_v4 - configures the TAS * @override_tas_iec: indicates whether to override default value of IEC regulatory * @enable_tas_iec: in case override_tas_iec is set - * indicates whether IEC regulatory is enabled or disabled * @usa_tas_uhb_allowed: if set, allow TAS UHB in the USA - * @reserved: reserved -*/ + * @uhb_allowed_flags: see &enum iwl_tas_uhb_allowed_flags. + */ struct iwl_tas_config_cmd_v4 { u8 override_tas_iec; u8 enable_tas_iec; u8 usa_tas_uhb_allowed; - u8 reserved; + u8 uhb_allowed_flags; } __packed; /* TAS_CONFIG_CMD_API_S_VER_4 */ struct iwl_tas_config_cmd { diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h index f5fbe7692f6c..dce61869a7e3 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/file.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h @@ -400,6 +400,7 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t; * passive channels * @IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA: supports (de)activating 5G9 * for CA from BIOS. + * @IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT: supports %TAS_UHB_ALLOWED_CANADA * * @NUM_IWL_UCODE_TLV_CAPA: number of bits used */ @@ -501,6 +502,7 @@ enum iwl_ucode_tlv_capa { IWL_UCODE_TLV_CAPA_SECURE_LTF_SUPPORT = (__force iwl_ucode_tlv_capa_t)121, IWL_UCODE_TLV_CAPA_MONITOR_PASSIVE_CHANS = (__force iwl_ucode_tlv_capa_t)122, IWL_UCODE_TLV_CAPA_BIOS_OVERRIDE_5G9_FOR_CA = (__force iwl_ucode_tlv_capa_t)123, + IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT = (__force iwl_ucode_tlv_capa_t)124, NUM_IWL_UCODE_TLV_CAPA /* * This construction make both sparse (which cannot increment the previous diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c index 4b5eeff4a140..c89ff380b86d 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.c @@ -426,10 +426,12 @@ IWL_EXPORT_SYMBOL(iwl_is_tas_approved); int iwl_parse_tas_selection(struct iwl_fw_runtime *fwrt, struct iwl_tas_data *tas_data, - const u32 tas_selection) + const u32 tas_selection, u8 tbl_rev) { u8 override_iec = u32_get_bits(tas_selection, IWL_WTAS_OVERRIDE_IEC_MSK); + u8 canada_tas_uhb = u32_get_bits(tas_selection, + IWL_WTAS_CANADA_UHB_MSK); u8 enabled_iec = u32_get_bits(tas_selection, IWL_WTAS_ENABLE_IEC_MSK); u8 usa_tas_uhb = u32_get_bits(tas_selection, IWL_WTAS_USA_UHB_MSK); int enabled = tas_selection & IWL_WTAS_ENABLED_MSK; @@ -441,6 +443,9 @@ int iwl_parse_tas_selection(struct iwl_fw_runtime *fwrt, tas_data->override_tas_iec = override_iec; tas_data->enable_tas_iec = enabled_iec; + if (tbl_rev > 1) + tas_data->canada_tas_uhb_allowed = canada_tas_uhb; + return enabled; } diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h index 4ced1711d913..f247d31ebdd6 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h @@ -43,6 +43,7 @@ #define IWL_WTAS_ENABLED_MSK 0x1 #define IWL_WTAS_OVERRIDE_IEC_MSK 0x2 #define IWL_WTAS_ENABLE_IEC_MSK 0x4 +#define IWL_WTAS_CANADA_UHB_MSK BIT(15) #define IWL_WTAS_USA_UHB_MSK BIT(16) #define BIOS_MCC_CHINA 0x434e @@ -99,9 +100,10 @@ struct iwl_ppag_chain { struct iwl_tas_data { __le32 block_list_size; __le32 block_list_array[IWL_WTAS_BLACK_LIST_MAX]; - u8 override_tas_iec; - u8 enable_tas_iec; - u8 usa_tas_uhb_allowed; + u8 override_tas_iec:1, + enable_tas_iec:1, + usa_tas_uhb_allowed:1, + canada_tas_uhb_allowed:1; }; /* For DSM revision 0 and 4 */ @@ -185,7 +187,7 @@ bool iwl_is_tas_approved(void); int iwl_parse_tas_selection(struct iwl_fw_runtime *fwrt, struct iwl_tas_data *tas_data, - const u32 tas_selection); + const u32 tas_selection, u8 tbl_rev); int iwl_bios_get_wrds_table(struct iwl_fw_runtime *fwrt); diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c index 091fb6fd7c78..dcbb3c387c10 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c @@ -561,7 +561,8 @@ int iwl_uefi_get_tas_table(struct iwl_fw_runtime *fwrt, if (IS_ERR(uefi_tas)) return -EINVAL; - if (uefi_tas->revision != IWL_UEFI_WTAS_REVISION) { + if (uefi_tas->revision < IWL_UEFI_MIN_WTAS_REVISION || + uefi_tas->revision > IWL_UEFI_MAX_WTAS_REVISION) { ret = -EINVAL; IWL_DEBUG_RADIO(fwrt, "Unsupported UEFI WTAS revision:%d\n", uefi_tas->revision); @@ -569,7 +570,9 @@ int iwl_uefi_get_tas_table(struct iwl_fw_runtime *fwrt, } enabled = iwl_parse_tas_selection(fwrt, tas_data, - uefi_tas->tas_selection); + uefi_tas->tas_selection, + uefi_tas->revision); + if (!enabled) { IWL_DEBUG_RADIO(fwrt, "TAS not enabled\n"); ret = 0; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h index e525d449e656..4e98f752b3d2 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h @@ -33,7 +33,8 @@ #define IWL_UEFI_WGDS_REVISION 3 #define IWL_UEFI_MIN_PPAG_REV 1 #define IWL_UEFI_MAX_PPAG_REV 3 -#define IWL_UEFI_WTAS_REVISION 1 +#define IWL_UEFI_MIN_WTAS_REVISION 1 +#define IWL_UEFI_MAX_WTAS_REVISION 2 #define IWL_UEFI_SPLC_REVISION 0 #define IWL_UEFI_WRDD_REVISION 0 #define IWL_UEFI_ECKV_REVISION 0 diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c index 5ea684802ad1..029347b79655 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c @@ -1171,6 +1171,10 @@ static void iwl_mvm_tas_init(struct iwl_mvm *mvm) cmd.v4.override_tas_iec = data.override_tas_iec; cmd.v4.enable_tas_iec = data.enable_tas_iec; cmd.v4.usa_tas_uhb_allowed = data.usa_tas_uhb_allowed; + if (fw_has_capa(&mvm->fw->ucode_capa, + IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT) && + data.canada_tas_uhb_allowed) + cmd.v4.uhb_allowed_flags = TAS_UHB_ALLOWED_CANADA; } else { cmd.v3.override_tas_iec = cpu_to_le16(data.override_tas_iec); cmd.v3.enable_tas_iec = cpu_to_le16(data.enable_tas_iec); From patchwork Thu Dec 26 15:44:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 854626 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D9ECB136353 for ; Thu, 26 Dec 2024 15:45:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227935; cv=none; b=UdKARM6AZiMVYhnJs3thjdgLHC98aQVtQL2DUsDwCLwZzAZXeHfIU1c8Shl0Kk46D3ta0zUviXtrUnr5R6eXlhl1cvUSsvBwjnUZslA9/RHl8AscD/w62HxyEOETzWfmLcoKcpdaGNPkVrqNshm2/6SBdtr6wkQnviKFGsgEoxQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735227935; c=relaxed/simple; bh=7M8OAVccliqQDhLFf8kYGf5QAmnsMo1lVHGu19sQug0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WM54ONKpsf5GfBkUiaaU39LAF0L+Xbdk0zSRygX5AsICM+7rXqHlY5BmuH0h0WpZtm+a9M6Zat7Ud0IyVJCWzWrh0RkTxbTD1iLHRmnbZxVFw3/1PXWAIuJJ3OY2w2HYrZHD8MTJUOw5DIgdjWUsuI87pF436aU4Yu+T0kNSQ60= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=NFE9VWix; arc=none smtp.client-ip=192.198.163.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NFE9VWix" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1735227934; x=1766763934; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7M8OAVccliqQDhLFf8kYGf5QAmnsMo1lVHGu19sQug0=; b=NFE9VWixUro+teF+uzzoNV7cvW4aAuTlplh43PPy2vA6WjcSk74+8CzW Drd+IpRnJ5u3cpzWE0cHp5rwjhQkzHyqIVT9EpNRqLEE9UyW7R0+sJdPA m9+3K3sJJWi25/n1AZESZJCdn1aKeVQqod410eJydJ4kuuKZuthMkYmPo afH0Uf3SPgZU2kbXEgKOXr3r0hRp4lheIlB1tUvJsXqin4exEJC4s8x+h /CdQTaZ/An++8joWEBTw34a1SvOSH/KqtO7Tvn+1un43EIbxsAuTASpTG KcUbN5v7Ng7JytE1oRL5H1co7E8PdAJXICiv2+rbjetVEVB3asRtro579 w==; X-CSE-ConnectionGUID: H69zwrxxRKKAR9iSxQOCZQ== X-CSE-MsgGUID: bwpENJbgRKel24KZlxh3cA== X-IronPort-AV: E=McAfee;i="6700,10204,11296"; a="35878176" X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="35878176" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:33 -0800 X-CSE-ConnectionGUID: MdetaFXJRsucPFoswDbmJQ== X-CSE-MsgGUID: T4UJY07gTCafRfOzHKEXaA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,266,1728975600"; d="scan'208";a="99778017" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Dec 2024 07:45:32 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu Subject: [PATCH 15/15] wifi: iwlwifi: mvm: add UHB canada support in GET_TAS_STATUS cmd resp Date: Thu, 26 Dec 2024 17:44:56 +0200 Message-Id: <20241226174257.dfd6b8893322.I196393dc3c9c28882f90b43a821a2d76a5c9a046@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> References: <20241226154456.473690-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Anjaneyulu dump UHB canada is enabled or not based on firmware capability. Signed-off-by: Anjaneyulu Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/api/debug.h | 6 +++++- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h index bea0f4668cc8..aa88e91d117e 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/debug.h @@ -477,6 +477,9 @@ struct iwl_mvm_tas_status_per_mac { * @tas_status_mac: TAS status per lmac, uses * &struct iwl_mvm_tas_status_per_mac * @in_dual_radio: is TAS in dual radio? - TRUE/FALSE + * @uhb_allowed_flags: see &enum iwl_tas_uhb_allowed_flags. + * This member is valid only when fw has + * %IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT capability. * @reserved: reserved */ struct iwl_mvm_tas_status_resp { @@ -486,7 +489,8 @@ struct iwl_mvm_tas_status_resp { __le16 block_list[16]; struct iwl_mvm_tas_status_per_mac tas_status_mac[2]; u8 in_dual_radio; - u8 reserved[3]; + u8 uhb_allowed_flags; + u8 reserved[2]; } __packed; /*DEBUG_GET_TAS_STATUS_RSP_API_S_VER_3*/ /** diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 91ca830a7b60..ccf377a6d73d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -659,6 +659,14 @@ static ssize_t iwl_dbgfs_tas_get_status_read(struct file *file, rsp->tas_fw_version); pos += scnprintf(pos, endpos - pos, "Is UHB enabled for USA?: %s\n", rsp->is_uhb_for_usa_enable ? "True" : "False"); + + if (fw_has_capa(&mvm->fw->ucode_capa, + IWL_UCODE_TLV_CAPA_UHB_CANADA_TAS_SUPPORT)) + pos += scnprintf(pos, endpos - pos, + "Is UHB enabled for CANADA?: %s\n", + rsp->uhb_allowed_flags & + TAS_UHB_ALLOWED_CANADA ? "True" : "False"); + pos += scnprintf(pos, endpos - pos, "Current MCC: 0x%x\n", le16_to_cpu(rsp->curr_mcc));