qcacld-3.0: Wait for RSO stop response from firmware

Firmware doesn't expect any vdev commands from host while RSO stop
is happening. It sends a response to the RSO_STOP command once
it's done with cleanup. Host needs to run a timer after sending
RSO stop command to firmware and wait for a maximum of 6 seconds
for the response. Host can stop the timer and allow the commands
to firmware in the below cases,
1. RSO_STOP response with success status
2. RSO_STOP response with HO_FAIL status followed by
   HO_FAIL event: Host needs to wait till HO_FAIL event is received

If firmware doesn't send any response in the 6 seconds wait, issue
a recovery to help to check the firmware state.

Also, set WMI_ROAM_SCAN_MODE_FLAG_REPORT_STATUS always when MLO is
supported while sending RSO_STOP to firmware. It's sent only
in case of wpa_supplicant disabled roaming currently.

Change-Id: I8182e60beb9288dba23cc72e978dc781c8ab1707
CRs-Fixed: 3106023
This commit is contained in:
Srinivas Dasari
2021-12-21 16:28:34 +05:30
committed by Madan Koyyalamudi
parent 2bd5e660c5
commit db3c1a98e5
16 changed files with 429 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -238,7 +239,8 @@ QDF_STATUS cm_handle_roam_start(struct wlan_objmgr_vdev *vdev,
cm_roam_state_change(wlan_vdev_get_pdev(vdev),
wlan_vdev_get_id(vdev),
WLAN_ROAM_RSO_STOPPED,
REASON_OS_REQUESTED_ROAMING_NOW);
REASON_OS_REQUESTED_ROAMING_NOW,
NULL, false);
return QDF_STATUS_SUCCESS;
}

View File

@@ -66,7 +66,7 @@ QDF_STATUS cm_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
vdev_id);
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
return cm_roam_stop_req(psoc, vdev_id,
REASON_ROAM_SYNCH_FAILED);
REASON_ROAM_SYNCH_FAILED, NULL, false);
}
status = cm_sm_deliver_event(vdev, WLAN_CM_SM_EV_ROAM_SYNC,
@@ -75,7 +75,8 @@ QDF_STATUS cm_fw_roam_sync_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("EV ROAM SYNC REQ not handled");
cm_fw_roam_abort_req(psoc, vdev_id);
cm_roam_stop_req(psoc, vdev_id, REASON_ROAM_SYNCH_FAILED);
cm_roam_stop_req(psoc, vdev_id, REASON_ROAM_SYNCH_FAILED,
NULL, false);
}
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
@@ -117,7 +118,8 @@ cm_fw_send_vdev_roam_event(struct cnx_mgr *cm_ctx, uint16_t data_len,
if (QDF_IS_STATUS_ERROR(status))
cm_roam_stop_req(psoc, roam_req->req.vdev_id,
REASON_ROAM_SYNCH_FAILED);
REASON_ROAM_SYNCH_FAILED,
NULL, false);
error:
if (QDF_IS_STATUS_ERROR(status))
@@ -882,7 +884,8 @@ error:
wlan_cm_free_connect_rsp(rsp);
if (QDF_IS_STATUS_ERROR(status)) {
cm_roam_stop_req(psoc, vdev_id, REASON_ROAM_SYNCH_FAILED);
cm_roam_stop_req(psoc, vdev_id, REASON_ROAM_SYNCH_FAILED,
NULL, false);
cm_abort_fw_roam(cm_ctx, cm_id);
mlo_update_connected_links(vdev, 0);
}

View File

