ipq50xx: update the ath11k-macs patch

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2023-11-16 09:05:59 +01:00
parent b4faeefc29
commit dfbbb01ea9

View File

@@ -2,11 +2,22 @@ Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/q
===================================================================
--- backports-20210222_001-4.4.60-b157d2276.orig/drivers/net/wireless/ath/ath11k/qmi.c
+++ backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/qmi.c
@@ -3161,6 +3161,12 @@ out_req:
@@ -3161,6 +3161,23 @@ out_req:
return ret;
}
+static const struct firmware *fw_macs;
+static int fw_macs_num = 0;
+
+int ath11k_get_custom_macs_num(int num)
+{
+ int ret = fw_macs_num;
+
+ fw_macs_num += num;
+
+ return ret;
+}
+
+const struct firmware* ath11k_get_custom_macs(void)
+{
+ return fw_macs;
@@ -15,7 +26,7 @@ Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/q
static int ath11k_qmi_load_bdf_qmi(struct ath11k_base *ab)
{
char filename[ATH11K_QMI_MAX_BDF_FILE_NAME_SIZE];
@@ -3188,6 +3194,8 @@ static int ath11k_qmi_load_bdf_qmi(struc
@@ -3188,6 +3205,8 @@ static int ath11k_qmi_load_bdf_qmi(struc
goto out;
}
@@ -36,11 +47,12 @@ Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/w
struct wmi_tlv_policy {
size_t min_len;
@@ -7278,11 +7279,14 @@ mem_free:
@@ -7268,11 +7269,15 @@ mem_free:
return ret;
}
+const struct firmware* ath11k_get_custom_macs(void);
+int ath11k_get_custom_macs_num(int num);
+
static int ath11k_wmi_tlv_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len,
const void *ptr, void *data)
@@ -51,17 +63,18 @@ Index: backports-20210222_001-4.4.60-b157d2276/drivers/net/wireless/ath/ath11k/w
struct wmi_mac_addr *addr_list;
struct ath11k_pdev *pdev;
u32 num_mac_addr;
@@ -7307,6 +7311,19 @@ static int ath11k_wmi_tlv_rdy_parse(stru
@@ -7297,6 +7302,20 @@ static int ath11k_wmi_tlv_rdy_parse(stru
addr_list = (struct wmi_mac_addr *)ptr;
num_mac_addr = rdy_parse->num_extra_mac_addr;
+ fw_entry = ath11k_get_custom_macs();
+ if (fw_entry) {
+ int num = ath11k_get_custom_macs_num(ab->num_radios);
+ printk("applying ath11k-macs\n");
+ if (fw_entry->size >= (ab->num_radios * 6)) {
+ if (fw_entry->size >= ((num + ab->num_radios) * 6)) {
+ for (i = 0; i < ab->num_radios; i++) {
+ pdev = &ab->pdevs[i];
+ ether_addr_copy(pdev->mac_addr, &fw_entry->data[i * 6]);
+ ether_addr_copy(pdev->mac_addr, &fw_entry->data[(num + i) * 6]);
+ }
+ }
+ ab->pdevs_macaddr_valid = true;