2 * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved.
3 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
5 * Copyright (c) 2014, Cisco Systems, Inc.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
38 /* Hardware intr coalesce timer is in units of 1.5us */
39 #define INTR_COALESCE_USEC_TO_HW(usec) ((usec) * 2 / 3)
40 #define INTR_COALESCE_HW_TO_USEC(usec) ((usec) * 3 / 2)
42 /* Device-specific region: enet configuration */
43 struct vnic_enet_config {
48 u16 intr_timer_deprecated;
65 #define VENETF_TSO 0x1 /* TSO enabled */
66 #define VENETF_LRO 0x2 /* LRO enabled */
67 #define VENETF_RXCSUM 0x4 /* RX csum enabled */
68 #define VENETF_TXCSUM 0x8 /* TX csum enabled */
69 #define VENETF_RSS 0x10 /* RSS enabled */
70 #define VENETF_RSSHASH_IPV4 0x20 /* Hash on IPv4 fields */
71 #define VENETF_RSSHASH_TCPIPV4 0x40 /* Hash on TCP + IPv4 fields */
72 #define VENETF_RSSHASH_IPV6 0x80 /* Hash on IPv6 fields */
73 #define VENETF_RSSHASH_TCPIPV6 0x100 /* Hash on TCP + IPv6 fields */
74 #define VENETF_RSSHASH_IPV6_EX 0x200 /* Hash on IPv6 extended fields */
75 #define VENETF_RSSHASH_TCPIPV6_EX 0x400 /* Hash on TCP + IPv6 ext. fields */
76 #define VENETF_LOOP 0x800 /* Loopback enabled */
77 #define VENETF_FAILOVER 0x1000 /* Fabric failover enabled */
78 #define VENETF_USPACE_NIC 0x2000 /* vHPC enabled */
79 #define VENETF_VMQ 0x4000 /* VMQ enabled */
80 #define VENETF_ARFS 0x8000 /* ARFS enabled */
81 #define VENETF_VXLAN 0x10000 /* VxLAN offload */
82 #define VENETF_NVGRE 0x20000 /* NVGRE offload */
83 #define VENETF_GRPINTR 0x40000 /* group interrupt */
85 #define VENET_INTR_TYPE_MIN 0 /* Timer specs min interrupt spacing */
86 #define VENET_INTR_TYPE_IDLE 1 /* Timer specs idle time before irq */
88 #define VENET_INTR_MODE_ANY 0 /* Try MSI-X, then MSI, then INTx */
89 #define VENET_INTR_MODE_MSI 1 /* Try MSI then INTx */
90 #define VENET_INTR_MODE_INTX 2 /* Try INTx only */
92 #endif /* _VNIC_ENIC_H_ */