From d1c580aa706ad49a670af9c7188d1e13c319bd9a Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 10 Mar 2011 22:33:47 +0900 Subject: [PATCH] staging: rtl8192e: Pass ieee80211_device to callbacks Signed-off-by: Mike McCormack Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8192e/ieee80211/ieee80211.h | 12 +++---- .../staging/rtl8192e/ieee80211/ieee80211_rx.c | 2 +- .../rtl8192e/ieee80211/ieee80211_softmac.c | 12 +++---- .../rtl8192e/ieee80211/ieee80211_softmac_wx.c | 12 +++---- .../staging/rtl8192e/ieee80211/ieee80211_tx.c | 2 +- .../staging/rtl8192e/ieee80211/ieee80211_wx.c | 4 +-- drivers/staging/rtl8192e/r8192E.h | 8 ++--- drivers/staging/rtl8192e/r8192E_core.c | 36 +++++++++---------- drivers/staging/rtl8192e/r8192E_wx.c | 2 +- 9 files changed, 44 insertions(+), 46 deletions(-) diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211.h b/drivers/staging/rtl8192e/ieee80211/ieee80211.h index 57ff8e55bd63..8bbf79d29300 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211.h @@ -1803,7 +1803,7 @@ struct ieee80211_device { u8 LPSDelayCnt; bool bIsAggregateFrame; bool polling; - void (*LeisurePSLeave)(struct net_device *dev); + void (*LeisurePSLeave)(struct ieee80211_device *ieee); #endif #ifdef ENABLE_IPS @@ -1811,10 +1811,10 @@ struct ieee80211_device { bool wx_set_enc; struct semaphore ips_sem; struct work_struct ips_leave_wq; - void (*ieee80211_ips_leave_wq) (struct net_device *dev); - void (*ieee80211_ips_leave)(struct net_device *dev); + void (*ieee80211_ips_leave_wq) (struct ieee80211_device *ieee); + void (*ieee80211_ips_leave)(struct ieee80211_device *ieee); #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); //hw security related @@ -2099,7 +2099,7 @@ struct ieee80211_device { struct workqueue_struct *wq; /* Callback functions */ - void (*set_security)(struct net_device *dev, + void (*set_security)(struct ieee80211_device *ieee, struct ieee80211_security *sec); /* Used to TX data frame by using txb structs. @@ -2107,7 +2107,7 @@ struct ieee80211_device { * is set the flag IEEE_SOFTMAC_TX_QUEUE */ int (*hard_start_xmit)(struct ieee80211_txb *txb, - struct net_device *dev); + struct ieee80211_device *ieee); int (*reset_port)(struct net_device *dev); int (*is_queue_full) (struct net_device * dev, int pri); diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c index 57acb3f21adf..c57a90e41058 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c @@ -1341,7 +1341,7 @@ int ieee80211_rtl_rx(struct ieee80211_device *ieee, struct sk_buff *skb, (ieee->LinkDetectInfo.NumRxUnicastOkInPeriod > 2) ) { if(ieee->LeisurePSLeave) - ieee->LeisurePSLeave(dev); + ieee->LeisurePSLeave(ieee); } } } diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c index b4fea6f7509e..d75c731157ba 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac.c @@ -609,7 +609,7 @@ void ieee80211_rtl_start_scan(struct ieee80211_device *ieee) { #ifdef ENABLE_IPS if(ieee->ieee80211_ips_leave_wq != NULL) - ieee->ieee80211_ips_leave_wq(ieee->dev); + ieee->ieee80211_ips_leave_wq(ieee); #endif #ifdef ENABLE_DOT11D @@ -1408,7 +1408,7 @@ void ieee80211_associate_procedure_wq(struct work_struct *work) ieee->sync_scan_hurryup = 1; #ifdef ENABLE_IPS if(ieee->ieee80211_ips_leave != NULL) - ieee->ieee80211_ips_leave(ieee->dev); + ieee->ieee80211_ips_leave(ieee); #endif down(&ieee->wx_sem); @@ -2522,7 +2522,7 @@ void ieee80211_start_bss(struct ieee80211_device *ieee) if (ieee->state == IEEE80211_NOLINK){ #ifdef ENABLE_IPS if(ieee->ieee80211_ips_leave_wq != NULL) - ieee->ieee80211_ips_leave_wq(ieee->dev); + ieee->ieee80211_ips_leave_wq(ieee); #endif ieee->actscanning = true; ieee80211_rtl_start_scan(ieee); @@ -2933,7 +2933,7 @@ static int ieee80211_wpa_set_auth_algs(struct ieee80211_device *ieee, int value) if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); + ieee->set_security(ieee, &sec); return ret; } @@ -2981,7 +2981,7 @@ static int ieee80211_wpa_set_param(struct ieee80211_device *ieee, u8 name, u32 v sec.level = SEC_LEVEL_1; } if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); + ieee->set_security(ieee, &sec); break; } @@ -3147,7 +3147,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee, } done: 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 * generate new IEEE 802.11 authentication which may end up in looping diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c index 427dfc1d0ffa..f82bb7d6203d 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_softmac_wx.c @@ -70,7 +70,7 @@ int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_request_info } #endif 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->state == IEEE80211_LINKED){ @@ -307,7 +307,7 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) #ifdef ENABLE_LPS if (ieee->LeisurePSLeave) { - ieee->LeisurePSLeave(ieee->dev); + ieee->LeisurePSLeave(ieee); } /* notify AP to be in PS mode */ @@ -334,14 +334,14 @@ void ieee80211_wx_sync_scan_wq(struct work_struct *work) if (b40M) { printk("Scan in 20M, back to 40M\n"); 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) - ieee->set_chan(ieee->dev, chan - 2); + ieee->set_chan(ieee, chan - 2); else - ieee->set_chan(ieee->dev, chan); + ieee->set_chan(ieee, chan); ieee->SetBWModeHandler(ieee->dev, bandwidth, chan_offset); } else { - ieee->set_chan(ieee->dev, chan); + ieee->set_chan(ieee, chan); } ieee->InitialGainHandler(ieee->dev,IG_Restore); diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c index 17535a23c57b..ea715a2d4dc3 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_tx.c @@ -935,7 +935,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb, struct net_device *dev) if (ieee->softmac_features & IEEE_SOFTMAC_TX_QUEUE){ ieee80211_softmac_xmit(txb, ieee); }else{ - if ((*ieee->hard_start_xmit)(txb, dev) == 0) { + if ((*ieee->hard_start_xmit)(txb, ieee) == 0) { stats->tx_packets++; stats->tx_bytes += txb->payload_size; return 0; diff --git a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c index bb0ff26bd843..ef3a9b202d42 100644 --- a/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192e/ieee80211/ieee80211_wx.c @@ -463,7 +463,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, sec.level = SEC_LEVEL_1; /* 40 and 104 bit WEP */ 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 * 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, #endif done: if (ieee->set_security) - ieee->set_security(ieee->dev, &sec); + ieee->set_security(ieee, &sec); if (ieee->reset_on_keychange && ieee->iw_mode != IW_MODE_INFRA && diff --git a/drivers/staging/rtl8192e/r8192E.h b/drivers/staging/rtl8192e/r8192E.h index 9ff0548f188e..8052d0cf9fb9 100644 --- a/drivers/staging/rtl8192e/r8192E.h +++ b/drivers/staging/rtl8192e/r8192E.h @@ -1133,12 +1133,12 @@ RT_STATUS cmpk_message_handle_tx(struct net_device *dev, u8* codevirtualaddress, void IPSEnter(struct r8192_priv *priv); void IPSLeave(struct r8192_priv *priv); void IPSLeave_wq(struct work_struct *work); -void ieee80211_ips_leave_wq(struct net_device *dev); -void ieee80211_ips_leave(struct net_device *dev); +void ieee80211_ips_leave_wq(struct ieee80211_device *ieee80211); +void ieee80211_ips_leave(struct ieee80211_device *ieee80211); #endif #ifdef ENABLE_LPS -void LeisurePSEnter(struct net_device *dev); -void LeisurePSLeave(struct net_device *dev); +void LeisurePSEnter(struct ieee80211_device *ieee80211); +void LeisurePSLeave(struct ieee80211_device *ieee80211); #endif bool NicIFEnableNIC(struct r8192_priv *priv); diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c index c392f19b0bdb..efd7e7f0a4f0 100644 --- a/drivers/staging/rtl8192e/r8192E_core.c +++ b/drivers/staging/rtl8192e/r8192E_core.c @@ -271,10 +271,9 @@ u8 rtl8192e_ap_sec_type(struct ieee80211_device *ieee) } } -void -rtl8192e_SetHwReg(struct net_device *dev,u8 variable,u8* val) +void rtl8192e_SetHwReg(struct ieee80211_device *ieee80211, u8 variable, u8 *val) { - struct r8192_priv* priv = ieee80211_priv(dev); + struct r8192_priv *priv = ieee80211_priv(ieee80211->dev); switch(variable) { @@ -748,13 +747,12 @@ void PHY_SetRtl8192eRfOff(struct r8192_priv *priv) static void rtl8192_halt_adapter(struct r8192_priv *priv, bool reset) { - struct net_device *dev = priv->ieee80211->dev; int i; u8 OpMode; u32 ulRegRead; 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) { /* @@ -3071,9 +3069,9 @@ bool MgntActSet_802_11_PowerSaveMode(struct r8192_priv *priv, u8 rtPsMode) } /* 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; if(!((priv->ieee80211->iw_mode == IW_MODE_INFRA) && @@ -3101,9 +3099,9 @@ void LeisurePSEnter(struct net_device *dev) /* 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; if (pPSC->bLeisurePs) @@ -3181,9 +3179,9 @@ void IPSLeave_wq(struct work_struct *work) 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; rtState = priv->eRFPowerState; @@ -3202,12 +3200,12 @@ void ieee80211_ips_leave_wq(struct net_device *dev) } } //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); - down(&priv->ieee80211->ips_sem); + struct r8192_priv *priv = ieee80211_priv(ieee80211->dev); + down(&ieee80211->ips_sem); IPSLeave(priv); - up(&priv->ieee80211->ips_sem); + up(&ieee80211->ips_sem); } #endif @@ -3283,11 +3281,11 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) // LeisurePS only work in infra mode. if(bEnterPS) { - LeisurePSEnter(dev); + LeisurePSEnter(priv->ieee80211); } else { - LeisurePSLeave(dev); + LeisurePSLeave(priv->ieee80211); } #endif @@ -3295,7 +3293,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work) else { #ifdef ENABLE_LPS - LeisurePSLeave(dev); + LeisurePSLeave(priv->ieee80211); #endif } @@ -3449,7 +3447,7 @@ int rtl8192_down(struct net_device *dev) #ifdef ENABLE_LPS //LZM for PS-Poll AID issue. 090429 if(priv->ieee80211->state == IEEE80211_LINKED) - LeisurePSLeave(dev); + LeisurePSLeave(priv->ieee80211); #endif priv->up=0; diff --git a/drivers/staging/rtl8192e/r8192E_wx.c b/drivers/staging/rtl8192e/r8192E_wx.c index f76377602da6..adad91b0b6b1 100644 --- a/drivers/staging/rtl8192e/r8192E_wx.c +++ b/drivers/staging/rtl8192e/r8192E_wx.c @@ -1006,7 +1006,7 @@ static int r8192_wx_adapter_power_status(struct net_device *dev, } else { //LZM for PS-Poll AID issue. 090429 if(priv->ieee80211->state == IEEE80211_LINKED) - LeisurePSLeave(dev); + LeisurePSLeave(priv->ieee80211); priv->ps_force = true; pPSC->bLeisurePs = false;