162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2005-2016 Broadcom.
462306a36Sopenharmony_ci * All rights reserved.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Contact Information:
762306a36Sopenharmony_ci * linux-drivers@emulex.com
862306a36Sopenharmony_ci *
962306a36Sopenharmony_ci * Emulex
1062306a36Sopenharmony_ci * 3333 Susan Street
1162306a36Sopenharmony_ci * Costa Mesa, CA 92626
1262306a36Sopenharmony_ci */
1362306a36Sopenharmony_ci
1462306a36Sopenharmony_ci/********* Mailbox door bell *************/
1562306a36Sopenharmony_ci/* Used for driver communication with the FW.
1662306a36Sopenharmony_ci * The software must write this register twice to post any command. First,
1762306a36Sopenharmony_ci * it writes the register with hi=1 and the upper bits of the physical address
1862306a36Sopenharmony_ci * for the MAILBOX structure. Software must poll the ready bit until this
1962306a36Sopenharmony_ci * is acknowledged. Then, sotware writes the register with hi=0 with the lower
2062306a36Sopenharmony_ci * bits in the address. It must poll the ready bit until the command is
2162306a36Sopenharmony_ci * complete. Upon completion, the MAILBOX will contain a valid completion
2262306a36Sopenharmony_ci * queue entry.
2362306a36Sopenharmony_ci */
2462306a36Sopenharmony_ci#define MPU_MAILBOX_DB_OFFSET	0x160
2562306a36Sopenharmony_ci#define MPU_MAILBOX_DB_RDY_MASK	0x1 	/* bit 0 */
2662306a36Sopenharmony_ci#define MPU_MAILBOX_DB_HI_MASK	0x2	/* bit 1 */
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci#define MPU_EP_CONTROL 		0
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/********** MPU semphore: used for SH & BE  *************/
3162306a36Sopenharmony_ci#define SLIPORT_SOFTRESET_OFFSET		0x5c	/* CSR BAR offset */
3262306a36Sopenharmony_ci#define SLIPORT_SEMAPHORE_OFFSET_BEx		0xac  /* CSR BAR offset */
3362306a36Sopenharmony_ci#define SLIPORT_SEMAPHORE_OFFSET_SH		0x94  /* PCI-CFG offset */
3462306a36Sopenharmony_ci#define POST_STAGE_MASK				0x0000FFFF
3562306a36Sopenharmony_ci#define POST_ERR_MASK				0x1
3662306a36Sopenharmony_ci#define POST_ERR_SHIFT				31
3762306a36Sopenharmony_ci#define POST_ERR_RECOVERY_CODE_MASK		0xFFF
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci/* Soft Reset register masks */
4062306a36Sopenharmony_ci#define SLIPORT_SOFTRESET_SR_MASK		0x00000080	/* SR bit */
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci/* MPU semphore POST stage values */
4362306a36Sopenharmony_ci#define POST_STAGE_AWAITING_HOST_RDY 	0x1 /* FW awaiting goahead from host */
4462306a36Sopenharmony_ci#define POST_STAGE_HOST_RDY 		0x2 /* Host has given go-ahed to FW */
4562306a36Sopenharmony_ci#define POST_STAGE_BE_RESET		0x3 /* Host wants to reset chip */
4662306a36Sopenharmony_ci#define POST_STAGE_ARMFW_RDY		0xc000	/* FW is done with POST */
4762306a36Sopenharmony_ci#define POST_STAGE_RECOVERABLE_ERR	0xE000	/* Recoverable err detected */
4862306a36Sopenharmony_ci/* FW has detected a UE and is dumping FAT log data */
4962306a36Sopenharmony_ci#define POST_STAGE_FAT_LOG_START       0x0D00
5062306a36Sopenharmony_ci#define POST_STAGE_ARMFW_UE            0xF000  /*FW has asserted an UE*/
5162306a36Sopenharmony_ci
5262306a36Sopenharmony_ci/* Lancer SLIPORT registers */
5362306a36Sopenharmony_ci#define SLIPORT_STATUS_OFFSET		0x404
5462306a36Sopenharmony_ci#define SLIPORT_CONTROL_OFFSET		0x408
5562306a36Sopenharmony_ci#define SLIPORT_ERROR1_OFFSET		0x40C
5662306a36Sopenharmony_ci#define SLIPORT_ERROR2_OFFSET		0x410
5762306a36Sopenharmony_ci#define PHYSDEV_CONTROL_OFFSET		0x414
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define SLIPORT_STATUS_ERR_MASK		0x80000000
6062306a36Sopenharmony_ci#define SLIPORT_STATUS_DIP_MASK		0x02000000
6162306a36Sopenharmony_ci#define SLIPORT_STATUS_RN_MASK		0x01000000
6262306a36Sopenharmony_ci#define SLIPORT_STATUS_RDY_MASK		0x00800000
6362306a36Sopenharmony_ci#define SLI_PORT_CONTROL_IP_MASK	0x08000000
6462306a36Sopenharmony_ci#define PHYSDEV_CONTROL_FW_RESET_MASK	0x00000002
6562306a36Sopenharmony_ci#define PHYSDEV_CONTROL_DD_MASK		0x00000004
6662306a36Sopenharmony_ci#define PHYSDEV_CONTROL_INP_MASK	0x40000000
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci#define SLIPORT_ERROR_NO_RESOURCE1	0x2
6962306a36Sopenharmony_ci#define SLIPORT_ERROR_NO_RESOURCE2	0x9
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_ci#define SLIPORT_ERROR_FW_RESET1		0x2
7262306a36Sopenharmony_ci#define SLIPORT_ERROR_FW_RESET2		0x0
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci/********* Memory BAR register ************/
7562306a36Sopenharmony_ci#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 	0xfc
7662306a36Sopenharmony_ci/* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt
7762306a36Sopenharmony_ci * Disable" may still globally block interrupts in addition to individual
7862306a36Sopenharmony_ci * interrupt masks; a mechanism for the device driver to block all interrupts
7962306a36Sopenharmony_ci * atomically without having to arbitrate for the PCI Interrupt Disable bit
8062306a36Sopenharmony_ci * with the OS.
8162306a36Sopenharmony_ci */
8262306a36Sopenharmony_ci#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK	BIT(29) /* bit 29 */
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci/********* PCI Function Capability *********/
8562306a36Sopenharmony_ci#define BE_FUNCTION_CAPS_RSS			0x2
8662306a36Sopenharmony_ci#define BE_FUNCTION_CAPS_SUPER_NIC		0x40
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci/********* Power management (WOL) **********/
8962306a36Sopenharmony_ci#define PCICFG_PM_CONTROL_OFFSET		0x44
9062306a36Sopenharmony_ci#define PCICFG_PM_CONTROL_MASK			0x108	/* bits 3 & 8 */
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci/********* Online Control Registers *******/
9362306a36Sopenharmony_ci#define PCICFG_ONLINE0				0xB0
9462306a36Sopenharmony_ci#define PCICFG_ONLINE1				0xB4
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci/********* UE Status and Mask Registers ***/
9762306a36Sopenharmony_ci#define PCICFG_UE_STATUS_LOW			0xA0
9862306a36Sopenharmony_ci#define PCICFG_UE_STATUS_HIGH			0xA4
9962306a36Sopenharmony_ci#define PCICFG_UE_STATUS_LOW_MASK		0xA8
10062306a36Sopenharmony_ci#define PCICFG_UE_STATUS_HI_MASK		0xAC
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci/******** SLI_INTF ***********************/
10362306a36Sopenharmony_ci#define SLI_INTF_REG_OFFSET			0x58
10462306a36Sopenharmony_ci#define SLI_INTF_VALID_MASK			0xE0000000
10562306a36Sopenharmony_ci#define SLI_INTF_VALID				0xC0000000
10662306a36Sopenharmony_ci#define SLI_INTF_HINT2_MASK			0x1F000000
10762306a36Sopenharmony_ci#define SLI_INTF_HINT2_SHIFT			24
10862306a36Sopenharmony_ci#define SLI_INTF_HINT1_MASK			0x00FF0000
10962306a36Sopenharmony_ci#define SLI_INTF_HINT1_SHIFT			16
11062306a36Sopenharmony_ci#define SLI_INTF_FAMILY_MASK			0x00000F00
11162306a36Sopenharmony_ci#define SLI_INTF_FAMILY_SHIFT			8
11262306a36Sopenharmony_ci#define SLI_INTF_IF_TYPE_MASK			0x0000F000
11362306a36Sopenharmony_ci#define SLI_INTF_IF_TYPE_SHIFT			12
11462306a36Sopenharmony_ci#define SLI_INTF_REV_MASK			0x000000F0
11562306a36Sopenharmony_ci#define SLI_INTF_REV_SHIFT			4
11662306a36Sopenharmony_ci#define SLI_INTF_FT_MASK			0x00000001
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci#define SLI_INTF_TYPE_2		2
11962306a36Sopenharmony_ci#define SLI_INTF_TYPE_3		3
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci/********* ISR0 Register offset **********/
12262306a36Sopenharmony_ci#define CEV_ISR0_OFFSET 			0xC18
12362306a36Sopenharmony_ci#define CEV_ISR_SIZE				4
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci/********* Event Q door bell *************/
12662306a36Sopenharmony_ci#define DB_EQ_OFFSET			DB_CQ_OFFSET
12762306a36Sopenharmony_ci#define DB_EQ_RING_ID_MASK		0x1FF	/* bits 0 - 8 */
12862306a36Sopenharmony_ci#define DB_EQ_RING_ID_EXT_MASK		0x3e00  /* bits 9-13 */
12962306a36Sopenharmony_ci#define DB_EQ_RING_ID_EXT_MASK_SHIFT	(2) /* qid bits 9-13 placing at 11-15 */
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci/* Clear the interrupt for this eq */
13262306a36Sopenharmony_ci#define DB_EQ_CLR_SHIFT			(9)	/* bit 9 */
13362306a36Sopenharmony_ci/* Must be 1 */
13462306a36Sopenharmony_ci#define DB_EQ_EVNT_SHIFT		(10)	/* bit 10 */
13562306a36Sopenharmony_ci/* Number of event entries processed */
13662306a36Sopenharmony_ci#define DB_EQ_NUM_POPPED_SHIFT		(16)	/* bits 16 - 28 */
13762306a36Sopenharmony_ci/* Rearm bit */
13862306a36Sopenharmony_ci#define DB_EQ_REARM_SHIFT		(29)	/* bit 29 */
13962306a36Sopenharmony_ci/* Rearm to interrupt delay encoding */
14062306a36Sopenharmony_ci#define DB_EQ_R2I_DLY_SHIFT		(30)    /* bits 30 - 31 */
14162306a36Sopenharmony_ci
14262306a36Sopenharmony_ci/* Rearm to interrupt (R2I) delay multiplier encoding represents 3 different
14362306a36Sopenharmony_ci * values configured in CEV_REARM2IRPT_DLY_MULT_CSR register. This value is
14462306a36Sopenharmony_ci * programmed by host driver while ringing an EQ doorbell(EQ_DB) if a delay
14562306a36Sopenharmony_ci * between rearming the EQ and next interrupt on this EQ is desired.
14662306a36Sopenharmony_ci */
14762306a36Sopenharmony_ci#define	R2I_DLY_ENC_0			0	/* No delay */
14862306a36Sopenharmony_ci#define	R2I_DLY_ENC_1			1	/* maps to 160us EQ delay */
14962306a36Sopenharmony_ci#define	R2I_DLY_ENC_2			2	/* maps to 96us EQ delay */
15062306a36Sopenharmony_ci#define	R2I_DLY_ENC_3			3	/* maps to 48us EQ delay */
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci/********* Compl Q door bell *************/
15362306a36Sopenharmony_ci#define DB_CQ_OFFSET 			0x120
15462306a36Sopenharmony_ci#define DB_CQ_RING_ID_MASK		0x3FF	/* bits 0 - 9 */
15562306a36Sopenharmony_ci#define DB_CQ_RING_ID_EXT_MASK		0x7C00	/* bits 10-14 */
15662306a36Sopenharmony_ci#define DB_CQ_RING_ID_EXT_MASK_SHIFT	(1)	/* qid bits 10-14
15762306a36Sopenharmony_ci						 placing at 11-15 */
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ci/* Number of event entries processed */
16062306a36Sopenharmony_ci#define DB_CQ_NUM_POPPED_SHIFT		(16) 	/* bits 16 - 28 */
16162306a36Sopenharmony_ci/* Rearm bit */
16262306a36Sopenharmony_ci#define DB_CQ_REARM_SHIFT		(29) 	/* bit 29 */
16362306a36Sopenharmony_ci
16462306a36Sopenharmony_ci/********** TX ULP door bell *************/
16562306a36Sopenharmony_ci#define DB_TXULP1_OFFSET		0x60
16662306a36Sopenharmony_ci#define DB_TXULP_RING_ID_MASK		0x7FF	/* bits 0 - 10 */
16762306a36Sopenharmony_ci/* Number of tx entries posted */
16862306a36Sopenharmony_ci#define DB_TXULP_NUM_POSTED_SHIFT	(16)	/* bits 16 - 29 */
16962306a36Sopenharmony_ci#define DB_TXULP_NUM_POSTED_MASK	0x3FFF	/* bits 16 - 29 */
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci/********** RQ(erx) door bell ************/
17262306a36Sopenharmony_ci#define DB_RQ_OFFSET 			0x100
17362306a36Sopenharmony_ci#define DB_RQ_RING_ID_MASK		0x3FF	/* bits 0 - 9 */
17462306a36Sopenharmony_ci/* Number of rx frags posted */
17562306a36Sopenharmony_ci#define DB_RQ_NUM_POSTED_SHIFT		(24)	/* bits 24 - 31 */
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci/********** MCC door bell ************/
17862306a36Sopenharmony_ci#define DB_MCCQ_OFFSET 			0x140
17962306a36Sopenharmony_ci#define DB_MCCQ_RING_ID_MASK		0x7FF	/* bits 0 - 10 */
18062306a36Sopenharmony_ci/* Number of entries posted */
18162306a36Sopenharmony_ci#define DB_MCCQ_NUM_POSTED_SHIFT	(16)	/* bits 16 - 29 */
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci/********** SRIOV VF PCICFG OFFSET ********/
18462306a36Sopenharmony_ci#define SRIOV_VF_PCICFG_OFFSET		(4096)
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci/********** FAT TABLE  ********/
18762306a36Sopenharmony_ci#define RETRIEVE_FAT	0
18862306a36Sopenharmony_ci#define QUERY_FAT	1
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci/************* Rx Packet Type Encoding **************/
19162306a36Sopenharmony_ci#define BE_UNICAST_PACKET		0
19262306a36Sopenharmony_ci#define BE_MULTICAST_PACKET		1
19362306a36Sopenharmony_ci#define BE_BROADCAST_PACKET		2
19462306a36Sopenharmony_ci#define BE_RSVD_PACKET			3
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci/*
19762306a36Sopenharmony_ci * BE descriptors: host memory data structures whose formats
19862306a36Sopenharmony_ci * are hardwired in BE silicon.
19962306a36Sopenharmony_ci */
20062306a36Sopenharmony_ci/* Event Queue Descriptor */
20162306a36Sopenharmony_ci#define EQ_ENTRY_VALID_MASK 		0x1	/* bit 0 */
20262306a36Sopenharmony_ci#define EQ_ENTRY_RES_ID_MASK 		0xFFFF	/* bits 16 - 31 */
20362306a36Sopenharmony_ci#define EQ_ENTRY_RES_ID_SHIFT 		16
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_cistruct be_eq_entry {
20662306a36Sopenharmony_ci	u32 evt;
20762306a36Sopenharmony_ci};
20862306a36Sopenharmony_ci
20962306a36Sopenharmony_ci/* TX Queue Descriptor */
21062306a36Sopenharmony_ci#define ETH_WRB_FRAG_LEN_MASK		0xFFFF
21162306a36Sopenharmony_cistruct be_eth_wrb {
21262306a36Sopenharmony_ci	__le32 frag_pa_hi;		/* dword 0 */
21362306a36Sopenharmony_ci	__le32 frag_pa_lo;		/* dword 1 */
21462306a36Sopenharmony_ci	u32 rsvd0;			/* dword 2 */
21562306a36Sopenharmony_ci	__le32 frag_len;		/* dword 3: bits 0 - 15 */
21662306a36Sopenharmony_ci} __packed;
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_ci/* Pseudo amap definition for eth_hdr_wrb in which each bit of the
21962306a36Sopenharmony_ci * actual structure is defined as a byte : used to calculate
22062306a36Sopenharmony_ci * offset/shift/mask of each field */
22162306a36Sopenharmony_cistruct amap_eth_hdr_wrb {
22262306a36Sopenharmony_ci	u8 rsvd0[32];		/* dword 0 */
22362306a36Sopenharmony_ci	u8 rsvd1[32];		/* dword 1 */
22462306a36Sopenharmony_ci	u8 complete;		/* dword 2 */
22562306a36Sopenharmony_ci	u8 event;
22662306a36Sopenharmony_ci	u8 crc;
22762306a36Sopenharmony_ci	u8 forward;
22862306a36Sopenharmony_ci	u8 lso6;
22962306a36Sopenharmony_ci	u8 mgmt;
23062306a36Sopenharmony_ci	u8 ipcs;
23162306a36Sopenharmony_ci	u8 udpcs;
23262306a36Sopenharmony_ci	u8 tcpcs;
23362306a36Sopenharmony_ci	u8 lso;
23462306a36Sopenharmony_ci	u8 vlan;
23562306a36Sopenharmony_ci	u8 gso[2];
23662306a36Sopenharmony_ci	u8 num_wrb[5];
23762306a36Sopenharmony_ci	u8 lso_mss[14];
23862306a36Sopenharmony_ci	u8 len[16];		/* dword 3 */
23962306a36Sopenharmony_ci	u8 vlan_tag[16];
24062306a36Sopenharmony_ci} __packed;
24162306a36Sopenharmony_ci
24262306a36Sopenharmony_ci#define TX_HDR_WRB_COMPL		1		/* word 2 */
24362306a36Sopenharmony_ci#define TX_HDR_WRB_EVT			BIT(1)		/* word 2 */
24462306a36Sopenharmony_ci#define TX_HDR_WRB_NUM_SHIFT		13		/* word 2: bits 13:17 */
24562306a36Sopenharmony_ci#define TX_HDR_WRB_NUM_MASK		0x1F		/* word 2: bits 13:17 */
24662306a36Sopenharmony_ci
24762306a36Sopenharmony_cistruct be_eth_hdr_wrb {
24862306a36Sopenharmony_ci	__le32 dw[4];
24962306a36Sopenharmony_ci};
25062306a36Sopenharmony_ci
25162306a36Sopenharmony_ci/********* Tx Compl Status Encoding *********/
25262306a36Sopenharmony_ci#define BE_TX_COMP_HDR_PARSE_ERR	0x2
25362306a36Sopenharmony_ci#define BE_TX_COMP_NDMA_ERR		0x3
25462306a36Sopenharmony_ci#define BE_TX_COMP_ACL_ERR		0x5
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci#define LANCER_TX_COMP_LSO_ERR			0x1
25762306a36Sopenharmony_ci#define LANCER_TX_COMP_HSW_DROP_MAC_ERR		0x3
25862306a36Sopenharmony_ci#define LANCER_TX_COMP_HSW_DROP_VLAN_ERR	0x5
25962306a36Sopenharmony_ci#define LANCER_TX_COMP_QINQ_ERR			0x7
26062306a36Sopenharmony_ci#define LANCER_TX_COMP_SGE_ERR			0x9
26162306a36Sopenharmony_ci#define LANCER_TX_COMP_PARITY_ERR		0xb
26262306a36Sopenharmony_ci#define LANCER_TX_COMP_DMA_ERR			0xd
26362306a36Sopenharmony_ci
26462306a36Sopenharmony_ci/* TX Compl Queue Descriptor */
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci/* Pseudo amap definition for eth_tx_compl in which each bit of the
26762306a36Sopenharmony_ci * actual structure is defined as a byte: used to calculate
26862306a36Sopenharmony_ci * offset/shift/mask of each field */
26962306a36Sopenharmony_cistruct amap_eth_tx_compl {
27062306a36Sopenharmony_ci	u8 wrb_index[16];	/* dword 0 */
27162306a36Sopenharmony_ci	u8 ct[2]; 		/* dword 0 */
27262306a36Sopenharmony_ci	u8 port[2];		/* dword 0 */
27362306a36Sopenharmony_ci	u8 rsvd0[8];		/* dword 0 */
27462306a36Sopenharmony_ci	u8 status[4];		/* dword 0 */
27562306a36Sopenharmony_ci	u8 user_bytes[16];	/* dword 1 */
27662306a36Sopenharmony_ci	u8 nwh_bytes[8];	/* dword 1 */
27762306a36Sopenharmony_ci	u8 lso;			/* dword 1 */
27862306a36Sopenharmony_ci	u8 cast_enc[2];		/* dword 1 */
27962306a36Sopenharmony_ci	u8 rsvd1[5];		/* dword 1 */
28062306a36Sopenharmony_ci	u8 rsvd2[32];		/* dword 2 */
28162306a36Sopenharmony_ci	u8 pkts[16];		/* dword 3 */
28262306a36Sopenharmony_ci	u8 ringid[11];		/* dword 3 */
28362306a36Sopenharmony_ci	u8 hash_val[4];		/* dword 3 */
28462306a36Sopenharmony_ci	u8 valid;		/* dword 3 */
28562306a36Sopenharmony_ci} __packed;
28662306a36Sopenharmony_ci
28762306a36Sopenharmony_cistruct be_eth_tx_compl {
28862306a36Sopenharmony_ci	u32 dw[4];
28962306a36Sopenharmony_ci};
29062306a36Sopenharmony_ci
29162306a36Sopenharmony_ci/* RX Queue Descriptor */
29262306a36Sopenharmony_cistruct be_eth_rx_d {
29362306a36Sopenharmony_ci	u32 fragpa_hi;
29462306a36Sopenharmony_ci	u32 fragpa_lo;
29562306a36Sopenharmony_ci};
29662306a36Sopenharmony_ci
29762306a36Sopenharmony_ci/* RX Compl Queue Descriptor */
29862306a36Sopenharmony_ci
29962306a36Sopenharmony_ci/* Pseudo amap definition for BE2 and BE3 legacy mode eth_rx_compl in which
30062306a36Sopenharmony_ci * each bit of the actual structure is defined as a byte: used to calculate
30162306a36Sopenharmony_ci * offset/shift/mask of each field */
30262306a36Sopenharmony_cistruct amap_eth_rx_compl_v0 {
30362306a36Sopenharmony_ci	u8 vlan_tag[16];	/* dword 0 */
30462306a36Sopenharmony_ci	u8 pktsize[14];		/* dword 0 */
30562306a36Sopenharmony_ci	u8 port;		/* dword 0 */
30662306a36Sopenharmony_ci	u8 ip_opt;		/* dword 0 */
30762306a36Sopenharmony_ci	u8 err;			/* dword 1 */
30862306a36Sopenharmony_ci	u8 rsshp;		/* dword 1 */
30962306a36Sopenharmony_ci	u8 ipf;			/* dword 1 */
31062306a36Sopenharmony_ci	u8 tcpf;		/* dword 1 */
31162306a36Sopenharmony_ci	u8 udpf;		/* dword 1 */
31262306a36Sopenharmony_ci	u8 ipcksm;		/* dword 1 */
31362306a36Sopenharmony_ci	u8 l4_cksm;		/* dword 1 */
31462306a36Sopenharmony_ci	u8 ip_version;		/* dword 1 */
31562306a36Sopenharmony_ci	u8 macdst[6];		/* dword 1 */
31662306a36Sopenharmony_ci	u8 vtp;			/* dword 1 */
31762306a36Sopenharmony_ci	u8 ip_frag;		/* dword 1 */
31862306a36Sopenharmony_ci	u8 fragndx[10];		/* dword 1 */
31962306a36Sopenharmony_ci	u8 ct[2];		/* dword 1 */
32062306a36Sopenharmony_ci	u8 sw;			/* dword 1 */
32162306a36Sopenharmony_ci	u8 numfrags[3];		/* dword 1 */
32262306a36Sopenharmony_ci	u8 rss_flush;		/* dword 2 */
32362306a36Sopenharmony_ci	u8 cast_enc[2];		/* dword 2 */
32462306a36Sopenharmony_ci	u8 qnq;			/* dword 2 */
32562306a36Sopenharmony_ci	u8 rss_bank;		/* dword 2 */
32662306a36Sopenharmony_ci	u8 rsvd1[23];		/* dword 2 */
32762306a36Sopenharmony_ci	u8 lro_pkt;		/* dword 2 */
32862306a36Sopenharmony_ci	u8 rsvd2[2];		/* dword 2 */
32962306a36Sopenharmony_ci	u8 valid;		/* dword 2 */
33062306a36Sopenharmony_ci	u8 rsshash[32];		/* dword 3 */
33162306a36Sopenharmony_ci} __packed;
33262306a36Sopenharmony_ci
33362306a36Sopenharmony_ci/* Pseudo amap definition for BE3 native mode eth_rx_compl in which
33462306a36Sopenharmony_ci * each bit of the actual structure is defined as a byte: used to calculate
33562306a36Sopenharmony_ci * offset/shift/mask of each field */
33662306a36Sopenharmony_cistruct amap_eth_rx_compl_v1 {
33762306a36Sopenharmony_ci	u8 vlan_tag[16];	/* dword 0 */
33862306a36Sopenharmony_ci	u8 pktsize[14];		/* dword 0 */
33962306a36Sopenharmony_ci	u8 vtp;			/* dword 0 */
34062306a36Sopenharmony_ci	u8 ip_opt;		/* dword 0 */
34162306a36Sopenharmony_ci	u8 err;			/* dword 1 */
34262306a36Sopenharmony_ci	u8 rsshp;		/* dword 1 */
34362306a36Sopenharmony_ci	u8 ipf;			/* dword 1 */
34462306a36Sopenharmony_ci	u8 tcpf;		/* dword 1 */
34562306a36Sopenharmony_ci	u8 udpf;		/* dword 1 */
34662306a36Sopenharmony_ci	u8 ipcksm;		/* dword 1 */
34762306a36Sopenharmony_ci	u8 l4_cksm;		/* dword 1 */
34862306a36Sopenharmony_ci	u8 ip_version;		/* dword 1 */
34962306a36Sopenharmony_ci	u8 macdst[7];		/* dword 1 */
35062306a36Sopenharmony_ci	u8 rsvd0;		/* dword 1 */
35162306a36Sopenharmony_ci	u8 fragndx[10];		/* dword 1 */
35262306a36Sopenharmony_ci	u8 ct[2];		/* dword 1 */
35362306a36Sopenharmony_ci	u8 sw;			/* dword 1 */
35462306a36Sopenharmony_ci	u8 numfrags[3];		/* dword 1 */
35562306a36Sopenharmony_ci	u8 rss_flush;		/* dword 2 */
35662306a36Sopenharmony_ci	u8 cast_enc[2];		/* dword 2 */
35762306a36Sopenharmony_ci	u8 qnq;			/* dword 2 */
35862306a36Sopenharmony_ci	u8 rss_bank;		/* dword 2 */
35962306a36Sopenharmony_ci	u8 port[2];		/* dword 2 */
36062306a36Sopenharmony_ci	u8 vntagp;		/* dword 2 */
36162306a36Sopenharmony_ci	u8 header_len[8];	/* dword 2 */
36262306a36Sopenharmony_ci	u8 header_split[2];	/* dword 2 */
36362306a36Sopenharmony_ci	u8 rsvd1[12];		/* dword 2 */
36462306a36Sopenharmony_ci	u8 tunneled;
36562306a36Sopenharmony_ci	u8 valid;		/* dword 2 */
36662306a36Sopenharmony_ci	u8 rsshash[32];		/* dword 3 */
36762306a36Sopenharmony_ci} __packed;
36862306a36Sopenharmony_ci
36962306a36Sopenharmony_cistruct be_eth_rx_compl {
37062306a36Sopenharmony_ci	u32 dw[4];
37162306a36Sopenharmony_ci};
372