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

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

Signed-off-by: default avatarJes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 04e57767
...@@ -349,7 +349,7 @@ int rtw_sitesurvey_cmd23a(struct rtw_adapter *padapter, ...@@ -349,7 +349,7 @@ int rtw_sitesurvey_cmd23a(struct rtw_adapter *padapter,
struct cmd_priv *pcmdpriv = &padapter->cmdpriv; struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; 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); rtw_lps_ctrl_wk_cmd23a(padapter, LPS_CTRL_SCAN, 1);
ph2c = kzalloc(sizeof(struct cmd_obj), GFP_ATOMIC); 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) ...@@ -1030,7 +1030,7 @@ static void dynamic_chk_wk_hdl(struct rtw_adapter *padapter, u8 *pbuf, int sz)
pmlmepriv = &padapter->mlmepriv; pmlmepriv = &padapter->mlmepriv;
#ifdef CONFIG_8723AU_AP_MODE #ifdef CONFIG_8723AU_AP_MODE
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
expire_timeout_chk23a(padapter); expire_timeout_chk23a(padapter);
#endif #endif
...@@ -1055,8 +1055,8 @@ static void lps_ctrl_wk_hdl(struct rtw_adapter *padapter, u8 lps_ctrl_type) ...@@ -1055,8 +1055,8 @@ static void lps_ctrl_wk_hdl(struct rtw_adapter *padapter, u8 lps_ctrl_type)
struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 mstatus; u8 mstatus;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true)) check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
return; return;
switch (lps_ctrl_type) switch (lps_ctrl_type)
...@@ -1597,8 +1597,8 @@ void rtw_setassocsta_cmdrsp_callback23a(struct rtw_adapter *padapter, ...@@ -1597,8 +1597,8 @@ void rtw_setassocsta_cmdrsp_callback23a(struct rtw_adapter *padapter,
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
(check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
_clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING); _clr_fwstate_(pmlmepriv, _FW_UNDER_LINKING);
set_fwstate(pmlmepriv, _FW_LINKED); set_fwstate(pmlmepriv, _FW_LINKED);
......
...@@ -82,7 +82,7 @@ int rtw_do_join23a(struct rtw_adapter *padapter) ...@@ -82,7 +82,7 @@ int rtw_do_join23a(struct rtw_adapter *padapter)
mod_timer(&pmlmepriv->assoc_timer, mod_timer(&pmlmepriv->assoc_timer,
jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT)); jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
} else { } else {
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
struct wlan_bssid_ex *pdev_network; struct wlan_bssid_ex *pdev_network;
/* submit createbss_cmd to change to a /* submit createbss_cmd to change to a
ADHOC_MASTER */ ADHOC_MASTER */
...@@ -175,14 +175,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, ...@@ -175,14 +175,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
spin_lock_bh(&pmlmepriv->lock); spin_lock_bh(&pmlmepriv->lock);
DBG_8723A("Set SSID under fw_state = 0x%08x\n", get_fwstate(pmlmepriv)); 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; 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; 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_, RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_info_,
("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n")); ("set_ssid: _FW_LINKED||WIFI_ADHOC_MASTER_STATE\n"));
...@@ -200,12 +198,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, ...@@ -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 */ /* if in WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE, create bss or rejoin again */
rtw_disassoc_cmd23a(padapter, 0, true); rtw_disassoc_cmd23a(padapter, 0, true);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
rtw_indicate_disconnect23a(padapter); rtw_indicate_disconnect23a(padapter);
rtw_free_assoc_resources23a(padapter, 1); 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); _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
} }
...@@ -228,12 +226,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, ...@@ -228,12 +226,12 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
rtw_disassoc_cmd23a(padapter, 0, true); rtw_disassoc_cmd23a(padapter, 0, true);
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED))
rtw_indicate_disconnect23a(padapter); rtw_indicate_disconnect23a(padapter);
rtw_free_assoc_resources23a(padapter, 1); 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); _clr_fwstate_(pmlmepriv, WIFI_ADHOC_MASTER_STATE);
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE); set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
} }
...@@ -260,12 +258,10 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter, ...@@ -260,12 +258,10 @@ int rtw_set_802_11_ssid23a(struct rtw_adapter* padapter,
memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct cfg80211_ssid)); memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(struct cfg80211_ssid));
pmlmepriv->assoc_by_bssid = false; pmlmepriv->assoc_by_bssid = false;
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true) { if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
pmlmepriv->to_join = true; pmlmepriv->to_join = true;
} else
else {
status = rtw_do_join23a(padapter); status = rtw_do_join23a(padapter);
}
release_mlme_lock: release_mlme_lock:
spin_unlock_bh(&pmlmepriv->lock); spin_unlock_bh(&pmlmepriv->lock);
......
...@@ -225,7 +225,7 @@ static void SwLedBlink1(struct led_8723a *pLed) ...@@ -225,7 +225,7 @@ static void SwLedBlink1(struct led_8723a *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->bLedLinkBlinkInProgress = true; pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL; pLed->CurrLedState = LED_BLINK_NORMAL;
if (pLed->bLedOn) if (pLed->bLedOn)
...@@ -258,7 +258,7 @@ static void SwLedBlink1(struct led_8723a *pLed) ...@@ -258,7 +258,7 @@ static void SwLedBlink1(struct led_8723a *pLed)
if (pLed->BlinkTimes == 0) if (pLed->BlinkTimes == 0)
bStopBlinking = true; bStopBlinking = true;
if (bStopBlinking) { if (bStopBlinking) {
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) { if (check_fwstate(pmlmepriv, _FW_LINKED)) {
pLed->bLedLinkBlinkInProgress = true; pLed->bLedLinkBlinkInProgress = true;
pLed->CurrLedState = LED_BLINK_NORMAL; pLed->CurrLedState = LED_BLINK_NORMAL;
if (pLed->bLedOn) if (pLed->bLedOn)
...@@ -450,8 +450,7 @@ static void SwLedBlink3(struct led_8723a *pLed) ...@@ -450,8 +450,7 @@ static void SwLedBlink3(struct led_8723a *pLed)
{ {
SwLedOff23a(padapter, 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->CurrLedState = RTW_LED_ON;
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
if (!pLed->bLedOn) if (!pLed->bLedOn)
...@@ -499,9 +498,8 @@ static void SwLedBlink3(struct led_8723a *pLed) ...@@ -499,9 +498,8 @@ static void SwLedBlink3(struct led_8723a *pLed)
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) if (padapter->pwrctrlpriv.rf_pwrstate != rf_on)
{ {
SwLedOff23a(padapter, pLed); SwLedOff23a(padapter, pLed);
} } else if (check_fwstate(pmlmepriv,
else if (check_fwstate(pmlmepriv, _FW_LINKED) == true) _FW_LINKED)) {
{
pLed->CurrLedState = RTW_LED_ON; pLed->CurrLedState = RTW_LED_ON;
pLed->BlinkingLedState = RTW_LED_ON; pLed->BlinkingLedState = RTW_LED_ON;
...@@ -914,8 +912,8 @@ SwLedControlMode1(struct rtw_adapter *padapter, enum led_ctl_mode LedAction) ...@@ -914,8 +912,8 @@ SwLedControlMode1(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
break; break;
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) check_fwstate(pmlmepriv, _FW_LINKED))
; ;
else if (pLed->bLedScanBlinkInProgress == false) { else if (pLed->bLedScanBlinkInProgress == false) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
...@@ -1118,8 +1116,8 @@ SwLedControlMode2(struct rtw_adapter *padapter, enum led_ctl_mode LedAction) ...@@ -1118,8 +1116,8 @@ SwLedControlMode2(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
break; break;
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if ((pLed->bLedBlinkInProgress == false) && if (pLed->bLedBlinkInProgress == false &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
if (pLed->CurrLedState == LED_BLINK_SCAN || if (pLed->CurrLedState == LED_BLINK_SCAN ||
IS_LED_WPS_BLINKING(pLed)) { IS_LED_WPS_BLINKING(pLed)) {
return; return;
...@@ -1261,8 +1259,8 @@ SwLedControlMode3(struct rtw_adapter *padapter, enum led_ctl_mode LedAction) ...@@ -1261,8 +1259,8 @@ SwLedControlMode3(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
case LED_CTL_TX: case LED_CTL_TX:
case LED_CTL_RX: case LED_CTL_RX:
if ((pLed->bLedBlinkInProgress == false) && if (pLed->bLedBlinkInProgress == false &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
if (pLed->CurrLedState == LED_BLINK_SCAN || if (pLed->CurrLedState == LED_BLINK_SCAN ||
IS_LED_WPS_BLINKING(pLed)) { IS_LED_WPS_BLINKING(pLed)) {
return; return;
...@@ -1477,8 +1475,8 @@ SwLedControlMode4(struct rtw_adapter *padapter, enum led_ctl_mode LedAction) ...@@ -1477,8 +1475,8 @@ SwLedControlMode4(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
break; break;
case LED_CTL_SITE_SURVEY: case LED_CTL_SITE_SURVEY:
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && if (pmlmepriv->LinkDetectInfo.bBusyTraffic &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) check_fwstate(pmlmepriv, _FW_LINKED))
; ;
else if (pLed->bLedScanBlinkInProgress == false) { else if (pLed->bLedScanBlinkInProgress == false) {
if (IS_LED_WPS_BLINKING(pLed)) if (IS_LED_WPS_BLINKING(pLed))
...@@ -1714,7 +1712,8 @@ SwLedControlMode5(struct rtw_adapter *padapter, enum led_ctl_mode LedAction) ...@@ -1714,7 +1712,8 @@ SwLedControlMode5(struct rtw_adapter *padapter, enum led_ctl_mode LedAction)
break; break;
case LED_CTL_SITE_SURVEY: 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) else if (pLed->bLedScanBlinkInProgress == false)
{ {
......
...@@ -643,7 +643,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter, ...@@ -643,7 +643,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
switch (stype) switch (stype)
{ {
case IEEE80211_STYPE_AUTH: case IEEE80211_STYPE_AUTH:
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
ptable->func = &OnAuth23a; ptable->func = &OnAuth23a;
else else
ptable->func = &OnAuth23aClient23a; ptable->func = &OnAuth23aClient23a;
...@@ -653,7 +653,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter, ...@@ -653,7 +653,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
_mgt_dispatcher23a(padapter, ptable, precv_frame); _mgt_dispatcher23a(padapter, ptable, precv_frame);
break; break;
case IEEE80211_STYPE_PROBE_REQ: 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); _mgt_dispatcher23a(padapter, ptable, precv_frame);
else else
_mgt_dispatcher23a(padapter, ptable, precv_frame); _mgt_dispatcher23a(padapter, ptable, precv_frame);
...@@ -662,7 +662,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter, ...@@ -662,7 +662,7 @@ void mgt_dispatcher23a(struct rtw_adapter *padapter,
_mgt_dispatcher23a(padapter, ptable, precv_frame); _mgt_dispatcher23a(padapter, ptable, precv_frame);
break; break;
case IEEE80211_STYPE_ACTION: 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); _mgt_dispatcher23a(padapter, ptable, precv_frame);
break; break;
default: default:
...@@ -1880,7 +1880,7 @@ OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) ...@@ -1880,7 +1880,7 @@ OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame)
DBG_8723A("%s Reason code(%d)\n", __func__, reason); DBG_8723A("%s Reason code(%d)\n", __func__, reason);
#ifdef CONFIG_8723AU_AP_MODE #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_info *psta;
struct sta_priv *pstapriv = &padapter->stapriv; struct sta_priv *pstapriv = &padapter->stapriv;
......
...@@ -300,10 +300,10 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter) ...@@ -300,10 +300,10 @@ static u8 PS_RDY_CHECK(struct rtw_adapter * padapter)
return false; return false;
if (check_fwstate(pmlmepriv, _FW_LINKED) == false || if (check_fwstate(pmlmepriv, _FW_LINKED) == false ||
check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == true || check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) ||
check_fwstate(pmlmepriv, WIFI_AP_STATE) == true || check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) check_fwstate(pmlmepriv, WIFI_ADHOC_STATE))
return false; return false;
if (pwrpriv->bInSuspend) if (pwrpriv->bInSuspend)
return false; return false;
...@@ -462,7 +462,7 @@ void LeaveAllPowerSaveMode23a(struct rtw_adapter *Adapter) ...@@ -462,7 +462,7 @@ void LeaveAllPowerSaveMode23a(struct rtw_adapter *Adapter)
u8 enqueue = 0; u8 enqueue = 0;
/* DBG_8723A("%s.....\n", __func__); */ /* 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); 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 ...@@ -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... */ /* 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; ret = _SUCCESS;
goto exit; goto exit;
} }
......
...@@ -800,8 +800,8 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter, ...@@ -800,8 +800,8 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
/* filter packets that SA is myself or multicast or broadcast */ /* filter packets that SA is myself or multicast or broadcast */
if (ether_addr_equal(myhwaddr, pattrib->src)) { if (ether_addr_equal(myhwaddr, pattrib->src)) {
...@@ -824,7 +824,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter, ...@@ -824,7 +824,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
} }
sta_addr = pattrib->src; sta_addr = pattrib->src;
} else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* For Station mode, sa and bssid should always be BSSID, /* For Station mode, sa and bssid should always be BSSID,
and DA is my mac-address */ and DA is my mac-address */
if (!ether_addr_equal(pattrib->bssid, pattrib->src)) { if (!ether_addr_equal(pattrib->bssid, pattrib->src)) {
...@@ -837,7 +837,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter, ...@@ -837,7 +837,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
sta_addr = pattrib->bssid; sta_addr = pattrib->bssid;
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
if (bmcast) { if (bmcast) {
/* For AP mode, if DA == MCAST, then BSSID should be also MCAST */ /* For AP mode, if DA == MCAST, then BSSID should be also MCAST */
if (!is_multicast_ether_addr(pattrib->bssid)) { if (!is_multicast_ether_addr(pattrib->bssid)) {
...@@ -854,7 +854,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter, ...@@ -854,7 +854,7 @@ static int sta2sta_data_frame(struct rtw_adapter *adapter,
sta_addr = pattrib->src; sta_addr = pattrib->src;
} }
} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
ether_addr_copy(pattrib->dst, hdr->addr1); ether_addr_copy(pattrib->dst, hdr->addr1);
ether_addr_copy(pattrib->src, hdr->addr2); ether_addr_copy(pattrib->src, hdr->addr2);
ether_addr_copy(pattrib->bssid, hdr->addr3); ether_addr_copy(pattrib->bssid, hdr->addr3);
...@@ -901,9 +901,9 @@ int ap2sta_data_frame(struct rtw_adapter *adapter, ...@@ -901,9 +901,9 @@ int ap2sta_data_frame(struct rtw_adapter *adapter,
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) && if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true || (check_fwstate(pmlmepriv, _FW_LINKED) ||
check_fwstate(pmlmepriv, _FW_UNDER_LINKING) == true)) { check_fwstate(pmlmepriv, _FW_UNDER_LINKING))) {
/* filter packets that SA is myself or multicast or broadcast */ /* filter packets that SA is myself or multicast or broadcast */
if (ether_addr_equal(myhwaddr, pattrib->src)) { if (ether_addr_equal(myhwaddr, pattrib->src)) {
...@@ -966,8 +966,8 @@ int ap2sta_data_frame(struct rtw_adapter *adapter, ...@@ -966,8 +966,8 @@ int ap2sta_data_frame(struct rtw_adapter *adapter,
goto exit; goto exit;
} }
} else if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true) && } else if (check_fwstate(pmlmepriv, WIFI_MP_STATE) &&
(check_fwstate(pmlmepriv, _FW_LINKED) == true)) { check_fwstate(pmlmepriv, _FW_LINKED)) {
ether_addr_copy(pattrib->dst, hdr->addr1); ether_addr_copy(pattrib->dst, hdr->addr1);
ether_addr_copy(pattrib->src, hdr->addr2); ether_addr_copy(pattrib->src, hdr->addr2);
ether_addr_copy(pattrib->bssid, hdr->addr3); ether_addr_copy(pattrib->bssid, hdr->addr3);
...@@ -985,7 +985,7 @@ int ap2sta_data_frame(struct rtw_adapter *adapter, ...@@ -985,7 +985,7 @@ int ap2sta_data_frame(struct rtw_adapter *adapter,
ret = _FAIL; ret = _FAIL;
goto exit; goto exit;
} }
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* Special case */ /* Special case */
ret = RTW_RX_HANDLED; ret = RTW_RX_HANDLED;
goto exit; goto exit;
...@@ -1029,7 +1029,7 @@ int sta2ap_data_frame(struct rtw_adapter *adapter, ...@@ -1029,7 +1029,7 @@ int sta2ap_data_frame(struct rtw_adapter *adapter,
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
/* For AP mode, RA = BSSID, TX = STA(SRC_ADDR), A3 = DST_ADDR */ /* For AP mode, RA = BSSID, TX = STA(SRC_ADDR), A3 = DST_ADDR */
if (!ether_addr_equal(pattrib->bssid, mybssid)) { if (!ether_addr_equal(pattrib->bssid, mybssid)) {
ret = _FAIL; ret = _FAIL;
...@@ -1589,7 +1589,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe) ...@@ -1589,7 +1589,7 @@ static int wlanhdr_to_ethhdr (struct recv_frame *precvframe)
pattrib->hdrlen, pattrib->iv_len)); pattrib->hdrlen, pattrib->iv_len));
pattrib->eth_type = eth_type; pattrib->eth_type = eth_type;
if ((check_fwstate(pmlmepriv, WIFI_MP_STATE) == true)) { if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
ptr += hdrlen; ptr += hdrlen;
*ptr = 0x87; *ptr = 0x87;
*(ptr + 1) = 0x12; *(ptr + 1) = 0x12;
......
...@@ -443,16 +443,14 @@ static int update_attrib(struct rtw_adapter *padapter, ...@@ -443,16 +443,14 @@ static int update_attrib(struct rtw_adapter *padapter,
pattrib->pctrl = 0; pattrib->pctrl = 0;
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) { check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
ether_addr_copy(pattrib->ra, pattrib->dst); ether_addr_copy(pattrib->ra, pattrib->dst);
ether_addr_copy(pattrib->ta, pattrib->src); ether_addr_copy(pattrib->ta, pattrib->src);
} } else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
ether_addr_copy(pattrib->ra, get_bssid(pmlmepriv)); ether_addr_copy(pattrib->ra, get_bssid(pmlmepriv));
ether_addr_copy(pattrib->ta, pattrib->src); ether_addr_copy(pattrib->ta, pattrib->src);
} } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
ether_addr_copy(pattrib->ra, pattrib->dst); ether_addr_copy(pattrib->ra, pattrib->dst);
ether_addr_copy(pattrib->ta, get_bssid(pmlmepriv)); ether_addr_copy(pattrib->ta, get_bssid(pmlmepriv));
} }
...@@ -510,7 +508,7 @@ static int update_attrib(struct rtw_adapter *padapter, ...@@ -510,7 +508,7 @@ static int update_attrib(struct rtw_adapter *padapter,
MAC_FMT"\n", MAC_ARG(pattrib->ra))); MAC_FMT"\n", MAC_ARG(pattrib->ra)));
res = _FAIL; res = _FAIL;
goto exit; goto exit;
} else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) && } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) &&
(!(psta->state & _FW_LINKED))) { (!(psta->state & _FW_LINKED))) {
res = _FAIL; res = _FAIL;
goto exit; goto exit;
...@@ -897,7 +895,7 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr, ...@@ -897,7 +895,7 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
pwlanhdr->frame_control = cpu_to_le16(pattrib->type); pwlanhdr->frame_control = cpu_to_le16(pattrib->type);
if (pattrib->type & IEEE80211_FTYPE_DATA) { if (pattrib->type & IEEE80211_FTYPE_DATA) {
if ((check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true)) { if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
/* to_ds = 1, fr_ds = 0; */ /* to_ds = 1, fr_ds = 0; */
/* Data transfer to AP */ /* Data transfer to AP */
pwlanhdr->frame_control |= pwlanhdr->frame_control |=
...@@ -909,8 +907,7 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr, ...@@ -909,8 +907,7 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
if (pmlmepriv->qos_option) if (pmlmepriv->qos_option)
qos_option = true; qos_option = true;
} } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == true)) {
/* to_ds = 0, fr_ds = 1; */ /* to_ds = 0, fr_ds = 1; */
pwlanhdr->frame_control |= pwlanhdr->frame_control |=
cpu_to_le16(IEEE80211_FCTL_FROMDS); cpu_to_le16(IEEE80211_FCTL_FROMDS);
...@@ -920,9 +917,8 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr, ...@@ -920,9 +917,8 @@ static int rtw_make_wlanhdr(struct rtw_adapter *padapter, u8 *hdr,
if (psta->qos_option) if (psta->qos_option)
qos_option = true; qos_option = true;
} } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) ||
else if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == true) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) {
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == true)) {
ether_addr_copy(pwlanhdr->addr1, pattrib->dst); ether_addr_copy(pwlanhdr->addr1, pattrib->dst);
ether_addr_copy(pwlanhdr->addr2, pattrib->src); ether_addr_copy(pwlanhdr->addr2, pattrib->src);
ether_addr_copy(pwlanhdr->addr3, get_bssid(pmlmepriv)); ether_addr_copy(pwlanhdr->addr3, get_bssid(pmlmepriv));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment