Ver Fonte

qcacld-3.0: Don't send success status to user space

Currently, If AP doesn't allow Prohibit to be set and user tries
to enable prohibit, host doesn't send command to FW to enable prohibit
but doesn't send failure status to user space.

Fix is to send failure status to userspace in case prohibit is not enabled.

Change-Id: Ic983b85d27e16314f63c02f88d3b1689d587d622
CRs-Fixed: 3344607
Sheenam Monga há 2 anos atrás
pai
commit
f6de97d19c

+ 4 - 3
components/spatial_reuse/dispatcher/inc/spatial_reuse_ucfg_api.h

@@ -113,10 +113,11 @@ void ucfg_spatial_reuse_set_sr_enable(struct wlan_objmgr_vdev *vdev,
  * @vdev: object manager vdev
  * @enable_he_siga_val15_prohibit: enable/disable he_siga_val15_allowed
  *
- * Return: void
+ * Return: success/failure
  */
-void ucfg_spatial_reuse_send_sr_prohibit(struct wlan_objmgr_vdev *vdev,
-					 bool enable_he_siga_val15_prohibit);
+QDF_STATUS
+ucfg_spatial_reuse_send_sr_prohibit(struct wlan_objmgr_vdev *vdev,
+				    bool enable_he_siga_val15_prohibit);
 
 /**
  * ucfg_spatial_reuse_setup_req() - To enable/disable SR (Spatial Reuse)

+ 12 - 3
components/spatial_reuse/dispatcher/src/spatial_reuse_ucfg_api.c

@@ -90,10 +90,11 @@ void ucfg_spatial_reuse_set_sr_enable(struct wlan_objmgr_vdev *vdev,
 	 wlan_vdev_mlme_set_he_spr_enabled(vdev, enable);
 }
 
-void ucfg_spatial_reuse_send_sr_prohibit(struct wlan_objmgr_vdev *vdev,
-					 bool enable_he_siga_val15_prohibit)
+QDF_STATUS ucfg_spatial_reuse_send_sr_prohibit(
+					struct wlan_objmgr_vdev *vdev,
+					bool enable_he_siga_val15_prohibit)
 {
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	bool sr_enabled = wlan_vdev_mlme_get_he_spr_enabled(vdev);
 	bool sr_prohibited = wlan_vdev_mlme_is_sr_prohibit_en(vdev);
 	uint8_t sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev);
@@ -111,7 +112,15 @@ void ucfg_spatial_reuse_send_sr_prohibit(struct wlan_objmgr_vdev *vdev,
 			wlan_vdev_mlme_set_sr_prohibit_en
 					(vdev,
 					 enable_he_siga_val15_prohibit);
+	} else {
+		mlme_debug("Prohibit command can not be sent sr_enabled %d, sr_ctrl %d , sr_prohibited %d",
+			   sr_enabled,
+			   sr_ctrl,
+			   sr_prohibited);
+
+		return QDF_STATUS_E_FAILURE;
 	}
+	return status;
 }
 
 QDF_STATUS

+ 11 - 3
core/hdd/src/wlan_hdd_he.c

@@ -823,11 +823,19 @@ static int __wlan_hdd_cfg80211_sr_operations(struct wiphy *wiphy,
 			hdd_err("invalid sr_he_siga_val15_enable param");
 			return -EINVAL;
 		}
-		ucfg_spatial_reuse_send_sr_prohibit(adapter->vdev,
-						    sr_he_siga_val15_allowed);
+		if (!QDF_IS_STATUS_SUCCESS(ucfg_spatial_reuse_send_sr_prohibit(
+					  adapter->vdev,
+					  sr_he_siga_val15_allowed))) {
+			hdd_debug("Prohibit command can not be sent");
+			return -EINVAL;
+		}
 		break;
 	case QCA_WLAN_SR_OPERATION_PSR_AND_NON_SRG_OBSS_PD_ALLOW:
-		ucfg_spatial_reuse_send_sr_prohibit(adapter->vdev, false);
+		if (!QDF_IS_STATUS_SUCCESS(ucfg_spatial_reuse_send_sr_prohibit(
+					   adapter->vdev, false))) {
+			hdd_debug("Prohibit command can not be sent");
+			return -EINVAL;
+		}
 		break;
 	case QCA_WLAN_SR_OPERATION_GET_PARAMS:
 		wlan_vdev_mlme_get_srg_pd_offset(adapter->vdev,