Staging: rtl8192e: Move static variable to device struct

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Mike McCormack 2011-01-31 22:09:44 +09:00 committed by Greg Kroah-Hartman
parent b3bb17e6da
commit 935ce8991a
2 changed files with 10 additions and 9 deletions

View File

@ -884,6 +884,7 @@ typedef struct r8192_priv
u8 retry_rts; u8 retry_rts;
struct work_struct reset_wq; struct work_struct reset_wq;
u8 rx_chk_cnt;
//for rtl819xPci //for rtl819xPci
// Data Rate Config. Added by Annie, 2006-04-13. // Data Rate Config. Added by Annie, 2006-04-13.

View File

@ -3484,51 +3484,51 @@ static bool HalRxCheckStuck8190Pci(struct net_device *dev)
struct r8192_priv *priv = ieee80211_priv(dev); struct r8192_priv *priv = ieee80211_priv(dev);
u16 RegRxCounter = read_nic_word(dev, 0x130); u16 RegRxCounter = read_nic_word(dev, 0x130);
bool bStuck = FALSE; bool bStuck = FALSE;
static u8 rx_chk_cnt = 0;
RT_TRACE(COMP_RESET,"%s(): RegRxCounter is %d,RxCounter is %d\n",__FUNCTION__,RegRxCounter,priv->RxCounter); RT_TRACE(COMP_RESET,"%s(): RegRxCounter is %d,RxCounter is %d\n",__FUNCTION__,RegRxCounter,priv->RxCounter);
// If rssi is small, we should check rx for long time because of bad rx. // If rssi is small, we should check rx for long time because of bad rx.
// or maybe it will continuous silent reset every 2 seconds. // or maybe it will continuous silent reset every 2 seconds.
rx_chk_cnt++; priv->rx_chk_cnt++;
if(priv->undecorated_smoothed_pwdb >= (RateAdaptiveTH_High+5)) if(priv->undecorated_smoothed_pwdb >= (RateAdaptiveTH_High+5))
{ {
rx_chk_cnt = 0; //high rssi, check rx stuck right now. priv->rx_chk_cnt = 0; /* high rssi, check rx stuck right now. */
} }
else if(priv->undecorated_smoothed_pwdb < (RateAdaptiveTH_High+5) && else if(priv->undecorated_smoothed_pwdb < (RateAdaptiveTH_High+5) &&
((priv->CurrentChannelBW!=HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb>=RateAdaptiveTH_Low_40M) || ((priv->CurrentChannelBW!=HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb>=RateAdaptiveTH_Low_40M) ||
(priv->CurrentChannelBW==HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb>=RateAdaptiveTH_Low_20M)) ) (priv->CurrentChannelBW==HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb>=RateAdaptiveTH_Low_20M)) )
{ {
if(rx_chk_cnt < 2) if(priv->rx_chk_cnt < 2)
{ {
return bStuck; return bStuck;
} }
else else
{ {
rx_chk_cnt = 0; priv->rx_chk_cnt = 0;
} }
} }
else if(((priv->CurrentChannelBW!=HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb<RateAdaptiveTH_Low_40M) || else if(((priv->CurrentChannelBW!=HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb<RateAdaptiveTH_Low_40M) ||
(priv->CurrentChannelBW==HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb<RateAdaptiveTH_Low_20M)) && (priv->CurrentChannelBW==HT_CHANNEL_WIDTH_20&&priv->undecorated_smoothed_pwdb<RateAdaptiveTH_Low_20M)) &&
priv->undecorated_smoothed_pwdb >= VeryLowRSSI) priv->undecorated_smoothed_pwdb >= VeryLowRSSI)
{ {
if(rx_chk_cnt < 4) if(priv->rx_chk_cnt < 4)
{ {
return bStuck; return bStuck;
} }
else else
{ {
rx_chk_cnt = 0; priv->rx_chk_cnt = 0;
} }
} }
else else
{ {
if(rx_chk_cnt < 8) if(priv->rx_chk_cnt < 8)
{ {
return bStuck; return bStuck;
} }
else else
{ {
rx_chk_cnt = 0; priv->rx_chk_cnt = 0;
} }
} }
if(priv->RxCounter==RegRxCounter) if(priv->RxCounter==RegRxCounter)