|
@@ -630,25 +630,20 @@ static bool policy_mgr_is_sap_channel_change_without_restart(
|
|
|
*/
|
|
|
void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data)
|
|
|
{
|
|
|
- struct check_cc_channel_work *cc_intf_work =
|
|
|
- (struct check_cc_channel_work *) data;
|
|
|
+ struct wlan_objmgr_psoc *psoc =
|
|
|
+ (struct wlan_objmgr_psoc *) data;
|
|
|
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
uint32_t mcc_to_scc_switch;
|
|
|
- struct wlan_objmgr_psoc *psoc;
|
|
|
QDF_STATUS status;
|
|
|
uint8_t channel, sec_ch;
|
|
|
- struct ch_params_s ch_params;
|
|
|
+ uint8_t operating_channel, vdev_id;
|
|
|
+ bool restart_sap;
|
|
|
|
|
|
- if (!cc_intf_work) {
|
|
|
- policy_mgr_err("Invalid check channel interface work");
|
|
|
- goto work_done;
|
|
|
- }
|
|
|
- psoc = cc_intf_work->psoc;
|
|
|
|
|
|
pm_ctx = policy_mgr_get_context(psoc);
|
|
|
if (!pm_ctx) {
|
|
|
policy_mgr_err("Invalid context");
|
|
|
- goto work_done;
|
|
|
+ return;
|
|
|
}
|
|
|
mcc_to_scc_switch =
|
|
|
policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc);
|
|
@@ -657,67 +652,32 @@ void policy_mgr_check_sta_ap_concurrent_ch_intf(void *data)
|
|
|
policy_mgr_concurrent_open_sessions_running(psoc));
|
|
|
|
|
|
if (!policy_mgr_is_restart_sap_allowed(psoc, mcc_to_scc_switch))
|
|
|
- goto work_done;
|
|
|
+ return;
|
|
|
+
|
|
|
+ if (!policy_mgr_get_sap_conn_info(psoc,
|
|
|
+ &operating_channel,
|
|
|
+ &vdev_id)) {
|
|
|
+ policy_mgr_err("Could not retrieve SAP channel & vdev id");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ restart_sap = policy_mgr_is_sap_channel_change_without_restart(
|
|
|
+ mcc_to_scc_switch) ? false : true;
|
|
|
|
|
|
if (!pm_ctx->hdd_cbacks.wlan_hdd_get_channel_for_sap_restart) {
|
|
|
policy_mgr_err("SAP restart get channel callback in NULL");
|
|
|
- goto work_done;
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
status = pm_ctx->hdd_cbacks.
|
|
|
- wlan_hdd_get_channel_for_sap_restart(psoc,
|
|
|
- cc_intf_work->vdev_id, &channel,
|
|
|
- &sec_ch, &ch_params);
|
|
|
+ wlan_hdd_get_channel_for_sap_restart(psoc, vdev_id,
|
|
|
+ &channel, &sec_ch, restart_sap);
|
|
|
if (status != QDF_STATUS_SUCCESS) {
|
|
|
- policy_mgr_err("Failed to get channel to restart SAP");
|
|
|
- goto work_done;
|
|
|
- }
|
|
|
-
|
|
|
- if (channel == 0) {
|
|
|
- policy_mgr_err("Invalid channel to restart SAP");
|
|
|
- goto work_done;
|
|
|
- }
|
|
|
- policy_mgr_info("SAP restarts due to MCC->SCC switch, new chan: %d",
|
|
|
- channel);
|
|
|
-
|
|
|
- wlan_reg_set_channel_params(channel, sec_ch, &ch_params);
|
|
|
-
|
|
|
- if (policy_mgr_is_sap_channel_change_without_restart(
|
|
|
- mcc_to_scc_switch) &&
|
|
|
- pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb) {
|
|
|
- pm_ctx->hdd_cbacks.sap_restart_chan_switch_cb(psoc,
|
|
|
- cc_intf_work->vdev_id, channel,
|
|
|
- ch_params.ch_width);
|
|
|
+ policy_mgr_err("Failed to switch SAP channel");
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
-work_done:
|
|
|
- qdf_mem_free(cc_intf_work);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * create_check_cc_channel_work() - Create Check concurrent intf
|
|
|
- * channel work
|
|
|
- * @psoc: PSOC object information
|
|
|
- *
|
|
|
- * Create check concurrent interface channel work
|
|
|
- *
|
|
|
- * Return: check concurrent channel interface work object
|
|
|
- */
|
|
|
-static struct check_cc_channel_work *create_check_cc_channel_work(
|
|
|
- struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
|
|
|
-{
|
|
|
- struct check_cc_channel_work *cc_intf_work;
|
|
|
-
|
|
|
- cc_intf_work = qdf_mem_malloc(
|
|
|
- sizeof(struct check_cc_channel_work));
|
|
|
- if (NULL == cc_intf_work) {
|
|
|
- policy_mgr_err("Falied to allocate check concurrent channel work");
|
|
|
- return NULL;
|
|
|
- }
|
|
|
- cc_intf_work->psoc = psoc;
|
|
|
- cc_intf_work->vdev_id = vdev_id;
|
|
|
- return cc_intf_work;
|
|
|
+ policy_mgr_info("SAP restarts due to MCC->SCC switch, old chan :%d new chan: %d",
|
|
|
+ operating_channel, channel);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -732,13 +692,11 @@ static struct check_cc_channel_work *create_check_cc_channel_work(
|
|
|
* Return: None
|
|
|
*/
|
|
|
void policy_mgr_check_concurrent_intf_and_restart_sap(
|
|
|
- struct wlan_objmgr_psoc *psoc,
|
|
|
- uint8_t vdev_id,
|
|
|
- uint8_t operation_channel)
|
|
|
+ struct wlan_objmgr_psoc *psoc)
|
|
|
{
|
|
|
struct policy_mgr_psoc_priv_obj *pm_ctx;
|
|
|
uint32_t mcc_to_scc_switch;
|
|
|
- struct check_cc_channel_work *cc_intf_work;
|
|
|
+ uint8_t operating_channel, vdev_id;
|
|
|
|
|
|
pm_ctx = policy_mgr_get_context(psoc);
|
|
|
if (!pm_ctx) {
|
|
@@ -746,22 +704,26 @@ void policy_mgr_check_concurrent_intf_and_restart_sap(
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (!policy_mgr_get_sap_conn_info(psoc,
|
|
|
+ &operating_channel,
|
|
|
+ &vdev_id)) {
|
|
|
+ policy_mgr_err("Could not retrieve SAP channel & vdev id");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
mcc_to_scc_switch =
|
|
|
policy_mgr_mcc_to_scc_switch_mode_in_user_cfg(psoc);
|
|
|
policy_mgr_info("MCC to SCC switch: %d chan: %d",
|
|
|
- mcc_to_scc_switch, operation_channel);
|
|
|
+ mcc_to_scc_switch, operating_channel);
|
|
|
if ((mcc_to_scc_switch != QDF_MCC_TO_SCC_SWITCH_DISABLE)
|
|
|
#ifdef FEATURE_WLAN_STA_AP_MODE_DFS_DISABLE
|
|
|
&& !wlan_reg_is_dfs_ch(psoc,
|
|
|
- operationChannel)
|
|
|
+ operating_channel)
|
|
|
#endif
|
|
|
) {
|
|
|
- cc_intf_work = create_check_cc_channel_work(psoc, vdev_id);
|
|
|
- if (!cc_intf_work)
|
|
|
- return;
|
|
|
qdf_create_work(0, &pm_ctx->sta_ap_intf_check_work,
|
|
|
- policy_mgr_check_sta_ap_concurrent_ch_intf,
|
|
|
- cc_intf_work);
|
|
|
+ policy_mgr_check_sta_ap_concurrent_ch_intf,
|
|
|
+ psoc);
|
|
|
qdf_sched_work(0, &pm_ctx->sta_ap_intf_check_work);
|
|
|
policy_mgr_info("Checking for Concurrent Change interference");
|
|
|
}
|