From 042a37976ba9a4f9e85f92fb0248ac9d68b27b9e Mon Sep 17 00:00:00 2001 From: Abhinav Kumar Date: Sun, 23 Apr 2023 22:25:14 -0700 Subject: [PATCH] qcacld-3.0: Reject GET_CU_FOR_EACH_SUB_BW request for MLO conn As per requirement, for MLO connection host should reject GET_CU_FOR_EACH_SUB_BW request and return failure to upper layer as a response. Change-Id: I8177d92982c832a17c1657239b69cc3712e1eaf4 CRs-Fixed: 3476349 --- components/mlme/core/inc/wlan_mlme_main.h | 6 +++--- components/mlme/core/src/wlan_mlme_main.c | 20 +++++++++++++------ .../mlme/dispatcher/inc/wlan_mlme_ucfg_api.h | 6 +++--- .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 6 +++--- core/hdd/src/wlan_hdd_stats.c | 13 ++++++------ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/components/mlme/core/inc/wlan_mlme_main.h b/components/mlme/core/inc/wlan_mlme_main.h index cbbecc0e77..b5b05fa8e0 100644 --- a/components/mlme/core/inc/wlan_mlme_main.h +++ b/components/mlme/core/inc/wlan_mlme_main.h @@ -929,10 +929,10 @@ uint32_t mlme_get_vdev_he_ops(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id); * @psoc: pointer to psoc object * @vdev_id: Vdev id * - * Return: none + * Return: QDF_STATUS */ -void mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id); +QDF_STATUS mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id); /** * mlme_get_ini_vdev_config() - get the vdev ini config params diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c index 2154db7f6f..d2efa452ea 100644 --- a/components/mlme/core/src/wlan_mlme_main.c +++ b/components/mlme/core/src/wlan_mlme_main.c @@ -245,8 +245,8 @@ mlme_fill_freq_in_wide_scan_start_request(struct wlan_objmgr_vdev *vdev, return QDF_STATUS_SUCCESS; } -void mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id) +QDF_STATUS mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id) { struct wlan_mlme_psoc_ext_obj *mlme_obj; QDF_STATUS status; @@ -256,20 +256,27 @@ void mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, mlme_obj = mlme_get_psoc_ext_obj(psoc); if (!mlme_obj) { mlme_debug("vdev %d : NULL mlme psoc object", vdev_id); - return; + return QDF_STATUS_E_FAILURE; } vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id, WLAN_MLME_NB_ID); if (!vdev) { mlme_debug("vdev %d : NULL vdev object", vdev_id); - return; + return QDF_STATUS_E_FAILURE; + } + + if (wlan_vdev_mlme_is_mlo_vdev(vdev)) { + mlme_debug("vdev %d :reject get_cu req for mlo connection", + vdev_id); + wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID); + return QDF_STATUS_E_NOSUPPORT; } req = qdf_mem_malloc(sizeof(*req)); if (!req) { wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID); - return; + return QDF_STATUS_E_NOMEM; } status = wlan_scan_init_default_params(vdev, req); @@ -311,10 +318,11 @@ void mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, } wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID); - return; + return status; release: qdf_mem_free(req); wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID); + return status; } uint32_t mlme_get_vdev_he_ops(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h index ae85e9780e..8a28dfef57 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h @@ -4619,10 +4619,10 @@ ucfg_mlme_is_chwidth_with_notify_supported(struct wlan_objmgr_psoc *psoc); * @psoc: pointer to psoc object * @vdev_id: Vdev id * - * Return: none + * Return: QDF_STATUS */ -void ucfg_mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id); +QDF_STATUS ucfg_mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id); /** * ucfg_mlme_set_vdev_traffic_high_throughput() - Set/clear vdev high diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index a60d1e8e7d..b3a3076062 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -367,10 +367,10 @@ ucfg_mlme_set_vdev_traffic_type(struct wlan_objmgr_psoc *psoc, return status; } -void ucfg_mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, - uint8_t vdev_id) +QDF_STATUS ucfg_mlme_connected_chan_stats_request(struct wlan_objmgr_psoc *psoc, + uint8_t vdev_id) { - mlme_connected_chan_stats_request(psoc, vdev_id); + return mlme_connected_chan_stats_request(psoc, vdev_id); } bool diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index 162a8f27c0..dfac7960f8 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -3963,19 +3963,20 @@ __wlan_hdd_cfg80211_connected_chan_stats_request(struct wiphy *wiphy, struct hdd_context *hdd_ctx = wiphy_priv(wiphy); bool is_vdev_connected; enum QDF_OPMODE mode; + QDF_STATUS status; is_vdev_connected = hdd_cm_is_vdev_connected(adapter); mode = adapter->device_mode; - if (mode == QDF_STA_MODE && is_vdev_connected) { - ucfg_mlme_connected_chan_stats_request(hdd_ctx->psoc, - adapter->deflink->vdev_id); - } else { + + if (mode != QDF_STA_MODE || !is_vdev_connected) { hdd_debug("vdev %d: reject chan stats req, mode:%d, conn:%d", adapter->deflink->vdev_id, mode, is_vdev_connected); - return -EINVAL; + return -EPERM; } - return 0; + status = ucfg_mlme_connected_chan_stats_request(hdd_ctx->psoc, + adapter->deflink->vdev_id); + return qdf_status_to_os_return(status); } int wlan_hdd_cfg80211_connected_chan_stats_req(struct wiphy *wiphy,