提交 08d348a0 编写于 作者: L Larry Finger 提交者: Greg Kroah-Hartman

staging: rtl8192e: Cleanup checkpatch -f warnings and errors - Part XVIII

Signed-off-by: NLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 62f27cc4
...@@ -23,42 +23,38 @@ ...@@ -23,42 +23,38 @@
#include "r8190P_rtl8256.h" #include "r8190P_rtl8256.h"
#include "rtl_pm.h" #include "rtl_pm.h"
int rtl8192E_save_state (struct pci_dev *dev, pm_message_t state) int rtl8192E_save_state(struct pci_dev *dev, pm_message_t state)
{ {
printk(KERN_NOTICE "r8192E save state call (state %u).\n", state.event); printk(KERN_NOTICE "r8192E save state call (state %u).\n", state.event);
return(-EAGAIN); return -EAGAIN;
} }
int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state) int rtl8192E_suspend(struct pci_dev *pdev, pm_message_t state)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
u32 ulRegRead; u32 ulRegRead;
RT_TRACE(COMP_POWER, "============> r8192E suspend call.\n"); printk(KERN_INFO "============> r8192E suspend call.\n");
printk("============> r8192E suspend call.\n");
del_timer_sync(&priv->gpio_polling_timer); del_timer_sync(&priv->gpio_polling_timer);
cancel_delayed_work(&priv->gpio_change_rf_wq); cancel_delayed_work(&priv->gpio_change_rf_wq);
priv->polling_timer_on = 0; priv->polling_timer_on = 0;
if (!netif_running(dev)){ if (!netif_running(dev)) {
printk("RTL819XE:UI is open out of suspend function\n"); printk(KERN_INFO "RTL819XE:UI is open out of suspend "
goto out_pci_suspend; "function\n");
} goto out_pci_suspend;
}
#ifdef HAVE_NET_DEVICE_OPS
if (dev->netdev_ops->ndo_stop) if (dev->netdev_ops->ndo_stop)
dev->netdev_ops->ndo_stop(dev); dev->netdev_ops->ndo_stop(dev);
#else
dev->stop(dev);
#endif
netif_device_detach(dev); netif_device_detach(dev);
if (!priv->rtllib->bSupportRemoteWakeUp) { if (!priv->rtllib->bSupportRemoteWakeUp) {
MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT,true); MgntActSet_RF_State(dev, eRfOff, RF_CHANGE_BY_INIT, true);
ulRegRead = read_nic_dword(dev, CPU_GEN); ulRegRead = read_nic_dword(dev, CPU_GEN);
ulRegRead|=CPU_GEN_SYSTEM_RESET; ulRegRead |= CPU_GEN_SYSTEM_RESET;
write_nic_dword(dev, CPU_GEN, ulRegRead); write_nic_dword(dev, CPU_GEN, ulRegRead);
} else { } else {
write_nic_dword(dev, WFCRC0, 0xffffffff); write_nic_dword(dev, WFCRC0, 0xffffffff);
...@@ -68,81 +64,73 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state) ...@@ -68,81 +64,73 @@ int rtl8192E_suspend (struct pci_dev *pdev, pm_message_t state)
write_nic_byte(dev, MacBlkCtrl, 0xa); write_nic_byte(dev, MacBlkCtrl, 0xa);
} }
out_pci_suspend: out_pci_suspend:
RT_TRACE(COMP_POWER, "r8192E support WOL call??????????????????????\n");
printk("r8192E support WOL call??????????????????????\n"); printk("r8192E support WOL call??????????????????????\n");
if (priv->rtllib->bSupportRemoteWakeUp) { if (priv->rtllib->bSupportRemoteWakeUp)
RT_TRACE(COMP_POWER, "r8192E support WOL call!!!!!!!!!!!!!!!!!!.\n"); RT_TRACE(COMP_POWER, "r8192E support WOL call!!!!!!!"
} "!!!!!!!!!!!.\n");
pci_save_state(pdev); pci_save_state(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_enable_wake(pdev, pci_choose_state(pdev,state),\ pci_enable_wake(pdev, pci_choose_state(pdev, state),
priv->rtllib->bSupportRemoteWakeUp?1:0); priv->rtllib->bSupportRemoteWakeUp ? 1 : 0);
pci_set_power_state(pdev,pci_choose_state(pdev,state)); pci_set_power_state(pdev, pci_choose_state(pdev, state));
mdelay(20); mdelay(20);
return 0; return 0;
} }
int rtl8192E_resume (struct pci_dev *pdev) int rtl8192E_resume(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
int err; int err;
u32 val; u32 val;
RT_TRACE(COMP_POWER, "================>r8192E resume call."); printk(KERN_INFO "================>r8192E resume call.\n");
printk("================>r8192E resume call.\n");
pci_set_power_state(pdev, PCI_D0);
err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name);
return err;
}
pci_restore_state(pdev);
pci_read_config_dword(pdev, 0x40, &val);
if ((val & 0x0000ff00) != 0) {
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
}
pci_enable_wake(pdev, PCI_D0, 0);
if (priv->polling_timer_on == 0){
check_rfctrl_gpio_timer((unsigned long)dev);
}
if (!netif_running(dev)){
printk("RTL819XE:UI is open out of resume function\n");
goto out;
}
netif_device_attach(dev);
#ifdef HAVE_NET_DEVICE_OPS
if (dev->netdev_ops->ndo_open)
dev->netdev_ops->ndo_open(dev);
#else
dev->open(dev);
#endif
if (!priv->rtllib->bSupportRemoteWakeUp) { pci_set_power_state(pdev, PCI_D0);
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_INIT,true);
} err = pci_enable_device(pdev);
if (err) {
printk(KERN_ERR "%s: pci_enable_device failed on resume\n",
dev->name);
return err;
}
pci_restore_state(pdev);
pci_read_config_dword(pdev, 0x40, &val);
if ((val & 0x0000ff00) != 0)
pci_write_config_dword(pdev, 0x40, val & 0xffff00ff);
pci_enable_wake(pdev, PCI_D0, 0);
if (priv->polling_timer_on == 0)
check_rfctrl_gpio_timer((unsigned long)dev);
if (!netif_running(dev)) {
printk(KERN_INFO "RTL819XE:UI is open out of resume "
"function\n");
goto out;
}
netif_device_attach(dev);
if (dev->netdev_ops->ndo_open)
dev->netdev_ops->ndo_open(dev);
if (!priv->rtllib->bSupportRemoteWakeUp)
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_INIT, true);
out: out:
RT_TRACE(COMP_POWER, "<================r8192E resume call.\n"); RT_TRACE(COMP_POWER, "<================r8192E resume call.\n");
return 0; return 0;
} }
int rtl8192E_enable_wake (struct pci_dev *dev, pm_message_t state, int enable) int rtl8192E_enable_wake(struct pci_dev *dev, pm_message_t state, int enable)
{ {
printk(KERN_NOTICE "r8192E enable wake call (state %u, enable %d).\n", printk(KERN_NOTICE "r8192E enable wake call (state %u, enable %d).\n",
state.event, enable); state.event, enable);
return(-EAGAIN); return -EAGAIN;
} }
#endif #endif
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/pci.h> #include <linux/pci.h>
int rtl8192E_save_state (struct pci_dev *dev, pm_message_t state); int rtl8192E_save_state(struct pci_dev *dev, pm_message_t state);
int rtl8192E_suspend (struct pci_dev *dev, pm_message_t state); int rtl8192E_suspend(struct pci_dev *dev, pm_message_t state);
int rtl8192E_resume (struct pci_dev *dev); int rtl8192E_resume(struct pci_dev *dev);
int rtl8192E_enable_wake (struct pci_dev *dev, pm_message_t state, int enable); int rtl8192E_enable_wake(struct pci_dev *dev, pm_message_t state, int enable);
#endif #endif
......
...@@ -33,44 +33,49 @@ void rtl8192_hw_sleep_down(struct net_device *dev) ...@@ -33,44 +33,49 @@ void rtl8192_hw_sleep_down(struct net_device *dev)
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
unsigned long flags = 0; unsigned long flags = 0;
spin_lock_irqsave(&priv->rf_ps_lock,flags); spin_lock_irqsave(&priv->rf_ps_lock, flags);
if (priv->RFChangeInProgress) { if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(&priv->rf_ps_lock,flags); spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
RT_TRACE(COMP_DBG, "rtl8192_hw_sleep_down(): RF Change in progress! \n"); RT_TRACE(COMP_DBG, "rtl8192_hw_sleep_down(): RF Change in "
"progress!\n");
return; return;
} }
spin_unlock_irqrestore(&priv->rf_ps_lock,flags); spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
RT_TRACE(COMP_DBG, "%s()============>come to sleep down\n", __func__); RT_TRACE(COMP_DBG, "%s()============>come to sleep down\n", __func__);
MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS,false); MgntActSet_RF_State(dev, eRfSleep, RF_CHANGE_BY_PS, false);
} }
void rtl8192_hw_sleep_wq(void *data) void rtl8192_hw_sleep_wq(void *data)
{ {
struct rtllib_device *ieee = container_of_dwork_rsl(data,struct rtllib_device,hw_sleep_wq); struct rtllib_device *ieee = container_of_dwork_rsl(data,
struct rtllib_device, hw_sleep_wq);
struct net_device *dev = ieee->dev; struct net_device *dev = ieee->dev;
rtl8192_hw_sleep_down(dev); rtl8192_hw_sleep_down(dev);
} }
void rtl8192_hw_wakeup(struct net_device* dev) void rtl8192_hw_wakeup(struct net_device *dev)
{ {
struct r8192_priv *priv = rtllib_priv(dev); struct r8192_priv *priv = rtllib_priv(dev);
unsigned long flags = 0; unsigned long flags = 0;
spin_lock_irqsave(&priv->rf_ps_lock,flags); spin_lock_irqsave(&priv->rf_ps_lock, flags);
if (priv->RFChangeInProgress) { if (priv->RFChangeInProgress) {
spin_unlock_irqrestore(&priv->rf_ps_lock,flags); spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
RT_TRACE(COMP_DBG, "rtl8192_hw_wakeup(): RF Change in progress! \n"); RT_TRACE(COMP_DBG, "rtl8192_hw_wakeup(): RF Change in "
queue_delayed_work_rsl(priv->rtllib->wq,&priv->rtllib->hw_wakeup_wq,MSECS(10)); "progress!\n");
queue_delayed_work_rsl(priv->rtllib->wq,
&priv->rtllib->hw_wakeup_wq, MSECS(10));
return; return;
} }
spin_unlock_irqrestore(&priv->rf_ps_lock,flags); spin_unlock_irqrestore(&priv->rf_ps_lock, flags);
RT_TRACE(COMP_PS, "%s()============>come to wake up\n", __func__); RT_TRACE(COMP_PS, "%s()============>come to wake up\n", __func__);
MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS,false); MgntActSet_RF_State(dev, eRfOn, RF_CHANGE_BY_PS, false);
} }
void rtl8192_hw_wakeup_wq(void *data) void rtl8192_hw_wakeup_wq(void *data)
{ {
struct rtllib_device *ieee = container_of_dwork_rsl(data,struct rtllib_device,hw_wakeup_wq); struct rtllib_device *ieee = container_of_dwork_rsl(data,
struct rtllib_device, hw_wakeup_wq);
struct net_device *dev = ieee->dev; struct net_device *dev = ieee->dev;
rtl8192_hw_wakeup(dev); rtl8192_hw_wakeup(dev);
...@@ -85,12 +90,12 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time) ...@@ -85,12 +90,12 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
u32 tmp; u32 tmp;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&priv->ps_lock,flags); spin_lock_irqsave(&priv->ps_lock, flags);
time -= MSECS(8+16+7); time -= MSECS(8+16+7);
if ((time - jiffies) <= MSECS(MIN_SLEEP_TIME)) { if ((time - jiffies) <= MSECS(MIN_SLEEP_TIME)) {
spin_unlock_irqrestore(&priv->ps_lock,flags); spin_unlock_irqrestore(&priv->ps_lock, flags);
printk(KERN_INFO "too short to sleep::%lld < %ld\n", printk(KERN_INFO "too short to sleep::%lld < %ld\n",
time - jiffies, MSECS(MIN_SLEEP_TIME)); time - jiffies, MSECS(MIN_SLEEP_TIME));
return; return;
...@@ -99,48 +104,48 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time) ...@@ -99,48 +104,48 @@ void rtl8192_hw_to_sleep(struct net_device *dev, u64 time)
if ((time - jiffies) > MSECS(MAX_SLEEP_TIME)) { if ((time - jiffies) > MSECS(MAX_SLEEP_TIME)) {
printk(KERN_INFO "========>too long to sleep:%lld > %ld\n", printk(KERN_INFO "========>too long to sleep:%lld > %ld\n",
time - jiffies, MSECS(MAX_SLEEP_TIME)); time - jiffies, MSECS(MAX_SLEEP_TIME));
spin_unlock_irqrestore(&priv->ps_lock,flags); spin_unlock_irqrestore(&priv->ps_lock, flags);
return; return;
} }
tmp = time - jiffies; tmp = time - jiffies;
queue_delayed_work_rsl(priv->rtllib->wq, queue_delayed_work_rsl(priv->rtllib->wq,
&priv->rtllib->hw_wakeup_wq,tmp); &priv->rtllib->hw_wakeup_wq, tmp);
queue_delayed_work_rsl(priv->rtllib->wq, queue_delayed_work_rsl(priv->rtllib->wq,
(void *)&priv->rtllib->hw_sleep_wq,0); (void *)&priv->rtllib->hw_sleep_wq, 0);
spin_unlock_irqrestore(&priv->ps_lock,flags); spin_unlock_irqrestore(&priv->ps_lock, flags);
} }
void InactivePsWorkItemCallback(struct net_device *dev) void InactivePsWorkItemCallback(struct net_device *dev)
{ {
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 *)(&(priv->rtllib->PowerSaveControl)); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
RT_TRACE(COMP_PS, "InactivePsWorkItemCallback() ---------> \n"); RT_TRACE(COMP_PS, "InactivePsWorkItemCallback() --------->\n");
pPSC->bSwRfProcessing = true; pPSC->bSwRfProcessing = true;
RT_TRACE(COMP_PS, "InactivePsWorkItemCallback(): Set RF to %s.\n", \ RT_TRACE(COMP_PS, "InactivePsWorkItemCallback(): Set RF to %s.\n",
pPSC->eInactivePowerState == eRfOff?"OFF":"ON"); pPSC->eInactivePowerState == eRfOff ? "OFF" : "ON");
MgntActSet_RF_State(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS,false); MgntActSet_RF_State(dev, pPSC->eInactivePowerState, RF_CHANGE_BY_IPS,
false);
pPSC->bSwRfProcessing = false; pPSC->bSwRfProcessing = false;
RT_TRACE(COMP_PS, "InactivePsWorkItemCallback() <--------- \n"); RT_TRACE(COMP_PS, "InactivePsWorkItemCallback() <---------\n");
} }
void void IPSEnter(struct net_device *dev)
IPSEnter(struct net_device *dev)
{ {
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 *)(&(priv->rtllib->PowerSaveControl)); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
enum rt_rf_power_state rtState; enum rt_rf_power_state rtState;
if (pPSC->bInactivePs) if (pPSC->bInactivePs) {
{
rtState = priv->rtllib->eRFPowerState; rtState = priv->rtllib->eRFPowerState;
if (rtState == eRfOn && !pPSC->bSwRfProcessing &&\ if (rtState == eRfOn && !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)) {
{ RT_TRACE(COMP_PS, "IPSEnter(): Turn off RF.\n");
RT_TRACE(COMP_PS,"IPSEnter(): Turn off RF.\n");
pPSC->eInactivePowerState = eRfOff; pPSC->eInactivePowerState = eRfOff;
priv->isRFOff = true; priv->isRFOff = true;
priv->bInPowerSaveMode = true; priv->bInPowerSaveMode = true;
...@@ -149,18 +154,17 @@ IPSEnter(struct net_device *dev) ...@@ -149,18 +154,17 @@ IPSEnter(struct net_device *dev)
} }
} }
void void IPSLeave(struct net_device *dev)
IPSLeave(struct net_device *dev)
{ {
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 *)(&(priv->rtllib->PowerSaveControl)); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
enum rt_rf_power_state rtState; enum rt_rf_power_state rtState;
if (pPSC->bInactivePs) if (pPSC->bInactivePs) {
{
rtState = priv->rtllib->eRFPowerState; rtState = priv->rtllib->eRFPowerState;
if (rtState != eRfOn && !pPSC->bSwRfProcessing && priv->rtllib->RfOffReason <= RF_CHANGE_BY_IPS) if (rtState != eRfOn && !pPSC->bSwRfProcessing &&
{ priv->rtllib->RfOffReason <= RF_CHANGE_BY_IPS) {
RT_TRACE(COMP_PS, "IPSLeave(): Turn on RF.\n"); RT_TRACE(COMP_PS, "IPSLeave(): Turn on RF.\n");
pPSC->eInactivePowerState = eRfOn; pPSC->eInactivePowerState = eRfOn;
priv->bInPowerSaveMode = false; priv->bInPowerSaveMode = false;
...@@ -168,9 +172,11 @@ IPSLeave(struct net_device *dev) ...@@ -168,9 +172,11 @@ IPSLeave(struct net_device *dev)
} }
} }
} }
void IPSLeave_wq(void *data) void IPSLeave_wq(void *data)
{ {
struct rtllib_device *ieee = container_of_work_rsl(data,struct rtllib_device,ips_leave_wq); struct rtllib_device *ieee = container_of_work_rsl(data,
struct rtllib_device, ips_leave_wq);
struct net_device *dev = ieee->dev; struct net_device *dev = ieee->dev;
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
down(&priv->rtllib->ips_sem); down(&priv->rtllib->ips_sem);
...@@ -184,20 +190,22 @@ void rtllib_ips_leave_wq(struct net_device *dev) ...@@ -184,20 +190,22 @@ void rtllib_ips_leave_wq(struct net_device *dev)
enum rt_rf_power_state rtState; enum rt_rf_power_state rtState;
rtState = priv->rtllib->eRFPowerState; rtState = priv->rtllib->eRFPowerState;
if (priv->rtllib->PowerSaveControl.bInactivePs){ if (priv->rtllib->PowerSaveControl.bInactivePs) {
if (rtState == eRfOff){ if (rtState == eRfOff) {
if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) if (priv->rtllib->RfOffReason > RF_CHANGE_BY_IPS) {
{ RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",
RT_TRACE(COMP_ERR, "%s(): RF is OFF.\n",__func__); __func__);
return; return;
} } else {
else{ printk(KERN_INFO "=========>%s(): IPSLeave\n",
printk("=========>%s(): IPSLeave\n",__func__); __func__);
queue_work_rsl(priv->rtllib->wq,&priv->rtllib->ips_leave_wq); queue_work_rsl(priv->rtllib->wq,
&priv->rtllib->ips_leave_wq);
} }
} }
} }
} }
void rtllib_ips_leave(struct net_device *dev) void rtllib_ips_leave(struct net_device *dev)
{ {
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev); struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
...@@ -213,38 +221,42 @@ bool MgntActSet_802_11_PowerSaveMode(struct net_device *dev, u8 rtPsMode) ...@@ -213,38 +221,42 @@ bool MgntActSet_802_11_PowerSaveMode(struct net_device *dev, u8 rtPsMode)
if (priv->rtllib->iw_mode == IW_MODE_ADHOC) if (priv->rtllib->iw_mode == IW_MODE_ADHOC)
return false; return false;
RT_TRACE(COMP_LPS,"%s(): set ieee->ps = %x\n",__func__,rtPsMode); RT_TRACE(COMP_LPS, "%s(): set ieee->ps = %x\n", __func__, rtPsMode);
if (!priv->ps_force) { if (!priv->ps_force)
priv->rtllib->ps = rtPsMode; priv->rtllib->ps = rtPsMode;
} if (priv->rtllib->sta_sleep != LPS_IS_WAKE &&
if (priv->rtllib->sta_sleep != LPS_IS_WAKE && rtPsMode == RTLLIB_PS_DISABLED) { rtPsMode == RTLLIB_PS_DISABLED) {
unsigned long flags; unsigned long flags;
rtl8192_hw_wakeup(dev); rtl8192_hw_wakeup(dev);
priv->rtllib->sta_sleep = LPS_IS_WAKE; priv->rtllib->sta_sleep = LPS_IS_WAKE;
spin_lock_irqsave(&(priv->rtllib->mgmt_tx_lock), flags); spin_lock_irqsave(&(priv->rtllib->mgmt_tx_lock), flags);
RT_TRACE(COMP_DBG, "LPS leave: notify AP we are awaked" RT_TRACE(COMP_DBG, "LPS leave: notify AP we are awaked"
" ++++++++++ SendNullFunctionData\n"); " ++++++++++ SendNullFunctionData\n");
rtllib_sta_ps_send_null_frame(priv->rtllib, 0); rtllib_sta_ps_send_null_frame(priv->rtllib, 0);
spin_unlock_irqrestore(&(priv->rtllib->mgmt_tx_lock), flags); spin_unlock_irqrestore(&(priv->rtllib->mgmt_tx_lock), flags);
} }
return true; return true;
} }
void LeisurePSEnter(struct net_device *dev) void LeisurePSEnter(struct net_device *dev)
{ {
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 *)(&(priv->rtllib->PowerSaveControl)); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
RT_TRACE(COMP_PS, "LeisurePSEnter()...\n"); RT_TRACE(COMP_PS, "LeisurePSEnter()...\n");
RT_TRACE(COMP_PS, "pPSC->bLeisurePs = %d, ieee->ps = %d,pPSC->LpsIdleCount is %d,RT_CHECK_FOR_HANG_PERIOD is %d\n", RT_TRACE(COMP_PS, "pPSC->bLeisurePs = %d, ieee->ps = %d,pPSC->LpsIdle"
pPSC->bLeisurePs, priv->rtllib->ps,pPSC->LpsIdleCount,RT_CHECK_FOR_HANG_PERIOD); "Count is %d,RT_CHECK_FOR_HANG_PERIOD is %d\n",
pPSC->bLeisurePs, priv->rtllib->ps, pPSC->LpsIdleCount,
if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) && (priv->rtllib->state == RTLLIB_LINKED)) RT_CHECK_FOR_HANG_PERIOD);
|| (priv->rtllib->iw_mode == IW_MODE_ADHOC) || (priv->rtllib->iw_mode == IW_MODE_MASTER))
if (!((priv->rtllib->iw_mode == IW_MODE_INFRA) &&
(priv->rtllib->state == RTLLIB_LINKED))
|| (priv->rtllib->iw_mode == IW_MODE_ADHOC) ||
(priv->rtllib->iw_mode == IW_MODE_MASTER))
return; return;
if (pPSC->bLeisurePs) { if (pPSC->bLeisurePs) {
...@@ -252,44 +264,46 @@ void LeisurePSEnter(struct net_device *dev) ...@@ -252,44 +264,46 @@ void LeisurePSEnter(struct net_device *dev)
if (priv->rtllib->ps == RTLLIB_PS_DISABLED) { if (priv->rtllib->ps == RTLLIB_PS_DISABLED) {
RT_TRACE(COMP_LPS, "LeisurePSEnter(): Enter 802.11 power save mode...\n"); RT_TRACE(COMP_LPS, "LeisurePSEnter(): Enter "
"802.11 power save mode...\n");
if (!pPSC->bFwCtrlLPS) { if (!pPSC->bFwCtrlLPS) {
if (priv->rtllib->SetFwCmdHandler) if (priv->rtllib->SetFwCmdHandler)
priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_ENTER); priv->rtllib->SetFwCmdHandler(
dev, FW_CMD_LPS_ENTER);
} }
MgntActSet_802_11_PowerSaveMode(dev, RTLLIB_PS_MBCAST|RTLLIB_PS_UNICAST); MgntActSet_802_11_PowerSaveMode(dev,
RTLLIB_PS_MBCAST |
RTLLIB_PS_UNICAST);
} }
} else } else
pPSC->LpsIdleCount++; pPSC->LpsIdleCount++;
} }
} }
void LeisurePSLeave(struct net_device *dev) void LeisurePSLeave(struct net_device *dev)
{ {
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 *)(&(priv->rtllib->PowerSaveControl)); struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
&(priv->rtllib->PowerSaveControl);
RT_TRACE(COMP_PS, "LeisurePSLeave()...\n"); RT_TRACE(COMP_PS, "LeisurePSLeave()...\n");
RT_TRACE(COMP_PS, "pPSC->bLeisurePs = %d, ieee->ps = %d\n", RT_TRACE(COMP_PS, "pPSC->bLeisurePs = %d, ieee->ps = %d\n",
pPSC->bLeisurePs, priv->rtllib->ps); pPSC->bLeisurePs, priv->rtllib->ps);
if (pPSC->bLeisurePs) if (pPSC->bLeisurePs) {
{ if (priv->rtllib->ps != RTLLIB_PS_DISABLED) {
if (priv->rtllib->ps != RTLLIB_PS_DISABLED) RT_TRACE(COMP_LPS, "LeisurePSLeave(): Busy Traffic , "
{ "Leave 802.11 power save..\n");
RT_TRACE(COMP_LPS, "LeisurePSLeave(): Busy Traffic , Leave 802.11 power save..\n"); MgntActSet_802_11_PowerSaveMode(dev,
MgntActSet_802_11_PowerSaveMode(dev, RTLLIB_PS_DISABLED); RTLLIB_PS_DISABLED);
if (!pPSC->bFwCtrlLPS) if (!pPSC->bFwCtrlLPS) {
{
if (priv->rtllib->SetFwCmdHandler) if (priv->rtllib->SetFwCmdHandler)
{ priv->rtllib->SetFwCmdHandler(dev,
priv->rtllib->SetFwCmdHandler(dev, FW_CMD_LPS_LEAVE); FW_CMD_LPS_LEAVE);
} }
}
} }
} }
} }
...@@ -36,7 +36,7 @@ void rtl8192_hw_wakeup(struct net_device *dev); ...@@ -36,7 +36,7 @@ void rtl8192_hw_wakeup(struct net_device *dev);
void rtl8192_hw_to_sleep(struct net_device *dev, u64 time); void rtl8192_hw_to_sleep(struct net_device *dev, u64 time);
void rtllib_ips_leave_wq(struct net_device *dev); void rtllib_ips_leave_wq(struct net_device *dev);
void rtllib_ips_leave(struct net_device *dev); void rtllib_ips_leave(struct net_device *dev);
void IPSLeave_wq (void *data); void IPSLeave_wq(void *data);
void IPSEnter(struct net_device *dev); void IPSEnter(struct net_device *dev);
void IPSLeave(struct net_device *dev); void IPSLeave(struct net_device *dev);
......
此差异已折叠。
...@@ -26,6 +26,6 @@ struct iw_statistics; ...@@ -26,6 +26,6 @@ struct iw_statistics;
extern struct iw_handler_def r8192_wx_handlers_def; extern struct iw_handler_def r8192_wx_handlers_def;
struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev); struct iw_statistics *r8192_get_wireless_stats(struct net_device *dev);
u16 rtl8192_11n_user_show_rates(struct net_device* dev); u16 rtl8192_11n_user_show_rates(struct net_device *dev);
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册