Sfoglia il codice sorgente

Merge "qcacmn: Spatial Reuse changes" into wlan-cmn.driver.lnx.2.0

Linux Build Service Account 6 anni fa
parent
commit
1d27cc3a48

+ 12 - 0
wmi/inc/wmi_unified_api.h

@@ -2475,4 +2475,16 @@ QDF_STATUS wmi_extract_smartlog_ev
 void wmi_process_fw_event_worker_thread_ctx(struct wmi_unified *wmi_handle,
 					    HTC_PACKET * htc_packet);
 
+#ifdef OBSS_PD
+/**
+ * wmi_extract_smartlog_ev() - extract smartlog event info from event
+ * @wmi_handle: wmi handle
+ * @param evt_buf: pointer to event buffer
+ * @param ev: Pointer to hold fatal events
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS wmi_unified_send_obss_spatial_reuse_set_cmd(void *wmi_handle,
+	struct wmi_host_obss_spatial_reuse_set_param *obss_spatial_reuse_param);
+#endif /* OBSS_PD */
 #endif /* _WMI_UNIFIED_API_H_ */

+ 18 - 0
wmi/inc/wmi_unified_param.h

@@ -6064,6 +6064,7 @@ typedef enum {
 	wmi_service_smart_logging_support,
 #endif
 	wmi_service_infra_mbssid,
+	wmi_service_obss_spatial_reuse,
 	wmi_services_max,
 } wmi_conv_service_ids;
 #define WMI_SERVICE_UNAVAILABLE 0xFFFF
@@ -8412,6 +8413,23 @@ struct bcn_offload_control {
 	enum bcn_offload_control_param bcn_ctrl_op;
 };
 
+#ifdef OBSS_PD
+/**
+ * struct wmi_host_obss_spatial_reuse_set_param - OBSS_PD_SPATIAL Reuse
+ *                                                structure
+ * @enable: Enable/Disable Spatial Reuse
+ * @obss_min: Minimum OBSS level to use
+ * @obss_max: Maximum OBSS level to use
+ * @pdev_id: Pdev id
+ */
+struct wmi_host_obss_spatial_reuse_set_param {
+	uint32_t enable;
+	uint32_t obss_min;
+	uint32_t obss_max;
+	uint32_t vdev_id;
+};
+#endif
+
 /**
  * struct wds_entry - WDS entry structure
  * @peer_mac: peer mac

+ 6 - 0
wmi/inc/wmi_unified_priv.h

@@ -1753,6 +1753,12 @@ QDF_STATUS (*extract_dfs_status_from_fw)(wmi_unified_t wmi_handle,
 					 void *evt_buf,
 					 uint32_t *dfs_status_check);
 #endif
+
+#ifdef OBSS_PD
+QDF_STATUS (*send_obss_spatial_reuse_set)(wmi_unified_t wmi_handle,
+		struct wmi_host_obss_spatial_reuse_set_param
+		*obss_spatial_reuse_param);
+#endif
 };
 
 /* Forward declartion for psoc*/

+ 16 - 0
wmi/src/wmi_unified_api.c

@@ -7523,3 +7523,19 @@ wmi_extract_roam_scan_stats_res_evt(wmi_unified_t wmi, void *evt_buf,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+#ifdef OBSS_PD
+QDF_STATUS
+wmi_unified_send_obss_spatial_reuse_set_cmd(void *wmi_hdl,
+				    struct wmi_host_obss_spatial_reuse_set_param
+				    *obss_spatial_reuse_param)
+{
+	wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
+
+	if (wmi->ops->send_obss_spatial_reuse_set)
+		return wmi->ops->send_obss_spatial_reuse_set(wmi,
+				obss_spatial_reuse_param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+#endif

+ 56 - 0
wmi/src/wmi_unified_tlv.c

@@ -16647,6 +16647,57 @@ QDF_STATUS send_bcn_offload_control_cmd_tlv(wmi_unified_t wmi_handle,
 	return ret;
 }
 
+#ifdef OBSS_PD
+/**
+ * send_obss_spatial_reuse_set_cmd_tlv - send obss spatial reuse set cmd to fw
+ * @wmi_handle: wmi handle
+ * @obss_spatial_reuse_param: pointer to obss_spatial_reuse_param
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static
+QDF_STATUS send_obss_spatial_reuse_set_cmd_tlv(wmi_unified_t wmi_handle,
+			struct wmi_host_obss_spatial_reuse_set_param
+			*obss_spatial_reuse_param)
+{
+	wmi_buf_t buf;
+	wmi_obss_spatial_reuse_set_cmd_fixed_param *cmd;
+	QDF_STATUS ret;
+	uint32_t len;
+
+	len = sizeof(*cmd);
+
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf) {
+		qdf_print("%s: wmi_buf_alloc failed\n", __func__);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	cmd = (wmi_obss_spatial_reuse_set_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		WMITLV_TAG_STRUC_wmi_obss_spatial_reuse_set_cmd_fixed_param,
+		WMITLV_GET_STRUCT_TLVLEN
+		(wmi_obss_spatial_reuse_set_cmd_fixed_param));
+
+	cmd->enable = obss_spatial_reuse_param->enable;
+	cmd->obss_min = obss_spatial_reuse_param->obss_min;
+	cmd->obss_max = obss_spatial_reuse_param->obss_max;
+	cmd->vdev_id = obss_spatial_reuse_param->vdev_id;
+
+	ret = wmi_unified_cmd_send(wmi_handle, buf, len,
+			WMI_PDEV_OBSS_PD_SPATIAL_REUSE_CMDID);
+
+	if (QDF_IS_STATUS_ERROR(ret)) {
+		WMI_LOGE(
+		 "WMI_PDEV_OBSS_PD_SPATIAL_REUSE_CMDID send returned Error %d",
+		 ret);
+		wmi_buf_free(buf);
+	}
+
+	return ret;
+}
+#endif
+
 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
 static QDF_STATUS nan_ndp_initiator_req_tlv(wmi_unified_t wmi_handle,
 				struct nan_datapath_initiator_req *ndp_req)
@@ -22964,6 +23015,9 @@ struct wmi_ops tlv_ops =  {
 				extract_esp_estimation_ev_param_tlv,
 	.send_roam_scan_stats_cmd = send_roam_scan_stats_cmd_tlv,
 	.extract_roam_scan_stats_res_evt = extract_roam_scan_stats_res_evt_tlv,
+#ifdef OBSS_PD
+	.send_obss_spatial_reuse_set = send_obss_spatial_reuse_set_cmd_tlv,
+#endif
 };
 
 /**
@@ -23483,6 +23537,8 @@ static void populate_tlv_service(uint32_t *wmi_service)
 	wmi_service[wmi_service_twt_responder] = WMI_SERVICE_AP_TWT;
 	wmi_service[wmi_service_listen_interval_offload_support] =
 			WMI_SERVICE_LISTEN_INTERVAL_OFFLOAD_SUPPORT;
+	wmi_service[wmi_service_obss_spatial_reuse] =
+			WMI_SERVICE_OBSS_SPATIAL_REUSE;
 
 }