From patchwork Thu Aug 8 20:22:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13758165 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 78D72146A69 for ; Thu, 8 Aug 2024 20:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148585; cv=none; b=sXBCy5MhFNSG8D3QP6gblqCzOCloTjVHsg9+hs3/tgOV0QsKIZwcO/JjAlD04wvb2cNh/qLrZV8FNjtdM0V7GNElmk8H8J1zkmLiL0aXmFOzoCa52NaSEHsr5xi5UUD2s0IEN3H540u8GCcTn871MO9rQz4MaKa4L6l8fEYHsPM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148585; c=relaxed/simple; bh=lURc50s5V+S3Sowi67xOdFvrm7KNjCkK24/9Ytssmz8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MquxQyvy1zMf0blBiBsdGtufsp6nV36fPYx0V8gKE0t1w01KoJgOEItH4cgLnT8NM+ZgBgIDYPhgPEerhFx1V9DkEJPO3WOEWiaw6YNA1OkwrFvDYvvNeu2tEILaWABxmQ0rKake+FEcq7XfhYUqiwP6aTy/QhNvG0Ug43wbhy8= 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=elZ29iR7; arc=none smtp.client-ip=192.198.163.8 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="elZ29iR7" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148584; x=1754684584; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=lURc50s5V+S3Sowi67xOdFvrm7KNjCkK24/9Ytssmz8=; b=elZ29iR7CzsdGiFz2WRXzUlrUY4ZuAZChWX/KA0fP4GwSDfkgqurv8BB s4uLiyC1wD4GGcECVidqj/7kVJN39jLYGDYnexjenmVfdJOpxv+valXjW i6zXO8zhiwLAXwq3tkt7/qPGigb1xOsrhfnHmZzbFvMIJvmUnFR16DVWK 6og25MyHrOgO/7Z820O1YRajuomQ402JJbO+/XHETUjw7nHrkgZDo6Soc eNcOwrUeNDeqfid3SeIsDj5lZPy9JUSqT++aHLz/9rvKlDyG6wnQroD/M j5DaKkFawBLB/w52i78c5ksqlJnG0vWxxDWNPTMElZngbsDb7bYHnt3hd g==; X-CSE-ConnectionGUID: 1NUSCvArS3iMWxdQjcD6eA== X-CSE-MsgGUID: YICXDmd1RTKbFlXYHDYz3w== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808827" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808827" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:03 -0700 X-CSE-ConnectionGUID: jcRVIFv5Tf6wZP1HB7Nr8w== X-CSE-MsgGUID: aTrFABGFSDGc7W6DkvsnYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305276" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:01 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay , Johannes Berg Subject: [PATCH 01/13] wifi: iwlwifi: mvm: Offload RLC/SMPS functionality to firmware Date: Thu, 8 Aug 2024 23:22:37 +0300 Message-Id: <20240808232017.45da23be1f65.I0d46db82dd990a82e8a66876fe2f5310bc9513be@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 Currently, the driver handles SMPS decisions by tracking AP capabilities, BT coexistence changes, sending necessary SMPS frames to the AP, and updating firmware with RX chain info using the RLC_CONFIG_CMD. Starting with version 3 of the RLC_CONFIG_CMD, the firmware takes over this responsibility. It now tracks SMPS, sends frames, and configures the RLC. In this patch: 1. Stop sending RLC_CONFIG_CMD when firmware supports RLC offload (version 3), as rlc.rx_chain_info is not needed by firmware, and no other field in the cmd is used. 2. Prevent the driver from forwarding any SMPS requests to mac80211, i.e., the driver should not transmit SMPS frames to the AP as firmware handles that. 3. Set NL80211_FEATURE_DYNAMIC_SMPS and NL80211_FEATURE_STATIC_SMPS conditionally based on RLC version. Signed-off-by: Daniel Gabay Reviewed-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 +++++++-- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 7 +++++++ drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 6 ++++++ drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c | 6 +++++- drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 4 ++++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index d6f4caa939bd..af892c8291d4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -635,10 +635,15 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm) NL80211_FEATURE_LOW_PRIORITY_SCAN | NL80211_FEATURE_P2P_GO_OPPPS | NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE | - NL80211_FEATURE_DYNAMIC_SMPS | - NL80211_FEATURE_STATIC_SMPS | NL80211_FEATURE_SUPPORTS_WMM_ADMISSION; + /* when firmware supports RLC/SMPS offload, do not set these + * driver features, since it's no longer supported by driver. + */ + if (!iwl_mvm_has_rlc_offload(mvm)) + hw->wiphy->features |= NL80211_FEATURE_STATIC_SMPS | + NL80211_FEATURE_DYNAMIC_SMPS; + if (fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_TXPOWER_INSERTION_SUPPORT)) hw->wiphy->features |= NL80211_FEATURE_TX_POWER_INSERTION; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index bd754b8a71fc..4cacaa7b398e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -1768,6 +1768,13 @@ static inline u8 iwl_mvm_mac_ac_to_tx_fifo(struct iwl_mvm *mvm, return iwl_mvm_ac_to_tx_fifo[ac]; } +static inline bool iwl_mvm_has_rlc_offload(struct iwl_mvm *mvm) +{ + return iwl_fw_lookup_cmd_ver(mvm->fw, + WIDE_ID(DATA_PATH_GROUP, RLC_CONFIG_CMD), + 0) >= 3; +} + struct iwl_rate_info { u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */ u8 plcp_siso; /* uCode API: IWL_RATE_SISO_6M_PLCP, etc. */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 8896d9792feb..be20c8e3a389 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -261,6 +261,12 @@ static void iwl_mvm_rx_thermal_dual_chain_req(struct iwl_mvm *mvm, struct iwl_rx_packet *pkt = rxb_addr(rxb); struct iwl_thermal_dual_chain_request *req = (void *)pkt->data; + /* firmware is expected to handle that in RLC offload mode */ + if (IWL_FW_CHECK(mvm, iwl_mvm_has_rlc_offload(mvm), + "Got THERMAL_DUAL_CHAIN_REQUEST (0x%x) in RLC offload mode\n", + req->event)) + return; + /* * We could pass it to the iterator data, but also need to remember * it for new interfaces that are added while in this state. diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c index ce264b386029..7cab5373c8ae 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c @@ -159,7 +159,11 @@ int iwl_mvm_phy_send_rlc(struct iwl_mvm *mvm, struct iwl_mvm_phy_ctxt *ctxt, .phy_id = cpu_to_le32(ctxt->id), }; - if (ctxt->rlc_disabled) + /* From version 3, RLC is offloaded to firmware, so the driver no + * longer needs to send cmd.rlc, note that we are not using any + * other fields in the command - don't send it. + */ + if (iwl_mvm_has_rlc_offload(mvm) || ctxt->rlc_disabled) return 0; if (iwl_fw_lookup_cmd_ver(mvm->fw, WIDE_ID(DATA_PATH_GROUP, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index 0e5fa8374103..edcc6e2cb76a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c @@ -297,6 +297,10 @@ void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (vif->type != NL80211_IFTYPE_STATION) return; + /* SMPS is handled by firmware */ + if (iwl_mvm_has_rlc_offload(mvm)) + return; + mvmvif = iwl_mvm_vif_from_mac80211(vif); if (WARN_ON_ONCE(!mvmvif->link[link_id])) From patchwork Thu Aug 8 20:22:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13758166 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 7998D155A25 for ; Thu, 8 Aug 2024 20:23:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148586; cv=none; b=THvE6YeeOqsMO2Ta1Af7nWFfPF4fh/Bli4Hyk+VrS1uorj5K6Ku7vga3xQeFlTHDEpjkkLB2q/N7PoY4sM42i8TahiA/FYlm9Qb2mxlRHdh4VZ8vFg/7ywHp3yUAfxs4d+4uHqcfPoXYhnIfvpPcmzVPZekoAdEgoEtvvoAorOE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148586; c=relaxed/simple; bh=8LtJ2Yc+UKzDnGNMjIQcmLl6PDDATWxUwyAULVDgAeQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=iv5feTICsOehCB2z8MV51mEDjWaZ0Fq7HWjRR8fKSFb5dzwvM1LTOUMfO1skJdQB+ugCd2fk/CGhjYAkoreFNprQU/KBar9fR4b74fS9eGFChEJfYDEWrcPka/mWoeX1znAzLGvvv5bx7Q8MIZhp6D3P+T4o5saDmoFyb78Db6c= 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=dbFZ9jsj; arc=none smtp.client-ip=192.198.163.8 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="dbFZ9jsj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148585; x=1754684585; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8LtJ2Yc+UKzDnGNMjIQcmLl6PDDATWxUwyAULVDgAeQ=; b=dbFZ9jsj1TEkCnVjYrRp++LXcdilMXCxlCVfpcl8iJQcAX52d7yLuUU2 16NZi7WoxRJQGkEEcXDxdgwCtJMe6ziufG09JaK21/ZcX+Y65kYjAqew9 7/ucgBlXVrFZ3mRdhqrKZveA/UD5YyVdlIN/O3P/PELQ8yjTrTDLW+2Nf JpLjzv1aKnSwnoWxHBqRENcUh3SBwnAGvmFM4IP1IGFz/2JdffwCAi2rj 1YVo2J403NmpbzDjGbbY0SM8+bMPzNM7s6BLBlZ8NAA3BmfOf3bffizwH T+dHU2sPObtx/wJimXy4ew29Q4W+PhWjYZ/ps9GSxopMQ287nelTs4Ld8 g==; X-CSE-ConnectionGUID: JXPzUofYScOKd6jMTfRBMA== X-CSE-MsgGUID: ZCGx6Q4dSB6/Yup/E1v7Iw== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808833" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808833" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:04 -0700 X-CSE-ConnectionGUID: d3BjZYVuSUq0neW4NLCWPw== X-CSE-MsgGUID: eM8kUs8+STaF3RXrQ2sIxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305283" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:02 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 02/13] wifi: iwlwifi: mvm: rename iwl_missed_beacons_notif Date: Thu, 8 Aug 2024 23:22:38 +0300 Message-Id: <20240808232017.b5c3a83a05ef.I698611582b5ca8395f42a535c51f7230307e2c6f@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 A new version is coming up. Rename the current struct to include the current version. s/iwl_missed_beacons_notif/iwl_missed_beacons_notif_v4 Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/api/commands.h | 2 +- drivers/net/wireless/intel/iwlwifi/fw/api/mac.h | 4 ++-- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h index 377fac278511..852ea5d14051 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/commands.h @@ -401,7 +401,7 @@ enum iwl_legacy_cmds { REDUCE_TX_POWER_CMD = 0x9f, /** - * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif + * @MISSED_BEACONS_NOTIFICATION: &struct iwl_missed_beacons_notif_v4 */ MISSED_BEACONS_NOTIFICATION = 0xa2, diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h b/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h index bcbbf8c4a297..490215e71e5d 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h @@ -378,7 +378,7 @@ struct iwl_missed_beacons_notif_ver_3 { } __packed; /* MISSED_BEACON_NTFY_API_S_VER_3 */ /** - * struct iwl_missed_beacons_notif - information on missed beacons + * struct iwl_missed_beacons_notif_v4 - information on missed beacons * ( MISSED_BEACONS_NOTIFICATION = 0xa2 ) * @link_id: fw link ID * @consec_missed_beacons_since_last_rx: number of consecutive missed @@ -387,7 +387,7 @@ struct iwl_missed_beacons_notif_ver_3 { * @num_expected_beacons: number of expected beacons * @num_recvd_beacons: number of received beacons */ -struct iwl_missed_beacons_notif { +struct iwl_missed_beacons_notif_v4 { __le32 link_id; __le32 consec_missed_beacons_since_last_rx; __le32 consec_missed_beacons; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index dfcc96f18b4f..9209814b465c 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1590,7 +1590,7 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { struct iwl_rx_packet *pkt = rxb_addr(rxb); - struct iwl_missed_beacons_notif *mb = (void *)pkt->data; + struct iwl_missed_beacons_notif_v4 *mb = (void *)pkt->data; struct iwl_fw_dbg_trigger_missed_bcon *bcon_trig; struct iwl_fw_dbg_trigger_tlv *trigger; u32 stop_trig_missed_bcon, stop_trig_missed_bcon_since_rx; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index be20c8e3a389..dd2631ff452d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -396,7 +396,7 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { RX_HANDLER(MISSED_BEACONS_NOTIFICATION, iwl_mvm_rx_missed_beacons_notif, RX_HANDLER_ASYNC_LOCKED_WIPHY, - struct iwl_missed_beacons_notif), + struct iwl_missed_beacons_notif_v4), RX_HANDLER(REPLY_ERROR, iwl_mvm_rx_fw_error, RX_HANDLER_SYNC, struct iwl_error_resp), From patchwork Thu Aug 8 20:22:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13758167 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 09D4D158DA0 for ; Thu, 8 Aug 2024 20:23:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148588; cv=none; b=k+9FRk+FlhlFvmfYTWRqWNS6sZlctJTucRcoQTOwtBmZSyzi8k5Suqmf8aJWHHSywKHQv0AyB4Ol+58zaZD+x0FaJuF2GAkoISnEy4tSpOrkrDdD4KmY6NKYCSoTCFSoe2ePb5vW3NspPf6Mazv1qPx7sz/cJ81jVk7hvBkoPI0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148588; c=relaxed/simple; bh=kWLKIOFTnqErhnq/7X3ep8qEyoWgLJNIM6KpB3wyL80=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=T7ygAP+zTepzAuzWD/iomaDMJ847RP7NiAE5y6CSiWGutKdqnP4Bx2HP/y/0fD+yq7xNfMN/8sCF3n9/b9MjNFd76pR/nnHu4PSsrFL1dJXb4+FT+pJLx0DIM7sZh4RJz5ZmnIBPZxNdWER7A7qfRbTEVluG7psaJH3g3JYrchw= 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=RTvkxM3M; arc=none smtp.client-ip=192.198.163.8 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="RTvkxM3M" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148586; x=1754684586; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kWLKIOFTnqErhnq/7X3ep8qEyoWgLJNIM6KpB3wyL80=; b=RTvkxM3Mb3L/ulYxkxG1G+rFwnX+oIPFMo2VRJGPWuNukrGaN0KTjCOl cuVDN3Hx+lEiTcjuwU+EPcN8GMMOitX1JlGRu9JMN+77vHIY84rcaNawd FDcRfF45MXfAEUtMidSItVCqFiBxbEqAqHTvaANnZRcqZ0gTcgrFejLDA /E+Ykc0lxQWledPwgun2kLHmIWvTBlnC5A1zw0Bq6HSpmebyoH9BdFE1e Yu8fF+zVTy/sS/t/Cox6xxsS6I7j7VbQA9OYOaurxHFJ6S04joJlDeTpN 9MjIWUwfA7falZIiVEuI/c7aQmX+5ztc82jlpHoQcdANExicc9rw7oVUw w==; X-CSE-ConnectionGUID: wsH+bBjBTZ+VIqJjcNg+uQ== X-CSE-MsgGUID: rZ+3rBLpRxaQA/IxdBolnQ== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808836" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808836" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:06 -0700 X-CSE-ConnectionGUID: MC6q+FYaSrmgG/naFnJmhA== X-CSE-MsgGUID: 5wd8X/83RW+omdlwtFgAzg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305287" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:04 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 03/13] wifi: iwlwifi: mvm: add the new API for the missed beacons notification Date: Thu, 8 Aug 2024 23:22:39 +0300 Message-Id: <20240808232017.4ea52360b32e.Ibc25dcabd8aeadda906549482a6c77bc42fb55bb@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 Note that the new API does not have the same notification ID as the previous notification: the new notification belongs to the group 0x3. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) 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 56b880e68870..5fc7967df6c5 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h @@ -61,6 +61,10 @@ enum iwl_mac_conf_subcmd_ids { * @ROC_CMD: &struct iwl_roc_req */ ROC_CMD = 0xE, + /** + * @MISSED_BEACONS_NOTIF: &struct iwl_missed_beacons_notif + */ + MISSED_BEACONS_NOTIF = 0xF6, /** * @ROC_NOTIF: &struct iwl_roc_notif */ @@ -665,4 +669,25 @@ struct iwl_mvm_esr_mode_notif { __le32 action; } __packed; /* ESR_MODE_RECOMMENDATION_NTFY_API_S_VER_1 */ +/** + * struct iwl_missed_beacons_notif - sent when by the firmware upon beacon loss + * ( MISSED_BEACONS_NOTIF = 0xF6 ) + * @link_id: fw link ID + * @consec_missed_beacons_since_last_rx: number of consecutive missed + * beacons since last RX. + * @consec_missed_beacons: number of consecutive missed beacons + * @other_link_id: used in EMLSR only. The fw link ID for + * &consec_missed_beacons_other_link. IWL_MVM_FW_LINK_ID_INVALID (0xff) if + * invalid. + * @consec_missed_beacons_other_link: number of consecutive missed beacons on + * &other_link_id. + */ +struct iwl_missed_beacons_notif { + __le32 link_id; + __le32 consec_missed_beacons_since_last_rx; + __le32 consec_missed_beacons; + __le32 other_link_id; + __le32 consec_missed_beacons_other_link; +} __packed; /* MISSED_BEACON_NTFY_API_S_VER_5 */ + #endif /* __iwl_fw_api_mac_cfg_h__ */ From patchwork Thu Aug 8 20:22:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13758168 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 7B05C155A25 for ; Thu, 8 Aug 2024 20:23:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148591; cv=none; b=G0rteiWo9WpoVpsDYObkOP7G7EYA0ByU3bFrkCpZYiy7UMN2vfkxL7mG2WjS/GIyDyFS29WzQpRS6ym1PlaMDsJvfOHH9LfbHssuwgN0SzJZKHb4cYXiDPzqxvvnQmREzhQTDc1udnQL7J7lNPxrLPO4kxtw8akq48CMtlV26Ng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148591; c=relaxed/simple; bh=S1EbqH5RJ+aYLz+GYv9bV9f/XN7u36bNismKc4ZJ8Fw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=P8SSZmqEjBVMnOQqpCks6BYkrRjK9eImHQfTpUbzCqK3tocBw0E1+4JQoNAGhVBJeZifAzu9p7h02ejaFAwttndgVs8qctLqSNL+KUf+F6ngCZonSJsmm4AGE7DEO9MjGPMs5lyVUeS42Cu3OYqfWNTiJvxAGVv8dD0KfDQXWN4= 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=G6ekyLjJ; arc=none smtp.client-ip=192.198.163.8 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="G6ekyLjJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148588; x=1754684588; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=S1EbqH5RJ+aYLz+GYv9bV9f/XN7u36bNismKc4ZJ8Fw=; b=G6ekyLjJCiUUzTK5H6KA6YCYqQLhintn24kguE32fgEfxwtSKEnM06tz ZanptbOmLsjJkdcOqeg10zTvecg7ABE5vLYJVArbtIlL9yCiChJFE042u QRzdkN66GowPzmRJ1QhuuiNSuL/o3R+zJ2TeBa2R/iYWbAwcHmeojMvFn 9K8lTklAQYLwdFxnSO49dFWzsAmUlyXCVBeS0YA1Ti3cs4R+BL2spPI+w 0WPZVLqJFg6eRgFFVidN9l0ZxMn/MUDf33Xk0KFR51o1vJ1+c51Pfe7Pv Tq9KN4uw3luSKDZoZMDwdOZu8163Z+CNZ85SeyBNzcby1LriieuhfBJgD w==; X-CSE-ConnectionGUID: 5HqUr1y8QW+0tfm/4rtZgw== X-CSE-MsgGUID: FrpdaOKuRRKcG8yYL9xxmw== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808839" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808839" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:07 -0700 X-CSE-ConnectionGUID: ryyJjK77QciD4/UHqvUYzg== X-CSE-MsgGUID: kl6dsuoATm6rFGAQZd4LBA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305291" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:05 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 04/13] wifi: iwlwifi: mvm: handle the new missed beacons notification Date: Thu, 8 Aug 2024 23:22:40 +0300 Message-Id: <20240808232017.a64ffc998569.I7d181052b1a69c331d07263f20c1e00cbc0bc891@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 Use the same handler for both types and just convert the old version to the new. Drop the unused fields from the old one and fake the new fields. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 49 ++++++++++++++++--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 + drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 7 ++- 3 files changed, 49 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 9209814b465c..4a8f50f8bb79 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1586,11 +1586,11 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, } } -void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, - struct iwl_rx_cmd_buffer *rxb) +static void +iwl_mvm_handle_missed_beacons_notif(struct iwl_mvm *mvm, + const struct iwl_missed_beacons_notif *mb, + struct iwl_rx_packet *pkt) { - struct iwl_rx_packet *pkt = rxb_addr(rxb); - struct iwl_missed_beacons_notif_v4 *mb = (void *)pkt->data; struct iwl_fw_dbg_trigger_missed_bcon *bcon_trig; struct iwl_fw_dbg_trigger_tlv *trigger; u32 stop_trig_missed_bcon, stop_trig_missed_bcon_since_rx; @@ -1604,6 +1604,16 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, u8 notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, LEGACY_GROUP, MISSED_BEACONS_NOTIFICATION, 0); + u8 new_notif_ver = iwl_fw_lookup_notif_ver(mvm->fw, MAC_CONF_GROUP, + MISSED_BEACONS_NOTIF, 0); + + /* If the firmware uses the new notification (from MAC_CONF_GROUP), + * refer to that notification's version. + * Note that the new notification from MAC_CONF_GROUP starts from + * version 5. + */ + if (new_notif_ver) + notif_ver = new_notif_ver; /* before version four the ID in the notification refers to mac ID */ if (notif_ver < 4) { @@ -1620,13 +1630,11 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, } IWL_DEBUG_INFO(mvm, - "missed bcn %s_id=%u, consecutive=%u (%u, %u, %u)\n", + "missed bcn %s_id=%u, consecutive=%u (%u)\n", notif_ver < 4 ? "mac" : "link", id, le32_to_cpu(mb->consec_missed_beacons), - le32_to_cpu(mb->consec_missed_beacons_since_last_rx), - le32_to_cpu(mb->num_recvd_beacons), - le32_to_cpu(mb->num_expected_beacons)); + le32_to_cpu(mb->consec_missed_beacons_since_last_rx)); if (!vif) return; @@ -1687,6 +1695,31 @@ void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, iwl_fw_dbg_collect_trig(&mvm->fwrt, trigger, NULL); } +void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb) +{ + struct iwl_rx_packet *pkt = rxb_addr(rxb); + + iwl_mvm_handle_missed_beacons_notif(mvm, (const void *)pkt->data, pkt); +} + +void iwl_mvm_rx_missed_beacons_notif_legacy(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb) +{ + struct iwl_rx_packet *pkt = rxb_addr(rxb); + const struct iwl_missed_beacons_notif_v4 *mb_v4 = + (const void *)pkt->data; + struct iwl_missed_beacons_notif mb = { + .link_id = mb_v4->link_id, + .consec_missed_beacons = mb_v4->consec_missed_beacons, + .consec_missed_beacons_since_last_rx = + mb_v4->consec_missed_beacons_since_last_rx, + .other_link_id = cpu_to_le32(IWL_MVM_FW_LINK_ID_INVALID), + }; + + iwl_mvm_handle_missed_beacons_notif(mvm, &mb, pkt); +} + void iwl_mvm_rx_stored_beacon_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 4cacaa7b398e..f9e676374daa 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -2073,6 +2073,8 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb); void iwl_mvm_rx_missed_beacons_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb); +void iwl_mvm_rx_missed_beacons_notif_legacy(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb); void iwl_mvm_rx_stored_beacon_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb); void iwl_mvm_mu_mimo_grp_notif(struct iwl_mvm *mvm, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index dd2631ff452d..0b91877592a8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -394,10 +394,15 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { iwl_mvm_rx_umac_scan_iter_complete_notif, RX_HANDLER_SYNC, struct iwl_umac_scan_iter_complete_notif), - RX_HANDLER(MISSED_BEACONS_NOTIFICATION, iwl_mvm_rx_missed_beacons_notif, + RX_HANDLER(MISSED_BEACONS_NOTIFICATION, + iwl_mvm_rx_missed_beacons_notif_legacy, RX_HANDLER_ASYNC_LOCKED_WIPHY, struct iwl_missed_beacons_notif_v4), + RX_HANDLER_GRP(MAC_CONF_GROUP, MISSED_BEACONS_NOTIF, + iwl_mvm_rx_missed_beacons_notif, + RX_HANDLER_ASYNC_LOCKED_WIPHY, + struct iwl_missed_beacons_notif), RX_HANDLER(REPLY_ERROR, iwl_mvm_rx_fw_error, RX_HANDLER_SYNC, struct iwl_error_resp), RX_HANDLER(PSM_UAPSD_AP_MISBEHAVING_NOTIFICATION, From patchwork Thu Aug 8 20:22:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 13758169 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 9541E158DA0 for ; Thu, 8 Aug 2024 20:23:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148591; cv=none; b=tgnGo3yE+brQG2YrqoxbRDKHX3NWukEtPHxi0ThlQXRzCGL7n0wiOcpU01oYLeSVEc0hlVd6gRxuFM/tuvTpdQF2AGKp8cZ80gF5R8b3lszcj9RPc9qTWaF8u7hek/1kHrQDvzNN7UhGGnj/Mz9IYMNigcOAxEm9pBGzP1LEQOg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148591; c=relaxed/simple; bh=D4BVSHmX4ElwQKiNcP/6xCd4Ibhq5EomBkNDwX/RX8M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Cm0V4oPFIsFux8qPA+nZLfLewITZvIQwzLVHqeayFZ9ICi+Z86JTFepn3WgCr8z4/05Jh0bM7wU2siyTGGtunHZ8mVYZG7lj1B/Lq7BnN0d2SHVx2Akt4vGPlJX1oMxbvQRjDghDFLiCMg7/bo/1L8wIat8mfm6c6T3z8VirDVg= 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=Nk+1lJiy; arc=none smtp.client-ip=192.198.163.8 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="Nk+1lJiy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148590; x=1754684590; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=D4BVSHmX4ElwQKiNcP/6xCd4Ibhq5EomBkNDwX/RX8M=; b=Nk+1lJiyWB5YuCIvIftYmLGVCqLDrBKtwTxkiSwq1pipcanWtCnSqyFq YnPKoeI2lis4dVYI4zm8N4izlLKiDNG7UOy07vDI5SNin9QQ/dGnJmc9s a0HAJP+AQH72mQkn84NLzoP2D6/LE8o0CP5LknidAbR+CM7BeONtkRMUR nMgWFe34rxPL6ToRmC06vc8/kBJ9qieUXlYcn47pHFMvYtIZDxEFZhK8A dMgyFgvbNIwMclQxor2My89hXuYYSOBF4FpQCwVKWzOEjmwfGERsZqps+ z85PePUaSgyznR1+qTonTKSql+Iaggk68AUS6OuYzMzyRYoefDDgFCdQ1 Q==; X-CSE-ConnectionGUID: +Dh4uBlDSDC+UjrojSxiDA== X-CSE-MsgGUID: H/ultLH8T2q61y7/GdRxqg== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808842" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808842" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:09 -0700 X-CSE-ConnectionGUID: C7BftDaqRqudEdjrXSyoxg== X-CSE-MsgGUID: v84wyiOKTiC0pHvSHV1B9Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305296" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:07 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 05/13] wifi: iwlwifi: mvm: exit EMLSR if both links are missing beacons Date: Thu, 8 Aug 2024 23:22:41 +0300 Message-Id: <20240808232017.b7785943a4fe.I70a459c5e7db85f398d5795ba83bb15f65d6bf9d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 If both links are missing 5 beacons, we need to exit EMLSR, if only one link misses beacons, we need to wait until 11 beacons are missed. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/mvm/constants.h | 3 ++- .../net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 25 ++++++++++++++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h index 8f63cbe9e50d..ddf484027d4f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h @@ -16,6 +16,8 @@ #define IWL_MVM_BT_COEX_WIFI_LOSS_THRESH 0 #define IWL_MVM_TRIGGER_LINK_SEL_TIME_SEC 30 #define IWL_MVM_TPT_COUNT_WINDOW_SEC 5 +#define IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_2_LINKS 5 +#define IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH 11 #define IWL_MVM_DEFAULT_PS_TX_DATA_TIMEOUT (100 * USEC_PER_MSEC) #define IWL_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (100 * USEC_PER_MSEC) @@ -125,7 +127,6 @@ #define IWL_MVM_6GHZ_PASSIVE_SCAN_ASSOC_TIMEOUT 60 /* in seconds */ #define IWL_MVM_MIN_BEACON_INTERVAL_TU 16 #define IWL_MVM_AUTO_EML_ENABLE true -#define IWL_MVM_MISSED_BEACONS_EXIT_ESR_THRESH 7 #define IWL_MVM_HIGH_RSSI_THRESH_20MHZ -67 #define IWL_MVM_LOW_RSSI_THRESH_20MHZ -71 diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 4a8f50f8bb79..bb864ec2e22a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1664,10 +1664,27 @@ iwl_mvm_handle_missed_beacons_notif(struct iwl_mvm *mvm, "missed_beacons:%d, missed_beacons_since_rx:%d\n", rx_missed_bcon, rx_missed_bcon_since_rx); } - } else if (rx_missed_bcon >= IWL_MVM_MISSED_BEACONS_EXIT_ESR_THRESH && - link_id >= 0 && hweight16(vif->active_links) > 1) { - iwl_mvm_exit_esr(mvm, vif, IWL_MVM_ESR_EXIT_MISSED_BEACON, - iwl_mvm_get_other_link(vif, link_id)); + } else if (link_id >= 0 && hweight16(vif->active_links) > 1) { + u32 scnd_lnk_bcn_lost = 0; + + if (notif_ver >= 5 && + !IWL_FW_CHECK(mvm, + le32_to_cpu(mb->other_link_id) == IWL_MVM_FW_LINK_ID_INVALID, + "No data for other link id but we are in EMLSR active_links: 0x%x\n", + vif->active_links)) + scnd_lnk_bcn_lost = + le32_to_cpu(mb->consec_missed_beacons_other_link); + + /* Exit EMLSR if we lost more than + * IWL_MVM_MISSED_BEACONS_EXIT_ESR_THRESH beacons on boths links + * OR more than IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH on any link. + */ + if ((rx_missed_bcon >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_2_LINKS && + scnd_lnk_bcn_lost >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH_2_LINKS) || + rx_missed_bcon >= IWL_MVM_BCN_LOSS_EXIT_ESR_THRESH) + iwl_mvm_exit_esr(mvm, vif, + IWL_MVM_ESR_EXIT_MISSED_BEACON, + iwl_mvm_get_primary_link(vif)); } else if (rx_missed_bcon_since_rx > IWL_MVM_MISSED_BEACONS_THRESHOLD) { if (!iwl_mvm_has_new_tx_api(mvm)) ieee80211_beacon_loss(vif); From patchwork Thu Aug 8 20:22: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: 13758170 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 193BA15665D for ; Thu, 8 Aug 2024 20:23:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148592; cv=none; b=iz9WY8yra0nPFceC43iTEcrhqQKyOrBRZWzl1hoeIlH1Ao+0SYlKOgMQJT5EAnamcOvTggPNhwl02C5TMd470TA76O7hzEHGxzx53EUh2aScQzQhPu1wzht/k8zt4732gz7R3sAGqNuRvJZln05/cEpbQqJlDu/LxfUGASPjXaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148592; c=relaxed/simple; bh=NBBjc7lk+ro6kzFamUvUJqvpQbhIXkJwB3vd8ZCylC8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HW/FzYF6/4DAm482fOGXzYuWpsyLDIVF69RzW3hKHOwnMX5sf5coT/0m7v/rwGtJDTr3S3M8lCtaR3bsvhLUK4uKh+wBWnNLPnnMWR+lhuqO/0pMlI82LWcav9wkW4ilVh+5L1YAkZq+fnFY8d7uNDw+Ua9+je508tnd66RArqg= 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=ipCqdcRm; arc=none smtp.client-ip=192.198.163.8 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="ipCqdcRm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148591; x=1754684591; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NBBjc7lk+ro6kzFamUvUJqvpQbhIXkJwB3vd8ZCylC8=; b=ipCqdcRmLXJOKmbeFQnFEgW6ph2ZCFIuwYC0H9IU2Nxjy32HnVpKzD6c 1XODb/cYRHvl9GuZKky5Jv+y8bVeCNOO9BkGK4Qr1qdr5v70MkOUbHNVy Q0HPIslwAzb3SGNXf46h7sBs7O9JiIXLsMt3xeCyCah8+v/fFpshJgxxF if5e3O/nmL05wFmq5y7Qgu2I1+jE9eoedXRFcC/DR1NE1DWp0l/NQ+1dI SuK0SscnXbQn6CZktJtNZEtAyKNh6dtrwhO58O6+QuZJg4kSYCWEkFaMD LfCqnQp5MdfnWP/5oO9+KXqsHV39TK9GxqKMZ0d+JjdGPYsGZBWnw3bqh g==; X-CSE-ConnectionGUID: QObh33+/SaKnno0rBF/uRA== X-CSE-MsgGUID: 0nibRcyBQhK/U7hvvzwv3Q== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808845" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808845" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:10 -0700 X-CSE-ConnectionGUID: JW3vb02EQM+VtdUEq2BV1A== X-CSE-MsgGUID: 5eiC5wFuSNa9tTgDs+MlEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305305" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:08 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 06/13] wifi: iwlwifi: mvm: add API for EML OMN frame failure Date: Thu, 8 Aug 2024 23:22:42 +0300 Message-Id: <20240808232017.0c6bc216ef8c.Ida85d2062734a569e1af35f47d14cc5bb4bf893e@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 When the firmware fails to send EML OMN frames, it notifies the host and the host need to take proper action. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/fw/api/mac-cfg.h | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) 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 5fc7967df6c5..6a2c5bed357e 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h @@ -65,6 +65,10 @@ enum iwl_mac_conf_subcmd_ids { * @MISSED_BEACONS_NOTIF: &struct iwl_missed_beacons_notif */ MISSED_BEACONS_NOTIF = 0xF6, + /** + * @EMLSR_TRANS_FAIL_NOTIF: &struct iwl_esr_trans_fail_notif + */ + EMLSR_TRANS_FAIL_NOTIF = 0xF7, /** * @ROC_NOTIF: &struct iwl_roc_notif */ @@ -690,4 +694,30 @@ struct iwl_missed_beacons_notif { __le32 consec_missed_beacons_other_link; } __packed; /* MISSED_BEACON_NTFY_API_S_VER_5 */ +/* + * enum iwl_esr_trans_fail_code: to be used to parse the notif below + * + * @ESR_TRANS_FAILED_TX_STATUS_ERROR: failed to TX EML OMN frame + * @ESR_TRANSITION_FAILED_TX_TIMEOUT: timeout on the EML OMN frame + * @ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD: can't get a beacon on the new link + */ +enum iwl_esr_trans_fail_code { + ESR_TRANS_FAILED_TX_STATUS_ERROR, + ESR_TRANSITION_FAILED_TX_TIMEOUT, + ESR_TRANSITION_FAILED_BEACONS_NOT_HEARD, +}; + +/** + * struct iwl_esr_trans_fail_notif - FW reports a failure in EMLSR transition + * + * @link_id: the link_id that was activated / de-activated + * @activation: true if the link was activated, false otherwise + * @err_code: see &enum iwl_esr_trans_fail_code + */ +struct iwl_esr_trans_fail_notif { + __le32 link_id; + __le32 activation; + __le32 err_code; +} __packed; /* ESR_TRANSITION_FAILED_NTFY_API_S_VER_1 */ + #endif /* __iwl_fw_api_mac_cfg_h__ */ From patchwork Thu Aug 8 20:22: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: 13758171 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 7F610155A25 for ; Thu, 8 Aug 2024 20:23:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148594; cv=none; b=hMc3KNCko4CXYcoCXRtY7x/pyUrb5uiiD//7Evfw9t41yeq6G7nym6k9JRN9s6i9s9UdaJgJB3rvC5CoCpekZPhx8f+UrbT0xXoTLn2w4mXrL9u31zZSJNTqQ0ec8NvksJ408xoS6n2bu57iSy5pAx7AnpWkjIcqOOUnAeaVgf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148594; c=relaxed/simple; bh=BuCcH+LtaTBzjNW2HDouyMrko7gU2m6QYP4MueXgsbI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tY1nV8YQczfL++pyPLQq8gHSdgTznvzMZVdvjSFnu5vUG1PyD2af6WnmM6KDTaIsE6FieqBNAbkSl2WmNmDFAkG8zMVj7E2GAldnkBTsKNOeMcwg8Dddb77VJQsSt2G+ph4FqzYQwjYpnG0NX5ihx7UlDtpy9vipRHcZzqglHno= 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=PSkKja5K; arc=none smtp.client-ip=192.198.163.8 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="PSkKja5K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148593; x=1754684593; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BuCcH+LtaTBzjNW2HDouyMrko7gU2m6QYP4MueXgsbI=; b=PSkKja5KRJvVqsi7O2E4PtrhAJc2NxbjlfRc5OlOlTlEiEzmV5vG2dhw 2lmEbwjWakGnDKcCm3BDc/tELX/bRcJATdx1dVF3qLuLJYNrvmuVmAps1 C3NjIBB+j9Hd6kLnM9WSzaMHUhpp7u0zAj4lvgJaUCykVlhUERGMGmVWq Xr2ig2j7KcVW70wVuxWul0jjCR01kCr3KIeUZtoyqiU1fW5AAnz6j+doA 9vdcQbZh5pv7rJ8wYldfxf1NQRjhU99rfZbMPZSpohdM+z7sW25lPgTbw HOOx1bDGpGCR26JBP8TDDE+uHKjg8i/UCCwoZaosllnEQuZlGN2OwGJzK g==; X-CSE-ConnectionGUID: ML3+gTsnShmJnuu+inhctA== X-CSE-MsgGUID: YaixQ8CsRriCzwNAZscbqg== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808847" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808847" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:12 -0700 X-CSE-ConnectionGUID: 9ThThVF/QT63YiaG3ubNXA== X-CSE-MsgGUID: JtOmN3ovSs2sjLli8PWbwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305311" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:10 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Emmanuel Grumbach Subject: [PATCH 07/13] wifi: iwlwifi: mvm: handle the new EML OMN failure notification Date: Thu, 8 Aug 2024 23:22:43 +0300 Message-Id: <20240808232017.273bc77a027b.I9f2d3ea851050f6031ac07bbe69eb38000fd5683@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 Take the proper action upon EML OMN frame failure. ticket=jira:WIFI-428051 Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 3 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 2 ++ drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 30 +++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 3a6e0a90a3ef..d151d935e12a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -17,7 +17,8 @@ HOW(EXIT_COEX) \ HOW(EXIT_BANDWIDTH) \ HOW(EXIT_CSA) \ - HOW(EXIT_LINK_USAGE) + HOW(EXIT_LINK_USAGE) \ + HOW(EXIT_FAIL_ENTRY) static const char *const iwl_mvm_esr_states_names[] = { #define NAME_ENTRY(x) [ilog2(IWL_MVM_ESR_##x)] = #x, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index f9e676374daa..65b66f01bef9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -368,6 +368,7 @@ struct iwl_mvm_vif_link_info { * preventing the enablement of EMLSR * @IWL_MVM_ESR_EXIT_CSA: CSA happened, so exit EMLSR * @IWL_MVM_ESR_EXIT_LINK_USAGE: Exit EMLSR due to low tpt on secondary link + * @IWL_MVM_ESR_EXIT_FAIL_ENTRY: Exit EMLSR due to entry failure */ enum iwl_mvm_esr_state { IWL_MVM_ESR_BLOCKED_PREVENTION = 0x1, @@ -382,6 +383,7 @@ enum iwl_mvm_esr_state { IWL_MVM_ESR_EXIT_BANDWIDTH = 0x80000, IWL_MVM_ESR_EXIT_CSA = 0x100000, IWL_MVM_ESR_EXIT_LINK_USAGE = 0x200000, + IWL_MVM_ESR_EXIT_FAIL_ENTRY = 0x400000, }; #define IWL_MVM_BLOCK_ESR_REASONS 0xffff diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 0b91877592a8..d69556c406a8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -159,6 +159,31 @@ static void iwl_mvm_rx_esr_mode_notif(struct iwl_mvm *mvm, iwl_mvm_get_primary_link(vif)); } +static void iwl_mvm_rx_esr_trans_fail_notif(struct iwl_mvm *mvm, + struct iwl_rx_cmd_buffer *rxb) +{ + struct iwl_rx_packet *pkt = rxb_addr(rxb); + struct iwl_esr_trans_fail_notif *notif = (void *)pkt->data; + struct ieee80211_vif *vif = iwl_mvm_get_bss_vif(mvm); + + if (IS_ERR_OR_NULL(vif)) + return; + + IWL_DEBUG_INFO(mvm, "Failed to %s eSR on link %d, reason %d\n", + le32_to_cpu(notif->activation) ? "enter" : "exit", + le32_to_cpu(notif->link_id), + le32_to_cpu(notif->err_code)); + /* If we couldn't exit EMLSR, the AP may send us data on the link we + * removed so we don't have much choice, just disconnect... + * If we can't enter EMLSR, go back to single link. + */ + if (le32_to_cpu(notif->activation)) + iwl_mvm_exit_esr(mvm, vif, IWL_MVM_ESR_EXIT_FAIL_ENTRY, + iwl_mvm_get_primary_link(vif)); + else + iwl_mvm_connection_loss(mvm, vif, "emlsr exit failed"); +} + static void iwl_mvm_rx_monitor_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb) { @@ -486,6 +511,10 @@ static const struct iwl_rx_handlers iwl_mvm_rx_handlers[] = { RX_HANDLER_GRP(SCAN_GROUP, CHANNEL_SURVEY_NOTIF, iwl_mvm_rx_channel_survey_notif, RX_HANDLER_ASYNC_LOCKED, struct iwl_umac_scan_channel_survey_notif), + RX_HANDLER_GRP(MAC_CONF_GROUP, EMLSR_TRANS_FAIL_NOTIF, + iwl_mvm_rx_esr_trans_fail_notif, + RX_HANDLER_ASYNC_LOCKED_WIPHY, + struct iwl_esr_trans_fail_notif), }; #undef RX_HANDLER #undef RX_HANDLER_GRP @@ -616,6 +645,7 @@ static const struct iwl_hcmd_names iwl_mvm_mac_conf_names[] = { HCMD_NAME(STA_REMOVE_CMD), HCMD_NAME(STA_DISABLE_TX_CMD), HCMD_NAME(ROC_CMD), + HCMD_NAME(EMLSR_TRANS_FAIL_NOTIF), HCMD_NAME(ROC_NOTIF), HCMD_NAME(CHANNEL_SWITCH_ERROR_NOTIF), HCMD_NAME(MISSED_VAP_NOTIF), From patchwork Thu Aug 8 20:22: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: 13758172 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 9B03115B0F4 for ; Thu, 8 Aug 2024 20:23:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148595; cv=none; b=cHNJyvE2HFlv0xRK1/blHtFAOsT4uYAE6MFZsr3qYm7ztGU3XcGY1NBiXQmIMPcyXqwInJthcKleDDYCBUObkaZb13N9OtJshNFA0fn5hr5EtNu0hGOO4KO7eOyC1Ir9SHUuXyRtyflyOF3A7VmtykFQv07SB+TfQ41GC/WzIK4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148595; c=relaxed/simple; bh=zOtFqVJQ6aawOIPvMuMp25drxU1zs7i/FYmUT6N4WR8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=nEkx0PA4iBU+Z/Arq6QtiQFMFBqo24WmyqU4y2rBOCQtgDIHi7dOoZGSIDNajBFzchcgjH3e+4wneFgC7wP3vXDjdrtoOfrkyi1KgHjg8dWhPsSprh4oB3hXugJZe9MC+O0hVR3bK6CpIe8XwFIvb6GUI66wxvfbQWmqyWKABDQ= 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=iI4DIXUM; arc=none smtp.client-ip=192.198.163.8 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="iI4DIXUM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148594; x=1754684594; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zOtFqVJQ6aawOIPvMuMp25drxU1zs7i/FYmUT6N4WR8=; b=iI4DIXUMZv0azxQwuOPufHLuC3ufk6+LmQ2Vgvu8addGsh/Xv3l49skg rgLf2vb57yy4HLNObd6J1af0hqlziwIY4jLyHNq8Cng5QAdiATatAx5sz lArlDJuaI9JylX1qj37tZrZuoK6oY10QlRqR2p87Mq4pLgEMn14Q4huNe m1bxbVfizuHMA5SwnexKXQYoweSZPIypvBi3kl9b964slJw0e6zyCv3rK PdAdAhnADyiSibAgkRo6/QFJ+sYdRY/tF60KvHgyCAZ4D//FHGTf3fi2O vzuvhwbjDiRsZ9r1lnJPUpL7WrVT76KDChgj404/AaPEzo+SUsUY5ySpn w==; X-CSE-ConnectionGUID: /S2+uH82SJ6FcHnghU5Z0w== X-CSE-MsgGUID: FKkcMozNTZaYUbYrS40xYg== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808850" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808850" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:13 -0700 X-CSE-ConnectionGUID: oB8pbPquT0uryJ9e9LeI6A== X-CSE-MsgGUID: rprayx8MSkWpA1vtoRZ7wQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305315" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:11 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Ilan Peer Subject: [PATCH 08/13] wifi: iwlwifi: mvm: Stop processing MCC update if there was no change Date: Thu, 8 Aug 2024 23:22:44 +0300 Message-Id: <20240808232017.60dd273d00e0.I985b3bc61ca4a6cac7c1d1365b5c0afba04f3031@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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: Ilan Peer When processing a MCC update notification from the firmware, if the firmware indicates that the regulatory configuration didn't change, abort the flow and do not notify higher layers. Signed-off-by: Ilan Peer Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/nvm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c index 836ca22597bc..80ec59c58ae4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/nvm.c @@ -611,6 +611,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm, char mcc[3]; struct ieee80211_regdomain *regd; int wgds_tbl_idx; + bool changed = false; lockdep_assert_held(&mvm->mutex); @@ -630,10 +631,15 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm, IWL_DEBUG_LAR(mvm, "RX: received chub update mcc cmd (mcc '%s' src %d)\n", mcc, src); - regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, mcc, src, NULL); + regd = iwl_mvm_get_regdomain(mvm->hw->wiphy, mcc, src, &changed); if (IS_ERR_OR_NULL(regd)) return; + if (!changed) { + IWL_DEBUG_LAR(mvm, "RX: No change in the regulatory data\n"); + goto out; + } + wgds_tbl_idx = iwl_mvm_get_sar_geo_profile(mvm); if (wgds_tbl_idx < 1) IWL_DEBUG_INFO(mvm, @@ -644,5 +650,7 @@ void iwl_mvm_rx_chub_update_mcc(struct iwl_mvm *mvm, wgds_tbl_idx); regulatory_set_wiphy_regd(mvm->hw->wiphy, regd); + +out: kfree(regd); } From patchwork Thu Aug 8 20:22: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: 13758173 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 6D6F3158D7F for ; Thu, 8 Aug 2024 20:23:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148596; cv=none; b=ktm8x9Sdt11FI/WBHobTKQ5o0oIXgGnKKf5l6gcH2zrMKn9Mi1TzMQJVtRjloC7YEW3Tni6J3ZERo4RXJsl9q9LaYCZI+d+88U+rBfc25KG2fAOVXULGI+4QqWcgBQ7FkM8yf2oKxxJakMxSpnV5MeUgGQqTaRKx/rjsi0d/kfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148596; c=relaxed/simple; bh=/49CYzd6N7ZY004PiipnuHZImv81GXobqQf9XWe48/o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rm6/a/4gXZBJnba1d8gigyg0nAZE3LmnQWL1eeq8YUHWNw+THG5tcdRFiFCkMw9gK+s01/AKhasBynevgXpt/AcL/mYpZkeZSp3PttLjNFnA65nlMUSB26idKqdsUHRujJtfUcUhcn+CqcpILWE3uJwt9nI73yoox8ZiCKpbHhU= 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=gwyGSqXW; arc=none smtp.client-ip=192.198.163.8 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="gwyGSqXW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148595; x=1754684595; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/49CYzd6N7ZY004PiipnuHZImv81GXobqQf9XWe48/o=; b=gwyGSqXWQcaN8jsGZTxn/DwwX+q8G47omHnUs7a79g8b3AxqMU60mON7 owL3jVgBED1xbwHdKVUMJwh8b5egZW+vlenJTsSlqxLiqA2n9Z61bwcbF OWCF8QRXLVo5aV87+8mO/oZL4ArtNsLYeQ1cEv6RiohkKP3LWNkoUcXLR NEVhYK/Ji7Lqeq1YdAlp6MDyZ/NQHYkG/5CoK/UJCts1AH9mHlsUPx2N1 3h2IJOccin1Ohs0w3CA2IDJEjXfMBea/Gdc7RLxoCezPCgLueH+leWhQo V60ADWOx4Rt7r0Q5TVos6ibaqAaqrCRLpvFUsADne3T9aSlQpaFyWJvgX g==; X-CSE-ConnectionGUID: H3/9zEKhRGuAhf2Fh9JPqg== X-CSE-MsgGUID: WFrHzwt4TmWIPUfBR/cOvA== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808854" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808854" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:14 -0700 X-CSE-ConnectionGUID: 66cFEM2zRZqQi5UqO+EEYA== X-CSE-MsgGUID: i2HcdAsAS4qK+NogWRzNdA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305317" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:13 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH 09/13] wifi: iwlwifi: use default command queue watchdog timeout Date: Thu, 8 Aug 2024 23:22:45 +0300 Message-Id: <20240808232017.87af3f063025.I2222981ead13f6a917f2d4b116c5b94200dc9e51@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 We used to have the opmode configuring it to the trans according to the debug tlv value (FW_DBG_TRIGGER_TXQ_TIMERS). But this debug is not used, so trans can just have the default value hardcoded. Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/dvm/main.c | 2 -- drivers/net/wireless/intel/iwlwifi/iwl-trans.h | 2 -- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 4 ---- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 4 +++- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/main.c b/drivers/net/wireless/intel/iwlwifi/dvm/main.c index 65b7c68e5ca7..e0b14be25b02 100644 --- a/drivers/net/wireless/intel/iwlwifi/dvm/main.c +++ b/drivers/net/wireless/intel/iwlwifi/dvm/main.c @@ -1325,8 +1325,6 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, iwlwifi_mod_params.amsdu_size); } - trans_cfg.cmd_q_wdg_timeout = IWL_WATCHDOG_DISABLED; - trans_cfg.command_groups = iwl_dvm_groups; trans_cfg.command_groups_size = ARRAY_SIZE(iwl_dvm_groups); diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h index 6148acbac6af..c6f51e3bc3c6 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.h @@ -386,7 +386,6 @@ struct iwl_dump_sanitize_ops { * @cmd_queue: the index of the command queue. * Must be set before start_fw. * @cmd_fifo: the fifo for host commands - * @cmd_q_wdg_timeout: the timeout of the watchdog timer for the command queue. * @no_reclaim_cmds: Some devices erroneously don't set the * SEQ_RX_FRAME bit on some notifications, this is the * list of such notifications to filter. Max length is @@ -412,7 +411,6 @@ struct iwl_trans_config { u8 cmd_queue; u8 cmd_fifo; - unsigned int cmd_q_wdg_timeout; const u8 *no_reclaim_cmds; unsigned int n_no_reclaim_cmds; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index d69556c406a8..c703f74ac64d 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1437,10 +1437,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, trans_cfg.cb_data_offs = offsetof(struct ieee80211_tx_info, driver_data[2]); - /* Set a short watchdog for the command queue */ - trans_cfg.cmd_q_wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, NULL, false, true); - snprintf(mvm->hw->wiphy->fw_version, sizeof(mvm->hw->wiphy->fw_version), "%.31s", fw->fw_version); diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index 719ddc4b72c5..3b9943eb6934 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -1967,7 +1967,6 @@ void iwl_trans_pcie_configure(struct iwl_trans *trans, trans_pcie->txqs.cmd.q_id = trans_cfg->cmd_queue; trans_pcie->txqs.cmd.fifo = trans_cfg->cmd_fifo; - trans_pcie->txqs.cmd.wdg_timeout = trans_cfg->cmd_q_wdg_timeout; trans_pcie->txqs.page_offs = trans_cfg->cb_data_offs; trans_pcie->txqs.dev_cmd_offs = trans_cfg->cb_data_offs + sizeof(void *); trans_pcie->txqs.queue_alloc_cmd_ver = trans_cfg->queue_alloc_cmd_ver; @@ -3567,6 +3566,9 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, } trans->max_skb_frags = IWL_TRANS_PCIE_MAX_FRAGS(trans_pcie); + /* Set a short watchdog for the command queue */ + trans_pcie->txqs.cmd.wdg_timeout = IWL_DEF_WD_TIMEOUT; + trans_pcie->txqs.tso_hdr_page = alloc_percpu(struct iwl_tso_hdr_page); if (!trans_pcie->txqs.tso_hdr_page) { ret = -ENOMEM; From patchwork Thu Aug 8 20:22: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: 13758174 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 1C04A15B98F for ; Thu, 8 Aug 2024 20:23:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148597; cv=none; b=H4sxGkFM8MWRdmwZklH6z/DSv2pUEEvXNfVFhn1GMBKGpCMbGxQgNz+pLMkZaDYddDIAnREkxDOc3Tggbx40dVuUAS3suunu5w5N8+M/qkMTzd2220TJMrQ7sy/be4yN77x/vwsy0/p0eWjzNaPINdWrxiC2HK8iitz94WE/aR0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148597; c=relaxed/simple; bh=IoolkF+bgVcJIZkKBbsM0KUgMBjkeNcF7FpINWH/X84=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Sv31iKmOiDaFnToSm+8ihh1FIogxMHh37jPjNPRyuRBlSiAFvXAfKmrd7qxnrb0S47QvLb1TI0v/S+rIxV+UavS5QZFmUwRR7fy5GWmWVgZPG6JoUQYpny+UzhvstDix4nshNFpbf0RrMJANOjZuW/rPagcGu+pRoucU84RJztA= 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=TljDum6h; arc=none smtp.client-ip=192.198.163.8 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="TljDum6h" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148596; x=1754684596; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IoolkF+bgVcJIZkKBbsM0KUgMBjkeNcF7FpINWH/X84=; b=TljDum6hxqFhfyeogXMaIdVBzVrJ5l0kLJ4TPT3agvyOejU4mc5xkgLI 3zuCtq1vY3DG6V1M0bjMB403Ish9fLeUCu6mgD+Eokd/o1hok4o3Mc74a o0AueogYUMS3CrpgONI698PX8dMtcHOw4FJd33D5OOzQTTjYl1CvSHpuV DV9UgAPinDM4u5aYVt/i2WUU95VK+1/EqWKVsaPopkrecoLBDkmTPIIcu 6Lb74IR4qXsFPglAyyuRDKjTn4PYhtwtbdDuXpkuH4ly8kR/hWwqGgxgb 7CRSodJTN3p7vCa8vpTkGcNs0bK2HF3UpYly75qBx0lwfexTCbo7/whfy Q==; X-CSE-ConnectionGUID: V3hN1/3bQXyZWAFu/GiIpg== X-CSE-MsgGUID: 6944QZgZRxqeZLu8lsHfEw== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808858" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808858" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:16 -0700 X-CSE-ConnectionGUID: jlAQ08QaT5qZJZef4t2kDw== X-CSE-MsgGUID: NSwKkNwPSMy3c2AOU7IZmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305330" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:14 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Emmanuel Grumbach Subject: [PATCH 10/13] wifi: iwlwifi: mvm: cleanup iwl_mvm_get_wd_timeout Date: Thu, 8 Aug 2024 23:22:46 +0300 Message-Id: <20240808232017.7a6944bc2e38.I532b4b5487c6be9203ff4db9742d7cc5b148d502@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 This used to extract the timeout from the debug TLV (FW_DBG_TRIGGER_TXQ_TIMERS), which is not in use. Cleanup iwl_mvm_get_wd_timeout to not consider the debug TLV. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg Reviewed-by: Emmanuel Grumbach --- .../net/wireless/intel/iwlwifi/mvm/mld-sta.c | 4 +- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 +- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 16 ++--- .../net/wireless/intel/iwlwifi/mvm/utils.c | 60 ++++--------------- 4 files changed, 22 insertions(+), 61 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index d5a204e52076..071de9372843 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -216,7 +216,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, static const u8 _baddr[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; const u8 *baddr = _baddr; unsigned int wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, vif, false, false); + iwl_mvm_get_wd_timeout(mvm, vif); u16 *queue; lockdep_assert_held(&mvm->mutex); @@ -254,7 +254,7 @@ int iwl_mvm_mld_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct iwl_mvm_int_sta *msta = &mvm_link->mcast_sta; static const u8 _maddr[] = {0x03, 0x00, 0x00, 0x00, 0x00, 0x00}; const u8 *maddr = _maddr; - unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false); + unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif); lockdep_assert_held(&mvm->mutex); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 65b66f01bef9..68464f892e85 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -2587,8 +2587,7 @@ u8 iwl_mvm_tcm_load_percentage(u32 airtime, u32 elapsed); void iwl_mvm_nic_restart(struct iwl_mvm *mvm, bool fw_error); unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm, - struct ieee80211_vif *vif, - bool tdls, bool cmd_q); + struct ieee80211_vif *vif); void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif, const char *errmsg); void iwl_mvm_event_frame_timeout_callback(struct iwl_mvm *mvm, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index cf4d6425f634..74bbeebe69d5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -900,7 +900,7 @@ static int iwl_mvm_sta_alloc_queue_tvqm(struct iwl_mvm *mvm, struct iwl_mvm_txq *mvmtxq = iwl_mvm_txq_from_tid(sta, tid); unsigned int wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); + iwl_mvm_get_wd_timeout(mvm, mvmsta->vif); int queue = -1; lockdep_assert_held(&mvm->mutex); @@ -1080,7 +1080,7 @@ static void iwl_mvm_unshare_queue(struct iwl_mvm *mvm, int queue) return; mvmsta = iwl_mvm_sta_from_mac80211(sta); - wdg_timeout = iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); + wdg_timeout = iwl_mvm_get_wd_timeout(mvm, mvmsta->vif); ssn = IEEE80211_SEQ_TO_SN(mvmsta->tid_data[tid].seq_number); @@ -1330,7 +1330,7 @@ static int iwl_mvm_sta_alloc_queue(struct iwl_mvm *mvm, .frame_limit = IWL_FRAME_LIMIT, }; unsigned int wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, mvmsta->vif, false, false); + iwl_mvm_get_wd_timeout(mvm, mvmsta->vif); int queue = -1; u16 queue_tmp; unsigned long disable_agg_tids = 0; @@ -1622,7 +1622,7 @@ void iwl_mvm_realloc_queues_after_restart(struct iwl_mvm *mvm, { struct iwl_mvm_sta *mvm_sta = iwl_mvm_sta_from_mac80211(sta); unsigned int wdg = - iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif, false, false); + iwl_mvm_get_wd_timeout(mvm, mvm_sta->vif); int i; struct iwl_trans_txq_scd_cfg cfg = { .sta_id = mvm_sta->deflink.sta_id, @@ -2359,7 +2359,7 @@ int iwl_mvm_send_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) int queue; int ret; unsigned int wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, vif, false, false); + iwl_mvm_get_wd_timeout(mvm, vif); struct iwl_trans_txq_scd_cfg cfg = { .fifo = IWL_MVM_TX_FIFO_VO, .sta_id = mvmvif->deflink.bcast_sta.sta_id, @@ -2568,7 +2568,7 @@ int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) .aggregate = false, .frame_limit = IWL_FRAME_LIMIT, }; - unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif, false, false); + unsigned int timeout = iwl_mvm_get_wd_timeout(mvm, vif); int ret; lockdep_assert_held(&mvm->mutex); @@ -3207,7 +3207,7 @@ int iwl_mvm_sta_tx_agg_oper(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta); struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid]; unsigned int wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, vif, sta->tdls, false); + iwl_mvm_get_wd_timeout(mvm, vif); int queue, ret; bool alloc_queue = true; enum iwl_mvm_queue_status queue_status; @@ -4326,7 +4326,7 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, u16 queue; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); unsigned int wdg_timeout = - iwl_mvm_get_wd_timeout(mvm, vif, false, false); + iwl_mvm_get_wd_timeout(mvm, vif); bool mld = iwl_mvm_has_mld_api(mvm->fw); u32 type = mld ? STATION_TYPE_PEER : IWL_STA_LINK; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index edcc6e2cb76a..1d1364d03f02 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c @@ -747,58 +747,20 @@ bool iwl_mvm_is_vif_assoc(struct iwl_mvm *mvm) } unsigned int iwl_mvm_get_wd_timeout(struct iwl_mvm *mvm, - struct ieee80211_vif *vif, - bool tdls, bool cmd_q) + struct ieee80211_vif *vif) { - struct iwl_fw_dbg_trigger_tlv *trigger; - struct iwl_fw_dbg_trigger_txq_timer *txq_timer; - unsigned int default_timeout = cmd_q ? - IWL_DEF_WD_TIMEOUT : + unsigned int default_timeout = mvm->trans->trans_cfg->base_params->wd_timeout; - if (!iwl_fw_dbg_trigger_enabled(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS)) { - /* - * We can't know when the station is asleep or awake, so we - * must disable the queue hang detection. - */ - if (fw_has_capa(&mvm->fw->ucode_capa, - IWL_UCODE_TLV_CAPA_STA_PM_NOTIF) && - vif && vif->type == NL80211_IFTYPE_AP) - return IWL_WATCHDOG_DISABLED; - return default_timeout; - } - - trigger = iwl_fw_dbg_get_trigger(mvm->fw, FW_DBG_TRIGGER_TXQ_TIMERS); - txq_timer = (void *)trigger->data; - - if (tdls) - return le32_to_cpu(txq_timer->tdls); - - if (cmd_q) - return le32_to_cpu(txq_timer->command_queue); - - if (WARN_ON(!vif)) - return default_timeout; - - switch (ieee80211_vif_type_p2p(vif)) { - case NL80211_IFTYPE_ADHOC: - return le32_to_cpu(txq_timer->ibss); - case NL80211_IFTYPE_STATION: - return le32_to_cpu(txq_timer->bss); - case NL80211_IFTYPE_AP: - return le32_to_cpu(txq_timer->softap); - case NL80211_IFTYPE_P2P_CLIENT: - return le32_to_cpu(txq_timer->p2p_client); - case NL80211_IFTYPE_P2P_GO: - return le32_to_cpu(txq_timer->p2p_go); - case NL80211_IFTYPE_P2P_DEVICE: - return le32_to_cpu(txq_timer->p2p_device); - case NL80211_IFTYPE_MONITOR: - return default_timeout; - default: - WARN_ON(1); - return mvm->trans->trans_cfg->base_params->wd_timeout; - } + /* + * We can't know when the station is asleep or awake, so we + * must disable the queue hang detection. + */ + if (fw_has_capa(&mvm->fw->ucode_capa, + IWL_UCODE_TLV_CAPA_STA_PM_NOTIF) && + vif->type == NL80211_IFTYPE_AP) + return IWL_WATCHDOG_DISABLED; + return default_timeout; } void iwl_mvm_connection_loss(struct iwl_mvm *mvm, struct ieee80211_vif *vif, From patchwork Thu Aug 8 20:22: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: 13758175 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 8CC19158D7F for ; Thu, 8 Aug 2024 20:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148598; cv=none; b=f6zkVRKjlhV6niUB9LGWjYLJiUoQG7Re5l7ATaj1SKY1WObBwshVr/Bzgyy40/wKs1PTP8kMwZW2CRygYZICyq2v8WC6c3aK6DuhX8NgBnbsvTlB53ysl4yAhdN04kHD7nagNjhE9S5GREYX8Nc+7VKobcB+Crr9ccz8jgpMHVk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148598; c=relaxed/simple; bh=g6NeEu2zkzsKnxuFEANQO7J0+43y/BINkKTkrvJKd3A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qePSpJGbTCZO2LyMrXSHSp/8rq6IKReZ4OFLdRujmBTSmMnIUutJdUOBA5n0Or6qv8fQU/hPQaGo7s1Kj2/h6sf4hMltZgjh6fP7JN0MVsVvud9VpaB7HqD+NkWgXFXBkWtXUPHWJaLT4X/Wgvpj7CPGfFdiOpuijSecPmCKCDk= 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=W33accMK; arc=none smtp.client-ip=192.198.163.8 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="W33accMK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148598; x=1754684598; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=g6NeEu2zkzsKnxuFEANQO7J0+43y/BINkKTkrvJKd3A=; b=W33accMKjo0+MbFtvwHbsOJoDWNHGP0bqOwm6b4c1f/zHiBbw2EZmAmQ zFEZF/yIHM74SJn5y8mBVYgvWze1I3k9vdNDSxi1GLqpI/P74l0EEluJx DylpLe5pYmWetSNy8ornwgE5pbwaNtKMHr18esUj/ZXz6K0uSyv4JSZYj WidBGesh5q6ZltcO/KUpynilQVLO9HNPYFh2PpdT9WDgB7bENRIixmq87 t1ZkWwWq0msv0vXLosIbHJoWi468dzOFKT0L7bHT7vsr6C/02zzHkmejB SeMKZLYnxYmrGvyoA2MEB7sRqGCVSyyQpw8IycGtEBMSkxj0sBkUBhmE5 Q==; X-CSE-ConnectionGUID: MFIbsa2UTGWIANmP2beZAQ== X-CSE-MsgGUID: SkPRXt/4QA6TeAgejoTnQw== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808864" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808864" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:18 -0700 X-CSE-ConnectionGUID: rVNMSKbpSoaopJyZDkIcfg== X-CSE-MsgGUID: sa5vjnnjTt+2mYzpBXzApQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305339" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:16 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 11/13] wifi: iwlwifi: bump FW API to 93 for BZ/SC devices Date: Thu, 8 Aug 2024 23:22:47 +0300 Message-Id: <20240808232017.5c9846f4c2c3.I6c825bc93aa23db302f24db5617f9b9b06042ec8@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 93 for new devices. Signed-off-by: Miri Korenblit Signed-off-by: Johannes Berg --- 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 b230441abc16..fa1be8c54d3c 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 92 +#define IWL_BZ_UCODE_API_MAX 93 /* Lowest firmware API version supported */ #define IWL_BZ_UCODE_API_MIN 90 diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/sc.c b/drivers/net/wireless/intel/iwlwifi/cfg/sc.c index 4ccb0b7bdc20..f1dd1c29f305 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 92 +#define IWL_SC_UCODE_API_MAX 93 /* Lowest firmware API version supported */ #define IWL_SC_UCODE_API_MIN 90 From patchwork Thu Aug 8 20:22: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: 13758176 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 C577A15D5C1 for ; Thu, 8 Aug 2024 20:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148601; cv=none; b=NQ+/qyJRosMt9cVyYK3Sao9qNWQz1Q/y7CgM9W8pTa2w2q9M+boYRqaPO/TlTo4FpEbT2lMGcmWuL9JFAxuhIqoT87L3Sci4IactptWQpwjQTNS1lQBqau/7ZiC1sM45yR0HmlyqF6Dr0YRNamJE2e1Phqln4lxjDIMLR6XKDoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148601; c=relaxed/simple; bh=JmZGHjDmkZRhxs9y+Es471c5l15L7ZyJLf7ffm78xlc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Clm4mT4kSkPswx53A9fO3bLeOOx634NmCL42sCaeiLaUodpdPOnvUVceqrC1bOebXnhtkHhihRRWgltCKRXth0U5Dsndzt8PnpDGBsAVZ8nuJHYf0oIJTxqNtkPVFZHORhPbWPgUNHxQE4Jw6wPAgrN4ynWQMPAWG4/YtabbKEM= 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=KRFiE/sr; arc=none smtp.client-ip=192.198.163.8 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="KRFiE/sr" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148600; x=1754684600; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JmZGHjDmkZRhxs9y+Es471c5l15L7ZyJLf7ffm78xlc=; b=KRFiE/srjFOBWGT8tNI8yq4Fyx5aK0bq31C9+tMergThHQUYtrf85lMi a2xV/gczAFTopBgl7tDuEDc7YLlQwSc0n2uaB15MdCItwlEoOc8hhIUqc viHU0WOpYbCDejfxWh9HoZSVK+zarCi+e5A25hENZMArz50CjSnSS1DxL 1KKm8AKwTbf1aPIkI0k6RabtP5eBhJQMIGYksZOwrl3RlizObPM2l2Siu vJOeE9Wu3HhJhf2jd7GPepyp1fdlzOOB1Qm9lxhXR15PefHyKjXeMW1GQ Xo+Fv3+rQG4505g6kCr9RJcGrfLR08u6Je26CTl7P8iI7KI4ky9rbOlAq A==; X-CSE-ConnectionGUID: FHdtL8ZHSmeA8p+uMdwR3Q== X-CSE-MsgGUID: 0EvF9IhrQeWGMG/oczDNjg== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808868" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808868" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:19 -0700 X-CSE-ConnectionGUID: GXFfDZhJTsuqAhDyZuM3HQ== X-CSE-MsgGUID: R3/Ve5FJQweic2+XPcgogQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305346" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:17 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 12/13] wifi: iwlwifi: mvm: drop wrong STA selection in TX Date: Thu, 8 Aug 2024 23:22:48 +0300 Message-Id: <20240808232017.45ad105dc7fe.I6d45c82e5758395d9afb8854057ded03c7dc81d7@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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: Johannes Berg This shouldn't happen at all, since in station mode all MMPDUs go through the TXQ for the STA, and not this function. There may or may not be a race in mac80211 through which this might happen for some frames while a station is being added, but in that case we can also just drop the frame and pretend the STA didn't exist yet. Also, the code is simply wrong since it uses deflink, and it's not easy to fix it since the mvmvif->ap_sta pointer cannot be used without the mutex, and perhaps the right link might not even be known. Just drop the frame at that point instead of trying to fix it up. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index af892c8291d4..f3f5cfd3baaa 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -839,20 +839,10 @@ void iwl_mvm_mac_tx(struct ieee80211_hw *hw, if (ieee80211_is_mgmt(hdr->frame_control)) sta = NULL; - /* If there is no sta, and it's not offchannel - send through AP */ + /* this shouldn't even happen: just drop */ if (!sta && info->control.vif->type == NL80211_IFTYPE_STATION && - !offchannel) { - struct iwl_mvm_vif *mvmvif = - iwl_mvm_vif_from_mac80211(info->control.vif); - u8 ap_sta_id = READ_ONCE(mvmvif->deflink.ap_sta_id); - - if (ap_sta_id < mvm->fw->ucode_capa.num_stations) { - /* mac80211 holds rcu read lock */ - sta = rcu_dereference(mvm->fw_id_to_mac_id[ap_sta_id]); - if (IS_ERR_OR_NULL(sta)) - goto drop; - } - } + !offchannel) + goto drop; if (tmp_sta && !sta && link_id != IEEE80211_LINK_UNSPECIFIED && !ieee80211_is_probe_resp(hdr->frame_control)) { From patchwork Thu Aug 8 20:22: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: 13758177 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 B70C315920B for ; Thu, 8 Aug 2024 20:23:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148604; cv=none; b=M2dxe18E15jcHjAAZgeTxez/MFYsbOK8qM/ESMPBG6nuOqPwjmqNv8t/DC8vTtMj5odyHRdyUAkMRfjRocvE86JYNxisl9ZoTaRU0uTMq5+Re4VMfNCCvxddvaCz9FaAlhtuHLcXh80hFPqPBOQ36fYiBYEtQwM4CVjY168TZRo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723148604; c=relaxed/simple; bh=KvK2ziTuGp6TKxSMfgRLa6728jWxTlfxjaDtJq9o80M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=bPsAsU4TXgo688jFbeyV4CcLzy36NtmQzMK41aXIm/cebTHpxMLN8d6USNpajdC+7Oav2dBmhTPj6TTPU68IR2U7/E+GXjXf/FodsFT0imv3PT3TkM/boeWHvdC5GMrLz2JFvUPIg4gJBmKu7gV4WgVejf+KMYcePFlXNxbltLc= 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=ezOZ+DQi; arc=none smtp.client-ip=192.198.163.8 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="ezOZ+DQi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1723148603; x=1754684603; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KvK2ziTuGp6TKxSMfgRLa6728jWxTlfxjaDtJq9o80M=; b=ezOZ+DQi2Ju6QyH6Bpldrx5g6SRGCgvUGptJfZMVu3WVh70CWKf2dGek Ikq5E3yTerL6FWpmvJdMFyDMV34SOGvgjC020yv8tdO5J77AaavExT1y2 6NVWdyZ5L87G0ybq54KAWRaJMGmAnbXoIWbtqMPi/hUD/9/7Xl+8UlBlp nrxc3302OL78iaV6bJVK1O28/SABVRLwLCBx1FsJH+fYmzCTcj5pxiBPB DSa8B/2rUVvf3LyUgSxi+H7HadEZ467udUYWcfCEFV17tUkPup+R5hBLg yoWncchbuYVFElcuGwBJeiHLz4TtGAA4ebHSca81Sws3MXUHRelt1bO9z Q==; X-CSE-ConnectionGUID: 5zANVtkfSmy1ES1veq4FTw== X-CSE-MsgGUID: x2uxP6LJSlOjAay5/VBW+w== X-IronPort-AV: E=McAfee;i="6700,10204,11158"; a="38808871" X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="38808871" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:21 -0700 X-CSE-ConnectionGUID: 6gO9CQ/KRu+BKodCmpsMFg== X-CSE-MsgGUID: JGZc05HFSwegwfrZjK3k0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,274,1716274800"; d="scan'208";a="57305354" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Aug 2024 13:23:19 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Anjaneyulu Subject: [PATCH 13/13] wifi: iwlwifi: allow only CN mcc from WRDD Date: Thu, 8 Aug 2024 23:22:49 +0300 Message-Id: <20240808232017.fe6ea7aa4b39.I86004687a2963fe26f990770aca103e2f5cb1628@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240808202249.4004087-1-miriam.rachel.korenblit@intel.com> References: <20240808202249.4004087-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 Block other mcc expect CN from WRDD ACPI. Signed-off-by: Anjaneyulu Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 5 +++++ drivers/net/wireless/intel/iwlwifi/fw/regulatory.h | 2 ++ drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 2 +- drivers/net/wireless/intel/iwlwifi/fw/uefi.h | 2 -- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c index 79774c8c7ff4..d20cd49773c9 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c @@ -357,6 +357,11 @@ int iwl_acpi_get_mcc(struct iwl_fw_runtime *fwrt, char *mcc) } mcc_val = wifi_pkg->package.elements[1].integer.value; + if (mcc_val != BIOS_MCC_CHINA) { + ret = -EINVAL; + IWL_DEBUG_RADIO(fwrt, "ACPI WRDD is supported only for CN\n"); + goto out_free; + } mcc[0] = (mcc_val >> 8) & 0xff; mcc[1] = mcc_val & 0xff; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h index c2209948b4c0..81787501d4a4 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/regulatory.h @@ -45,6 +45,8 @@ #define IWL_WTAS_ENABLE_IEC_MSK 0x4 #define IWL_WTAS_USA_UHB_MSK BIT(16) +#define BIOS_MCC_CHINA 0x434e + /* * The profile for revision 2 is a superset of revision 1, which is in * turn a superset of revision 0. So we can store all revisions diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c index 754fc5014fbf..091fb6fd7c78 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c @@ -638,7 +638,7 @@ int iwl_uefi_get_mcc(struct iwl_fw_runtime *fwrt, char *mcc) goto out; } - if (data->mcc != UEFI_MCC_CHINA) { + if (data->mcc != BIOS_MCC_CHINA) { ret = -EINVAL; IWL_DEBUG_RADIO(fwrt, "UEFI WRDD is supported only for CN\n"); goto out; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h index 0b2477190070..e525d449e656 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h @@ -151,8 +151,6 @@ struct uefi_cnv_var_splc { u32 default_pwr_limit; } __packed; -#define UEFI_MCC_CHINA 0x434e - /* struct uefi_cnv_var_wrdd - WRDD table as defined in UEFI * @revision: the revision of the table * @mcc: country identifier as defined in ISO/IEC 3166-1 Alpha 2 code