All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 01/17] wifi: iwlwifi: prepare for reading SPLC from UEFI
Date: Thu,  1 Feb 2024 16:17:25 +0200	[thread overview]
Message-ID: <20240201155157.4cce81198afe.Ice8b1b97a68da9ec7b5a4799ddb668642198e1af@changeid> (raw)
In-Reply-To: <20240201141741.2569180-1-miriam.rachel.korenblit@intel.com>

As the iwl_bios_get_x() functions are now generated using a macro,
and this macro requires the all iwl_acpi_get_x() to have the same
prototype, change iwl_acpi_get_pwr_limit() to return a int
and the actuall power limit will be filled in a pointer function
parameter.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 23 +++++++++-----------
 drivers/net/wireless/intel/iwlwifi/fw/acpi.h |  6 +++--
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c |  2 +-
 3 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index 170c840c321a..d6e7de2543b2 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -362,31 +362,28 @@ int iwl_acpi_get_mcc(struct device *dev, char *mcc)
 }
 IWL_EXPORT_SYMBOL(iwl_acpi_get_mcc);
 
-u64 iwl_acpi_get_pwr_limit(struct device *dev)
+int iwl_acpi_get_pwr_limit(struct iwl_fw_runtime *fwrt, u64 *dflt_pwr_limit)
 {
 	union acpi_object *data, *wifi_pkg;
-	u64 dflt_pwr_limit;
-	int tbl_rev;
+	int tbl_rev, ret = -EINVAL;
 
-	data = iwl_acpi_get_object(dev, ACPI_SPLC_METHOD);
-	if (IS_ERR(data)) {
-		dflt_pwr_limit = 0;
+	*dflt_pwr_limit = 0;
+	data = iwl_acpi_get_object(fwrt->dev, ACPI_SPLC_METHOD);
+	if (IS_ERR(data))
 		goto out;
-	}
 
-	wifi_pkg = iwl_acpi_get_wifi_pkg(dev, data,
+	wifi_pkg = iwl_acpi_get_wifi_pkg(fwrt->dev, data,
 					 ACPI_SPLC_WIFI_DATA_SIZE, &tbl_rev);
 	if (IS_ERR(wifi_pkg) || tbl_rev != 0 ||
-	    wifi_pkg->package.elements[1].integer.value != ACPI_TYPE_INTEGER) {
-		dflt_pwr_limit = 0;
+	    wifi_pkg->package.elements[1].integer.value != ACPI_TYPE_INTEGER)
 		goto out_free;
-	}
 
-	dflt_pwr_limit = wifi_pkg->package.elements[1].integer.value;
+	*dflt_pwr_limit = wifi_pkg->package.elements[1].integer.value;
+	ret = 0;
 out_free:
 	kfree(data);
 out:
-	return dflt_pwr_limit;
+	return ret;
 }
 IWL_EXPORT_SYMBOL(iwl_acpi_get_pwr_limit);
 
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
index 61bfdaa467d4..f0ed7174a951 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
@@ -156,7 +156,7 @@ int iwl_acpi_get_dsm_u32(struct device *dev, int rev, int func,
  */
 int iwl_acpi_get_mcc(struct device *dev, char *mcc);
 
-u64 iwl_acpi_get_pwr_limit(struct device *dev);
+int iwl_acpi_get_pwr_limit(struct iwl_fw_runtime *fwrt, u64 *dflt_pwr_limit);
 
 /*
  * iwl_acpi_get_eckv - read external clock validation from ACPI, if available
@@ -212,8 +212,10 @@ static inline int iwl_acpi_get_mcc(struct device *dev, char *mcc)
 	return -ENOENT;
 }
 
-static inline u64 iwl_acpi_get_pwr_limit(struct device *dev)
+static inline int iwl_acpi_get_pwr_limit(struct iwl_fw_runtime *fwrt,
+					 u64 *dflt_pwr_limit)
 {
+	*dflt_pwr_limit = 0;
 	return 0;
 }
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 1b41318e1e55..0e7b66a20b7c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -689,7 +689,7 @@ static u32 iwl_mvm_min_backoff(struct iwl_mvm *mvm)
 	if (!backoff)
 		return 0;
 
-	dflt_pwr_limit = iwl_acpi_get_pwr_limit(mvm->dev);
+	iwl_acpi_get_pwr_limit(&mvm->fwrt, &dflt_pwr_limit);
 
 	while (backoff->pwr) {
 		if (dflt_pwr_limit >= backoff->pwr)
-- 
2.34.1


  reply	other threads:[~2024-02-01 14:18 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 14:17 [PATCH 00/17] wifi: iwlwifi: updates - 2024-02-01 Miri Korenblit
2024-02-01 14:17 ` Miri Korenblit [this message]
2024-02-01 14:17 ` [PATCH 02/17] wifi: iwlwifi: read SPLC from UEFI Miri Korenblit
2024-02-01 14:17 ` [PATCH 03/17] wifi: iwlwifi: mvm: don't send NDPs for new tx devices Miri Korenblit
2024-02-01 14:17 ` [PATCH 04/17] wifi: iwlwifi: mvm: use fast balance scan in case of an active P2P GO Miri Korenblit
2024-02-01 14:17 ` [PATCH 05/17] wifi: iwlwifi: support link command version 2 Miri Korenblit
2024-02-01 14:17 ` [PATCH 06/17] wifi: iwlwifi: do not announce EPCS support Miri Korenblit
2024-02-01 14:17 ` [PATCH 07/17] wifi: iwlwifi: read WRDD table from UEFI Miri Korenblit
2024-02-01 14:17 ` [PATCH 08/17] wifi: iwlwifi: read ECKV " Miri Korenblit
2024-02-01 14:17 ` [PATCH 09/17] wifi: iwlwifi: rfi: use a single DSM function for all RFI configurations Miri Korenblit
2024-02-01 14:17 ` [PATCH 10/17] wifi: iwlwifi: take send-DSM-to-FW flows out of ACPI ifdef Miri Korenblit
2024-02-01 14:17 ` [PATCH 11/17] wifi: iwlwifi: simplify getting DSM from ACPI Miri Korenblit
2024-02-01 14:17 ` [PATCH 12/17] wifi: iwlwifi: prepare for reading DSM from UEFI Miri Korenblit
2024-02-01 14:17 ` [PATCH 13/17] wifi: iwlwifi: read DSM functions " Miri Korenblit
2024-02-01 14:17 ` [PATCH 14/17] wifi: iwlwifi: mvm: don't send BT_COEX_CI command on new devices Miri Korenblit
2024-02-01 14:17 ` [PATCH 15/17] wifi: iwlwifi: exit eSR only after the FW does Miri Korenblit
2024-02-01 14:17 ` [PATCH 16/17] wifi: iwlwifi: bump FW API to 88 for AX/BZ/SC devices Miri Korenblit
2024-02-01 14:17 ` [PATCH 17/17] wifi: iwlwifi: mvm: make functions public Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240201155157.4cce81198afe.Ice8b1b97a68da9ec7b5a4799ddb668642198e1af@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.