blob: e8740e3704e495eedbdb4726bc0f48bff72b06ff [file] [log] [blame]
Scott Feldman01f2e4e2008-09-15 09:17:11 -07001/*
Vasanthy Kolluri29046f92010-06-24 10:52:26 +00002 * Copyright 2008-2010 Cisco Systems, Inc. All rights reserved.
Scott Feldman01f2e4e2008-09-15 09:17:11 -07003 * Copyright 2007 Nuova Systems, Inc. All rights reserved.
4 *
5 * This program is free software; you may redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
10 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
12 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
13 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
14 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
15 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16 * SOFTWARE.
17 *
18 */
19
20#ifndef _VNIC_ENIC_H_
21#define _VNIC_ENIC_H_
22
Scott Feldman7c844592009-12-23 13:27:54 +000023/* Hardware intr coalesce timer is in units of 1.5us */
24#define INTR_COALESCE_USEC_TO_HW(usec) ((usec) * 2/3)
25#define INTR_COALESCE_HW_TO_USEC(usec) ((usec) * 3/2)
26
Scott Feldman01f2e4e2008-09-15 09:17:11 -070027/* Device-specific region: enet configuration */
28struct vnic_enet_config {
29 u32 flags;
30 u32 wq_desc_count;
31 u32 rq_desc_count;
32 u16 mtu;
Roopa Prabhu1f76da52010-08-10 18:55:26 +000033 u16 intr_timer_deprecated;
Scott Feldman01f2e4e2008-09-15 09:17:11 -070034 u8 intr_timer_type;
35 u8 intr_mode;
36 char devname[16];
Scott Feldman7c844592009-12-23 13:27:54 +000037 u32 intr_timer_usec;
Vasanthy Kolluri1825aca2010-06-24 10:51:59 +000038 u16 loop_tag;
Scott Feldman01f2e4e2008-09-15 09:17:11 -070039};
40
41#define VENETF_TSO 0x1 /* TSO enabled */
42#define VENETF_LRO 0x2 /* LRO enabled */
43#define VENETF_RXCSUM 0x4 /* RX csum enabled */
44#define VENETF_TXCSUM 0x8 /* TX csum enabled */
45#define VENETF_RSS 0x10 /* RSS enabled */
46#define VENETF_RSSHASH_IPV4 0x20 /* Hash on IPv4 fields */
47#define VENETF_RSSHASH_TCPIPV4 0x40 /* Hash on TCP + IPv4 fields */
48#define VENETF_RSSHASH_IPV6 0x80 /* Hash on IPv6 fields */
49#define VENETF_RSSHASH_TCPIPV6 0x100 /* Hash on TCP + IPv6 fields */
50#define VENETF_RSSHASH_IPV6_EX 0x200 /* Hash on IPv6 extended fields */
51#define VENETF_RSSHASH_TCPIPV6_EX 0x400 /* Hash on TCP + IPv6 ext. fields */
Vasanthy Kolluri1825aca2010-06-24 10:51:59 +000052#define VENETF_LOOP 0x800 /* Loopback enabled */
Scott Feldman01f2e4e2008-09-15 09:17:11 -070053
54#endif /* _VNIC_ENIC_H_ */