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

staging: rtl8192e: Pass ieee80211_device to callbacks

Signed-off-by: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 09145962
...@@ -1803,7 +1803,7 @@ struct ieee80211_device { ...@@ -1803,7 +1803,7 @@ struct ieee80211_device {
u8 LPSDelayCnt; u8 LPSDelayCnt;
bool bIsAggregateFrame; bool bIsAggregateFrame;
bool polling; bool polling;
void (*LeisurePSLeave)(struct net_device *dev); void (*LeisurePSLeave)(struct ieee80211_device *ieee);
#endif #endif
#ifdef ENABLE_IPS #ifdef ENABLE_IPS
...@@ -1811,10 +1811,10 @@ struct ieee80211_device { ...@@ -1811,10 +1811,10 @@ struct ieee80211_device {
bool wx_set_enc; bool wx_set_enc;
struct semaphore ips_sem; struct semaphore ips_sem;
struct work_struct ips_leave_wq; struct work_struct ips_leave_wq;
void (*ieee80211_ips_leave_wq) (struct net_device *dev); void (*ieee80211_ips_leave_wq) (struct ieee80211_device *ieee);
void (*ieee80211_ips_leave)(struct net_device *dev); void (*ieee80211_ips_leave)(struct ieee80211_device *ieee);
#endif #endif
void (*SetHwRegHandler)(struct net_device *dev,u8 variable,u8* val); void (*SetHwRegHandler)(struct ieee80211_device *ieee, u8 variable, u8 *val);
u8 (*rtllib_ap_sec_type)(struct ieee80211_device *ieee); u8 (*rtllib_ap_sec_type)(struct ieee80211_device *ieee);
//hw security related //hw security related
...@@ -2099,7 +2099,7 @@ struct ieee80211_device { ...@@ -2099,7 +2099,7 @@ struct ieee80211_device {
struct workqueue_struct *wq; struct workqueue_struct *wq;
/* Callback functions */ /* Callback functions */
void (*set_security)(struct net_device *dev, void (*set_security)(struct ieee80211_device *ieee,
struct ieee80211_security *sec); struct ieee80211_security *sec);
/* Used to TX data frame by using txb structs. /* Used to TX data frame by using txb structs.
...@@ -2107,7 +2107,7 @@ struct ieee80211_device { ...@@ -2107,7 +2107,7 @@ struct ieee80211_device {
* is set the flag IEEE_SOFTMAC_TX_QUEUE * is set the flag IEEE_SOFTMAC_TX_QUEUE
*/ */
int (*hard_start_xmit)(struct ieee80211_txb *txb, int (*hard_start_xmit)(struct ieee80211_txb *txb,
struct net_device *dev); struct ieee80211_device *ieee);
int (*reset_port)(struct net_device *dev); int (*reset_port)(struct net_device *dev);
int (*is_queue_full) (struct net_device * dev, int pri); int (*is_queue_full) (struct net_device * dev, int pri);
......
...@@ -1341,7 +1341,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, ...@@ -1341,7 +1341,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
(ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) ) (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) )
{ {
if(ieee->LeisurePSLeave) if(ieee->LeisurePSLeave)
ieee->LeisurePSLeave(dev); ieee->LeisurePSLeave(ieee);
} }
} }
} }
......
...@@ -609,7 +609,7 @@ void ieee80211_rtl_start_scan(struct ieee80211_device *ieee) ...@@ -609,7 +609,7 @@ void ieee80211_rtl_start_scan(struct ieee80211_device *ieee)
{ {
#ifdef ENABLE_IPS #ifdef ENABLE_IPS
if(ieee->ieee80211_ips_leave_wq != NULL) if(ieee->ieee80211_ips_leave_wq != NULL)
ieee->ieee80211_ips_leave_wq(ieee->dev); ieee->ieee80211_ips_leave_wq(ieee);
#endif #endif
#ifdef ENABLE_DOT11D #ifdef ENABLE_DOT11D
...@@ -1408,7 +1408,7 @@ void ieee80211_associate_procedure_wq(struct work_struct *work) ...@@ -1408,7 +1408,7 @@ void ieee80211_associate_procedure_wq(struct work_struct *work)
ieee->sync_scan_hurryup = 1; ieee->sync_scan_hurryup = 1;
#ifdef ENABLE_IPS #ifdef ENABLE_IPS
if(ieee->ieee80211_ips_leave != NULL) if(ieee->ieee80211_ips_leave != NULL)
ieee->ieee80211_ips_leave(ieee->dev); ieee->ieee80211_ips_leave(ieee);
#endif #endif
down(&ieee->wx_sem); down(&ieee->wx_sem);
...@@ -2522,7 +2522,7 @@ void ieee80211_start_bss(struct ieee80211_device *ieee) ...@@ -2522,7 +2522,7 @@ void ieee80211_start_bss(struct ieee80211_device *ieee)
if (ieee->state == IEEE80211_NOLINK){ if (ieee->state == IEEE80211_NOLINK){
#ifdef ENABLE_IPS #ifdef ENABLE_IPS
if(ieee->ieee80211_ips_leave_wq != NULL) if(ieee->ieee80211_ips_leave_wq != NULL)
ieee->ieee80211_ips_leave_wq(ieee->dev); ieee->ieee80211_ips_leave_wq(ieee);
#endif #endif
ieee->actscanning = true; ieee->actscanning = true;
ieee80211_rtl_start_scan(ieee); ieee80211_rtl_start_scan(ieee);
...@@ -2933,7 +2933,7 @@ static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value) ...@@ -2933,7 +2933,7 @@ static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value)
if (ieee->set_security) if (ieee->set_security)
ieee->set_security(ieee->dev, &sec); ieee->set_security(ieee, &sec);
return ret; return ret;
} }
...@@ -2981,7 +2981,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v ...@@ -2981,7 +2981,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v
sec.level = SEC_LEVEL_1; sec.level = SEC_LEVEL_1;
} }
if (ieee->set_security) if (ieee->set_security)
ieee->set_security(ieee->dev, &sec); ieee->set_security(ieee, &sec);
break; break;
} }
...@@ -3147,7 +3147,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, ...@@ -3147,7 +3147,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
} }
done: done:
if (ieee->set_security) if (ieee->set_security)
ieee->set_security(ieee->dev, &sec); ieee->set_security(ieee, &sec);
/* Do not reset port if card is in Managed mode since resetting will /* Do not reset port if card is in Managed mode since resetting will
* generate new IEEE 802.11 authentication which may end up in looping * generate new IEEE 802.11 authentication which may end up in looping
......
...@@ -70,7 +70,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info ...@@ -70,7 +70,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info
} }
#endif #endif
ieee->current_network.channel = fwrq->m; ieee->current_network.channel = fwrq->m;
ieee->set_chan(ieee->dev, ieee->current_network.channel); ieee->set_chan(ieee, ieee->current_network.channel);
if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER) if(ieee->iw_mode == IW_MODE_ADHOC || ieee->iw_mode == IW_MODE_MASTER)
if(ieee->state == IEEE80211_LINKED){ if(ieee->state == IEEE80211_LINKED){
...@@ -307,7 +307,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) ...@@ -307,7 +307,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
#ifdef ENABLE_LPS #ifdef ENABLE_LPS
if (ieee->LeisurePSLeave) { if (ieee->LeisurePSLeave) {
ieee->LeisurePSLeave(ieee->dev); ieee->LeisurePSLeave(ieee);
} }
/* notify AP to be in PS mode */ /* notify AP to be in PS mode */
...@@ -334,14 +334,14 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) ...@@ -334,14 +334,14 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work)
if (b40M) { if (b40M) {
printk("Scan in 20M, back to 40M\n"); printk("Scan in 20M, back to 40M\n");
if (chan_offset == HT_EXTCHNL_OFFSET_UPPER) if (chan_offset == HT_EXTCHNL_OFFSET_UPPER)
ieee->set_chan(ieee->dev, chan + 2); ieee->set_chan(ieee, chan + 2);
else if (chan_offset == HT_EXTCHNL_OFFSET_LOWER) else if (chan_offset == HT_EXTCHNL_OFFSET_LOWER)
ieee->set_chan(ieee->dev, chan - 2); ieee->set_chan(ieee, chan - 2);
else else
ieee->set_chan(ieee->dev, chan); ieee->set_chan(ieee, chan);
ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset); ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset);
} else { } else {
ieee->set_chan(ieee->dev, chan); ieee->set_chan(ieee, chan);
} }
ieee->InitialGainHandler(ieee->dev,IG_Restore); ieee->InitialGainHandler(ieee->dev,IG_Restore);
......
...@@ -935,7 +935,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -935,7 +935,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev)
if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){ if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){
ieee80211_softmac_xmit(txb, ieee); ieee80211_softmac_xmit(txb, ieee);
}else{ }else{
if ((*ieee->hard_start_xmit)(txb, dev) == 0) { if ((*ieee->hard_start_xmit)(txb, ieee) == 0) {
stats->tx_packets++; stats->tx_packets++;
stats->tx_bytes += txb->payload_size; stats->tx_bytes += txb->payload_size;
return 0; return 0;
......
...@@ -463,7 +463,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, ...@@ -463,7 +463,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee,
sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */ sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */
if (ieee->set_security) if (ieee->set_security)
ieee->set_security(dev, &sec); ieee->set_security(ieee, &sec);
/* Do not reset port if card is in Managed mode since resetting will /* Do not reset port if card is in Managed mode since resetting will
* generate new IEEE 802.11 authentication which may end up in looping * generate new IEEE 802.11 authentication which may end up in looping
...@@ -696,7 +696,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, ...@@ -696,7 +696,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee,
#endif #endif
done: done:
if (ieee->set_security) if (ieee->set_security)
ieee->set_security(ieee->dev, &sec); ieee->set_security(ieee, &sec);
if (ieee->reset_on_keychange && if (ieee->reset_on_keychange &&
ieee->iw_mode != IW_MODE_INFRA && ieee->iw_mode != IW_MODE_INFRA &&
......
...@@ -1133,12 +1133,12 @@ RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, ...@@ -1133,12 +1133,12 @@ RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress,
void IPSEnter(struct r8192_priv *priv); void IPSEnter(struct r8192_priv *priv);
void IPSLeave(struct r8192_priv *priv); void IPSLeave(struct r8192_priv *priv);
void IPSLeave_wq(struct work_struct *work); void IPSLeave_wq(struct work_struct *work);
void ieee80211_ips_leave_wq(struct net_device *dev); void ieee80211_ips_leave_wq(struct ieee80211_device *ieee80211);
void ieee80211_ips_leave(struct net_device *dev); void ieee80211_ips_leave(struct ieee80211_device *ieee80211);
#endif #endif
#ifdef ENABLE_LPS #ifdef ENABLE_LPS
void LeisurePSEnter(struct net_device *dev); void LeisurePSEnter(struct ieee80211_device *ieee80211);
void LeisurePSLeave(struct net_device *dev); void LeisurePSLeave(struct ieee80211_device *ieee80211);
#endif #endif
bool NicIFEnableNIC(struct r8192_priv *priv); bool NicIFEnableNIC(struct r8192_priv *priv);
......
...@@ -271,10 +271,9 @@ u8 rtl8192e_ap_sec_type(struct ieee80211_device *ieee) ...@@ -271,10 +271,9 @@ u8 rtl8192e_ap_sec_type(struct ieee80211_device *ieee)
} }
} }
void void rtl8192e_SetHwReg(struct ieee80211_device *ieee80211, u8 variable, u8 *val)
rtl8192e_SetHwReg(struct net_device *dev,u8 variable,u8* val)
{ {
struct r8192_priv* priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
switch(variable) switch(variable)
{ {
...@@ -748,13 +747,12 @@ void PHY_SetRtl8192eRfOff(struct r8192_priv *priv) ...@@ -748,13 +747,12 @@ void PHY_SetRtl8192eRfOff(struct r8192_priv *priv)
static void rtl8192_halt_adapter(struct r8192_priv *priv, bool reset) static void rtl8192_halt_adapter(struct r8192_priv *priv, bool reset)
{ {
struct net_device *dev = priv->ieee80211->dev;
int i; int i;
u8 OpMode; u8 OpMode;
u32 ulRegRead; u32 ulRegRead;
OpMode = RT_OP_MODE_NO_LINK; OpMode = RT_OP_MODE_NO_LINK;
priv->ieee80211->SetHwRegHandler(dev, HW_VAR_MEDIA_STATUS, &OpMode); priv->ieee80211->SetHwRegHandler(priv->ieee80211, HW_VAR_MEDIA_STATUS, &OpMode);
if (!priv->ieee80211->bSupportRemoteWakeUp) { if (!priv->ieee80211->bSupportRemoteWakeUp) {
/* /*
...@@ -3071,9 +3069,9 @@ bool MgntActSet_802_11_PowerSaveMode(struct r8192_priv *priv, u8 rtPsMode) ...@@ -3071,9 +3069,9 @@ bool MgntActSet_802_11_PowerSaveMode(struct r8192_priv *priv, u8 rtPsMode)
} }
/* Enter the leisure power save mode. */ /* Enter the leisure power save mode. */
void LeisurePSEnter(struct net_device *dev) void LeisurePSEnter(struct ieee80211_device *ieee80211)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl; PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
if(!((priv->ieee80211->iw_mode == IW_MODE_INFRA) && if(!((priv->ieee80211->iw_mode == IW_MODE_INFRA) &&
...@@ -3101,9 +3099,9 @@ void LeisurePSEnter(struct net_device *dev) ...@@ -3101,9 +3099,9 @@ void LeisurePSEnter(struct net_device *dev)
/* Leave leisure power save mode. */ /* Leave leisure power save mode. */
void LeisurePSLeave(struct net_device *dev) void LeisurePSLeave(struct ieee80211_device *ieee80211)
{ {
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl; PRT_POWER_SAVE_CONTROL pPSC = &priv->PowerSaveControl;
if (pPSC->bLeisurePs) if (pPSC->bLeisurePs)
...@@ -3181,9 +3179,9 @@ void IPSLeave_wq(struct work_struct *work) ...@@ -3181,9 +3179,9 @@ void IPSLeave_wq(struct work_struct *work)
up(&priv->ieee80211->ips_sem); up(&priv->ieee80211->ips_sem);
} }
void ieee80211_ips_leave_wq(struct net_device *dev) void ieee80211_ips_leave_wq(struct ieee80211_device *ieee80211)
{ {
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
RT_RF_POWER_STATE rtState; RT_RF_POWER_STATE rtState;
rtState = priv->eRFPowerState; rtState = priv->eRFPowerState;
...@@ -3202,12 +3200,12 @@ void ieee80211_ips_leave_wq(struct net_device *dev) ...@@ -3202,12 +3200,12 @@ void ieee80211_ips_leave_wq(struct net_device *dev)
} }
} }
//added by amy 090331 end //added by amy 090331 end
void ieee80211_ips_leave(struct net_device *dev) void ieee80211_ips_leave(struct ieee80211_device *ieee80211)
{ {
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(ieee80211->dev);
down(&priv->ieee80211->ips_sem); down(&ieee80211->ips_sem);
IPSLeave(priv); IPSLeave(priv);
up(&priv->ieee80211->ips_sem); up(&ieee80211->ips_sem);
} }
#endif #endif
...@@ -3283,11 +3281,11 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) ...@@ -3283,11 +3281,11 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
// LeisurePS only work in infra mode. // LeisurePS only work in infra mode.
if(bEnterPS) if(bEnterPS)
{ {
LeisurePSEnter(dev); LeisurePSEnter(priv->ieee80211);
} }
else else
{ {
LeisurePSLeave(dev); LeisurePSLeave(priv->ieee80211);
} }
#endif #endif
...@@ -3295,7 +3293,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) ...@@ -3295,7 +3293,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
else else
{ {
#ifdef ENABLE_LPS #ifdef ENABLE_LPS
LeisurePSLeave(dev); LeisurePSLeave(priv->ieee80211);
#endif #endif
} }
...@@ -3449,7 +3447,7 @@ int rtl8192_down(struct net_device *dev) ...@@ -3449,7 +3447,7 @@ int rtl8192_down(struct net_device *dev)
#ifdef ENABLE_LPS #ifdef ENABLE_LPS
//LZM for PS-Poll AID issue. 090429 //LZM for PS-Poll AID issue. 090429
if(priv->ieee80211->state == IEEE80211_LINKED) if(priv->ieee80211->state == IEEE80211_LINKED)
LeisurePSLeave(dev); LeisurePSLeave(priv->ieee80211);
#endif #endif
priv->up=0; priv->up=0;
......
...@@ -1006,7 +1006,7 @@ static int r8192_wx_adapter_power_status(struct net_device *dev, ...@@ -1006,7 +1006,7 @@ static int r8192_wx_adapter_power_status(struct net_device *dev,
} else { } else {
//LZM for PS-Poll AID issue. 090429 //LZM for PS-Poll AID issue. 090429
if(priv->ieee80211->state == IEEE80211_LINKED) if(priv->ieee80211->state == IEEE80211_LINKED)
LeisurePSLeave(dev); LeisurePSLeave(priv->ieee80211);
priv->ps_force = true; priv->ps_force = true;
pPSC->bLeisurePs = false; pPSC->bLeisurePs = false;
......
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