Commit f2f97035 authored by Jes Sorensen's avatar Jes Sorensen Committed by Greg Kroah-Hartman
Browse files

staging: rtl8723au: Don't explicitly check check_fwstate() == true

parent 04e57767
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -349,7 +349,7 @@ int rtw_sitesurvey_cmd23a(struct rtw_adapter *padapter,
	struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;

	if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
	if (check_fwstate(pmlmepriv, _FW_LINKED))
		rtw_lps_ctrl_wk_cmd23a(padapter, LPS_CTRL_SCAN, 1);

	ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC);
@@ -1030,7 +1030,7 @@ static void dynamic_chk_wk_hdl(struct rtw_adapter *padapter, u8 *pbuf, int sz)
	pmlmepriv = &padapter->mlmepriv;

#ifdef CONFIG_8723AU_AP_MODE
	if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
	if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
		expire_timeout_chk23a(padapter);
#endif

@@ -1055,8 +1055,8 @@ static void lps_ctrl_wk_hdl(struct rtw_adapter *padapter, u8 lps_ctrl_type)
	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
	u8 mstatus;

	if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) ||
	    (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true))
	if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
	    check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
		return;

	switch (lps_ctrl_type)
@@ -1597,8 +1597,8 @@ void rtw_setassocsta_cmdrsp_callback23a(struct rtw_adapter *padapter,

	spin_lock_bh(&pmlmepriv->lock);

	if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) &&
	    (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true))
	if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
	    check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
		_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);

	set_fwstate(pmlmepriv, _FW_LINKED);
