Jelajahi Sumber

qcacld-3.0: Send pause indication to upper layer for proper vdev

While processing BEACON_REPORTING_ACTIVE_REPORTING vendor command
on a particular STA (say its vdevid == 0), If scan started on any
interfaces (for example, on same STA (with vdev id == 0) or P2P
(with vdev id == 1) or on second STA (with vdev id == 1) of
STA + STA), Host should send a pause indication to upper layer only
for the vdev id(s) (here vdev id == 0) on which host processing
BEACON_REPORTING vendor command comes from user space.

Add sanity check to make sure that HOST should send pause
indication to upper layer only for vdev of STA for which host
processing BEACON_REPORTING vendor command at the moment.

Change-Id: I5ed5dc42e4dded2a803349d75234b84d3aa7f314
CRs-Fixed: 2582389
Abhinav Kumar 5 tahun lalu
induk
melakukan
d83a689ba1
2 mengubah file dengan 19 tambahan dan 18 penghapusan
  1. 8 9
      core/hdd/src/wlan_hdd_assoc.c
  2. 11 9
      core/sme/src/common/sme_api.c

+ 8 - 9
core/hdd/src/wlan_hdd_assoc.c

@@ -1801,16 +1801,15 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter,
 	mac_handle = hdd_ctx->mac_handle;
 	sme_ft_reset(mac_handle, adapter->vdev_id);
 	sme_reset_key(mac_handle, adapter->vdev_id);
-	if (!hdd_remove_beacon_filter(adapter)) {
-		if (sme_is_beacon_report_started(mac_handle,
-						 adapter->vdev_id)) {
-			hdd_beacon_recv_pause_indication((hdd_handle_t)hdd_ctx,
-							 adapter->vdev_id,
-							 SCAN_EVENT_TYPE_MAX,
-							 true);
-		}
+	if (!hdd_remove_beacon_filter(adapter))
+		hdd_err("hdd_remove_beacon_filter() failed");
+
+	if (sme_is_beacon_report_started(mac_handle, adapter->vdev_id)) {
+		hdd_debug("Sending beacon pause indication to userspace");
+		hdd_beacon_recv_pause_indication((hdd_handle_t)hdd_ctx,
+						 adapter->vdev_id,
+						 SCAN_EVENT_TYPE_MAX, true);
 	}
-
 	if (eCSR_ROAM_IBSS_LEAVE == roam_status) {
 		uint8_t i;
 

+ 11 - 9
core/sme/src/common/sme_api.c

@@ -15938,24 +15938,26 @@ static void sme_scan_event_handler(struct wlan_objmgr_vdev *vdev,
 				   void *arg)
 {
 	struct mac_context *mac = arg;
-	struct csr_roam_session *session;
+	uint8_t vdev_id;
 
 	if (!mac) {
 		sme_err("Invalid mac context");
 		return;
 	}
 
-	if (!CSR_IS_SESSION_VALID(mac, vdev->vdev_objmgr.vdev_id)) {
-		sme_err("Invalid vdev_id: %d", vdev->vdev_objmgr.vdev_id);
+	if (!mac->sme.beacon_pause_cb)
 		return;
-	}
 
-	session = CSR_GET_SESSION(mac, vdev->vdev_objmgr.vdev_id);
+	if (event->type != SCAN_EVENT_TYPE_STARTED)
+		return;
 
-	if (event->type == SCAN_EVENT_TYPE_STARTED) {
-		if (mac->sme.beacon_pause_cb)
-			mac->sme.beacon_pause_cb(mac->hdd_handle,
-				vdev->vdev_objmgr.vdev_id, event->type, false);
+	for (vdev_id = 0 ; vdev_id < WLAN_MAX_VDEVS ; vdev_id++) {
+		if (CSR_IS_SESSION_VALID(mac, vdev_id) &&
+		    sme_is_beacon_report_started(MAC_HANDLE(mac), vdev_id)) {
+			sme_debug("Send pause ind for vdev_id : %d", vdev_id);
+			mac->sme.beacon_pause_cb(mac->hdd_handle, vdev_id,
+						 event->type, false);
+		}
 	}
 }