Commit dd30a36e authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo

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: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 8c5c5368
...@@ -502,8 +502,7 @@ void ath10k_core_destroy(struct ath10k *ar) ...@@ -502,8 +502,7 @@ void ath10k_core_destroy(struct ath10k *ar)
} }
EXPORT_SYMBOL(ath10k_core_destroy); EXPORT_SYMBOL(ath10k_core_destroy);
int ath10k_core_start(struct ath10k *ar)
int ath10k_core_register(struct ath10k *ar)
{ {
struct bmi_target_info target_info; struct bmi_target_info target_info;
int status; int status;
...@@ -589,9 +588,36 @@ int ath10k_core_register(struct ath10k *ar) ...@@ -589,9 +588,36 @@ int ath10k_core_register(struct ath10k *ar)
if (status) if (status)
goto err_disconnect_htc; goto err_disconnect_htc;
return 0;
err_disconnect_htc:
ath10k_htc_stop(&ar->htc);
err_htt_detach:
ath10k_htt_detach(&ar->htt);
err_wmi_detach:
ath10k_wmi_detach(ar);
err:
return status;
}
void ath10k_core_stop(struct ath10k *ar)
{
ath10k_htc_stop(&ar->htc);
ath10k_htt_detach(&ar->htt);
ath10k_wmi_detach(ar);
}
int ath10k_core_register(struct ath10k *ar)
{
int status;
status = ath10k_core_start(ar);
if (status)
goto err;
status = ath10k_mac_register(ar); status = ath10k_mac_register(ar);
if (status) if (status)
goto err_disconnect_htc; goto err_core_stop;
status = ath10k_debug_create(ar); status = ath10k_debug_create(ar);
if (status) { if (status) {
...@@ -603,12 +629,8 @@ int ath10k_core_register(struct ath10k *ar) ...@@ -603,12 +629,8 @@ int ath10k_core_register(struct ath10k *ar)
err_unregister_mac: err_unregister_mac:
ath10k_mac_unregister(ar); ath10k_mac_unregister(ar);
err_disconnect_htc: err_core_stop:
ath10k_htc_stop(&ar->htc); ath10k_core_stop(ar);
err_htt_detach:
ath10k_htt_detach(&ar->htt);
err_wmi_detach:
ath10k_wmi_detach(ar);
err: err:
return status; return status;
} }
...@@ -620,9 +642,7 @@ void ath10k_core_unregister(struct ath10k *ar) ...@@ -620,9 +642,7 @@ void ath10k_core_unregister(struct ath10k *ar)
* Otherwise we will fail to submit commands to FW and mac80211 will be * Otherwise we will fail to submit commands to FW and mac80211 will be
* unhappy about callback failures. */ * unhappy about callback failures. */
ath10k_mac_unregister(ar); ath10k_mac_unregister(ar);
ath10k_htc_stop(&ar->htc); ath10k_core_stop(ar);
ath10k_htt_detach(&ar->htt);
ath10k_wmi_detach(ar);
} }
EXPORT_SYMBOL(ath10k_core_unregister); EXPORT_SYMBOL(ath10k_core_unregister);
......
...@@ -353,6 +353,8 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev, ...@@ -353,6 +353,8 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
const struct ath10k_hif_ops *hif_ops); const struct ath10k_hif_ops *hif_ops);
void ath10k_core_destroy(struct ath10k *ar); void ath10k_core_destroy(struct ath10k *ar);
int ath10k_core_start(struct ath10k *ar);
void ath10k_core_stop(struct ath10k *ar);
int ath10k_core_register(struct ath10k *ar); int ath10k_core_register(struct ath10k *ar);
void ath10k_core_unregister(struct ath10k *ar); void ath10k_core_unregister(struct ath10k *ar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment