]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ath10k: fix channel info parsing for non tlv target
authorRakesh Pillai <pillair@codeaurora.org>
Fri, 8 Mar 2019 11:26:06 +0000 (16:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Oct 2019 11:14:11 +0000 (13:14 +0200)
commit 6be6c04bcc2e8770b8637632789ff15765124894 upstream.

The tlv targets such as WCN3990 send more data in the chan info event, which is
not sent by the non tlv targets. There is a minimum size check in the wmi event
for non-tlv targets and hence we cannot update the common channel info
structure as it was done in commit 13104929d2ec ("ath10k: fill the channel
survey results for WCN3990 correctly"). This broke channel survey results on
10.x firmware versions.

If the common channel info structure is updated, the size check for chan info
event for non-tlv targets will fail and return -EPROTO and we see the below
error messages

   ath10k_pci 0000:01:00.0: failed to parse chan info event: -71

Add tlv specific channel info structure and restore the original size of the
common channel info structure to mitigate this issue.

Tested HW: WCN3990
   QCA9887
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1
   10.2.4-1.0-00037

Fixes: 13104929d2ec ("ath10k: fill the channel survey results for WCN3990 correctly")
Cc: stable@vger.kernel.org # 5.0
Signed-off-by: Rakesh Pillai <pillair@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ath/ath10k/wmi-tlv.c
drivers/net/wireless/ath/ath10k/wmi-tlv.h
drivers/net/wireless/ath/ath10k/wmi.h

index 02709fc9903467044a0534ce23bd3737a870e2f7..9deca6d33ecd48421867f467cbc9b17cc040672d 100644 (file)
@@ -810,7 +810,7 @@ static int ath10k_wmi_tlv_op_pull_ch_info_ev(struct ath10k *ar,
                                             struct wmi_ch_info_ev_arg *arg)
 {
        const void **tb;
-       const struct wmi_chan_info_event *ev;
+       const struct wmi_tlv_chan_info_event *ev;
        int ret;
 
        tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
index 65e6aa520b069bd34c216f1dcd64333f8269ac46..4bdd65515ad47296a0c3f651ff0f983796e76338 100644 (file)
@@ -1607,6 +1607,22 @@ struct chan_info_params {
 
 #define WMI_TLV_FLAG_MGMT_BUNDLE_TX_COMPL      BIT(9)
 
+struct wmi_tlv_chan_info_event {
+       __le32 err_code;
+       __le32 freq;
+       __le32 cmd_flags;
+       __le32 noise_floor;
+       __le32 rx_clear_count;
+       __le32 cycle_count;
+       __le32 chan_tx_pwr_range;
+       __le32 chan_tx_pwr_tp;
+       __le32 rx_frame_count;
+       __le32 my_bss_rx_cycle_count;
+       __le32 rx_11b_mode_data_duration;
+       __le32 tx_frame_cnt;
+       __le32 mac_clk_mhz;
+} __packed;
+
 struct wmi_tlv_mgmt_tx_compl_ev {
        __le32 desc_id;
        __le32 status;
index 12f57f9adbba579135c8bf60e3853424c15a9bd6..aaa3f587fa249ae67506e63245b092ab7622786b 100644 (file)
@@ -6524,14 +6524,6 @@ struct wmi_chan_info_event {
        __le32 noise_floor;
        __le32 rx_clear_count;
        __le32 cycle_count;
-       __le32 chan_tx_pwr_range;
-       __le32 chan_tx_pwr_tp;
-       __le32 rx_frame_count;
-       __le32 my_bss_rx_cycle_count;
-       __le32 rx_11b_mode_data_duration;
-       __le32 tx_frame_cnt;
-       __le32 mac_clk_mhz;
-
 } __packed;
 
 struct wmi_10_4_chan_info_event {