1*6e9ef509SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 29aebddd1SJeff Kirsher /* 377b696cbSSriharsha Basavapatna * Copyright (C) 2005-2016 Broadcom. 49aebddd1SJeff Kirsher * All rights reserved. 59aebddd1SJeff Kirsher * 69aebddd1SJeff Kirsher * Contact Information: 79aebddd1SJeff Kirsher * linux-drivers@emulex.com 89aebddd1SJeff Kirsher * 99aebddd1SJeff Kirsher * Emulex 109aebddd1SJeff Kirsher * 3333 Susan Street 119aebddd1SJeff Kirsher * Costa Mesa, CA 92626 129aebddd1SJeff Kirsher */ 139aebddd1SJeff Kirsher 149aebddd1SJeff Kirsher /********* Mailbox door bell *************/ 159aebddd1SJeff Kirsher /* Used for driver communication with the FW. 169aebddd1SJeff Kirsher * The software must write this register twice to post any command. First, 179aebddd1SJeff Kirsher * it writes the register with hi=1 and the upper bits of the physical address 189aebddd1SJeff Kirsher * for the MAILBOX structure. Software must poll the ready bit until this 199aebddd1SJeff Kirsher * is acknowledged. Then, sotware writes the register with hi=0 with the lower 209aebddd1SJeff Kirsher * bits in the address. It must poll the ready bit until the command is 219aebddd1SJeff Kirsher * complete. Upon completion, the MAILBOX will contain a valid completion 229aebddd1SJeff Kirsher * queue entry. 239aebddd1SJeff Kirsher */ 249aebddd1SJeff Kirsher #define MPU_MAILBOX_DB_OFFSET 0x160 259aebddd1SJeff Kirsher #define MPU_MAILBOX_DB_RDY_MASK 0x1 /* bit 0 */ 269aebddd1SJeff Kirsher #define MPU_MAILBOX_DB_HI_MASK 0x2 /* bit 1 */ 279aebddd1SJeff Kirsher 289aebddd1SJeff Kirsher #define MPU_EP_CONTROL 0 299aebddd1SJeff Kirsher 301bc8e7e4SSathya Perla /********** MPU semphore: used for SH & BE *************/ 31710f3e59SSriharsha Basavapatna #define SLIPORT_SOFTRESET_OFFSET 0x5c /* CSR BAR offset */ 32c5b3ad4cSSathya Perla #define SLIPORT_SEMAPHORE_OFFSET_BEx 0xac /* CSR BAR offset */ 33c5b3ad4cSSathya Perla #define SLIPORT_SEMAPHORE_OFFSET_SH 0x94 /* PCI-CFG offset */ 341bc8e7e4SSathya Perla #define POST_STAGE_MASK 0x0000FFFF 351bc8e7e4SSathya Perla #define POST_ERR_MASK 0x1 361bc8e7e4SSathya Perla #define POST_ERR_SHIFT 31 37710f3e59SSriharsha Basavapatna #define POST_ERR_RECOVERY_CODE_MASK 0xFFF 38710f3e59SSriharsha Basavapatna 39710f3e59SSriharsha Basavapatna /* Soft Reset register masks */ 40710f3e59SSriharsha Basavapatna #define SLIPORT_SOFTRESET_SR_MASK 0x00000080 /* SR bit */ 419aebddd1SJeff Kirsher 429aebddd1SJeff Kirsher /* MPU semphore POST stage values */ 439aebddd1SJeff Kirsher #define POST_STAGE_AWAITING_HOST_RDY 0x1 /* FW awaiting goahead from host */ 449aebddd1SJeff Kirsher #define POST_STAGE_HOST_RDY 0x2 /* Host has given go-ahed to FW */ 459aebddd1SJeff Kirsher #define POST_STAGE_BE_RESET 0x3 /* Host wants to reset chip */ 469aebddd1SJeff Kirsher #define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */ 47710f3e59SSriharsha Basavapatna #define POST_STAGE_RECOVERABLE_ERR 0xE000 /* Recoverable err detected */ 48673c96e5SSuresh Reddy /* FW has detected a UE and is dumping FAT log data */ 49673c96e5SSuresh Reddy #define POST_STAGE_FAT_LOG_START 0x0D00 50673c96e5SSuresh Reddy #define POST_STAGE_ARMFW_UE 0xF000 /*FW has asserted an UE*/ 519aebddd1SJeff Kirsher 52f67ef7baSPadmanabh Ratnakar /* Lancer SLIPORT registers */ 539aebddd1SJeff Kirsher #define SLIPORT_STATUS_OFFSET 0x404 549aebddd1SJeff Kirsher #define SLIPORT_CONTROL_OFFSET 0x408 55e1cfb67aSPadmanabh Ratnakar #define SLIPORT_ERROR1_OFFSET 0x40C 56e1cfb67aSPadmanabh Ratnakar #define SLIPORT_ERROR2_OFFSET 0x410 57f67ef7baSPadmanabh Ratnakar #define PHYSDEV_CONTROL_OFFSET 0x414 589aebddd1SJeff Kirsher 599aebddd1SJeff Kirsher #define SLIPORT_STATUS_ERR_MASK 0x80000000 605c510811SSomnath Kotur #define SLIPORT_STATUS_DIP_MASK 0x02000000 619aebddd1SJeff Kirsher #define SLIPORT_STATUS_RN_MASK 0x01000000 629aebddd1SJeff Kirsher #define SLIPORT_STATUS_RDY_MASK 0x00800000 639aebddd1SJeff Kirsher #define SLI_PORT_CONTROL_IP_MASK 0x08000000 64f67ef7baSPadmanabh Ratnakar #define PHYSDEV_CONTROL_FW_RESET_MASK 0x00000002 655c510811SSomnath Kotur #define PHYSDEV_CONTROL_DD_MASK 0x00000004 66f67ef7baSPadmanabh Ratnakar #define PHYSDEV_CONTROL_INP_MASK 0x40000000 679aebddd1SJeff Kirsher 6867297ad8SPadmanabh Ratnakar #define SLIPORT_ERROR_NO_RESOURCE1 0x2 6967297ad8SPadmanabh Ratnakar #define SLIPORT_ERROR_NO_RESOURCE2 0x9 7067297ad8SPadmanabh Ratnakar 714bebb56aSSomnath Kotur #define SLIPORT_ERROR_FW_RESET1 0x2 724bebb56aSSomnath Kotur #define SLIPORT_ERROR_FW_RESET2 0x0 734bebb56aSSomnath Kotur 749aebddd1SJeff Kirsher /********* Memory BAR register ************/ 759aebddd1SJeff Kirsher #define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc 769aebddd1SJeff Kirsher /* Host Interrupt Enable, if set interrupts are enabled although "PCI Interrupt 779aebddd1SJeff Kirsher * Disable" may still globally block interrupts in addition to individual 789aebddd1SJeff Kirsher * interrupt masks; a mechanism for the device driver to block all interrupts 799aebddd1SJeff Kirsher * atomically without having to arbitrate for the PCI Interrupt Disable bit 809aebddd1SJeff Kirsher * with the OS. 819aebddd1SJeff Kirsher */ 8283b06116SVasundhara Volam #define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK BIT(29) /* bit 29 */ 839aebddd1SJeff Kirsher 8494d73aaaSVasundhara Volam /********* PCI Function Capability *********/ 8594d73aaaSVasundhara Volam #define BE_FUNCTION_CAPS_RSS 0x2 8694d73aaaSVasundhara Volam #define BE_FUNCTION_CAPS_SUPER_NIC 0x40 8794d73aaaSVasundhara Volam 889aebddd1SJeff Kirsher /********* Power management (WOL) **********/ 899aebddd1SJeff Kirsher #define PCICFG_PM_CONTROL_OFFSET 0x44 909aebddd1SJeff Kirsher #define PCICFG_PM_CONTROL_MASK 0x108 /* bits 3 & 8 */ 919aebddd1SJeff Kirsher 929aebddd1SJeff Kirsher /********* Online Control Registers *******/ 939aebddd1SJeff Kirsher #define PCICFG_ONLINE0 0xB0 949aebddd1SJeff Kirsher #define PCICFG_ONLINE1 0xB4 959aebddd1SJeff Kirsher 969aebddd1SJeff Kirsher /********* UE Status and Mask Registers ***/ 979aebddd1SJeff Kirsher #define PCICFG_UE_STATUS_LOW 0xA0 989aebddd1SJeff Kirsher #define PCICFG_UE_STATUS_HIGH 0xA4 999aebddd1SJeff Kirsher #define PCICFG_UE_STATUS_LOW_MASK 0xA8 1009aebddd1SJeff Kirsher #define PCICFG_UE_STATUS_HI_MASK 0xAC 1019aebddd1SJeff Kirsher 1029aebddd1SJeff Kirsher /******** SLI_INTF ***********************/ 1039aebddd1SJeff Kirsher #define SLI_INTF_REG_OFFSET 0x58 1049aebddd1SJeff Kirsher #define SLI_INTF_VALID_MASK 0xE0000000 1059aebddd1SJeff Kirsher #define SLI_INTF_VALID 0xC0000000 1069aebddd1SJeff Kirsher #define SLI_INTF_HINT2_MASK 0x1F000000 1079aebddd1SJeff Kirsher #define SLI_INTF_HINT2_SHIFT 24 1089aebddd1SJeff Kirsher #define SLI_INTF_HINT1_MASK 0x00FF0000 1099aebddd1SJeff Kirsher #define SLI_INTF_HINT1_SHIFT 16 1109aebddd1SJeff Kirsher #define SLI_INTF_FAMILY_MASK 0x00000F00 1119aebddd1SJeff Kirsher #define SLI_INTF_FAMILY_SHIFT 8 1129aebddd1SJeff Kirsher #define SLI_INTF_IF_TYPE_MASK 0x0000F000 1139aebddd1SJeff Kirsher #define SLI_INTF_IF_TYPE_SHIFT 12 1149aebddd1SJeff Kirsher #define SLI_INTF_REV_MASK 0x000000F0 1159aebddd1SJeff Kirsher #define SLI_INTF_REV_SHIFT 4 1169aebddd1SJeff Kirsher #define SLI_INTF_FT_MASK 0x00000001 1179aebddd1SJeff Kirsher 118045508a8SParav Pandit #define SLI_INTF_TYPE_2 2 119045508a8SParav Pandit #define SLI_INTF_TYPE_3 3 1209aebddd1SJeff Kirsher 1219aebddd1SJeff Kirsher /********* ISR0 Register offset **********/ 1229aebddd1SJeff Kirsher #define CEV_ISR0_OFFSET 0xC18 1239aebddd1SJeff Kirsher #define CEV_ISR_SIZE 4 1249aebddd1SJeff Kirsher 1259aebddd1SJeff Kirsher /********* Event Q door bell *************/ 1269aebddd1SJeff Kirsher #define DB_EQ_OFFSET DB_CQ_OFFSET 1279aebddd1SJeff Kirsher #define DB_EQ_RING_ID_MASK 0x1FF /* bits 0 - 8 */ 1289aebddd1SJeff Kirsher #define DB_EQ_RING_ID_EXT_MASK 0x3e00 /* bits 9-13 */ 1299aebddd1SJeff Kirsher #define DB_EQ_RING_ID_EXT_MASK_SHIFT (2) /* qid bits 9-13 placing at 11-15 */ 1309aebddd1SJeff Kirsher 1319aebddd1SJeff Kirsher /* Clear the interrupt for this eq */ 1329aebddd1SJeff Kirsher #define DB_EQ_CLR_SHIFT (9) /* bit 9 */ 1339aebddd1SJeff Kirsher /* Must be 1 */ 1349aebddd1SJeff Kirsher #define DB_EQ_EVNT_SHIFT (10) /* bit 10 */ 1359aebddd1SJeff Kirsher /* Number of event entries processed */ 1369aebddd1SJeff Kirsher #define DB_EQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */ 1379aebddd1SJeff Kirsher /* Rearm bit */ 1389aebddd1SJeff Kirsher #define DB_EQ_REARM_SHIFT (29) /* bit 29 */ 13920947770SPadmanabh Ratnakar /* Rearm to interrupt delay encoding */ 14020947770SPadmanabh Ratnakar #define DB_EQ_R2I_DLY_SHIFT (30) /* bits 30 - 31 */ 14120947770SPadmanabh Ratnakar 14220947770SPadmanabh Ratnakar /* Rearm to interrupt (R2I) delay multiplier encoding represents 3 different 14320947770SPadmanabh Ratnakar * values configured in CEV_REARM2IRPT_DLY_MULT_CSR register. This value is 14420947770SPadmanabh Ratnakar * programmed by host driver while ringing an EQ doorbell(EQ_DB) if a delay 14520947770SPadmanabh Ratnakar * between rearming the EQ and next interrupt on this EQ is desired. 14620947770SPadmanabh Ratnakar */ 14720947770SPadmanabh Ratnakar #define R2I_DLY_ENC_0 0 /* No delay */ 14820947770SPadmanabh Ratnakar #define R2I_DLY_ENC_1 1 /* maps to 160us EQ delay */ 14920947770SPadmanabh Ratnakar #define R2I_DLY_ENC_2 2 /* maps to 96us EQ delay */ 15020947770SPadmanabh Ratnakar #define R2I_DLY_ENC_3 3 /* maps to 48us EQ delay */ 1519aebddd1SJeff Kirsher 1529aebddd1SJeff Kirsher /********* Compl Q door bell *************/ 1539aebddd1SJeff Kirsher #define DB_CQ_OFFSET 0x120 1549aebddd1SJeff Kirsher #define DB_CQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */ 1559aebddd1SJeff Kirsher #define DB_CQ_RING_ID_EXT_MASK 0x7C00 /* bits 10-14 */ 1569aebddd1SJeff Kirsher #define DB_CQ_RING_ID_EXT_MASK_SHIFT (1) /* qid bits 10-14 1579aebddd1SJeff Kirsher placing at 11-15 */ 1589aebddd1SJeff Kirsher 1599aebddd1SJeff Kirsher /* Number of event entries processed */ 1609aebddd1SJeff Kirsher #define DB_CQ_NUM_POPPED_SHIFT (16) /* bits 16 - 28 */ 1619aebddd1SJeff Kirsher /* Rearm bit */ 1629aebddd1SJeff Kirsher #define DB_CQ_REARM_SHIFT (29) /* bit 29 */ 1639aebddd1SJeff Kirsher 1649aebddd1SJeff Kirsher /********** TX ULP door bell *************/ 1659aebddd1SJeff Kirsher #define DB_TXULP1_OFFSET 0x60 1669aebddd1SJeff Kirsher #define DB_TXULP_RING_ID_MASK 0x7FF /* bits 0 - 10 */ 1679aebddd1SJeff Kirsher /* Number of tx entries posted */ 1689aebddd1SJeff Kirsher #define DB_TXULP_NUM_POSTED_SHIFT (16) /* bits 16 - 29 */ 1699aebddd1SJeff Kirsher #define DB_TXULP_NUM_POSTED_MASK 0x3FFF /* bits 16 - 29 */ 1709aebddd1SJeff Kirsher 1719aebddd1SJeff Kirsher /********** RQ(erx) door bell ************/ 1729aebddd1SJeff Kirsher #define DB_RQ_OFFSET 0x100 1739aebddd1SJeff Kirsher #define DB_RQ_RING_ID_MASK 0x3FF /* bits 0 - 9 */ 1749aebddd1SJeff Kirsher /* Number of rx frags posted */ 1759aebddd1SJeff Kirsher #define DB_RQ_NUM_POSTED_SHIFT (24) /* bits 24 - 31 */ 1769aebddd1SJeff Kirsher 1779aebddd1SJeff Kirsher /********** MCC door bell ************/ 1789aebddd1SJeff Kirsher #define DB_MCCQ_OFFSET 0x140 1799aebddd1SJeff Kirsher #define DB_MCCQ_RING_ID_MASK 0x7FF /* bits 0 - 10 */ 1809aebddd1SJeff Kirsher /* Number of entries posted */ 1819aebddd1SJeff Kirsher #define DB_MCCQ_NUM_POSTED_SHIFT (16) /* bits 16 - 29 */ 1829aebddd1SJeff Kirsher 1839aebddd1SJeff Kirsher /********** SRIOV VF PCICFG OFFSET ********/ 1849aebddd1SJeff Kirsher #define SRIOV_VF_PCICFG_OFFSET (4096) 1859aebddd1SJeff Kirsher 1869aebddd1SJeff Kirsher /********** FAT TABLE ********/ 1879aebddd1SJeff Kirsher #define RETRIEVE_FAT 0 1889aebddd1SJeff Kirsher #define QUERY_FAT 1 1899aebddd1SJeff Kirsher 1909aebddd1SJeff Kirsher /************* Rx Packet Type Encoding **************/ 1919aebddd1SJeff Kirsher #define BE_UNICAST_PACKET 0 1929aebddd1SJeff Kirsher #define BE_MULTICAST_PACKET 1 1939aebddd1SJeff Kirsher #define BE_BROADCAST_PACKET 2 1949aebddd1SJeff Kirsher #define BE_RSVD_PACKET 3 1959aebddd1SJeff Kirsher 1969aebddd1SJeff Kirsher /* 1979aebddd1SJeff Kirsher * BE descriptors: host memory data structures whose formats 1989aebddd1SJeff Kirsher * are hardwired in BE silicon. 1999aebddd1SJeff Kirsher */ 2009aebddd1SJeff Kirsher /* Event Queue Descriptor */ 2019aebddd1SJeff Kirsher #define EQ_ENTRY_VALID_MASK 0x1 /* bit 0 */ 2029aebddd1SJeff Kirsher #define EQ_ENTRY_RES_ID_MASK 0xFFFF /* bits 16 - 31 */ 2039aebddd1SJeff Kirsher #define EQ_ENTRY_RES_ID_SHIFT 16 2049aebddd1SJeff Kirsher 2059aebddd1SJeff Kirsher struct be_eq_entry { 2069aebddd1SJeff Kirsher u32 evt; 2079aebddd1SJeff Kirsher }; 2089aebddd1SJeff Kirsher 2099aebddd1SJeff Kirsher /* TX Queue Descriptor */ 2109aebddd1SJeff Kirsher #define ETH_WRB_FRAG_LEN_MASK 0xFFFF 2119aebddd1SJeff Kirsher struct be_eth_wrb { 212f986afcbSSathya Perla __le32 frag_pa_hi; /* dword 0 */ 213f986afcbSSathya Perla __le32 frag_pa_lo; /* dword 1 */ 2149aebddd1SJeff Kirsher u32 rsvd0; /* dword 2 */ 215f986afcbSSathya Perla __le32 frag_len; /* dword 3: bits 0 - 15 */ 2169aebddd1SJeff Kirsher } __packed; 2179aebddd1SJeff Kirsher 2189aebddd1SJeff Kirsher /* Pseudo amap definition for eth_hdr_wrb in which each bit of the 2199aebddd1SJeff Kirsher * actual structure is defined as a byte : used to calculate 2209aebddd1SJeff Kirsher * offset/shift/mask of each field */ 2219aebddd1SJeff Kirsher struct amap_eth_hdr_wrb { 2229aebddd1SJeff Kirsher u8 rsvd0[32]; /* dword 0 */ 2239aebddd1SJeff Kirsher u8 rsvd1[32]; /* dword 1 */ 2249aebddd1SJeff Kirsher u8 complete; /* dword 2 */ 2259aebddd1SJeff Kirsher u8 event; 2269aebddd1SJeff Kirsher u8 crc; 2279aebddd1SJeff Kirsher u8 forward; 2289aebddd1SJeff Kirsher u8 lso6; 2299aebddd1SJeff Kirsher u8 mgmt; 2309aebddd1SJeff Kirsher u8 ipcs; 2319aebddd1SJeff Kirsher u8 udpcs; 2329aebddd1SJeff Kirsher u8 tcpcs; 2339aebddd1SJeff Kirsher u8 lso; 2349aebddd1SJeff Kirsher u8 vlan; 2359aebddd1SJeff Kirsher u8 gso[2]; 2369aebddd1SJeff Kirsher u8 num_wrb[5]; 2379aebddd1SJeff Kirsher u8 lso_mss[14]; 2389aebddd1SJeff Kirsher u8 len[16]; /* dword 3 */ 2399aebddd1SJeff Kirsher u8 vlan_tag[16]; 2409aebddd1SJeff Kirsher } __packed; 2419aebddd1SJeff Kirsher 2425f07b3c5SSathya Perla #define TX_HDR_WRB_COMPL 1 /* word 2 */ 24383b06116SVasundhara Volam #define TX_HDR_WRB_EVT BIT(1) /* word 2 */ 2445f07b3c5SSathya Perla #define TX_HDR_WRB_NUM_SHIFT 13 /* word 2: bits 13:17 */ 2455f07b3c5SSathya Perla #define TX_HDR_WRB_NUM_MASK 0x1F /* word 2: bits 13:17 */ 2465f07b3c5SSathya Perla 2479aebddd1SJeff Kirsher struct be_eth_hdr_wrb { 248f986afcbSSathya Perla __le32 dw[4]; 2499aebddd1SJeff Kirsher }; 2509aebddd1SJeff Kirsher 251512bb8a2SKalesh AP /********* Tx Compl Status Encoding *********/ 252512bb8a2SKalesh AP #define BE_TX_COMP_HDR_PARSE_ERR 0x2 253512bb8a2SKalesh AP #define BE_TX_COMP_NDMA_ERR 0x3 254512bb8a2SKalesh AP #define BE_TX_COMP_ACL_ERR 0x5 255512bb8a2SKalesh AP 256512bb8a2SKalesh AP #define LANCER_TX_COMP_LSO_ERR 0x1 257512bb8a2SKalesh AP #define LANCER_TX_COMP_HSW_DROP_MAC_ERR 0x3 258512bb8a2SKalesh AP #define LANCER_TX_COMP_HSW_DROP_VLAN_ERR 0x5 259512bb8a2SKalesh AP #define LANCER_TX_COMP_QINQ_ERR 0x7 260ffc39620SSuresh Reddy #define LANCER_TX_COMP_SGE_ERR 0x9 261512bb8a2SKalesh AP #define LANCER_TX_COMP_PARITY_ERR 0xb 262512bb8a2SKalesh AP #define LANCER_TX_COMP_DMA_ERR 0xd 263512bb8a2SKalesh AP 2649aebddd1SJeff Kirsher /* TX Compl Queue Descriptor */ 2659aebddd1SJeff Kirsher 2669aebddd1SJeff Kirsher /* Pseudo amap definition for eth_tx_compl in which each bit of the 2679aebddd1SJeff Kirsher * actual structure is defined as a byte: used to calculate 2689aebddd1SJeff Kirsher * offset/shift/mask of each field */ 2699aebddd1SJeff Kirsher struct amap_eth_tx_compl { 2709aebddd1SJeff Kirsher u8 wrb_index[16]; /* dword 0 */ 2719aebddd1SJeff Kirsher u8 ct[2]; /* dword 0 */ 2729aebddd1SJeff Kirsher u8 port[2]; /* dword 0 */ 2739aebddd1SJeff Kirsher u8 rsvd0[8]; /* dword 0 */ 2749aebddd1SJeff Kirsher u8 status[4]; /* dword 0 */ 2759aebddd1SJeff Kirsher u8 user_bytes[16]; /* dword 1 */ 2769aebddd1SJeff Kirsher u8 nwh_bytes[8]; /* dword 1 */ 2779aebddd1SJeff Kirsher u8 lso; /* dword 1 */ 2789aebddd1SJeff Kirsher u8 cast_enc[2]; /* dword 1 */ 2799aebddd1SJeff Kirsher u8 rsvd1[5]; /* dword 1 */ 2809aebddd1SJeff Kirsher u8 rsvd2[32]; /* dword 2 */ 2819aebddd1SJeff Kirsher u8 pkts[16]; /* dword 3 */ 2829aebddd1SJeff Kirsher u8 ringid[11]; /* dword 3 */ 2839aebddd1SJeff Kirsher u8 hash_val[4]; /* dword 3 */ 2849aebddd1SJeff Kirsher u8 valid; /* dword 3 */ 2859aebddd1SJeff Kirsher } __packed; 2869aebddd1SJeff Kirsher 2879aebddd1SJeff Kirsher struct be_eth_tx_compl { 2889aebddd1SJeff Kirsher u32 dw[4]; 2899aebddd1SJeff Kirsher }; 2909aebddd1SJeff Kirsher 2919aebddd1SJeff Kirsher /* RX Queue Descriptor */ 2929aebddd1SJeff Kirsher struct be_eth_rx_d { 2939aebddd1SJeff Kirsher u32 fragpa_hi; 2949aebddd1SJeff Kirsher u32 fragpa_lo; 2959aebddd1SJeff Kirsher }; 2969aebddd1SJeff Kirsher 2979aebddd1SJeff Kirsher /* RX Compl Queue Descriptor */ 2989aebddd1SJeff Kirsher 2999aebddd1SJeff Kirsher /* Pseudo amap definition for BE2 and BE3 legacy mode eth_rx_compl in which 3009aebddd1SJeff Kirsher * each bit of the actual structure is defined as a byte: used to calculate 3019aebddd1SJeff Kirsher * offset/shift/mask of each field */ 3029aebddd1SJeff Kirsher struct amap_eth_rx_compl_v0 { 3039aebddd1SJeff Kirsher u8 vlan_tag[16]; /* dword 0 */ 3049aebddd1SJeff Kirsher u8 pktsize[14]; /* dword 0 */ 3059aebddd1SJeff Kirsher u8 port; /* dword 0 */ 3069aebddd1SJeff Kirsher u8 ip_opt; /* dword 0 */ 3079aebddd1SJeff Kirsher u8 err; /* dword 1 */ 3089aebddd1SJeff Kirsher u8 rsshp; /* dword 1 */ 3099aebddd1SJeff Kirsher u8 ipf; /* dword 1 */ 3109aebddd1SJeff Kirsher u8 tcpf; /* dword 1 */ 3119aebddd1SJeff Kirsher u8 udpf; /* dword 1 */ 3129aebddd1SJeff Kirsher u8 ipcksm; /* dword 1 */ 3139aebddd1SJeff Kirsher u8 l4_cksm; /* dword 1 */ 3149aebddd1SJeff Kirsher u8 ip_version; /* dword 1 */ 3159aebddd1SJeff Kirsher u8 macdst[6]; /* dword 1 */ 3169aebddd1SJeff Kirsher u8 vtp; /* dword 1 */ 317e38b1706SSomnath Kotur u8 ip_frag; /* dword 1 */ 3189aebddd1SJeff Kirsher u8 fragndx[10]; /* dword 1 */ 3199aebddd1SJeff Kirsher u8 ct[2]; /* dword 1 */ 3209aebddd1SJeff Kirsher u8 sw; /* dword 1 */ 3219aebddd1SJeff Kirsher u8 numfrags[3]; /* dword 1 */ 3229aebddd1SJeff Kirsher u8 rss_flush; /* dword 2 */ 3239aebddd1SJeff Kirsher u8 cast_enc[2]; /* dword 2 */ 324f93f160bSVasundhara Volam u8 qnq; /* dword 2 */ 3259aebddd1SJeff Kirsher u8 rss_bank; /* dword 2 */ 3269aebddd1SJeff Kirsher u8 rsvd1[23]; /* dword 2 */ 3279aebddd1SJeff Kirsher u8 lro_pkt; /* dword 2 */ 3289aebddd1SJeff Kirsher u8 rsvd2[2]; /* dword 2 */ 3299aebddd1SJeff Kirsher u8 valid; /* dword 2 */ 3309aebddd1SJeff Kirsher u8 rsshash[32]; /* dword 3 */ 3319aebddd1SJeff Kirsher } __packed; 3329aebddd1SJeff Kirsher 3339aebddd1SJeff Kirsher /* Pseudo amap definition for BE3 native mode eth_rx_compl in which 3349aebddd1SJeff Kirsher * each bit of the actual structure is defined as a byte: used to calculate 3359aebddd1SJeff Kirsher * offset/shift/mask of each field */ 3369aebddd1SJeff Kirsher struct amap_eth_rx_compl_v1 { 3379aebddd1SJeff Kirsher u8 vlan_tag[16]; /* dword 0 */ 3389aebddd1SJeff Kirsher u8 pktsize[14]; /* dword 0 */ 3399aebddd1SJeff Kirsher u8 vtp; /* dword 0 */ 3409aebddd1SJeff Kirsher u8 ip_opt; /* dword 0 */ 3419aebddd1SJeff Kirsher u8 err; /* dword 1 */ 3429aebddd1SJeff Kirsher u8 rsshp; /* dword 1 */ 3439aebddd1SJeff Kirsher u8 ipf; /* dword 1 */ 3449aebddd1SJeff Kirsher u8 tcpf; /* dword 1 */ 3459aebddd1SJeff Kirsher u8 udpf; /* dword 1 */ 3469aebddd1SJeff Kirsher u8 ipcksm; /* dword 1 */ 3479aebddd1SJeff Kirsher u8 l4_cksm; /* dword 1 */ 3489aebddd1SJeff Kirsher u8 ip_version; /* dword 1 */ 3499aebddd1SJeff Kirsher u8 macdst[7]; /* dword 1 */ 3509aebddd1SJeff Kirsher u8 rsvd0; /* dword 1 */ 3519aebddd1SJeff Kirsher u8 fragndx[10]; /* dword 1 */ 3529aebddd1SJeff Kirsher u8 ct[2]; /* dword 1 */ 3539aebddd1SJeff Kirsher u8 sw; /* dword 1 */ 3549aebddd1SJeff Kirsher u8 numfrags[3]; /* dword 1 */ 3559aebddd1SJeff Kirsher u8 rss_flush; /* dword 2 */ 3569aebddd1SJeff Kirsher u8 cast_enc[2]; /* dword 2 */ 357f93f160bSVasundhara Volam u8 qnq; /* dword 2 */ 3589aebddd1SJeff Kirsher u8 rss_bank; /* dword 2 */ 3599aebddd1SJeff Kirsher u8 port[2]; /* dword 2 */ 3609aebddd1SJeff Kirsher u8 vntagp; /* dword 2 */ 3619aebddd1SJeff Kirsher u8 header_len[8]; /* dword 2 */ 3629aebddd1SJeff Kirsher u8 header_split[2]; /* dword 2 */ 363c9c47142SSathya Perla u8 rsvd1[12]; /* dword 2 */ 364c9c47142SSathya Perla u8 tunneled; 3659aebddd1SJeff Kirsher u8 valid; /* dword 2 */ 3669aebddd1SJeff Kirsher u8 rsshash[32]; /* dword 3 */ 3679aebddd1SJeff Kirsher } __packed; 3689aebddd1SJeff Kirsher 3699aebddd1SJeff Kirsher struct be_eth_rx_compl { 3709aebddd1SJeff Kirsher u32 dw[4]; 3719aebddd1SJeff Kirsher }; 372