Przeglądaj źródła

qcacmn: ADD WMI unified param and APIs for PPEDS

Add WMI unified param and APIs to enable PPE based
routing.

Change-Id: I32e475dc684938180c837e3c6a4980a9b5a14a21
CRs-Fixed: 3147720
Neelansh Mittal 3 lat temu
rodzic
commit
c903ec29a1

+ 13 - 0
wmi/inc/wmi_unified_api.h

@@ -4660,4 +4660,17 @@ QDF_STATUS wmi_extract_quiet_offload_event(
 				struct wmi_unified *wmi_handle, void *evt_buf,
 				struct vdev_sta_quiet_event *quiet_event);
 #endif
+
+#ifdef WLAN_SUPPORT_PPEDS
+/**
+ * wmi_unified_peer_ppe_ds_param_send - Set the PPEDS configs
+ * @wmi_handle: WMI handle
+ * @param: Peer PPE DS param
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code.
+ */
+QDF_STATUS
+wmi_unified_peer_ppe_ds_param_send(wmi_unified_t wmi_handle,
+				   struct peer_ppe_ds_param *param);
+#endif /* WLAN_SUPPORT_PPEDS */
 #endif /* _WMI_UNIFIED_API_H_ */

+ 22 - 0
wmi/inc/wmi_unified_param.h

@@ -825,6 +825,28 @@ struct peer_create_params {
 #endif
 };
 
+#ifdef WLAN_SUPPORT_PPEDS
+/**
+ * struct peer_ppe_ds_param - Per peer PPE Direct Switch parameter
+ * @peer_macaddr: PPE mac address
+ * @ppe_routing_enabled: Master flag for PPE routing
+ * @use_ppe: Use PPE command for the peer entry
+ * @service_code: Service code
+ * @priority_valid: If PRI to TID conversion is enabled
+ * @src_info: Source info/PPE port of the interface
+ * @vdev_id: VAP ID
+ */
+struct peer_ppe_ds_param {
+	uint8_t peer_macaddr[QDF_MAC_ADDR_SIZE];
+	bool ppe_routing_enabled;
+	bool use_ppe;
+	uint16_t service_code;
+	uint16_t src_info;
+	uint8_t priority_valid;
+	uint8_t vdev_id;
+};
+#endif
+
 /**
  * struct peer_remove_params - peer remove cmd parameter
  * @bssid: bss id

+ 6 - 0
wmi/inc/wmi_unified_priv.h

@@ -2947,6 +2947,12 @@ QDF_STATUS (*extract_quiet_offload_event)(
 				wmi_unified_t wmi_handle, void *evt_buf,
 				struct vdev_sta_quiet_event *quiet_event);
 #endif
+
+#ifdef WLAN_SUPPORT_PPEDS
+QDF_STATUS
+(*peer_ppe_ds_param_send)(wmi_unified_t wmi_handle,
+			  struct peer_ppe_ds_param *param);
+#endif /* WLAN_SUPPORT_PPEDS */
 };
 
 /* Forward declartion for psoc*/

+ 13 - 0
wmi/src/wmi_unified_api.c

@@ -3732,3 +3732,16 @@ QDF_STATUS wmi_extract_quiet_offload_event(
 	return QDF_STATUS_E_FAILURE;
 }
 #endif
+
+#ifdef WLAN_SUPPORT_PPEDS
+QDF_STATUS
+wmi_unified_peer_ppe_ds_param_send(wmi_unified_t wmi_handle,
+				   struct peer_ppe_ds_param *param)
+{
+	if (wmi_handle->ops->peer_ppe_ds_param_send)
+		return wmi_handle->ops->peer_ppe_ds_param_send(
+				wmi_handle, param);
+
+	return QDF_STATUS_E_FAILURE;
+}
+#endif /* WLAN_SUPPORT_PPEDS */

+ 67 - 0
wmi/src/wmi_unified_tlv.c

@@ -1360,6 +1360,69 @@ static inline uint32_t convert_host_peer_param_id_to_target_id_tlv(
 }
 #endif
 
+#ifdef WLAN_SUPPORT_PPEDS
+/**
+ * peer_ppe_ds_param_send_tlv() - Set peer PPE DS config
+ * @wmi: wmi handle
+ * @param: pointer to hold PPE DS config
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static QDF_STATUS peer_ppe_ds_param_send_tlv(wmi_unified_t wmi,
+					     struct peer_ppe_ds_param *param)
+{
+	wmi_peer_config_ppe_ds_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	int32_t err;
+	uint32_t len = sizeof(wmi_peer_config_ppe_ds_cmd_fixed_param);
+
+	buf = wmi_buf_alloc(wmi, sizeof(*cmd));
+	if (!buf)
+		return QDF_STATUS_E_NOMEM;
+
+	cmd = (wmi_peer_config_ppe_ds_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_peer_config_ppe_ds_cmd_fixed_param,
+		       WMITLV_GET_STRUCT_TLVLEN
+				(wmi_peer_config_ppe_ds_cmd_fixed_param));
+
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(param->peer_macaddr, &cmd->peer_macaddr);
+
+	if (param->ppe_routing_enabled)
+		cmd->ppe_routing_enable = param->use_ppe ?
+			WMI_AST_USE_PPE_ENABLED :  WMI_AST_USE_PPE_DISABLED;
+	else
+		cmd->ppe_routing_enable = WMI_PPE_ROUTING_DISABLED;
+
+	cmd->service_code = param->service_code;
+	cmd->priority_valid = param->priority_valid;
+	cmd->src_info = param->src_info;
+	cmd->vdev_id = param->vdev_id;
+
+	wmi_debug("vdev_id %d peer_mac: QDF_MAC_ADDR_FMT\n"
+		  "ppe_routing_enable: %u service_code: %u\n"
+		  "priority_valid:%d src_info:%u",
+		  param->vdev_id,
+		  QDF_MAC_ADDR_REF(param->peer_macaddr),
+		  param->ppe_routing_enabled,
+		  param->service_code,
+		  param->priority_valid,
+		  param->src_info);
+
+	wmi_mtrace(WMI_PEER_CONFIG_PPE_DS_CMDID, cmd->vdev_id, 0);
+	err = wmi_unified_cmd_send(wmi, buf,
+				   len,
+				   WMI_PEER_CONFIG_PPE_DS_CMDID);
+	if (err) {
+		wmi_err("Failed to send ppeds config cmd");
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return 0;
+}
+#endif /* WLAN_SUPPORT_PPEDS */
+
 /**
  * send_peer_param_cmd_tlv() - set peer parameter in fw
  * @wmi: wmi handle
@@ -17561,6 +17624,10 @@ struct wmi_ops tlv_ops =  {
 	.extract_quiet_offload_event =
 				extract_quiet_offload_event_tlv,
 #endif
+
+#ifdef WLAN_SUPPORT_PPEDS
+	.peer_ppe_ds_param_send = peer_ppe_ds_param_send_tlv,
+#endif /* WLAN_SUPPORT_PPEDS */
 };
 
 /**