Commit 480ab9dc authored by Mike McCormack's avatar Mike McCormack Committed by Greg Kroah-Hartman

staging: rtl8192e: Convert more functions to use r8192_priv

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d9ffa6c2
...@@ -317,10 +317,9 @@ static void r8192e_drain_tx_queues(struct r8192_priv *priv) ...@@ -317,10 +317,9 @@ static void r8192e_drain_tx_queues(struct r8192_priv *priv)
} }
} }
static bool static bool SetRFPowerState8190(struct r8192_priv *priv,
SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) RT_RF_POWER_STATE eRFPowerState)
{ {
struct r8192_priv *priv = ieee80211_priv(dev);
PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl; PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
bool bResult = true; bool bResult = true;
...@@ -342,7 +341,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) ...@@ -342,7 +341,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
* The current RF state is OFF and the RF OFF level * The current RF state is OFF and the RF OFF level
* is halting the NIC, re-initialize the NIC. * is halting the NIC, re-initialize the NIC.
*/ */
if (!NicIFEnableNIC(dev)) { if (!NicIFEnableNIC(priv)) {
RT_TRACE(COMP_ERR, "%s(): NicIFEnableNIC failed\n",__FUNCTION__); RT_TRACE(COMP_ERR, "%s(): NicIFEnableNIC failed\n",__FUNCTION__);
bResult = false; bResult = false;
goto out; goto out;
...@@ -386,7 +385,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) ...@@ -386,7 +385,7 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
r8192e_drain_tx_queues(priv); r8192e_drain_tx_queues(priv);
PHY_SetRtl8192eRfOff(dev); PHY_SetRtl8192eRfOff(priv);
break; break;
...@@ -401,13 +400,13 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) ...@@ -401,13 +400,13 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC && !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC)) if (pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC && !RT_IN_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC))
{ {
/* Disable all components. */ /* Disable all components. */
NicIFDisableNIC(dev); NicIFDisableNIC(priv);
RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC); RT_SET_PS_LEVEL(pPSC, RT_RF_OFF_LEVL_HALT_NIC);
} }
else if (!(pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC)) else if (!(pPSC->RegRfPsLevel & RT_RF_OFF_LEVL_HALT_NIC))
{ {
/* Normal case - IPS should go to this. */ /* Normal case - IPS should go to this. */
PHY_SetRtl8192eRfOff(dev); PHY_SetRtl8192eRfOff(priv);
} }
break; break;
...@@ -431,12 +430,8 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState) ...@@ -431,12 +430,8 @@ SetRFPowerState8190(struct net_device *dev, RT_RF_POWER_STATE eRFPowerState)
static void static void MgntDisconnectIBSS(struct r8192_priv *priv)
MgntDisconnectIBSS(
struct net_device* dev
)
{ {
struct r8192_priv *priv = ieee80211_priv(dev);
u8 i; u8 i;
bool bFilterOutNonAssociatedBSSID = false; bool bFilterOutNonAssociatedBSSID = false;
...@@ -498,14 +493,9 @@ MgntDisconnectIBSS( ...@@ -498,14 +493,9 @@ MgntDisconnectIBSS(
} }
static void static void MlmeDisassociateRequest(struct r8192_priv *priv, u8 *asSta,
MlmeDisassociateRequest( u8 asRsn)
struct net_device* dev,
u8* asSta,
u8 asRsn
)
{ {
struct r8192_priv *priv = ieee80211_priv(dev);
u8 i; u8 i;
RemovePeerTS(priv->ieee80211, asSta); RemovePeerTS(priv->ieee80211, asSta);
...@@ -557,9 +547,8 @@ MlmeDisassociateRequest( ...@@ -557,9 +547,8 @@ MlmeDisassociateRequest(
} }
static void MgntDisconnectAP(struct net_device *dev, u8 asRsn) static void MgntDisconnectAP(struct r8192_priv *priv, u8 asRsn)
{ {
struct r8192_priv *priv = ieee80211_priv(dev);
bool bFilterOutNonAssociatedBSSID = false; bool bFilterOutNonAssociatedBSSID = false;
u32 RegRCR, Type; u32 RegRCR, Type;
...@@ -578,26 +567,20 @@ static void MgntDisconnectAP(struct net_device *dev, u8 asRsn) ...@@ -578,26 +567,20 @@ static void MgntDisconnectAP(struct net_device *dev, u8 asRsn)
write_nic_dword(priv, RCR, RegRCR); write_nic_dword(priv, RCR, RegRCR);
priv->ReceiveConfig = RegRCR; priv->ReceiveConfig = RegRCR;
MlmeDisassociateRequest(dev, priv->ieee80211->current_network.bssid, asRsn); MlmeDisassociateRequest(priv, priv->ieee80211->current_network.bssid, asRsn);
priv->ieee80211->state = IEEE80211_NOLINK; priv->ieee80211->state = IEEE80211_NOLINK;
} }
static bool static bool MgntDisconnect(struct r8192_priv *priv, u8 asRsn)
MgntDisconnect(
struct net_device* dev,
u8 asRsn
)
{ {
struct r8192_priv *priv = ieee80211_priv(dev);
// In adhoc mode, update beacon frame. // In adhoc mode, update beacon frame.
if( priv->ieee80211->state == IEEE80211_LINKED ) if( priv->ieee80211->state == IEEE80211_LINKED )
{ {
if( priv->ieee80211->iw_mode == IW_MODE_ADHOC ) if( priv->ieee80211->iw_mode == IW_MODE_ADHOC )
{ {
MgntDisconnectIBSS(dev); MgntDisconnectIBSS(priv);
} }
if( priv->ieee80211->iw_mode == IW_MODE_INFRA ) if( priv->ieee80211->iw_mode == IW_MODE_INFRA )
{ {
...@@ -606,7 +589,7 @@ MgntDisconnect( ...@@ -606,7 +589,7 @@ MgntDisconnect(
// e.g. OID_802_11_DISASSOCIATE in Windows while as MgntDisconnectAP() is // e.g. OID_802_11_DISASSOCIATE in Windows while as MgntDisconnectAP() is
// used to handle disassociation related things to AP, e.g. send Disassoc // used to handle disassociation related things to AP, e.g. send Disassoc
// frame to AP. 2005.01.27, by rcnjko. // frame to AP. 2005.01.27, by rcnjko.
MgntDisconnectAP(dev, asRsn); MgntDisconnectAP(priv, asRsn);
} }
} }
...@@ -665,7 +648,7 @@ MgntActSet_RF_State( ...@@ -665,7 +648,7 @@ MgntActSet_RF_State(
if (priv->RfOffReason > RF_CHANGE_BY_IPS) if (priv->RfOffReason > RF_CHANGE_BY_IPS)
{ {
// Disconnect to current BSS when radio off. Asked by QuanTa. // Disconnect to current BSS when radio off. Asked by QuanTa.
MgntDisconnect(dev, disas_lv_ss); MgntDisconnect(priv, disas_lv_ss);
} }
priv->RfOffReason |= ChangeSource; priv->RfOffReason |= ChangeSource;
...@@ -682,7 +665,7 @@ MgntActSet_RF_State( ...@@ -682,7 +665,7 @@ MgntActSet_RF_State(
{ {
RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n", StateToSet, priv->RfOffReason); RT_TRACE(COMP_POWER, "MgntActSet_RF_State(): Action is allowed.... StateToSet(%d), RfOffReason(%#X)\n", StateToSet, priv->RfOffReason);
// Config HW to the specified mode. // Config HW to the specified mode.
SetRFPowerState8190(dev, StateToSet); SetRFPowerState8190(priv, StateToSet);
} }
else else
{ {
......
...@@ -1059,7 +1059,7 @@ int rtl8192_down(struct net_device *dev); ...@@ -1059,7 +1059,7 @@ int rtl8192_down(struct net_device *dev);
int rtl8192_up(struct net_device *dev); int rtl8192_up(struct net_device *dev);
void rtl8192_commit(struct net_device *dev); void rtl8192_commit(struct net_device *dev);
void write_phy(struct net_device *dev, u8 adr, u8 data); void write_phy(struct net_device *dev, u8 adr, u8 data);
void CamResetAllEntry(struct net_device* dev); void CamResetAllEntry(struct r8192_priv *priv);
void EnableHWSecurityConfig8192(struct net_device *dev); void EnableHWSecurityConfig8192(struct net_device *dev);
void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent ); void setKey(struct net_device *dev, u8 EntryNo, u8 KeyIndex, u16 KeyType, const u8 *MacAddr, u8 DefaultKey, u32 *KeyContent );
void dm_cck_txpower_adjust(struct net_device *dev, bool binch14); void dm_cck_txpower_adjust(struct net_device *dev, bool binch14);
...@@ -1079,8 +1079,8 @@ void LeisurePSEnter(struct net_device *dev); ...@@ -1079,8 +1079,8 @@ void LeisurePSEnter(struct net_device *dev);
void LeisurePSLeave(struct net_device *dev); void LeisurePSLeave(struct net_device *dev);
#endif #endif
bool NicIFEnableNIC(struct net_device* dev); bool NicIFEnableNIC(struct r8192_priv *priv);
bool NicIFDisableNIC(struct net_device* dev); bool NicIFDisableNIC(struct r8192_priv *priv);
void PHY_SetRtl8192eRfOff(struct net_device* dev); void PHY_SetRtl8192eRfOff(struct r8192_priv *priv);
#endif #endif
This diff is collapsed.
...@@ -887,7 +887,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev, ...@@ -887,7 +887,7 @@ static int r8192_wx_set_enc_ext(struct net_device *dev,
ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01 ext->alg == IW_ENCODE_ALG_NONE) //none is not allowed to use hwsec WB 2008.07.01
{ {
ieee->pairwise_key_type = ieee->group_key_type = KEY_TYPE_NA; ieee->pairwise_key_type = ieee->group_key_type = KEY_TYPE_NA;
CamResetAllEntry(dev); CamResetAllEntry(priv);
goto end_hw_sec; goto end_hw_sec;
} }
alg = (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg; // as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4; alg = (ext->alg == IW_ENCODE_ALG_CCMP)?KEY_TYPE_CCMP:ext->alg; // as IW_ENCODE_ALG_CCMP is defined to be 3 and KEY_TYPE_CCMP is defined to 4;
......
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