qcacld-3.0: Move rso related process to connection manager [PART 6]
Add new code to implement below functions for connection manager roam part: And below two RSO command related process: ROAM_SCAN_OFFLOAD_STOP ROAM_SCAN_OFFLOAD_UPDATE_CFG Change-Id: I378b969ddae77fff49ad1d4d8ce21764b292e5ac CRs-Fixed: 2753011
This commit is contained in:
parent
ce06f6cbcb
commit
eadb9c42b8
@ -25,6 +25,7 @@
|
||||
#include "wlan_mlme_dbg.h"
|
||||
#include "wlan_mlme_api.h"
|
||||
#include "wlan_crypto_global_api.h"
|
||||
#include "wlan_mlme_main.h"
|
||||
|
||||
#if defined(WLAN_FEATURE_ROAM_OFFLOAD) || defined(ROAM_OFFLOAD_V1)
|
||||
static struct wmi_unified
|
||||
@ -757,7 +758,7 @@ target_if_cm_roam_send_roam_init(struct wlan_objmgr_vdev *vdev,
|
||||
* @vdev: vdev object
|
||||
* @req: roam start config parameters
|
||||
*
|
||||
* This function is used to Send roam start related commands to wmi
|
||||
* This function is used to send roam start related commands to wmi
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
@ -851,7 +852,7 @@ end:
|
||||
* @vdev: vdev object
|
||||
* @req: roam stop config parameters
|
||||
*
|
||||
* This function is used to Send roam start related commands to wmi
|
||||
* This function is used to send roam stop related commands to wmi
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
@ -859,13 +860,95 @@ static QDF_STATUS
|
||||
target_if_cm_roam_send_stop(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_roam_stop_config *req)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
wmi_unified_t wmi_handle;
|
||||
uint32_t mode = 0;
|
||||
bool is_roam_offload_enabled = false;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
uint8_t vdev_id;
|
||||
|
||||
wmi_handle = target_if_cm_roam_get_wmi_handle_from_vdev(vdev);
|
||||
if (!wmi_handle)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
/* Send 11k offload disable command to FW as part of RSO Stop */
|
||||
status = target_if_cm_roam_offload_11k_params(wmi_handle,
|
||||
&req->roam_11k_params);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("11k offload disable not sent, status %d",
|
||||
status);
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Send BTM config as disabled during RSO Stop */
|
||||
status = target_if_cm_roam_scan_btm_offload(wmi_handle,
|
||||
&req->btm_config);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Sending BTM config to fw failed");
|
||||
goto end;
|
||||
}
|
||||
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
wlan_mlme_get_roaming_offload(psoc, &is_roam_offload_enabled);
|
||||
if (req->reason == REASON_ROAM_STOP_ALL ||
|
||||
req->reason == REASON_DISCONNECTED ||
|
||||
req->reason == REASON_ROAM_SYNCH_FAILED ||
|
||||
req->reason == REASON_SUPPLICANT_DISABLED_ROAMING) {
|
||||
mode = WMI_ROAM_SCAN_MODE_NONE;
|
||||
} else {
|
||||
if (is_roam_offload_enabled)
|
||||
mode = WMI_ROAM_SCAN_MODE_NONE |
|
||||
WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
|
||||
else
|
||||
mode = WMI_ROAM_SCAN_MODE_NONE;
|
||||
}
|
||||
|
||||
/*
|
||||
* After sending the roam scan mode because of a disconnect,
|
||||
* clear the scan bitmap client as well by sending
|
||||
* the following command
|
||||
*/
|
||||
target_if_cm_roam_scan_offload_rssi_thresh(wmi_handle,
|
||||
&req->rssi_params);
|
||||
|
||||
/*
|
||||
* If the STOP command is due to a disconnect, then
|
||||
* send the filter command to clear all the filter
|
||||
* entries. If it is roaming scenario, then do not
|
||||
* send the cleared entries.
|
||||
*/
|
||||
if (!req->middle_of_roaming) {
|
||||
status = target_if_cm_roam_scan_filter(
|
||||
wmi_handle, ROAM_SCAN_OFFLOAD_STOP,
|
||||
&req->scan_filter_params);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("clear for roam scan filter failed");
|
||||
goto end;
|
||||
}
|
||||
}
|
||||
|
||||
target_if_cm_roam_disconnect_params(wmi_handle, ROAM_SCAN_OFFLOAD_STOP,
|
||||
&req->disconnect_params);
|
||||
|
||||
target_if_cm_roam_idle_params(wmi_handle, ROAM_SCAN_OFFLOAD_STOP,
|
||||
&req->idle_params);
|
||||
/*
|
||||
* Disable all roaming triggers if RSO stop is as part of
|
||||
* disconnect
|
||||
*/
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (mode == WMI_ROAM_SCAN_MODE_NONE) {
|
||||
req->roam_triggers.vdev_id = vdev_id;
|
||||
req->roam_triggers.trigger_bitmap = 0;
|
||||
target_if_cm_roam_triggers(wmi_handle, &req->roam_triggers);
|
||||
}
|
||||
end:
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -880,13 +963,69 @@ static QDF_STATUS
|
||||
target_if_cm_roam_send_update_config(struct wlan_objmgr_vdev *vdev,
|
||||
struct wlan_roam_update_config *req)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_SUCCESS;
|
||||
wmi_unified_t wmi_handle;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
uint8_t vdev_id;
|
||||
|
||||
wmi_handle = target_if_cm_roam_get_wmi_handle_from_vdev(vdev);
|
||||
if (!wmi_handle)
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
status = target_if_cm_roam_scan_bmiss_cnt(wmi_handle,
|
||||
&req->beacon_miss_cnt);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("vdev set bmiss bcnt param failed");
|
||||
goto end;
|
||||
}
|
||||
|
||||
status = target_if_cm_roam_scan_filter(wmi_handle,
|
||||
ROAM_SCAN_OFFLOAD_UPDATE_CFG,
|
||||
&req->scan_filter_params);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Sending update for roam scan filter failed");
|
||||
goto end;
|
||||
}
|
||||
|
||||
status = target_if_cm_roam_scan_offload_rssi_thresh(
|
||||
wmi_handle,
|
||||
&req->rssi_params);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
target_if_err("Sending roam scan offload rssi thresh failed");
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (req->scan_period_params.empty_scan_refresh_period > 0) {
|
||||
status = target_if_cm_roam_scan_offload_scan_period(
|
||||
wmi_handle,
|
||||
&req->scan_period_params);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
goto end;
|
||||
}
|
||||
|
||||
status = target_if_cm_roam_scan_offload_ap_profile(
|
||||
vdev, wmi_handle,
|
||||
&req->profile_params);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
goto end;
|
||||
psoc = wlan_vdev_get_psoc(vdev);
|
||||
if (!psoc) {
|
||||
target_if_err("psoc handle is NULL");
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
vdev_id = wlan_vdev_get_id(vdev);
|
||||
if (!MLME_IS_ROAM_STATE_RSO_ENABLED(psoc, vdev_id)) {
|
||||
target_if_cm_roam_disconnect_params(
|
||||
wmi_handle, ROAM_SCAN_OFFLOAD_UPDATE_CFG,
|
||||
&req->disconnect_params);
|
||||
|
||||
target_if_cm_roam_idle_params(
|
||||
wmi_handle, ROAM_SCAN_OFFLOAD_UPDATE_CFG,
|
||||
&req->idle_params);
|
||||
target_if_cm_roam_triggers(wmi_handle, &req->roam_triggers);
|
||||
}
|
||||
end:
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -915,7 +1054,7 @@ target_if_cm_roam_abort(struct wlan_objmgr_vdev *vdev, uint8_t vdev_id)
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_cm_roam_send_update_config() - Send roam update config related
|
||||
* target_if_cm_roam_per_config() - Send roam per config related
|
||||
* commands to wmi
|
||||
* @vdev: vdev object
|
||||
* @req: roam per config parameters
|
||||
|
@ -249,6 +249,19 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
update_req = qdf_mem_malloc(sizeof(*update_req));
|
||||
if (!update_req)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
/* fill from mlme directly */
|
||||
cm_roam_scan_bmiss_cnt(psoc, vdev_id, &update_req->beacon_miss_cnt);
|
||||
if (!MLME_IS_ROAM_STATE_RSO_ENABLED(psoc, vdev_id)) {
|
||||
cm_roam_disconnect_params(psoc, vdev_id,
|
||||
&update_req->disconnect_params);
|
||||
cm_roam_idle_params(psoc, vdev_id,
|
||||
&update_req->idle_params);
|
||||
cm_roam_triggers(psoc, vdev_id,
|
||||
&update_req->roam_triggers);
|
||||
}
|
||||
|
||||
/* fill from legacy through this API */
|
||||
wlan_cm_roam_fill_update_config_req(psoc, vdev_id, update_req, reason);
|
||||
|
||||
status = wlan_cm_tgt_send_roam_update_req(psoc, vdev_id, update_req);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
@ -317,31 +330,61 @@ cm_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* cm_roam_stop_req() - roam stop request handling
|
||||
* @psoc: psoc pointer
|
||||
* @vdev_id: vdev id
|
||||
* @reason: reason for changing roam state for the requested vdev id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
static QDF_STATUS
|
||||
QDF_STATUS
|
||||
cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
uint8_t reason)
|
||||
{
|
||||
struct wlan_roam_stop_config *stop_req;
|
||||
QDF_STATUS status;
|
||||
|
||||
/*
|
||||
* If roam synch propagation is in progress and an user space
|
||||
* disconnect is requested, then there is no need to send the
|
||||
* RSO STOP to firmware, since the roaming is already complete.
|
||||
* If the RSO STOP is sent to firmware, then an HO_FAIL will be
|
||||
* generated and the expectation from firmware would be to
|
||||
* clean up the peer context on the host and not send down any
|
||||
* WMI PEER DELETE commands to firmware. But, if the user space
|
||||
* disconnect gets processed first, then there is a chance to
|
||||
* send down the PEER DELETE commands. Hence, if we do not
|
||||
* receive the HO_FAIL, and we complete the roam sync
|
||||
* propagation, then the host and firmware will be in sync with
|
||||
* respect to the peer and then the user space disconnect can
|
||||
* be handled gracefully in a normal way.
|
||||
*
|
||||
* Ensure to check the reason code since the RSO Stop might
|
||||
* come when roam sync failed as well and at that point it
|
||||
* should go through to the firmware and receive HO_FAIL
|
||||
* and clean up.
|
||||
*/
|
||||
if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) &&
|
||||
reason == REASON_ROAM_STOP_ALL) {
|
||||
mlme_info("vdev_id:%d : Drop RSO stop during roam sync",
|
||||
vdev_id);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
cm_roam_set_roam_reason_better_ap(psoc, vdev_id, false);
|
||||
|
||||
stop_req = qdf_mem_malloc(sizeof(*stop_req));
|
||||
if (!stop_req)
|
||||
return QDF_STATUS_E_NOMEM;
|
||||
|
||||
/* do the filling as csr_post_rso_stop */
|
||||
status = wlan_cm_roam_fill_stop_req(psoc, vdev_id, stop_req, reason);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
mlme_debug("fail to fill stop config req");
|
||||
return status;
|
||||
}
|
||||
|
||||
status = wlan_cm_tgt_send_roam_stop_req(psoc, vdev_id, stop_req);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
mlme_debug("fail to send roam stop");
|
||||
} else {
|
||||
status = wlan_cm_roam_scan_offload_rsp(vdev_id, reason);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
mlme_debug("fail to send rso rsp msg");
|
||||
}
|
||||
|
||||
qdf_mem_free(stop_req);
|
||||
|
||||
|
@ -63,5 +63,17 @@ QDF_STATUS cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id, uint8_t rso_command,
|
||||
uint8_t reason);
|
||||
|
||||
/**
|
||||
* cm_roam_stop_req() - roam stop request handling
|
||||
* @psoc: psoc pointer
|
||||
* @vdev_id: vdev id
|
||||
* @reason: reason for changing roam state for the requested vdev id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
uint8_t reason);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
@ -57,10 +57,8 @@ wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
uint8_t rso_command,
|
||||
uint8_t reason);
|
||||
wlan_cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
uint8_t rso_command, uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_roam_fill_start_req() - fill start request structure content
|
||||
@ -74,10 +72,53 @@ wlan_cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc,
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_cm_roam_fill_start_req(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
struct wlan_roam_start_config *req,
|
||||
uint8_t reason);
|
||||
wlan_cm_roam_fill_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
struct wlan_roam_start_config *req, uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_roam_fill_stop_req() - fill stop request structure content
|
||||
* @psoc: pointer to psoc object
|
||||
* @vdev_id: vdev id
|
||||
* @req: roam stop config pointer
|
||||
* @reason: reason to roam
|
||||
*
|
||||
* This function gets called to fill stop request structure content
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_cm_roam_fill_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
struct wlan_roam_stop_config *req, uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_roam_fill_update_config_req() - fill update config request
|
||||
* structure content
|
||||
* @psoc: pointer to psoc object
|
||||
* @vdev_id: vdev id
|
||||
* @req: roam update config pointer
|
||||
* @reason: reason to roam
|
||||
*
|
||||
* This function gets called to fill update config request structure content
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_cm_roam_fill_update_config_req(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id,
|
||||
struct wlan_roam_update_config *req,
|
||||
uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_roam_scan_offload_rsp() - send roam scan offload response message
|
||||
* @vdev_id: vdev id
|
||||
* @reason: reason to roam
|
||||
*
|
||||
* This function gets called to send roam scan offload response message
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS
|
||||
wlan_cm_roam_scan_offload_rsp(uint8_t vdev_id, uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_send_beacon_miss() - initiate beacon miss
|
||||
@ -190,6 +231,17 @@ QDF_STATUS wlan_cm_roam_state_change(struct wlan_objmgr_pdev *pdev,
|
||||
QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id, uint8_t rso_command,
|
||||
uint8_t reason);
|
||||
|
||||
/**
|
||||
* wlan_cm_roam_stop_req() - roam stop request handling
|
||||
* @psoc: psoc pointer
|
||||
* @vdev_id: vdev id
|
||||
* @reason: reason for changing roam state for the requested vdev id
|
||||
*
|
||||
* Return: QDF_STATUS
|
||||
*/
|
||||
QDF_STATUS wlan_cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
|
||||
uint8_t reason);
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
|
@ -722,6 +722,8 @@ struct wlan_roam_start_config {
|
||||
/**
|
||||
* struct wlan_roam_stop_config - structure containing parameters for
|
||||
* roam stop
|
||||
* @reason: roaming reason
|
||||
* @middle_of_roaming: in the middle of roaming
|
||||
* @roam_11k_params: 11k params
|
||||
* @btm_config: btm configuration
|
||||
* @scan_filter_params: roam scan filter parameters
|
||||
@ -731,6 +733,8 @@ struct wlan_roam_start_config {
|
||||
* @rssi_params: roam scan rssi threshold parameters
|
||||
*/
|
||||
struct wlan_roam_stop_config {
|
||||
uint8_t reason;
|
||||
uint8_t middle_of_roaming;
|
||||
struct wlan_roam_11k_offload_params roam_11k_params;
|
||||
struct wlan_roam_btm_config btm_config;
|
||||
struct wlan_roam_scan_filter_params scan_filter_params;
|
||||
@ -746,17 +750,21 @@ struct wlan_roam_stop_config {
|
||||
* @beacon_miss_cnt: roam beacon miss count parameters
|
||||
* @scan_filter_params: roam scan filter parameters
|
||||
* @scan_period_params: roam scan period parameters
|
||||
* @profile_params: ap profile parameters
|
||||
* @rssi_params: roam scan rssi threshold parameters
|
||||
* @disconnect_params: disconnect params
|
||||
* @idle_params: idle params
|
||||
* @roam_triggers: roam triggers parameters
|
||||
*/
|
||||
struct wlan_roam_update_config {
|
||||
struct wlan_roam_beacon_miss_cnt beacon_miss_cnt;
|
||||
struct wlan_roam_scan_filter_params scan_filter_params;
|
||||
struct wlan_roam_scan_period_params scan_period_params;
|
||||
struct ap_profile_params profile_params;
|
||||
struct wlan_roam_offload_scan_rssi_params rssi_params;
|
||||
struct wlan_roam_disconnect_params disconnect_params;
|
||||
struct wlan_roam_idle_params idle_params;
|
||||
struct wlan_roam_triggers roam_triggers;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -183,6 +183,12 @@ QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
|
||||
{
|
||||
return cm_roam_send_rso_cmd(psoc, vdev_id, rso_command, reason);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
|
||||
|
Loading…
Reference in New Issue
Block a user