فهرست منبع

qcacmn: Send beacon frame in wmi_roam_invoke_cmd

Send beacon frame in wmi_roam_invoke_cmd to firmware
This helps firmware skip scan to connect to requested
BSSID.

Change-Id: I5c6e375309dcb3bdd6430a3d501bade5cfe2e88d
CRs-Fixed: 1116901
Naveen Rawat 8 سال پیش
والد
کامیت
1cbd823f1b
3فایلهای تغییر یافته به همراه46 افزوده شده و 4 حذف شده
  1. 4 1
      qdf/linux/src/i_qdf_trace.h
  2. 4 0
      wmi/inc/wmi_unified_param.h
  3. 38 3
      wmi/src/wmi_unified_tlv.c

+ 4 - 1
qdf/linux/src/i_qdf_trace.h

@@ -57,7 +57,7 @@
 #define QDF_TRACE(arg ...)
 #define QDF_TRACE_HEX_DUMP(arg ...)
 #endif
-#else
+#else /* CONFIG_MCL */
 
 #define qdf_trace(log_level, args...) \
 		do {	\
@@ -69,6 +69,9 @@
 		} while (0)
 #define QDF_TRACE(x, log_level, args...) \
 	qdf_trace(log_level, args)
+
+#define QDF_TRACE_HEX_DUMP(arg ...)
+
 #endif /* CONFIG_MCL */
 
 #define QDF_ENABLE_TRACING

+ 4 - 0
wmi/inc/wmi_unified_param.h

@@ -3365,11 +3365,15 @@ struct wmi_unit_test_cmd {
  * @vdev_id: vdev id
  * @bssid: mac address
  * @channel: channel
+ * @frame_len: frame length, includs mac header, fixed params and ies
+ * @frame_buf: buffer contaning probe response or beacon
  */
 struct wmi_roam_invoke_cmd {
 	uint32_t vdev_id;
 	uint8_t bssid[IEEE80211_ADDR_LEN];
 	uint32_t channel;
+	uint32_t frame_len;
+	uint8_t *frame_buf;
 };
 
 /**

+ 38 - 3
wmi/src/wmi_unified_tlv.c

@@ -11312,10 +11312,12 @@ static QDF_STATUS send_roam_invoke_cmd_tlv(wmi_unified_t wmi_handle,
 	u_int16_t len, args_tlv_len;
 	A_UINT32 *channel_list;
 	wmi_mac_addr *bssid_list;
+	wmi_tlv_buf_len_param *buf_len_tlv;
 
 	/* Host sends only one channel and one bssid */
-	args_tlv_len = 2 * WMI_TLV_HDR_SIZE + sizeof(A_UINT32) +
-			sizeof(wmi_mac_addr);
+	args_tlv_len = (4 * WMI_TLV_HDR_SIZE) + sizeof(A_UINT32) +
+			sizeof(wmi_mac_addr) + sizeof(wmi_tlv_buf_len_param) +
+			roundup(roaminvoke->frame_len, sizeof(uint32_t));
 	len = sizeof(wmi_roam_invoke_cmd_fixed_param) + args_tlv_len;
 	wmi_buf = wmi_buf_alloc(wmi_handle, len);
 	if (!wmi_buf) {
@@ -11330,11 +11332,19 @@ static QDF_STATUS send_roam_invoke_cmd_tlv(wmi_unified_t wmi_handle,
 	WMITLV_GET_STRUCT_TLVLEN(wmi_roam_invoke_cmd_fixed_param));
 	cmd->vdev_id = roaminvoke->vdev_id;
 	cmd->flags = 0;
-	cmd->roam_scan_mode = 0;
+
+	if (roaminvoke->frame_len)
+		cmd->roam_scan_mode = WMI_ROAM_INVOKE_SCAN_MODE_SKIP;
+	else
+		cmd->roam_scan_mode = WMI_ROAM_INVOKE_SCAN_MODE_FIXED_CH;
+
 	cmd->roam_ap_sel_mode = 0;
 	cmd->roam_delay = 0;
 	cmd->num_chan = 1;
 	cmd->num_bssid = 1;
+	/* packing 1 beacon/probe_rsp frame with WMI cmd */
+	cmd->num_buf = 1;
+
 	buf_ptr += sizeof(wmi_roam_invoke_cmd_fixed_param);
 	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
 				(sizeof(u_int32_t)));
@@ -11345,6 +11355,31 @@ static QDF_STATUS send_roam_invoke_cmd_tlv(wmi_unified_t wmi_handle,
 				(sizeof(wmi_mac_addr)));
 	bssid_list = (wmi_mac_addr *)(buf_ptr + WMI_TLV_HDR_SIZE);
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(roaminvoke->bssid, bssid_list);
+
+	/* move to next tlv i.e. bcn_prb_buf_list */
+	buf_ptr += WMI_TLV_HDR_SIZE + sizeof(wmi_mac_addr);
+
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_FIXED_STRUC,
+			sizeof(wmi_tlv_buf_len_param));
+
+	buf_len_tlv = (wmi_tlv_buf_len_param *)(buf_ptr + WMI_TLV_HDR_SIZE);
+	buf_len_tlv->buf_len = roaminvoke->frame_len;
+
+	/* move to next tlv i.e. bcn_prb_frm */
+	buf_ptr += WMI_TLV_HDR_SIZE + sizeof(wmi_tlv_buf_len_param);
+	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE,
+		roundup(roaminvoke->frame_len, sizeof(uint32_t)));
+
+	/* copy frame after the header */
+	qdf_mem_copy(buf_ptr + WMI_TLV_HDR_SIZE,
+			roaminvoke->frame_buf,
+			roaminvoke->frame_len);
+
+	WMI_LOGD(FL("bcn/prb_rsp frame, length: %d"), roaminvoke->frame_len);
+	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_WMA, QDF_TRACE_LEVEL_DEBUG,
+			buf_ptr + WMI_TLV_HDR_SIZE,
+			roaminvoke->frame_len);
+
 	if (wmi_unified_cmd_send(wmi_handle, wmi_buf, len,
 					WMI_ROAM_INVOKE_CMDID)) {
 		WMI_LOGP("%s: failed to send roam invoke command", __func__);