mirror of
https://github.com/abperiasamy/rtl8812AU_8821AU_linux.git
synced 2025-04-29 23:29:38 +02:00
Refactor case-statement to if-statement to avoid implicit fallback. (#310)
This commit is contained in:
parent
4235b0ec7d
commit
fa68771376
@ -672,6 +672,8 @@ static void _mgt_dispatcher(_adapter *padapter, struct mlme_handler *ptable, uni
|
|||||||
|
|
||||||
void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
||||||
{
|
{
|
||||||
|
int subtype;
|
||||||
|
|
||||||
int index;
|
int index;
|
||||||
struct mlme_handler *ptable;
|
struct mlme_handler *ptable;
|
||||||
#ifdef CONFIG_AP_MODE
|
#ifdef CONFIG_AP_MODE
|
||||||
@ -751,50 +753,61 @@ void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_AP_MODE
|
#ifdef CONFIG_AP_MODE
|
||||||
switch (GetFrameSubType(pframe)) {
|
subtype = GetFrameSubType(pframe);
|
||||||
case WIFI_AUTH:
|
if ((subtype == WIFI_AUTH) ||
|
||||||
|
(subtype == WIFI_ASSOCREQ) ||
|
||||||
|
(subtype == WIFI_REASSOCREQ))
|
||||||
|
{
|
||||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||||
|
{
|
||||||
ptable->func = &OnAuth;
|
ptable->func = &OnAuth;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ptable->func = &OnAuthClient;
|
ptable->func = &OnAuthClient;
|
||||||
//pass through
|
}
|
||||||
case WIFI_ASSOCREQ:
|
|
||||||
case WIFI_REASSOCREQ:
|
// fallthrough
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
if ((subtype == WIFI_ASSOCREQ) ||
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
(subtype == WIFI_REASSOCREQ))
|
||||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
{
|
||||||
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
|
||||||
#endif
|
|
||||||
break;
|
|
||||||
case WIFI_PROBEREQ:
|
|
||||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) {
|
|
||||||
#ifdef CONFIG_HOSTAPD_MLME
|
|
||||||
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
|
||||||
#else
|
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
#endif
|
|
||||||
} else
|
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||||
|
{
|
||||||
|
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (subtype == WIFI_PROBEREQ)
|
||||||
|
{
|
||||||
|
if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) {
|
||||||
|
#ifdef CONFIG_HOSTAPD_MLME
|
||||||
|
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
||||||
|
#else
|
||||||
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
break;
|
}
|
||||||
case WIFI_BEACON:
|
} else if (subtype == WIFI_BEACON ||
|
||||||
|
subtype == WIFI_ACTION)
|
||||||
|
{
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
break;
|
}
|
||||||
case WIFI_ACTION:
|
else
|
||||||
//if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
{
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
if(check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE)
|
||||||
|
{
|
||||||
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
rtw_hostapd_mlme_rx(padapter, precv_frame);
|
||||||
break;
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
_mgt_dispatcher(padapter, ptable, precv_frame);
|
_mgt_dispatcher(padapter, ptable, precv_frame);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_P2P
|
#ifdef CONFIG_P2P
|
||||||
|
Loading…
x
Reference in New Issue
Block a user