aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2016-04-20 12:45:33 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2016-04-20 13:00:26 -0400
commitbf3c13ab49965f0517b579dc490d612d074d535a (patch)
tree082efc25dcef6ce623b7fd6c4aa20e8f817f3c59 /drivers/net
parentc4cdf753ed4287467248126a4fac072fbba53b31 (diff)
ath10k: move wmi_op_version to struct ath10k_fw_file
Preparation for testmode.c to use ath10k_core_fetch_board_data_api_n(). Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c20
-rw-r--r--drivers/net/wireless/ath/ath10k/core.h5
-rw-r--r--drivers/net/wireless/ath/ath10k/debug.c2
-rw-r--r--drivers/net/wireless/ath/ath10k/mac.c2
-rw-r--r--drivers/net/wireless/ath/ath10k/testmode.c17
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.c4
6 files changed, 22 insertions, 28 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 71b8ca71d1da..a7c99355a7c2 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -1106,10 +1106,10 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name,
1106 1106
1107 version = (__le32 *)data; 1107 version = (__le32 *)data;
1108 1108
1109 ar->wmi.op_version = le32_to_cpup(version); 1109 fw_file->wmi_op_version = le32_to_cpup(version);
1110 1110
1111 ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie wmi op version %d\n", 1111 ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie wmi op version %d\n",
1112 ar->wmi.op_version); 1112 fw_file->wmi_op_version);
1113 break; 1113 break;
1114 case ATH10K_FW_IE_HTT_OP_VERSION: 1114 case ATH10K_FW_IE_HTT_OP_VERSION:
1115 if (ie_len != sizeof(u32)) 1115 if (ie_len != sizeof(u32))
@@ -1438,9 +1438,9 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
1438 return -EINVAL; 1438 return -EINVAL;
1439 } 1439 }
1440 1440
1441 if (ar->wmi.op_version >= ATH10K_FW_WMI_OP_VERSION_MAX) { 1441 if (fw_file->wmi_op_version >= ATH10K_FW_WMI_OP_VERSION_MAX) {
1442 ath10k_err(ar, "unsupported WMI OP version (max %d): %d\n", 1442 ath10k_err(ar, "unsupported WMI OP version (max %d): %d\n",
1443 ATH10K_FW_WMI_OP_VERSION_MAX, ar->wmi.op_version); 1443 ATH10K_FW_WMI_OP_VERSION_MAX, fw_file->wmi_op_version);
1444 return -EINVAL; 1444 return -EINVAL;
1445 } 1445 }
1446 1446
@@ -1496,19 +1496,19 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
1496 /* Backwards compatibility for firmwares without 1496 /* Backwards compatibility for firmwares without
1497 * ATH10K_FW_IE_WMI_OP_VERSION. 1497 * ATH10K_FW_IE_WMI_OP_VERSION.
1498 */ 1498 */
1499 if (ar->wmi.op_version == ATH10K_FW_WMI_OP_VERSION_UNSET) { 1499 if (fw_file->wmi_op_version == ATH10K_FW_WMI_OP_VERSION_UNSET) {
1500 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) { 1500 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, fw_file->fw_features)) {
1501 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, 1501 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2,
1502 fw_file->fw_features)) 1502 fw_file->fw_features))
1503 ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_2; 1503 fw_file->wmi_op_version = ATH10K_FW_WMI_OP_VERSION_10_2;
1504 else 1504 else
1505 ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_10_1; 1505 fw_file->wmi_op_version = ATH10K_FW_WMI_OP_VERSION_10_1;
1506 } else { 1506 } else {
1507 ar->wmi.op_version = ATH10K_FW_WMI_OP_VERSION_MAIN; 1507 fw_file->wmi_op_version = ATH10K_FW_WMI_OP_VERSION_MAIN;
1508 } 1508 }
1509 } 1509 }
1510 1510
1511 switch (ar->wmi.op_version) { 1511 switch (fw_file->wmi_op_version) {
1512 case ATH10K_FW_WMI_OP_VERSION_MAIN: 1512 case ATH10K_FW_WMI_OP_VERSION_MAIN:
1513 ar->max_num_peers = TARGET_NUM_PEERS; 1513 ar->max_num_peers = TARGET_NUM_PEERS;
1514 ar->max_num_stations = TARGET_NUM_STATIONS; 1514 ar->max_num_stations = TARGET_NUM_STATIONS;
@@ -1570,7 +1570,7 @@ static int ath10k_core_init_firmware_features(struct ath10k *ar)
1570 * ATH10K_FW_IE_HTT_OP_VERSION. 1570 * ATH10K_FW_IE_HTT_OP_VERSION.
1571 */ 1571 */
1572 if (ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_UNSET) { 1572 if (ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_UNSET) {
1573 switch (ar->wmi.op_version) { 1573 switch (fw_file->wmi_op_version) {
1574 case ATH10K_FW_WMI_OP_VERSION_MAIN: 1574 case ATH10K_FW_WMI_OP_VERSION_MAIN:
1575 ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_MAIN; 1575 ar->htt.op_version = ATH10K_FW_HTT_OP_VERSION_MAIN;
1576 break; 1576 break;
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 18e21b4fe034..7d709f848fac 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -139,7 +139,6 @@ struct ath10k_mem_chunk {
139}; 139};
140 140
141struct ath10k_wmi { 141struct ath10k_wmi {
142 enum ath10k_fw_wmi_op_version op_version;
143 enum ath10k_htc_ep_id eid; 142 enum ath10k_htc_ep_id eid;
144 struct completion service_ready; 143 struct completion service_ready;
145 struct completion unified_ready; 144 struct completion unified_ready;
@@ -634,6 +633,8 @@ struct ath10k_fw_file {
634 633
635 DECLARE_BITMAP(fw_features, ATH10K_FW_FEATURE_COUNT); 634 DECLARE_BITMAP(fw_features, ATH10K_FW_FEATURE_COUNT);
636 635
636 enum ath10k_fw_wmi_op_version wmi_op_version;
637
637 const void *firmware_data; 638 const void *firmware_data;
638 size_t firmware_len; 639 size_t firmware_len;
639 640
@@ -895,8 +896,6 @@ struct ath10k {
895 struct { 896 struct {
896 /* protected by conf_mutex */ 897 /* protected by conf_mutex */
897 struct ath10k_fw_components utf_mode_fw; 898 struct ath10k_fw_components utf_mode_fw;
898 enum ath10k_fw_wmi_op_version orig_wmi_op_version;
899 enum ath10k_fw_wmi_op_version op_version;
900 899
901 /* protected by data_lock */ 900 /* protected by data_lock */
902 bool utf_monitor; 901 bool utf_monitor;
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 27787d23b2bd..8a63ce5c6e09 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -178,7 +178,7 @@ void ath10k_debug_print_boot_info(struct ath10k *ar)
178 ath10k_info(ar, "htt-ver %d.%d wmi-op %d htt-op %d cal %s max-sta %d raw %d hwcrypto %d\n", 178 ath10k_info(ar, "htt-ver %d.%d wmi-op %d htt-op %d cal %s max-sta %d raw %d hwcrypto %d\n",
179 ar->htt.target_version_major, 179 ar->htt.target_version_major,
180 ar->htt.target_version_minor, 180 ar->htt.target_version_minor,
181 ar->wmi.op_version, 181 ar->normal_mode_fw.fw_file.wmi_op_version,
182 ar->htt.op_version, 182 ar->htt.op_version,
183 ath10k_cal_mode_str(ar->cal_mode), 183 ath10k_cal_mode_str(ar->cal_mode),
184 ar->max_num_stations, 184 ar->max_num_stations,
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 0fd0fc111c40..5fb912acc0a8 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -7786,7 +7786,7 @@ int ath10k_mac_register(struct ath10k *ar)
7786 */ 7786 */
7787 ar->hw->offchannel_tx_hw_queue = IEEE80211_MAX_QUEUES - 1; 7787 ar->hw->offchannel_tx_hw_queue = IEEE80211_MAX_QUEUES - 1;
7788 7788
7789 switch (ar->wmi.op_version) { 7789 switch (ar->running_fw->fw_file.wmi_op_version) {
7790 case ATH10K_FW_WMI_OP_VERSION_MAIN: 7790 case ATH10K_FW_WMI_OP_VERSION_MAIN:
7791 ar->hw->wiphy->iface_combinations = ath10k_if_comb; 7791 ar->hw->wiphy->iface_combinations = ath10k_if_comb;
7792 ar->hw->wiphy->n_iface_combinations = 7792 ar->hw->wiphy->n_iface_combinations =
diff --git a/drivers/net/wireless/ath/ath10k/testmode.c b/drivers/net/wireless/ath/ath10k/testmode.c
index 102539409f54..3d4418969697 100644
--- a/drivers/net/wireless/ath/ath10k/testmode.c
+++ b/drivers/net/wireless/ath/ath10k/testmode.c
@@ -230,9 +230,9 @@ static int ath10k_tm_fetch_utf_firmware_api_2(struct ath10k *ar,
230 if (ie_len != sizeof(u32)) 230 if (ie_len != sizeof(u32))
231 break; 231 break;
232 version = (__le32 *)data; 232 version = (__le32 *)data;
233 ar->testmode.op_version = le32_to_cpup(version); 233 fw_file->wmi_op_version = le32_to_cpup(version);
234 ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode found fw ie wmi op version %d\n", 234 ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode found fw ie wmi op version %d\n",
235 ar->testmode.op_version); 235 fw_file->wmi_op_version);
236 break; 236 break;
237 default: 237 default:
238 ath10k_warn(ar, "Unknown testmode FW IE: %u\n", 238 ath10k_warn(ar, "Unknown testmode FW IE: %u\n",
@@ -283,7 +283,7 @@ static int ath10k_tm_fetch_utf_firmware_api_1(struct ath10k *ar,
283 * correct WMI interface. 283 * correct WMI interface.
284 */ 284 */
285 285
286 ar->testmode.op_version = ATH10K_FW_WMI_OP_VERSION_10_1; 286 fw_file->wmi_op_version = ATH10K_FW_WMI_OP_VERSION_10_1;
287 fw_file->firmware_data = fw_file->firmware->data; 287 fw_file->firmware_data = fw_file->firmware->data;
288 fw_file->firmware_len = fw_file->firmware->size; 288 fw_file->firmware_len = fw_file->firmware->size;
289 289
@@ -363,17 +363,14 @@ static int ath10k_tm_cmd_utf_start(struct ath10k *ar, struct nlattr *tb[])
363 ar->testmode.utf_monitor = true; 363 ar->testmode.utf_monitor = true;
364 spin_unlock_bh(&ar->data_lock); 364 spin_unlock_bh(&ar->data_lock);
365 365
366 ar->testmode.orig_wmi_op_version = ar->wmi.op_version;
367 ar->wmi.op_version = ar->testmode.op_version;
368
369 ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode wmi version %d\n", 366 ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode wmi version %d\n",
370 ar->wmi.op_version); 367 ar->testmode.utf_mode_fw.fw_file.wmi_op_version);
371 368
372 ret = ath10k_hif_power_up(ar); 369 ret = ath10k_hif_power_up(ar);
373 if (ret) { 370 if (ret) {
374 ath10k_err(ar, "failed to power up hif (testmode): %d\n", ret); 371 ath10k_err(ar, "failed to power up hif (testmode): %d\n", ret);
375 ar->state = ATH10K_STATE_OFF; 372 ar->state = ATH10K_STATE_OFF;
376 goto err_fw_features; 373 goto err_release_utf_mode_fw;
377 } 374 }
378 375
379 ret = ath10k_core_start(ar, ATH10K_FIRMWARE_MODE_UTF, 376 ret = ath10k_core_start(ar, ATH10K_FIRMWARE_MODE_UTF,
@@ -400,9 +397,7 @@ static int ath10k_tm_cmd_utf_start(struct ath10k *ar, struct nlattr *tb[])
400err_power_down: 397err_power_down:
401 ath10k_hif_power_down(ar); 398 ath10k_hif_power_down(ar);
402 399
403err_fw_features: 400err_release_utf_mode_fw:
404 ar->wmi.op_version = ar->testmode.orig_wmi_op_version;
405
406 release_firmware(ar->testmode.utf_mode_fw.fw_file.firmware); 401 release_firmware(ar->testmode.utf_mode_fw.fw_file.firmware);
407 ar->testmode.utf_mode_fw.fw_file.firmware = NULL; 402 ar->testmode.utf_mode_fw.fw_file.firmware = NULL;
408 403
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index d5279ce32974..a1afb2e2b05a 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -7865,7 +7865,7 @@ static const struct wmi_ops wmi_10_4_ops = {
7865 7865
7866int ath10k_wmi_attach(struct ath10k *ar) 7866int ath10k_wmi_attach(struct ath10k *ar)
7867{ 7867{
7868 switch (ar->wmi.op_version) { 7868 switch (ar->running_fw->fw_file.wmi_op_version) {
7869 case ATH10K_FW_WMI_OP_VERSION_10_4: 7869 case ATH10K_FW_WMI_OP_VERSION_10_4:
7870 ar->wmi.ops = &wmi_10_4_ops; 7870 ar->wmi.ops = &wmi_10_4_ops;
7871 ar->wmi.cmd = &wmi_10_4_cmd_map; 7871 ar->wmi.cmd = &wmi_10_4_cmd_map;
@@ -7907,7 +7907,7 @@ int ath10k_wmi_attach(struct ath10k *ar)
7907 case ATH10K_FW_WMI_OP_VERSION_UNSET: 7907 case ATH10K_FW_WMI_OP_VERSION_UNSET:
7908 case ATH10K_FW_WMI_OP_VERSION_MAX: 7908 case ATH10K_FW_WMI_OP_VERSION_MAX:
7909 ath10k_err(ar, "unsupported WMI op version: %d\n", 7909 ath10k_err(ar, "unsupported WMI op version: %d\n",
7910 ar->wmi.op_version); 7910 ar->running_fw->fw_file.wmi_op_version);
7911 return -EINVAL; 7911 return -EINVAL;
7912 } 7912 }
7913 7913