Bläddra i källkod

qcacld-3.0: Add check for SR INI, SR enabled flag

Add check for INI and SR enabled flag before handling SR IE
change in beacon frame.

Change-Id: I4b43f47c89a1f12bcf6f85ac602179af634f2f54
CRs-Fixed: 3577077
Rachit Kankane 1 år sedan
förälder
incheckning
512b354b8c
1 ändrade filer med 21 tillägg och 1 borttagningar
  1. 21 1
      core/mac/src/pe/lim/lim_api.c

+ 21 - 1
core/mac/src/pe/lim/lim_api.c

@@ -2749,17 +2749,37 @@ void lim_handle_sr_cap(struct wlan_objmgr_vdev *vdev,
 	uint8_t non_srg_pd_offset = 0;
 	uint8_t srg_max_pd_offset = 0;
 	uint8_t srg_min_pd_offset = 0;
-	uint8_t sr_ctrl;
+	uint8_t sr_ctrl, sr_enable_modes;
 	bool is_pd_threshold_present = false;
 	struct wlan_objmgr_pdev *pdev;
 	enum sr_status_of_roamed_ap sr_status;
 	enum sr_osif_operation sr_op;
+	enum QDF_OPMODE opmode;
+	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 
+	if (!mac) {
+		pe_err("mac ctx is null");
+		return;
+	}
 	pdev = wlan_vdev_get_pdev(vdev);
 	if (!pdev) {
 		pe_err("invalid pdev");
 		return;
 	}
+
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	/* If SR is disabled in INI for the session-operating mode
+	 * Then return.
+	 */
+	wlan_mlme_get_sr_enable_modes(mac->psoc, &sr_enable_modes);
+	if (!(sr_enable_modes & (1 << opmode))) {
+		pe_debug("SR is disabled in INI for mode: %d", opmode);
+		return;
+	}
+	if (!wlan_vdev_mlme_get_he_spr_enabled(vdev)) {
+		pe_debug("SR is not enabled");
+		return;
+	}
 	non_srg_pd_offset = wlan_vdev_mlme_get_non_srg_pd_offset(vdev);
 	wlan_vdev_mlme_get_srg_pd_offset(vdev, &srg_max_pd_offset,
 					 &srg_min_pd_offset);