From e0facfa97c02330ca7f7e0751ab73175463bb85b Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Tue, 15 Apr 2014 19:43:53 +0200 Subject: [PATCH] staging: rtl8723au: Make mlme_handlers and action_handlers return int In addition, make them all static and move the prototypes to rtw_mlme_ext.c. Signed-off-by: Jes Sorensen Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723au/core/rtw_mlme_ext.c | 96 ++++++++++++------- .../staging/rtl8723au/include/rtw_mlme_ext.h | 26 +---- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c index 5264c24470b0..7452b03ab74c 100644 --- a/drivers/staging/rtl8723au/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723au/core/rtw_mlme_ext.c @@ -27,6 +27,28 @@ #include #endif +static int OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnProbeReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnProbeRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int DoReserved23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAtim23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnDisassoc23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAuth23aClient23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); + +static int on_action_spct23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a_qos(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a_dls(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a_back23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int on_action_public23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a_ht(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a_wmm(struct rtw_adapter *padapter, struct recv_frame *precv_frame); +static int OnAction23a_p2p(struct rtw_adapter *padapter, struct recv_frame *precv_frame); + static struct mlme_handler mlme_sta_tbl[]={ {"OnAssocReq23a", &OnAssocReq23a}, {"OnAssocRsp23a", &OnAssocRsp23a}, @@ -637,8 +659,8 @@ Following are the callback functions for each subtype of the management frames *****************************************************************************/ -unsigned int OnProbeReq23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnProbeReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { const u8 *ie; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -686,8 +708,8 @@ out: return _SUCCESS; } -unsigned int OnProbeRsp23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnProbeRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; @@ -699,8 +721,8 @@ unsigned int OnProbeRsp23a(struct rtw_adapter *padapter, return _SUCCESS; } -unsigned int OnBeacon23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { int cam_idx; struct sta_info *psta; @@ -828,8 +850,8 @@ _END_ONBEACON_: return _SUCCESS; } -unsigned int OnAuth23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { #ifdef CONFIG_8723AU_AP_MODE unsigned int auth_mode, seq; @@ -1020,8 +1042,8 @@ auth_fail: return _FAIL; } -unsigned int OnAuth23aClient23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAuth23aClient23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { unsigned int seq, status, algthm, offset; unsigned int go2asoc = 0; @@ -1113,7 +1135,8 @@ authclnt_fail: return _FAIL; } -unsigned int OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) +static int +OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { #ifdef CONFIG_8723AU_AP_MODE u16 capab_info, listen_interval; @@ -1582,8 +1605,8 @@ OnAssocReq23aFail: return _FAIL; } -unsigned int OnAssocRsp23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { struct ndis_802_11_var_ies *pIE; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1685,8 +1708,8 @@ report_assoc_result: return _SUCCESS; } -unsigned int OnDeAuth23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { unsigned short reason; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1741,8 +1764,8 @@ unsigned int OnDeAuth23a(struct rtw_adapter *padapter, return _SUCCESS; } -unsigned int OnDisassoc23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnDisassoc23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { unsigned short reason; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; @@ -1796,29 +1819,33 @@ unsigned int OnDisassoc23a(struct rtw_adapter *padapter, return _SUCCESS; } -unsigned int OnAtim23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) +static int +OnAtim23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { DBG_8723A("%s\n", __func__); return _SUCCESS; } -unsigned int on_action_spct23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) +static int +on_action_spct23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _FAIL; } -unsigned int OnAction23a_qos(struct rtw_adapter *padapter, struct recv_frame *precv_frame) +static int +OnAction23a_qos(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _SUCCESS; } -unsigned int OnAction23a_dls(struct rtw_adapter *padapter, struct recv_frame *precv_frame) +static int +OnAction23a_dls(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _SUCCESS; } -unsigned int OnAction23a_back23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int OnAction23a_back23a(struct rtw_adapter *padapter, + struct recv_frame *precv_frame) { u8 *addr; struct sta_info *psta = NULL; @@ -2014,8 +2041,8 @@ exit: return ret; } -unsigned int on_action_public23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int on_action_public23a(struct rtw_adapter *padapter, + struct recv_frame *precv_frame) { unsigned int ret = _FAIL; struct sk_buff *skb = precv_frame->pkt; @@ -2046,26 +2073,26 @@ exit: return ret; } -unsigned int OnAction23a_ht(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAction23a_ht(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _SUCCESS; } -unsigned int OnAction23a_wmm(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAction23a_wmm(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _SUCCESS; } -unsigned int OnAction23a_p2p(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAction23a_p2p(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _SUCCESS; } -unsigned int OnAction23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +static int +OnAction23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { int i; unsigned char category; @@ -2090,8 +2117,7 @@ unsigned int OnAction23a(struct rtw_adapter *padapter, return _SUCCESS; } -unsigned int DoReserved23a(struct rtw_adapter *padapter, - struct recv_frame *precv_frame) +int DoReserved23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame) { return _SUCCESS; } diff --git a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h index 9d9815dd6941..7f1cef124ee8 100644 --- a/drivers/staging/rtl8723au/include/rtw_mlme_ext.h +++ b/drivers/staging/rtl8723au/include/rtw_mlme_ext.h @@ -262,13 +262,13 @@ enum SCAN_STATE { struct mlme_handler { char *str; - unsigned int (*func)(struct rtw_adapter *padapter, struct recv_frame *precv_frame); + int (*func)(struct rtw_adapter *padapter, struct recv_frame *precv_frame); }; struct action_handler { unsigned int num; char* str; - unsigned int (*func)(struct rtw_adapter *padapter, struct recv_frame *precv_frame); + int (*func)(struct rtw_adapter *padapter, struct recv_frame *precv_frame); }; struct ss_res @@ -615,28 +615,6 @@ void start_clnt_auth23a(struct rtw_adapter *padapter); void start_clnt_join23a(struct rtw_adapter *padapter); void start_create_ibss23a(struct rtw_adapter *padapter); -unsigned int OnAssocReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAssocRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnProbeReq23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnProbeRsp23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int DoReserved23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnBeacon23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAtim23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnDisassoc23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAuth23aClient23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnDeAuth23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); - -unsigned int on_action_spct23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a_qos(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a_dls(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a_back23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int on_action_public23a(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a_ht(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a_wmm(struct rtw_adapter *padapter, struct recv_frame *precv_frame); -unsigned int OnAction23a_p2p(struct rtw_adapter *padapter, struct recv_frame *precv_frame); - void mlmeext_joinbss_event_callback23a(struct rtw_adapter *padapter, int join_res); void mlmeext_sta_del_event_callback23a(struct rtw_adapter *padapter); -- 2.30.2