Jelajahi Sumber

qcacld-3.0: Configure scan burst duration when NDI is active

Configure burst duration for the scan when VDEV is in NDI mode
and at least one peer is connected.

CRs-Fixed: 2055300
Change-Id: I4cd582ad8df6bc2aa2095cff1933b2f9d166fd60
Ravi Joshi 7 tahun lalu
induk
melakukan
3750de94c4
2 mengubah file dengan 28 tambahan dan 0 penghapusan
  1. 19 0
      core/wma/src/wma_nan_datapath.h
  2. 9 0
      core/wma/src/wma_scan_roam.c

+ 19 - 0
core/wma/src/wma_nan_datapath.h

@@ -102,6 +102,23 @@ void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss);
 void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
 					tpDeleteStaParams del_sta);
 
+/**
+ * wma_is_ndi_active() - Determines of the nan data iface is active
+ * @wma_handle: handle to wma context
+ *
+ * Returns: true if ndi active, flase otherwise
+ */
+static inline bool wma_is_ndi_active(tp_wma_handle wma_handle)
+{
+	int i;
+
+	for (i = 0; i < wma_handle->max_bssid; i++) {
+		if (wma_handle->interfaces[i].type == WMI_VDEV_TYPE_NDI &&
+				wma_handle->interfaces[i].peer_count > 0)
+			return true;
+	}
+	return false;
+}
 #else
 #define WMA_IS_VDEV_IN_NDI_MODE(intf, vdev_id) (false)
 static inline void wma_update_hdd_cfg_ndp(tp_wma_handle wma_handle,
@@ -122,6 +139,8 @@ static inline void wma_delete_sta_req_ndi_mode(tp_wma_handle wma,
 }
 static inline void wma_add_sta_ndi_mode(tp_wma_handle wma,
 					tpAddStaParams add_sta) {}
+
+static inline bool wma_is_ndi_active(tp_wma_handle wma_handle) { return false; }
 #endif /* WLAN_FEATURE_NAN_DATAPATH */
 
 #endif /* __WMA_NAN_DATAPATH_H */

+ 9 - 0
core/wma/src/wma_scan_roam.c

@@ -75,6 +75,7 @@
 #include "wma_he.h"
 #include <wlan_scan_public_structs.h>
 #include <wlan_scan_ucfg_api.h>
+#include "wma_nan_datapath.h"
 
 #define WMA_MCC_MIRACAST_REST_TIME 400
 #define WMA_SCAN_ID_MASK 0x0fff
@@ -376,6 +377,14 @@ QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
 					cmd->burst_duration = 0;
 				break;
 			}
+			if (wma_is_ndi_active(wma_handle)) {
+				cmd->burst_duration = wma_get_burst_duration(
+						scan_req->maxChannelTime,
+						wma_handle->miracast_value);
+				WMA_LOGD("NDI Active, Burst duration: %x",
+					cmd->burst_duration);
+				break;
+			}
 		} while (0);
 
 	} else {