qcacmn: Set hw mode based on channel_select_logic_conc ini
Set hw mode to DBS or single MAC for STA+STA and STA+P2P concurrencies based on channel_select_logic_conc ini. Change-Id: I46ba4d5cd8f5cda71d0c00be2b612bc851eb5ba4 CRs-Fixed: 2189848
这个提交包含在:
@@ -836,6 +836,7 @@ struct policy_mgr_hdd_cbacks {
|
||||
enum policy_mgr_con_mode (*get_mode_for_non_connected_vdev)(
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
uint8_t vdev_id);
|
||||
enum tQDF_ADAPTER_MODE (*hdd_get_device_mode)(uint32_t session_id);
|
||||
};
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
@@ -1018,6 +1018,7 @@ struct policy_mgr_user_cfg {
|
||||
uint32_t mcc_to_scc_switch_mode;
|
||||
bool sub_20_mhz_enabled;
|
||||
bool is_sta_sap_scc_allowed_on_dfs_chan;
|
||||
uint32_t channel_select_logic_conc;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -346,6 +346,78 @@ QDF_STATUS policy_mgr_update_and_wait_for_connection_update(
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* policy_mgr_is_dbs_allowed_for_concurrency() - If dbs is allowed for current
|
||||
* concurreny
|
||||
* @new_conn_mode: new connection mode
|
||||
*
|
||||
* When a new connection is about to come up, check if dbs is allowed for
|
||||
* STA+STA or STA+P2P
|
||||
*
|
||||
* Return: true if dbs is allowed for STA+STA or STA+P2P else false
|
||||
*/
|
||||
static bool policy_mgr_is_dbs_allowed_for_concurrency(
|
||||
struct wlan_objmgr_psoc *psoc, uint32_t session_id)
|
||||
{
|
||||
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
||||
uint32_t count, dbs_for_sta_sta, dbs_for_sta_p2p;
|
||||
enum tQDF_ADAPTER_MODE new_conn_mode = QDF_MAX_NO_OF_MODE;
|
||||
bool ret = true;
|
||||
|
||||
pm_ctx = policy_mgr_get_context(psoc);
|
||||
if (!pm_ctx) {
|
||||
policy_mgr_err("Invalid context");
|
||||
return ret;
|
||||
}
|
||||
|
||||
count = policy_mgr_get_connection_count(psoc);
|
||||
if (pm_ctx->hdd_cbacks.hdd_get_device_mode)
|
||||
new_conn_mode = pm_ctx->hdd_cbacks.
|
||||
hdd_get_device_mode(session_id);
|
||||
|
||||
if (count != 1 || new_conn_mode == QDF_MAX_NO_OF_MODE)
|
||||
return ret;
|
||||
|
||||
dbs_for_sta_sta = PM_CHANNEL_SELECT_LOGIC_STA_STA_GET(pm_ctx->user_cfg.
|
||||
channel_select_logic_conc);
|
||||
dbs_for_sta_p2p = PM_CHANNEL_SELECT_LOGIC_STA_P2P_GET(pm_ctx->user_cfg.
|
||||
channel_select_logic_conc);
|
||||
|
||||
switch (pm_conc_connection_list[0].mode) {
|
||||
case PM_STA_MODE:
|
||||
switch (new_conn_mode) {
|
||||
case QDF_STA_MODE:
|
||||
if (!dbs_for_sta_sta)
|
||||
return false;
|
||||
break;
|
||||
case QDF_P2P_DEVICE_MODE:
|
||||
case QDF_P2P_CLIENT_MODE:
|
||||
case QDF_P2P_GO_MODE:
|
||||
if (!dbs_for_sta_p2p)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PM_P2P_CLIENT_MODE:
|
||||
case PM_P2P_GO_MODE:
|
||||
switch (new_conn_mode) {
|
||||
case QDF_STA_MODE:
|
||||
if (!dbs_for_sta_p2p)
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc,
|
||||
uint32_t session_id,
|
||||
uint8_t channel,
|
||||
@@ -410,6 +482,22 @@ QDF_STATUS policy_mgr_current_connections_update(struct wlan_objmgr_psoc *psoc,
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Based on channel_select_logic_conc ini, hw mode is set
|
||||
* when second connection is about to come up that results
|
||||
* in STA+STA and STA+P2P concurrency.
|
||||
* 1) If MCC is set and if current hw mode is dbs, hw mode
|
||||
* should be set to single mac for above concurrency.
|
||||
* 2) If MCC is set and if current hw mode is not dbs, hw
|
||||
* mode change is not required.
|
||||
*/
|
||||
if (policy_mgr_is_current_hwmode_dbs(psoc) &&
|
||||
!policy_mgr_is_dbs_allowed_for_concurrency(psoc, session_id))
|
||||
next_action = PM_SINGLE_MAC;
|
||||
else if (!policy_mgr_is_current_hwmode_dbs(psoc) &&
|
||||
!policy_mgr_is_dbs_allowed_for_concurrency(psoc, session_id))
|
||||
next_action = PM_NOP;
|
||||
|
||||
if (PM_NOP != next_action)
|
||||
status = policy_mgr_next_actions(psoc, session_id,
|
||||
next_action, reason);
|
||||
|
@@ -576,6 +576,8 @@ QDF_STATUS policy_mgr_register_hdd_cb(struct wlan_objmgr_psoc *psoc,
|
||||
hdd_cbacks->wlan_hdd_get_channel_for_sap_restart;
|
||||
pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev =
|
||||
hdd_cbacks->get_mode_for_non_connected_vdev;
|
||||
pm_ctx->hdd_cbacks.hdd_get_device_mode =
|
||||
hdd_cbacks->hdd_get_device_mode;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -593,6 +595,7 @@ QDF_STATUS policy_mgr_deregister_hdd_cb(struct wlan_objmgr_psoc *psoc)
|
||||
pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb = NULL;
|
||||
pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart = NULL;
|
||||
pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev = NULL;
|
||||
pm_ctx->hdd_cbacks.hdd_get_device_mode = NULL;
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
在新工单中引用
屏蔽一个用户