1dee1ad47SJeff Kirsher /******************************************************************************* 2dee1ad47SJeff Kirsher 3dee1ad47SJeff Kirsher Intel 82599 Virtual Function driver 4dec0d8e4SJeff Kirsher Copyright(c) 1999 - 2015 Intel Corporation. 5dee1ad47SJeff Kirsher 6dee1ad47SJeff Kirsher This program is free software; you can redistribute it and/or modify it 7dee1ad47SJeff Kirsher under the terms and conditions of the GNU General Public License, 8dee1ad47SJeff Kirsher version 2, as published by the Free Software Foundation. 9dee1ad47SJeff Kirsher 10dee1ad47SJeff Kirsher This program is distributed in the hope it will be useful, but WITHOUT 11dee1ad47SJeff Kirsher ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12dee1ad47SJeff Kirsher FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13dee1ad47SJeff Kirsher more details. 14dee1ad47SJeff Kirsher 15dee1ad47SJeff Kirsher You should have received a copy of the GNU General Public License along with 16dec0d8e4SJeff Kirsher this program; if not, see <http://www.gnu.org/licenses/>. 17dee1ad47SJeff Kirsher 18dee1ad47SJeff Kirsher The full GNU General Public License is included in this distribution in 19dee1ad47SJeff Kirsher the file called "COPYING". 20dee1ad47SJeff Kirsher 21dee1ad47SJeff Kirsher Contact Information: 22dee1ad47SJeff Kirsher e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> 23dee1ad47SJeff Kirsher Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 24dee1ad47SJeff Kirsher 25dee1ad47SJeff Kirsher *******************************************************************************/ 26dee1ad47SJeff Kirsher 27dee1ad47SJeff Kirsher #ifndef _IXGBEVF_DEFINES_H_ 28dee1ad47SJeff Kirsher #define _IXGBEVF_DEFINES_H_ 29dee1ad47SJeff Kirsher 30dee1ad47SJeff Kirsher /* Device IDs */ 31dee1ad47SJeff Kirsher #define IXGBE_DEV_ID_82599_VF 0x10ED 32dee1ad47SJeff Kirsher #define IXGBE_DEV_ID_X540_VF 0x1515 3347068b0dSEmil Tantilov #define IXGBE_DEV_ID_X550_VF 0x1565 3447068b0dSEmil Tantilov #define IXGBE_DEV_ID_X550EM_X_VF 0x15A8 35*1d94f987SDon Skidmore #define IXGBE_DEV_ID_X550EM_A_VF 0x15C5 36dee1ad47SJeff Kirsher 37b4363fbdSKY Srinivasan #define IXGBE_DEV_ID_82599_VF_HV 0x152E 38b4363fbdSKY Srinivasan #define IXGBE_DEV_ID_X540_VF_HV 0x1530 39b4363fbdSKY Srinivasan #define IXGBE_DEV_ID_X550_VF_HV 0x1564 40b4363fbdSKY Srinivasan #define IXGBE_DEV_ID_X550EM_X_VF_HV 0x15A9 41b4363fbdSKY Srinivasan 42dee1ad47SJeff Kirsher #define IXGBE_VF_IRQ_CLEAR_MASK 7 4356e94095SAlexander Duyck #define IXGBE_VF_MAX_TX_QUEUES 8 4456e94095SAlexander Duyck #define IXGBE_VF_MAX_RX_QUEUES 8 4556e94095SAlexander Duyck 4656e94095SAlexander Duyck /* DCB define */ 4756e94095SAlexander Duyck #define IXGBE_VF_MAX_TRAFFIC_CLASS 8 48dee1ad47SJeff Kirsher 49dee1ad47SJeff Kirsher /* Link speed */ 50dee1ad47SJeff Kirsher typedef u32 ixgbe_link_speed; 51dee1ad47SJeff Kirsher #define IXGBE_LINK_SPEED_1GB_FULL 0x0020 52dee1ad47SJeff Kirsher #define IXGBE_LINK_SPEED_10GB_FULL 0x0080 5331a1b375SGreg Rose #define IXGBE_LINK_SPEED_100_FULL 0x0008 54dee1ad47SJeff Kirsher 55dee1ad47SJeff Kirsher #define IXGBE_CTRL_RST 0x04000000 /* Reset (SW) */ 56dee1ad47SJeff Kirsher #define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */ 57dee1ad47SJeff Kirsher #define IXGBE_TXDCTL_ENABLE 0x02000000 /* Enable specific Tx Queue */ 58dee1ad47SJeff Kirsher #define IXGBE_LINKS_UP 0x40000000 59dee1ad47SJeff Kirsher #define IXGBE_LINKS_SPEED_82599 0x30000000 60dee1ad47SJeff Kirsher #define IXGBE_LINKS_SPEED_10G_82599 0x30000000 61dee1ad47SJeff Kirsher #define IXGBE_LINKS_SPEED_1G_82599 0x20000000 6231a1b375SGreg Rose #define IXGBE_LINKS_SPEED_100_82599 0x10000000 63dee1ad47SJeff Kirsher 64dee1ad47SJeff Kirsher /* Number of Transmit and Receive Descriptors must be a multiple of 8 */ 65dee1ad47SJeff Kirsher #define IXGBE_REQ_TX_DESCRIPTOR_MULTIPLE 8 66dee1ad47SJeff Kirsher #define IXGBE_REQ_RX_DESCRIPTOR_MULTIPLE 8 67dee1ad47SJeff Kirsher #define IXGBE_REQ_TX_BUFFER_GRANULARITY 1024 68dee1ad47SJeff Kirsher 69dee1ad47SJeff Kirsher /* Interrupt Vector Allocation Registers */ 70dee1ad47SJeff Kirsher #define IXGBE_IVAR_ALLOC_VAL 0x80 /* Interrupt Allocation valid */ 71dee1ad47SJeff Kirsher 72dee1ad47SJeff Kirsher #define IXGBE_VF_INIT_TIMEOUT 200 /* Number of retries to clear RSTI */ 73dee1ad47SJeff Kirsher 74dee1ad47SJeff Kirsher /* Receive Config masks */ 75dee1ad47SJeff Kirsher #define IXGBE_RXCTRL_RXEN 0x00000001 /* Enable Receiver */ 76dee1ad47SJeff Kirsher #define IXGBE_RXCTRL_DMBYPS 0x00000002 /* Descriptor Monitor Bypass */ 77dee1ad47SJeff Kirsher #define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */ 78dee1ad47SJeff Kirsher #define IXGBE_RXDCTL_VME 0x40000000 /* VLAN mode enable */ 79dee1ad47SJeff Kirsher #define IXGBE_RXDCTL_RLPMLMASK 0x00003FFF /* Only supported on the X540 */ 80dee1ad47SJeff Kirsher #define IXGBE_RXDCTL_RLPML_EN 0x00008000 81dee1ad47SJeff Kirsher 82dee1ad47SJeff Kirsher /* DCA Control */ 838d055cc0SJacob Keller #define IXGBE_DCA_TXCTRL_TX_WB_RO_EN BIT(11) /* Tx Desc writeback RO bit */ 84dee1ad47SJeff Kirsher 85dee1ad47SJeff Kirsher /* PSRTYPE bit definitions */ 86dee1ad47SJeff Kirsher #define IXGBE_PSRTYPE_TCPHDR 0x00000010 87dee1ad47SJeff Kirsher #define IXGBE_PSRTYPE_UDPHDR 0x00000020 88dee1ad47SJeff Kirsher #define IXGBE_PSRTYPE_IPV4HDR 0x00000100 89dee1ad47SJeff Kirsher #define IXGBE_PSRTYPE_IPV6HDR 0x00000200 90dee1ad47SJeff Kirsher #define IXGBE_PSRTYPE_L2HDR 0x00001000 91dee1ad47SJeff Kirsher 92dee1ad47SJeff Kirsher /* SRRCTL bit definitions */ 93dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_BSIZEPKT_SHIFT 10 /* so many KBs */ 94dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_RDMTS_SHIFT 22 95dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_RDMTS_MASK 0x01C00000 96dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DROP_EN 0x10000000 97dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_BSIZEPKT_MASK 0x0000007F 98dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_BSIZEHDR_MASK 0x00003F00 99dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DESCTYPE_LEGACY 0x00000000 100dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DESCTYPE_ADV_ONEBUF 0x02000000 101dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT 0x04000000 102dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DESCTYPE_HDR_REPLICATION_LARGE_PKT 0x08000000 103dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS 0x0A000000 104dee1ad47SJeff Kirsher #define IXGBE_SRRCTL_DESCTYPE_MASK 0x0E000000 105dee1ad47SJeff Kirsher 106dee1ad47SJeff Kirsher /* Receive Descriptor bit definitions */ 107dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_DD 0x01 /* Descriptor Done */ 108dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_EOP 0x02 /* End of Packet */ 109dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_FLM 0x04 /* FDir Match */ 110dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_VP 0x08 /* IEEE VLAN Packet */ 111dee1ad47SJeff Kirsher #define IXGBE_RXDADV_NEXTP_MASK 0x000FFFF0 /* Next Descriptor Index */ 112dee1ad47SJeff Kirsher #define IXGBE_RXDADV_NEXTP_SHIFT 0x00000004 113dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_UDPCS 0x10 /* UDP xsum calculated */ 114dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_L4CS 0x20 /* L4 xsum calculated */ 115dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_IPCS 0x40 /* IP xsum calculated */ 116dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_PIF 0x80 /* passed in-exact filter */ 117dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_CRCV 0x100 /* Speculative CRC Valid */ 118dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_VEXT 0x200 /* 1st VLAN found */ 119dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_UDPV 0x400 /* Valid UDP checksum */ 120dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_DYNINT 0x800 /* Pkt caused INT via DYNINT */ 121dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_TS 0x10000 /* Time Stamp */ 122dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_SECP 0x20000 /* Security Processing */ 123dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_LB 0x40000 /* Loopback Status */ 124dee1ad47SJeff Kirsher #define IXGBE_RXD_STAT_ACK 0x8000 /* ACK Packet indication */ 125dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_CE 0x01 /* CRC Error */ 126dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_LE 0x02 /* Length Error */ 127dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_PE 0x08 /* Packet Error */ 128dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_OSE 0x10 /* Oversize Error */ 129dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_USE 0x20 /* Undersize Error */ 130dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_TCPE 0x40 /* TCP/UDP Checksum Error */ 131dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_IPE 0x80 /* IP Checksum Error */ 132dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_MASK 0xFFF00000 /* RDESC.ERRORS mask */ 133dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_SHIFT 20 /* RDESC.ERRORS shift */ 134dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_HBO 0x00800000 /*Header Buffer Overflow */ 135dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_CE 0x01000000 /* CRC Error */ 136dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_LE 0x02000000 /* Length Error */ 137dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_PE 0x08000000 /* Packet Error */ 138dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_OSE 0x10000000 /* Oversize Error */ 139dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_USE 0x20000000 /* Undersize Error */ 140dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_TCPE 0x40000000 /* TCP/UDP Checksum Error */ 141dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_IPE 0x80000000 /* IP Checksum Error */ 142dee1ad47SJeff Kirsher #define IXGBE_RXD_VLAN_ID_MASK 0x0FFF /* VLAN ID is in lower 12 bits */ 143dee1ad47SJeff Kirsher #define IXGBE_RXD_PRI_MASK 0xE000 /* Priority is in upper 3 bits */ 144dee1ad47SJeff Kirsher #define IXGBE_RXD_PRI_SHIFT 13 145dee1ad47SJeff Kirsher #define IXGBE_RXD_CFI_MASK 0x1000 /* CFI is bit 12 */ 146dee1ad47SJeff Kirsher #define IXGBE_RXD_CFI_SHIFT 12 147dee1ad47SJeff Kirsher 148dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_DD IXGBE_RXD_STAT_DD /* Done */ 149dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_EOP IXGBE_RXD_STAT_EOP /* End of Packet */ 150dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FLM IXGBE_RXD_STAT_FLM /* FDir Match */ 151dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_VP IXGBE_RXD_STAT_VP /* IEEE VLAN Pkt */ 152dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_MASK 0x000FFFFF /* Stat/NEXTP: bit 0-19 */ 153dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FCEOFS 0x00000040 /* FCoE EOF/SOF Stat */ 154dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FCSTAT 0x00000030 /* FCoE Pkt Stat */ 155dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FCSTAT_NOMTCH 0x00000000 /* 00: No Ctxt Match */ 156dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FCSTAT_NODDP 0x00000010 /* 01: Ctxt w/o DDP */ 157dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FCSTAT_FCPRSP 0x00000020 /* 10: Recv. FCP_RSP */ 158dee1ad47SJeff Kirsher #define IXGBE_RXDADV_STAT_FCSTAT_DDP 0x00000030 /* 11: Ctxt w/ DDP */ 159dee1ad47SJeff Kirsher 160dee1ad47SJeff Kirsher #define IXGBE_RXDADV_RSSTYPE_MASK 0x0000000F 161dee1ad47SJeff Kirsher #define IXGBE_RXDADV_PKTTYPE_MASK 0x0000FFF0 162dee1ad47SJeff Kirsher #define IXGBE_RXDADV_PKTTYPE_MASK_EX 0x0001FFF0 163dee1ad47SJeff Kirsher #define IXGBE_RXDADV_HDRBUFLEN_MASK 0x00007FE0 164dee1ad47SJeff Kirsher #define IXGBE_RXDADV_RSCCNT_MASK 0x001E0000 165dee1ad47SJeff Kirsher #define IXGBE_RXDADV_RSCCNT_SHIFT 17 166dee1ad47SJeff Kirsher #define IXGBE_RXDADV_HDRBUFLEN_SHIFT 5 167dee1ad47SJeff Kirsher #define IXGBE_RXDADV_SPLITHEADER_EN 0x00001000 168dee1ad47SJeff Kirsher #define IXGBE_RXDADV_SPH 0x8000 169dee1ad47SJeff Kirsher 1701e1429d6SFan Du /* RSS Hash results */ 1711e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_NONE 0x00000000 1721e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV4_TCP 0x00000001 1731e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV4 0x00000002 1741e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV6_TCP 0x00000003 1751e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV6_EX 0x00000004 1761e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV6 0x00000005 1771e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV6_TCP_EX 0x00000006 1781e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV4_UDP 0x00000007 1791e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV6_UDP 0x00000008 1801e1429d6SFan Du #define IXGBE_RXDADV_RSSTYPE_IPV6_UDP_EX 0x00000009 1811e1429d6SFan Du 182dee1ad47SJeff Kirsher #define IXGBE_RXD_ERR_FRAME_ERR_MASK ( \ 183dee1ad47SJeff Kirsher IXGBE_RXD_ERR_CE | \ 184dee1ad47SJeff Kirsher IXGBE_RXD_ERR_LE | \ 185dee1ad47SJeff Kirsher IXGBE_RXD_ERR_PE | \ 186dee1ad47SJeff Kirsher IXGBE_RXD_ERR_OSE | \ 187dee1ad47SJeff Kirsher IXGBE_RXD_ERR_USE) 188dee1ad47SJeff Kirsher 189dee1ad47SJeff Kirsher #define IXGBE_RXDADV_ERR_FRAME_ERR_MASK ( \ 190dee1ad47SJeff Kirsher IXGBE_RXDADV_ERR_CE | \ 191dee1ad47SJeff Kirsher IXGBE_RXDADV_ERR_LE | \ 192dee1ad47SJeff Kirsher IXGBE_RXDADV_ERR_PE | \ 193dee1ad47SJeff Kirsher IXGBE_RXDADV_ERR_OSE | \ 194dee1ad47SJeff Kirsher IXGBE_RXDADV_ERR_USE) 195dee1ad47SJeff Kirsher 196dee1ad47SJeff Kirsher #define IXGBE_TXD_POPTS_IXSM 0x01 /* Insert IP checksum */ 197dee1ad47SJeff Kirsher #define IXGBE_TXD_POPTS_TXSM 0x02 /* Insert TCP/UDP checksum */ 198dee1ad47SJeff Kirsher #define IXGBE_TXD_CMD_EOP 0x01000000 /* End of Packet */ 199dee1ad47SJeff Kirsher #define IXGBE_TXD_CMD_IFCS 0x02000000 /* Insert FCS (Ethernet CRC) */ 200dee1ad47SJeff Kirsher #define IXGBE_TXD_CMD_IC 0x04000000 /* Insert Checksum */ 201dee1ad47SJeff Kirsher #define IXGBE_TXD_CMD_RS 0x08000000 /* Report Status */ 202dec0d8e4SJeff Kirsher #define IXGBE_TXD_CMD_DEXT 0x20000000 /* Descriptor ext (0 = legacy) */ 203dee1ad47SJeff Kirsher #define IXGBE_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */ 204dee1ad47SJeff Kirsher #define IXGBE_TXD_STAT_DD 0x00000001 /* Descriptor Done */ 20529d37fa1SEmil Tantilov #define IXGBE_TXD_CMD (IXGBE_TXD_CMD_EOP | IXGBE_TXD_CMD_RS) 206dee1ad47SJeff Kirsher 207dee1ad47SJeff Kirsher /* Transmit Descriptor - Advanced */ 208dee1ad47SJeff Kirsher union ixgbe_adv_tx_desc { 209dee1ad47SJeff Kirsher struct { 210dee1ad47SJeff Kirsher __le64 buffer_addr; /* Address of descriptor's data buf */ 211dee1ad47SJeff Kirsher __le32 cmd_type_len; 212dee1ad47SJeff Kirsher __le32 olinfo_status; 213dee1ad47SJeff Kirsher } read; 214dee1ad47SJeff Kirsher struct { 215dee1ad47SJeff Kirsher __le64 rsvd; /* Reserved */ 216dee1ad47SJeff Kirsher __le32 nxtseq_seed; 217dee1ad47SJeff Kirsher __le32 status; 218dee1ad47SJeff Kirsher } wb; 219dee1ad47SJeff Kirsher }; 220dee1ad47SJeff Kirsher 221dee1ad47SJeff Kirsher /* Receive Descriptor - Advanced */ 222dee1ad47SJeff Kirsher union ixgbe_adv_rx_desc { 223dee1ad47SJeff Kirsher struct { 224dee1ad47SJeff Kirsher __le64 pkt_addr; /* Packet buffer address */ 225dee1ad47SJeff Kirsher __le64 hdr_addr; /* Header buffer address */ 226dee1ad47SJeff Kirsher } read; 227dee1ad47SJeff Kirsher struct { 228dee1ad47SJeff Kirsher struct { 229dee1ad47SJeff Kirsher union { 230dee1ad47SJeff Kirsher __le32 data; 231dee1ad47SJeff Kirsher struct { 232dee1ad47SJeff Kirsher __le16 pkt_info; /* RSS, Pkt type */ 233dee1ad47SJeff Kirsher __le16 hdr_info; /* Splithdr, hdrlen */ 234dee1ad47SJeff Kirsher } hs_rss; 235dee1ad47SJeff Kirsher } lo_dword; 236dee1ad47SJeff Kirsher union { 237dee1ad47SJeff Kirsher __le32 rss; /* RSS Hash */ 238dee1ad47SJeff Kirsher struct { 239dee1ad47SJeff Kirsher __le16 ip_id; /* IP id */ 240dee1ad47SJeff Kirsher __le16 csum; /* Packet Checksum */ 241dee1ad47SJeff Kirsher } csum_ip; 242dee1ad47SJeff Kirsher } hi_dword; 243dee1ad47SJeff Kirsher } lower; 244dee1ad47SJeff Kirsher struct { 245dee1ad47SJeff Kirsher __le32 status_error; /* ext status/error */ 246dee1ad47SJeff Kirsher __le16 length; /* Packet length */ 247dee1ad47SJeff Kirsher __le16 vlan; /* VLAN tag */ 248dee1ad47SJeff Kirsher } upper; 249dee1ad47SJeff Kirsher } wb; /* writeback */ 250dee1ad47SJeff Kirsher }; 251dee1ad47SJeff Kirsher 252dee1ad47SJeff Kirsher /* Context descriptors */ 253dee1ad47SJeff Kirsher struct ixgbe_adv_tx_context_desc { 254dee1ad47SJeff Kirsher __le32 vlan_macip_lens; 255dee1ad47SJeff Kirsher __le32 seqnum_seed; 256dee1ad47SJeff Kirsher __le32 type_tucmd_mlhl; 257dee1ad47SJeff Kirsher __le32 mss_l4len_idx; 258dee1ad47SJeff Kirsher }; 259dee1ad47SJeff Kirsher 260dee1ad47SJeff Kirsher /* Adv Transmit Descriptor Config Masks */ 261dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DTYP_MASK 0x00F00000 /* DTYP mask */ 262dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Desc */ 263dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */ 264dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DCMD_EOP IXGBE_TXD_CMD_EOP /* End of Packet */ 265dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DCMD_IFCS IXGBE_TXD_CMD_IFCS /* Insert FCS */ 266dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DCMD_RS IXGBE_TXD_CMD_RS /* Report Status */ 267dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DCMD_DEXT IXGBE_TXD_CMD_DEXT /* Desc ext (1=Adv) */ 268dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DCMD_VLE IXGBE_TXD_CMD_VLE /* VLAN pkt enable */ 269dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_DCMD_TSE 0x80000000 /* TCP Seg enable */ 270dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_STAT_DD IXGBE_TXD_STAT_DD /* Descriptor Done */ 271dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */ 272dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */ 273dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */ 274dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */ 275dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 Packet TYPE of SCTP */ 276dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_IDX_SHIFT 4 /* Adv desc Index shift */ 27770a10e25SAlexander Duyck #define IXGBE_ADVTXD_CC 0x00000080 /* Check Context */ 278dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_POPTS_SHIFT 8 /* Adv desc POPTS shift */ 279dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_POPTS_IXSM (IXGBE_TXD_POPTS_IXSM << \ 280dee1ad47SJeff Kirsher IXGBE_ADVTXD_POPTS_SHIFT) 281dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_POPTS_TXSM (IXGBE_TXD_POPTS_TXSM << \ 282dee1ad47SJeff Kirsher IXGBE_ADVTXD_POPTS_SHIFT) 283dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */ 284dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ 285dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */ 286dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ 287dee1ad47SJeff Kirsher #define IXGBE_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ 288dee1ad47SJeff Kirsher 289dee1ad47SJeff Kirsher /* Interrupt register bitmasks */ 290dee1ad47SJeff Kirsher 291dee1ad47SJeff Kirsher #define IXGBE_EITR_CNT_WDIS 0x80000000 2925f3600ebSAlexander Duyck #define IXGBE_MAX_EITR 0x00000FF8 2935f3600ebSAlexander Duyck #define IXGBE_MIN_EITR 8 294dee1ad47SJeff Kirsher 295dee1ad47SJeff Kirsher /* Error Codes */ 296dee1ad47SJeff Kirsher #define IXGBE_ERR_INVALID_MAC_ADDR -1 297dee1ad47SJeff Kirsher #define IXGBE_ERR_RESET_FAILED -2 29831186785SAlexander Duyck #define IXGBE_ERR_INVALID_ARGUMENT -3 299dee1ad47SJeff Kirsher 300de02decbSDon Skidmore /* Transmit Config masks */ 301de02decbSDon Skidmore #define IXGBE_TXDCTL_ENABLE 0x02000000 /* Ena specific Tx Queue */ 302de02decbSDon Skidmore #define IXGBE_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. wr-bk flushing */ 303de02decbSDon Skidmore #define IXGBE_TXDCTL_WTHRESH_SHIFT 16 /* shift to WTHRESH bits */ 304de02decbSDon Skidmore 3058d055cc0SJacob Keller #define IXGBE_DCA_RXCTRL_DESC_DCA_EN BIT(5) /* Rx Desc enable */ 3068d055cc0SJacob Keller #define IXGBE_DCA_RXCTRL_HEAD_DCA_EN BIT(6) /* Rx Desc header ena */ 3078d055cc0SJacob Keller #define IXGBE_DCA_RXCTRL_DATA_DCA_EN BIT(7) /* Rx Desc payload ena */ 3088d055cc0SJacob Keller #define IXGBE_DCA_RXCTRL_DESC_RRO_EN BIT(9) /* Rx rd Desc Relax Order */ 3098d055cc0SJacob Keller #define IXGBE_DCA_RXCTRL_DATA_WRO_EN BIT(13) /* Rx wr data Relax Order */ 3108d055cc0SJacob Keller #define IXGBE_DCA_RXCTRL_HEAD_WRO_EN BIT(15) /* Rx wr header RO */ 311de02decbSDon Skidmore 3128d055cc0SJacob Keller #define IXGBE_DCA_TXCTRL_DESC_DCA_EN BIT(5) /* DCA Tx Desc enable */ 3138d055cc0SJacob Keller #define IXGBE_DCA_TXCTRL_DESC_RRO_EN BIT(9) /* Tx rd Desc Relax Order */ 3148d055cc0SJacob Keller #define IXGBE_DCA_TXCTRL_DESC_WRO_EN BIT(11) /* Tx Desc writeback RO bit */ 3158d055cc0SJacob Keller #define IXGBE_DCA_TXCTRL_DATA_RRO_EN BIT(13) /* Tx rd data Relax Order */ 316de02decbSDon Skidmore 317dee1ad47SJeff Kirsher #endif /* _IXGBEVF_DEFINES_H_ */ 318