qcacld-3.0: Add support for sme_abort_roaming for ROAM_OFFLOAD_V1
Adds support for sme_abort_roaming for ROAM_OFFLOAD_V1. Also fix compilation error for ROAM_OFFLOAD_V1. Change-Id: I06247b1118b7dee32ff392b247e2e08e32dbaf9f CRs-Fixed: 2768397
This commit is contained in:

committed by
snandini

parent
0dc264f36e
commit
cb27dfd2e4
@@ -149,6 +149,17 @@ wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* wlan_cm_neighbor_roam_in_progress() -Check if STA is in the middle of
|
||||
* roaming states
|
||||
* @psoc: psoc
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: True or False
|
||||
*/
|
||||
bool wlan_cm_neighbor_roam_in_progress(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* cm_roam_acquire_lock() - Wrapper for sme_acquire_global_lock.
|
||||
*
|
||||
@@ -194,7 +205,7 @@ wlan_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
enum wlan_cm_rso_control_requestor requestor,
|
||||
uint8_t reason);
|
||||
|
||||
@@ -207,10 +218,34 @@ QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
enum wlan_cm_rso_control_requestor requestor,
|
||||
uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_abort_rso() - Enable roam scan offload to firmware
|
||||
* @pdev: Pointer to pdev
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Returns:
|
||||
* QDF_STATUS_E_BUSY if roam_synch is in progress and upper layer has to wait
|
||||
* before RSO stop cmd can be issued;
|
||||
* QDF_STATUS_SUCCESS if roam_synch is not outstanding. RSO stop cmd will be
|
||||
* issued with the global SME lock held in this case, and
|
||||
* uppler layer doesn't have to do any wait.
|
||||
*/
|
||||
QDF_STATUS wlan_cm_abort_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* wlan_cm_roaming_in_progress() - check if roaming is in progress
|
||||
* @pdev: Pointer to pdev
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
bool
|
||||
wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* wlan_cm_roam_state_change() - Post roam state change to roam state machine
|
||||
* @pdev: pdev pointer
|
||||
|
@@ -80,7 +80,7 @@ ucfg_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static inline
|
||||
QDF_STATUS ucfg_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
QDF_STATUS ucfg_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
enum wlan_cm_rso_control_requestor requestor,
|
||||
uint8_t reason)
|
||||
{
|
||||
@@ -97,11 +97,43 @@ QDF_STATUS ucfg_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static inline
|
||||
QDF_STATUS ucfg_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
QDF_STATUS ucfg_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
enum wlan_cm_rso_control_requestor requestor,
|
||||
uint8_t reason)
|
||||
{
|
||||
return wlan_cm_enable_rso(pdev, vdev_id, requestor, reason);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_cm_abort_rso() - Enable roam scan offload to firmware
|
||||
* @pdev: Pointer to pdev
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Returns:
|
||||
* QDF_STATUS_E_BUSY if roam_synch is in progress and upper layer has to wait
|
||||
* before RSO stop cmd can be issued;
|
||||
* QDF_STATUS_SUCCESS if roam_synch is not outstanding. RSO stop cmd will be
|
||||
* issued with the global SME lock held in this case, and
|
||||
* uppler layer doesn't have to do any wait.
|
||||
*/
|
||||
static inline
|
||||
QDF_STATUS ucfg_cm_abort_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
return wlan_cm_abort_rso(pdev, vdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* ucfg_cm_roaming_in_progress() - check if roaming is in progress
|
||||
* @pdev: Pointer to pdev
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
static inline bool
|
||||
ucfg_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
return wlan_cm_roaming_in_progress(pdev, vdev_id);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -114,7 +114,7 @@ wlan_cm_rso_set_roam_trigger(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
enum wlan_cm_rso_control_requestor requestor,
|
||||
uint8_t reason)
|
||||
{
|
||||
@@ -138,7 +138,7 @@ QDF_STATUS wlan_cm_disable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
|
||||
enum wlan_cm_rso_control_requestor requestor,
|
||||
uint8_t reason)
|
||||
{
|
||||
@@ -162,6 +162,53 @@ QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint32_t vdev_id,
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_cm_abort_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
|
||||
QDF_STATUS status;
|
||||
|
||||
status = cm_roam_acquire_lock();
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) ||
|
||||
wlan_cm_neighbor_roam_in_progress(psoc, vdev_id)) {
|
||||
cm_roam_release_lock();
|
||||
return QDF_STATUS_E_BUSY;
|
||||
}
|
||||
|
||||
/* RSO stop cmd will be issued with lock held to avoid
|
||||
* any racing conditions with wma/csr layer
|
||||
*/
|
||||
wlan_cm_disable_rso(pdev, vdev_id, REASON_DRIVER_DISABLED,
|
||||
RSO_INVALID_REQUESTOR);
|
||||
|
||||
cm_roam_release_lock();
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
bool wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
|
||||
QDF_STATUS status;
|
||||
|
||||
status = cm_roam_acquire_lock();
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
return false;
|
||||
|
||||
if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) ||
|
||||
MLME_IS_ROAMING_IN_PROG(psoc, vdev_id) ||
|
||||
mlme_is_roam_invoke_in_progress(psoc, vdev_id) ||
|
||||
wlan_cm_neighbor_roam_in_progress(psoc, vdev_id)) {
|
||||
cm_roam_release_lock();
|
||||
return true;
|
||||
}
|
||||
|
||||
cm_roam_release_lock();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
|
||||
uint8_t vdev_id,
|
||||
enum roam_offload_state requested_state,
|
||||
|
@@ -1817,6 +1817,7 @@ wmi_get_rso_buf_len(struct wlan_roam_scan_offload_params *roam_req)
|
||||
|
||||
if (!roam_req->is_rso_stop)
|
||||
wmi_debug("vdev[%d]: %s roam offload: %d",
|
||||
roam_req->vdev_id,
|
||||
roam_req->is_rso_stop ? "RSO stop cmd." : "",
|
||||
roam_req->roam_offload_enabled);
|
||||
|
||||
|
@@ -17546,15 +17546,9 @@ static QDF_STATUS hdd_is_connection_in_progress_iterator(
|
||||
|
||||
return QDF_STATUS_E_ABORTED;
|
||||
}
|
||||
/*
|
||||
* sme_neighbor_middle_of_roaming is for LFR2
|
||||
* hdd_is_roaming_in_progress is for LFR3
|
||||
*/
|
||||
if (((QDF_STA_MODE == adapter->device_mode) &&
|
||||
sme_neighbor_middle_of_roaming(
|
||||
mac_handle,
|
||||
adapter->vdev_id)) ||
|
||||
hdd_is_roaming_in_progress(hdd_ctx)) {
|
||||
|
||||
if ((QDF_STA_MODE == adapter->device_mode) &&
|
||||
sme_roaming_in_progress(mac_handle, adapter->vdev_id)) {
|
||||
hdd_debug("%pK(%d) mode %d Reassociation in progress",
|
||||
WLAN_HDD_GET_STATION_CTX_PTR(adapter),
|
||||
adapter->vdev_id, adapter->device_mode);
|
||||
|
@@ -1011,7 +1011,17 @@ QDF_STATUS sme_start_roaming(mac_handle_t mac_handle, uint8_t sessionId,
|
||||
* issued with the global SME lock held in this case, and
|
||||
* uppler layer doesn't have to do any wait.
|
||||
*/
|
||||
QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t session_id);
|
||||
QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t vdev_id);
|
||||
|
||||
|
||||
/**
|
||||
* sme_roaming_in_progress() - check if roaming is in progress
|
||||
* @mac_handle - The handle returned by mac_open
|
||||
* @vdev_id: vdev id
|
||||
*
|
||||
* Return: true or false
|
||||
*/
|
||||
bool sme_roaming_in_progress(mac_handle_t mac_handle, uint8_t vdev_id);
|
||||
|
||||
/**
|
||||
* sme_set_pcl_for_first_connected_vdev - Set the vdev pcl for the connected
|
||||
|
@@ -6395,6 +6395,34 @@ QDF_STATUS sme_start_roaming(mac_handle_t mac_handle, uint8_t vdev_id,
|
||||
return wlan_cm_enable_rso(mac->pdev, vdev_id, requestor, reason);
|
||||
}
|
||||
|
||||
QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t vdev_id)
|
||||
{
|
||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||
struct csr_roam_session *session;
|
||||
|
||||
session = CSR_GET_SESSION(mac, vdev_id);
|
||||
if (!session) {
|
||||
sme_err("ROAM: incorrect vdev ID %d", vdev_id);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return wlan_cm_abort_rso(mac->pdev, vdev_id);
|
||||
}
|
||||
|
||||
bool sme_roaming_in_progress(mac_handle_t mac_handle, uint8_t vdev_id)
|
||||
{
|
||||
struct mac_context *mac = MAC_CONTEXT(mac_handle);
|
||||
struct csr_roam_session *session;
|
||||
|
||||
session = CSR_GET_SESSION(mac, vdev_id);
|
||||
if (!session) {
|
||||
sme_err("ROAM: incorrect vdev ID %d", vdev_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
return wlan_cm_roaming_in_progress(mac->pdev, vdev_id);
|
||||
}
|
||||
|
||||
#else
|
||||
/**
|
||||
* sme_stop_roaming() - Stop roaming for a given sessionId
|
||||
@@ -6439,7 +6467,7 @@ QDF_STATUS sme_stop_roaming(mac_handle_t mac_handle, uint8_t session_id,
|
||||
return status;
|
||||
}
|
||||
|
||||
QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t session_id)
|
||||
QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t vdev_id)
|
||||
{
|
||||
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
|
||||
QDF_STATUS status;
|
||||
@@ -6450,8 +6478,8 @@ QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t session_id)
|
||||
return status;
|
||||
}
|
||||
|
||||
if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, session_id) ||
|
||||
sme_neighbor_middle_of_roaming(mac_handle, session_id)) {
|
||||
if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, vdev_id) ||
|
||||
sme_neighbor_middle_of_roaming(mac_handle, vdev_id)) {
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
return QDF_STATUS_E_BUSY;
|
||||
}
|
||||
@@ -6459,7 +6487,7 @@ QDF_STATUS sme_abort_roaming(mac_handle_t mac_handle, uint8_t session_id)
|
||||
/* RSO stop cmd will be issued with global SME lock held to avoid
|
||||
* any racing conditions with wma/csr layer
|
||||
*/
|
||||
sme_stop_roaming(mac_handle, session_id, REASON_DRIVER_DISABLED,
|
||||
sme_stop_roaming(mac_handle, vdev_id, REASON_DRIVER_DISABLED,
|
||||
RSO_INVALID_REQUESTOR);
|
||||
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
@@ -6500,6 +6528,30 @@ QDF_STATUS sme_start_roaming(mac_handle_t mac_handle, uint8_t sessionId,
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
bool sme_roaming_in_progress(mac_handle_t mac_handle, uint8_t vdev_id)
|
||||
{
|
||||
struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
|
||||
QDF_STATUS status;
|
||||
|
||||
status = sme_acquire_global_lock(&mac_ctx->sme);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
sme_err("Failed to acquire global SME lock!");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac_ctx->psoc, vdev_id) ||
|
||||
MLME_IS_ROAMING_IN_PROG(mac_ctx->psoc, vdev_id) ||
|
||||
mlme_is_roam_invoke_in_progress(mac_ctx->psoc, vdev_id) ||
|
||||
sme_neighbor_middle_of_roaming(mac_handle, vdev_id)) {
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
return true;
|
||||
}
|
||||
|
||||
sme_release_global_lock(&mac_ctx->sme);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void sme_set_pcl_for_first_connected_vdev(mac_handle_t mac_handle,
|
||||
|
@@ -19887,11 +19887,6 @@ csr_cm_fill_rso_sae_single_pmk_info(struct mac_context *mac_ctx,
|
||||
struct wlan_mlme_sae_single_pmk single_pmk;
|
||||
struct wlan_objmgr_vdev *vdev;
|
||||
|
||||
if (!mac_ctx || !req_buf) {
|
||||
sme_debug("Invalid session or req buff");
|
||||
return false;
|
||||
}
|
||||
|
||||
vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
|
||||
WLAN_LEGACY_SME_ID);
|
||||
if (!vdev) {
|
||||
|
@@ -1279,6 +1279,30 @@ bool csr_neighbor_middle_of_roaming(struct mac_context *mac, uint8_t sessionId)
|
||||
return val;
|
||||
}
|
||||
|
||||
#ifdef ROAM_OFFLOAD_V1
|
||||
bool
|
||||
wlan_cm_neighbor_roam_in_progress(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
struct csr_roam_session *session;
|
||||
struct mac_context *mac_ctx;
|
||||
|
||||
mac_ctx = sme_get_mac_context();
|
||||
if (!mac_ctx) {
|
||||
sme_err("mac_ctx is NULL");
|
||||
return false;
|
||||
}
|
||||
|
||||
session = CSR_GET_SESSION(mac_ctx, vdev_id);
|
||||
if (!session) {
|
||||
sme_err("session is null %d", vdev_id);
|
||||
return false;
|
||||
}
|
||||
|
||||
return csr_neighbor_middle_of_roaming(mac_ctx, vdev_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* csr_neighbor_roam_process_handoff_req - Processes handoff request
|
||||
*
|
||||
|
Reference in New Issue
Block a user