Преглед на файлове

qcacld-3.0: Add SRPS IE in Beacon if defined in hostapd.conf

SRPS IE is not included in beacon, when Non-SRG OBSS PD SR Disallowed
bit is set in he_spr_sr_control hostapd configuration parameter.

Code changes are done to update beacon template to include SRPS IE to
communicate to all the connected STAs that, the Non-SRG OBSS PD based
SR transmissions are not allowed in the BSS.

Change-Id: I4090099de20fe383f16e60ad871faa4f42549a24
CRs-Fixed: 3533287
Gangadhar Kavalastramath преди 1 година
родител
ревизия
42f90e43f6
променени са 3 файла, в които са добавени 47 реда и са изтрити 20 реда
  1. 24 10
      components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c
  2. 9 0
      core/hdd/src/wlan_hdd_hostapd.c
  3. 14 10
      core/mac/src/sys/legacy/src/utils/src/parser_api.c

+ 24 - 10
components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c

@@ -257,7 +257,7 @@ int mlme_sr_is_enable(struct wlan_objmgr_vdev *vdev)
 
 	sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(vdev);
 	return ((!(sr_ctrl & NON_SRG_PD_SR_DISALLOWED) &&
-		 (sr_ctrl & NON_SRG_OFFSET_PRESENT)) ||
+		(sr_ctrl & NON_SRG_OFFSET_PRESENT)) ||
 		(sr_ctrl & SRG_INFO_PRESENT));
 }
 
