From patchwork Mon May 27 16:05:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799441 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 11F6E17E912 for ; Mon, 27 May 2024 16:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825987; cv=none; b=XlAP3145HFY8Lwd1CYz67Gm+CuHb2JfgX6FxiV2Vmrb60cE48kDZYTkVzlBPOlYpcz7WmdymhTvSq2DW6SXdIh6kGe4JKyUtTaCZWEyshiFnRiLiQ8590Dp/Sb35o/20zXnROB4SYw1L3gUNc3IpK+vriNI6p7sKRpX7enwoMDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825987; c=relaxed/simple; bh=3jrStSjjx6cpUKiSHySiyQIlpny2pdh8KDgY3wJv2q4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=V1m8jqQgJRbXvuihh3VGANhGrkEHuSc6PmQQr8kswdzynVSphaWwYJ4607vyrPQlU98D8yFVQTOs99ABbv0h+uGaD7MVTseAOvbPXpA/A6WJEgNtek2qRoBDugdRV0ELg9oTo2e9Q4UybzILvzsCeIDXbZIC2/Y3hM36rqQP/rA= 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=B1UeceCR; arc=none smtp.client-ip=198.175.65.19 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="B1UeceCR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825986; x=1748361986; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3jrStSjjx6cpUKiSHySiyQIlpny2pdh8KDgY3wJv2q4=; b=B1UeceCRKTvtJ+j8eaJMMfYbG3dZOT49AFwGIHvdNzZUAC6ANsIB0+o4 4Z8vnyUgIGgMMmB0gTYTUYSIk/7FsVgRVtFGicVLgZFLI0D2f8CTf8/Wu smLpELwvHsoNBuf6zrypHhRAwEYusHhlHntCYTR0eqlHiISB3S0jJH45X MD603djoHMlPUsUdaosrSp7VWMFDXb6Q8MbvIjwr3moMUQ6E2qdfsQpKr 6p2IVe38DsvoIgkhL0DeRYI45o3+qNgxvRQ6JtGNgIGnCqmDN+Y111996 ZJlwWCHQDkn+11Eo3lN1T+FU6VeZsqoNJJkmNOvGkqha1ALii0LCGTurj g==; X-CSE-ConnectionGUID: iHEI/IjeTZq3OQnkMhqLLw== X-CSE-MsgGUID: Huyhca8ETQ2Szs4wXn1WxA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002067" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002067" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:26 -0700 X-CSE-ConnectionGUID: T87mtdBpTt2J+Zx3tPFzKQ== X-CSE-MsgGUID: ZaOsCuDEQaWjrISSMMjUaw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407059" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:24 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern , Greenman, Gregory Subject: [PATCH 01/20] wifi: iwlwifi: mvm: add an option to use ptp clock for rx timestamp Date: Mon, 27 May 2024 19:05:56 +0300 Message-Id: <20240527190228.b197b4f3f9ed.I578ee916d5f517a2e3a89e890a8ea24065946427@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avraham Stern Add a debugfs option to use the ptp clock time for rx device timestamps. This can be useful to e.g. synchronize multiple NICs or reporting the timestamp in the system clock instead of gp2. Signed-off-by: Avraham Stern Reviewed-by: Greenman, Gregory Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 7e7153220fd7..1504cbec69c9 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -2450,6 +2450,9 @@ void iwl_mvm_dbgfs_register(struct iwl_mvm *mvm) debugfs_create_file("mem", 0600, mvm->debugfs_dir, mvm, &iwl_dbgfs_mem_ops); + debugfs_create_bool("rx_ts_ptp", 0600, mvm->debugfs_dir, + &mvm->rx_ts_ptp); + /* * Create a symlink with mac80211. It will be removed when mac80211 * exists (before the opmode exists which removes the target.) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index 9e967b9cb015..f3d9b8355c6b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -1309,6 +1309,9 @@ struct iwl_mvm { struct iwl_phy_specific_cfg phy_filters; #endif + /* report rx timestamp in ptp clock time */ + bool rx_ts_ptp; + unsigned long last_6ghz_passive_scan_jiffies; unsigned long last_reset_or_resume_time_jiffies; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index 0f78a9ef5240..34a0f524262a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -1954,6 +1954,14 @@ static void iwl_mvm_rx_fill_status(struct iwl_mvm *mvm, iwl_mvm_decode_lsig(skb, phy_data); rx_status->device_timestamp = phy_data->gp2_on_air_rise; + + if (mvm->rx_ts_ptp && mvm->monitor_on) { + u64 adj_time = + iwl_mvm_ptp_get_adj_time(mvm, phy_data->gp2_on_air_rise * NSEC_PER_USEC); + + rx_status->device_timestamp = div64_u64(adj_time, NSEC_PER_USEC); + } + rx_status->freq = ieee80211_channel_to_frequency(phy_data->channel, rx_status->band); iwl_mvm_get_signal_strength(mvm, rx_status, rate_n_flags, From patchwork Mon May 27 16:05:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800941 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 792027347E for ; Mon, 27 May 2024 16:06:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825989; cv=none; b=nVnPSAEzvPxJaRAl9pMA+/2e4P6Lsq9ZO8lYPtUayVgOSWTx0XAYGwilJXUil6VVmJ5QllliNrdgnvx2PGhZVGtTCV3zOiS3owzqK/hF2KYKl1RWOS//TJnlitfoT0KNxcKjefJMNjQNfMYpFyzmSXTDw2f/U1umfO4ncAXvbkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825989; c=relaxed/simple; bh=609RYTUe1Eiuo3cpjYJhXwnSKD4qdU2A3FS1aWur41s=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pueRSOxL6ByXN8JPErYixGV5ySPBnd0ookmMBtOMtJQ/EgK9aP+sepeGT/ouhKbO6NIX9KVZaY78VchCie7pcETjbbm3JOjJ9lvkZVol+hP7YtMsAzbvAa6G+T5ank6t6R9u7ic4zZzZs1QHPEVV2vBdT1uLqrXbV9lGByrUJ+w= 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=V2+vnRG3; arc=none smtp.client-ip=198.175.65.19 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="V2+vnRG3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825988; x=1748361988; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=609RYTUe1Eiuo3cpjYJhXwnSKD4qdU2A3FS1aWur41s=; b=V2+vnRG3ZlrvVCdJM9Aw48LH6YvdAW0TsTWb34rPPAZ9ocsoztbR/Ux7 +PmKohfomV1+2UKhy/lp2Pxv4rhm0QV7weF0QavIIYXqNfLDLOtIEXvJn 0o6vszjSOM+nG1MhspxTrkGNCpeWstMj2licbdIKr8ViPjPQS4H+MIyMa yjZ6dxd8uSLAS4eGeBTrxSWkAozSGYTlwGApRYni0Ivq/wtTvId+3CJSf WDNU3O5sE/26ogEuP9LUgNWJibCSzIeXMSKB1Lpf/W05dVi4e/5ygsm18 sZSMpWi824EpS9dO5G7MuLRq1GTjRnay7Q2HoJT6brpRyVxpgRQ5mNx88 g==; X-CSE-ConnectionGUID: jQPUAQjTQjqY5WfJfCECRQ== X-CSE-MsgGUID: rXAWuvD4R5ePbkP3Td7XhA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002070" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002070" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:28 -0700 X-CSE-ConnectionGUID: hXZ08PUjQCO7SQCtwJbSWQ== X-CSE-MsgGUID: SImxyqXIS429Kf6stjARmQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407069" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:26 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman , Benjamin Berg Subject: [PATCH 02/20] wifi: iwlwifi: mvm: report 64-bit radiotap timestamp Date: Mon, 27 May 2024 19:05:57 +0300 Message-Id: <20240527190228.4fc44356e7df.Ic8642d35f1090a415e09299a1bd409f51dfb6351@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 Use the new RX_FLAG_MACTIME_IS_RTAP_TS64 in mac80211 to report a 64-bit timestamp in the mactime for radiotap only, in case we report the synchronized PTP clock timestamp (otherwise we really only have 32 bits anyway). Signed-off-by: Johannes Berg Reviewed-by: Gregory Greenman Reviewed-by: Benjamin Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c index 34a0f524262a..5370580f6210 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -1959,7 +1959,9 @@ static void iwl_mvm_rx_fill_status(struct iwl_mvm *mvm, u64 adj_time = iwl_mvm_ptp_get_adj_time(mvm, phy_data->gp2_on_air_rise * NSEC_PER_USEC); - rx_status->device_timestamp = div64_u64(adj_time, NSEC_PER_USEC); + rx_status->mactime = div64_u64(adj_time, NSEC_PER_USEC); + rx_status->flag |= RX_FLAG_MACTIME_IS_RTAP_TS64; + rx_status->flag &= ~RX_FLAG_MACTIME; } rx_status->freq = ieee80211_channel_to_frequency(phy_data->channel, From patchwork Mon May 27 16:05:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799440 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 9129115A878 for ; Mon, 27 May 2024 16:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825991; cv=none; b=jPuHW/Z1i6J7rk2YS4yrB1N6ASkYxHiMS/DU89WO/777S076On+4m0Of3fSfgkdQ1Li189SX053STapDnWkpDsCmzZlTZ1EYm3sRY/l8ezobkr+mJSEL/R4MKJ27/lByuw1qZsjhb1R7B6Mra43boqU6z1Xj4rSgEbSOPwwgsXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825991; c=relaxed/simple; bh=qRWX54XhMdkVAtp/3yAqaKPnnYCSfsB09HLipgk7kTE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=rRR2SWn99754FOMMBFckWzpl0LIhEXK74apv3BotV/0QmLNgrfcn+NCgKEAadRRfFpo8Ibk0HXYJthGO2a4wcewJaxLZYMhF+s5AwHSgO69tBvyde68YMibTDI1uRzbta6OK3T0Lbo1HZ11TVsCKbKDznu2A1+S5AnIQcixw5Tk= 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=cQyyYzR5; arc=none smtp.client-ip=198.175.65.19 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="cQyyYzR5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825990; x=1748361990; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qRWX54XhMdkVAtp/3yAqaKPnnYCSfsB09HLipgk7kTE=; b=cQyyYzR5pPaT+L0QEEjCh6LsVJJtvl7K7AWoq8Gt5Ss/RRZn3ozy+Wx7 RDgLCC7k8ngedQH5dkhz6dLTC9KtWliEZFmviuGrvKnoWGMyuoBwPRTxP yWK8mEDS9GDaiSvqAe8hlUgebOBo9Kj2NO4jg975F7RJFOH3LNQqa4xGQ t62uSMlCSoOGUdA1fAdKomkZE8MBHqY40ey3N4Ykgh2gpzigbRDryT/rM YKMrRuGzsXExsFaYxMfYHtGzruz+Kmwp5AsaAyjDgVQOzVAjYrWIx1+Gi nyRglQpi7RIGln7jWhw68KDT+k6sONxzgLWwVIlzXQUMaQRhf+J7C02bT A==; X-CSE-ConnectionGUID: Falo3/2XTsSXv2u9NhJw/Q== X-CSE-MsgGUID: U8XrU6BfQFSTH9cr5Ao6QQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002073" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002073" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:29 -0700 X-CSE-ConnectionGUID: dvmyVwfvQcKAR8V6cKkJww== X-CSE-MsgGUID: Q6Ot/b+oQP+AJMrGumkMmA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407076" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:28 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avri Altman , Grumbach, Emmanuel Subject: [PATCH 03/20] wifi: iwlwifi: mvm: Enable p2p low latency Date: Mon, 27 May 2024 19:05:58 +0300 Message-Id: <20240527190228.21b431bdfc26.I018e330d1e6a76e967b25e9542c2260f0f6ed2a8@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avri Altman Enable p2p low latency by default. Signed-off-by: Avri Altman Reviewed-by: Grumbach, Emmanuel Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/constants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h index 3cbeaddf4358..eda6634b4fb5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h @@ -23,7 +23,7 @@ #define IWL_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * USEC_PER_MSEC) #define IWL_MVM_SHORT_PS_TX_DATA_TIMEOUT (2 * 1024) /* defined in TU */ #define IWL_MVM_SHORT_PS_RX_DATA_TIMEOUT (40 * 1024) /* defined in TU */ -#define IWL_MVM_P2P_LOWLATENCY_PS_ENABLE 0 +#define IWL_MVM_P2P_LOWLATENCY_PS_ENABLE 1 #define IWL_MVM_UAPSD_RX_DATA_TIMEOUT (50 * USEC_PER_MSEC) #define IWL_MVM_UAPSD_TX_DATA_TIMEOUT (50 * USEC_PER_MSEC) #define IWL_MVM_UAPSD_QUEUES (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ From patchwork Mon May 27 16:05:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800940 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 8DBCF15A87F for ; Mon, 27 May 2024 16:06:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825992; cv=none; b=E3WTyX+x7JtbxfZx1XtkkPwT/+mon3TNlROio62+8Agz9SuvfN6fF7S2QWyM81xOC/GHz+4+bQJT4xhMlScIwTABRetn8i7K5O2S2sLcjKIPe98JvIXUG8mGwYzLR9IiDTM/6JsutOgM71IJFDPbocMMCYT/62iBdBbYbH57Vy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825992; c=relaxed/simple; bh=llX8MBU0oPhPPqJcjmNYdou62xPDV6OLXxIgzNerdhE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=L1w6beKD38ALTQbTvMZLD0qVgSVUkv6MlBxr4QZ432MoAJqZY7hTgwnrr3gY+kCq2dmWbYZjshA6yTiIyE35iLWT4U6Rc9dz4e8tFttm3glAJn8yLKU5/1DvE3jfL08V1+QvmVF0K/ehrMtd7jJD+6w9Gt7FsVkAm61x3HKcViQ= 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=hsooS6yx; arc=none smtp.client-ip=198.175.65.19 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="hsooS6yx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825992; x=1748361992; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=llX8MBU0oPhPPqJcjmNYdou62xPDV6OLXxIgzNerdhE=; b=hsooS6yx2btqHF9U/tg94JOtqkW6sboaH8CBf90aiVwdpVyjmSTuAEBI 1yh8acJgy1ydXRRxmnMAbqxLzxyNg7vbExWYyDBGIsFGZeb1Wg3xPydtM gs1k8IN3o3jR3jCWMavNIbRKMg0aSwAHgMjeptP27EU7p9KL48dhFmrWX nkXApGorPCssBTWawUwtT4EUj16Vp3Oomfnegx8iicnF1ZGZswrhv8BDv H+qTci19Sd7E/JE+euu6vCLA6DgilJQ1GSfWK3MRiNMH/0yReOwB2ypck 6JFa7BkWZLOBFeVo0x5UoyEqEstfDIq3JidbevuJhH1NoQaQt4rNyKQhM g==; X-CSE-ConnectionGUID: 3srIrrirQ2OaHCwKF5HMTA== X-CSE-MsgGUID: dJKSzFo0R92K7epG2DJaMg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002075" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002075" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:31 -0700 X-CSE-ConnectionGUID: Bv2BMTFORoq7vdXgyaRvWA== X-CSE-MsgGUID: FfrBf+nNRn2CPnQZokZ6Tg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407078" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:30 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH 04/20] wifi: iwlwifi: mvm: remove IWL_MVM_USE_NSSN_SYNC Date: Mon, 27 May 2024 19:05:59 +0300 Message-Id: <20240527190228.c5edfb967e35.I34a3d54a1dc90d9b2937b0bcbbc508fe3cd41773@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 is not used and not needed anymore. Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/constants.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h index eda6634b4fb5..c991eaeade15 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h @@ -114,7 +114,6 @@ #define IWL_MVM_D3_DEBUG false #define IWL_MVM_USE_TWT true #define IWL_MVM_AMPDU_CONSEC_DROPS_DELBA 20 -#define IWL_MVM_USE_NSSN_SYNC 0 #define IWL_MVM_FTM_INITIATOR_ENABLE_SMOOTH false #define IWL_MVM_FTM_INITIATOR_SMOOTH_ALPHA 40 /* 20016 pSec is 6 meter RTT, meaning 3 meter range */ From patchwork Mon May 27 16:06:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799439 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 74F5715A874 for ; Mon, 27 May 2024 16:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825992; cv=none; b=qOXGpGcF/0ZXrvRCFFDvwg8kguc+WONcqwH7rEpc/fB1xdDVYUSf0OWomU1nZ2DGhiiMIqplwOFE/KTVDdsZ7NPdIx+i+DM+8tAJBdUA4VqrvyBwU6oXwfcCKc2d8ZU0Omf0WOfMxKTirK3GYbnNRVqJJQDfBWGZLP8H5hpOR9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825992; c=relaxed/simple; bh=x+hJ0WZJSbXevrGpC1b/J/ZsRiqmsh+sCFUjPpZn2VE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=q9wXo+iQG5kj1ah6iZYujcLzG+AQtXd4uV8gF5Mfc8sX7J8co4+vCWcLoQKGjTwr1eobMPz3cu33jFP4sFT+R9t7SABLVBWxtI0GVKhO+gJzu9vMffIqT3yTllz51y8TCu8nRXgFf+P3YxiefMWbqgYI9Drc/J+8emzDOAeF6gc= 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=AtI7brAu; arc=none smtp.client-ip=198.175.65.19 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="AtI7brAu" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825992; x=1748361992; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=x+hJ0WZJSbXevrGpC1b/J/ZsRiqmsh+sCFUjPpZn2VE=; b=AtI7brAuLQwyMOb/QUC4M8d9V+kkL+Ddn3ajOVU+EvBpWCUfi57v1gcY O9ABf7Gmii0PVTDhjR+wJhE/nI3tlmFK5CIlDg9ys0xYOqtvh96OXJ5va +WNbZznO9cnrAZD6Fm/N4JyJn4v52WmYoQ1LIGnxIcc8ojyp3FqlNiYPu d5JXYmW03cTCWpFP7/aDvWljva4FqmhydGd/4DEOUBvJC+e+O1DXcRDSj 2JCl9OnWX97xhnlg7EXuUb5XKM9XSbEhOM841ueyMnRDrmt/ZmzXYo2Dw FQvYUY2/21LppQo1pwyO0OtI28ruhprhbzhQoGoNNzgP43wT62jsORUna A==; X-CSE-ConnectionGUID: yO5PL5UsR3CPW9ViNsz86g== X-CSE-MsgGUID: qv/2vkyySNaElM4v51yGBA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002077" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002077" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:32 -0700 X-CSE-ConnectionGUID: lMGz6E5QQpCfr/ZkLaW8bA== X-CSE-MsgGUID: D1SsIYwdSPmziDymZiyZlw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407080" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:31 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH 05/20] wifi: iwlwifi: mvm: move a constant to constants.h Date: Mon, 27 May 2024 19:06:00 +0300 Message-Id: <20240527190228.395f5b24ff82.Id78a5a404c3ae15cbbc950b1f1d7e500a8b92a43@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 Move IWL_MVM_MIN_BEACON_INTERVAL_TU to constants.h Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/constants.h | 1 + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h index c991eaeade15..d840653cc907 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h @@ -123,6 +123,7 @@ #define IWL_MVM_DISABLE_AP_FILS false #define IWL_MVM_6GHZ_PASSIVE_SCAN_TIMEOUT 3000 /* in seconds */ #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 diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 87825fb496bc..752fdb6a783f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3753,8 +3753,6 @@ static void iwl_mvm_rs_rate_init_all_links(struct iwl_mvm *mvm, } } -#define IWL_MVM_MIN_BEACON_INTERVAL_TU 16 - static bool iwl_mvm_vif_conf_from_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct ieee80211_sta *sta) From patchwork Mon May 27 16:06:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800939 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 660E715D5D2 for ; Mon, 27 May 2024 16:06:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825995; cv=none; b=CZuFm8DA2oUIP/8+vQQBbTwUtWC/QmdxZqgdogn7UpF/rkt0w/a+fDKHIHq9dR6jfG2Bg8doaZiE95e/do0dXob36lxX7cusX8GR9eYOtd9qVyjM9xJ0V/hLwlMY2sTnpiWZHDqKF6bvCk7WCgc61And/IHb8gG0/T4u9Dm0S3U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825995; c=relaxed/simple; bh=c4GBhdjRv1DldMu0+bvicmxHq/r6v+Y95sJs0PPz5/U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=g2i9lPA8iNikgQpEtFwse/5isfEgvLMNnuinR8n6TdMtpMESO0IpV89i4cqYzVbiK8VonWL+i11Gi7AnPR39BkHDAr1XkbhHfq8/TaFrEdzFqDxQqkj4azVTGeURpWzJb33wyNhEnvXN1AHo1aWrlObv3k/FZOEz3mwA2/ztfkc= 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=SrAe79Y0; arc=none smtp.client-ip=198.175.65.19 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="SrAe79Y0" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825994; x=1748361994; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=c4GBhdjRv1DldMu0+bvicmxHq/r6v+Y95sJs0PPz5/U=; b=SrAe79Y0u2IbDfrkxHK/kEVyUbNn/Dpbo4zi9S3E8OQC0xITimMdIOcH 0FsZKEaAxLuzH2vpp2StCSNIirK/QmhTcyczXFpRtsHASNvcylMNx34Km c4sQEsxCC27ti2Wfk2UE8z3q3AZy6Kn7NXpcZzKJOAJvT3vcJxJ3pMO8Z JiBsp9hnc8bc/75KwhTSWm7B+nx1TQYHkX2dFv4HupBY8pMeI1I7Be7ch KhdMjakqGQPOK5A3Zw2HrG5kWOL2yx6TF4PsRI6M48xNFmhE7NSCEi2Mx u/w7d5tBLeYNDUk+Y1uWtYIV0uf24/poN7OWg6g/NkgbckeRMWRkq3F6I A==; X-CSE-ConnectionGUID: qcAB4I0ZQtS/CWvSJWhv8A== X-CSE-MsgGUID: IFqX0KcESYKhCVQvRZXiew== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002079" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002079" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:34 -0700 X-CSE-ConnectionGUID: 9OQxxAzkQb2WOYYwcIOq2Q== X-CSE-MsgGUID: d7kItj29TNShBdzXcE47RA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407088" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:32 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Mukesh Sisodiya Subject: [PATCH 06/20] wifi: iwlwifi: mvm: handle TPE advertised by AP Date: Mon, 27 May 2024 19:06:01 +0300 Message-Id: <20240527190228.32f1e2e1447c.I58ac91c38585362aa42bb4a8a59c7d88e67bc40b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 6 GHz BSS SP client shall respect TX power limits advertised by the AP in TPE elements, send the data to the firmware using the AP_TX_POWER_CONSTRAINTS_CMD command, so do that. Co-developed-by: Mukesh Sisodiya Signed-off-by: Mukesh Sisodiya Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 11 ++++ .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 55 ++++++++++++++++--- drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 6 ++ 3 files changed, 63 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 752fdb6a783f..88bc0baabf7e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -2768,6 +2768,13 @@ iwl_mvm_bss_info_changed_station_common(struct iwl_mvm *mvm, if (changes & BSS_CHANGED_BANDWIDTH) iwl_mvm_update_link_smps(vif, link_conf); + + if (changes & BSS_CHANGED_TPE) { + IWL_DEBUG_CALIB(mvm, "Changing TPE\n"); + iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, + link_conf, + false); + } } static void iwl_mvm_bss_info_changed_station(struct iwl_mvm *mvm, @@ -5122,6 +5129,10 @@ static int __iwl_mvm_assign_vif_chanctx(struct iwl_mvm *mvm, } iwl_mvm_update_quotas(mvm, false, NULL); + + iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, + link_conf, + false); } goto out; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index 00433d1c8564..b2b6dbdcc44f 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -345,6 +345,11 @@ __iwl_mvm_mld_assign_vif_chanctx(struct iwl_mvm *mvm, rcu_read_unlock(); } + if (vif->type == NL80211_IFTYPE_STATION) + iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, + link_conf, + false); + /* then activate */ ret = iwl_mvm_link_changed(mvm, vif, link_conf, LINK_CONTEXT_MODIFY_ACTIVE | @@ -524,9 +529,37 @@ static void iwl_mvm_mld_unassign_vif_chanctx(struct ieee80211_hw *hw, } static void +iwl_mvm_tpe_sta_cmd_data(struct iwl_txpower_constraints_cmd *cmd, + const struct ieee80211_bss_conf *bss_info) +{ + u8 i; + + /* + * NOTE: the 0 here is IEEE80211_TPE_CAT_6GHZ_DEFAULT, + * we fully ignore IEEE80211_TPE_CAT_6GHZ_SUBORDINATE + */ + + BUILD_BUG_ON(ARRAY_SIZE(cmd->psd_pwr) != + ARRAY_SIZE(bss_info->tpe.psd_local[0].power)); + + /* if not valid, mac80211 puts default (max value) */ + for (i = 0; i < ARRAY_SIZE(cmd->psd_pwr); i++) + cmd->psd_pwr[i] = min(bss_info->tpe.psd_local[0].power[i], + bss_info->tpe.psd_reg_client[0].power[i]); + + BUILD_BUG_ON(ARRAY_SIZE(cmd->eirp_pwr) != + ARRAY_SIZE(bss_info->tpe.max_local[0].power)); + + for (i = 0; i < ARRAY_SIZE(cmd->eirp_pwr); i++) + cmd->eirp_pwr[i] = min(bss_info->tpe.max_local[0].power[i], + bss_info->tpe.max_reg_client[0].power[i]); +} + +void iwl_mvm_send_ap_tx_power_constraint_cmd(struct iwl_mvm *mvm, struct ieee80211_vif *vif, - struct ieee80211_bss_conf *bss_conf) + struct ieee80211_bss_conf *bss_conf, + bool is_ap) { struct iwl_txpower_constraints_cmd cmd = {}; struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); @@ -546,19 +579,22 @@ iwl_mvm_send_ap_tx_power_constraint_cmd(struct iwl_mvm *mvm, link_info->fw_link_id == IWL_MVM_FW_LINK_ID_INVALID) return; - if (bss_conf->chanreq.oper.chan->band != NL80211_BAND_6GHZ || - bss_conf->chanreq.oper.chan->flags & - IEEE80211_CHAN_NO_6GHZ_VLP_CLIENT) + if (bss_conf->chanreq.oper.chan->band != NL80211_BAND_6GHZ) return; cmd.link_id = cpu_to_le16(link_info->fw_link_id); - /* - * Currently supporting VLP Soft AP only. - */ - cmd.ap_type = cpu_to_le16(IWL_6GHZ_AP_TYPE_VLP); memset(cmd.psd_pwr, DEFAULT_TPE_TX_POWER, sizeof(cmd.psd_pwr)); memset(cmd.eirp_pwr, DEFAULT_TPE_TX_POWER, sizeof(cmd.eirp_pwr)); + if (is_ap) { + cmd.ap_type = cpu_to_le16(IWL_6GHZ_AP_TYPE_VLP); + } else if (bss_conf->power_type == IEEE80211_REG_UNSET_AP) { + return; + } else { + cmd.ap_type = cpu_to_le16(bss_conf->power_type - 1); + iwl_mvm_tpe_sta_cmd_data(&cmd, bss_conf); + } + ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP, AP_TX_POWER_CONSTRAINTS_CMD), @@ -580,7 +616,8 @@ static int iwl_mvm_mld_start_ap_ibss(struct ieee80211_hw *hw, guard(mvm)(mvm); if (vif->type == NL80211_IFTYPE_AP) - iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, link_conf); + iwl_mvm_send_ap_tx_power_constraint_cmd(mvm, vif, + link_conf, true); /* Send the beacon template */ ret = iwl_mvm_mac_ctxt_beacon_changed(mvm, vif, link_conf); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h index f3d9b8355c6b..9b939225990a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -2962,4 +2962,10 @@ iwl_mvm_bt_coex_calculate_esr_mode(struct iwl_mvm *mvm, bool primary); int iwl_mvm_esr_non_bss_link(struct iwl_mvm *mvm, struct ieee80211_vif *vif, unsigned int link_id, bool active); + +void +iwl_mvm_send_ap_tx_power_constraint_cmd(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct ieee80211_bss_conf *bss_conf, + bool is_ap); #endif /* __IWL_MVM_H__ */ From patchwork Mon May 27 16:06:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799438 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 0BFC07346D for ; Mon, 27 May 2024 16:06:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825996; cv=none; b=O46/Db1zkuHpW85Hzj3zBY3b8SUBu1epb2jetDm8CONErwYLNek6gmdMfj2s+q9oPtRdSjdhpPmmwGc+T1pElPCL8EIhZ1pcMuQpt43wcdh9fcWcl91Da7M//YtSKat9HEPWlF97mZnQXzySaw8TBSqHDveeSY9lW9NU1Ml2LZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825996; c=relaxed/simple; bh=haIERDVN8aIfsXOHcTTGoVqbQocflAXSZNpuk/9L7zU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=WK/zyBg6m3qzJa2bcCfRqI/ZejyG0fIiwtBejVd7HuMZ4xzsShFWW7UDaAfSX4EO5uD9oQJ5gaLv5NWFEGgoEwz28l86xzpF9c9wCFFGF8soaxhaH8+rVVXTYKq52H4iw5oUsWvhK5YMf6HzpQFu2iZZg9SOfBRnMj+hch4w8f0= 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=ZvGsKQw+; arc=none smtp.client-ip=198.175.65.19 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="ZvGsKQw+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825995; x=1748361995; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=haIERDVN8aIfsXOHcTTGoVqbQocflAXSZNpuk/9L7zU=; b=ZvGsKQw+Orxc+faTJU9AXS3I94S/41eUaXK++DpRQFS1aVh6rkZsD2EF yNyFwXFPzJg37RF+dC+REHnxeOgbK7UD1fezCLSRxN+qsgnPtq6jFknSE U+zlloUyxdvKazEEXJ0NazM3bOOr1WcKQENW8F8d9AyV0639c7WAFBaFb sy4U5tMi1s2j5R6q3iUrvHMKxAbDTc8cbnnSTEiCv5nOng2MI8MqgBZio /P3Lzgd/jNAFXOjAoi4J8ezBP2Fz7XO5+7IXgB1Tmedzpa/8f9N5lPZZQ +G9YIwA/XeI6p3JVse0OnbSGE9ztnvPnKkM0q5YnrNszcwPaJtOj+tWFM g==; X-CSE-ConnectionGUID: JcN66xEpRViYtLgHJdG3Cg== X-CSE-MsgGUID: 0SgwwLvXTZOSi694W4t+Zw== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002083" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002083" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:35 -0700 X-CSE-ConnectionGUID: MZgcheqPQ/StN0cHzogWbA== X-CSE-MsgGUID: 95DOrkAlRnaYAu8W01jqZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407091" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:34 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern Subject: [PATCH 07/20] wifi: iwlwifi: mvm: initiator: move setting target flags into a function Date: Mon, 27 May 2024 19:06:02 +0300 Message-Id: <20240527190228.9d22b61ce589.I7dbe596b4f677638d9a48c3f39b0826a9e35bea4@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avraham Stern Move setting the target flags into a dedicated function to support different versions of the target struct. This is done as preparation for moving to the new range request version. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit --- .../intel/iwlwifi/mvm/ftm-initiator.c | 49 ++++++++++++------- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index 72a3d71f46f0..98b1bbfc84bc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -434,44 +434,55 @@ iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm, #define FTM_PUT_FLAG(flag) (target->initiator_ap_flags |= \ cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag)) +#define FTM_SET_FLAG(flag) (*flags |= \ + cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag)) + static void -iwl_mvm_ftm_put_target_common(struct iwl_mvm *mvm, - struct cfg80211_pmsr_request_peer *peer, - struct iwl_tof_range_req_ap_entry_v6 *target) +iwl_mvm_ftm_set_target_flags(struct iwl_mvm *mvm, + struct cfg80211_pmsr_request_peer *peer, + __le32 *flags) { - memcpy(target->bssid, peer->addr, ETH_ALEN); - target->burst_period = - cpu_to_le16(peer->ftm.burst_period); - target->samples_per_burst = peer->ftm.ftms_per_burst; - target->num_of_bursts = peer->ftm.num_bursts_exp; - target->ftmr_max_retries = peer->ftm.ftmr_retries; - target->initiator_ap_flags = cpu_to_le32(0); + *flags = cpu_to_le32(0); if (peer->ftm.asap) - FTM_PUT_FLAG(ASAP); + FTM_SET_FLAG(ASAP); if (peer->ftm.request_lci) - FTM_PUT_FLAG(LCI_REQUEST); + FTM_SET_FLAG(LCI_REQUEST); if (peer->ftm.request_civicloc) - FTM_PUT_FLAG(CIVIC_REQUEST); + FTM_SET_FLAG(CIVIC_REQUEST); if (IWL_MVM_FTM_INITIATOR_DYNACK) - FTM_PUT_FLAG(DYN_ACK); + FTM_SET_FLAG(DYN_ACK); if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_LINEAR_REG) - FTM_PUT_FLAG(ALGO_LR); + FTM_SET_FLAG(ALGO_LR); else if (IWL_MVM_FTM_INITIATOR_ALGO == IWL_TOF_ALGO_TYPE_FFT) - FTM_PUT_FLAG(ALGO_FFT); + FTM_SET_FLAG(ALGO_FFT); if (peer->ftm.trigger_based) - FTM_PUT_FLAG(TB); + FTM_SET_FLAG(TB); else if (peer->ftm.non_trigger_based) - FTM_PUT_FLAG(NON_TB); + FTM_SET_FLAG(NON_TB); if ((peer->ftm.trigger_based || peer->ftm.non_trigger_based) && peer->ftm.lmr_feedback) - FTM_PUT_FLAG(LMR_FEEDBACK); + FTM_SET_FLAG(LMR_FEEDBACK); +} + +static void +iwl_mvm_ftm_put_target_common(struct iwl_mvm *mvm, + struct cfg80211_pmsr_request_peer *peer, + struct iwl_tof_range_req_ap_entry_v6 *target) +{ + memcpy(target->bssid, peer->addr, ETH_ALEN); + target->burst_period = + cpu_to_le16(peer->ftm.burst_period); + target->samples_per_burst = peer->ftm.ftms_per_burst; + target->num_of_bursts = peer->ftm.num_bursts_exp; + target->ftmr_max_retries = peer->ftm.ftmr_retries; + iwl_mvm_ftm_set_target_flags(mvm, peer, &target->initiator_ap_flags); } static int From patchwork Mon May 27 16:06:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800938 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 A7D3615EFC8 for ; Mon, 27 May 2024 16:06:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825997; cv=none; b=McnUDv4L3qzJPMjGyEqLcA4rLVZrLBRuB8hEhbUh8QCq36yF0IB939jVxPngqDAdni3Bd7XZ1E0+vNCWVFsorrdEWbDBdKsD1EhLwKlrdY/w0YrWIm+3vLQXpZKqX+HC2QkiMjUSkXW1m3ARHGXIYvAKP5fNIV9BHlMszrjIIpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825997; c=relaxed/simple; bh=XWbcCMcpCb1QpC42k20A+pt00F6hlMeD7mFV5mQzmDY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ko2GtrKMdJ4rw3UOIylJWZARrPoJvetaOu8NHpAVLof7X+SFXhZbobMSptfjfJnQ/I2BjLDecJnPxCBSHZA5GnZiKRMyw9xW0EOmpUPCzMOSCq9V7y+dEHlnI2FexnetfK88c1P9f7aIovLATtu9QExIqu9Kfyg/h/Hpbyu+b2Y= 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=JgOgs64v; arc=none smtp.client-ip=198.175.65.19 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="JgOgs64v" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825996; x=1748361996; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XWbcCMcpCb1QpC42k20A+pt00F6hlMeD7mFV5mQzmDY=; b=JgOgs64vr9PEcnacTkTM2CkswjVs+Vje8RImAv+njZeRIXtaNizRS0A8 owqppX/K0tTZobbs411gG4sJtOzYa9Zo0wAynw6jVeWKoAuddyfax7cAu RnjssJt00qLFVzBz4UTuuRNa6+yxKPkZSWXSg8gNGs9c/DWL0uwG1tBpe I3l//jmksQqkxJQCZ9kePvY1Lli8LgL7d6mVmRR3a4HbKtgeUlnnDTMVB pM4eooXBqLIJGMQv2f8FaIsaaybNN6mXMvm6zHMNOTAZl5YVybZs7UWY2 OF6KYtSCyNE89L6DypQsGdh5kgW1BD5KVxP3SIUCWQEU0p/iRZ6abKYI7 g==; X-CSE-ConnectionGUID: nEcLkaNgRRWKoztQMaIh4g== X-CSE-MsgGUID: A2f6XyCHRtyMv7GduW8jWg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002086" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002086" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:36 -0700 X-CSE-ConnectionGUID: Ebb7kWAzSl+jkcQO7iKnhw== X-CSE-MsgGUID: dIGo9Z8URdWS3TObGRdPsw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407092" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:35 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org Subject: [PATCH 08/20] wifi: iwlwifi: mvm: Remove debug related code Date: Mon, 27 May 2024 19:06:03 +0300 Message-Id: <20240527190228.c3b89828efb2.I7ded6348d2fb0cb7e103c4eee033451924c3461d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 code is intended for internal testing. Remove it. Fixes: 30ce039094b5 ("wifi: iwlwifi: mvm: Don't allow EMLSR when the RSSI is low") Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c b/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c index f49e3c98b1ba..6a680b5d03e0 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c @@ -393,9 +393,6 @@ static void test_valid_link_pair(struct kunit *test) chandef_a.width = params->cw_a ?: NL80211_CHAN_WIDTH_20; chandef_b.width = params->cw_b ?: NL80211_CHAN_WIDTH_20; -#ifdef CONFIG_IWLWIFI_SUPPORT_DEBUG_OVERRIDES - trans->dbg_cfg = default_dbg_config; -#endif mvm.trans = trans; mvm.last_bt_notif.wifi_loss_low_rssi = params->bt; From patchwork Mon May 27 16:06:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799437 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 5E76815EFC4 for ; Mon, 27 May 2024 16:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825998; cv=none; b=rqQZuDAmX78vv2Bxevbz2JziTE284X6yyMfBp8sVSVDw1ck2xLtzMp/uDf93AHVuGxg+KglCk4oNDy1Z/YoAIQ+/R08qGObZakTe0M13L5aQQQQRj2YxTOvk+UiGTGIZRZKV5Bts6R+/XuPDi2BTdJtTMlIgmTOYeya2OHfa0Lw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716825998; c=relaxed/simple; bh=euGrkW9C9BReiYgJyxO/H5u2czTaAPCJR+tq2G0J10k=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BcwgC7kispFDwDeDImE3vpb3LWUZQ4ZfBFtwwlMDtgVQBcnRwt9GVaTf5ZsS96nvzTNVKcPTzEgK1eCT77xPfd6JC+iIUvw/fN9P5zi4qU2tVaDJvGwoGiQsOAP427gGDdF3cBFr/jNn9N9vaFnTlZ0fcvlE+p7dgpKtzVM0/Ho= 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=C9S0VpnF; arc=none smtp.client-ip=198.175.65.19 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="C9S0VpnF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825998; x=1748361998; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=euGrkW9C9BReiYgJyxO/H5u2czTaAPCJR+tq2G0J10k=; b=C9S0VpnFyB0CwyVYQcSZwBVYD6OlzGtuCFtb8RONNQjGnWnKVc9W/xqH 3Yf9N9oV6PgMpFGDhzIljEF277z1d8bC27opAvBwQZxvZG7QtlX+HHNMi /JbGR4qj4nepkzogA6pJsj4gI6MmM+8tj4fPtR0klZzqp5nwB9s7h1LtZ REWEULp/zDHI84q7Dyyt3Bke1qVe4P64gyBKkV7Mq4zETy7MXPVlHbgpp s97rIDE5jCMKTMhxAf5W/hZk7UH594xAESYqTgtiBuNkCfisevaXNTylW Kl71nC+9ln/71HzOw8GCeQWbSqgEJ1Zx71x2m6W6RLeHazFODoTMdA+U3 Q==; X-CSE-ConnectionGUID: igvl3rVgS1u9DARcIRT5XA== X-CSE-MsgGUID: COGY1XKlQo6zDqzvMek3Qw== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002089" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002089" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:38 -0700 X-CSE-ConnectionGUID: aJmBKKzYTjmpmlR/y0geAw== X-CSE-MsgGUID: bZ1Du0VqSvG4WEzP9NPMUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407099" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:36 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern Subject: [PATCH 09/20] wifi: iwlwifi: mvm: initiator: move setting the sta_id into a function Date: Mon, 27 May 2024 19:06:04 +0300 Message-Id: <20240527190228.18e3a6a6f1cb.I85e3ee607b3947448532bc16730f8898a11c92b8@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avraham Stern Move setting the target's sta_id (and related flags) into a function to support different versions of the target struct. This is done as preparation for moving to the new range request version. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit --- .../intel/iwlwifi/mvm/ftm-initiator.c | 55 ++++++++++--------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index 98b1bbfc84bc..8596e6f7d1dc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -431,9 +431,6 @@ iwl_mvm_ftm_put_target_v2(struct iwl_mvm *mvm, return 0; } -#define FTM_PUT_FLAG(flag) (target->initiator_ap_flags |= \ - cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag)) - #define FTM_SET_FLAG(flag) (*flags |= \ cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag)) @@ -525,21 +522,10 @@ iwl_mvm_ftm_put_target_v4(struct iwl_mvm *mvm, return 0; } -static int -iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif, - struct cfg80211_pmsr_request_peer *peer, - struct iwl_tof_range_req_ap_entry_v6 *target) +static int iwl_mvm_ftm_set_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct cfg80211_pmsr_request_peer *peer, + u8 *sta_id, __le32 *flags) { - int ret; - - ret = iwl_mvm_ftm_target_chandef_v2(mvm, peer, &target->channel_num, - &target->format_bw, - &target->ctrl_ch_position); - if (ret) - return ret; - - iwl_mvm_ftm_put_target_common(mvm, peer, target); - if (vif->cfg.assoc) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); struct ieee80211_sta *sta; @@ -551,8 +537,8 @@ iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (memcmp(peer->addr, link_conf->bssid, ETH_ALEN)) continue; - target->sta_id = mvmvif->link[link_id]->ap_sta_id; - sta = rcu_dereference(mvm->fw_id_to_mac_id[target->sta_id]); + *sta_id = mvmvif->link[link_id]->ap_sta_id; + sta = rcu_dereference(mvm->fw_id_to_mac_id[*sta_id]); if (WARN_ON_ONCE(IS_ERR_OR_NULL(sta))) { rcu_read_unlock(); return PTR_ERR_OR_ZERO(sta); @@ -560,23 +546,42 @@ iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (sta->mfp && (peer->ftm.trigger_based || peer->ftm.non_trigger_based)) - FTM_PUT_FLAG(PMF); + FTM_SET_FLAG(PMF); break; } rcu_read_unlock(); #ifdef CONFIG_IWLWIFI_DEBUGFS if (mvmvif->ftm_unprotected) { - target->sta_id = IWL_MVM_INVALID_STA; - target->initiator_ap_flags &= - ~cpu_to_le32(IWL_INITIATOR_AP_FLAGS_PMF); + *sta_id = IWL_MVM_INVALID_STA; + *flags &= ~cpu_to_le32(IWL_INITIATOR_AP_FLAGS_PMF); } - #endif } else { - target->sta_id = IWL_MVM_INVALID_STA; + *sta_id = IWL_MVM_INVALID_STA; } + return 0; +} + +static int +iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct cfg80211_pmsr_request_peer *peer, + struct iwl_tof_range_req_ap_entry_v6 *target) +{ + int ret; + + ret = iwl_mvm_ftm_target_chandef_v2(mvm, peer, &target->channel_num, + &target->format_bw, + &target->ctrl_ch_position); + if (ret) + return ret; + + iwl_mvm_ftm_put_target_common(mvm, peer, target); + + iwl_mvm_ftm_set_sta(mvm, vif, peer, &target->sta_id, + &target->initiator_ap_flags); + /* * TODO: Beacon interval is currently unknown, so use the common value * of 100 TUs. From patchwork Mon May 27 16:06:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800937 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 AF59C73452 for ; Mon, 27 May 2024 16:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826000; cv=none; b=iHaVEjoImgB+fyeZfhNO8ClJcHjzby0AirebSFy8qjPQjhCYHVvagdONb1368QiOS+XpDVF5vlVF2ncXkysbwJpXNBnkK0VUgyNp2I/OnE815DS25at6N94qNTQQu6spt4D1vJwHX9daumE0HGUFXgN8x57xX2kplOUbCzdN+d4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826000; c=relaxed/simple; bh=vEUKNlzzJmbrrxSACtO66t3DOJ+wNTHog6bm7AT4qiA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YSHIQxJgXhwJWC/Hyyw/8nzzRoswoQ7um8EUWde8NxV9XViCiOJ9EWC9ubrMIt25/4y98j7KD2FOv2OWcT4NZE7FRIzTX2B07VFQeEwUT6kQLG2HJMdQD+LRl8t+H+jAc7Dfk9Pv0Rp98GOYrH7aroq0cCO/pYy4NE0vlFPCOrw= 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=RIWL2OHK; arc=none smtp.client-ip=198.175.65.19 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="RIWL2OHK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716825999; x=1748361999; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vEUKNlzzJmbrrxSACtO66t3DOJ+wNTHog6bm7AT4qiA=; b=RIWL2OHKqns5l9ZFdfUIZKhjT3LCzBDetvAyoHVdWOzlDtxsNt1ySNrB 2T9AyNvy9WOfdBxipcscJx5Z3CpMkyHdBHUu6rLXoNNi9jenpgnMcrJ2I ZpOo3/jJaaXb6q3ByvBvrxeC50At9vrE1kTh6pXHzpR9N7pntLwaFr6BH GwK7Kp8SssTIKuMSiV4Gjj//V3pvii2jWK0+Qz5muYsJ56w7U4102BOLe LwJfOyWbZf6flQFng7R30s2H6CHMP5ZbiXuCAc11UxcaiCJkBjMs5IaqQ cjqp8KT+gBWX16YgWtxJ15Sl67ikFppD8m+v139zU16PPE3wPxdt0gwx+ A==; X-CSE-ConnectionGUID: ib78Dt3UT0Gq1qWlxonnBA== X-CSE-MsgGUID: QAxkKfx8Qgy4e5bngVmVzQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002092" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002092" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:39 -0700 X-CSE-ConnectionGUID: Q7HD5+FcTvazZM92MGebQA== X-CSE-MsgGUID: N/FgTf9VSOOgFF5Vm0nk9g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407102" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:38 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern Subject: [PATCH 10/20] wifi: iwlwifi: mvm: modify iwl_mvm_ftm_set_secured_ranging() parameters Date: Mon, 27 May 2024 19:06:05 +0300 Message-Id: <20240527190228.56d6aee320b3.I5a52fa93cd791d0229b392a20f076b7cebb110cd@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avraham Stern Modify iwl_mvm_ftm_set_secured_ranging() parameters to support multiple versions of the target struct. This is done as preparation for moving to the new range request version. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit --- .../intel/iwlwifi/mvm/ftm-initiator.c | 54 ++++++++++++------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index 8596e6f7d1dc..f5bf99f7fc2e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -40,6 +40,12 @@ struct iwl_mvm_ftm_pasn_entry { u32 flags; }; +struct iwl_mvm_ftm_iter_data { + u8 *cipher; + u8 *bssid; + u8 *tk; +}; + int iwl_mvm_ftm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, u8 *addr, u32 cipher, u8 *tk, u32 tk_len, u8 *hltk, u32 hltk_len) @@ -719,7 +725,7 @@ static void iter(struct ieee80211_hw *hw, struct ieee80211_key_conf *key, void *data) { - struct iwl_tof_range_req_ap_entry_v6 *target = data; + struct iwl_mvm_ftm_iter_data *target = data; if (!sta || memcmp(sta->addr, target->bssid, ETH_ALEN)) return; @@ -730,16 +736,16 @@ static void iter(struct ieee80211_hw *hw, return; memcpy(target->tk, key->key, key->keylen); - target->cipher = iwl_mvm_cipher_to_location_cipher(key->cipher); - WARN_ON(target->cipher == IWL_LOCATION_CIPHER_INVALID); + *target->cipher = iwl_mvm_cipher_to_location_cipher(key->cipher); + WARN_ON(*target->cipher == IWL_LOCATION_CIPHER_INVALID); } static void iwl_mvm_ftm_set_secured_ranging(struct iwl_mvm *mvm, struct ieee80211_vif *vif, - struct iwl_tof_range_req_ap_entry_v7 *target) + u8 *bssid, u8 *cipher, u8 *hltk, u8 *tk, + u8 *rx_pn, u8 *tx_pn, __le32 *flags) { struct iwl_mvm_ftm_pasn_entry *entry; - u32 flags = le32_to_cpu(target->initiator_ap_flags); #ifdef CONFIG_IWLWIFI_DEBUGFS struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif); @@ -747,35 +753,39 @@ iwl_mvm_ftm_set_secured_ranging(struct iwl_mvm *mvm, struct ieee80211_vif *vif, return; #endif - if (!(flags & (IWL_INITIATOR_AP_FLAGS_NON_TB | + if (!(le32_to_cpu(*flags) & (IWL_INITIATOR_AP_FLAGS_NON_TB | IWL_INITIATOR_AP_FLAGS_TB))) return; lockdep_assert_held(&mvm->mutex); list_for_each_entry(entry, &mvm->ftm_initiator.pasn_list, list) { - if (memcmp(entry->addr, target->bssid, sizeof(entry->addr))) + if (memcmp(entry->addr, bssid, sizeof(entry->addr))) continue; - target->cipher = entry->cipher; + *cipher = entry->cipher; if (entry->flags & IWL_MVM_PASN_FLAG_HAS_HLTK) - memcpy(target->hltk, entry->hltk, sizeof(target->hltk)); + memcpy(hltk, entry->hltk, sizeof(entry->hltk)); else - memset(target->hltk, 0, sizeof(target->hltk)); + memset(hltk, 0, sizeof(entry->hltk)); if (vif->cfg.assoc && - !memcmp(vif->bss_conf.bssid, target->bssid, - sizeof(target->bssid))) - ieee80211_iter_keys(mvm->hw, vif, iter, target); - else - memcpy(target->tk, entry->tk, sizeof(target->tk)); + !memcmp(vif->bss_conf.bssid, bssid, ETH_ALEN)) { + struct iwl_mvm_ftm_iter_data target; + + target.cipher = cipher; + target.bssid = bssid; + target.tk = tk; + ieee80211_iter_keys(mvm->hw, vif, iter, &target); + } else { + memcpy(tk, entry->tk, sizeof(entry->tk)); + } - memcpy(target->rx_pn, entry->rx_pn, sizeof(target->rx_pn)); - memcpy(target->tx_pn, entry->tx_pn, sizeof(target->tx_pn)); + memcpy(rx_pn, entry->rx_pn, sizeof(entry->rx_pn)); + memcpy(tx_pn, entry->tx_pn, sizeof(entry->tx_pn)); - target->initiator_ap_flags |= - cpu_to_le32(IWL_INITIATOR_AP_FLAGS_SECURED); + FTM_SET_FLAG(SECURED); return; } } @@ -789,7 +799,11 @@ iwl_mvm_ftm_put_target_v7(struct iwl_mvm *mvm, struct ieee80211_vif *vif, if (err) return err; - iwl_mvm_ftm_set_secured_ranging(mvm, vif, target); + iwl_mvm_ftm_set_secured_ranging(mvm, vif, target->bssid, + &target->cipher, target->hltk, + target->tk, target->rx_pn, + target->tx_pn, + &target->initiator_ap_flags); return err; } From patchwork Mon May 27 16:06:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799436 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 9CC2A167296 for ; Mon, 27 May 2024 16:06:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826002; cv=none; b=Ji/AiMHo4xXRoHrve/vPCoGrR6ZBRoZNfEBTkgSGa0k8iesIbq8LrPCWboZIPS/pwnTUK4CHlav3BjY4tls7eF43a1Nt3RRvya0AjpFCRnyMXJfQORF6O/y5L7qW4naSaM7W4BtYYhqpXbPvjiTTLy4ZDR7IpMFNv4XNwAU+e30= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826002; c=relaxed/simple; bh=WL1DrIQoBUh6de9N0Vu8vh48wnvTvfbiLfiD/I+JmQM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YQelCjZNpCVGpd5LbF2vlQCFY73WbGhfGtlA6fNFSEa+gie5qVW3vwdW41KVe7/pzWMwIn2jq8qVO+ziPxNGOogMtZldYyzjL0SP8Zsn5Dnqe5pN9MNomsaUbbkKf3jx2QK8vCjySIFf+mYh0arvXOxhP20mBMwOpNA0XgFY+qc= 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=gFl395fV; arc=none smtp.client-ip=198.175.65.19 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="gFl395fV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826001; x=1748362001; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WL1DrIQoBUh6de9N0Vu8vh48wnvTvfbiLfiD/I+JmQM=; b=gFl395fVLShOKkJNPjzWwSyi20HTrn2XcAA03QdnkUn41BksSs9ccR1k pNU3ODDMPR3i8Tes40BA+j8zQNHwLl2376uhq2Z0RJiWDDLbMi0/K1B7O j0nqOLLaG1UTD+jgHJiuMq/DdwyADgNayiINu0oUym/k331mEvUy+ehMb vLtD5EttVklDRdeQzUF9vHV64wskGgoYeNMMYmT5lVtbucj32hfITP+h0 xVveaBQEWRRqIb71lutO9MAKdLej4AO6bZOQz6RAkRk5kRmaBdHJi8Pj8 J0NC9nKFCL5yrAspdsOppE5nJyJZ6dfC13CVBj3KHV5ZqeKJ5LNcFxAC3 w==; X-CSE-ConnectionGUID: 8hiRJdgsSrGnza+J+9M5ug== X-CSE-MsgGUID: VMXom1ozRVyQTn1z/xxI2Q== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002095" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002095" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:41 -0700 X-CSE-ConnectionGUID: RfxGdjuLSDmJ28zPLJ1xmQ== X-CSE-MsgGUID: IluU42qjSmaDWRokWK6FrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407109" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:39 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern Subject: [PATCH 11/20] wifi: iwlwifi: mvm: add support for version 14 of the range request command Date: Mon, 27 May 2024 19:06:06 +0300 Message-Id: <20240527190228.8f36ccb1cc74.I9b76461634f308e75dc3cd016d0b0bce812c6e9d@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avraham Stern This version adds a testing option to send an incorrect SAC in the first NDPA. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/fw/api/location.h | 105 ++++++++++++++++++ .../wireless/intel/iwlwifi/mvm/constants.h | 1 + .../intel/iwlwifi/mvm/ftm-initiator.c | 102 +++++++++++++++++ 3 files changed, 208 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h index 25530a29317e..c20bb289a623 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h @@ -2,6 +2,7 @@ /* * Copyright (C) 2015-2017 Intel Deutschland GmbH * Copyright (C) 2018-2022 Intel Corporation + * Copyright (C) 2024 Intel Corporation */ #ifndef __iwl_fw_api_location_h__ #define __iwl_fw_api_location_h__ @@ -561,6 +562,8 @@ struct iwl_tof_range_req_ap_entry_v2 { * the responder asked for LMR feedback although the initiator did not set * the LMR feedback bit in the FTM request. If not set, the initiator will * continue with the session and will provide the LMR feedback. + * @IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC: send an incorrect SAC in the + * first NDP exchange. This is used for testing. */ enum iwl_initiator_ap_flags { IWL_INITIATOR_AP_FLAGS_ASAP = BIT(1), @@ -577,6 +580,7 @@ enum iwl_initiator_ap_flags { IWL_INITIATOR_AP_FLAGS_USE_CALIB = BIT(13), IWL_INITIATOR_AP_FLAGS_PMF = BIT(14), IWL_INITIATOR_AP_FLAGS_TERMINATE_ON_LMR_FEEDBACK = BIT(15), + IWL_INITIATOR_AP_FLAGS_TEST_INCORRECT_SAC = BIT(16), }; /** @@ -797,6 +801,7 @@ struct iwl_tof_range_req_ap_entry_v7 { } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_7 */ #define IWL_LOCATION_MAX_STS_POS 3 +#define IWL_LOCATION_TOTAL_LTF_POS 6 /** * struct iwl_tof_range_req_ap_entry_v8 - AP configuration parameters @@ -953,6 +958,78 @@ struct iwl_tof_range_req_ap_entry_v9 { __le16 min_time_between_msr; } __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */ +/** + * struct iwl_tof_range_req_ap_entry_v10 - AP configuration parameters + * @initiator_ap_flags: see &enum iwl_initiator_ap_flags. + * @band: 0 for 5.2 GHz, 1 for 2.4 GHz, 2 for 6GHz + * @channel_num: AP Channel number + * @format_bw: bits 0 - 3: &enum iwl_location_frame_format. + * bits 4 - 7: &enum iwl_location_bw. + * @ctrl_ch_position: Coding of the control channel position relative to the + * center frequency, see iwl_mvm_get_ctrl_pos(). + * @bssid: AP's BSSID + * @burst_period: For EDCA based ranging: Recommended value to be sent to the + * AP. Measurement periodicity In units of 100ms. ignored if + * num_of_bursts_exp = 0. + * For non trigger based NDP ranging, the maximum time between + * measurements in units of milliseconds. + * @samples_per_burst: the number of FTMs pairs in single Burst (1-31); + * @num_of_bursts: Recommended value to be sent to the AP. 2s Exponent of + * the number of measurement iterations (min 2^0 = 1, max 2^14) + * @sta_id: the station id of the AP. Only relevant when associated to the AP, + * otherwise should be set to &IWL_MVM_INVALID_STA. + * @cipher: pairwise cipher suite for secured measurement. + * &enum iwl_location_cipher. + * @hltk: HLTK to be used for secured 11az measurement + * @tk: TK to be used for secured 11az measurement + * @calib: An array of calibration values per FTM rx bandwidth. + * If &IWL_INITIATOR_AP_FLAGS_USE_CALIB is set, the fw will use the + * calibration value that corresponds to the rx bandwidth of the FTM + * frame. + * @beacon_interval: beacon interval of the AP in TUs. Only required if + * &IWL_INITIATOR_AP_FLAGS_TB is set. + * @rx_pn: the next expected PN for protected management frames Rx. LE byte + * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id + * is set to &IWL_MVM_INVALID_STA. + * @tx_pn: the next PN to use for protected management frames Tx. LE byte + * order. Only valid if &IWL_INITIATOR_AP_FLAGS_SECURED is set and sta_id + * is set to &IWL_MVM_INVALID_STA. + * @r2i_ndp_params: parameters for R2I NDP ranging negotiation. + * bits 0 - 2: max LTF repetitions + * bits 3 - 5: max number of spatial streams + * bits 6 - 7: max total LTFs. One of + * &enum ieee80211_range_params_max_total_ltf. + * @i2r_ndp_params: parameters for I2R NDP ranging negotiation. + * bits 0 - 2: max LTF repetitions + * bits 3 - 5: max number of spatial streams (supported values are < 2) + * bits 6 - 7: max total LTFs. One of + * &enum ieee80211_range_params_max_total_ltf. + * @min_time_between_msr: For non trigger based NDP ranging, the minimum time + * between measurements in units of milliseconds + */ +struct iwl_tof_range_req_ap_entry_v10 { + __le32 initiator_ap_flags; + u8 band; + u8 channel_num; + u8 format_bw; + u8 ctrl_ch_position; + u8 bssid[ETH_ALEN]; + __le16 burst_period; + u8 samples_per_burst; + u8 num_of_bursts; + u8 sta_id; + u8 cipher; + u8 hltk[HLTK_11AZ_LEN]; + u8 tk[TK_11AZ_LEN]; + __le16 calib[IWL_TOF_BW_NUM]; + __le16 beacon_interval; + u8 rx_pn[IEEE80211_CCMP_PN_LEN]; + u8 tx_pn[IEEE80211_CCMP_PN_LEN]; + u8 r2i_ndp_params; + u8 i2r_ndp_params; + __le16 min_time_between_msr; +} __packed; /* LOCATION_RANGE_REQ_AP_ENTRY_CMD_API_S_VER_9 */ + /** * enum iwl_tof_response_mode * @IWL_MVM_TOF_RESPONSE_ASAP: report each AP measurement separately as soon as @@ -1230,6 +1307,34 @@ struct iwl_tof_range_req_cmd_v13 { struct iwl_tof_range_req_ap_entry_v9 ap[IWL_MVM_TOF_MAX_APS]; } __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_13 */ +/** + * struct iwl_tof_range_req_cmd_v14 - start measurement cmd + * @initiator_flags: see flags @ iwl_tof_initiator_flags + * @request_id: A Token incremented per request. The same Token will be + * sent back in the range response + * @num_of_ap: Number of APs to measure (error if > IWL_MVM_TOF_MAX_APS) + * @range_req_bssid: ranging request BSSID + * @macaddr_mask: Bits set to 0 shall be copied from the MAC address template. + * Bits set to 1 shall be randomized by the UMAC + * @macaddr_template: MAC address template to use for non-randomized bits + * @req_timeout_ms: Requested timeout of the response in units of milliseconds. + * This is the session time for completing the measurement. + * @tsf_mac_id: report the measurement start time for each ap in terms of the + * TSF of this mac id. 0xff to disable TSF reporting. + * @ap: per-AP request data, see &struct iwl_tof_range_req_ap_entry_v10. + */ +struct iwl_tof_range_req_cmd_v14 { + __le32 initiator_flags; + u8 request_id; + u8 num_of_ap; + u8 range_req_bssid[ETH_ALEN]; + u8 macaddr_mask[ETH_ALEN]; + u8 macaddr_template[ETH_ALEN]; + __le32 req_timeout_ms; + __le32 tsf_mac_id; + struct iwl_tof_range_req_ap_entry_v10 ap[IWL_MVM_TOF_MAX_APS]; +} __packed; /* LOCATION_RANGE_REQ_CMD_API_S_VER_13 */ + /* * enum iwl_tof_range_request_status - status of the sent request * @IWL_TOF_RANGE_REQUEST_STATUS_SUCCESSFUL - FW successfully received the diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h index d840653cc907..1abe9e9fd46b 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/constants.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/constants.h @@ -100,6 +100,7 @@ #define IWL_MVM_FTM_INITIATOR_ALGO IWL_TOF_ALGO_TYPE_MAX_LIKE #define IWL_MVM_FTM_INITIATOR_DYNACK true #define IWL_MVM_FTM_LMR_FEEDBACK_TERMINATE false +#define IWL_MVM_FTM_TEST_INCORRECT_SAC false #define IWL_MVM_FTM_R2I_MAX_REP 7 #define IWL_MVM_FTM_I2R_MAX_REP 7 #define IWL_MVM_FTM_R2I_MAX_STS 1 diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c index f5bf99f7fc2e..00d447e40cc6 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c @@ -950,6 +950,105 @@ static int iwl_mvm_ftm_start_v13(struct iwl_mvm *mvm, return iwl_mvm_ftm_send_cmd(mvm, &hcmd); } +static int +iwl_mvm_ftm_put_target_v10(struct iwl_mvm *mvm, struct ieee80211_vif *vif, + struct cfg80211_pmsr_request_peer *peer, + struct iwl_tof_range_req_ap_entry_v10 *target) +{ + u32 i2r_max_sts, flags; + int ret; + + ret = iwl_mvm_ftm_target_chandef_v2(mvm, peer, &target->channel_num, + &target->format_bw, + &target->ctrl_ch_position); + if (ret) + return ret; + + memcpy(target->bssid, peer->addr, ETH_ALEN); + target->burst_period = + cpu_to_le16(peer->ftm.burst_period); + target->samples_per_burst = peer->ftm.ftms_per_burst; + target->num_of_bursts = peer->ftm.num_bursts_exp; + iwl_mvm_ftm_set_target_flags(mvm, peer, &target->initiator_ap_flags); + iwl_mvm_ftm_set_sta(mvm, vif, peer, &target->sta_id, + &target->initiator_ap_flags); + iwl_mvm_ftm_set_secured_ranging(mvm, vif, target->bssid, + &target->cipher, target->hltk, + target->tk, target->rx_pn, + target->tx_pn, + &target->initiator_ap_flags); + + i2r_max_sts = IWL_MVM_FTM_I2R_MAX_STS > 1 ? 1 : + IWL_MVM_FTM_I2R_MAX_STS; + + target->r2i_ndp_params = IWL_MVM_FTM_R2I_MAX_REP | + (IWL_MVM_FTM_R2I_MAX_STS << IWL_LOCATION_MAX_STS_POS) | + (IWL_MVM_FTM_R2I_MAX_TOTAL_LTF << IWL_LOCATION_TOTAL_LTF_POS); + target->i2r_ndp_params = IWL_MVM_FTM_I2R_MAX_REP | + (i2r_max_sts << IWL_LOCATION_MAX_STS_POS) | + (IWL_MVM_FTM_I2R_MAX_TOTAL_LTF << IWL_LOCATION_TOTAL_LTF_POS); + + if (peer->ftm.non_trigger_based) { + target->min_time_between_msr = + cpu_to_le16(IWL_MVM_FTM_NON_TB_MIN_TIME_BETWEEN_MSR); + target->burst_period = + cpu_to_le16(IWL_MVM_FTM_NON_TB_MAX_TIME_BETWEEN_MSR); + } else { + target->min_time_between_msr = cpu_to_le16(0); + } + + target->band = + iwl_mvm_phy_band_from_nl80211(peer->chandef.chan->band); + + /* + * TODO: Beacon interval is currently unknown, so use the common value + * of 100 TUs. + */ + target->beacon_interval = cpu_to_le16(100); + + /* + * If secure LTF is turned off, replace the flag with PMF only + */ + flags = le32_to_cpu(target->initiator_ap_flags); + if (flags & IWL_INITIATOR_AP_FLAGS_SECURED) { + if (!IWL_MVM_FTM_INITIATOR_SECURE_LTF) + flags &= ~IWL_INITIATOR_AP_FLAGS_SECURED; + + flags |= IWL_INITIATOR_AP_FLAGS_PMF; + target->initiator_ap_flags = cpu_to_le32(flags); + } + + return 0; +} + +static int iwl_mvm_ftm_start_v14(struct iwl_mvm *mvm, + struct ieee80211_vif *vif, + struct cfg80211_pmsr_request *req) +{ + struct iwl_tof_range_req_cmd_v14 cmd; + struct iwl_host_cmd hcmd = { + .id = WIDE_ID(LOCATION_GROUP, TOF_RANGE_REQ_CMD), + .dataflags[0] = IWL_HCMD_DFL_DUP, + .data[0] = &cmd, + .len[0] = sizeof(cmd), + }; + u8 i; + int err; + + iwl_mvm_ftm_cmd_common(mvm, vif, (void *)&cmd, req); + + for (i = 0; i < cmd.num_of_ap; i++) { + struct cfg80211_pmsr_request_peer *peer = &req->peers[i]; + struct iwl_tof_range_req_ap_entry_v10 *target = &cmd.ap[i]; + + err = iwl_mvm_ftm_put_target_v10(mvm, vif, peer, target); + if (err) + return err; + } + + return iwl_mvm_ftm_send_cmd(mvm, &hcmd); +} + int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, struct cfg80211_pmsr_request *req) { @@ -968,6 +1067,9 @@ int iwl_mvm_ftm_start(struct iwl_mvm *mvm, struct ieee80211_vif *vif, IWL_FW_CMD_VER_UNKNOWN); switch (cmd_ver) { + case 14: + err = iwl_mvm_ftm_start_v14(mvm, vif, req); + break; case 13: err = iwl_mvm_ftm_start_v13(mvm, vif, req); break; From patchwork Mon May 27 16:06:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800936 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 0C57A15F30F for ; Mon, 27 May 2024 16:06:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826003; cv=none; b=pOOlmY2GKr2YxUJlkfQKR5zOpfrlWJPc+lNM5UH5CfpPGKi8g2Sb5xL5gJtP44cVodnEzdEi6qE+SaHvB257m3txepZFDz4Yjz+g3FB6sAao3S/f4ikHiiHEOI+PXZfpFWuc5O7udsubFVp01cz47jpm2N+gUyEGdRuYGgENNAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826003; c=relaxed/simple; bh=7PCte07guXq7+2spuBHPimIrI1hxFGWu0Nna3yGo7z4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cqV7I+e6x3b0RMcZtyFBitrsH50Om4GnK7B7a+NoR829AGIVumtnNj4FJWs0+SiAv2UBzGWICzEF8YL6t2J1sbdQL6p2prIH7svqdnpovpOzAlgiEDxJL4CqZcZdAOWnxrr/Gyy6X3g6labkEs9J4v5VSGQfjoFkmHluuS+MS/Y= 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=V3Ve53sq; arc=none smtp.client-ip=198.175.65.19 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="V3Ve53sq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826002; x=1748362002; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7PCte07guXq7+2spuBHPimIrI1hxFGWu0Nna3yGo7z4=; b=V3Ve53sq8qByCkPC0gxqFAZi2Mukcm2GcL9Ktb9y+jmkkxmftmVN1Y5M YaN0EnhsX1EwTEWFhLKrOBuT3VFImir1Au3TDMf8lqxt6FHVjML8KjGBN tcqAVCFW4+2i7GHeGffJmOMnT75k0MaH5FGRxp/TvwMyiblOnL2Xs9feJ R61MwJ/WgV3O1i17w0fH2gtd2t1G22uyNZ+Ab+QtdxxO4rheogVE0xyBg G9Bq/jToavK2esAx06pOwIe1pib5XsXbbhRjR0/eElT4+QH4ovjPeVNI/ auhpLeL0bM9cVbea+3aHbA3pSvf/K35j4FFS98GEXnRfTtiTS3xQNhBWS w==; X-CSE-ConnectionGUID: YEsmGOaQQ1G5itI7w83i6A== X-CSE-MsgGUID: ufbs+aUmR1Ce4KsmPAeXPA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002098" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002098" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:42 -0700 X-CSE-ConnectionGUID: 2xgj8iN4R1CF5+TO/B+MOg== X-CSE-MsgGUID: PLUlTswxTSGGJTVNSXJrZg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407113" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:41 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Avraham Stern Subject: [PATCH 12/20] wifi: iwlwifi: mvm: add support for version 10 of the responder config command Date: Mon, 27 May 2024 19:06:07 +0300 Message-Id: <20240527190228.af09129ebd74.I9356e2504a4c19961d4856494416ae49b36bfe62@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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: Avraham Stern This version adds the band to the responder config command. Signed-off-by: Avraham Stern Signed-off-by: Miri Korenblit --- .../wireless/intel/iwlwifi/fw/api/location.h | 52 +++++++++++++++++++ .../intel/iwlwifi/mvm/ftm-responder.c | 15 ++++-- 2 files changed, 62 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h index c20bb289a623..7c158a8dfed0 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/api/location.h +++ b/drivers/net/wireless/intel/iwlwifi/fw/api/location.h @@ -391,6 +391,58 @@ struct iwl_tof_responder_config_cmd_v9 { __le16 max_time_between_msr; } __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_8 */ +/** + * struct iwl_tof_responder_config_cmd - ToF AP mode + * @cmd_valid_fields: &iwl_tof_responder_cmd_valid_field + * @responder_cfg_flags: &iwl_tof_responder_cfg_flags + * @format_bw: bits 0 - 3: &enum iwl_location_frame_format. + * bits 4 - 7: &enum iwl_location_bw. + * @bss_color: current AP bss_color + * @channel_num: current AP Channel + * @ctrl_ch_position: coding of the control channel position relative to + * the center frequency, see iwl_mvm_get_ctrl_pos() + * @sta_id: index of the AP STA when in AP mode + * @band: current AP band + * @toa_offset: Artificial addition [pSec] for the ToA - to be used for debug + * purposes, simulating station movement by adding various values + * to this field + * @common_calib: XVT: common calibration value + * @specific_calib: XVT: specific calibration value + * @bssid: Current AP BSSID + * @r2i_ndp_params: parameters for R2I NDP. + * bits 0 - 2: max number of LTF repetitions + * bits 3 - 5: max number of spatial streams (supported values are < 2) + * bits 6 - 7: max number of total LTFs see + * &enum ieee80211_range_params_max_total_ltf + * @i2r_ndp_params: parameters for I2R NDP. + * bits 0 - 2: max number of LTF repetitions + * bits 3 - 5: max number of spatial streams + * bits 6 - 7: max number of total LTFs see + * &enum ieee80211_range_params_max_total_ltf + * @min_time_between_msr: for non trigger based NDP ranging, minimum time + * between measurements in milliseconds. + * @max_time_between_msr: for non trigger based NDP ranging, maximum time + * between measurements in milliseconds. + */ +struct iwl_tof_responder_config_cmd { + __le32 cmd_valid_fields; + __le32 responder_cfg_flags; + u8 format_bw; + u8 bss_color; + u8 channel_num; + u8 ctrl_ch_position; + u8 sta_id; + u8 band; + __le16 toa_offset; + __le16 common_calib; + __le16 specific_calib; + u8 bssid[ETH_ALEN]; + u8 r2i_ndp_params; + u8 i2r_ndp_params; + __le16 min_time_between_msr; + __le16 max_time_between_msr; +} __packed; /* TOF_RESPONDER_CONFIG_CMD_API_S_VER_10 */ + #define IWL_LCI_CIVIC_IE_MAX_SIZE 400 /** diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c index 8e760300a1ab..e4caa362f597 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Copyright (C) 2015-2017 Intel Deutschland GmbH - * Copyright (C) 2018-2023 Intel Corporation + * Copyright (C) 2018-2024 Intel Corporation */ #include #include @@ -88,7 +88,7 @@ static int iwl_mvm_ftm_responder_set_bw_v2(struct cfg80211_chan_def *chandef, static void iwl_mvm_ftm_responder_set_ndp(struct iwl_mvm *mvm, - struct iwl_tof_responder_config_cmd_v9 *cmd) + struct iwl_tof_responder_config_cmd *cmd) { /* Up to 2 R2I STS are allowed on the responder */ u32 r2i_max_sts = IWL_MVM_FTM_R2I_MAX_STS < 2 ? @@ -117,7 +117,7 @@ iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm, * field interpretation is different), so the same struct can be use * for all cases. */ - struct iwl_tof_responder_config_cmd_v9 cmd = { + struct iwl_tof_responder_config_cmd cmd = { .channel_num = chandef->chan->hw_value, .cmd_valid_fields = cpu_to_le32(IWL_TOF_RESPONDER_CMD_VALID_CHAN_INFO | @@ -131,8 +131,13 @@ iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm, lockdep_assert_held(&mvm->mutex); + if (cmd_ver == 10) { + cmd.band = + iwl_mvm_phy_band_from_nl80211(chandef->chan->band); + } + /* Use a default of bss_color=1 for now */ - if (cmd_ver == 9) { + if (cmd_ver >= 9) { cmd.cmd_valid_fields |= cpu_to_le32(IWL_TOF_RESPONDER_CMD_VALID_BSS_COLOR | IWL_TOF_RESPONDER_CMD_VALID_MIN_MAX_TIME_BETWEEN_MSR); @@ -148,7 +153,7 @@ iwl_mvm_ftm_responder_cmd(struct iwl_mvm *mvm, } if (cmd_ver >= 8) - iwl_mvm_ftm_responder_set_ndp(mvm, &cmd); + iwl_mvm_ftm_responder_set_ndp(mvm, (void *)&cmd); if (cmd_ver >= 7) err = iwl_mvm_ftm_responder_set_bw_v2(chandef, &cmd.format_bw, From patchwork Mon May 27 16:06:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799435 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 1C051169393 for ; Mon, 27 May 2024 16:06:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826004; cv=none; b=geNhdr8JIPyl3guZyB2BMCBYlnAl+si3buOQLIrulOi0jJHrPZP7ic7fbqF9P6Sd2yPwWkT4jfRdWuQqTjZiXxft1QON8D4+gnvogToFcAlylUagKOkubZo6jZI7oAPI4sQ7jku9Z/mxr4OKlQd/IfFA/Kj7gHWoKISqy7MRlMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826004; c=relaxed/simple; bh=EOEOq0/iGJoklaiFsdqU39Tz2VxPfldFvYzX4db6yNo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VkqOtWRGCC6oSznI178NiEAmuClqTlCD/JoXdbsk0nA0O8WfVd18NtBJYjKyXe4BMC0ifOnlekAvfBpfGoDKYLz8tL3cuBIifwkac7V/CTTzHO355UDsMFix6wiMPyNrK41Rx4oO5tyE8NYuatQ/SnqOFAh6EyEcJEr9ZCwkYgQ= 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=WvFKXy6B; arc=none smtp.client-ip=198.175.65.19 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="WvFKXy6B" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826003; x=1748362003; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EOEOq0/iGJoklaiFsdqU39Tz2VxPfldFvYzX4db6yNo=; b=WvFKXy6B2Jys352+9xR9seKPj/jfxpue9CQxpQr/DpQFAtxOIJU8UgSb NrjIrX/V8vIE/wtmYXfWNTKGPBleJyiBHetESHoaywcpL99T6pAMsvKRS 9VxckbyHHgnKizOg/1PnVbE6Sdt9gQgj+mZJ9A8EI326nAAZrLTWcZW46 xaaXiXG7/3IvgEDkEGpAqKfx65lqa0d1z0pAhT6P5M0laQeq5UFi1BECl X0sgG1Fq31qOTm+7hYhdaQoEkWx3Kvy+NfZmdkmQi7eo8US7FjDXM/s63 nAqphYGEaQfTZyvm9r4piVjoiIWMp8Eiwbrku+CgNjUN6sQQVbY6Yr1Gz g==; X-CSE-ConnectionGUID: gbljEAlaRn2WvTdiJCXmdg== X-CSE-MsgGUID: gey9k+WJSsyMaEybtxKatA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002101" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002101" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:43 -0700 X-CSE-ConnectionGUID: ueQ7FoudQD+uo9uKJoT+CA== X-CSE-MsgGUID: WceVv1c2TzCpR3fAL6+Wkw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407117" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:42 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 13/20] wifi: iwlwifi: mvm: use only beacon BSS load for active links Date: Mon, 27 May 2024 19:06:08 +0300 Message-Id: <20240527190228.6947dc462fa9.I2076961211d6785c8a15b4308e0e87a413148222@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 For active links, don't take information that may have been received in probe responses, as those are not protected. For inactive links, there may not be a choice. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/link.c | 14 ++++++++++++-- .../net/wireless/intel/iwlwifi/mvm/tests/links.c | 1 + 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c index 0745229c8c37..02a475a1f1b8 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c @@ -492,17 +492,27 @@ iwl_mvm_get_puncturing_factor(const struct ieee80211_bss_conf *link_conf) static unsigned int iwl_mvm_get_chan_load(struct ieee80211_bss_conf *link_conf) { + struct ieee80211_vif *vif = link_conf->vif; struct iwl_mvm_vif_link_info *mvm_link = iwl_mvm_vif_from_mac80211(link_conf->vif)->link[link_conf->link_id]; const struct element *bss_load_elem; const struct ieee80211_bss_load_elem *bss_load; enum nl80211_band band = link_conf->chanreq.oper.chan->band; + const struct cfg80211_bss_ies *ies; unsigned int chan_load; u32 chan_load_by_us; rcu_read_lock(); - bss_load_elem = ieee80211_bss_get_elem(link_conf->bss, - WLAN_EID_QBSS_LOAD); + if (ieee80211_vif_link_active(vif, link_conf->link_id)) + ies = rcu_dereference(link_conf->bss->beacon_ies); + else + ies = rcu_dereference(link_conf->bss->ies); + + if (ies) + bss_load_elem = cfg80211_find_elem(WLAN_EID_QBSS_LOAD, + ies->data, ies->len); + else + bss_load_elem = NULL; /* If there isn't BSS Load element, take the defaults */ if (!bss_load_elem || diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c b/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c index 6a680b5d03e0..47b8e7b64ead 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/tests/links.c @@ -208,6 +208,7 @@ static void setup_link_conf(struct kunit *test) bss_load->channel_util = params->channel_util; rcu_assign_pointer(bss.ies, ies); + rcu_assign_pointer(bss.beacon_ies, ies); } static void test_link_grading(struct kunit *test) From patchwork Mon May 27 16:06:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800935 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 4CC8D16A378 for ; Mon, 27 May 2024 16:06:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826005; cv=none; b=aSdNpDLOITkTDgkx+snAcQJCRryUj48UOUK+5/BHDY9EEkPOgu1BzDvHNfD5jN8ZtLogKjThgSVinwH+7jcd/7YP/KwjmOuQPjwWff8wK/tFaWpn+Dg4typ7tfuSLKQVdaKqhqCXvK43Blrd6ROAgSDNBzdsPS6tO5jWsAC5IwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826005; c=relaxed/simple; bh=rduEwfeldFbQSu+DyFXro32lUWD4fBdfFwjuxNDKnUU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Tlmsx+pIRzYs4nmxer9Mk0SKOBBnxldpYKSbXM4xHFOBtuuFkNY5JiCWkIyF5WZjukZM4lzlyHILMflml38EqNZoG5ckUYBzrYY2ipAx1+W0TwhhQLlgYpSJuxhYX042skl1m+niZXaEwLvEimfygr6RBtgEoojcQ3XTZPxJSRY= 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=JaRT1G+I; arc=none smtp.client-ip=198.175.65.19 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="JaRT1G+I" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826005; x=1748362005; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rduEwfeldFbQSu+DyFXro32lUWD4fBdfFwjuxNDKnUU=; b=JaRT1G+I0tTlMaiRQ4uoX3ULx27t0GfCatgjdt81km22b49bRQM9u7Gg 9OD4WRLLBj//20Fm7vVzPF0oQFt2qMFku7e18xYUwD2GSa4V1cx1VNYhA 6guTtVcWGeFTIFtC0o1g2MBMW+H3Et86voah2gIfZrl4ZpUv/YTCZgtsO 2upDUjnSrGxNof1/8m9YsAcjbi8p/UWw17B3nMvndARLhLrcHvwdMl1Lu Q9YnVtcAPKQoV27fhbJrsWuc5IQFkbJZRasGIGpJRCo22enyxWvt1CUnZ qrO1afI+TJyDsc/FtUZUJAtma+DnKAlRQVLAKPVGUcBk1Vs7jIZFRkFre Q==; X-CSE-ConnectionGUID: xuN0Yj5xQEiGL0eAtSVRyw== X-CSE-MsgGUID: eAlJL3pwQ6+uPcmn4i3zyQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002105" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002105" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:45 -0700 X-CSE-ConnectionGUID: KAEBlLyOQ72j699a3LlBnw== X-CSE-MsgGUID: oUFjJ7hISUenVBRqPl3xwA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407120" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:44 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 14/20] wifi: iwlwifi: mvm: add debug data for MPDU counting Date: Mon, 27 May 2024 19:06:09 +0300 Message-Id: <20240527190228.77ef3c2654dc.I1796a3995da2a49dd5102d33766af1ad416dd60b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 It is hard to debug issues of EMLSR entry/exit due to low throughput. Add debug data. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c | 2 ++ drivers/net/wireless/intel/iwlwifi/mvm/rx.c | 3 +++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c index b2b6dbdcc44f..ebf313e161f4 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c @@ -222,6 +222,8 @@ static void iwl_mvm_restart_mpdu_count(struct iwl_mvm *mvm, mvmsta->mpdu_counters[q].window_start = jiffies; spin_unlock_bh(&mvmsta->mpdu_counters[q].lock); } + + IWL_DEBUG_STATS(mvm, "MPDU counters are cleared\n"); } static int iwl_mvm_esr_mode_active(struct iwl_mvm *mvm, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c index 4fa8066a89b6..b7185ddcca87 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rx.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rx.c @@ -1010,6 +1010,9 @@ static void iwl_mvm_update_esr_mode_tpt(struct iwl_mvm *mvm) spin_unlock_bh(&mvmsta->mpdu_counters[q].lock); } + IWL_DEBUG_STATS(mvm, "total Tx MPDUs: %ld. total Rx MPDUs: %ld\n", + total_tx, total_rx); + /* If we don't have enough MPDUs - exit EMLSR */ if (total_tx < IWL_MVM_ENTER_ESR_TPT_THRESH && total_rx < IWL_MVM_ENTER_ESR_TPT_THRESH) { diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index cc79fe991c26..2a8ad718ce78 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -4433,6 +4433,7 @@ void iwl_mvm_count_mpdu(struct iwl_mvm_sta *mvm_sta, u8 fw_sta_id, u32 count, bool tx, int queue) { struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(mvm_sta->vif); + struct iwl_mvm *mvm = mvmvif->mvm; struct iwl_mvm_tpt_counter *queue_counter; struct iwl_mvm_mpdu_counter *link_counter; u32 total_mpdus = 0; @@ -4469,6 +4470,8 @@ void iwl_mvm_count_mpdu(struct iwl_mvm_sta *mvm_sta, u8 fw_sta_id, u32 count, memset(queue_counter->per_link, 0, sizeof(queue_counter->per_link)); queue_counter->window_start = jiffies; + + IWL_DEBUG_STATS(mvm, "MPDU counters are cleared\n"); } for (int i = 0; i < IWL_MVM_FW_MAX_LINK_ID; i++) From patchwork Mon May 27 16:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799434 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 54B2216A387 for ; Mon, 27 May 2024 16:06:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826007; cv=none; b=sU8uYoNQn3q4rubdXLKZj4AGlGvNwEAFdh+Qk+sCWKN/hgBrSoKtpG1hTd8oB2mpq0yIcCWN+S4A0sy/M9GhW57nkJebqGu/Y7Cvi6bgKqy4+8ks1g0bXVRKhqQ2oQKraQlSXE29kr0lSvP+u43aatsA/sywvukoBDoV8GhfVcw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826007; c=relaxed/simple; bh=6PlQHpmLhVTDr2w6PgBCI+VbOS76xIY47fqcHkDY5+I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pTFc+Cfo5klhm0QLXqTZD3qednu1rq9id1ZVvRx/sQDSbbcXsWxaOZRb95ghJEe7eWQ5xahI+OUmfHpvoycRakKDhZ0io52KH3Q/sIcXuYBLkO9/v2+PuTbe7uHgQJeUMkvabqKIe1qBiyRaIiwJXsRSoG2LdwwJ/d1W0iA1+7E= 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=NCPJwurf; arc=none smtp.client-ip=198.175.65.19 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="NCPJwurf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826007; x=1748362007; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6PlQHpmLhVTDr2w6PgBCI+VbOS76xIY47fqcHkDY5+I=; b=NCPJwurfGXwLdNF8aFmECT8ECQru+TnuKn/UKirled2yvnVek4zAMzJm 4SewWeFpKRQUF8suKBlqQSOMLNpsr7Ze+YjzwkZ+YqsbtdSCeP6mBIUri 6bbDKz5n1nVwYSqJD6Ii0PTCyEawxn/T5K1YqBnKY2UYfM1kfqidGifqS gX7sRsVkulr8rEm0ft4VE6aCyfKMPvf8zI6DIsOulD/3vKeR+YO+2dV3k c2ZfEu7J1bpW0nhiKDN6eD0oz611jKjMyS9NS6E9z0Um5DYRqF5cDOJ++ kS+QXYoy9qH5BpEbX00VhflSIlE4OvGDvtM+Bol0HfR4zYwBTJJQ2bF1d Q==; X-CSE-ConnectionGUID: TSDsabagRGGNVnq4G3FkNQ== X-CSE-MsgGUID: 09z4feUMQViBarDouxjxuQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002110" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002110" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:46 -0700 X-CSE-ConnectionGUID: 9e0J9YlTQ12Kxhz3na6Bgg== X-CSE-MsgGUID: IJil7A2cRGm3vmbMfLgnVQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407124" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:45 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 15/20] wifi: iwlwifi: mvm: show full firmware ID in debugfs Date: Mon, 27 May 2024 19:06:10 +0300 Message-Id: <20240527190228.527a1c72996d.If7588b854149d51605031fc9a70a650534351ef4@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 The firmware prefix is unused today, but it might still be useful to have some information. Since the prefix will get the intel/ directory in some cases, replace the prefix by the full FW id which has all the information. Signed-off-by: Johannes Berg Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 1504cbec69c9..cb164b733cb3 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -754,7 +754,6 @@ static ssize_t iwl_dbgfs_fw_ver_read(struct file *file, char __user *user_buf, struct iwl_mvm *mvm = file->private_data; char *buff, *pos, *endpos; static const size_t bufsz = 1024; - char _fw_name_pre[FW_NAME_PRE_BUFSIZE]; int ret; buff = kmalloc(bufsz, GFP_KERNEL); @@ -764,8 +763,8 @@ static ssize_t iwl_dbgfs_fw_ver_read(struct file *file, char __user *user_buf, pos = buff; endpos = pos + bufsz; - pos += scnprintf(pos, endpos - pos, "FW prefix: %s\n", - iwl_drv_get_fwname_pre(mvm->trans, _fw_name_pre)); + pos += scnprintf(pos, endpos - pos, "FW id: %s\n", + mvm->fwrt.fw->fw_version); pos += scnprintf(pos, endpos - pos, "FW: %s\n", mvm->fwrt.fw->human_readable); pos += scnprintf(pos, endpos - pos, "Device: %s\n", From patchwork Mon May 27 16:06:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800934 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 3295616A399 for ; Mon, 27 May 2024 16:06:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826008; cv=none; b=h7A25UKj2RR8KbSg6YtOB9yMVmXI/v5/BeMDJwIF4jaRcjGULL/nUQMAF597uTWMwsluVNHDIlqkLc7pOmOFDrpOXicSvevCRIyOLeXHD9WxFT/CWF35HjfebySbxtuf4hdT/X9upzYAOhYL6P4aLKAFgJFLPfFZlJb6HLc8s94= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826008; c=relaxed/simple; bh=znVBTYtF+pt5O46QjnYGcwyoV78Uaec6desSDNbVHdg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u1rAetOnl8mRA4buZlFbp3Dk+9+7iOqQRqgJhSZD96zOjJuz1/JBZILQe+2pu6HyhBDeU8GMkD1EKiZ1U3cT87yR4Aox/Hw5gT94u45zuMQNoc62tpNhMkj4KlhWN1WzNzoNhzZzfhx4+8ozPATNyTbKKedYnegvmLkLhrdEznA= 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=XvhfOLJK; arc=none smtp.client-ip=198.175.65.19 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="XvhfOLJK" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826008; x=1748362008; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=znVBTYtF+pt5O46QjnYGcwyoV78Uaec6desSDNbVHdg=; b=XvhfOLJKYgn0qv0L1zanDI2RbrYVbe2ndgVBFV8YsPjQB+rtlxCd1Hh0 QNyESl4U+5ZeWTUAG88x+DNvRy/qt8q/dA3oSH3mn6y95HNRqJyXzrG0g p0gIV7Ps+1q0ybbL90ijv2eJSsYIzMU8kFTIZaQW0BIWwbbOvA54qntpv ER3gcfzYwtlk31I6MZjVH8aU+AmE9FkX6MSpR0SWleD9zG/eJn7ON4NQX LlKzotCw4z/96gkLSfuzacpdavrIQ8nwG09yqve68nrZce1sXDkXjN/2a zLXUuNuItmNJ/Xvo9uSinXRALe6USiqlsAO8n/btGMWifOKDLHdrWGoDB Q==; X-CSE-ConnectionGUID: D5Ejhbp9RUyp7X0OZn850A== X-CSE-MsgGUID: K9QFlmSTRFygLvCufUal+w== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002115" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002115" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:47 -0700 X-CSE-ConnectionGUID: sMZ1sT5YSbKR+9K8TiQS5g== X-CSE-MsgGUID: HaOHgFKsTguHOyy0AIQW3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407128" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:46 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 16/20] wifi: iwlwifi: mvm: declare band variable in the scope Date: Mon, 27 May 2024 19:06:11 +0300 Message-Id: <20240527190228.b634d184980a.I9d9e71125f9a77ba4f9a33a7a2ff1e8e78e17767@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 band is not used outside of the for loop, declare it inside it. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c index 5132964661c8..712dabb30acc 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c @@ -1730,7 +1730,6 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, const u16 *nvm_chan; struct ieee80211_regdomain *regd, *copy_rd; struct ieee80211_reg_rule *rule; - enum nl80211_band band; int center_freq, prev_center_freq = 0; int valid_rules = 0; bool new_rule; @@ -1774,8 +1773,10 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, reg_capa = iwl_get_reg_capa(cap, resp_ver); for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) { + enum nl80211_band band = + iwl_nl80211_band_from_channel_idx(ch_idx); + ch_flags = (u16)__le32_to_cpup(channels + ch_idx); - band = iwl_nl80211_band_from_channel_idx(ch_idx); center_freq = ieee80211_channel_to_frequency(nvm_chan[ch_idx], band); new_rule = false; From patchwork Mon May 27 16:06:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799433 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 7EA1F16ABE7 for ; Mon, 27 May 2024 16:06:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826009; cv=none; b=Bw+2preU8gPrDOMXwswifKgyyfnIQEYBhsIRv3gZBfM7U/5Ygceijbwx4a2d7XQf4APagX7RLHs3IwgNH/78r99sfe/h0raQhXmvi1V5MePlAoEL81ZEVv/BbV7VBTVyVcpH5Lg+sUBnQAKlPqwUGGIJ7iRXIT4gBqjXarKSDUg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826009; c=relaxed/simple; bh=FLvfxp0U7BqlC8Yq/Rt+MPI38+vRUIWVRlWfWcdOyXA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pYiu+8WId2ZxGmqezJKgf8gv3WichxwGJ52gbFxhbwEUeW8is00tHfLoBC+iA17lL9OJxF9Z1HVJ2W8SqPCZ1l3TWET2aPn/H4Yno1JWKF5g/Tx7DQ4gsojOPqfdGJe6vbnOVtpzwdEEFqXJBpWiyW4B+iMj9DdWCSTgg0t5JwI= 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=HMGlzbU1; arc=none smtp.client-ip=198.175.65.19 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="HMGlzbU1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826009; x=1748362009; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FLvfxp0U7BqlC8Yq/Rt+MPI38+vRUIWVRlWfWcdOyXA=; b=HMGlzbU1X68RP68HaQIzxexD5WH1VMhDpq38Efvjr3fG/qdWMmlHQgtC LoAkCrMIHN8G8WABh3fElnpZM+HiZm3SQgAKB5jG2wFUAJX9HIlNeZIl8 3o3B9TXVFKp6KQsMC4irTv2LknHBekoR9Xv1s4ajwEINOY+hpbfRfMKuV qpGcvjk8KORCh6rL53q467plXhkOGP/QcnO2yg878TgMrDVnoUr9cB4u7 tU4Sp591VsDzwXpqyXOK8Kqrbec6O2ZHAvombdyoUWBQQv/afJTuVLs1f lrduM3AEzUR5Oz9r9ehLhqfVof9R/CSt1Gaf4VPQyXNym29+rrQLfuTEZ A==; X-CSE-ConnectionGUID: cgu5JvOaTfqCdSVFzLVosg== X-CSE-MsgGUID: Rpa5xgJLQfOliPCqxoT0Qw== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002119" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002119" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:49 -0700 X-CSE-ConnectionGUID: iktxY+hjTqO4PO7vTe8mIw== X-CSE-MsgGUID: SA8ZSMpnSUSfOriTyUiuJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407135" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:48 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 17/20] wifi: iwlwifi: mvm: fix a wrong comment Date: Mon, 27 May 2024 19:06:12 +0300 Message-Id: <20240527190228.2105ffcf747d.Ic838959b812b6cb4cbb856e8c0bcaad2f46ac71b@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index 0e88629f695a..d5a204e52076 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -241,7 +241,7 @@ int iwl_mvm_mld_add_bcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif, IWL_MAX_TID_COUNT, &wdg_timeout); } -/* Allocate a new station entry for the broadcast station to the given vif, +/* Allocate a new station entry for the multicast station to the given vif, * and send it to the FW. * Note that each AP/GO mac should have its own multicast station. */ From patchwork Mon May 27 16:06:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800933 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 84F9416B723 for ; Mon, 27 May 2024 16:06:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826011; cv=none; b=M7M9bYGMgaBi1k1fG9Zf1uFtiZEFNupzMhCtR5UzT3NM4jwVAqkWqVZ4/avIOrLE/L6gQQaeRD2c89KnGNYGFhZfOXNAzYQ3XsPk8yBmuLr2M+RD1vwTa6I2Tko+RyX54yO8NC8jvIS9nEqo4o3Or5C8OjlLD8ensWY0YtBS6lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826011; c=relaxed/simple; bh=GlDXrMmvyHp+ZQHsgykCIZT2Gm3bqfQZI9tYpK9ENqk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jdKEKK2YGUrzrlTeWrlC6daKyrZ1Al3rUVGaswZ9TO2lwggiyiMAhb44jgINA1mNhMa5IS8Js/D7gyzKP9TrOs2W8dqwpTEI86KgEid7nn5022SQvDZSec475LopHzBpKVzMH9WpAWUeF+8pFkGT+pWqnb7pqs/hXxK5iASJ8xM= 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=g1jf6sUe; arc=none smtp.client-ip=198.175.65.19 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="g1jf6sUe" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826011; x=1748362011; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GlDXrMmvyHp+ZQHsgykCIZT2Gm3bqfQZI9tYpK9ENqk=; b=g1jf6sUejeDm43SQbL7LuBBbVF+cAN0erMo4T5TTFS61QkG+pHGWWEV7 Wix4NGIFXfQVf13QqfJBUW3XUaSYfQyPIJ0Y4zhAhwASpmEm3VdSWSy5E NsdIAUd8js53MSumYk+nH+JKVstpxq0h5BNicvtXFo/8W+0H/TXKviUfo mUdBVCFvkb5wzo0FSuFJ/DdsP8Sre49Db7n/AcVyP8Wx68qaGhgEQL5st Xs0UzZRrj/YmMX1akoJauSMlQIGagAE+5+2HVngvnLbxrLbD/FlzQYISk Bi5pRAfn8L4AsRf6oesH2MZkE7ccvd4kNmKFSiarh+wG2WrdOmgP5t2I4 Q==; X-CSE-ConnectionGUID: UAOJ+tlBSh2Bu4zUwH7zMA== X-CSE-MsgGUID: uX4DZWnvQvi8T/4YTIF1YA== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002121" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002121" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:50 -0700 X-CSE-ConnectionGUID: ToJqOvPxQh6H5mXKDLQGIw== X-CSE-MsgGUID: LJ+WAk3eTQeglDivHMj2FQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407143" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:49 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Emmanuel Grumbach Subject: [PATCH 18/20] wifi: iwlwifi: remove redundant prints Date: Mon, 27 May 2024 19:06:13 +0300 Message-Id: <20240527190228.5c589c7abed0.I3590c4ee0ee99d1b207852c32d25d326afb327dd@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 Upon start, the different opmodes are currently printing: 1. HW rev, which is already print by iwlwifi 2. The HW name (e.g. "Intel(R) Wi-Fi 7 BE201 320MHz") cleanup things such as the hw rev won't be printed again, the HW name will be printed by iwlwifi instead of each opmode. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg Reviewed-by: Emmanuel Grumbach --- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 3 --- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index 516decc647dd..ed9487062093 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1450,9 +1450,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, goto out_free; } - IWL_INFO(mvm, "Detected %s, REV=0x%X\n", - mvm->trans->name, mvm->trans->hw_rev); - if (iwlwifi_mod_params.nvm_file) mvm->nvm_file_name = iwlwifi_mod_params.nvm_file; else diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index fed2754be680..92e48cff49de 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -1476,6 +1476,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) if (!iwl_trans->name) iwl_trans->name = iwl_trans->cfg->name; + IWL_INFO(iwl_trans, "Detected %s\n", iwl_trans->name); + if (iwl_trans->trans_cfg->mq_rx_supported) { if (WARN_ON(!iwl_trans->cfg->num_rbds)) { ret = -EINVAL; From patchwork Mon May 27 16:06:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 799432 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 DE37C16B727 for ; Mon, 27 May 2024 16:06:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826013; cv=none; b=ZOCr3R7sJXAsloBnmjAjYe0mZU6PR5SViYqWOouuWE/N9YUg/U5mJRxjteQFuvzlVuBiII/mbAC6kDnIY7mr7UncLszDDh91soU0kvUJKeoRvh+Eu7BerOMpeWo6GbcVJab3DN5e/80SQ53+R/XhB+xb/RCy1Vng7qQtM2Z+hik= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826013; c=relaxed/simple; bh=VYlpb+ivOvVn1+IXaKIeNqkqT/zhRp+RvXuzt/zNjxI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=miMmK9Fmq0JR87LwDDMR1ToGgY3YZHIX0nwiF46PgwDZuAMeGe1AcKmpfXGyVIfpM5+JvWoaKRss8Ul5vlnT6JDJvkdXoyBI3kPgEe9Eh6K8CNReURHBZrBzkryNvyhAXRDfKQyvWUecBl5zYGD/EQ3u/asDnSLIdpYZVTZTvfE= 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=YusfDqz+; arc=none smtp.client-ip=198.175.65.19 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="YusfDqz+" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826012; x=1748362012; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VYlpb+ivOvVn1+IXaKIeNqkqT/zhRp+RvXuzt/zNjxI=; b=YusfDqz+SHDgdy39q1Q5Wo27cixeebZU2tUgknLv6lNNsnVnfF9fgJzs 30UeYvQXqcmIA/X6RBSrW8Qcip41t8h6/Ssv5hRc4j8UESWF2Xc6KbZmj Lj3Vgc6z13F9DtqG5KKuWeSgZK9OsvJWwgdcy53dTn5G4AlPFqOknT9ML X9PUEWszaDEdp5tLToZBdUMtmK4iXpc9J+AfOIoezqvisUhUDxkLW9kf9 /R2+cEPKtdzu2IVMENF0HlUg9oQqR+c7vj3HwZVFr+no1JJtc+74Fp0wT hHdQrHQ6NGBN/hAePeSe1pboO3RprfH4Qufzjm+gjqfTbMNrtUboJ5Kmi g==; X-CSE-ConnectionGUID: 3gc2mR7FRqeNKN1ajzhx+w== X-CSE-MsgGUID: m5+rlaYfSeODPRNmElDbxQ== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002124" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002124" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:52 -0700 X-CSE-ConnectionGUID: zcVdLBvtTFeaU+hksGz6mw== X-CSE-MsgGUID: 4KUFG3iNSIerSQTMfildOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407147" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:51 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 19/20] wifi: iwlwifi: move amsdu_size parsing to iwlwifi Date: Mon, 27 May 2024 19:06:14 +0300 Message-Id: <20240527190228.a3430d32923d.Iab3c22ef0df685f72f22dafc47021f0dc7bd6fa5@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 The code that is parsing the amsdu_size module parameter and mapping it to the corresponding Rx buffer size is common to all opmodes. Move it into a function in iwlwifi, as preparation to a new op mode we are working on. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg --- .../wireless/intel/iwlwifi/iwl-modparams.h | 21 ++++++++++++++++++- drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 19 +---------------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h index 1cf26ab4f488..21eabfc3ffc8 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h +++ b/drivers/net/wireless/intel/iwlwifi/iwl-modparams.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ /* - * Copyright (C) 2005-2014, 2018-2022 Intel Corporation + * Copyright (C) 2005-2014, 2018-2022, 2024 Intel Corporation */ #ifndef __iwl_modparams_h__ #define __iwl_modparams_h__ @@ -106,4 +106,23 @@ static inline bool iwl_enable_tx_ampdu(void) return true; } +/* Verify amsdu_size module parameter and convert it to a rxb size */ +static inline enum iwl_amsdu_size +iwl_amsdu_size_to_rxb_size(void) +{ + switch (iwlwifi_mod_params.amsdu_size) { + case IWL_AMSDU_8K: + return IWL_AMSDU_8K; + case IWL_AMSDU_12K: + return IWL_AMSDU_12K; + default: + pr_err("%s: Unsupported amsdu_size: %d\n", KBUILD_MODNAME, + iwlwifi_mod_params.amsdu_size); + fallthrough; + case IWL_AMSDU_DEF: + case IWL_AMSDU_4K: + return IWL_AMSDU_4K; + } +} + #endif /* #__iwl_modparams_h__ */ diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c index ed9487062093..85178fe1b7ea 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c @@ -1373,24 +1373,7 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg, trans_cfg.no_reclaim_cmds = no_reclaim_cmds; trans_cfg.n_no_reclaim_cmds = ARRAY_SIZE(no_reclaim_cmds); - switch (iwlwifi_mod_params.amsdu_size) { - case IWL_AMSDU_DEF: - trans_cfg.rx_buf_size = IWL_AMSDU_4K; - break; - case IWL_AMSDU_4K: - trans_cfg.rx_buf_size = IWL_AMSDU_4K; - break; - case IWL_AMSDU_8K: - trans_cfg.rx_buf_size = IWL_AMSDU_8K; - break; - case IWL_AMSDU_12K: - trans_cfg.rx_buf_size = IWL_AMSDU_12K; - break; - default: - pr_err("%s: Unsupported amsdu_size: %d\n", KBUILD_MODNAME, - iwlwifi_mod_params.amsdu_size); - trans_cfg.rx_buf_size = IWL_AMSDU_4K; - } + trans_cfg.rx_buf_size = iwl_amsdu_size_to_rxb_size(); trans->wide_cmd_header = true; trans_cfg.bc_table_dword = From patchwork Mon May 27 16:06:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miri Korenblit X-Patchwork-Id: 800932 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 1FFEE16B723 for ; Mon, 27 May 2024 16:06:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826014; cv=none; b=oZ50HpGVi+t8slCYBaldXE1a4qgTjLOAkEsrO+BEbPwyBYYvfVH2W/e+yPYfab147HxFgzpXlJyuZINtWfY1SZnLwlQcwo6c17f3db2wuq7JwK7/gFMhRnxlOoXFBfeUP2DqUD1oSTDlbbPwPao9DO/SDmFtVay/A9dvi9HyMqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826014; c=relaxed/simple; bh=oycJ6t5CoIxGzT/Xbzje22K5K3HjjpKaCPfnSwFfArg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=t7WqT4Lqwvp3B5nRUr8DWwCJkY3J2zz2iX9kA/GpZ4BikjY0slmeRBjiuddKpA00BGFON3qCwfjafPhOuNO0CpBvXcdt6MMEcE9jh02gmiKJAHR6j2yfH2jJlbMlv7dXsrNNmK/7hdDTJJYP6asMa875qKdOLnBNjqdFs/KOOl0= 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=Zz3lhUQL; arc=none smtp.client-ip=198.175.65.19 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="Zz3lhUQL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716826013; x=1748362013; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oycJ6t5CoIxGzT/Xbzje22K5K3HjjpKaCPfnSwFfArg=; b=Zz3lhUQLv3NjuRMkNJlcBNVyXj75b/4P2vf5F9Yc0U6utE3A3zeFP5u/ kChsLx5HrtfHwggRsbDilj98BnQgKf6zR1vM++q4/3S7ttal4OTApSA1G SgWKPihn62bo9Q3KkiFlG9TmEGM3MQ3D9hZOKBQAng3lhoQ+dGVxNuzuI CDv1vWAEEMpMX/qLD6sdXwfnnEqCAw7TRsFY0hBfcN35u4aXHIw50d9LE BluNef+z/ii8w1evi5iF8V7hHFw+JoodO/Y934x8Eh0pUm3FzONLEcrPX iuxM5Cwh8Q2wvBu49WCbRA5VdP2sFLrzIows6O+OeuLLsOMbHDBlBvNxD Q==; X-CSE-ConnectionGUID: 5RMI+58BTYu2cDO+9YxK8w== X-CSE-MsgGUID: k0zXrJJNTte4DxTrlba3Sg== X-IronPort-AV: E=McAfee;i="6600,9927,11085"; a="13002137" X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="13002137" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:53 -0700 X-CSE-ConnectionGUID: 4/+ypBiXSx2QdZuR1Pz6EQ== X-CSE-MsgGUID: HIvbX+S9SOmO9Gro2DkY2w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,193,1712646000"; d="scan'208";a="35407152" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 May 2024 09:06:52 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Emmanuel Grumbach Subject: [PATCH 20/20] wifi: iwlwifi: move Bz and Gl iwl_dev_info entries Date: Mon, 27 May 2024 19:06:15 +0300 Message-Id: <20240527190228.a75e9a1eb86c.I003980f8ca60a96019657e396e848a07df6b92a4@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527160615.1549563-1-miriam.rachel.korenblit@intel.com> References: <20240527160615.1549563-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 The iwl_dev_info entries for these devices were incorrectly positioned within the array, out of chronological order. Move them arround. Signed-off-by: Miri Korenblit Reviewed-by: Johannes Berg Reviewed-by: Emmanuel Grumbach --- drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c index 92e48cff49de..d6da25e24818 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c @@ -997,32 +997,6 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = { IWL_CFG_160, IWL_CFG_ANY, IWL_CFG_CDB, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_name), -/* Bz */ -/* FIXME: need to change the naming according to the actual CRF */ - _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_MAC_TYPE_BZ, IWL_CFG_ANY, - IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, - iwl_cfg_bz, iwl_fm_name), - - _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_MAC_TYPE_BZ_W, IWL_CFG_ANY, - IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, - iwl_cfg_bz, iwl_fm_name), - -/* Ga (Gl) */ - _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_MAC_TYPE_GL, IWL_CFG_ANY, - IWL_CFG_RF_TYPE_FM, IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_320, IWL_CFG_ANY, IWL_CFG_NO_CDB, - iwl_cfg_gl, iwl_gl_name), - _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_MAC_TYPE_GL, IWL_CFG_ANY, - IWL_CFG_RF_TYPE_FM, IWL_CFG_ANY, IWL_CFG_ANY, - IWL_CFG_NO_320, IWL_CFG_ANY, IWL_CFG_NO_CDB, - iwl_cfg_gl, iwl_mtp_name), - /* SoF with JF2 */ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_MAC_TYPE_SOF, IWL_CFG_ANY, @@ -1103,6 +1077,32 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = { IWL_CFG_NO_160, IWL_CFG_CORES_BT, IWL_CFG_NO_CDB, iwlax210_2ax_cfg_so_jf_b0, iwl9462_name), +/* Bz */ +/* FIXME: need to change the naming according to the actual CRF */ + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_MAC_TYPE_BZ, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + iwl_cfg_bz, iwl_fm_name), + + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_MAC_TYPE_BZ_W, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY, + iwl_cfg_bz, iwl_fm_name), + +/* Ga (Gl) */ + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_MAC_TYPE_GL, IWL_CFG_ANY, + IWL_CFG_RF_TYPE_FM, IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_320, IWL_CFG_ANY, IWL_CFG_NO_CDB, + iwl_cfg_gl, iwl_gl_name), + _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_MAC_TYPE_GL, IWL_CFG_ANY, + IWL_CFG_RF_TYPE_FM, IWL_CFG_ANY, IWL_CFG_ANY, + IWL_CFG_NO_320, IWL_CFG_ANY, IWL_CFG_NO_CDB, + iwl_cfg_gl, iwl_mtp_name), + /* Sc */ _IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_MAC_TYPE_SC, IWL_CFG_ANY,