linux/drivers/net/ethernet/brocade/bna/bfi_enet.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Linux network driver for QLogic BR-series Converged Network Adapter.
 */
/*
 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
 * Copyright (c) 2014-2015 QLogic Corporation
 * All rights reserved
 * www.qlogic.com
 */

/* BNA Hardware and Firmware Interface */

/* Skipping statistics collection to avoid clutter.
 * Command is no longer needed:
 *	MTU
 *	TxQ Stop
 *	RxQ Stop
 *	RxF Enable/Disable
 *
 * HDS-off request is dynamic
 * keep structures as multiple of 32-bit fields for alignment.
 * All values must be written in big-endian.
 */
#ifndef __BFI_ENET_H__
#define __BFI_ENET_H__

#include "bfa_defs.h"
#include "bfi.h"

#define BFI_ENET_CFG_MAX

#define BFI_ENET_TXQ_PRIO_MAX
#define BFI_ENET_RX_QSET_MAX
#define BFI_ENET_TXQ_WI_VECT_MAX

#define BFI_ENET_VLAN_ID_MAX
#define BFI_ENET_VLAN_BLOCK_SIZE
#define BFI_ENET_VLAN_BLOCKS_MAX
#define BFI_ENET_VLAN_WORD_SIZE
#define BFI_ENET_VLAN_WORDS_MAX

#define BFI_ENET_RSS_RIT_MAX
#define BFI_ENET_RSS_KEY_LEN

bfi_addr_be_u __packed;

/*	T X   Q U E U E   D E F I N E S      */
/* TxQ Vector (a.k.a. Tx-Buffer Descriptor) */
/* TxQ Entry Opcodes */
#define BFI_ENET_TXQ_WI_SEND
#define BFI_ENET_TXQ_WI_SEND_LSO
#define BFI_ENET_TXQ_WI_EXTENSION

/* TxQ Entry Control Flags */
#define BFI_ENET_TXQ_WI_CF_FCOE_CRC
#define BFI_ENET_TXQ_WI_CF_IPID_MODE
#define BFI_ENET_TXQ_WI_CF_INS_PRIO
#define BFI_ENET_TXQ_WI_CF_INS_VLAN
#define BFI_ENET_TXQ_WI_CF_UDP_CKSUM
#define BFI_ENET_TXQ_WI_CF_TCP_CKSUM
#define BFI_ENET_TXQ_WI_CF_IP_CKSUM

struct bfi_enet_txq_wi_base {} __packed;

struct bfi_enet_txq_wi_ext {} __packed;

struct bfi_enet_txq_wi_vector {} __packed;

/*  TxQ Entry Structure  */
struct bfi_enet_txq_entry {} __packed;

#define wi_hdr
#define wi_ext_hdr

#define BFI_ENET_TXQ_WI_L4_HDR_N_OFFSET(_hdr_size, _offset)

/*   R X   Q U E U E   D E F I N E S   */
struct bfi_enet_rxq_entry {} __packed;

/*   R X   C O M P L E T I O N   Q U E U E   D E F I N E S   */
/* CQ Entry Flags */
#define BFI_ENET_CQ_EF_MAC_ERROR
#define BFI_ENET_CQ_EF_FCS_ERROR
#define BFI_ENET_CQ_EF_TOO_LONG
#define BFI_ENET_CQ_EF_FC_CRC_OK

#define BFI_ENET_CQ_EF_RSVD1
#define BFI_ENET_CQ_EF_L4_CKSUM_OK
#define BFI_ENET_CQ_EF_L3_CKSUM_OK
#define BFI_ENET_CQ_EF_HDS_HEADER

#define BFI_ENET_CQ_EF_UDP
#define BFI_ENET_CQ_EF_TCP
#define BFI_ENET_CQ_EF_IP_OPTIONS
#define BFI_ENET_CQ_EF_IPV6

#define BFI_ENET_CQ_EF_IPV4
#define BFI_ENET_CQ_EF_VLAN
#define BFI_ENET_CQ_EF_RSS
#define BFI_ENET_CQ_EF_RSVD2

#define BFI_ENET_CQ_EF_MCAST_MATCH
#define BFI_ENET_CQ_EF_MCAST
#define BFI_ENET_CQ_EF_BCAST
#define BFI_ENET_CQ_EF_REMOTE

#define BFI_ENET_CQ_EF_LOCAL

/* CQ Entry Structure */
struct bfi_enet_cq_entry {} __packed;

/*   E N E T   C O N T R O L   P A T H   C O M M A N D S   */
struct bfi_enet_q {} __packed;

struct bfi_enet_txq {} __packed;

struct bfi_enet_rxq {} __packed;

struct bfi_enet_cq {} __packed;

struct bfi_enet_ib_cfg {} __packed;

struct bfi_enet_ib {} __packed;

/* ENET command messages */
enum bfi_enet_h2i_msgs {};

enum bfi_enet_i2h_msgs {};

/* The following error codes can be returned by the enet commands */
enum bfi_enet_err {};

/* Generic Request
 *
 * bfi_enet_req is used by:
 *	BFI_ENET_H2I_RX_CFG_CLR_REQ
 *	BFI_ENET_H2I_TX_CFG_CLR_REQ
 */
struct bfi_enet_req {} __packed;

/* Enable/Disable Request
 *
 * bfi_enet_enable_req is used by:
 *	BFI_ENET_H2I_RSS_ENABLE_REQ	(enet_id must be zero)
 *	BFI_ENET_H2I_RX_PROMISCUOUS_REQ (enet_id must be zero)
 *	BFI_ENET_H2I_RX_DEFAULT_REQ	(enet_id must be zero)
 *	BFI_ENET_H2I_RX_MAC_MCAST_FILTER_REQ
 *	BFI_ENET_H2I_PORT_ADMIN_UP_REQ	(enet_id must be zero)
 */
