Skip to content

Commit eceb024

Browse files
author
Kalle Valo
committed
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for v6.2. Major changes: ath10k * store WLAN firmware version in SMEM image table
2 parents 823092a + 7256f28 commit eceb024

File tree

14 files changed

+230
-181
lines changed

14 files changed

+230
-181
lines changed

drivers/net/wireless/ath/ath10k/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ config ATH10K_SNOC
4444
tristate "Qualcomm ath10k SNOC support"
4545
depends on ATH10K
4646
depends on ARCH_QCOM || COMPILE_TEST
47+
select QCOM_SMEM
4748
select QCOM_SCM
4849
select QCOM_QMI_HELPERS
4950
help

drivers/net/wireless/ath/ath10k/htt_rx.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ static void ath10k_process_rx(struct ath10k *ar, struct sk_buff *skb)
13791379
ath10k_get_tid(hdr, tid, sizeof(tid)),
13801380
is_multicast_ether_addr(ieee80211_get_DA(hdr)) ?
13811381
"mcast" : "ucast",
1382-
(__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4,
1382+
IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl)),
13831383
(status->encoding == RX_ENC_LEGACY) ? "legacy" : "",
13841384
(status->encoding == RX_ENC_HT) ? "ht" : "",
13851385
(status->encoding == RX_ENC_VHT) ? "vht" : "",
@@ -1844,15 +1844,14 @@ static void ath10k_htt_rx_h_csum_offload(struct ath10k_hw_params *hw,
18441844
}
18451845

18461846
static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb,
1847-
u16 offset,
18481847
enum htt_rx_mpdu_encrypt_type enctype)
18491848
{
18501849
struct ieee80211_hdr *hdr;
18511850
u64 pn = 0;
18521851
u8 *ehdr;
18531852

1854-
hdr = (struct ieee80211_hdr *)(skb->data + offset);
1855-
ehdr = skb->data + offset + ieee80211_hdrlen(hdr->frame_control);
1853+
hdr = (struct ieee80211_hdr *)skb->data;
1854+
ehdr = skb->data + ieee80211_hdrlen(hdr->frame_control);
18561855

18571856
if (enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) {
18581857
pn = ehdr[0];
@@ -1866,19 +1865,17 @@ static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb,
18661865
}
18671866

18681867
static bool ath10k_htt_rx_h_frag_multicast_check(struct ath10k *ar,
1869-
struct sk_buff *skb,
1870-
u16 offset)
1868+
struct sk_buff *skb)
18711869
{
18721870
struct ieee80211_hdr *hdr;
18731871

1874-
hdr = (struct ieee80211_hdr *)(skb->data + offset);
1872+
hdr = (struct ieee80211_hdr *)skb->data;
18751873
return !is_multicast_ether_addr(hdr->addr1);
18761874
}
18771875

18781876
static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
18791877
struct sk_buff *skb,
18801878
u16 peer_id,
1881-
u16 offset,
18821879
enum htt_rx_mpdu_encrypt_type enctype)
18831880
{
18841881
struct ath10k_peer *peer;
@@ -1893,16 +1890,16 @@ static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
18931890
return false;
18941891
}
18951892

1896-
hdr = (struct ieee80211_hdr *)(skb->data + offset);
1893+
hdr = (struct ieee80211_hdr *)skb->data;
18971894
if (ieee80211_is_data_qos(hdr->frame_control))
18981895
tid = ieee80211_get_tid(hdr);
18991896
else
19001897
tid = ATH10K_TXRX_NON_QOS_TID;
19011898