@@ -929,7 +929,7 @@ QDF_STATUS cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev,
status = cm_roam_state_change(pdev, vdev_id,
trigger->trigger_bitmap ? WLAN_ROAM_RSO_ENABLED :
WLAN_ROAM_DEINIT,
reason);
reason, NULL, false);
if (QDF_IS_STATUS_ERROR(status))
return status;
@@ -2948,7 +2948,7 @@ static void cm_fill_stop_reason(struct wlan_roam_stop_config *stop_req,
QDF_STATUS
cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
uint8_t reason)
uint8_t reason, bool *send_resp, bool start_timer)
{
struct wlan_roam_stop_config *stop_req;
QDF_STATUS status;
@@ -2990,6 +2990,9 @@ cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
cm_fill_stop_reason(stop_req, reason);
if (wlan_cm_host_roam_in_progress(psoc, vdev_id))
stop_req->middle_of_roaming = 1;
if (send_resp)
stop_req->send_rso_stop_resp = *send_resp;
stop_req->start_rso_stop_timer = start_timer;
/*
* If roam synch propagation is in progress and an user space
* disconnect is requested, then there is no need to send the
@@ -3028,6 +3031,8 @@ cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
if (QDF_IS_STATUS_ERROR(status)) {
mlme_debug("fail to send roam stop");
}
if (send_resp)
*send_resp = stop_req->send_rso_stop_resp;
rel_vdev_ref:
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
@@ -3439,7 +3444,7 @@ QDF_STATUS cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
static QDF_STATUS
cm_roam_switch_to_rso_stop(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
uint8_t reason)
uint8_t reason, bool *send_resp, bool start_timer)
{
enum roam_offload_state cur_state;
QDF_STATUS status;
@@ -3450,7 +3455,8 @@ cm_roam_switch_to_rso_stop(struct wlan_objmgr_pdev *pdev,
case WLAN_ROAM_RSO_ENABLED:
case WLAN_ROAMING_IN_PROG:
case WLAN_ROAM_SYNCH_IN_PROG:
status = cm_roam_stop_req(psoc, vdev_id, reason);
status = cm_roam_stop_req(psoc, vdev_id, reason,
send_resp, start_timer);
if (QDF_IS_STATUS_ERROR(status)) {
mlme_err("ROAM: Unable to switch to RSO STOP State");
return QDF_STATUS_E_FAILURE;
@@ -3501,7 +3507,7 @@ cm_roam_switch_to_deinit(struct wlan_objmgr_pdev *pdev,
case WLAN_ROAM_RSO_ENABLED:
case WLAN_ROAMING_IN_PROG:
case WLAN_ROAM_SYNCH_IN_PROG:
cm_roam_switch_to_rso_stop(pdev, vdev_id, reason);
cm_roam_switch_to_rso_stop(pdev, vdev_id, reason, NULL, false);
break;
case WLAN_ROAM_RSO_STOPPED:
/*
@@ -3522,7 +3528,8 @@ cm_roam_switch_to_deinit(struct wlan_objmgr_pdev *pdev,
if (sup_disabled_roam) {
mlme_err("vdev[%d]: supplicant disabled roam. clear roam scan mode",
vdev_id);
cm_roam_switch_to_rso_stop(pdev, vdev_id, reason);
cm_roam_switch_to_rso_stop(pdev, vdev_id, reason,
NULL, false);
}
case WLAN_ROAM_INIT:
@@ -3650,7 +3657,8 @@ cm_roam_switch_to_init(struct wlan_objmgr_pdev *pdev,
cm_roam_state_change(pdev, temp_vdev_id,
WLAN_ROAM_DEINIT,
is_vdev_primary ?
REASON_ROAM_SET_PRIMARY : reason);
REASON_ROAM_SET_PRIMARY : reason,
NULL, false);
} else {
mlme_info("CM_RSO: Roam module already initialized on vdev:[%d]",
temp_vdev_id);
@@ -3847,7 +3855,8 @@ cm_roam_switch_to_rso_enable(struct wlan_objmgr_pdev *pdev,
mlme_debug("ROAM: RSO disabled by Supplicant on vdev[%d]", vdev_id);
return cm_roam_state_change(pdev, vdev_id, WLAN_ROAM_RSO_STOPPED,
REASON_SUPPLICANT_DISABLED_ROAMING);
REASON_SUPPLICANT_DISABLED_ROAMING,
NULL, false);
}
/**
@@ -4217,7 +4226,7 @@ QDF_STATUS
cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
enum roam_offload_state requested_state,
uint8_t reason)
uint8_t reason, bool *send_resp, bool start_timer)
{
QDF_STATUS status = QDF_STATUS_SUCCESS;
struct wlan_objmgr_vdev *vdev;
@@ -4260,7 +4269,8 @@ cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
status = cm_roam_switch_to_rso_enable(pdev, vdev_id, reason);
break;
case WLAN_ROAM_RSO_STOPPED:
status = cm_roam_switch_to_rso_stop(pdev, vdev_id, reason);
status = cm_roam_switch_to_rso_stop(pdev, vdev_id, reason,
send_resp, start_timer);
break;
case WLAN_ROAMING_IN_PROG:
status = cm_roam_switch_to_roam_start(pdev, vdev_id, reason);
@@ -5840,4 +5850,30 @@ cm_roam_beacon_loss_disconnect_event(struct qdf_mac_addr bssid, int32_t rssi,
return status;
}
#endif /* WLAN_FEATURE_CONNECTIVITY_LOGGING */
QDF_STATUS
cm_send_rso_stop(struct wlan_objmgr_vdev *vdev)
{
bool send_resp = true, start_timer;
if (!vdev) {
mlme_err("vdev is NULL");
return QDF_STATUS_E_INVAL;
}
start_timer = cm_roam_offload_enabled(wlan_vdev_get_psoc(vdev));
cm_roam_state_change(wlan_vdev_get_pdev(vdev), wlan_vdev_get_id(vdev),
WLAN_ROAM_RSO_STOPPED, REASON_DRIVER_DISABLED,
&send_resp, start_timer);
/*
* RSO stop resp is not supported or RSO STOP timer/req failed,
* then send resp from here
*/
if (send_resp)
wlan_cm_rso_stop_continue_disconnect(wlan_vdev_get_psoc(vdev),
wlan_vdev_get_id(vdev),
false);
return QDF_STATUS_SUCCESS;
}
#endif /* WLAN_FEATURE_ROAM_OFFLOAD */

View File

@@ -106,6 +106,8 @@ void cm_roam_result_info_event(struct wmi_roam_result *res,
* @vdev_id: vdev id
* @requested_state: roam state to be set
* @reason: reason for changing roam state for the requested vdev id
* @send_resp: send rso stop response
* @start_timer: start timer for rso stop
*
* This function posts roam state change to roam state machine handling
*
@@ -115,7 +117,7 @@ QDF_STATUS
cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
uint8_t vdev_id,
enum roam_offload_state requested_state,
uint8_t reason);
uint8_t reason, bool *send_resp, bool start_timer);
/**
* cm_handle_sta_sta_roaming_enablement() - To handle roaming in case
@@ -169,12 +171,14 @@ QDF_STATUS cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev,
* @psoc: psoc pointer
* @vdev_id: vdev id
* @reason: reason for changing roam state for the requested vdev id
* @send_resp: send rso stop response
* @start_timer: start timer for rso stop
*
* Return: QDF_STATUS
*/
QDF_STATUS
cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
uint8_t reason);
uint8_t reason, bool *send_resp, bool start_timer);
/**
* cm_roam_fill_rssi_change_params() - Fill roam scan rssi change parameters

View File

@@ -532,7 +532,8 @@ err:
wlan_mlo_roam_abort_on_link(psoc, sync_ind);
cm_fw_roam_abort_req(psoc, sync_ind->roamed_vdev_id);
cm_roam_stop_req(psoc, sync_ind->roamed_vdev_id,
REASON_ROAM_SYNCH_FAILED);
REASON_ROAM_SYNCH_FAILED,
NULL, false);
}
return status;
}

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012-2015, 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -689,4 +690,32 @@ QDF_STATUS wlan_cm_send_connect_rsp(struct scheduler_msg *msg);
* Return: void
*/
void wlan_cm_free_connect_rsp(struct cm_vdev_join_rsp *rsp);
/**
* wlan_cm_rso_stop_continue_disconnect() - Continue disconnect after RSO stop
* @psoc: psoc object
* @vdev_id: vdev id
* @is_ho_fail: Carries true if HO_FAIL happened
*
* Return: QDF_STATUS
*/
QDF_STATUS
wlan_cm_rso_stop_continue_disconnect(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, bool is_ho_fail);
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
/**
* cm_send_rso_stop() - Send RSP stop req to firmware
* @vdev: VDEV object
*
* Return: QDF_STATUS
*/
QDF_STATUS
cm_send_rso_stop(struct wlan_objmgr_vdev *vdev);
#else
static inline QDF_STATUS
cm_send_rso_stop(struct wlan_objmgr_vdev *vdev)
{
return QDF_STATUS_E_NOSUPPORT;
}
#endif
#endif /* __WLAN_CM_VDEV_API_H__ */

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2012-2015, 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -82,8 +83,6 @@ QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
wlan_p2p_cleanup_roc_by_vdev(vdev);
wlan_tdls_notify_sta_disconnect(req->vdev_id, false,
user_disconnect, vdev);
cm_roam_state_change(pdev, req->vdev_id, WLAN_ROAM_RSO_STOPPED,
REASON_DRIVER_DISABLED);
}
cm_abort_connect_request_timers(vdev);
@@ -401,3 +400,38 @@ QDF_STATUS cm_handle_disconnect_resp(struct scheduler_msg *msg)
return QDF_STATUS_SUCCESS;
}
QDF_STATUS
wlan_cm_rso_stop_continue_disconnect(struct wlan_objmgr_psoc *psoc,
uint8_t vdev_id, bool is_ho_fail)
{
struct wlan_objmgr_vdev *vdev = NULL;
struct wlan_cm_vdev_discon_req *req;
QDF_STATUS status = QDF_STATUS_SUCCESS;
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
WLAN_MLME_SB_ID);
if (!vdev) {
mlme_err("vdev_id: %d vdev not found", vdev_id);
return QDF_STATUS_E_NULL_VALUE;
}
req = qdf_mem_malloc(sizeof(*req));
if (!req) {
status = QDF_STATUS_E_NOMEM;
goto done;
}
if (!cm_get_active_disconnect_req(vdev, req)) {
mlme_err("vdev: %d: Active disconnect not found", vdev_id);
status = QDF_STATUS_E_EXISTS;
goto done;
}
wlan_cm_disc_cont_after_rso_stop(vdev, is_ho_fail, req);
done:
wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
qdf_mem_free(req);
return status;
}

