From 0a4d67bf730803a8afb496089974306ad5fd783f Mon Sep 17 00:00:00 2001 From: Sandeep Puligilla Date: Fri, 19 Oct 2018 15:32:08 -0700 Subject: [PATCH] qcacmn: Add support to event WLAN_VDEV_SM_EV_ROAM - Add supprot to event 'WLAN_VDEV_SM_EV_ROAM'. - WLAN_VDEV_SM_EV_ROAM - roaming event to notify the vdev manager about the firmware triggered roaming. Change-Id: I249664e72ba5fe0e13ddc8e59533489c69963f5f CRs-Fixed: 2337795 --- umac/mlme/include/wlan_vdev_mlme.h | 45 +++++++++++++--- .../dispatcher/inc/wlan_vdev_mlme_main.h | 52 ++++++++++--------- umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c | 27 ++++++---- 3 files changed, 81 insertions(+), 43 deletions(-) diff --git a/umac/mlme/include/wlan_vdev_mlme.h b/umac/mlme/include/wlan_vdev_mlme.h index 3c7de9ffc938..ca323f5d724f 100644 --- a/umac/mlme/include/wlan_vdev_mlme.h +++ b/umac/mlme/include/wlan_vdev_mlme.h @@ -72,6 +72,7 @@ enum vdev_cmd_type { * MLME up operation * @mlme_vdev_notify_up_complete: callback to notify VDEV MLME on moving * to UP state + * @mlme_vdev_notify_roam_start: callback to initiate roaming * @mlme_vdev_update_beacon: callback to initiate beacon update * @mlme_vdev_disconnect_peers: callback to initiate disconnection of * peers @@ -123,6 +124,9 @@ struct vdev_mlme_ops { QDF_STATUS (*mlme_vdev_notify_up_complete)( struct vdev_mlme_obj *vdev_mlme, uint16_t event_data_len, void *event_data); + QDF_STATUS (*mlme_vdev_notify_roam_start)( + struct vdev_mlme_obj *vdev_mlme, + uint16_t event_data_len, void *event_data); QDF_STATUS (*mlme_vdev_update_beacon)( struct vdev_mlme_obj *vdev_mlme, enum beacon_update_op op, @@ -401,19 +405,44 @@ static inline QDF_STATUS mlme_vdev_up_send( * Return: SUCCESS on successful completion of up notification * FAILURE, if it fails due to any */ -static inline QDF_STATUS mlme_vdev_notify_up_complete( - struct vdev_mlme_obj *vdev_mlme, +static inline +QDF_STATUS mlme_vdev_notify_up_complete(struct vdev_mlme_obj *vdev_mlme, uint16_t event_data_len, void *event_data) { QDF_STATUS ret = QDF_STATUS_SUCCESS; - if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_notify_up_complete) + if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_up_complete) ret = vdev_mlme->ops->mlme_vdev_notify_up_complete( vdev_mlme, event_data_len, event_data); return ret; } +/** + * mlme_vdev_notify_roam_start - VDEV Roaming notification + * @vdev_mlme_obj: VDEV MLME comp object + * @event_len: data size + * @event_data: event data + * + * API notifies MLME on roaming + * + * Return: SUCCESS on successful completion of up notification + * FAILURE, if it fails due to any + */ +static inline +QDF_STATUS mlme_vdev_notify_roam_start(struct vdev_mlme_obj *vdev_mlme, + uint16_t event_len, void *event_data) +{ + QDF_STATUS ret = QDF_STATUS_SUCCESS; + + if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_notify_roam_start) + ret = vdev_mlme->ops->mlme_vdev_notify_roam_start(vdev_mlme, + event_len, + event_data); + + return ret; +} + /** * mlme_vdev_update_beacon - Updates beacon * @vdev_mlme_obj: VDEV MLME comp object @@ -426,14 +455,14 @@ static inline QDF_STATUS mlme_vdev_notify_up_complete( * Return: SUCCESS on successful update of beacon * FAILURE, if it fails due to any */ -static inline QDF_STATUS mlme_vdev_update_beacon( - struct vdev_mlme_obj *vdev_mlme, - enum beacon_update_op op, - uint16_t event_data_len, void *event_data) +static inline +QDF_STATUS mlme_vdev_update_beacon(struct vdev_mlme_obj *vdev_mlme, + enum beacon_update_op op, + uint16_t event_data_len, void *event_data) { QDF_STATUS ret = QDF_STATUS_SUCCESS; - if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_update_beacon) + if (vdev_mlme->ops && vdev_mlme->ops->mlme_vdev_update_beacon) ret = vdev_mlme->ops->mlme_vdev_update_beacon(vdev_mlme, op, event_data_len, event_data); diff --git a/umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.h b/umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.h index c2f2eba8c20d..948bec2826ec 100644 --- a/umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.h +++ b/umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.h @@ -102,36 +102,38 @@ enum wlan_vdev_state { * @WLAN_VDEV_SM_EV_CSA_COMPLETE: Notifiction of CSA process complete * @WLAN_VDEV_SM_EV_MLME_DOWN_REQ: Invoke DOWN command operation * @WLAN_VDEV_SM_EV_DOWN_COMPLETE: Notification of DOWN complete + * @WLAN_VDEV_SM_EV_ROAM: Notifiction on ROAMING */ enum wlan_vdev_sm_evt { WLAN_VDEV_SM_EV_START = 0, - WLAN_VDEV_SM_EV_START_REQ, - WLAN_VDEV_SM_EV_RESTART_REQ, - WLAN_VDEV_SM_EV_START_RESP, - WLAN_VDEV_SM_EV_RESTART_RESP, - WLAN_VDEV_SM_EV_START_REQ_FAIL, - WLAN_VDEV_SM_EV_RESTART_REQ_FAIL, - WLAN_VDEV_SM_EV_START_SUCCESS, - WLAN_VDEV_SM_EV_CONN_PROGRESS, - WLAN_VDEV_SM_EV_STA_CONN_START, + WLAN_VDEV_SM_EV_START_REQ = 1, + WLAN_VDEV_SM_EV_RESTART_REQ = 2, + WLAN_VDEV_SM_EV_START_RESP = 3, + WLAN_VDEV_SM_EV_RESTART_RESP = 4, + WLAN_VDEV_SM_EV_START_REQ_FAIL = 5, + WLAN_VDEV_SM_EV_RESTART_REQ_FAIL = 6, + WLAN_VDEV_SM_EV_START_SUCCESS = 7, + WLAN_VDEV_SM_EV_CONN_PROGRESS = 8, + WLAN_VDEV_SM_EV_STA_CONN_START = 9, WLAN_VDEV_SM_EV_DFS_CAC_WAIT = 10, - WLAN_VDEV_SM_EV_DFS_CAC_COMPLETED, - WLAN_VDEV_SM_EV_DOWN, - WLAN_VDEV_SM_EV_CONNECTION_FAIL, - WLAN_VDEV_SM_EV_STOP_RESP, - WLAN_VDEV_SM_EV_STOP_FAIL, - WLAN_VDEV_SM_EV_DOWN_FAIL, - WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE, - WLAN_VDEV_SM_EV_SUPSEND_RESTART, - WLAN_VDEV_SM_EV_HOST_RESTART, + WLAN_VDEV_SM_EV_DFS_CAC_COMPLETED = 11, + WLAN_VDEV_SM_EV_DOWN = 12, + WLAN_VDEV_SM_EV_CONNECTION_FAIL = 13, + WLAN_VDEV_SM_EV_STOP_RESP = 14, + WLAN_VDEV_SM_EV_STOP_FAIL = 15, + WLAN_VDEV_SM_EV_DOWN_FAIL = 16, + WLAN_VDEV_SM_EV_DISCONNECT_COMPLETE = 17, + WLAN_VDEV_SM_EV_SUPSEND_RESTART = 18, + WLAN_VDEV_SM_EV_HOST_RESTART = 19, WLAN_VDEV_SM_EV_UP_HOST_RESTART = 20, - WLAN_VDEV_SM_EV_FW_VDEV_RESTART, - WLAN_VDEV_SM_EV_UP_FAIL, - WLAN_VDEV_SM_EV_RADAR_DETECTED, - WLAN_VDEV_SM_EV_CSA_RESTART, - WLAN_VDEV_SM_EV_CSA_COMPLETE, - WLAN_VDEV_SM_EV_MLME_DOWN_REQ, - WLAN_VDEV_SM_EV_DOWN_COMPLETE, + WLAN_VDEV_SM_EV_FW_VDEV_RESTART = 21, + WLAN_VDEV_SM_EV_UP_FAIL = 22, + WLAN_VDEV_SM_EV_RADAR_DETECTED = 23, + WLAN_VDEV_SM_EV_CSA_RESTART = 24, + WLAN_VDEV_SM_EV_CSA_COMPLETE = 25, + WLAN_VDEV_SM_EV_MLME_DOWN_REQ = 26, + WLAN_VDEV_SM_EV_DOWN_COMPLETE = 27, + WLAN_VDEV_SM_EV_ROAM = 28, }; /** diff --git a/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c b/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c index 2cc0d5e9a183..79b011e39431 100644 --- a/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c +++ b/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.c @@ -409,9 +409,9 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event, struct vdev_mlme_obj *vdev_mlme = (struct vdev_mlme_obj *)ctx; enum QDF_OPMODE mode; struct wlan_objmgr_vdev *vdev; + bool status = false; vdev = vdev_mlme->vdev; - mode = wlan_vdev_mlme_get_opmode(vdev); switch (event) { @@ -427,7 +427,7 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event, mlme_vdev_notify_up_complete(vdev_mlme, event_data_len, event_data); - return true; + status = true; break; case WLAN_VDEV_SM_EV_SUPSEND_RESTART: @@ -441,8 +441,8 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event, mlme_vdev_sm_transition_to(vdev_mlme, WLAN_VDEV_S_SUSPEND); mlme_vdev_sm_deliver_event(vdev_mlme, event, event_data_len, event_data); - return true; - break; + status = true; + break; case WLAN_VDEV_SM_EV_RADAR_DETECTED: /* These events are not supported in STA mode */ @@ -452,8 +452,8 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event, mlme_vdev_sm_deliver_event(vdev_mlme, WLAN_VDEV_SM_EV_CSA_RESTART, event_data_len, event_data); - return true; - break; + status = true; + break; case WLAN_VDEV_SM_EV_UP_HOST_RESTART: /* Reinit beacon, send template to FW(use ping-pong buffer) */ @@ -463,7 +463,7 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event, /* notify that UP command is completed */ mlme_vdev_notify_up_complete(vdev_mlme, event_data_len, event_data); - return true; + status = true; break; case WLAN_VDEV_SM_EV_FW_VDEV_RESTART: @@ -471,20 +471,27 @@ static bool mlme_vdev_state_up_event(void *ctx, uint16_t event, mlme_vdev_sm_deliver_event(vdev_mlme, WLAN_VDEV_SM_EV_RESTART_REQ, event_data_len, event_data); - return true; + status = true; break; case WLAN_VDEV_SM_EV_UP_FAIL: mlme_vdev_sm_transition_to(vdev_mlme, WLAN_VDEV_S_SUSPEND); mlme_vdev_sm_deliver_event(vdev_mlme, event, event_data_len, event_data); - return true; + status = true; + break; + + case WLAN_VDEV_SM_EV_ROAM: + mlme_vdev_notify_roam_start(vdev_mlme, event_data_len, + event_data); + status = true; break; default: - return false; break; } + + return status; } /**