19021899
last_pn = &peer->frag_tids_last_pn[tid];
1903-
new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, offset, enctype);
1900+
new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, enctype);
19041901
frag_number = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
1905-
seq = (__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;
1902+
seq = IEEE80211_SEQ_TO_SN(__le16_to_cpu(hdr->seq_ctrl));
19061903

19071904
if (frag_number == 0) {
19081905
last_pn->pn48 = new_pn.pn48;
@@ -2059,13 +2056,11 @@ static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
20592056
frag_pn_check = ath10k_htt_rx_h_frag_pn_check(ar,
20602057
msdu,
20612058
peer_id,
2062-
0,
20632059
enctype);
20642060

20652061
if (frag)
20662062
multicast_check = ath10k_htt_rx_h_frag_multicast_check(ar,
2067-
msdu,
2068-
0);
2063+
msdu);
20692064

20702065
if (!frag_pn_check || !multicast_check) {
20712066
/* Discard the fragment with invalid PN or multicast DA
@@ -2824,7 +2819,7 @@ static bool ath10k_htt_rx_proc_rx_frag_ind_hl(struct ath10k_htt *htt,
28242819

28252820
hdr_space = ieee80211_hdrlen(hdr->frame_control);
28262821
sc = __le16_to_cpu(hdr->seq_ctrl);
2827-
seq = (sc & IEEE80211_SCTL_SEQ) >> 4;
2822+
seq = IEEE80211_SEQ_TO_SN(sc);
28282823
frag = sc & IEEE80211_SCTL_FRAG;
28292824

28302825
sec_index = MS(rx_desc_info, HTT_RX_DESC_HL_INFO_MCAST_BCAST) ?

drivers/net/wireless/ath/ath10k/pci.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,18 +3792,22 @@ static struct pci_driver ath10k_pci_driver = {
37923792

37933793
static int __init ath10k_pci_init(void)
37943794
{
3795-
int ret;
3795+
int ret1, ret2;
37963796

3797-
ret = pci_register_driver(&ath10k_pci_driver);
3798-
if (ret)
3797+
ret1 = pci_register_driver(&ath10k_pci_driver);
3798+
if (ret1)
37993799
printk(KERN_ERR "failed to register ath10k pci driver: %d\n",
3800-
ret);
3800+
ret1);
38013801

3802-
ret = ath10k_ahb_init();
3803-
if (ret)
3804-
printk(KERN_ERR "ahb init failed: %d\n", ret);
3802+
ret2 = ath10k_ahb_init();
3803+
if (ret2)
3804+
printk(KERN_ERR "ahb init failed: %d\n", ret2);
38053805

3806-
return ret;
3806+
if (ret1 && ret2)
3807+
return ret1;
3808+
3809+
/* registered to at least one bus */
3810+
return 0;
38073811
}
38083812
module_init(ath10k_pci_init);
38093813

drivers/net/wireless/ath/ath10k/qmi.c

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/net.h>
1515
#include <linux/platform_device.h>
1616
#include <linux/qcom_scm.h>
17+
#include <linux/soc/qcom/smem.h>
1718
#include <linux/string.h>
1819
#include <net/sock.h>
1920

@@ -22,6 +23,10 @@
2223

2324
#define ATH10K_QMI_CLIENT_ID 0x4b4e454c
2425
#define ATH10K_QMI_TIMEOUT 30
26+
#define SMEM_IMAGE_VERSION_TABLE 469
27+
#define SMEM_IMAGE_TABLE_CNSS_INDEX 13
28+
#define SMEM_IMAGE_VERSION_ENTRY_SIZE 128
29+
#define SMEM_IMAGE_VERSION_NAME_SIZE 75
2530

2631
static int ath10k_qmi_map_msa_permission(struct ath10k_qmi *qmi,
2732
struct ath10k_msa_mem_info *mem_info)
@@ -536,6 +541,33 @@ int ath10k_qmi_wlan_disable(struct ath10k *ar)
536541
return ath10k_qmi_mode_send_sync_msg(ar, QMI_WLFW_OFF_V01);
537542
}
538543

544+
static void ath10k_qmi_add_wlan_ver_smem(struct ath10k *ar, const char *fw_build_id)
545+
{
546+
u8 *table_ptr;
547+
size_t smem_item_size;
548+
const u32 smem_img_idx_wlan = SMEM_IMAGE_TABLE_CNSS_INDEX *
549+
SMEM_IMAGE_VERSION_ENTRY_SIZE;
550+
551+
table_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY,
552+
SMEM_IMAGE_VERSION_TABLE,
553+
&smem_item_size);
554+
555+
if (IS_ERR(table_ptr)) {
556+
ath10k_err(ar, "smem image version table not found\n");
557+
return;
558+
}
559+
560+
if (smem_img_idx_wlan + SMEM_IMAGE_VERSION_ENTRY_SIZE >
561+
smem_item_size) {
562+
ath10k_err(ar, "smem block size too small: %zu\n",
563+
smem_item_size);
564+
return;
565+
}
566+
567+
strscpy(table_ptr + smem_img_idx_wlan, fw_build_id,
568+
SMEM_IMAGE_VERSION_NAME_SIZE);
569+
}
570+
539571
static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi)
540572
{
541573
struct wlfw_cap_resp_msg_v01 *resp;
@@ -606,6 +638,9 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi)
606638
qmi->fw_version, qmi->fw_build_timestamp, qmi->fw_build_id);
607639
}
608640

641+
if (resp->fw_build_id_valid)
642+
ath10k_qmi_add_wlan_ver_smem(ar, qmi->fw_build_id);
643+
609644
kfree(resp);
610645
return 0;
611646

@@ -618,7 +653,7 @@ static int ath10k_qmi_host_cap_send_sync(struct ath10k_qmi *qmi)
618653
{
619654
struct wlfw_host_cap_resp_msg_v01 resp = {};
620655
struct wlfw_host_cap_req_msg_v01 req = {};
621-
struct qmi_elem_info *req_ei;
656+
const struct qmi_elem_info *req_ei;
622657
struct ath10k *ar = qmi->ar;
623658
struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);
624659
struct qmi_txn txn;

0 commit comments

Comments
 (0)