Commit ec079860 authored by Philipp Hortmann's avatar Philipp Hortmann Committed by Greg Kroah-Hartman

staging: rtl8192e: Rename eRFPowerState, eRfOff and eRfOn

Rename variable eRFPowerState to rf_power_state, eRfOff to rf_off and
eRfOn to rf_on to avoid CamelCase which is not accepted by checkpatch.
Omit the upfront "e" as no RFPowerState, RfOff and RfOn exist and it
makes the variables unnecessary long.
Signed-off-by: default avatarPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/52c676bbaf1f894e30971c5c409b4bcb71c8ef7e.1664055213.git.philipp.g.hortmann@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db65beca
...@@ -625,7 +625,7 @@ bool rtl92e_start_adapter(struct net_device *dev) ...@@ -625,7 +625,7 @@ bool rtl92e_start_adapter(struct net_device *dev)
priv->pFirmware->status = FW_STATUS_0_INIT; priv->pFirmware->status = FW_STATUS_0_INIT;
if (priv->RegRfOff) if (priv->RegRfOff)
priv->rtllib->eRFPowerState = eRfOff; priv->rtllib->rf_power_state = rf_off;
ulRegRead = rtl92e_readl(dev, CPU_GEN); ulRegRead = rtl92e_readl(dev, CPU_GEN);
if (priv->pFirmware->status == FW_STATUS_0_INIT) if (priv->pFirmware->status == FW_STATUS_0_INIT)
...@@ -757,13 +757,13 @@ bool rtl92e_start_adapter(struct net_device *dev) ...@@ -757,13 +757,13 @@ bool rtl92e_start_adapter(struct net_device *dev)
rtl92e_writeb(dev, 0x87, 0x0); rtl92e_writeb(dev, 0x87, 0x0);
if (priv->RegRfOff) { if (priv->RegRfOff) {
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_SW); rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_SW);
} else if (priv->rtllib->RfOffReason > RF_CHANGE_BY_PS) { } else if (priv->rtllib->RfOffReason > RF_CHANGE_BY_PS) {
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason); rtl92e_set_rf_state(dev, rf_off, priv->rtllib->RfOffReason);
} else if (priv->rtllib->RfOffReason >= RF_CHANGE_BY_IPS) { } else if (priv->rtllib->RfOffReason >= RF_CHANGE_BY_IPS) {
rtl92e_set_rf_state(dev, eRfOff, priv->rtllib->RfOffReason); rtl92e_set_rf_state(dev, rf_off, priv->rtllib->RfOffReason);
} else { } else {
priv->rtllib->eRFPowerState = eRfOn; priv->rtllib->rf_power_state = rf_on;
priv->rtllib->RfOffReason = 0; priv->rtllib->RfOffReason = 0;
} }
......
...@@ -200,7 +200,7 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, ...@@ -200,7 +200,7 @@ void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
if (!rtl92e_is_legal_rf_path(dev, eRFPath)) if (!rtl92e_is_legal_rf_path(dev, eRFPath))
return; return;
if (priv->rtllib->eRFPowerState != eRfOn && !priv->being_init_adapter) if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter)
return; return;
if (priv->Rf_Mode == RF_OP_By_FW) { if (priv->Rf_Mode == RF_OP_By_FW) {
...@@ -237,7 +237,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath, ...@@ -237,7 +237,7 @@ u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
if (!rtl92e_is_legal_rf_path(dev, eRFPath)) if (!rtl92e_is_legal_rf_path(dev, eRFPath))
return 0; return 0;
if (priv->rtllib->eRFPowerState != eRfOn && !priv->being_init_adapter) if (priv->rtllib->rf_power_state != rf_on && !priv->being_init_adapter)
return 0; return 0;
mutex_lock(&priv->rf_mutex); mutex_lock(&priv->rf_mutex);
if (priv->Rf_Mode == RF_OP_By_FW) { if (priv->Rf_Mode == RF_OP_By_FW) {
...@@ -1301,7 +1301,7 @@ void rtl92e_set_rf_off(struct net_device *dev) ...@@ -1301,7 +1301,7 @@ void rtl92e_set_rf_off(struct net_device *dev)
} }
static bool _rtl92e_set_rf_power_state(struct net_device *dev, static bool _rtl92e_set_rf_power_state(struct net_device *dev,
enum rt_rf_power_state eRFPowerState) enum rt_rf_power_state rf_power_state)
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *) struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
...@@ -1316,9 +1316,9 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, ...@@ -1316,9 +1316,9 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
switch (priv->rf_chip) { switch (priv->rf_chip) {
case RF_8256: case RF_8256:
switch (eRFPowerState) { switch (rf_power_state) {
case eRfOn: case rf_on:
if ((priv->rtllib->eRFPowerState == eRfOff) && if ((priv->rtllib->rf_power_state == rf_off) &&
RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) { RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) {
bool rtstatus; bool rtstatus;
u32 InitilizeCount = 3; u32 InitilizeCount = 3;
...@@ -1364,7 +1364,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, ...@@ -1364,7 +1364,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
break; break;
case eRfSleep: case eRfSleep:
if (priv->rtllib->eRFPowerState == eRfOff) if (priv->rtllib->rf_power_state == rf_off)
break; break;
...@@ -1386,7 +1386,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, ...@@ -1386,7 +1386,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
rtl92e_set_rf_off(dev); rtl92e_set_rf_off(dev);
break; break;
case eRfOff: case rf_off:
for (QueueID = 0, i = 0; QueueID < MAX_TX_QUEUE; ) { for (QueueID = 0, i = 0; QueueID < MAX_TX_QUEUE; ) {
ring = &priv->tx_ring[QueueID]; ring = &priv->tx_ring[QueueID];
...@@ -1418,7 +1418,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, ...@@ -1418,7 +1418,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
bResult = false; bResult = false;
netdev_warn(dev, netdev_warn(dev,
"%s(): Unknown state requested: 0x%X.\n", "%s(): Unknown state requested: 0x%X.\n",
__func__, eRFPowerState); __func__, rf_power_state);
break; break;
} }
...@@ -1430,7 +1430,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, ...@@ -1430,7 +1430,7 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
} }
if (bResult) { if (bResult) {
priv->rtllib->eRFPowerState = eRFPowerState; priv->rtllib->rf_power_state = rf_power_state;
switch (priv->rf_chip) { switch (priv->rf_chip) {
case RF_8256: case RF_8256:
...@@ -1447,18 +1447,18 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev, ...@@ -1447,18 +1447,18 @@ static bool _rtl92e_set_rf_power_state(struct net_device *dev,
} }
bool rtl92e_set_rf_power_state(struct net_device *dev, bool rtl92e_set_rf_power_state(struct net_device *dev,
enum rt_rf_power_state eRFPowerState) enum rt_rf_power_state rf_power_state)
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
bool bResult = false; bool bResult = false;
if (eRFPowerState == priv->rtllib->eRFPowerState && if (rf_power_state == priv->rtllib->rf_power_state &&
priv->bHwRfOffAction == 0) { priv->bHwRfOffAction == 0) {
return bResult; return bResult;
} }
bResult = _rtl92e_set_rf_power_state(dev, eRFPowerState); bResult = _rtl92e_set_rf_power_state(dev, rf_power_state);
return bResult; return bResult;
} }
......
...@@ -82,7 +82,7 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation); ...@@ -82,7 +82,7 @@ void rtl92e_init_gain(struct net_device *dev, u8 Operation);
void rtl92e_set_rf_off(struct net_device *dev); void rtl92e_set_rf_off(struct net_device *dev);
bool rtl92e_set_rf_power_state(struct net_device *dev, bool rtl92e_set_rf_power_state(struct net_device *dev,
enum rt_rf_power_state eRFPowerState); enum rt_rf_power_state rf_power_state);
void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation); void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation);
......
...@@ -80,9 +80,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex, ...@@ -80,9 +80,9 @@ void rtl92e_set_key(struct net_device *dev, u8 EntryNo, u8 KeyIndex,
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == eRfOff) { if (rt_state == rf_off) {
if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) { if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n", netdev_warn(dev, "%s(): RF is OFF.\n",
__func__); __func__);
......
...@@ -166,10 +166,10 @@ bool rtl92e_set_rf_state(struct net_device *dev, ...@@ -166,10 +166,10 @@ bool rtl92e_set_rf_state(struct net_device *dev,
} }
} }
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
switch (state_to_set) { switch (state_to_set) {
case eRfOn: case rf_on:
priv->rtllib->RfOffReason &= (~change_source); priv->rtllib->RfOffReason &= (~change_source);
if ((change_source == RF_CHANGE_BY_HW) && priv->hw_radio_off) if ((change_source == RF_CHANGE_BY_HW) && priv->hw_radio_off)
...@@ -179,13 +179,13 @@ bool rtl92e_set_rf_state(struct net_device *dev, ...@@ -179,13 +179,13 @@ bool rtl92e_set_rf_state(struct net_device *dev,
priv->rtllib->RfOffReason = 0; priv->rtllib->RfOffReason = 0;
action_allowed = true; action_allowed = true;
if (rt_state == eRfOff && if (rt_state == rf_off &&
change_source >= RF_CHANGE_BY_HW) change_source >= RF_CHANGE_BY_HW)
connect_by_ssid = true; connect_by_ssid = true;
} }
break; break;
case eRfOff: case rf_off:
if ((priv->rtllib->iw_mode == IW_MODE_INFRA) || if ((priv->rtllib->iw_mode == IW_MODE_INFRA) ||
(priv->rtllib->iw_mode == IW_MODE_ADHOC)) { (priv->rtllib->iw_mode == IW_MODE_ADHOC)) {
...@@ -216,7 +216,7 @@ bool rtl92e_set_rf_state(struct net_device *dev, ...@@ -216,7 +216,7 @@ bool rtl92e_set_rf_state(struct net_device *dev,
if (action_allowed) { if (action_allowed) {
rtl92e_set_rf_power_state(dev, state_to_set); rtl92e_set_rf_power_state(dev, state_to_set);
if (state_to_set == eRfOn) { if (state_to_set == rf_on) {
if (connect_by_ssid && priv->blinked_ingpio) { if (connect_by_ssid && priv->blinked_ingpio) {
schedule_delayed_work( schedule_delayed_work(
&ieee->associate_procedure_wq, 0); &ieee->associate_procedure_wq, 0);
...@@ -892,7 +892,7 @@ static void _rtl92e_init_priv_variable(struct net_device *dev) ...@@ -892,7 +892,7 @@ static void _rtl92e_init_priv_variable(struct net_device *dev)
priv->rtllib->PowerSaveControl.bFwCtrlLPS = false; priv->rtllib->PowerSaveControl.bFwCtrlLPS = false;
priv->rtllib->LPSDelayCnt = 0; priv->rtllib->LPSDelayCnt = 0;
priv->rtllib->sta_sleep = LPS_IS_WAKE; priv->rtllib->sta_sleep = LPS_IS_WAKE;
priv->rtllib->eRFPowerState = eRfOn; priv->rtllib->rf_power_state = rf_on;
priv->rtllib->current_network.beacon_interval = DEFAULT_BEACONINTERVAL; priv->rtllib->current_network.beacon_interval = DEFAULT_BEACONINTERVAL;
priv->rtllib->iw_mode = IW_MODE_INFRA; priv->rtllib->iw_mode = IW_MODE_INFRA;
...@@ -1114,12 +1114,12 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev) ...@@ -1114,12 +1114,12 @@ static enum reset_type _rtl92e_if_check_reset(struct net_device *dev)
enum reset_type RxResetType = RESET_TYPE_NORESET; enum reset_type RxResetType = RESET_TYPE_NORESET;
enum rt_rf_power_state rfState; enum rt_rf_power_state rfState;
rfState = priv->rtllib->eRFPowerState; rfState = priv->rtllib->rf_power_state;
if (rfState == eRfOn) if (rfState == rf_on)
TxResetType = _rtl92e_tx_check_stuck(dev); TxResetType = _rtl92e_tx_check_stuck(dev);
if (rfState == eRfOn && if (rfState == rf_on &&
(priv->rtllib->iw_mode == IW_MODE_INFRA) && (priv->rtllib->iw_mode == IW_MODE_INFRA) &&
(priv->rtllib->state == RTLLIB_LINKED)) (priv->rtllib->state == RTLLIB_LINKED))
RxResetType = _rtl92e_rx_check_stuck(dev); RxResetType = _rtl92e_rx_check_stuck(dev);
...@@ -1307,7 +1307,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) ...@@ -1307,7 +1307,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
if (!rtllib_act_scanning(priv->rtllib, false)) { if (!rtllib_act_scanning(priv->rtllib, false)) {
if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state == if ((ieee->iw_mode == IW_MODE_INFRA) && (ieee->state ==
RTLLIB_NOLINK) && RTLLIB_NOLINK) &&
(ieee->eRFPowerState == eRfOn) && !ieee->is_set_key && (ieee->rf_power_state == rf_on) && !ieee->is_set_key &&
(!ieee->proto_stoppping) && !ieee->wx_set_enc) { (!ieee->proto_stoppping) && !ieee->wx_set_enc) {
if ((ieee->PowerSaveControl.ReturnPoint == if ((ieee->PowerSaveControl.ReturnPoint ==
IPS_CALLBACK_NONE) && IPS_CALLBACK_NONE) &&
...@@ -1370,7 +1370,7 @@ static void _rtl92e_watchdog_wq_cb(void *data) ...@@ -1370,7 +1370,7 @@ static void _rtl92e_watchdog_wq_cb(void *data)
priv->check_roaming_cnt = 0; priv->check_roaming_cnt = 0;
if (priv->check_roaming_cnt > 0) { if (priv->check_roaming_cnt > 0) {
if (ieee->eRFPowerState == eRfOff) if (ieee->rf_power_state == rf_off)
netdev_info(dev, "%s(): RF is off\n", __func__); netdev_info(dev, "%s(): RF is off\n", __func__);
netdev_info(dev, netdev_info(dev,
...@@ -1507,7 +1507,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev, ...@@ -1507,7 +1507,7 @@ static void _rtl92e_hard_data_xmit(struct sk_buff *skb, struct net_device *dev,
MAX_DEV_ADDR_SIZE); MAX_DEV_ADDR_SIZE);
u8 queue_index = tcb_desc->queue_index; u8 queue_index = tcb_desc->queue_index;
if ((priv->rtllib->eRFPowerState == eRfOff) || !priv->up || if ((priv->rtllib->rf_power_state == rf_off) || !priv->up ||
priv->bResetInProgress) { priv->bResetInProgress) {
kfree_skb(skb); kfree_skb(skb);
return; return;
...@@ -1540,7 +1540,7 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -1540,7 +1540,7 @@ static int _rtl92e_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
u8 queue_index = tcb_desc->queue_index; u8 queue_index = tcb_desc->queue_index;
if (queue_index != TXCMD_QUEUE) { if (queue_index != TXCMD_QUEUE) {
if ((priv->rtllib->eRFPowerState == eRfOff) || if ((priv->rtllib->rf_power_state == rf_off) ||
!priv->up || priv->bResetInProgress) { !priv->up || priv->bResetInProgress) {
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
......
...@@ -648,7 +648,7 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev) ...@@ -648,7 +648,7 @@ static void _rtl92e_dm_tx_power_tracking_callback_tssi(struct net_device *dev)
rtl92e_writeb(dev, FW_Busy_Flag, 0); rtl92e_writeb(dev, FW_Busy_Flag, 0);
return; return;
} }
if (priv->rtllib->eRFPowerState != eRfOn) { if (priv->rtllib->rf_power_state != rf_on) {
rtl92e_writeb(dev, Pw_Track_Flag, 0); rtl92e_writeb(dev, Pw_Track_Flag, 0);
rtl92e_writeb(dev, FW_Busy_Flag, 0); rtl92e_writeb(dev, FW_Busy_Flag, 0);
return; return;
...@@ -1684,13 +1684,13 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data) ...@@ -1684,13 +1684,13 @@ static void _rtl92e_dm_check_rf_ctrl_gpio(void *data)
tmp1byte = rtl92e_readb(dev, GPI); tmp1byte = rtl92e_readb(dev, GPI);
eRfPowerStateToSet = (tmp1byte&BIT1) ? eRfOn : eRfOff; eRfPowerStateToSet = (tmp1byte&BIT1) ? rf_on : rf_off;
if (priv->hw_radio_off && (eRfPowerStateToSet == eRfOn)) { if (priv->hw_radio_off && (eRfPowerStateToSet == rf_on)) {
netdev_info(dev, "gpiochangeRF - HW Radio ON\n"); netdev_info(dev, "gpiochangeRF - HW Radio ON\n");
priv->hw_radio_off = false; priv->hw_radio_off = false;
bActuallySet = true; bActuallySet = true;
} else if (!priv->hw_radio_off && (eRfPowerStateToSet == eRfOff)) { } else if (!priv->hw_radio_off && (eRfPowerStateToSet == rf_off)) {
netdev_info(dev, "gpiochangeRF - HW Radio OFF\n"); netdev_info(dev, "gpiochangeRF - HW Radio OFF\n");
priv->hw_radio_off = true; priv->hw_radio_off = true;
bActuallySet = true; bActuallySet = true;
......
...@@ -32,7 +32,7 @@ int rtl92e_suspend(struct device *dev_d) ...@@ -32,7 +32,7 @@ int rtl92e_suspend(struct device *dev_d)
netif_device_detach(dev); netif_device_detach(dev);
if (!priv->rtllib->bSupportRemoteWakeUp) { if (!priv->rtllib->bSupportRemoteWakeUp) {
rtl92e_set_rf_state(dev, eRfOff, RF_CHANGE_BY_INIT); rtl92e_set_rf_state(dev, rf_off, RF_CHANGE_BY_INIT);
ulRegRead = rtl92e_readl(dev, CPU_GEN); ulRegRead = rtl92e_readl(dev, CPU_GEN);
ulRegRead |= CPU_GEN_SYSTEM_RESET; ulRegRead |= CPU_GEN_SYSTEM_RESET;
rtl92e_writel(dev, CPU_GEN, ulRegRead); rtl92e_writel(dev, CPU_GEN, ulRegRead);
...@@ -83,7 +83,7 @@ int rtl92e_resume(struct device *dev_d) ...@@ -83,7 +83,7 @@ int rtl92e_resume(struct device *dev_d)
dev->netdev_ops->ndo_open(dev); dev->netdev_ops->ndo_open(dev);
if (!priv->rtllib->bSupportRemoteWakeUp) if (!priv->rtllib->bSupportRemoteWakeUp)
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_INIT); rtl92e_set_rf_state(dev, rf_on, RF_CHANGE_BY_INIT);
out: out:
return 0; return 0;
......
...@@ -51,7 +51,7 @@ void rtl92e_hw_wakeup(struct net_device *dev) ...@@ -51,7 +51,7 @@ void rtl92e_hw_wakeup(struct net_device *dev)
return; return;
} }
spin_unlock_irqrestore(&priv->rf_ps_lock, flags); spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
rtl92e_set_rf_state(dev, eRfOn, RF_CHANGE_BY_PS); rtl92e_set_rf_state(dev, rf_on, RF_CHANGE_BY_PS);
} }
void rtl92e_hw_wakeup_wq(void *data) void rtl92e_hw_wakeup_wq(void *data)
...@@ -117,11 +117,11 @@ void rtl92e_ips_enter(struct net_device *dev) ...@@ -117,11 +117,11 @@ void rtl92e_ips_enter(struct net_device *dev)
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
if (pPSC->bInactivePs) { if (pPSC->bInactivePs) {
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
if (rt_state == eRfOn && !pPSC->bSwRfProcessing && if (rt_state == rf_on && !pPSC->bSwRfProcessing &&
(priv->rtllib->state != RTLLIB_LINKED) && (priv->rtllib->state != RTLLIB_LINKED) &&
(priv->rtllib->iw_mode != IW_MODE_MASTER)) { (priv->rtllib->iw_mode != IW_MODE_MASTER)) {
pPSC->eInactivePowerState = eRfOff; pPSC->eInactivePowerState = rf_off;
priv->isRFOff = true; priv->isRFOff = true;
priv->bInPowerSaveMode = true; priv->bInPowerSaveMode = true;
_rtl92e_ps_update_rf_state(dev); _rtl92e_ps_update_rf_state(dev);
...@@ -137,10 +137,10 @@ void rtl92e_ips_leave(struct net_device *dev) ...@@ -137,10 +137,10 @@ void rtl92e_ips_leave(struct net_device *dev)
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
if (pPSC->bInactivePs) { if (pPSC->bInactivePs) {
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
if (rt_state != eRfOn && !pPSC->bSwRfProcessing && if (rt_state != rf_on && !pPSC->bSwRfProcessing &&
priv->rtllib->RfOffReason <= RF_CHANGE_BY_IPS) { priv->rtllib->RfOffReason <= RF_CHANGE_BY_IPS) {
pPSC->eInactivePowerState = eRfOn; pPSC->eInactivePowerState = rf_on;
priv->bInPowerSaveMode = false; priv->bInPowerSaveMode = false;
_rtl92e_ps_update_rf_state(dev); _rtl92e_ps_update_rf_state(dev);
} }
...@@ -164,10 +164,10 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev) ...@@ -164,10 +164,10 @@ void rtl92e_rtllib_ips_leave_wq(struct net_device *dev)
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
enum rt_rf_power_state rt_state; enum rt_rf_power_state rt_state;
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == eRfOff) { if (rt_state == rf_off) {
if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) { if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n", netdev_warn(dev, "%s(): RF is OFF.\n",
__func__); __func__);
......
...@@ -248,12 +248,12 @@ static int _rtl92e_wx_set_mode(struct net_device *dev, ...@@ -248,12 +248,12 @@ static int _rtl92e_wx_set_mode(struct net_device *dev,
if (priv->hw_radio_off) if (priv->hw_radio_off)
return 0; return 0;
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
mutex_lock(&priv->wx_mutex); mutex_lock(&priv->wx_mutex);
if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR || if (wrqu->mode == IW_MODE_ADHOC || wrqu->mode == IW_MODE_MONITOR ||
ieee->bNetPromiscuousMode) { ieee->bNetPromiscuousMode) {
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == eRfOff) { if (rt_state == rf_off) {
if (priv->rtllib->RfOffReason > if (priv->rtllib->RfOffReason >
RF_CHANGE_BY_IPS) { RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n", netdev_warn(dev, "%s(): RF is OFF.\n",
...@@ -392,7 +392,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -392,7 +392,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
__func__); __func__);
return 0; return 0;
} }
rt_state = priv->rtllib->eRFPowerState; rt_state = priv->rtllib->rf_power_state;
if (!priv->up) if (!priv->up)
return -ENETDOWN; return -ENETDOWN;
if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true) if (priv->rtllib->LinkDetectInfo.bBusyTraffic == true)
...@@ -415,7 +415,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -415,7 +415,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
if (priv->rtllib->state != RTLLIB_LINKED) { if (priv->rtllib->state != RTLLIB_LINKED) {
if (priv->rtllib->PowerSaveControl.bInactivePs) { if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rt_state == eRfOff) { if (rt_state == rf_off) {
if (priv->rtllib->RfOffReason > if (priv->rtllib->RfOffReason >
RF_CHANGE_BY_IPS) { RF_CHANGE_BY_IPS) {
netdev_warn(dev, "%s(): RF is OFF.\n", netdev_warn(dev, "%s(): RF is OFF.\n",
...@@ -433,7 +433,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev, ...@@ -433,7 +433,7 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
priv->rtllib->LedControlHandler(dev, priv->rtllib->LedControlHandler(dev,
LED_CTL_SITE_SURVEY); LED_CTL_SITE_SURVEY);
if (priv->rtllib->eRFPowerState != eRfOff) { if (priv->rtllib->rf_power_state != rf_off) {
priv->rtllib->actscanning = true; priv->rtllib->actscanning = true;
if (ieee->ScanOperationBackupHandler) if (ieee->ScanOperationBackupHandler)
...@@ -487,7 +487,7 @@ static int _rtl92e_wx_set_essid(struct net_device *dev, ...@@ -487,7 +487,7 @@ static int _rtl92e_wx_set_essid(struct net_device *dev,
if (priv->hw_radio_off) { if (priv->hw_radio_off) {
netdev_info(dev, netdev_info(dev,
"=========>%s():hw radio off,or Rf state is eRfOff, return\n", "=========>%s():hw radio off,or Rf state is rf_off, return\n",
__func__); __func__);
return 0; return 0;
} }
......
...@@ -1244,9 +1244,9 @@ enum ips_callback_function { ...@@ -1244,9 +1244,9 @@ enum ips_callback_function {
}; };
enum rt_rf_power_state { enum rt_rf_power_state {
eRfOn, rf_on,
eRfSleep, eRfSleep,
eRfOff rf_off
}; };
struct rt_pwr_save_ctrl { struct rt_pwr_save_ctrl {
...@@ -1434,7 +1434,7 @@ struct rtllib_device { ...@@ -1434,7 +1434,7 @@ struct rtllib_device {
bool FirstIe_InScan; bool FirstIe_InScan;
bool be_scan_inprogress; bool be_scan_inprogress;
bool beinretry; bool beinretry;
enum rt_rf_power_state eRFPowerState; enum rt_rf_power_state rf_power_state;
RT_RF_CHANGE_SOURCE RfOffReason; RT_RF_CHANGE_SOURCE RfOffReason;
bool is_set_key; bool is_set_key;
bool wx_set_enc; bool wx_set_enc;
......
...@@ -586,9 +586,9 @@ static void rtllib_softmac_scan_wq(void *data) ...@@ -586,9 +586,9 @@ static void rtllib_softmac_scan_wq(void *data)
mutex_lock(&ieee->scan_mutex); mutex_lock(&ieee->scan_mutex);
if (ieee->eRFPowerState == eRfOff) { if (ieee->rf_power_state == rf_off) {
netdev_info(ieee->dev, netdev_info(ieee->dev,
"======>%s():rf state is eRfOff, return\n", "======>%s():rf state is rf_off, return\n",
__func__); __func__);
goto out1; goto out1;
} }
...@@ -1585,7 +1585,7 @@ static void rtllib_associate_procedure_wq(void *data) ...@@ -1585,7 +1585,7 @@ static void rtllib_associate_procedure_wq(void *data)
rtllib_stop_scan(ieee); rtllib_stop_scan(ieee);
HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT); HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
if (ieee->eRFPowerState == eRfOff) { if (ieee->rf_power_state == rf_off) {
if (ieee->rtllib_ips_leave_wq != NULL) if (ieee->rtllib_ips_leave_wq != NULL)
ieee->rtllib_ips_leave_wq(ieee->dev); ieee->rtllib_ips_leave_wq(ieee->dev);
mutex_unlock(&ieee->wx_mutex); mutex_unlock(&ieee->wx_mutex);
......
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