summaryrefslogtreecommitdiffstats
path: root/drivers/staging/r8188eu/core/rtw_pwrctrl.c
diff options
context:
space:
mode:
authorLarry Finger <Larry.Finger@lwfinger.net>2021-09-09 11:58:09 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-13 08:49:54 +0200
commit102243f893ecdef92690afcc2c42603b589329ac (patch)
treee6bd3719e9459c7e6d6d38a20e5b3231a29b838a /drivers/staging/r8188eu/core/rtw_pwrctrl.c
parenteb01e81fe1cc77e0a048697d814f6e089c2b07f5 (diff)
downloadlinux-102243f893ecdef92690afcc2c42603b589329ac.tar.bz2
staging: r8188eu: Remove conditionals CONFIG_88EU_{AP_MODE,P2P}
These rwo conditional compile symbols are explicitely defined. As a result, their included code is always compiled. They could be converted to Kconfig symbols; however, my experience with this driver in a GitHub repo is that many users of the device have it built into a SOC or SBC that they wish to use as an access point. As a result, CONFIG_88EU_APMODE would need to be selected. Thuse it should be built in. There have also been many users the wish to establish peer-to-peer networks with this device. For this reason, I am also proposing that CONFIG_88EU_P2P be automatically included. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210909165809.12634-1-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/r8188eu/core/rtw_pwrctrl.c')
-rw-r--r--drivers/staging/r8188eu/core/rtw_pwrctrl.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
index 00750394c50b..353b7bd850d9 100644
--- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c
@@ -99,10 +99,7 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
{
struct adapter *buddy = adapter->pbuddy_adapter;
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
-#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &adapter->wdinfo;
-#endif
-
bool ret = false;
if (adapter->pwrctrlpriv.ips_deny_time >= jiffies)
@@ -113,29 +110,19 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
check_fwstate(pmlmepriv, WIFI_UNDER_WPS) ||
check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE) ||
-#if defined(CONFIG_88EU_P2P)
!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE))
-#else
- 0)
-#endif
goto exit;
/* consider buddy, if exist */
if (buddy) {
struct mlme_priv *b_pmlmepriv = &buddy->mlmepriv;
- #ifdef CONFIG_88EU_P2P
struct wifidirect_info *b_pwdinfo = &buddy->wdinfo;
- #endif
if (check_fwstate(b_pmlmepriv, WIFI_ASOC_STATE | WIFI_SITE_MONITOR) ||
check_fwstate(b_pmlmepriv, WIFI_UNDER_LINKING | WIFI_UNDER_WPS) ||
check_fwstate(b_pmlmepriv, WIFI_AP_STATE) ||
check_fwstate(b_pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE) ||
-#if defined(CONFIG_88EU_P2P)
!rtw_p2p_chk_state(b_pwdinfo, P2P_STATE_NONE))
-#else
- 0)
-#endif
goto exit;
}
ret = true;
@@ -274,9 +261,7 @@ static u8 PS_RDY_CHECK(struct adapter *padapter)
void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_ant_mode)
{
struct pwrctrl_priv *pwrpriv = &padapter->pwrctrlpriv;
-#ifdef CONFIG_88EU_P2P
struct wifidirect_info *pwdinfo = &padapter->wdinfo;
-#endif /* CONFIG_88EU_P2P */
if (ps_mode > PM_Card_Disable)
return;
@@ -292,7 +277,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
/* if (pwrpriv->pwr_mode == PS_MODE_ACTIVE) */
if (ps_mode == PS_MODE_ACTIVE) {
-#ifdef CONFIG_88EU_P2P
if (pwdinfo->opp_ps == 0) {
DBG_88E("rtw_set_ps_mode: Leave 802.11 power save\n");
pwrpriv->pwr_mode = ps_mode;
@@ -301,7 +285,6 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
pwrpriv->bFwCurrentInPSMode = false;
}
} else {
-#endif /* CONFIG_88EU_P2P */
if (PS_RDY_CHECK(padapter)) {
DBG_88E("%s: Enter 802.11 power save\n", __func__);
pwrpriv->bFwCurrentInPSMode = true;
@@ -310,11 +293,9 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode, u8 smart_ps, u8 bcn_a
pwrpriv->bcn_ant_mode = bcn_ant_mode;
rtw_hal_set_hwreg(padapter, HW_VAR_H2C_FW_PWRMODE, (u8 *)(&ps_mode));
-#ifdef CONFIG_88EU_P2P
/* Set CTWindow after LPS */
if (pwdinfo->opp_ps == 1)
p2p_ps_wk_cmd(padapter, P2P_PS_ENABLE, 0);
-#endif /* CONFIG_88EU_P2P */
rtw_set_rpwm(padapter, PS_STATE_S2);
}