Skip to contentSkip to conversation

ath10k: Add support to create boardname for non-bmi target

PATCH Superseded Govind Singh 3 participants 3 messages Jun 5, 2018 – Jul 3, 2018 Qualcomm Atheros ATH10K wireless driver

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/6 ath10k: Add support to create boardname for non-bmi target

From: Rakesh Pillai <[email protected]>

Add support to create the boardname for non-bmi targets like WCN3990, which uses qmi for bdf download. This boardname is used to parse the board data from board-2.bin.

---
 drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++++++++
 drivers/net/wireless/ath/ath10k/core.h |  2 ++
 2 files changed, 16 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +14 -0
index 4cf54a7ef09a..8a592019cc4d 100644
@@ -1429,6 +1429,20 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 		goto out;
 	}
 
+	if (ar->id.qmi_ids_valid) {
+		if (ar->id.qmi_board_id > 0x99)
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=%03x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		else
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=b%02x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		goto out;
+	}
+
 	scnprintf(name, name_len,
 		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
 		  ath10k_bus_str(ar->hif.bus),
drivers/net/wireless/ath/ath10k/core.h +2 -0
index 951dbdd1c9eb..0a2e4a5c3612 100644
@@ -940,7 +940,9 @@ struct ath10k {
 		u32 subsystem_device;
 
 		bool bmi_ids_valid;
+		bool qmi_ids_valid;
 		u8 bmi_board_id;
+		u8 qmi_board_id;
 		u8 bmi_chip_id;
 
 		char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
Signature · 1 line
2.17.0
Acked-by on v2 2/6
#1 lore raw
Quoted 60 lines · Govind Singh

From: Rakesh Pillai <[email protected]>

Add support to create the boardname for non-bmi targets like WCN3990, which uses qmi for bdf download. This boardname is used to parse the board data from board-2.bin.

---
 drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++++++++
 drivers/net/wireless/ath/ath10k/core.h |  2 ++
 2 files changed, 16 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +14 -0
index 4cf54a7ef09a..8a592019cc4d 100644
@@ -1429,6 +1429,20 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 		goto out;
 	}
 
+	if (ar->id.qmi_ids_valid) {
+		if (ar->id.qmi_board_id > 0x99)
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=%03x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		else
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=b%02x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		goto out;
+	}
+
 	scnprintf(name, name_len,
 		  "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s",
 		  ath10k_bus_str(ar->hif.bus),
drivers/net/wireless/ath/ath10k/core.h +2 -0
index 951dbdd1c9eb..0a2e4a5c3612 100644
@@ -940,7 +940,9 @@ struct ath10k {
 		u32 subsystem_device;
 
 		bool bmi_ids_valid;
+		bool qmi_ids_valid;
 		u8 bmi_board_id;
+		u8 qmi_board_id;
 		u8 bmi_chip_id;
 
 		char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH];
Signature · 7 lines
2.17.0


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#2 lore raw
In reply to Govind Singh
Quoted 24 lines · Govind Singh

From: Rakesh Pillai <[email protected]>

Add support to create the boardname for non-bmi targets like WCN3990, which uses qmi for bdf download. This boardname is used to parse the board data from board-2.bin.

---
 drivers/net/wireless/ath/ath10k/core.c | 14 ++++++++++++++
 drivers/net/wireless/ath/ath10k/core.h |  2 ++
 2 files changed, 16 insertions(+)
drivers/net/wireless/ath/ath10k/core.c +3 -0
index 4cf54a7ef09a..8a592019cc4d 100644
@@ -1429,6 +1429,20 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name,
 		goto out;
 	}
 
+	if (ar->id.qmi_ids_valid) {
+		if (ar->id.qmi_board_id > 0x99)
+			scnprintf(name, name_len,

drivers/net/wireless/ath/ath10k/core.c static int ath10k_core_create_board_name(struct ath10k *ar, char *name, · line 1444

Quoted 10 lines
drivers/net/wireless/ath/ath10k/core.c +10 -0
+				  "bus=%s,qmi-board-id=%03x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		else
+			scnprintf(name, name_len,
+				  "bus=%s,qmi-board-id=b%02x",
+				  ath10k_bus_str(ar->hif.bus),
+				  ar->id.qmi_board_id);
+		goto out;
+	}

Why not just use %d? What benefit would hexadecimal format bring?

And why %02 and %03? I don't see the need for that.

Signature · 1 line
Kalle Valo