Browse Source

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
Abhinav Kumar 1 year ago
parent
commit
042a37976b

+ 3 - 3
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

+ 14 - 6
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)

+ 3 - 3
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

+ 3 - 3
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

+ 7 - 6
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,