1 /****************************************************************************
2 * Driver for Solarflare network controllers -
3 * resource management for Xen backend, OpenOnload, etc
4 * (including support for SFE4001 10GBT NIC)
6 * This file provides API of the efhw library which may be used both from
7 * the kernel and from the user-space code.
9 * Copyright 2005-2007: Solarflare Communications Inc,
10 * 9501 Jeronimo Road, Suite 250,
11 * Irvine, CA 92618, USA
13 * Developed and maintained by Solarflare Communications:
14 * <linux-xen-drivers@solarflare.com>
15 * <onload-dev@solarflare.com>
17 * Certain parts of the driver were implemented by
18 * Alexandra Kossovsky <Alexandra.Kossovsky@oktetlabs.ru>
19 * OKTET Labs Ltd, Russia,
20 * http://oktetlabs.ru, <info@oktetlabs.ru>
21 * by request of Solarflare Communications
24 * This program is free software; you can redistribute it and/or modify it
25 * under the terms of the GNU General Public License version 2 as published
26 * by the Free Software Foundation, incorporated herein by reference.
28 * This program is distributed in the hope that it will be useful,
29 * but WITHOUT ANY WARRANTY; without even the implied warranty of
30 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 * GNU General Public License for more details.
33 * You should have received a copy of the GNU General Public License
34 * along with this program; if not, write to the Free Software
35 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
36 ****************************************************************************
39 #ifndef __CI_EFHW_COMMON_H__
40 #define __CI_EFHW_COMMON_H__
42 #include <ci/efhw/common_sysdep.h>
49 typedef uint32_t efhw_buffer_addr_t;
50 #define EFHW_BUFFER_ADDR_FMT "[ba:%"PRIx32"]"
65 /* Flags for TX/RX queues */
66 #define EFHW_VI_JUMBO_EN 0x01 /*! scatter RX over multiple desc */
67 #define EFHW_VI_ISCSI_RX_HDIG_EN 0x02 /*! iscsi rx header digest */
68 #define EFHW_VI_ISCSI_TX_HDIG_EN 0x04 /*! iscsi tx header digest */
69 #define EFHW_VI_ISCSI_RX_DDIG_EN 0x08 /*! iscsi rx data digest */
70 #define EFHW_VI_ISCSI_TX_DDIG_EN 0x10 /*! iscsi tx data digest */
71 #define EFHW_VI_TX_PHYS_ADDR_EN 0x20 /*! TX physical address mode */
72 #define EFHW_VI_RX_PHYS_ADDR_EN 0x40 /*! RX physical address mode */
73 #define EFHW_VI_RM_WITH_INTERRUPT 0x80 /*! VI with an interrupt */
74 #define EFHW_VI_TX_IP_CSUM_DIS 0x100 /*! enable ip checksum generation */
75 #define EFHW_VI_TX_TCPUDP_CSUM_DIS 0x200 /*! enable tcp/udp checksum
77 #define EFHW_VI_TX_TCPUDP_ONLY 0x400 /*! drop non-tcp/udp packets */
79 /* Types of hardware filter */
80 /* Each of these values implicitly selects scatter filters on B0 - or in
81 EFHW_IP_FILTER_TYPE_NOSCAT_B0_MASK if a non-scatter filter is required */
82 #define EFHW_IP_FILTER_TYPE_UDP_WILDCARD (0) /* dest host only */
83 #define EFHW_IP_FILTER_TYPE_UDP_FULL (1) /* dest host and port */
84 #define EFHW_IP_FILTER_TYPE_TCP_WILDCARD (2) /* dest based filter */
85 #define EFHW_IP_FILTER_TYPE_TCP_FULL (3) /* src filter */
86 /* Same again, but with RSS (for B0 only) */
87 #define EFHW_IP_FILTER_TYPE_UDP_WILDCARD_RSS_B0 (4)
88 #define EFHW_IP_FILTER_TYPE_UDP_FULL_RSS_B0 (5)
89 #define EFHW_IP_FILTER_TYPE_TCP_WILDCARD_RSS_B0 (6)
90 #define EFHW_IP_FILTER_TYPE_TCP_FULL_RSS_B0 (7)
92 #define EFHW_IP_FILTER_TYPE_FULL_MASK (0x1) /* Mask for full / wildcard */
93 #define EFHW_IP_FILTER_TYPE_TCP_MASK (0x2) /* Mask for TCP type */
94 #define EFHW_IP_FILTER_TYPE_RSS_B0_MASK (0x4) /* Mask for B0 RSS enable */
95 #define EFHW_IP_FILTER_TYPE_NOSCAT_B0_MASK (0x8) /* Mask for B0 SCATTER dsbl */
97 #define EFHW_IP_FILTER_TYPE_MASK (0xffff) /* Mask of types above */
99 #define EFHW_IP_FILTER_BROADCAST (0x10000) /* driverlink filter
102 #endif /* __CI_EFHW_COMMON_H__ */