Browse Source

qcacmn: Add support to send user vendor ie info to target

When user sets the vendor ie for probe request frame, it is not
included in the broadcast probe request sent by FW.

Add support to send vendor ie info in scan start command to FW. Therefore,
FW can include this vendor ie in the broadcast probe request frame.

Change-Id: Ie5fc0c074bd7543568a135d3ef4662bf09b274f6
CRs-Fixed: 2400265
Shashikala Prabhu 6 years ago
parent
commit
7b635b9857

+ 2 - 0
os_if/linux/scan/inc/wlan_cfg80211_scan.h

@@ -123,6 +123,7 @@ struct scan_req {
  * struct scan_params - Scan params
  * @source: scan request source
  * @default_ie: default scan ie
+ * @vendor_ie: vendor ie
  * @half_rate: Half rate flag
  * @quarter_rate: Quarter rate flag
  * @strict_pscan: strict passive scan flag
@@ -130,6 +131,7 @@ struct scan_req {
 struct scan_params {
 	uint8_t source;
 	struct element_info default_ie;
+	struct element_info vendor_ie;
 	bool half_rate;
 	bool quarter_rate;
 	bool strict_pscan;

+ 24 - 9
os_if/linux/scan/src/wlan_cfg80211_scan.c

@@ -1294,6 +1294,7 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev,
 	enum wlan_band band;
 	struct net_device *netdev = NULL;
 	QDF_STATUS qdf_status;
+	uint32_t extra_ie_len = 0;
 
 	psoc = wlan_pdev_get_psoc(pdev);
 	if (!psoc) {
@@ -1490,27 +1491,41 @@ int wlan_cfg80211_scan(struct wlan_objmgr_vdev *vdev,
 	/* P2P increase the scan priority */
 	if (is_p2p_scan)
 		req->scan_req.scan_priority = SCAN_PRIORITY_HIGH;
-	if (request->ie_len) {
-		req->scan_req.extraie.ptr = qdf_mem_malloc(request->ie_len);
+
+	if (request->ie_len)
+		extra_ie_len = request->ie_len;
+	else if (params->default_ie.ptr && params->default_ie.len)
+		extra_ie_len = params->default_ie.len;
+
+	if (params->vendor_ie.ptr && params->vendor_ie.len)
+		extra_ie_len += params->vendor_ie.len;
+
+	if (extra_ie_len) {
+		req->scan_req.extraie.ptr = qdf_mem_malloc(extra_ie_len);
 		if (!req->scan_req.extraie.ptr) {
 			ret = -ENOMEM;
 			goto err;
 		}
+	}
+
+	if (request->ie_len) {
 		req->scan_req.extraie.len = request->ie_len;
 		qdf_mem_copy(req->scan_req.extraie.ptr, request->ie,
-				request->ie_len);
+			     request->ie_len);
 	} else if (params->default_ie.ptr && params->default_ie.len) {
-		req->scan_req.extraie.ptr =
-			qdf_mem_malloc(params->default_ie.len);
-		if (!req->scan_req.extraie.ptr) {
-			ret = -ENOMEM;
-			goto err;
-		}
 		req->scan_req.extraie.len = params->default_ie.len;
 		qdf_mem_copy(req->scan_req.extraie.ptr, params->default_ie.ptr,
 			     params->default_ie.len);
 	}
 
+	if (params->vendor_ie.ptr && params->vendor_ie.len) {
+		qdf_mem_copy((req->scan_req.extraie.ptr +
+			      req->scan_req.extraie.len),
+			     params->vendor_ie.ptr, params->vendor_ie.len);
+
+		req->scan_req.extraie.len += params->vendor_ie.len;
+	}
+
 	if (!is_p2p_scan) {
 		if (req->scan_req.scan_random.randomize)
 			wlan_scan_rand_attrs(vdev, request, req);