aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-05-26 05:46:02 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2014-05-27 05:27:24 -0400
commitae254433a8dfaaf7983b39d87ce695a616d36163 (patch)
tree16ba06247f18db634d47b45cd47843ecfdb43e5d /drivers/net/wireless/ath
parent6782cb696ddecdd20f22a06dd228ea8ad28a3f81 (diff)
ath10k: clean up start() callback
This fixes failpath when override AC pdev param setup fails and makes other pdev params setting fail as well. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath10k/mac.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 8f311b373859..b98f88746f15 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2404,22 +2404,19 @@ static int ath10k_start(struct ieee80211_hw *hw)
2404 if (ar->state != ATH10K_STATE_OFF && 2404 if (ar->state != ATH10K_STATE_OFF &&
2405 ar->state != ATH10K_STATE_RESTARTING) { 2405 ar->state != ATH10K_STATE_RESTARTING) {
2406 ret = -EINVAL; 2406 ret = -EINVAL;
2407 goto exit; 2407 goto err;
2408 } 2408 }
2409 2409
2410 ret = ath10k_hif_power_up(ar); 2410 ret = ath10k_hif_power_up(ar);
2411 if (ret) { 2411 if (ret) {
2412 ath10k_err("Could not init hif: %d\n", ret); 2412 ath10k_err("Could not init hif: %d\n", ret);
2413 ar->state = ATH10K_STATE_OFF; 2413 goto err_off;
2414 goto exit;
2415 } 2414 }
2416 2415
2417 ret = ath10k_core_start(ar); 2416 ret = ath10k_core_start(ar);
2418 if (ret) { 2417 if (ret) {
2419 ath10k_err("Could not init core: %d\n", ret); 2418 ath10k_err("Could not init core: %d\n", ret);
2420 ath10k_hif_power_down(ar); 2419 goto err_power_down;
2421 ar->state = ATH10K_STATE_OFF;
2422 goto exit;
2423 } 2420 }
2424 2421
2425 if (ar->state == ATH10K_STATE_OFF) 2422 if (ar->state == ATH10K_STATE_OFF)
@@ -2428,12 +2425,16 @@ static int ath10k_start(struct ieee80211_hw *hw)
2428 ar->state = ATH10K_STATE_RESTARTED; 2425 ar->state = ATH10K_STATE_RESTARTED;
2429 2426
2430 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pmf_qos, 1); 2427 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->pmf_qos, 1);
2431 if (ret) 2428 if (ret) {
2432 ath10k_warn("failed to enable PMF QOS: %d\n", ret); 2429 ath10k_warn("failed to enable PMF QOS: %d\n", ret);
2430 goto err_core_stop;
2431 }
2433 2432
2434 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->dynamic_bw, 1); 2433 ret = ath10k_wmi_pdev_set_param(ar, ar->wmi.pdev_param->dynamic_bw, 1);
2435 if (ret) 2434 if (ret) {
2436 ath10k_warn("failed to enable dynamic BW: %d\n", ret); 2435 ath10k_warn("failed to enable dynamic BW: %d\n", ret);
2436 goto err_core_stop;
2437 }
2437 2438
2438 if (ar->cfg_tx_chainmask) 2439 if (ar->cfg_tx_chainmask)
2439 __ath10k_set_antenna(ar, ar->cfg_tx_chainmask, 2440 __ath10k_set_antenna(ar, ar->cfg_tx_chainmask,
@@ -2453,14 +2454,25 @@ static int ath10k_start(struct ieee80211_hw *hw)
2453 if (ret) { 2454 if (ret) {
2454 ath10k_warn("failed to set arp ac override parameter: %d\n", 2455 ath10k_warn("failed to set arp ac override parameter: %d\n",
2455 ret); 2456 ret);
2456 goto exit; 2457 goto err_core_stop;
2457 } 2458 }
2458 2459
2459 ar->num_started_vdevs = 0; 2460 ar->num_started_vdevs = 0;
2460 ath10k_regd_update(ar); 2461 ath10k_regd_update(ar);
2461 ret = 0;
2462 2462
2463exit: 2463 mutex_unlock(&ar->conf_mutex);
2464 return 0;
2465
2466err_core_stop:
2467 ath10k_core_stop(ar);
2468
2469err_power_down:
2470 ath10k_hif_power_down(ar);
2471
2472err_off:
2473 ar->state = ATH10K_STATE_OFF;
2474
2475err:
2464 mutex_unlock(&ar->conf_mutex); 2476 mutex_unlock(&ar->conf_mutex);
2465 return ret; 2477 return ret;
2466} 2478}