소스 검색

qcacmn: Add WMI support to enable injector frame cmd

Add corresponding WMI host param for enabling the
injector frame on the AP.

CRs-fixed: 2640751
Change-Id: I00a634375e0eafbacfd505aa39dce9c8d90804c6
Rhythm Patwa 5 년 전
부모
커밋
78ddddb141
5개의 변경된 파일84개의 추가작업 그리고 0개의 파일을 삭제
  1. 12 0
      wmi/inc/wmi_unified_api.h
  2. 16 0
      wmi/inc/wmi_unified_param.h
  3. 3 0
      wmi/inc/wmi_unified_priv.h
  4. 12 0
      wmi/src/wmi_unified_api.c
  5. 41 0
      wmi/src/wmi_unified_tlv.c

+ 12 - 0
wmi/inc/wmi_unified_api.h

@@ -3912,4 +3912,16 @@ wmi_unified_extract_time_sync_ftm_offset(wmi_unified_t wmi_handle,
 					 struct ftm_time_sync_offset *param);
 #endif /* FEATURE_WLAN_TIME_SYNC_FTM */
 
+/**
+ * wmi_unified_send_injector_frame_config_cmd() - configure injector frame
+ * @wmi_handle: wmi handle
+ * @param: params received in the injector frame configure command
+ *
+ * This function configures the AP to send out injector frames
+ *
+ * Return QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_unified_send_injector_frame_config_cmd(wmi_unified_t wmi_handle,
+				struct wmi_host_injector_frame_params *param);
 #endif /* _WMI_UNIFIED_API_H_ */

+ 16 - 0
wmi/inc/wmi_unified_param.h

@@ -7352,6 +7352,22 @@ struct wmi_host_obss_spatial_reuse_set_def_thresh {
 };
 #endif
 
+/**
+ * struct wmi_host_injector_frame_params - Injector frame configuration params
+ * @vdev_id: vdev identifer of VAP
+ * @enable: Enable/disable flag for the frame
+ * @frame_type: Frame type to be enabled
+ * @frame_inject_period: Periodicity of injector frame transmission
+ * @dstmac: Destination address to be used for the frame
+ */
+struct wmi_host_injector_frame_params {
+	uint32_t vdev_id;
+	uint32_t enable;
+	uint32_t frame_type;
+	uint32_t frame_inject_period;
+	uint8_t dstmac[QDF_MAC_ADDR_SIZE];
+};
+
 /**
  * struct wds_entry - WDS entry structure
  * @peer_mac: peer mac

+ 3 - 0
wmi/inc/wmi_unified_priv.h

@@ -2254,6 +2254,9 @@ QDF_STATUS (*extract_time_sync_ftm_offset_event)(
 #endif /* FEATURE_WLAN_TIME_SYNC_FTM */
 QDF_STATUS (*send_roam_scan_ch_list_req_cmd)(wmi_unified_t wmi_hdl,
 					     uint32_t vdev_id);
+
+QDF_STATUS (*send_injector_config_cmd)(wmi_unified_t wmi_handle,
+				struct wmi_host_injector_frame_params *params);
 };
 
 /* Forward declartion for psoc*/

+ 12 - 0
wmi/src/wmi_unified_api.c

@@ -3196,3 +3196,15 @@ QDF_STATUS wmi_unified_extract_time_sync_ftm_offset(
 	return QDF_STATUS_E_FAILURE;
 }
 #endif /* FEATURE_WLAN_TIME_SYNC_FTM */
+
+QDF_STATUS
+wmi_unified_send_injector_frame_config_cmd(wmi_unified_t wmi_handle,
+				 struct wmi_host_injector_frame_params *param)
+{
+	if (wmi_handle->ops->send_injector_config_cmd) {
+		return wmi_handle->ops->send_injector_config_cmd(wmi_handle,
+			param);
+	}
+
+	return QDF_STATUS_E_FAILURE;
+}

+ 41 - 0
wmi/src/wmi_unified_tlv.c

@@ -8477,6 +8477,46 @@ QDF_STATUS send_obss_spatial_reuse_set_cmd_tlv(wmi_unified_t wmi_handle,
 }
 #endif
 
+static
+QDF_STATUS send_injector_config_cmd_tlv(wmi_unified_t wmi_handle,
+		struct wmi_host_injector_frame_params *inject_config_params)
+{
+	wmi_buf_t buf;
+	wmi_frame_inject_cmd_fixed_param *cmd;
+	QDF_STATUS ret;
+	uint32_t len;
+
+	len = sizeof(*cmd);
+
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf)
+		return QDF_STATUS_E_NOMEM;
+
+	cmd = (wmi_frame_inject_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		WMITLV_TAG_STRUC_wmi_frame_inject_cmd_fixed_param,
+		WMITLV_GET_STRUCT_TLVLEN
+		(wmi_frame_inject_cmd_fixed_param));
+
+	cmd->vdev_id = inject_config_params->vdev_id;
+	cmd->enable = inject_config_params->enable;
+	cmd->frame_type = inject_config_params->frame_type;
+	cmd->frame_inject_period = inject_config_params->frame_inject_period;
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(inject_config_params->dstmac,
+			&cmd->frame_addr1);
+
+	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
+			WMI_PDEV_FRAME_INJECT_CMDID);
+
+	if (QDF_IS_STATUS_ERROR(ret)) {
+		WMI_LOGE(
+		 "WMI_PDEV_FRAME_INJECT_CMDID send returned Error %d",
+		 ret);
+		wmi_buf_free(buf);
+	}
+
+	return ret;
+}
 #ifdef QCA_SUPPORT_CP_STATS
 /**
  * extract_cca_stats_tlv - api to extract congestion stats from event buffer
@@ -13727,6 +13767,7 @@ struct wmi_ops tlv_ops =  {
 					extract_time_sync_ftm_offset_event_tlv,
 #endif /* FEATURE_WLAN_TIME_SYNC_FTM */
 	.send_roam_scan_ch_list_req_cmd = send_roam_scan_ch_list_req_cmd_tlv,
+	.send_injector_config_cmd = send_injector_config_cmd_tlv,
 };
 
 /**