linux/drivers/net/ethernet/intel/ice/ice_ddp.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (c) 2022, Intel Corporation. */

#ifndef _ICE_DDP_H_
#define _ICE_DDP_H_

#include "ice_type.h"

/* Package minimal version supported */
#define ICE_PKG_SUPP_VER_MAJ
#define ICE_PKG_SUPP_VER_MNR

/* Package format version */
#define ICE_PKG_FMT_VER_MAJ
#define ICE_PKG_FMT_VER_MNR
#define ICE_PKG_FMT_VER_UPD
#define ICE_PKG_FMT_VER_DFT

#define ICE_PKG_CNT

#define ICE_FV_OFFSET_INVAL

/* Extraction Sequence (Field Vector) Table */
struct ice_fv_word {} __packed;

#define ICE_MAX_NUM_PROFILES

#define ICE_MAX_FV_WORDS
struct ice_fv {};

enum ice_ddp_state {};

/* Package and segment headers and tables */
struct ice_pkg_hdr {};

/* Package signing algorithm types */
#define SEGMENT_SIGN_TYPE_INVALID
#define SEGMENT_SIGN_TYPE_RSA2K
#define SEGMENT_SIGN_TYPE_RSA3K
#define SEGMENT_SIGN_TYPE_RSA3K_SBB
#define SEGMENT_SIGN_TYPE_RSA3K_E825

/* generic segment */
struct ice_generic_seg_hdr {};

/* ice specific segment */

ice_device_id;

struct ice_device_id_entry {};

struct ice_seg {};

struct ice_nvm_table {};

struct ice_buf {};

struct ice_buf_table {};

struct ice_run_time_cfg_seg {};

/* global metadata specific segment */
struct ice_global_metadata_seg {};

#define ICE_MIN_S_OFF
#define ICE_MAX_S_OFF
#define ICE_MIN_S_SZ
#define ICE_MAX_S_SZ

struct ice_sign_seg {};

/* section information */
struct ice_section_entry {};

#define ICE_MIN_S_COUNT
#define ICE_MAX_S_COUNT
#define ICE_MIN_S_DATA_END
#define ICE_MAX_S_DATA_END

#define ICE_METADATA_BUF

struct ice_buf_hdr {};

#define ICE_MAX_ENTRIES_IN_BUF(hd_sz, ent_sz)

/* ice package section IDs */
#define ICE_SID_METADATA
#define ICE_SID_XLT0_SW
#define ICE_SID_XLT_KEY_BUILDER_SW
#define ICE_SID_XLT1_SW
#define ICE_SID_XLT2_SW
#define ICE_SID_PROFID_TCAM_SW
#define ICE_SID_PROFID_REDIR_SW
#define ICE_SID_FLD_VEC_SW
#define ICE_SID_CDID_KEY_BUILDER_SW

struct ice_meta_sect {};

#define ICE_SID_CDID_REDIR_SW

#define ICE_SID_XLT0_ACL
#define ICE_SID_XLT_KEY_BUILDER_ACL
#define ICE_SID_XLT1_ACL
#define ICE_SID_XLT2_ACL
#define ICE_SID_PROFID_TCAM_ACL
#define ICE_SID_PROFID_REDIR_ACL
#define ICE_SID_FLD_VEC_ACL
#define ICE_SID_CDID_KEY_BUILDER_ACL
#define ICE_SID_CDID_REDIR_ACL

#define ICE_SID_XLT0_FD
#define ICE_SID_XLT_KEY_BUILDER_FD
#define ICE_SID_XLT1_FD
#define ICE_SID_XLT2_FD
#define ICE_SID_PROFID_TCAM_FD
#define ICE_SID_PROFID_REDIR_FD
#define ICE_SID_FLD_VEC_FD
#define ICE_SID_CDID_KEY_BUILDER_FD
#define ICE_SID_CDID_REDIR_FD

#define ICE_SID_XLT0_RSS
#define ICE_SID_XLT_KEY_BUILDER_RSS
#define ICE_SID_XLT1_RSS
#define ICE_SID_XLT2_RSS
#define ICE_SID_PROFID_TCAM_RSS
#define ICE_SID_PROFID_REDIR_RSS
#define ICE_SID_FLD_VEC_RSS
#define ICE_SID_CDID_KEY_BUILDER_RSS
#define ICE_SID_CDID_REDIR_RSS

