From 66fc8d2e91f5c2f77bfbb0390f26b71fa872909c Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Tue, 26 Mar 2019 10:34:43 -0700 Subject: [PATCH] qcacld-3.0: Replace typedef tWLAN_SAPEvent The Linux Coding Style enumerates a few special cases where typedefs are useful, but stresses "NEVER EVER use a typedef unless you can clearly match one of those rules." The tWLAN_SAPEvent typedef does not meet any of those criteria, so replace it (and the "pt" variant) with a properly named struct. Change-Id: Ie39e51a24a16f0c19b7b0fe926748a6b90d31632 CRs-Fixed: 2423729 --- core/sap/src/sap_api_link_cntl.c | 6 ++--- core/sap/src/sap_fsm.c | 40 ++++++++++++++++++-------------- core/sap/src/sap_internal.h | 21 ++++++++--------- core/sap/src/sap_module.c | 6 ++--- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/core/sap/src/sap_api_link_cntl.c b/core/sap/src/sap_api_link_cntl.c index 2f3f458049b7..746f90ae4b6e 100644 --- a/core/sap/src/sap_api_link_cntl.c +++ b/core/sap/src/sap_api_link_cntl.c @@ -300,7 +300,7 @@ wlansap_roam_process_ch_change_success(struct mac_context *mac_ctx, struct csr_roam_info *csr_roam_info, QDF_STATUS *ret_status) { - tWLAN_SAPEvent sap_event; + struct sap_sm_event sap_event; QDF_STATUS qdf_status; bool is_ch_dfs = false; /* @@ -579,7 +579,7 @@ wlansap_roam_process_dfs_radar_found(struct mac_context *mac_ctx, QDF_STATUS *ret_status) { QDF_STATUS qdf_status; - tWLAN_SAPEvent sap_event; + struct sap_sm_event sap_event; if (sap_is_dfs_cac_wait_state(sap_ctx)) { if (mac_ctx->mlme_cfg->dfs_cfg.dfs_disable_channel_switch) { @@ -769,7 +769,7 @@ wlansap_roam_callback(void *ctx, struct csr_roam_info *csr_roam_info, /* sap_ctx value */ struct sap_context *sap_ctx = ctx; /* State machine event */ - tWLAN_SAPEvent sap_event; + struct sap_sm_event sap_event; QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; QDF_STATUS qdf_ret_status = QDF_STATUS_SUCCESS; mac_handle_t mac_handle; diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index 88e06a8f1001..c906311af719 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -1295,7 +1295,7 @@ static QDF_STATUS sap_goto_stopping(struct sap_context *sap_ctx) static QDF_STATUS sap_goto_init(struct sap_context *sap_ctx) { QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; - tWLAN_SAPEvent sap_event; + struct sap_sm_event sap_event; /* Processing has to be coded */ /* @@ -2136,10 +2136,10 @@ static QDF_STATUS sap_cac_end_notify(mac_handle_t mac_handle, * * Return: QDF_STATUS */ -static QDF_STATUS -sap_goto_starting(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, struct mac_context *mac_ctx, - mac_handle_t mac_handle) +static QDF_STATUS sap_goto_starting(struct sap_context *sap_ctx, + struct sap_sm_event *sap_event, + struct mac_context *mac_ctx, + mac_handle_t mac_handle) { QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; bool b_leak_chan = false; @@ -2323,10 +2323,10 @@ static QDF_STATUS sap_fsm_cac_start(struct sap_context *sap_ctx, * * Return: QDF_STATUS */ -static QDF_STATUS -sap_fsm_state_init(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, struct mac_context *mac_ctx, - mac_handle_t mac_handle) +static QDF_STATUS sap_fsm_state_init(struct sap_context *sap_ctx, + struct sap_sm_event *sap_event, + struct mac_context *mac_ctx, + mac_handle_t mac_handle) { uint32_t msg = sap_event->event; QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; @@ -2428,7 +2428,7 @@ static QDF_STATUS sap_fsm_handle_radar_during_cac(struct sap_context *sap_ctx, #ifdef CONFIG_VDEV_SM static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, + struct sap_sm_event *sap_event, struct mac_context *mac_ctx, mac_handle_t mac_handle) { @@ -2506,8 +2506,9 @@ static QDF_STATUS sap_fsm_handle_start_failure(struct sap_context *sap_ctx, * Return: QDF_STATUS */ static QDF_STATUS sap_fsm_state_dfs_cac_wait(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, struct mac_context *mac_ctx, - mac_handle_t mac_handle) + struct sap_sm_event *sap_event, + struct mac_context *mac_ctx, + mac_handle_t mac_handle) { uint32_t msg = sap_event->event; struct csr_roam_info *roam_info = @@ -2586,8 +2587,9 @@ static QDF_STATUS sap_fsm_handle_start_failure(struct sap_context *sap_ctx, * Return: QDF_STATUS */ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, struct mac_context *mac_ctx, - mac_handle_t mac_handle) + struct sap_sm_event *sap_event, + struct mac_context *mac_ctx, + mac_handle_t mac_handle) { uint32_t msg = sap_event->event; struct csr_roam_info *roam_info = @@ -2763,7 +2765,8 @@ sap_handle_csa_anouncement_start(struct mac_context *mac_ctx, * Return: QDF_STATUS */ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, struct mac_context *mac_ctx) + struct sap_sm_event *sap_event, + struct mac_context *mac_ctx) { uint32_t msg = sap_event->event; QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE; @@ -2844,7 +2847,8 @@ static QDF_STATUS sap_fsm_state_started(struct sap_context *sap_ctx, */ static QDF_STATUS sap_fsm_state_stopping(struct sap_context *sap_ctx, - ptWLAN_SAPEvent sap_event, struct mac_context *mac_ctx, + struct sap_sm_event *sap_event, + struct mac_context *mac_ctx, mac_handle_t mac_handle) { uint32_t msg = sap_event->event; @@ -2882,7 +2886,7 @@ sap_fsm_state_stopping(struct sap_context *sap_ctx, * * Return: QDF_STATUS */ -QDF_STATUS sap_fsm(struct sap_context *sap_ctx, ptWLAN_SAPEvent sap_event) +QDF_STATUS sap_fsm(struct sap_context *sap_ctx, struct sap_sm_event *sap_event) { /* * Retrieve the phy link state machine structure @@ -3618,7 +3622,7 @@ uint8_t sap_indicate_radar(struct sap_context *sap_ctx) void sap_dfs_cac_timer_callback(void *data) { struct sap_context *sap_ctx; - tWLAN_SAPEvent sap_event; + struct sap_sm_event sap_event; mac_handle_t mac_handle = data; struct mac_context *mac; diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index 654a518f3661..b53ac56e07d2 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -203,20 +203,19 @@ struct sap_context { * External declarations for global context * -------------------------------------------------------------------------*/ -/*---------------------------------------------------------------------------- - * SAP state machine event definition - * -------------------------------------------------------------------------*/ -/* The event structure */ -typedef struct sWLAN_SAPEvent { - /* A VOID pointer type for all possible inputs */ +/** + * struct sap_sm_event - SAP state machine event definition + * @params: A VOID pointer type for all possible inputs + * @event: State machine input event message + * @u1: Introduced to handle csr_roam_complete_cb roamStatus + * @u2: Introduced to handle csr_roam_complete_cb roamResult + */ +struct sap_sm_event { void *params; - /* State machine input event message */ uint32_t event; - /* introduced to handle csr_roam_complete_cb roamStatus */ uint32_t u1; - /* introduced to handle csr_roam_complete_cb roamResult */ uint32_t u2; -} tWLAN_SAPEvent, *ptWLAN_SAPEvent; +}; /*---------------------------------------------------------------------------- * Function Declarations and Documentation @@ -263,7 +262,7 @@ sap_signal_hdd_event(struct sap_context *sap_ctx, struct csr_roam_info *pCsrRoamInfo, eSapHddEvent sapHddevent, void *); -QDF_STATUS sap_fsm(struct sap_context *sap_ctx, ptWLAN_SAPEvent sap_event); +QDF_STATUS sap_fsm(struct sap_context *sap_ctx, struct sap_sm_event *sap_event); eSapStatus sapconvert_to_csr_profile(struct sap_config *config, diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index d23e391a0abb..b508d957cc94 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -665,7 +665,7 @@ QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, sap_event_cb sap_event_cb, struct sap_config *config, void *user_context) { - tWLAN_SAPEvent sap_event; /* State machine event */ + struct sap_sm_event sap_event; /* State machine event */ QDF_STATUS qdf_status = QDF_STATUS_SUCCESS; struct mac_context *pmac = NULL; @@ -804,7 +804,7 @@ QDF_STATUS wlansap_set_mac_acl(struct sap_context *sap_ctx, QDF_STATUS wlansap_stop_bss(struct sap_context *sap_ctx) { - tWLAN_SAPEvent sap_event; /* State machine event */ + struct sap_sm_event sap_event; /* State machine event */ QDF_STATUS qdf_status; if (!sap_ctx) { @@ -1267,7 +1267,7 @@ static inline void sap_start_csa_restart(struct mac_context *mac, static void sap_start_csa_restart(struct mac_context *mac, struct sap_context *sap_ctx) { - tWLAN_SAPEvent sap_event; + struct sap_sm_event sap_event; /* * Post the eSAP_CHANNEL_SWITCH_ANNOUNCEMENT_START