linux/drivers/net/ethernet/cisco/enic/vnic_devcmd.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright 2008-2010 Cisco Systems, Inc.  All rights reserved.
 * Copyright 2007 Nuova Systems, Inc.  All rights reserved.
 */

#ifndef _VNIC_DEVCMD_H_
#define _VNIC_DEVCMD_H_

#define _CMD_NBITS
#define _CMD_VTYPEBITS
#define _CMD_FLAGSBITS
#define _CMD_DIRBITS

#define _CMD_NMASK
#define _CMD_VTYPEMASK
#define _CMD_FLAGSMASK
#define _CMD_DIRMASK

#define _CMD_NSHIFT
#define _CMD_VTYPESHIFT
#define _CMD_FLAGSSHIFT
#define _CMD_DIRSHIFT

/*
 * Direction bits (from host perspective).
 */
#define _CMD_DIR_NONE
#define _CMD_DIR_WRITE
#define _CMD_DIR_READ
#define _CMD_DIR_RW

/*
 * Flag bits.
 */
#define _CMD_FLAGS_NONE
#define _CMD_FLAGS_NOWAIT

/*
 * vNIC type bits.
 */
#define _CMD_VTYPE_NONE
#define _CMD_VTYPE_ENET
#define _CMD_VTYPE_FC
#define _CMD_VTYPE_SCSI
#define _CMD_VTYPE_ALL

/*
 * Used to create cmds..
*/
#define _CMDCF(dir, flags, vtype, nr)
#define _CMDC(dir, vtype, nr)
#define _CMDCNW(dir, vtype, nr)

/*
 * Used to decode cmds..
*/
#define _CMD_DIR(cmd)
#define _CMD_FLAGS(cmd)
#define _CMD_VTYPE(cmd)
#define _CMD_N(cmd)

enum vnic_devcmd_cmd {};

/* CMD_ENABLE2 flags */
#define CMD_ENABLE2_STANDBY
#define CMD_ENABLE2_ACTIVE

/* flags for CMD_OPEN */
#define CMD_OPENF_OPROM
#define CMD_OPENF_IG_DESCCACHE

/* flags for CMD_INIT */
#define CMD_INITF_DEFAULT_MAC

/* flags for CMD_PACKET_FILTER */
#define CMD_PFILTER_DIRECTED
#define CMD_PFILTER_MULTICAST
#define CMD_PFILTER_BROADCAST
#define CMD_PFILTER_PROMISCUOUS
#define CMD_PFILTER_ALL_MULTICAST

/* Commands for CMD_QP_ENABLE/CM_QP_DISABLE */
#define CMD_QP_RQWQ

/* rewrite modes for CMD_IG_VLAN_REWRITE_MODE */
#define IG_VLAN_REWRITE_MODE_DEFAULT_TRUNK
#define IG_VLAN_REWRITE_MODE_UNTAG_DEFAULT_VLAN
#define IG_VLAN_REWRITE_MODE_PRIORITY_TAG_DEFAULT_VLAN
#define IG_VLAN_REWRITE_MODE_PASS_THRU

enum vnic_devcmd_status {};

enum vnic_devcmd_error {};

/*
 * note: hw_version and asic_rev refer to the same thing,
 *       but have different formats. hw_version is
 *       a 32-byte string (e.g. "A2") and asic_rev is
 *       a 16-bit integer (e.g. 0xA2).
 */
struct vnic_devcmd_fw_info {};

struct vnic_devcmd_notify {};
#define VNIC_STF_FATAL_ERR
#define VNIC_STF_STD_PAUSE
#define VNIC_STF_PFC_PAUSE
/* all supported status flags */
#define VNIC_STF_ALL

struct vnic_devcmd_provinfo {};

/* These are used in flags field of different filters to denote
 * valid fields used.
 */
#define FILTER_FIELD_VALID(fld)

#define FILTER_FIELDS_USNIC

#define FILTER_FIELDS_IPV4_5TUPLE

#define FILTER_FIELDS_MAC_VLAN

#define FILTER_FIELD_USNIC_VLAN
#define FILTER_FIELD_USNIC_ETHTYPE
#define FILTER_FIELD_USNIC_PROTO
#define FILTER_FIELD_USNIC_ID

struct filter_usnic_id {} __packed;

#define FILTER_FIELD_5TUP_PROTO
#define FILTER_FIELD_5TUP_SRC_AD
#define FILTER_FIELD_5TUP_DST_AD
#define FILTER_FIELD_5TUP_SRC_PT
#define FILTER_FIELD_5TUP_DST_PT

/* Enums for the protocol field. */
enum protocol_e {};

struct filter_ipv4_5tuple {} __packed;

#define FILTER_FIELD_VMQ_VLAN
#define FILTER_FIELD_VMQ_MAC

struct filter_mac_vlan {} __packed;

/* Specifies the filter_action type. */
enum {};

struct filter_action {} __packed;

/* Specifies the filter type. */
enum filter_type {};

struct filter {} __packed;

enum {};

/* Maximum size of buffer to CMD_ADD_FILTER */
#define FILTER_MAX_BUF_SIZE

struct filter_tlv {};

enum {};

/*
 * Writing cmd register causes STAT_BUSY to get set in status register.
 * When cmd completes, STAT_BUSY will be cleared.
 *
 * If cmd completed successfully STAT_ERROR will be clear
 * and args registers contain cmd-specific results.
 *
 * If cmd error, STAT_ERROR will be set and args[0] contains error code.
 *
 * status register is read-only.  While STAT_BUSY is set,
 * all other register contents are read-only.
 */

/* Make sizeof(vnic_devcmd) a power-of-2 for I/O BAR. */
#define VNIC_DEVCMD_NARGS
struct vnic_devcmd {};

#define DEVCMD2_FNORESULT

#define VNIC_DEVCMD2_NARGS
struct vnic_devcmd2 {};

#define VNIC_DEVCMD2_NRESULTS
struct devcmd2_result {};

#define DEVCMD2_RING_SIZE
#define DEVCMD2_DESC_SIZE

enum overlay_feature_t {};

enum overlay_ofld_cmd {};

#define OVERLAY_CFG_VXLAN_PORT_UPDATE

#define ENIC_VXLAN_INNER_IPV6
#define ENIC_VXLAN_OUTER_IPV6
#define ENIC_VXLAN_MULTI_WQ

/* Use this enum to get the supported versions for each of these features
 * If you need to use the devcmd_get_supported_feature_version(), add
 * the new feature into this enum and install function handler in devcmd.c
 */
enum vic_feature_t {};

#endif /* _VNIC_DEVCMD_H_ */