#define ICE_SID_RXPARSER_CAM
#define ICE_SID_RXPARSER_NOMATCH_CAM
#define ICE_SID_RXPARSER_IMEM
#define ICE_SID_RXPARSER_MARKER_PTYPE
#define ICE_SID_RXPARSER_BOOST_TCAM
#define ICE_SID_RXPARSER_PROTO_GRP
#define ICE_SID_RXPARSER_METADATA_INIT
#define ICE_SID_TXPARSER_BOOST_TCAM
#define ICE_SID_RXPARSER_MARKER_GRP
#define ICE_SID_RXPARSER_PG_SPILL
#define ICE_SID_RXPARSER_NOMATCH_SPILL

#define ICE_SID_XLT0_PE
#define ICE_SID_XLT_KEY_BUILDER_PE
#define ICE_SID_XLT1_PE
#define ICE_SID_XLT2_PE
#define ICE_SID_PROFID_TCAM_PE
#define ICE_SID_PROFID_REDIR_PE
#define ICE_SID_FLD_VEC_PE
#define ICE_SID_CDID_KEY_BUILDER_PE
#define ICE_SID_CDID_REDIR_PE

#define ICE_SID_RXPARSER_FLAG_REDIR
/* Label Metadata section IDs */
#define ICE_SID_LBL_FIRST
#define ICE_SID_LBL_RXPARSER_TMEM
/* The following define MUST be updated to reflect the last label section ID */
#define ICE_SID_LBL_LAST

/* Label ICE runtime configuration section IDs */
#define ICE_SID_TX_5_LAYER_TOPO

enum ice_block {};

enum ice_sect {};

/* package labels */
struct ice_label {};

struct ice_label_section {};

#define ICE_MAX_LABELS_IN_BUF

struct ice_sw_fv_section {};

struct ice_sw_fv_list_entry {};

/* The BOOST TCAM stores the match packet header in reverse order, meaning
 * the fields are reversed; in addition, this means that the normally big endian
 * fields of the packet are now little endian.
 */
struct ice_boost_key_value {} __packed;

struct ice_boost_key {};

/* package Boost TCAM entry */
struct ice_boost_tcam_entry {};

struct ice_boost_tcam_section {};

#define ICE_MAX_BST_TCAMS_IN_BUF

/* package Marker Ptype TCAM entry */
struct ice_marker_ptype_tcam_entry {};

struct ice_marker_ptype_tcam_section {};

#define ICE_MAX_MARKER_PTYPE_TCAMS_IN_BUF

struct ice_xlt1_section {};

struct ice_xlt2_section {};

struct ice_prof_redir_section {};

/* package buffer building */

struct ice_buf_build {};

struct ice_pkg_enum {};

int ice_aq_upload_section(struct ice_hw *hw, struct ice_buf_hdr *pkg_buf,
			  u16 buf_size, struct ice_sq_cd *cd);

void *ice_pkg_buf_alloc_section(struct ice_buf_build *bld, u32 type, u16 size);

struct ice_buf_build *ice_pkg_buf_alloc(struct ice_hw *hw);

int ice_update_pkg_no_lock(struct ice_hw *hw, struct ice_buf *bufs, u32 count);
int ice_update_pkg(struct ice_hw *hw, struct ice_buf *bufs, u32 count);

int ice_pkg_buf_reserve_section(struct ice_buf_build *bld, u16 count);
u16 ice_pkg_buf_get_active_sections(struct ice_buf_build *bld);
void *
ice_pkg_enum_entry(struct ice_seg *ice_seg, struct ice_pkg_enum *state,
		   u32 sect_type, u32 *offset,
		   void *(*handler)(u32 sect_type, void *section,
				    u32 index, u32 *offset));
void *ice_pkg_enum_section(struct ice_seg *ice_seg, struct ice_pkg_enum *state,
			   u32 sect_type);

int ice_cfg_tx_topo(struct ice_hw *hw, const void *buf, u32 len);

#endif