qcacld-3.0: Add connect id for the connection manager

Add connect id in the policy manager for the newly designed
connection manager infrastructure.

Change-Id: Ib7bd08e5326ead04da88175636777bf5dd4e255b
CRs-FIxed: 2705700
This commit is contained in:
Ashish Kumar Dhanotiya
2020-05-21 01:27:34 +05:30
committed by nshrivas
parent 0570165f4e
commit 9f588185d9
12 changed files with 94 additions and 43 deletions

View File

@@ -502,6 +502,8 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc,
* @session_id: Session ID
* @ch_freq: Channel frequency
* @reason: reason for connection update
* @request_id: Request id provided by the requester, can be used while
* calling callback to the requester
*
* This routine will handle STA side concurrency when policy manager
* is enabled.
@@ -511,7 +513,8 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc,
uint8_t session_id, uint32_t ch_freq,
enum policy_mgr_conn_update_reason reason);
enum policy_mgr_conn_update_reason reason,
uint32_t request_id);
#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
/**
@@ -966,6 +969,8 @@ QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc,
* @session_id: Session id
* @ch_freq: Channel frequency on which new connection will be
* @reason: Reason for which connection update is required
* @request_id: Request id provided by the requester, can be used while
* calling callback to the requester
*
* This function initiates initiates actions
* needed on current connections once channel has been decided
@@ -976,7 +981,8 @@ QDF_STATUS policy_mgr_decr_connection_count(struct wlan_objmgr_psoc *psoc,
QDF_STATUS
policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc,
uint32_t session_id, uint32_t ch_freq,
enum policy_mgr_conn_update_reason);
enum policy_mgr_conn_update_reason,
uint32_t request_id);
/**
* policy_mgr_is_dbs_allowed_for_concurrency() - If dbs is allowed for current
@@ -1225,6 +1231,9 @@ QDF_STATUS policy_mgr_check_n_start_opportunistic_timer(
* HW mode change
* @action: action to be applied before hw mode change
*
* @request_id: Request id provided by the requester, can be used while
* calling callback to the requester
*
* Sends the set hw mode request to FW
*
* e.g.: To configure 2x2_80
@@ -1271,7 +1280,8 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc,
enum hw_mode_agile_dfs_capab dfs,
enum hw_mode_sbs_capab sbs,
enum policy_mgr_conn_update_reason reason,
uint8_t next_action, enum policy_mgr_conc_next_action action);
uint8_t next_action, enum policy_mgr_conc_next_action action,
uint32_t request_id);
/**
* policy_mgr_pdev_set_hw_mode_cback() - callback invoked by
@@ -1285,6 +1295,8 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc,
* @reason: Reason for set HW mode
* @session_id: vdev id on which the request was made
* @context: PSOC object information
* @request_id: Request id provided by the requester, can be used while
* calling callback to the requester
*
* This function is the callback registered with SME at set HW
* mode request time
@@ -1297,7 +1309,8 @@ typedef void (*policy_mgr_pdev_set_hw_mode_cback)(uint32_t status,
struct policy_mgr_vdev_mac_map *vdev_mac_map,
uint8_t next_action,
enum policy_mgr_conn_update_reason reason,
uint32_t session_id, void *context);
uint32_t session_id, void *context,
uint32_t request_id);
/**
* policy_mgr_nss_update_cback() - callback invoked by other
@@ -1482,6 +1495,8 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade(
* @session_id: Session id
* @action: action to be executed
* @reason: Reason for connection update
* @request_id: Request id provided by the requester, can be used while
* calling callback to the requester
*
* This function initiates initiates actions
* needed on current connections once channel has been decided
@@ -1492,7 +1507,8 @@ enum policy_mgr_conc_next_action policy_mgr_need_opportunistic_upgrade(
QDF_STATUS policy_mgr_next_actions(struct wlan_objmgr_psoc *psoc,
uint32_t session_id,
enum policy_mgr_conc_next_action action,
enum policy_mgr_conn_update_reason reason);
enum policy_mgr_conn_update_reason reason,
uint32_t request_id);
/**
* policy_mgr_validate_dbs_switch() - Check DBS action valid or not

View File

@@ -63,6 +63,9 @@
#define MAX_NUMBER_OF_CONC_CONNECTIONS 3
#endif
/* Policy manager default request id */
#define POLICY_MGR_DEF_REQ_ID 0
typedef int (*send_mode_change_event_cb)(void);
/**
@@ -1131,6 +1134,8 @@ struct policy_mgr_dual_mac_config {
* @next_action: next action to happen at policy mgr
* @action: current hw change action to be done
* @context: psoc context
* @request_id: Request id provided by the requester, can be used while
* calling callback to the requester
*/
struct policy_mgr_hw_mode {
uint32_t hw_mode_index;
@@ -1140,6 +1145,7 @@ struct policy_mgr_hw_mode {
uint8_t next_action;
enum policy_mgr_conc_next_action action;
struct wlan_objmgr_psoc *context;
uint32_t request_id;
};
/**

View File

@@ -131,7 +131,8 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc,
enum hw_mode_agile_dfs_capab dfs,
enum hw_mode_sbs_capab sbs,
enum policy_mgr_conn_update_reason reason,
uint8_t next_action, enum policy_mgr_conc_next_action action)
uint8_t next_action, enum policy_mgr_conc_next_action action,
uint32_t request_id)
{
int8_t hw_mode_index;
struct policy_mgr_hw_mode msg;
@@ -183,9 +184,11 @@ QDF_STATUS policy_mgr_pdev_set_hw_mode(struct wlan_objmgr_psoc *psoc,
msg.next_action = next_action;
msg.action = action;
msg.context = psoc;
msg.request_id = request_id;
policy_mgr_debug("set hw mode to sme: hw_mode_index: %d session:%d reason:%d action %d",
msg.hw_mode_index, msg.session_id, msg.reason, action);
policy_mgr_debug("set hw mode to sme: hw_mode_index: %d session:%d reason:%d action %d request_id %d",
msg.hw_mode_index, msg.session_id, msg.reason, action,
msg.request_id);
status = pm_ctx->sme_cbacks.sme_pdev_set_hw_mode(msg);
if (status != QDF_STATUS_SUCCESS) {
@@ -397,7 +400,8 @@ QDF_STATUS policy_mgr_update_and_wait_for_connection_update(
policy_mgr_err("clearing event failed");
status = policy_mgr_current_connections_update(
psoc, session_id, ch_freq, reason);
psoc, session_id, ch_freq, reason,
POLICY_MGR_DEF_REQ_ID);
if (QDF_STATUS_E_FAILURE == status) {
policy_mgr_err("connections update failed");
return QDF_STATUS_E_FAILURE;
@@ -906,7 +910,7 @@ QDF_STATUS
policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc,
uint32_t session_id, uint32_t ch_freq,
enum policy_mgr_conn_update_reason
reason)
reason, uint32_t request_id)
{
enum policy_mgr_conc_next_action next_action = PM_NOP;
QDF_STATUS status;
@@ -923,7 +927,8 @@ policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc,
if (PM_NOP != next_action)
status = policy_mgr_next_actions(psoc, session_id,
next_action, reason);
next_action, reason,
request_id);
else
status = QDF_STATUS_E_NOSUPPORT;
@@ -1059,7 +1064,8 @@ QDF_STATUS policy_mgr_next_actions(
struct wlan_objmgr_psoc *psoc,
uint32_t session_id,
enum policy_mgr_conc_next_action action,
enum policy_mgr_conn_update_reason reason)
enum policy_mgr_conn_update_reason reason,
uint32_t request_id)
{
QDF_STATUS status = QDF_STATUS_E_FAILURE;
struct dbs_nss nss_dbs = {0};
@@ -1102,7 +1108,8 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_DBS,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
reason, PM_NOP, PM_DBS);
reason, PM_NOP, PM_DBS,
request_id);
break;
case PM_SINGLE_MAC_UPGRADE:
/*
@@ -1117,7 +1124,8 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
reason, PM_UPGRADE,
PM_SINGLE_MAC_UPGRADE);
PM_SINGLE_MAC_UPGRADE,
request_id);
break;
case PM_SINGLE_MAC:
status = policy_mgr_pdev_set_hw_mode(psoc, session_id,
@@ -1128,7 +1136,8 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_DBS_NONE,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
reason, PM_NOP, PM_SINGLE_MAC);
reason, PM_NOP, PM_SINGLE_MAC,
request_id);
break;
case PM_DBS_UPGRADE:
status = policy_mgr_pdev_set_hw_mode(psoc, session_id,
@@ -1140,7 +1149,7 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
reason, PM_UPGRADE,
PM_DBS_UPGRADE);
PM_DBS_UPGRADE, request_id);
break;
case PM_SBS_DOWNGRADE:
status = policy_mgr_complete_action(psoc, POLICY_MGR_RX_NSS_1,
@@ -1155,7 +1164,8 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_DBS,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS,
reason, PM_NOP, PM_SBS);
reason, PM_NOP, PM_SBS,
request_id);
break;
case PM_DOWNGRADE:
/*
@@ -1214,7 +1224,8 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_DBS,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
reason, next_action, PM_DBS1);
reason, next_action, PM_DBS1,
request_id);
} else {
status = QDF_STATUS_E_ALREADY;
}
@@ -1240,7 +1251,8 @@ QDF_STATUS policy_mgr_next_actions(
HW_MODE_DBS,
HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
reason, next_action, PM_DBS2);
reason, next_action, PM_DBS2,
request_id);
} else {
status = QDF_STATUS_E_ALREADY;
}
@@ -1269,7 +1281,8 @@ QDF_STATUS policy_mgr_next_actions(
QDF_STATUS
policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc,
uint8_t session_id, uint32_t ch_freq,
enum policy_mgr_conn_update_reason reason)
enum policy_mgr_conn_update_reason reason,
uint32_t request_id)
{
QDF_STATUS status;
@@ -1284,7 +1297,8 @@ policy_mgr_handle_conc_multiport(struct wlan_objmgr_psoc *psoc,
policy_mgr_err("clearing event failed");
status = policy_mgr_current_connections_update(psoc, session_id,
ch_freq, reason);
ch_freq, reason,
request_id);
if (QDF_STATUS_E_FAILURE == status) {
policy_mgr_err("connections update failed");
return status;
@@ -2510,7 +2524,8 @@ QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch(
/* For DBS, we want to move right away to DBS mode */
status = policy_mgr_next_actions(psoc, session_id, action,
POLICY_MGR_UPDATE_REASON_AFTER_CHANNEL_SWITCH);
POLICY_MGR_UPDATE_REASON_AFTER_CHANNEL_SWITCH,
POLICY_MGR_DEF_REQ_ID);
if (!QDF_IS_STATUS_SUCCESS(status)) {
policy_mgr_err("no set hw mode command was issued");
goto done;
@@ -2579,7 +2594,8 @@ QDF_STATUS policy_mgr_check_and_set_hw_mode_for_channel_switch(
if (PM_NOP != next_action)
status = policy_mgr_next_actions(psoc, vdev_id,
next_action, reason);
next_action, reason,
POLICY_MGR_DEF_REQ_ID);
else
status = QDF_STATUS_E_NOSUPPORT;
@@ -2666,7 +2682,8 @@ void policy_mgr_check_and_stop_opportunistic_timer(
if (action) {
qdf_event_reset(&pm_ctx->opportunistic_update_done_evt);
status = policy_mgr_next_actions(psoc, id, action,
reason);
reason,
POLICY_MGR_DEF_REQ_ID);
if (status != QDF_STATUS_SUCCESS) {
policy_mgr_err("Failed in policy_mgr_next_actions");
return;

View File

@@ -907,7 +907,8 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
struct policy_mgr_vdev_mac_map *vdev_mac_map,
uint8_t next_action,
enum policy_mgr_conn_update_reason reason,
uint32_t session_id, void *context)
uint32_t session_id, void *context,
uint32_t request_id)
{
QDF_STATUS ret;
struct policy_mgr_hw_mode_params hw_mode;
@@ -980,7 +981,7 @@ next_action:
if (PM_NOP != next_action && (status == SET_HW_MODE_STATUS_ALREADY ||
status == SET_HW_MODE_STATUS_OK))
policy_mgr_next_actions(context, session_id,
next_action, reason);
next_action, reason, request_id);
else
policy_mgr_debug("No action needed right now");
@@ -1455,7 +1456,7 @@ void pm_dbs_opportunistic_timer_handler(void *data)
}
session_id = pm_get_vdev_id_of_first_conn_idx(psoc);
policy_mgr_next_actions(psoc, session_id, action,
reason);
reason, POLICY_MGR_DEF_REQ_ID);
}
/**
@@ -2834,10 +2835,11 @@ static void policy_mgr_nss_update_cb(struct wlan_objmgr_psoc *psoc,
if (PM_NOP != next_action) {
if (reason == POLICY_MGR_UPDATE_REASON_AFTER_CHANNEL_SWITCH)
policy_mgr_next_actions(psoc, vdev_id, next_action,
reason);
reason, POLICY_MGR_DEF_REQ_ID);
else
policy_mgr_next_actions(psoc, original_vdev_id,
next_action, reason);
next_action, reason,
POLICY_MGR_DEF_REQ_ID);
} else {
policy_mgr_debug("No action needed right now");
ret = policy_mgr_set_opportunistic_update(psoc);
@@ -2989,7 +2991,8 @@ QDF_STATUS policy_mgr_complete_action(struct wlan_objmgr_psoc *psoc,
session_id);
if (!QDF_IS_STATUS_SUCCESS(status))
status = policy_mgr_next_actions(psoc, session_id,
next_action, reason);
next_action, reason,
POLICY_MGR_DEF_REQ_ID);
return status;
}

View File

@@ -547,7 +547,8 @@ void policy_mgr_pdev_set_hw_mode_cb(uint32_t status,
struct policy_mgr_vdev_mac_map *vdev_mac_map,
uint8_t next_action,
enum policy_mgr_conn_update_reason reason,
uint32_t session_id, void *context);
uint32_t session_id, void *context,
uint32_t request_id);
void policy_mgr_dump_current_concurrency(struct wlan_objmgr_psoc *psoc);
/**

View File

@@ -595,7 +595,8 @@ static QDF_STATUS nan_handle_confirm(
status = policy_mgr_current_connections_update(
psoc, vdev_id, wlan_chan_to_freq(channel),
POLICY_MGR_UPDATE_REASON_NDP_UPDATE);
POLICY_MGR_UPDATE_REASON_NDP_UPDATE,
POLICY_MGR_DEF_REQ_ID);
if (QDF_STATUS_E_FAILURE == status) {
nan_err("connections update failed!!");
return status;

View File

@@ -22326,7 +22326,7 @@ int wlan_hdd_change_hw_mode_for_given_chnl(struct hdd_adapter *adapter,
status = policy_mgr_current_connections_update(
hdd_ctx->psoc, adapter->vdev_id,
chan_freq, reason);
chan_freq, reason, POLICY_MGR_DEF_REQ_ID);
switch (status) {
case QDF_STATUS_E_FAILURE:
/*

View File

@@ -6523,7 +6523,8 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
status = policy_mgr_current_connections_update(
hdd_ctx->psoc, adapter->vdev_id,
wlan_chan_to_freq(channel),
POLICY_MGR_UPDATE_REASON_START_AP);
POLICY_MGR_UPDATE_REASON_START_AP,
POLICY_MGR_DEF_REQ_ID);
if (status == QDF_STATUS_E_FAILURE) {
hdd_err("ERROR: connections update failed!!");
return -EINVAL;

View File

@@ -6780,7 +6780,7 @@ hdd_policy_mgr_set_hw_mode_ut(struct hdd_context *hdd_ctx,
mac0_band_cap, dbs, HW_MODE_AGILE_DFS_NONE,
HW_MODE_SBS_NONE,
POLICY_MGR_UPDATE_REASON_UT, PM_NOP,
action);
action, POLICY_MGR_DEF_REQ_ID);
}
static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
@@ -6890,7 +6890,7 @@ static int iw_get_policy_manager_ut_ops(struct hdd_context *hdd_ctx,
policy_mgr_current_connections_update(
hdd_ctx->psoc, adapter->vdev_id,
wlan_chan_to_freq(apps_args[0]),
POLICY_MGR_UPDATE_REASON_UT);
POLICY_MGR_UPDATE_REASON_UT, POLICY_MGR_DEF_REQ_ID);
}
break;

View File

@@ -190,7 +190,8 @@ static QDF_STATUS sme_process_set_hw_mode_resp(struct mac_context *mac, uint8_t
command->u.set_hw_mode_cmd.next_action,
command->u.set_hw_mode_cmd.reason,
command->u.set_hw_mode_cmd.session_id,
command->u.set_hw_mode_cmd.context);
command->u.set_hw_mode_cmd.context,
command->u.set_hw_mode_cmd.request_id);
if (!CSR_IS_SESSION_VALID(mac, session_id)) {
sme_err("session %d is invalid", session_id);
goto end;
@@ -12205,10 +12206,12 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg)
cmd->u.set_hw_mode_cmd.next_action = msg.next_action;
cmd->u.set_hw_mode_cmd.action = msg.action;
cmd->u.set_hw_mode_cmd.context = msg.context;
cmd->u.set_hw_mode_cmd.request_id = msg.request_id;
sme_debug("Queuing set hw mode to CSR, session: %d reason: %d",
sme_debug("Queuing set hw mode to CSR, session: %d reason: %d request_id: %d",
cmd->u.set_hw_mode_cmd.session_id,
cmd->u.set_hw_mode_cmd.reason);
cmd->u.set_hw_mode_cmd.reason,
cmd->u.set_hw_mode_cmd.request_id);
csr_queue_sme_command(mac, cmd, false);
sme_release_global_lock(&mac->sme);

View File

@@ -8389,7 +8389,8 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t sessionId,
status = policy_mgr_handle_conc_multiport(
mac->psoc, sessionId, ch_freq,
POLICY_MGR_UPDATE_REASON_NORMAL_STA);
POLICY_MGR_UPDATE_REASON_NORMAL_STA,
POLICY_MGR_DEF_REQ_ID);
if ((QDF_IS_STATUS_SUCCESS(status)) &&
(!csr_wait_for_connection_update(mac, true))) {
sme_debug("conn update error");
@@ -9934,7 +9935,8 @@ void csr_handle_disassoc_ho(struct mac_context *mac, uint32_t session_id)
status = policy_mgr_handle_conc_multiport(
mac->psoc, session_id,
bss_node->pBssDescription->chan_freq,
POLICY_MGR_UPDATE_REASON_LFR2_ROAM);
POLICY_MGR_UPDATE_REASON_LFR2_ROAM,
POLICY_MGR_DEF_REQ_ID);
if (QDF_IS_STATUS_SUCCESS(status)) {
mac->roam.neighborRoamInfo[session_id].scan_res_lfr2_roam_ap =
scan_handle_roam_ap;

View File

@@ -1137,7 +1137,8 @@ static void csr_handle_nxt_cmd(struct mac_context *mac_ctx,
case eCsrNextCheckAllowConc:
ret = policy_mgr_current_connections_update(
mac_ctx->psoc, session_id, chan_freq,
POLICY_MGR_UPDATE_REASON_HIDDEN_STA);
POLICY_MGR_UPDATE_REASON_HIDDEN_STA,
POLICY_MGR_DEF_REQ_ID);
sme_debug("channel freq: %d session: %d status: %d",
chan_freq, session_id, ret);