// SPDX-License-Identifier: GPL-2.0 /****************************************************************************** * rtl871x_pwrctrl.c * * Copyright(c) 2007 - 2010 Realtek Corporation. All rights reserved. * Linux device driver for RTL8192SU * * Modifications for inclusion into the Linux staging tree are * Copyright(c) 2010 Larry Finger. All rights reserved. * * Contact information: * WLAN FAE <[email protected]> * Larry Finger <[email protected]> * ******************************************************************************/ #define _RTL871X_PWRCTRL_C_ #include "osdep_service.h" #include "drv_types.h" #include "osdep_intf.h" #define RTL8712_SDIO_LOCAL_BASE … #define SDIO_HCPWM … void r8712_set_rpwm(struct _adapter *padapter, u8 val8) { … } void r8712_set_ps_mode(struct _adapter *padapter, uint ps_mode, uint smart_ps) { … } /* * Caller:ISR handler... * * This will be called when CPWM interrupt is up. * * using to update cpwn of drv; and drv will make a decision to up or * down pwr level */ void r8712_cpwm_int_hdl(struct _adapter *padapter, struct reportpwrstate_parm *preportpwrstate) { … } static inline void register_task_alive(struct pwrctrl_priv *pwrctrl, uint tag) { … } static inline void unregister_task_alive(struct pwrctrl_priv *pwrctrl, uint tag) { … } static void _rpwm_check_handler (struct _adapter *padapter) { … } static void SetPSModeWorkItemCallback(struct work_struct *work) { … } static void rpwm_workitem_callback(struct work_struct *work) { … } static void rpwm_check_handler (struct timer_list *t) { … } void r8712_init_pwrctrl_priv(struct _adapter *padapter) { … } /* * Caller: r8712_cmd_thread * Check if the fw_pwrstate is okay for issuing cmd. * If not (cpwm should be is less than P2 state), then the sub-routine * will raise the cpwm to be greater than or equal to P2. * Calling Context: Passive * Return Value: * 0: r8712_cmd_thread can issue cmds to firmware afterwards. * -EINVAL: r8712_cmd_thread can not do anything. */ int r8712_register_cmd_alive(struct _adapter *padapter) { … } /* * Caller: ISR * If ISR's txdone, * No more pkts for TX, * Then driver shall call this fun. to power down firmware again. */ void r8712_unregister_cmd_alive(struct _adapter *padapter) { … } void r8712_flush_rwctrl_works(struct _adapter *padapter) { … }