+10 −14
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ int rtw_do_join23a(struct rtw_adapter *padapter)
			mod_timer(&pmlmepriv->assoc_timer,
				  jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
		} else {
			if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) {
			if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
				struct wlan_bssid_ex *pdev_network;
				/*  submit createbss_cmd to change to a
				    ADHOC_MASTER */
@@ -175,14 +175,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
	spin_lock_bh(&pmlmepriv->lock);

	DBG_8723A("Set SSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv));
	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
		goto handle_tkip_countermeasure;
	} else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true) {
	else if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
		goto release_mlme_lock;
	}

	if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE) == true)
	{
	if (check_fwstate(pmlmepriv, _FW_LINKED|WIFI_ADHOC_MASTER_STATE)) {
		RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
			 ("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));

@@ -200,12 +198,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
					/* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
					rtw_disassoc_cmd23a(padapter, 0, true);

					if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
					if (check_fwstate(pmlmepriv, _FW_LINKED))
						rtw_indicate_disconnect23a(padapter);

					rtw_free_assoc_resources23a(padapter, 1);

					if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) {
					if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
						_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
						set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
					}
@@ -228,12 +226,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,

			rtw_disassoc_cmd23a(padapter, 0, true);

			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
			if (check_fwstate(pmlmepriv, _FW_LINKED))
				rtw_indicate_disconnect23a(padapter);

			rtw_free_assoc_resources23a(padapter, 1);

			if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) {
			if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
				_clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
				set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
			}
@@ -260,12 +258,10 @@ handle_tkip_countermeasure:
	memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct cfg80211_ssid));
	pmlmepriv->assoc_by_bssid = false;

	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) {
	if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
		pmlmepriv->to_join = true;
	}
	else {
	else
		status = rtw_do_join23a(padapter);
	}

release_mlme_lock:
	spin_unlock_bh(&pmlmepriv->lock);
+15 −16
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static void SwLedBlink1(struct led_8723a *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
@@ -258,7 +258,7 @@ static void SwLedBlink1(struct led_8723a *pLed)
		if (pLed->BlinkTimes == 0)
			bStopBlinking = true;
		if (bStopBlinking) {
			if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
			if (check_fwstate(pmlmepriv, _FW_LINKED)) {
				pLed->bLedLinkBlinkInProgress = true;
				pLed->CurrLedState = LED_BLINK_NORMAL;
				if (pLed->bLedOn)
@@ -450,8 +450,7 @@ static void SwLedBlink3(struct led_8723a *pLed)
				{
					SwLedOff23a(padapter, pLed);
				}
				else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
				{
				else if (check_fwstate(pmlmepriv, _FW_LINKED)) {
					pLed->CurrLedState = RTW_LED_ON;
					pLed->BlinkingLedState = RTW_LED_ON;
					if (!pLed->bLedOn)
@@ -499,9 +498,8 @@ static void SwLedBlink3(struct led_8723a *pLed)
				if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
				{
					SwLedOff23a(padapter, pLed);
				}
				else if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
				{
				} else if (check_fwstate(pmlmepriv,
							 _FW_LINKED)) {
					pLed->CurrLedState = RTW_LED_ON;
					pLed->BlinkingLedState = RTW_LED_ON;

@@ -914,8 +912,8 @@ SwLedControlMode1(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
			break;

		case LED_CTL_SITE_SURVEY:
			 if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) &&
			     (check_fwstate(pmlmepriv, _FW_LINKED) == true))
			 if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
			     check_fwstate(pmlmepriv, _FW_LINKED))
				;
			 else if (pLed->bLedScanBlinkInProgress == false) {
				if (IS_LED_WPS_BLINKING(pLed))
@@ -1118,8 +1116,8 @@ SwLedControlMode2(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
		 break;
	case LED_CTL_TX:
	case LED_CTL_RX:
		if ((pLed->bLedBlinkInProgress == false) &&
		    (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
		if (pLed->bLedBlinkInProgress == false &&
		    check_fwstate(pmlmepriv, _FW_LINKED)) {
			if (pLed->CurrLedState == LED_BLINK_SCAN ||
			    IS_LED_WPS_BLINKING(pLed)) {
				return;
@@ -1261,8 +1259,8 @@ SwLedControlMode3(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)

		case LED_CTL_TX:
		case LED_CTL_RX:
			if ((pLed->bLedBlinkInProgress == false) &&
			    (check_fwstate(pmlmepriv, _FW_LINKED) == true)) {
			if (pLed->bLedBlinkInProgress == false &&
			    check_fwstate(pmlmepriv, _FW_LINKED)) {
				if (pLed->CurrLedState == LED_BLINK_SCAN ||
				    IS_LED_WPS_BLINKING(pLed)) {
					return;
@@ -1477,8 +1475,8 @@ SwLedControlMode4(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
			break;

		case LED_CTL_SITE_SURVEY:
			if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) &&
			    (check_fwstate(pmlmepriv, _FW_LINKED) == true))
			if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
			    check_fwstate(pmlmepriv, _FW_LINKED))
				;
			else if (pLed->bLedScanBlinkInProgress == false) {
				if (IS_LED_WPS_BLINKING(pLed))
@@ -1714,7 +1712,8 @@ SwLedControlMode5(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
			break;

		case LED_CTL_SITE_SURVEY:
			if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED) == true))
			if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
			    check_fwstate(pmlmepriv, _FW_LINKED))
				;
			else if (pLed->bLedScanBlinkInProgress == false)
			{
+4 −4
Original line number Diff line number Diff line
@@ -643,7 +643,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
	switch (stype)
	{
	case IEEE80211_STYPE_AUTH:
		if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
		if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
			ptable->func = &OnAuth23a;
		else
			ptable->func = &OnAuth23aClient23a;
@@ -653,7 +653,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
		_mgt_dispatcher23a(padapter, ptable, precv_frame);
		break;
	case IEEE80211_STYPE_PROBE_REQ:
		if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)
		if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
			_mgt_dispatcher23a(padapter, ptable, precv_frame);
		else
			_mgt_dispatcher23a(padapter, ptable, precv_frame);
@@ -662,7 +662,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
		_mgt_dispatcher23a(padapter, ptable, precv_frame);
		break;
	case IEEE80211_STYPE_ACTION:
		/* if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) */
		/* if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) */
		_mgt_dispatcher23a(padapter, ptable, precv_frame);
		break;
	default:
@@ -1880,7 +1880,7 @@ OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
	DBG_8723A("%s Reason code(%d)\n", __func__, reason);

#ifdef CONFIG_8723AU_AP_MODE
	if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) {
	if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
		struct sta_info *psta;
		struct sta_priv *pstapriv = &padapter->stapriv;

+6 −6
Original line number Diff line number Diff line
@@ -300,10 +300,10 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter)
		return false;

	if (check_fwstate(pmlmepriv, _FW_LINKED) == false ||
	    check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true ||
	    check_fwstate(pmlmepriv, WIFI_AP_STATE) == true ||
	    check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true ||
	    check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)
	    check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ||
	    check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
	    check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
	    check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
		return false;
	if (pwrpriv->bInSuspend)
		return false;
@@ -462,7 +462,7 @@ void LeaveAllPowerSaveMode23a(struct rtw_adapter *Adapter)
	u8 enqueue = 0;

	/* DBG_8723A("%s.....\n", __func__); */
	if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
	if (check_fwstate(pmlmepriv, _FW_LINKED))
		rtw_lps_ctrl_wk_cmd23a(Adapter, LPS_CTRL_LEAVE, enqueue);
}

@@ -589,7 +589,7 @@ int _rtw_pwr_wakeup23a(struct rtw_adapter *padapter, u32 ips_deffer_ms, const ch
	}

	/* I think this should be check in IPS, LPS, autosuspend functions... */
	if (check_fwstate(pmlmepriv, _FW_LINKED) == true) {
	if (check_fwstate(pmlmepriv, _FW_LINKED)) {
		ret = _SUCCESS;
		goto exit;
	}
Loading