aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2013-07-16 03:38:51 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2013-07-30 11:01:18 -0400
commitdd30a36e11a1315751c668832cbaa2c42f9e9002 (patch)
tree2860587a25ad2bc0930061d12a1331ccb0cf2f21 /drivers/net
parent8c5c53682f0da87b91ff87d060a5d92df524c13d (diff)
ath10k: decouple core start/stop logic
Enables code reuse for proper hw reconfiguration that is in turn required for proper suspend/hibernation/wowlan support. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/ath/ath10k/core.c44
-rw-r--r--drivers/net/wireless/ath/ath10k/core.h2
2 files changed, 34 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index f1312fae8056..dcddae4d5d90 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -502,8 +502,7 @@ void ath10k_core_destroy(struct ath10k *ar)
502} 502}
503EXPORT_SYMBOL(ath10k_core_destroy); 503EXPORT_SYMBOL(ath10k_core_destroy);
504 504
505 505int ath10k_core_start(struct ath10k *ar)
506int ath10k_core_register(struct ath10k *ar)
507{ 506{
508 struct bmi_target_info target_info; 507 struct bmi_target_info target_info;
509 int status; 508 int status;
@@ -589,9 +588,36 @@ int ath10k_core_register(struct ath10k *ar)
589 if (status) 588 if (status)
590 goto err_disconnect_htc; 589 goto err_disconnect_htc;
591 590
591 return 0;
592
593err_disconnect_htc:
594 ath10k_htc_stop(&ar->htc);
595err_htt_detach:
596 ath10k_htt_detach(&ar->htt);
597err_wmi_detach:
598 ath10k_wmi_detach(ar);
599err:
600 return status;
601}
602
603void ath10k_core_stop(struct ath10k *ar)
604{
605 ath10k_htc_stop(&ar->htc);
606 ath10k_htt_detach(&ar->htt);
607 ath10k_wmi_detach(ar);
608}
609
610int ath10k_core_register(struct ath10k *ar)
611{
612 int status;
613
614 status = ath10k_core_start(ar);
615 if (status)
616 goto err;
617
592 status = ath10k_mac_register(ar); 618 status = ath10k_mac_register(ar);
593 if (status) 619 if (status)
594 goto err_disconnect_htc; 620 goto err_core_stop;
595 621
596 status = ath10k_debug_create(ar); 622 status = ath10k_debug_create(ar);
597 if (status) { 623 if (status) {
@@ -603,12 +629,8 @@ int ath10k_core_register(struct ath10k *ar)
603 629
604err_unregister_mac: 630err_unregister_mac:
605 ath10k_mac_unregister(ar); 631 ath10k_mac_unregister(ar);
606err_disconnect_htc: 632err_core_stop:
607 ath10k_htc_stop(&ar->htc); 633 ath10k_core_stop(ar);
608err_htt_detach:
609 ath10k_htt_detach(&ar->htt);
610err_wmi_detach:
611 ath10k_wmi_detach(ar);
612err: 634err:
613 return status; 635 return status;
614} 636}
@@ -620,9 +642,7 @@ void ath10k_core_unregister(struct ath10k *ar)
620 * Otherwise we will fail to submit commands to FW and mac80211 will be 642 * Otherwise we will fail to submit commands to FW and mac80211 will be
621 * unhappy about callback failures. */ 643 * unhappy about callback failures. */
622 ath10k_mac_unregister(ar); 644 ath10k_mac_unregister(ar);
623 ath10k_htc_stop(&ar->htc); 645 ath10k_core_stop(ar);
624 ath10k_htt_detach(&ar->htt);
625 ath10k_wmi_detach(ar);
626} 646}
627EXPORT_SYMBOL(ath10k_core_unregister); 647EXPORT_SYMBOL(ath10k_core_unregister);
628 648
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index 2f7065c48f57..5a0b2cef7d90 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -353,6 +353,8 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
353 const struct ath10k_hif_ops *hif_ops); 353 const struct ath10k_hif_ops *hif_ops);
354void ath10k_core_destroy(struct ath10k *ar); 354void ath10k_core_destroy(struct ath10k *ar);
355 355
356int ath10k_core_start(struct ath10k *ar);
357void ath10k_core_stop(struct ath10k *ar);
356int ath10k_core_register(struct ath10k *ar); 358int ath10k_core_register(struct ath10k *ar);
357void ath10k_core_unregister(struct ath10k *ar); 359void ath10k_core_unregister(struct ath10k *ar);
358 360