View File

@@ -1727,6 +1727,8 @@ struct wlan_roam_start_config {
* @idle_params: idle params
* @roam_triggers: roam triggers parameters
* @rssi_params: roam scan rssi threshold parameters
* @send_rso_stop_resp: send rso stop response
* @start_rso_stop_timer: start rso stop timer
*/
struct wlan_roam_stop_config {
uint8_t reason;
@@ -1739,6 +1741,8 @@ struct wlan_roam_stop_config {
struct wlan_roam_idle_params idle_params;
struct wlan_roam_triggers roam_triggers;
struct wlan_roam_offload_scan_rssi_params rssi_params;
bool send_rso_stop_resp;
bool start_rso_stop_timer;
};
/**
@@ -1989,8 +1993,11 @@ struct roam_invoke_req {
* @CM_ROAM_NOTIF_DISASSOC_RECV: indicate disassoc received, notif_params to be
sent as reason code, notif_params1 to be sent
as frame length
* @CM_ROAM_NOTIF_HO_FAIL: indicates that roaming scan mode is successful but
caused disconnection and subsequent
WMI_ROAM_REASON_HO_FAILED is event expected
* @CM_ROAM_NOTIF_SCAN_END: indicate roam scan end, notif_params to be sent
as WMI_ROAM_TRIGGER_REASON_ID
as WMI_ROAM_TRIGGER_REASON_ID
*/
enum cm_roam_notif {
CM_ROAM_NOTIF_INVALID = 0,
@@ -2004,7 +2011,8 @@ enum cm_roam_notif {
CM_ROAM_NOTIF_SCAN_START,
CM_ROAM_NOTIF_DEAUTH_RECV,
CM_ROAM_NOTIF_DISASSOC_RECV,
CM_ROAM_NOTIF_SCAN_END = 12,
CM_ROAM_NOTIF_HO_FAIL,
CM_ROAM_NOTIF_SCAN_END,
};
/**
@@ -2146,6 +2154,7 @@ struct roam_offload_roam_event {
uint32_t notif_params1;
struct cm_hw_mode_trans_ind *hw_mode_trans_ind;
uint8_t *deauth_disassoc_frame;
bool rso_timer_stopped;
};
/**

View File

@@ -85,7 +85,8 @@ wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
return cm_roam_state_change(pdev,
sta_vdev_id,
WLAN_ROAM_RSO_ENABLED,
REASON_CTX_INIT);
REASON_CTX_INIT,
NULL, false);
}
QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
@@ -93,7 +94,8 @@ QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
enum roam_offload_state requested_state,
uint8_t reason)
{
return cm_roam_state_change(pdev, vdev_id, requested_state, reason);
return cm_roam_state_change(pdev, vdev_id, requested_state, reason,
NULL, false);
}
QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
@@ -199,7 +201,7 @@ QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
vdev_id, cm_roam_get_requestor_string(requestor));
status = cm_roam_state_change(pdev, vdev_id, WLAN_ROAM_RSO_STOPPED,
REASON_DRIVER_DISABLED);
REASON_DRIVER_DISABLED, NULL, false);
cm_roam_release_lock(vdev);
release_ref:
@@ -234,7 +236,7 @@ QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
vdev_id, cm_roam_get_requestor_string(requestor));
status = cm_roam_state_change(pdev, vdev_id, WLAN_ROAM_RSO_ENABLED,
REASON_DRIVER_ENABLED);
REASON_DRIVER_ENABLED, NULL, false);
cm_roam_release_lock(vdev);
release_ref:
@@ -291,7 +293,7 @@ exit:
QDF_STATUS wlan_cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
uint8_t reason)
{
return cm_roam_stop_req(psoc, vdev_id, reason);
return cm_roam_stop_req(psoc, vdev_id, reason, NULL, false);
}
bool wlan_cm_same_band_sta_allowed(struct wlan_objmgr_psoc *psoc)
@@ -1722,11 +1724,11 @@ QDF_STATUS cm_mlme_roam_preauth_fail(struct wlan_objmgr_vdev *vdev,
if (req->source == CM_ROAMING_FW)
cm_roam_state_change(pdev, vdev_id,
ROAM_SCAN_OFFLOAD_RESTART,
roam_reason);
roam_reason, NULL, false);
else
cm_roam_state_change(pdev, vdev_id,
ROAM_SCAN_OFFLOAD_START,
roam_reason);
roam_reason, NULL, false);
return QDF_STATUS_SUCCESS;
}
#endif
@@ -2480,10 +2482,30 @@ cm_roam_event_handler(struct roam_offload_roam_event *roam_event)
roam_event->rssi);
break;
case ROAM_REASON_HO_FAILED:
/*
* Continue disconnect only if RSO_STOP timer is running when
* this event is received and stopped as part of this.
* Otherwise it's a normal HO_FAIL event and handle it in
* legacy way.
*/
if (roam_event->rso_timer_stopped)
wlan_cm_rso_stop_continue_disconnect(roam_event->psoc,
roam_event->vdev_id, true);
/* fallthrough */
case ROAM_REASON_INVALID:
cm_handle_roam_offload_events(roam_event);
break;
case ROAM_REASON_RSO_STATUS:
/*
* roam_event->rso_timer_stopped is set to true in target_if
* only if RSO_STOP timer is running and it's stopped
* successfully
*/
if (roam_event->rso_timer_stopped &&
(roam_event->notif == CM_ROAM_NOTIF_SCAN_MODE_SUCCESS ||
roam_event->notif == CM_ROAM_NOTIF_SCAN_MODE_FAIL))
wlan_cm_rso_stop_continue_disconnect(roam_event->psoc,
roam_event->vdev_id, false);
cm_rso_cmd_status_event_handler(roam_event->vdev_id,
roam_event->notif);
break;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -101,7 +101,8 @@ ucfg_user_space_enable_disable_rso(struct wlan_objmgr_pdev *pdev,
state = (is_fast_roam_enabled) ?
WLAN_ROAM_RSO_ENABLED : WLAN_ROAM_RSO_STOPPED;
status = cm_roam_state_change(pdev, vdev_id, state,
REASON_SUPPLICANT_DISABLED_ROAMING);
REASON_SUPPLICANT_DISABLED_ROAMING,
NULL, false);
return status;
}