linux/drivers/net/ethernet/mellanox/mlx5/core/steering/hws/mlx5hws_cmd.h

/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/* Copyright (c) 2024 NVIDIA Corporation & Affiliates */

#ifndef MLX5HWS_CMD_H_
#define MLX5HWS_CMD_H_

#define WIRE_PORT

#define ACCESS_KEY_LEN

enum mlx5hws_cmd_ext_dest_flags {};

struct mlx5hws_cmd_set_fte_dest {};

struct mlx5hws_cmd_set_fte_attr {};

struct mlx5hws_cmd_ft_create_attr {};

struct mlx5hws_cmd_ft_modify_attr {};

struct mlx5hws_cmd_ft_query_attr {};

struct mlx5hws_cmd_fg_attr {};

struct mlx5hws_cmd_forward_tbl {};

struct mlx5hws_cmd_rtc_create_attr {};

struct mlx5hws_cmd_alias_obj_create_attr {};

struct mlx5hws_cmd_stc_create_attr {};

struct mlx5hws_cmd_stc_modify_attr {};

struct mlx5hws_cmd_ste_create_attr {};

struct mlx5hws_cmd_definer_create_attr {};

struct mlx5hws_cmd_allow_other_vhca_access_attr {};

struct mlx5hws_cmd_packet_reformat_create_attr {};

struct mlx5hws_cmd_query_ft_caps {};

struct mlx5hws_cmd_generate_wqe_attr {};

struct mlx5hws_cmd_query_caps {};

int mlx5hws_cmd_flow_table_create(struct mlx5_core_dev *mdev,
				  struct mlx5hws_cmd_ft_create_attr *ft_attr,
				  u32 *table_id);

int mlx5hws_cmd_flow_table_modify(struct mlx5_core_dev *mdev,
				  struct mlx5hws_cmd_ft_modify_attr *ft_attr,
				  u32 table_id);

int mlx5hws_cmd_flow_table_query(struct mlx5_core_dev *mdev,
				 u32 obj_id,
				 struct mlx5hws_cmd_ft_query_attr *ft_attr,
				 u64 *icm_addr_0, u64 *icm_addr_1);

int mlx5hws_cmd_flow_table_destroy(struct mlx5_core_dev *mdev,
				   u8 fw_ft_type, u32 table_id);

void mlx5hws_cmd_alias_flow_table_destroy(struct mlx5_core_dev *mdev,
					  u32 table_id);

int mlx5hws_cmd_rtc_create(struct mlx5_core_dev *mdev,
			   struct mlx5hws_cmd_rtc_create_attr *rtc_attr,
			   u32 *rtc_id);

void mlx5hws_cmd_rtc_destroy(struct mlx5_core_dev *mdev, u32 rtc_id);

int mlx5hws_cmd_stc_create(struct mlx5_core_dev *mdev,
			   struct mlx5hws_cmd_stc_create_attr *stc_attr,
			   u32 *stc_id);

int mlx5hws_cmd_stc_modify(struct mlx5_core_dev *mdev,
			   u32 stc_id,
			   struct mlx5hws_cmd_stc_modify_attr *stc_attr);

void mlx5hws_cmd_stc_destroy(struct mlx5_core_dev *mdev, u32 stc_id);

int mlx5hws_cmd_generate_wqe(struct mlx5_core_dev *mdev,
			     struct mlx5hws_cmd_generate_wqe_attr *attr,
			     struct mlx5_cqe64 *ret_cqe);

int mlx5hws_cmd_ste_create(struct mlx5_core_dev *mdev,
			   struct mlx5hws_cmd_ste_create_attr *ste_attr,
			   u32 *ste_id);

void mlx5hws_cmd_ste_destroy(struct mlx5_core_dev *mdev, u32 ste_id);

int mlx5hws_cmd_definer_create(struct mlx5_core_dev *mdev,
			       struct mlx5hws_cmd_definer_create_attr *def_attr,
			       u32 *definer_id);

void mlx5hws_cmd_definer_destroy(struct mlx5_core_dev *mdev,
				 u32 definer_id);

int mlx5hws_cmd_arg_create(struct mlx5_core_dev *mdev,
			   u16 log_obj_range,
			   u32 pd,
			   u32 *arg_id);

void mlx5hws_cmd_arg_destroy(struct mlx5_core_dev *mdev,
			     u32 arg_id);

int mlx5hws_cmd_header_modify_pattern_create(struct mlx5_core_dev *mdev,
					     u32 pattern_length,
					     u8 *actions,
					     u32 *ptrn_id);

void mlx5hws_cmd_header_modify_pattern_destroy(struct mlx5_core_dev *mdev,
					       u32 ptrn_id);

int mlx5hws_cmd_packet_reformat_create(struct mlx5_core_dev *mdev,
				       struct mlx5hws_cmd_packet_reformat_create_attr *attr,
				       u32 *reformat_id);

int mlx5hws_cmd_packet_reformat_destroy(struct mlx5_core_dev *mdev,
					u32 reformat_id);

int mlx5hws_cmd_set_fte(struct mlx5_core_dev *mdev,
			u32 table_type,
			u32 table_id,
			u32 group_id,
			struct mlx5hws_cmd_set_fte_attr *fte_attr);

int mlx5hws_cmd_delete_fte(struct mlx5_core_dev *mdev,
			   u32 table_type, u32 table_id);

struct mlx5hws_cmd_forward_tbl *
mlx5hws_cmd_forward_tbl_create(struct mlx5_core_dev *mdev,
			       struct mlx5hws_cmd_ft_create_attr *ft_attr,
			       struct mlx5hws_cmd_set_fte_attr *fte_attr);

void mlx5hws_cmd_forward_tbl_destroy(struct mlx5_core_dev *mdev,
				     struct mlx5hws_cmd_forward_tbl *tbl);

int mlx5hws_cmd_alias_obj_create(struct mlx5_core_dev *mdev,
				 struct mlx5hws_cmd_alias_obj_create_attr *alias_attr,
				 u32 *obj_id);

int mlx5hws_cmd_alias_obj_destroy(struct mlx5_core_dev *mdev,
				  u16 obj_type,
				  u32 obj_id);

int mlx5hws_cmd_sq_modify_rdy(struct mlx5_core_dev *mdev, u32 sqn);

int mlx5hws_cmd_query_caps(struct mlx5_core_dev *mdev,
			   struct mlx5hws_cmd_query_caps *caps);

void mlx5hws_cmd_set_attr_connect_miss_tbl(struct mlx5hws_context *ctx,
					   u32 fw_ft_type,
					   enum mlx5hws_table_type type,
					   struct mlx5hws_cmd_ft_modify_attr *ft_attr);

int mlx5hws_cmd_allow_other_vhca_access(struct mlx5_core_dev *mdev,
					struct mlx5hws_cmd_allow_other_vhca_access_attr *attr);

int mlx5hws_cmd_query_gvmi(struct mlx5_core_dev *mdev, bool other_function,
			   u16 vport_number, u16 *gvmi);

#endif /* MLX5HWS_CMD_H_ */