All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jouni Malinen <jouni@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Anilkumar Kolli <akolli@codeaurora.org>,
	Jouni Malinen <jouni@codeaurora.org>
Subject: [PATCH 3/4] ath11k: add caldata file for multiple radios
Date: Wed, 21 Jul 2021 23:19:26 +0300	[thread overview]
Message-ID: <20210721201927.100369-4-jouni@codeaurora.org> (raw)
In-Reply-To: <20210721201927.100369-1-jouni@codeaurora.org>

From: Anilkumar Kolli <akolli@codeaurora.org>

If multiple PCI cards are attached, each needs its own caldata file.

Added new Caldata file name,
PCI Bus:
        cal-pci-0001:01:00.0.bin
        cal-pci-0000:01:00.0.bin
AHB Bus:
	cal-ahb-c000000.wifi1.bin

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index a24a6647ba52..381ae70e45ff 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2027,6 +2027,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab,
 
 static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 {
+	struct device *dev = ab->dev;
 	char filename[ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE];
 	const struct firmware *fw_entry;
 	struct ath11k_board_data bd;
@@ -2061,6 +2062,14 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 		goto out;
 
 	file_type = ATH11K_QMI_FILE_TYPE_CALDATA;
+
+	/* cal-<bus>-<id>.bin */
+	snprintf(filename, sizeof(filename), "cal-%s-%s.bin",
+		 ath11k_bus_str(ab->hif.bus), dev_name(dev));
+	fw_entry = ath11k_core_firmware_request(ab, filename);
+	if (!IS_ERR(fw_entry))
+		goto success;
+
 	fw_entry = ath11k_core_firmware_request(ab, ATH11K_DEFAULT_CAL_FILE);
 	if (IS_ERR(fw_entry)) {
 		ret = PTR_ERR(fw_entry);
@@ -2070,6 +2079,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 		goto out;
 	}
 
+success:
 	fw_size = min_t(u32, ab->hw_params.fw.board_size, fw_entry->size);
 	ret = ath11k_qmi_load_file_target_mem(ab, fw_entry->data, fw_size, file_type);
 	if (ret < 0) {
@@ -2077,8 +2087,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 		goto out_qmi_cal;
 	}
 
-	ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi caldata downloaded: type: %u\n",
-		   file_type);
+	ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi caldata type: %u\n", file_type);
 
 out_qmi_cal:
 	release_firmware(fw_entry);
-- 
2.25.1


WARNING: multiple messages have this Message-ID (diff)
From: Jouni Malinen <jouni@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Anilkumar Kolli <akolli@codeaurora.org>,
	Jouni Malinen <jouni@codeaurora.org>
Subject: [PATCH 3/4] ath11k: add caldata file for multiple radios
Date: Wed, 21 Jul 2021 23:19:26 +0300	[thread overview]
Message-ID: <20210721201927.100369-4-jouni@codeaurora.org> (raw)
In-Reply-To: <20210721201927.100369-1-jouni@codeaurora.org>

From: Anilkumar Kolli <akolli@codeaurora.org>

If multiple PCI cards are attached, each needs its own caldata file.

Added new Caldata file name,
PCI Bus:
        cal-pci-0001:01:00.0.bin
        cal-pci-0000:01:00.0.bin
AHB Bus:
	cal-ahb-c000000.wifi1.bin

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-00009-QCAHKSWPL_SILICONZ-1
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01838-QCAHKSWPL_SILICONZ-1

Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/qmi.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index a24a6647ba52..381ae70e45ff 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -2027,6 +2027,7 @@ static int ath11k_qmi_load_file_target_mem(struct ath11k_base *ab,
 
 static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 {
+	struct device *dev = ab->dev;
 	char filename[ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE];
 	const struct firmware *fw_entry;
 	struct ath11k_board_data bd;
@@ -2061,6 +2062,14 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 		goto out;
 
 	file_type = ATH11K_QMI_FILE_TYPE_CALDATA;
+
+	/* cal-<bus>-<id>.bin */
+	snprintf(filename, sizeof(filename), "cal-%s-%s.bin",
+		 ath11k_bus_str(ab->hif.bus), dev_name(dev));
+	fw_entry = ath11k_core_firmware_request(ab, filename);
+	if (!IS_ERR(fw_entry))
+		goto success;
+
 	fw_entry = ath11k_core_firmware_request(ab, ATH11K_DEFAULT_CAL_FILE);
 	if (IS_ERR(fw_entry)) {
 		ret = PTR_ERR(fw_entry);
@@ -2070,6 +2079,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 		goto out;
 	}
 
+success:
 	fw_size = min_t(u32, ab->hw_params.fw.board_size, fw_entry->size);
 	ret = ath11k_qmi_load_file_target_mem(ab, fw_entry->data, fw_size, file_type);
 	if (ret < 0) {
@@ -2077,8 +2087,7 @@ static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
 		goto out_qmi_cal;
 	}
 
-	ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi caldata downloaded: type: %u\n",
-		   file_type);
+	ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi caldata type: %u\n", file_type);
 
 out_qmi_cal:
 	release_firmware(fw_entry);
-- 
2.25.1


-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  parent reply	other threads:[~2021-07-21 20:20 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 20:19 [PATCH 0/4] ath11k: Add caldata download support from file/EEPROM Jouni Malinen
2021-07-21 20:19 ` Jouni Malinen
2021-07-21 20:19 ` [PATCH 1/4] ath11k: use hw_params to access board_size and cal_offset Jouni Malinen
2021-07-21 20:19   ` Jouni Malinen
2021-09-24 14:49   ` Kalle Valo
2021-09-24 14:49     ` Kalle Valo
2021-09-27  4:21     ` akolli
2021-09-27  4:21       ` akolli
2021-09-28 10:50   ` Kalle Valo
2021-09-28 10:50   ` Kalle Valo
2021-07-21 20:19 ` [PATCH 2/4] ath11k: clean up BDF download functions Jouni Malinen
2021-07-21 20:19   ` Jouni Malinen
2021-07-21 20:19 ` Jouni Malinen [this message]
2021-07-21 20:19   ` [PATCH 3/4] ath11k: add caldata file for multiple radios Jouni Malinen
2021-07-21 20:19 ` [PATCH 4/4] ath11k: add caldata download support from EEPROM Jouni Malinen
2021-07-21 20:19   ` Jouni Malinen
2021-09-24 15:04   ` Kalle Valo
2021-09-24 15:04     ` Kalle Valo
2021-09-27  4:42     ` Anilkumar Kolli
2021-09-27  4:42       ` Anilkumar Kolli
2021-09-28  9:24       ` Kalle Valo
2021-09-28  9:24         ` Kalle Valo

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=20210721201927.100369-4-jouni@codeaurora.org \
    --to=jouni@codeaurora.org \
    --cc=akolli@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@codeaurora.org \
    --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.