aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMike McCormack <mikem@ring3k.org>2011-03-10 08:33:20 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-14 15:24:44 -0400
commit45a43a84cdabc1918b9e59c829587fe1be7cee92 (patch)
treebb400f8914d1aae68150c4a0c0868fd30b15727b /drivers/staging
parent8031aecb2dc4a973792f147ece4e23771d5071d3 (diff)
staging: rtl8192e: Simplify rtl819x_ifcheck_resetornot
Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8192e/r8192E_core.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/drivers/staging/rtl8192e/r8192E_core.c b/drivers/staging/rtl8192e/r8192E_core.c
index cd3e2ce2aef7..eb956eab8891 100644
--- a/drivers/staging/rtl8192e/r8192E_core.c
+++ b/drivers/staging/rtl8192e/r8192E_core.c
@@ -2971,38 +2971,31 @@ static RESET_TYPE RxCheckStuck(struct r8192_priv *priv)
2971 return RESET_TYPE_NORESET; 2971 return RESET_TYPE_NORESET;
2972} 2972}
2973 2973
2974static RESET_TYPE 2974static RESET_TYPE rtl819x_check_reset(struct r8192_priv *priv)
2975rtl819x_ifcheck_resetornot(struct r8192_priv *priv)
2976{ 2975{
2977 RESET_TYPE TxResetType = RESET_TYPE_NORESET; 2976 RESET_TYPE RxResetType = RESET_TYPE_NORESET;
2978 RESET_TYPE RxResetType = RESET_TYPE_NORESET; 2977 RT_RF_POWER_STATE rfState;
2979 RT_RF_POWER_STATE rfState;
2980 2978
2981 rfState = priv->eRFPowerState; 2979 rfState = priv->eRFPowerState;
2982 2980
2983 if( rfState != eRfOff && 2981 if (rfState != eRfOff && (priv->ieee80211->iw_mode != IW_MODE_ADHOC)) {
2984 /*ADAPTER_TEST_STATUS_FLAG(Adapter, ADAPTER_STATUS_FW_DOWNLOAD_FAILURE)) &&*/ 2982 /*
2985 (priv->ieee80211->iw_mode != IW_MODE_ADHOC)) 2983 * If driver is in the status of firmware download failure,
2986 { 2984 * driver skips RF initialization and RF is in turned off state.
2987 // If driver is in the status of firmware download failure , driver skips RF initialization and RF is 2985 * Driver should check whether Rx stuck and do silent reset. And
2988 // in turned off state. Driver should check whether Rx stuck and do silent reset. And 2986 * if driver is in firmware download failure status, driver
2989 // if driver is in firmware download failure status, driver should initialize RF in the following 2987 * should initialize RF in the following silent reset procedure
2990 // silent reset procedure Emily, 2008.01.21 2988 *
2991 2989 * Driver should not check RX stuck in IBSS mode because it is
2992 // Driver should not check RX stuck in IBSS mode because it is required to 2990 * required to set Check BSSID in order to send beacon, however,
2993 // set Check BSSID in order to send beacon, however, if check BSSID is 2991 * if check BSSID is set, STA cannot hear any packet a all.
2994 // set, STA cannot hear any packet a all. Emily, 2008.04.12 2992 */
2995 RxResetType = RxCheckStuck(priv); 2993 RxResetType = RxCheckStuck(priv);
2996 } 2994 }
2997 2995
2998 RT_TRACE(COMP_RESET,"%s(): TxResetType is %d, RxResetType is %d\n",__FUNCTION__,TxResetType,RxResetType); 2996 RT_TRACE(COMP_RESET, "%s(): RxResetType is %d\n", __FUNCTION__, RxResetType);
2999 if(TxResetType==RESET_TYPE_NORMAL || RxResetType==RESET_TYPE_NORMAL)
3000 return RESET_TYPE_NORMAL;
3001 else if(TxResetType==RESET_TYPE_SILENT || RxResetType==RESET_TYPE_SILENT)
3002 return RESET_TYPE_SILENT;
3003 else
3004 return RESET_TYPE_NORESET;
3005 2997
2998 return RxResetType;
3006} 2999}
3007 3000
3008#ifdef ENABLE_IPS 3001#ifdef ENABLE_IPS
@@ -3341,7 +3334,7 @@ static void rtl819x_watchdog_wqcallback(struct work_struct *work)
3341 if (priv->watchdog_check_reset_cnt++ >= 3 && !ieee->is_roaming && 3334 if (priv->watchdog_check_reset_cnt++ >= 3 && !ieee->is_roaming &&
3342 priv->watchdog_last_time != 1) 3335 priv->watchdog_last_time != 1)
3343 { 3336 {
3344 ResetType = rtl819x_ifcheck_resetornot(priv); 3337 ResetType = rtl819x_check_reset(priv);
3345 priv->watchdog_check_reset_cnt = 3; 3338 priv->watchdog_check_reset_cnt = 3;
3346 } 3339 }
3347 if(!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL) 3340 if(!priv->bDisableNormalResetCheck && ResetType == RESET_TYPE_NORMAL)