diff options
Diffstat (limited to 'drivers/staging/ath6kl/os/linux/ar6000_pm.c')
-rw-r--r-- | drivers/staging/ath6kl/os/linux/ar6000_pm.c | 62 |
1 files changed, 17 insertions, 45 deletions
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_pm.c b/drivers/staging/ath6kl/os/linux/ar6000_pm.c index b937df9c0cb5..fbac26429d84 100644 --- a/drivers/staging/ath6kl/os/linux/ar6000_pm.c +++ b/drivers/staging/ath6kl/os/linux/ar6000_pm.c @@ -30,23 +30,12 @@ #include <linux/platform_device.h> #include "wlan_config.h" -#ifdef CONFIG_HAS_WAKELOCK -#include <linux/wakelock.h> -#endif - #define WOW_ENABLE_MAX_INTERVAL 0 #define WOW_SET_SCAN_PARAMS 0 extern unsigned int wmitimeout; extern wait_queue_head_t arEvent; -#ifdef CONFIG_PM -#ifdef CONFIG_HAS_WAKELOCK -struct wake_lock ar6k_suspend_wake_lock; -struct wake_lock ar6k_wow_wake_lock; -#endif -#endif /* CONFIG_PM */ - #ifdef ANDROID_ENV extern void android_ar6k_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL isEvent); #endif @@ -68,7 +57,7 @@ ATH_DEBUG_INSTANTIATE_MODULE_VAR(pm, #endif /* DEBUG */ -A_STATUS ar6000_exit_cut_power_state(AR_SOFTC_T *ar); +int ar6000_exit_cut_power_state(AR_SOFTC_T *ar); #ifdef CONFIG_PM static void ar6k_send_asleep_event_to_app(AR_SOFTC_T *ar, A_BOOL asleep) @@ -89,9 +78,6 @@ static void ar6000_wow_resume(AR_SOFTC_T *ar) A_UINT16 bg_period = (ar->scParams.bg_period==0) ? 60 : ar->scParams.bg_period; WMI_SET_HOST_SLEEP_MODE_CMD hostSleepMode = {TRUE, FALSE}; ar->arWowState = WLAN_WOW_STATE_NONE; -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_timeout(&ar6k_wow_wake_lock, 3*HZ); -#endif if (wmi_set_host_sleep_mode_cmd(ar->arWmi, &hostSleepMode)!=A_OK) { AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Fail to setup restore host awake\n")); } @@ -136,7 +122,7 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar) struct in_ifaddr *ifa = NULL; struct in_device *in_dev; A_UINT8 macMask[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; - A_STATUS status; + int status; WMI_ADD_WOW_PATTERN_CMD addWowCmd = { .filter = { 0 } }; WMI_DEL_WOW_PATTERN_CMD delWowCmd; WMI_SET_HOST_SLEEP_MODE_CMD hostSleepMode = {FALSE, TRUE}; @@ -225,9 +211,9 @@ static void ar6000_wow_suspend(AR_SOFTC_T *ar) } } -A_STATUS ar6000_suspend_ev(void *context) +int ar6000_suspend_ev(void *context) { - A_STATUS status = A_OK; + int status = A_OK; AR_SOFTC_T *ar = (AR_SOFTC_T *)context; A_INT16 pmmode = ar->arSuspendConfig; wow_not_connected: @@ -262,14 +248,11 @@ wow_not_connected: return status; } -A_STATUS ar6000_resume_ev(void *context) +int ar6000_resume_ev(void *context) { AR_SOFTC_T *ar = (AR_SOFTC_T *)context; A_UINT16 powerState = ar->arWlanPowerState; -#ifdef CONFIG_HAS_WAKELOCK - wake_lock(&ar6k_suspend_wake_lock); -#endif AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: enter previous state %d wowState %d\n", __func__, powerState, ar->arWowState)); switch (powerState) { case WLAN_POWER_STATE_WOW: @@ -287,9 +270,6 @@ A_STATUS ar6000_resume_ev(void *context) AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Strange SDIO bus power mode!!\n")); break; } -#ifdef CONFIG_HAS_WAKELOCK - wake_unlock(&ar6k_suspend_wake_lock); -#endif return A_OK; } @@ -310,10 +290,10 @@ void ar6000_check_wow_status(AR_SOFTC_T *ar, struct sk_buff *skb, A_BOOL isEvent } } -A_STATUS ar6000_power_change_ev(void *context, A_UINT32 config) +int ar6000_power_change_ev(void *context, A_UINT32 config) { AR_SOFTC_T *ar = (AR_SOFTC_T *)context; - A_STATUS status = A_OK; + int status = A_OK; AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: power change event callback %d \n", __func__, config)); switch (config) { @@ -362,10 +342,10 @@ static struct platform_driver ar6000_pm_device = { }; #endif /* CONFIG_PM */ -A_STATUS +int ar6000_setup_cut_power_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) { - A_STATUS status = A_OK; + int status = A_OK; HIF_DEVICE_POWER_CHANGE_TYPE config; AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: Cut power %d %d \n", __func__,state, ar->arWlanPowerState)); @@ -432,10 +412,10 @@ ar6000_setup_cut_power_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) return status; } -A_STATUS +int ar6000_setup_deep_sleep_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) { - A_STATUS status = A_OK; + int status = A_OK; AR_DEBUG_PRINTF(ATH_DEBUG_PM, ("%s: Deep sleep %d %d \n", __func__,state, ar->arWlanPowerState)); #ifdef CONFIG_PM @@ -556,10 +536,10 @@ ar6000_setup_deep_sleep_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) return status; } -A_STATUS +int ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, A_BOOL pmEvent) { - A_STATUS status = A_OK; + int status = A_OK; A_UINT16 powerState, oldPowerState; AR6000_WLAN_STATE oldstate = ar->arWlanState; A_BOOL wlanOff = ar->arWlanOff; @@ -670,12 +650,12 @@ ar6000_update_wlan_pwr_state(struct ar6_softc *ar, AR6000_WLAN_STATE state, A_BO return status; } -A_STATUS +int ar6000_set_bt_hw_state(struct ar6_softc *ar, A_UINT32 enable) { #ifdef CONFIG_PM A_BOOL off = (enable == 0); - A_STATUS status; + int status; if (ar->arBTOff == off) { return A_OK; } @@ -687,10 +667,10 @@ ar6000_set_bt_hw_state(struct ar6_softc *ar, A_UINT32 enable) #endif } -A_STATUS +int ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) { - A_STATUS status; + int status; A_BOOL off = (state == WLAN_DISABLED); if (ar->arWlanOff == off) { return A_OK; @@ -704,10 +684,6 @@ void ar6000_pm_init() { A_REGISTER_MODULE_DEBUG_INFO(pm); #ifdef CONFIG_PM -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_init(&ar6k_suspend_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_suspend"); - wake_lock_init(&ar6k_wow_wake_lock, WAKE_LOCK_SUSPEND, "ar6k_wow"); -#endif /* * Register ar6000_pm_device into system. * We should also add platform_device into the first item of array @@ -723,9 +699,5 @@ void ar6000_pm_exit() { #ifdef CONFIG_PM platform_driver_unregister(&ar6000_pm_device); -#ifdef CONFIG_HAS_WAKELOCK - wake_lock_destroy(&ar6k_suspend_wake_lock); - wake_lock_destroy(&ar6k_wow_wake_lock); -#endif #endif /* CONFIG_PM */ } |