struct bfi_enet_enable_req {} __packed;

/* Generic Response */
struct bfi_enet_rsp {} __packed;

/* GLOBAL CONFIGURATION */

/* bfi_enet_attr_req is used by:
 *	BFI_ENET_H2I_GET_ATTR_REQ
 */
struct bfi_enet_attr_req {} __packed;

/* bfi_enet_attr_rsp is used by:
 *	BFI_ENET_I2H_GET_ATTR_RSP
 */
struct bfi_enet_attr_rsp {} __packed;

/* Tx Configuration
 *
 * bfi_enet_tx_cfg is used by:
 *	BFI_ENET_H2I_TX_CFG_SET_REQ
 */
enum bfi_enet_tx_vlan_mode {};

struct bfi_enet_tx_cfg {} __packed;

struct bfi_enet_tx_cfg_req {};

struct bfi_enet_tx_cfg_rsp {};

/* Rx Configuration
 *
 * bfi_enet_rx_cfg is used by:
 *	BFI_ENET_H2I_RX_CFG_SET_REQ
 */
enum bfi_enet_rxq_type {};

enum bfi_enet_hds_type {};

struct bfi_enet_rx_cfg {} __packed;

/*
 * Multicast frames are received on the ql of q-set index zero.
 * On the completion queue.  RxQ ID = even is for large/data buffer queues
 * and RxQ ID = odd is for small/header buffer queues.
 */
struct bfi_enet_rx_cfg_req {} __packed;

struct bfi_enet_rx_cfg_rsp {} __packed;

/* RIT
 *
 * bfi_enet_rit_req is used by:
 *	BFI_ENET_H2I_RIT_CFG_REQ
 */
struct bfi_enet_rit_req {} __packed;

/* RSS
 *
 * bfi_enet_rss_cfg_req is used by:
 *	BFI_ENET_H2I_RSS_CFG_REQ
 */
enum bfi_enet_rss_type {};

struct bfi_enet_rss_cfg {} __packed;

struct bfi_enet_rss_cfg_req {} __packed;

/* MAC Unicast
 *
 * bfi_enet_rx_vlan_req is used by:
 *	BFI_ENET_H2I_MAC_UCAST_SET_REQ
 *	BFI_ENET_H2I_MAC_UCAST_CLR_REQ
 *	BFI_ENET_H2I_MAC_UCAST_ADD_REQ
 *	BFI_ENET_H2I_MAC_UCAST_DEL_REQ
 */
struct bfi_enet_ucast_req {} __packed;

/* MAC Unicast + VLAN */
struct bfi_enet_mac_n_vlan_req {} __packed;

/* MAC Multicast
 *
 * bfi_enet_mac_mfilter_add_req is used by:
 *	BFI_ENET_H2I_MAC_MCAST_ADD_REQ
 */
struct bfi_enet_mcast_add_req {} __packed;

/* bfi_enet_mac_mfilter_add_rsp is used by:
 *	BFI_ENET_I2H_MAC_MCAST_ADD_RSP
 */
struct bfi_enet_mcast_add_rsp {} __packed;

/* bfi_enet_mac_mfilter_del_req is used by:
 *	BFI_ENET_H2I_MAC_MCAST_DEL_REQ
 */
struct bfi_enet_mcast_del_req {} __packed;

/* VLAN
 *
 * bfi_enet_rx_vlan_req is used by:
 *	BFI_ENET_H2I_RX_VLAN_SET_REQ
 */
struct bfi_enet_rx_vlan_req {} __packed;

/* PAUSE
 *
 * bfi_enet_set_pause_req is used by:
 *	BFI_ENET_H2I_SET_PAUSE_REQ
 */
struct bfi_enet_set_pause_req {} __packed;

/* DIAGNOSTICS
 *
 * bfi_enet_diag_lb_req is used by:
 *      BFI_ENET_H2I_DIAG_LOOPBACK
 */
struct bfi_enet_diag_lb_req {} __packed;

/* enum for Loopback opmodes */
enum {};

/* STATISTICS
 *
 * bfi_enet_stats_req is used by:
 *    BFI_ENET_H2I_STATS_GET_REQ
 *    BFI_ENET_I2H_STATS_CLR_REQ
 */
struct bfi_enet_stats_req {} __packed;

/* defines for "stats_mask" above. */
#define BFI_ENET_STATS_MAC
#define BFI_ENET_STATS_BPC
#define BFI_ENET_STATS_RAD
#define BFI_ENET_STATS_RX_FC
#define BFI_ENET_STATS_TX_FC

#define BFI_ENET_STATS_ALL

/* TxF Frame Statistics */
struct bfi_enet_stats_txf {} __packed;

/* RxF Frame Statistics */
struct bfi_enet_stats_rxf {} __packed;

/* FC Tx Frame Statistics */
struct bfi_enet_stats_fc_tx {} __packed;

/* FC Rx Frame Statistics */
struct bfi_enet_stats_fc_rx {} __packed;

/* RAD Frame Statistics */
struct bfi_enet_stats_rad {} __packed;

/* BPC Tx Registers */
struct bfi_enet_stats_bpc {} __packed;

/* MAC Rx Statistics */
struct bfi_enet_stats_mac {} __packed;

/* Complete statistics, DMAed from fw to host followed by
 * BFI_ENET_I2H_STATS_GET_RSP
 */
struct bfi_enet_stats {} __packed;

#endif  /* __BFI_ENET_H__ */