ath10k: correct the tlv len of ath10k_wmi_tlv_op_gen_config_pno_start
the tlv len is set to the total len of the wmi cmd, it will trigger
firmware crash, correct the tlv len.
Tested with QCA6174 SDIO with firmware
WLAN.RMH.4.4.1-00017-QCARMSWP-1 and QCA6174
PCIE with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.
Fixes: ce834e280f
("ath10k: support NET_DETECT WoWLAN feature")
Signed-off-by: Wen Gong <wgong@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
@@ -3707,6 +3707,7 @@ ath10k_wmi_tlv_op_gen_config_pno_start(struct ath10k *ar,
|
|||||||
struct wmi_tlv *tlv;
|
struct wmi_tlv *tlv;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
__le32 *channel_list;
|
__le32 *channel_list;
|
||||||
|
u16 tlv_len;
|
||||||
size_t len;
|
size_t len;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
u32 i;
|
u32 i;
|
||||||
@@ -3764,10 +3765,12 @@ ath10k_wmi_tlv_op_gen_config_pno_start(struct ath10k *ar,
|
|||||||
/* nlo_configured_parameters(nlo_list) */
|
/* nlo_configured_parameters(nlo_list) */
|
||||||
cmd->no_of_ssids = __cpu_to_le32(min_t(u8, pno->uc_networks_count,
|
cmd->no_of_ssids = __cpu_to_le32(min_t(u8, pno->uc_networks_count,
|
||||||
WMI_NLO_MAX_SSIDS));
|
WMI_NLO_MAX_SSIDS));
|
||||||
|
tlv_len = __le32_to_cpu(cmd->no_of_ssids) *
|
||||||
|
sizeof(struct nlo_configured_parameters);
|
||||||
|
|
||||||
tlv = ptr;
|
tlv = ptr;
|
||||||
tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_STRUCT);
|
tlv->tag = __cpu_to_le16(WMI_TLV_TAG_ARRAY_STRUCT);
|
||||||
tlv->len = __cpu_to_le16(len);
|
tlv->len = __cpu_to_le16(tlv_len);
|
||||||
|
|
||||||
ptr += sizeof(*tlv);
|
ptr += sizeof(*tlv);
|
||||||
nlo_list = ptr;
|
nlo_list = ptr;
|
||||||
|
Reference in New Issue
Block a user