ath10k: change the fw stats access mask
authorYanbo Li <yanbol@qca.qualcomm.com>
Wed, 1 Apr 2015 19:53:21 +0000 (22:53 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Thu, 9 Apr 2015 12:06:36 +0000 (15:06 +0300)
This fix the regerssion introduced after "ath10k_wmi_requests_stats()
call to use more stat bits", both the 10.2.X FW and community FW 10.1.X
will return time out when access the fw_stats with the STAT_VDEV and
STAT_PDEV. Add the condition to use different fw_stats mask for different
FW versions.

Fixes: 7777d8c7ef6f ("ath10k: implement fw stats for wmi-tlv")
Signed-off-by: Yanbo Li <yanbol@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/debug.c

index 1961e42f715769bd9852cb10312ce0abf0d1e078..2d64926c8228fb0fa2e4ee21a80c9161ba1322f6 100644 (file)
@@ -976,6 +976,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                ar->max_num_stations = TARGET_NUM_STATIONS;
                ar->max_num_vdevs = TARGET_NUM_VDEVS;
                ar->htt.max_num_pending_tx = TARGET_NUM_MSDU_DESC;
+               ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
+                       WMI_STAT_PEER;
                break;
        case ATH10K_FW_WMI_OP_VERSION_10_1:
        case ATH10K_FW_WMI_OP_VERSION_10_2:
@@ -984,6 +986,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                ar->max_num_stations = TARGET_10X_NUM_STATIONS;
                ar->max_num_vdevs = TARGET_10X_NUM_VDEVS;
                ar->htt.max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC;
+               ar->fw_stats_req_mask = WMI_STAT_PEER;
                break;
        case ATH10K_FW_WMI_OP_VERSION_TLV:
                ar->max_num_peers = TARGET_TLV_NUM_PEERS;
@@ -992,6 +995,8 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                ar->max_num_tdls_vdevs = TARGET_TLV_NUM_TDLS_VDEVS;
                ar->htt.max_num_pending_tx = TARGET_TLV_NUM_MSDU_DESC;
                ar->wow.max_num_patterns = TARGET_TLV_NUM_WOW_PATTERNS;
+               ar->fw_stats_req_mask = WMI_STAT_PDEV | WMI_STAT_VDEV |
+                       WMI_STAT_PEER;
                break;
        case ATH10K_FW_WMI_OP_VERSION_UNSET:
        case ATH10K_FW_WMI_OP_VERSION_MAX:
index 30f6ade6ade84696df1634e340462be52e99c40a..b0e8905ca325d191bb9662daedbc0ea52307846a 100644 (file)
@@ -535,6 +535,7 @@ struct ath10k {
        u32 fw_version_minor;
        u16 fw_version_release;
        u16 fw_version_build;
+       u32 fw_stats_req_mask;
        u32 phy_capability;
        u32 hw_min_tx_power;
        u32 hw_max_tx_power;
index b0f87c3eda6389447fea503152a35df2728cb85e..1391f00f2b8f32cd6b7eab99ea1cdb3292eb35cf 100644 (file)
@@ -395,10 +395,7 @@ static int ath10k_debug_fw_stats_request(struct ath10k *ar)
 
                reinit_completion(&ar->debug.fw_stats_complete);
 
-               ret = ath10k_wmi_request_stats(ar,
-                                              WMI_STAT_PDEV |
-                                              WMI_STAT_VDEV |
-                                              WMI_STAT_PEER);
+               ret = ath10k_wmi_request_stats(ar, ar->fw_stats_req_mask);
                if (ret) {
                        ath10k_warn(ar, "could not request stats (%d)\n", ret);
                        return ret;