]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: ath11k: Include STA_KEEPALIVE_ARP_RESPONSE TLV header by default
authorBaochen Qiang <quic_bqiang@quicinc.com>
Tue, 13 Sep 2022 04:43:58 +0000 (12:43 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Oct 2022 10:38:11 +0000 (12:38 +0200)
[ Upstream commit b7b6f86149a7e06269d61a7a5206360f5b642f80 ]

In current code STA_KEEPALIVE_ARP_RESPONSE TLV header is included only
when ARP method is used, this causes firmware always to crash when wowlan
is enabled because firmware needs it to be present no matter ARP method
is used or not.

Fix this issue by including STA_KEEPALIVE_ARP_RESPONSE TLV header by
default.

Also fix below typo:
  s/WMI_TAG_STA_KEEPALVE_ARP_RESPONSE/WMI_TAG_STA_KEEPALIVE_ARP_RESPONSE/

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3

Fixes: 0f84a156aa3b ("ath11k: Handle keepalive during WoWLAN suspend and resume")
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20220913044358.2037-1-quic_bqiang@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/wmi.c
drivers/net/wireless/ath/ath11k/wmi.h

index 88ee4f9d19da589c12d970b10b3b1e4c942ca5af..b658ea60dcf7d1ccf45622b32eab4e4d78673df2 100644 (file)
@@ -8962,12 +8962,13 @@ int ath11k_wmi_sta_keepalive(struct ath11k *ar,
        cmd->interval = arg->interval;
        cmd->method = arg->method;
 
+       arp = (struct wmi_sta_keepalive_arp_resp *)(cmd + 1);
+       arp->tlv_header = FIELD_PREP(WMI_TLV_TAG,
+                                    WMI_TAG_STA_KEEPALIVE_ARP_RESPONSE) |
+                        FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE);
+
        if (arg->method == WMI_STA_KEEPALIVE_METHOD_UNSOLICITED_ARP_RESPONSE ||
            arg->method == WMI_STA_KEEPALIVE_METHOD_GRATUITOUS_ARP_REQUEST) {
-               arp = (struct wmi_sta_keepalive_arp_resp *)(cmd + 1);
-               arp->tlv_header = FIELD_PREP(WMI_TLV_TAG,
-                                            WMI_TAG_STA_KEEPALVE_ARP_RESPONSE) |
-                                FIELD_PREP(WMI_TLV_LEN, sizeof(*arp) - TLV_HDR_SIZE);
                arp->src_ip4_addr = arg->src_ip4_addr;
                arp->dest_ip4_addr = arg->dest_ip4_addr;
                ether_addr_copy(arp->dest_mac_addr.addr, arg->dest_mac_addr);
index 4da248ffa3186e29b1c58773cfdc536701a4039e..ba5343a3411fa17acf56fae7226960666e129723 100644 (file)
@@ -1214,7 +1214,7 @@ enum wmi_tlv_tag {
        WMI_TAG_NS_OFFLOAD_TUPLE,
        WMI_TAG_FTM_INTG_CMD,
        WMI_TAG_STA_KEEPALIVE_CMD,
-       WMI_TAG_STA_KEEPALVE_ARP_RESPONSE,
+       WMI_TAG_STA_KEEPALIVE_ARP_RESPONSE,
        WMI_TAG_P2P_SET_VENDOR_IE_DATA_CMD,
        WMI_TAG_AP_PS_PEER_CMD,
        WMI_TAG_PEER_RATE_RETRY_SCHED_CMD,