From 78dc32e86cdf40da3c1fcf9851bcad5568c77fcc Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 28 Aug 2020 10:13:53 +0530 Subject: [PATCH] qcacmn: Fix the connection manager state machine init failure The state machine infra require the states in sequence and addition of if define in the wlan_sm_state_info will lead to state machine init failure. Fix this by removing the if define from the wlan_sm_state_info and adding the dummy func for not define cases. Change-Id: I5c5cb7837774954183a8ea1683c401441fb48bab CRs-Fixed: 2764953 --- .../connection_mgr/core/src/wlan_cm_roam_sm.h | 43 +++++++++++++++++-- .../mlme/connection_mgr/core/src/wlan_cm_sm.c | 4 -- 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/umac/mlme/connection_mgr/core/src/wlan_cm_roam_sm.h b/umac/mlme/connection_mgr/core/src/wlan_cm_roam_sm.h index 5afdcf811e..2754d4932c 100644 --- a/umac/mlme/connection_mgr/core/src/wlan_cm_roam_sm.h +++ b/umac/mlme/connection_mgr/core/src/wlan_cm_roam_sm.h @@ -59,8 +59,7 @@ void cm_state_roaming_exit(void *ctx); bool cm_state_roaming_event(void *ctx, uint16_t event, uint16_t data_len, void *data); -#ifdef WLAN_FEATURE_HOST_ROAM -#ifdef WLAN_FEATURE_PREAUTH_ENABLE +#if defined(WLAN_FEATURE_HOST_ROAM) && defined(WLAN_FEATURE_PREAUTH_ENABLE) /** * cm_subst_preauth_entry() - Entry API for preauth sub-state for * connection mgr @@ -97,7 +96,7 @@ void cm_subst_preauth_exit(void *ctx); */ bool cm_subst_preauth_event(void *ctx, uint16_t event, uint16_t data_len, void *data); -#else /* WLAN_FEATURE_PREAUTH_ENABLE && WLAN_FEATURE_HOST_ROAM */ +#else static inline void cm_subst_preauth_entry(void *ctx) {} @@ -108,8 +107,9 @@ static inline bool cm_subst_preauth_event(void *ctx, uint16_t event, { return true; } -#endif /* WLAN_FEATURE_PREAUTH_ENABLE */ +#endif /* WLAN_FEATURE_HOST_ROAM && WLAN_FEATURE_PREAUTH_ENABLE */ +#ifdef WLAN_FEATURE_HOST_ROAM /** * cm_subst_reassoc_entry() - Entry API for reassoc sub-state for * connection mgr @@ -146,6 +146,17 @@ void cm_subst_reassoc_exit(void *ctx); */ bool cm_subst_reassoc_event(void *ctx, uint16_t event, uint16_t data_len, void *data); +#else + +static inline void cm_subst_reassoc_entry(void *ctx) {} +static inline void cm_subst_reassoc_exit(void *ctx) {} +static inline +bool cm_subst_reassoc_event(void *ctx, uint16_t event, uint16_t data_len, + void *data) +{ + return true; +} + #endif /* WLAN_FEATURE_HOST_ROAM */ #ifdef WLAN_FEATURE_ROAM_OFFLOAD @@ -223,6 +234,30 @@ void cm_subst_roam_sync_exit(void *ctx); */ bool cm_subst_roam_sync_event(void *ctx, uint16_t event, uint16_t data_len, void *data); +#else + +static inline void cm_subst_roam_start_entry(void *ctx) {} + +static inline void cm_subst_roam_start_exit(void *ctx) {} + +static inline +bool cm_subst_roam_start_event(void *ctx, uint16_t event, uint16_t data_len, + void *data) +{ + return true; +} + +static inline void cm_subst_roam_sync_entry(void *ctx) {} + +static inline void cm_subst_roam_sync_exit(void *ctx) {} + +static inline +bool cm_subst_roam_sync_event(void *ctx, uint16_t event, uint16_t data_len, + void *data) +{ + return true; +} + #endif /* WLAN_FEATURE_ROAM_OFFLOAD */ #endif /* __WLAN_CM_ROAM_SM_H__ */ diff --git a/umac/mlme/connection_mgr/core/src/wlan_cm_sm.c b/umac/mlme/connection_mgr/core/src/wlan_cm_sm.c index 3d63859c14..13dfebfe3f 100644 --- a/umac/mlme/connection_mgr/core/src/wlan_cm_sm.c +++ b/umac/mlme/connection_mgr/core/src/wlan_cm_sm.c @@ -626,7 +626,6 @@ struct wlan_sm_state_info cm_sm_info[] = { cm_subst_join_active_exit, cm_subst_join_active_event }, -#ifdef WLAN_FEATURE_HOST_ROAM { (uint8_t)WLAN_CM_SS_PREAUTH, (uint8_t)WLAN_CM_S_ROAMING, @@ -647,8 +646,6 @@ struct wlan_sm_state_info cm_sm_info[] = { cm_subst_reassoc_exit, cm_subst_reassoc_event }, -#endif -#ifdef WLAN_FEATURE_ROAM_OFFLOAD { (uint8_t)WLAN_CM_SS_ROAM_STARTED, (uint8_t)WLAN_CM_S_ROAMING, @@ -669,7 +666,6 @@ struct wlan_sm_state_info cm_sm_info[] = { cm_subst_roam_sync_exit, cm_subst_roam_sync_event }, -#endif { (uint8_t)WLAN_CM_SS_MAX, (uint8_t)WLAN_SM_ENGINE_STATE_NONE,