ath10k: deinit wow config in driver unload

The mac80211 support user configured wowlan enable/disable
feature using wlan utils, If the wowlan feature is not enabled
by user the mac80211 subsystem fallback to core stop instead
of wow suspend during system suspend even the wlan firmware
support wowlan feature.

So in driver load init wow and set the wlan device as a wakeup
capable device and deinit wow in driver unload.

CRs-Fixed: 2218083
Change-Id: I5ac5b6e0118f8a3dd01cfbdd706f56fa33b3e101
Signed-off-by: Sarada Prasanna Garnayak <sgarna@codeaurora.org>
This commit is contained in:
Sarada Prasanna Garnayak 2018-03-21 21:10:28 +05:30 committed by Gerrit - the friendly Code Review server
parent d620817f3a
commit 521e320a40
3 changed files with 14 additions and 2 deletions

View file

@ -8308,6 +8308,7 @@ err_free:
void ath10k_mac_unregister(struct ath10k *ar) void ath10k_mac_unregister(struct ath10k *ar)
{ {
ath10k_wow_deinit(ar);
ieee80211_unregister_hw(ar->hw); ieee80211_unregister_hw(ar->hw);
if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector) if (IS_ENABLED(CONFIG_ATH10K_DFS_CERTIFIED) && ar->dfs_detector)

View file

@ -577,8 +577,15 @@ int ath10k_wow_init(struct ath10k *ar)
ar->wow.wowlan_support = ath10k_wowlan_support; ar->wow.wowlan_support = ath10k_wowlan_support;
ar->wow.wowlan_support.n_patterns = ar->wow.max_num_patterns; ar->wow.wowlan_support.n_patterns = ar->wow.max_num_patterns;
ar->hw->wiphy->wowlan = &ar->wow.wowlan_support; ar->hw->wiphy->wowlan = &ar->wow.wowlan_support;
device_init_wakeup(ar->dev, true);
device_set_wakeup_capable(ar->dev, true);
return 0; return 0;
} }
void ath10k_wow_deinit(struct ath10k *ar)
{
if (test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT,
ar->running_fw->fw_file.fw_features) &&
test_bit(WMI_SERVICE_WOW, ar->wmi.svc_map))
device_init_wakeup(ar->dev, false);
}

View file

@ -27,6 +27,7 @@ struct ath10k_wow {
#ifdef CONFIG_PM #ifdef CONFIG_PM
int ath10k_wow_init(struct ath10k *ar); int ath10k_wow_init(struct ath10k *ar);
void ath10k_wow_deinit(struct ath10k *ar);
int ath10k_wow_op_suspend(struct ieee80211_hw *hw, int ath10k_wow_op_suspend(struct ieee80211_hw *hw,
struct cfg80211_wowlan *wowlan); struct cfg80211_wowlan *wowlan);
int ath10k_wow_op_resume(struct ieee80211_hw *hw); int ath10k_wow_op_resume(struct ieee80211_hw *hw);
@ -41,5 +42,8 @@ static inline int ath10k_wow_init(struct ath10k *ar)
return 0; return 0;
} }
void ath10k_wow_deinit(struct ath10k *ar)
{
}
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
#endif /* _WOW_H_ */ #endif /* _WOW_H_ */