diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 982cc462afed..c8759b200443 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1865,6 +1865,13 @@ int hdd_vdev_ready(struct hdd_adapter *adapter); QDF_STATUS hdd_init_station_mode(struct hdd_adapter *adapter); struct hdd_adapter *hdd_get_adapter(struct hdd_context *hdd_ctx, enum QDF_OPMODE mode); +/* + * hdd_get_device_mode() - Get device mode + * @session_id: Session id + * + * Return: Device mode + */ +enum tQDF_ADAPTER_MODE hdd_get_device_mode(uint32_t session_id); void hdd_deinit_adapter(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter, bool rtnl_held); diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c index 57b209c8d293..dce25a656e4a 100644 --- a/core/hdd/src/wlan_hdd_cfg.c +++ b/core/hdd/src/wlan_hdd_cfg.c @@ -8677,6 +8677,8 @@ QDF_STATUS hdd_set_policy_mgr_user_cfg(struct hdd_context *hdd_ctx) user_cfg->sub_20_mhz_enabled = cds_is_sub_20_mhz_enabled(); user_cfg->is_sta_sap_scc_allowed_on_dfs_chan = hdd_ctx->config->sta_sap_scc_on_dfs_chan; + user_cfg->channel_select_logic_conc = + hdd_ctx->config->channel_select_logic_conc; status = policy_mgr_set_user_cfg(hdd_ctx->hdd_psoc, user_cfg); qdf_mem_free(user_cfg); diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index a1e16e6d8141..d0daf0ede9c5 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2438,6 +2438,7 @@ static void hdd_register_policy_manager_callback( wlan_hdd_get_channel_for_sap_restart; hdd_cbacks.get_mode_for_non_connected_vdev = wlan_hdd_get_mode_for_non_connected_vdev; + hdd_cbacks.hdd_get_device_mode = hdd_get_device_mode; if (QDF_STATUS_SUCCESS != policy_mgr_register_hdd_cb(psoc, &hdd_cbacks)) { @@ -5943,6 +5944,26 @@ struct hdd_adapter *hdd_get_adapter(struct hdd_context *hdd_ctx, return NULL; } +enum tQDF_ADAPTER_MODE hdd_get_device_mode(uint32_t session_id) +{ + struct hdd_context *hdd_ctx; + struct hdd_adapter *adapter; + + hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD); + if (!hdd_ctx) { + hdd_err("Invalid HDD context"); + return QDF_MAX_NO_OF_MODE; + } + + adapter = hdd_get_adapter_by_sme_session_id(hdd_ctx, session_id); + if (!adapter) { + hdd_err("Invalid HDD adapter"); + return QDF_MAX_NO_OF_MODE; + } + + return adapter->device_mode; +} + /** * hdd_get_operating_channel() - return operating channel of the device mode * @hdd_ctx: Pointer to the HDD context.