staging: rtl8187se: Convert _RT_RF_POWER_STATE typedef into an enum
The Documentation/CodingStyle doesn't recommend the use of typedef, convert this to an enum. While at it, I have also renamed the variable names that were used in this typedef not to use Hungarian notation. Signed-off-by: Ana Rey <anarey@gmail.com> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
This commit is contained in:
parent
8a8ec80643
commit
c0cfe01fbc
@ -250,11 +250,11 @@ typedef enum _LED_CTL_MODE {
|
||||
LED_CTL_POWER_OFF = 7
|
||||
} LED_CTL_MODE;
|
||||
|
||||
typedef enum _RT_RF_POWER_STATE {
|
||||
eRfOn,
|
||||
eRfSleep,
|
||||
eRfOff
|
||||
} RT_RF_POWER_STATE;
|
||||
enum rt_rf_power_state {
|
||||
RF_ON,
|
||||
RF_SLEEP,
|
||||
RF_OFF
|
||||
};
|
||||
|
||||
enum _ReasonCode {
|
||||
unspec_reason = 0x1,
|
||||
@ -467,8 +467,8 @@ struct r8180_priv {
|
||||
struct timer_list watch_dog_timer;
|
||||
bool bInactivePs;
|
||||
bool bSwRfProcessing;
|
||||
RT_RF_POWER_STATE eInactivePowerState;
|
||||
RT_RF_POWER_STATE eRFPowerState;
|
||||
enum rt_rf_power_state eInactivePowerState;
|
||||
enum rt_rf_power_state eRFPowerState;
|
||||
u32 RfOffReason;
|
||||
bool RFChangeInProgress;
|
||||
bool SetRFPowerStateInProgress;
|
||||
@ -694,7 +694,7 @@ void fix_tx_fifo(struct net_device *dev);
|
||||
void rtl8225z2_SetTXPowerLevel(struct net_device *dev, short ch);
|
||||
void rtl8180_rate_adapter(struct work_struct *work);
|
||||
/* #endif */
|
||||
bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
|
||||
bool MgntActSet_RF_State(struct net_device *dev, enum rt_rf_power_state StateToSet,
|
||||
u32 ChangeSource);
|
||||
|
||||
#endif
|
||||
|
@ -2439,7 +2439,7 @@ static short rtl8180_init(struct net_device *dev)
|
||||
priv->bInactivePs = true; /* false; */
|
||||
priv->ieee80211->bInactivePs = priv->bInactivePs;
|
||||
priv->bSwRfProcessing = false;
|
||||
priv->eRFPowerState = eRfOff;
|
||||
priv->eRFPowerState = RF_OFF;
|
||||
priv->RfOffReason = 0;
|
||||
priv->led_strategy = SW_LED_MODE0;
|
||||
priv->TxPollingTimes = 0; /* lzm add 080826 */
|
||||
@ -2967,7 +2967,7 @@ void rtl8180_watch_dog(struct net_device *dev)
|
||||
if ((priv->ieee80211->iw_mode != IW_MODE_ADHOC) &&
|
||||
(priv->ieee80211->state == IEEE80211_NOLINK) &&
|
||||
(priv->ieee80211->beinretry == false) &&
|
||||
(priv->eRFPowerState == eRfOn))
|
||||
(priv->eRFPowerState == RF_ON))
|
||||
IPSEnter(dev);
|
||||
}
|
||||
/* YJ,add,080828,for link state check */
|
||||
@ -3101,7 +3101,7 @@ int rtl8180_down(struct net_device *dev)
|
||||
cancel_delayed_work(&priv->ieee80211->hw_dig_wq);
|
||||
cancel_delayed_work(&priv->ieee80211->tx_pw_wq);
|
||||
del_timer_sync(&priv->SwAntennaDiversityTimer);
|
||||
SetZebraRFPowerState8185(dev, eRfOff);
|
||||
SetZebraRFPowerState8185(dev, RF_OFF);
|
||||
memset(&priv->ieee80211->current_network,
|
||||
0, sizeof(struct ieee80211_network));
|
||||
priv->ieee80211->state = IEEE80211_NOLINK;
|
||||
@ -3752,7 +3752,7 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work)
|
||||
struct r8180_priv *priv = ieee80211_priv(dev);
|
||||
u8 btPSR;
|
||||
u8 btConfig0;
|
||||
RT_RF_POWER_STATE eRfPowerStateToSet;
|
||||
enum rt_rf_power_state eRfPowerStateToSet;
|
||||
bool bActuallySet = false;
|
||||
|
||||
char *argv[3];
|
||||
@ -3774,18 +3774,18 @@ void GPIOChangeRFWorkItemCallBack(struct work_struct *work)
|
||||
/* HW radio On/Off according to the value of FF51[4](config0) */
|
||||
btConfig0 = btPSR = read_nic_byte(dev, CONFIG0);
|
||||
|
||||
eRfPowerStateToSet = (btConfig0 & BIT4) ? eRfOn : eRfOff;
|
||||
eRfPowerStateToSet = (btConfig0 & BIT4) ? RF_ON : RF_OFF;
|
||||
|
||||
/* Turn LED back on when radio enabled */
|
||||
if (eRfPowerStateToSet == eRfOn)
|
||||
if (eRfPowerStateToSet == RF_ON)
|
||||
write_nic_byte(dev, PSR, btPSR | BIT3);
|
||||
|
||||
if ((priv->ieee80211->bHwRadioOff == true) &&
|
||||
(eRfPowerStateToSet == eRfOn)) {
|
||||
(eRfPowerStateToSet == RF_ON)) {
|
||||
priv->ieee80211->bHwRadioOff = false;
|
||||
bActuallySet = true;
|
||||
} else if ((priv->ieee80211->bHwRadioOff == false) &&
|
||||
(eRfPowerStateToSet == eRfOff)) {
|
||||
(eRfPowerStateToSet == RF_OFF)) {
|
||||
priv->ieee80211->bHwRadioOff = true;
|
||||
bActuallySet = true;
|
||||
}
|
||||
|
@ -1116,14 +1116,14 @@ bool CheckTxPwrTracking(struct net_device *dev)
|
||||
void SwAntennaDiversityTimerCallback(struct net_device *dev)
|
||||
{
|
||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||
RT_RF_POWER_STATE rtState;
|
||||
enum rt_rf_power_state rtState;
|
||||
|
||||
/* We do NOT need to switch antenna while RF is off. */
|
||||
rtState = priv->eRFPowerState;
|
||||
do {
|
||||
if (rtState == eRfOff) {
|
||||
if (rtState == RF_OFF) {
|
||||
break;
|
||||
} else if (rtState == eRfSleep) {
|
||||
} else if (rtState == RF_SLEEP) {
|
||||
/* Don't access BB/RF under Disable PLL situation. */
|
||||
break;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ u16 RF_ReadReg(struct net_device *dev, u8 offset);
|
||||
void rtl8180_set_mode(struct net_device *dev, int mode);
|
||||
void rtl8180_set_mode(struct net_device *dev, int mode);
|
||||
bool SetZebraRFPowerState8185(struct net_device *dev,
|
||||
RT_RF_POWER_STATE eRFPowerState);
|
||||
enum rt_rf_power_state eRFPowerState);
|
||||
void rtl8225z4_rf_sleep(struct net_device *dev);
|
||||
void rtl8225z4_rf_wakeup(struct net_device *dev);
|
||||
|
||||
|
@ -650,7 +650,7 @@ void rtl8225z2_rf_set_mode(struct net_device *dev)
|
||||
#define LPS_MAX_SLEEP_WAITING_TIMES_87SE 5
|
||||
|
||||
bool SetZebraRFPowerState8185(struct net_device *dev,
|
||||
RT_RF_POWER_STATE eRFPowerState)
|
||||
enum rt_rf_power_state eRFPowerState)
|
||||
{
|
||||
struct r8180_priv *priv = ieee80211_priv(dev);
|
||||
u8 btCR9346, btConfig3;
|
||||
@ -672,7 +672,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
|
||||
write_nic_byte(dev, CONFIG3, (btConfig3 | CONFIG3_PARM_En));
|
||||
|
||||
switch (eRFPowerState) {
|
||||
case eRfOn:
|
||||
case RF_ON:
|
||||
write_nic_word(dev, 0x37C, 0x00EC);
|
||||
|
||||
/* turn on AFE */
|
||||
@ -697,7 +697,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
|
||||
u1bTmp = read_nic_byte(dev, 0x24E);
|
||||
write_nic_byte(dev, 0x24E, (u1bTmp & (~(BIT5 | BIT6))));
|
||||
break;
|
||||
case eRfSleep:
|
||||
case RF_SLEEP:
|
||||
for (QueueID = 0, i = 0; QueueID < 6;) {
|
||||
if (get_curr_tx_free_desc(dev, QueueID) ==
|
||||
priv->txringcount) {
|
||||
@ -764,7 +764,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case eRfOff:
|
||||
case RF_OFF:
|
||||
for (QueueID = 0, i = 0; QueueID < 6;) {
|
||||
if (get_curr_tx_free_desc(dev, QueueID) ==
|
||||
priv->txringcount) {
|
||||
@ -841,10 +841,10 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
|
||||
|
||||
void rtl8225z4_rf_sleep(struct net_device *dev)
|
||||
{
|
||||
MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS);
|
||||
MgntActSet_RF_State(dev, RF_SLEEP, RF_CHANGE_BY_PS);
|
||||
}
|
||||
|
||||
void rtl8225z4_rf_wakeup(struct net_device *dev)
|
||||
{
|
||||
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS);
|
||||
MgntActSet_RF_State(dev, RF_ON, RF_CHANGE_BY_PS);
|
||||
}
|
||||
|
@ -619,10 +619,10 @@ void UpdateInitialGain(struct net_device *dev)
|
||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||
|
||||
/* lzm add 080826 */
|
||||
if (priv->eRFPowerState != eRfOn) {
|
||||
if (priv->eRFPowerState != RF_ON) {
|
||||
/* Don't access BB/RF under disable PLL situation.
|
||||
* RT_TRACE(COMP_DIG, DBG_LOUD, ("UpdateInitialGain -
|
||||
* pHalData->eRFPowerState!=eRfOn\n"));
|
||||
* pHalData->eRFPowerState!=RF_ON\n"));
|
||||
* Back to the original state
|
||||
*/
|
||||
priv->InitialGain = priv->InitialGainBackUp;
|
||||
@ -1085,7 +1085,7 @@ static bool MgntDisconnect(struct net_device *dev, u8 asRsn)
|
||||
* PASSIVE LEVEL.
|
||||
*/
|
||||
static bool SetRFPowerState(struct net_device *dev,
|
||||
RT_RF_POWER_STATE eRFPowerState)
|
||||
enum rt_rf_power_state eRFPowerState)
|
||||
{
|
||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||
bool bResult = false;
|
||||
@ -1098,13 +1098,13 @@ static bool SetRFPowerState(struct net_device *dev,
|
||||
return bResult;
|
||||
}
|
||||
|
||||
bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
|
||||
bool MgntActSet_RF_State(struct net_device *dev, enum rt_rf_power_state StateToSet,
|
||||
u32 ChangeSource)
|
||||
{
|
||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||
bool bActionAllowed = false;
|
||||
bool bConnectBySSID = false;
|
||||
RT_RF_POWER_STATE rtState;
|
||||
enum rt_rf_power_state rtState;
|
||||
u16 RFWaitCounter = 0;
|
||||
unsigned long flag;
|
||||
/*
|
||||
@ -1140,7 +1140,7 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
|
||||
rtState = priv->eRFPowerState;
|
||||
|
||||
switch (StateToSet) {
|
||||
case eRfOn:
|
||||
case RF_ON:
|
||||
/*
|
||||
* Turn On RF no matter the IPS setting because we need to
|
||||
* update the RF state to Ndis under Vista, or the Windows
|
||||
@ -1153,13 +1153,13 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
|
||||
priv->RfOffReason = 0;
|
||||
bActionAllowed = true;
|
||||
|
||||
if (rtState == eRfOff &&
|
||||
if (rtState == RF_OFF &&
|
||||
ChangeSource >= RF_CHANGE_BY_HW)
|
||||
bConnectBySSID = true;
|
||||
}
|
||||
break;
|
||||
|
||||
case eRfOff:
|
||||
case RF_OFF:
|
||||
/* 070125, rcnjko: we always keep connected in AP mode. */
|
||||
|
||||
if (priv->RfOffReason > RF_CHANGE_BY_IPS) {
|
||||
@ -1182,7 +1182,7 @@ bool MgntActSet_RF_State(struct net_device *dev, RT_RF_POWER_STATE StateToSet,
|
||||
priv->RfOffReason |= ChangeSource;
|
||||
bActionAllowed = true;
|
||||
break;
|
||||
case eRfSleep:
|
||||
case RF_SLEEP:
|
||||
priv->RfOffReason |= ChangeSource;
|
||||
bActionAllowed = true;
|
||||
break;
|
||||
@ -1233,7 +1233,7 @@ static void InactivePowerSave(struct net_device *dev)
|
||||
void IPSEnter(struct net_device *dev)
|
||||
{
|
||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||
RT_RF_POWER_STATE rtState;
|
||||
enum rt_rf_power_state rtState;
|
||||
if (priv->bInactivePs) {
|
||||
rtState = priv->eRFPowerState;
|
||||
|
||||
@ -1245,9 +1245,9 @@ void IPSEnter(struct net_device *dev)
|
||||
* trigger IPS)(4) IBSS (send Beacon)
|
||||
* (5) AP mode (send Beacon)
|
||||
*/
|
||||
if (rtState == eRfOn && !priv->bSwRfProcessing
|
||||
if (rtState == RF_ON && !priv->bSwRfProcessing
|
||||
&& (priv->ieee80211->state != IEEE80211_LINKED)) {
|
||||
priv->eInactivePowerState = eRfOff;
|
||||
priv->eInactivePowerState = RF_OFF;
|
||||
InactivePowerSave(dev);
|
||||
}
|
||||
}
|
||||
@ -1255,13 +1255,13 @@ void IPSEnter(struct net_device *dev)
|
||||
void IPSLeave(struct net_device *dev)
|
||||
{
|
||||
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
|
||||
RT_RF_POWER_STATE rtState;
|
||||
enum rt_rf_power_state rtState;
|
||||
if (priv->bInactivePs) {
|
||||
rtState = priv->eRFPowerState;
|
||||
if ((rtState == eRfOff || rtState == eRfSleep) &&
|
||||
if ((rtState == RF_OFF || rtState == RF_SLEEP) &&
|
||||
!priv->bSwRfProcessing
|
||||
&& priv->RfOffReason <= RF_CHANGE_BY_IPS) {
|
||||
priv->eInactivePowerState = eRfOn;
|
||||
priv->eInactivePowerState = RF_ON;
|
||||
InactivePowerSave(dev);
|
||||
}
|
||||
}
|
||||
@ -1391,17 +1391,17 @@ void rtl8185b_adapter_start(struct net_device *dev)
|
||||
/* One of B, G, A. */
|
||||
InitWirelessMode = ieee->mode;
|
||||
}
|
||||
priv->eRFPowerState = eRfOff;
|
||||
priv->eRFPowerState = RF_OFF;
|
||||
priv->RfOffReason = 0;
|
||||
{
|
||||
MgntActSet_RF_State(dev, eRfOn, 0);
|
||||
MgntActSet_RF_State(dev, RF_ON, 0);
|
||||
}
|
||||
/*
|
||||
* If inactive power mode is enabled, disable rf while in
|
||||
* disconnected state.
|
||||
*/
|
||||
if (priv->bInactivePs)
|
||||
MgntActSet_RF_State(dev , eRfOff, RF_CHANGE_BY_IPS);
|
||||
MgntActSet_RF_State(dev , RF_OFF, RF_CHANGE_BY_IPS);
|
||||
|
||||
ActSetWirelessMode8185(dev, (u8)(InitWirelessMode));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user