@@ -279,6 +279,7 @@ mlme_sr_handle_conc(struct wlan_objmgr_vdev *vdev,
 	struct wlan_objmgr_pdev *pdev;
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_lmac_if_tx_ops *tx_ops;
+	struct wlan_lmac_if_spatial_reuse_tx_ops *sr_tx_ops;
 	uint8_t conc_vdev_id = wlan_vdev_get_id(conc_vdev);
 
 	pdev = wlan_vdev_get_pdev(vdev);
@@ -289,6 +290,16 @@ mlme_sr_handle_conc(struct wlan_objmgr_vdev *vdev,
 
 	psoc = wlan_vdev_get_psoc(vdev);
 	tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
+	if (!tx_ops) {
+		mlme_err("tx_ops is NULL");
+		return;
+	}
+
+	sr_tx_ops = &tx_ops->spatial_reuse_tx_ops;
+	if (!sr_tx_ops) {
+		mlme_err("sr_tx_ops is NULL");
+		return;
+	}
 
 	if (en_sr_curr_vdev) {
 		wlan_vdev_mlme_set_sr_disable_due_conc(vdev, true);
@@ -297,24 +308,27 @@ mlme_sr_handle_conc(struct wlan_objmgr_vdev *vdev,
 		if (!wlan_vdev_mlme_get_he_spr_enabled(conc_vdev))
 			return;
 
-		if (tx_ops && tx_ops->spatial_reuse_tx_ops.target_if_sr_update)
-			tx_ops->spatial_reuse_tx_ops.target_if_sr_update
-						     (pdev, conc_vdev_id, val);
+		if (mlme_sr_is_enable(conc_vdev)) {
+			if (sr_tx_ops->target_if_sr_update)
+				sr_tx_ops->target_if_sr_update
+						(pdev, conc_vdev_id, val);
 
-		wlan_spatial_reuse_osif_event(conc_vdev, SR_OPERATION_SUSPEND,
-					      SR_REASON_CODE_CONCURRENCY);
+			wlan_spatial_reuse_osif_event(conc_vdev,
+						      SR_OPERATION_SUSPEND,
+						   SR_REASON_CODE_CONCURRENCY);
+		}
 	} else if (wlan_vdev_mlme_is_sr_disable_due_conc(conc_vdev)) {
 		wlan_vdev_mlme_set_sr_disable_due_conc(conc_vdev, false);
 
 		if (!wlan_vdev_mlme_get_he_spr_enabled(conc_vdev))
 			return;
 
-		if (mlme_sr_is_enable(vdev)) {
+		if (mlme_sr_is_enable(conc_vdev)) {
 			wlan_mlme_update_sr_data(conc_vdev, &val, 0, 0, true);
 
-			if (tx_ops && tx_ops->spatial_reuse_tx_ops.target_if_sr_update)
-				tx_ops->spatial_reuse_tx_ops.target_if_sr_update
-						      (pdev, conc_vdev_id, val);
+			if (sr_tx_ops->target_if_sr_update)
+				sr_tx_ops->target_if_sr_update
+						(pdev, conc_vdev_id, val);
 
 			wlan_spatial_reuse_osif_event(conc_vdev,
 						      SR_OPERATION_RESUME,

+ 9 - 0
core/hdd/src/wlan_hdd_hostapd.c

@@ -7673,6 +7673,15 @@ static void hdd_update_he_obss_pd(struct wlan_hdd_link_info *link_info,
 {
 	struct wlan_objmgr_vdev *vdev;
 	struct ieee80211_he_obss_pd *obss_pd;
+	uint8_t sr_device_modes;
+	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(link_info->adapter);
+
+	ucfg_mlme_get_sr_enable_modes(hdd_ctx->psoc, &sr_device_modes);
+	if (!(sr_device_modes & (1 << link_info->adapter->device_mode))) {
+		hdd_debug("SR operation not allowed for mode %d",
+			  link_info->adapter->device_mode);
+		return;
+	}
 
 	if (!params || !params->he_obss_pd.enable)
 		return;

+ 14 - 10
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -7706,24 +7706,28 @@ populate_dot11f_sr_info(struct mac_context *mac_ctx,
 	uint8_t non_srg_pd_offset;
 	uint8_t sr_ctrl = wlan_vdev_mlme_get_sr_ctrl(session->vdev);
 	bool sr_enabled = wlan_vdev_mlme_get_he_spr_enabled(session->vdev);
-	bool sr_disabled_due_conc =
-		wlan_vdev_mlme_is_sr_disable_due_conc(session->vdev);
 
-	if (!sr_enabled || !sr_ctrl || sr_disabled_due_conc ||
-	    (sr_ctrl & WLAN_HE_NON_SRG_PD_SR_DISALLOWED) ||
-	    !(sr_ctrl & WLAN_HE_NON_SRG_OFFSET_PRESENT))
+	if (!sr_enabled)
 		return QDF_STATUS_SUCCESS;
 
-	non_srg_pd_offset = wlan_vdev_mlme_get_non_srg_pd_offset(session->vdev);
 	sr_info->present = 1;
 	sr_info->psr_disallow = 1;
-	sr_info->non_srg_pd_sr_disallow = 0;
-	sr_info->srg_info_present = 0;
-	sr_info->non_srg_offset_present = 1;
 	sr_info->srg_info_present = 0;
+	sr_info->non_srg_offset_present = 0;
+	sr_info->non_srg_pd_sr_disallow = !!(sr_ctrl &
+					   WLAN_HE_NON_SRG_PD_SR_DISALLOWED);
+
+	if ((!sr_info->non_srg_pd_sr_disallow) &&
+	    (sr_ctrl & WLAN_HE_NON_SRG_OFFSET_PRESENT)) {
+		non_srg_pd_offset =
+			wlan_vdev_mlme_get_non_srg_pd_offset(session->vdev);
+		sr_info->non_srg_offset_present = 1;
+		sr_info->non_srg_offset.info.non_srg_pd_max_offset =
+							non_srg_pd_offset;
+	}
+
 	if (sr_ctrl & WLAN_HE_SIGA_SR_VAL15_ALLOWED)
 		sr_info->sr_value15_allow = 1;
-	sr_info->non_srg_offset.info.non_srg_pd_max_offset = non_srg_pd_offset;
 
 	return QDF_STATUS_SUCCESS;
 }