ath10k: fix HTT op backwards compatibility for QCA6174
authorKalle Valo <kvalo@qca.qualcomm.com>
Mon, 30 Mar 2015 11:14:28 +0000 (14:14 +0300)
committerKalle Valo <kvalo@qca.qualcomm.com>
Mon, 30 Mar 2015 11:56:06 +0000 (14:56 +0300)
Commit 8348db298496 ("ath10k: add ATH10K_FW_IE_HTT_OP_VERSION") broke QCA6174
receive side as the HTT ids from ATH10K_FW_HTT_OP_VERSION_MAIN don't have
HTT_TLV_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND set. Fix this by adding a backwards
compatibility code which sets HTT op version if it's not set by the firmware
image.

Fixes: 8348db298496 ("ath10k: add ATH10K_FW_IE_HTT_OP_VERSION")
Reported-by: Michal Kazior <michal.kazior@tieto.com>
Tested-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.c
drivers/net/wireless/ath/ath10k/htt.c

index 1c74585d9256b062bb6c25bb7cae006b70522d68..47f7e7116448f8d5ff5cfecb9d2c2cc9ee5f5210 100644 (file)
@@ -998,6 +998,29 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
                return -EINVAL;
        }
 
+       /* Backwards compatibility for firmwares without
+        * ATH10K_FW_IE_HTT_OP_VERSION.
+        */
+       if (ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_UNSET) {
+               switch (ar->wmi.op_version) {
+               case ATH10K_FW_WMI_OP_VERSION_MAIN:
+                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_MAIN;
+                       break;
+               case ATH10K_FW_WMI_OP_VERSION_10_1:
+               case ATH10K_FW_WMI_OP_VERSION_10_2:
+               case ATH10K_FW_WMI_OP_VERSION_10_2_4:
+                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_10_1;
+                       break;
+               case ATH10K_FW_WMI_OP_VERSION_TLV:
+                       ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_TLV;
+                       break;
+               case ATH10K_FW_WMI_OP_VERSION_UNSET:
+               case ATH10K_FW_WMI_OP_VERSION_MAX:
+                       WARN_ON(1);
+                       return -EINVAL;
+               }
+       }
+
        return 0;
 }
 
index f782d76c38868dd9c96e0dc1f6e21bee080aa921..6da6ef26143af0caeac2ed8ed76b14f28319b471 100644 (file)
@@ -156,11 +156,11 @@ int ath10k_htt_init(struct ath10k *ar)
                ar->htt.t2h_msg_types_max = HTT_TLV_T2H_NUM_MSGS;
                break;
        case ATH10K_FW_HTT_OP_VERSION_MAIN:
-       case ATH10K_FW_HTT_OP_VERSION_UNSET:
                ar->htt.t2h_msg_types = htt_main_t2h_msg_types;
                ar->htt.t2h_msg_types_max = HTT_MAIN_T2H_NUM_MSGS;
                break;
        case ATH10K_FW_HTT_OP_VERSION_MAX:
+       case ATH10K_FW_HTT_OP_VERSION_UNSET:
                WARN_ON(1);
                return -EINVAL;
        }