- patches.rt/0001-sched-count-of-queued-RT-tasks.patch: Delete.
[linux-flexiantxendom0-3.2.10.git] / drivers / xen / sfc_netback / ci / efhw / common.h
1 /****************************************************************************
2  * Driver for Solarflare network controllers -
3  *          resource management for Xen backend, OpenOnload, etc
4  *           (including support for SFE4001 10GBT NIC)
5  *
6  * This file provides API of the efhw library which may be used both from
7  * the kernel and from the user-space code.
8  *
9  * Copyright 2005-2007: Solarflare Communications Inc,
10  *                      9501 Jeronimo Road, Suite 250,
11  *                      Irvine, CA 92618, USA
12  *
13  * Developed and maintained by Solarflare Communications:
14  *                      <linux-xen-drivers@solarflare.com>
15  *                      <onload-dev@solarflare.com>
16  *
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
22  *
23  *
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.
27  *
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.
32  *
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  ****************************************************************************
37  */
38
39 #ifndef __CI_EFHW_COMMON_H__
40 #define __CI_EFHW_COMMON_H__
41
42 #include <ci/efhw/common_sysdep.h>
43
44 enum efhw_arch {
45         EFHW_ARCH_FALCON,
46         EFHW_ARCH_SIENA,
47 };
48
49 typedef uint32_t efhw_buffer_addr_t;
50 #define EFHW_BUFFER_ADDR_FMT    "[ba:%"PRIx32"]"
51
52 /*! Comment? */
53 typedef union {
54         uint64_t u64;
55         struct {
56                 uint32_t a;
57                 uint32_t b;
58         } opaque;
59         struct {
60                 uint32_t code;
61                 uint32_t status;
62         } ev1002;
63 } efhw_event_t;
64
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
76                                            generation */
77 #define EFHW_VI_TX_TCPUDP_ONLY     0x400 /*! drop non-tcp/udp packets */
78
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)
91
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 */
96
97 #define EFHW_IP_FILTER_TYPE_MASK        (0xffff) /* Mask of types above */
98
99 #define EFHW_IP_FILTER_BROADCAST        (0x10000) /* driverlink filter
100                                                      support */
101
102 #endif /* __CI_EFHW_COMMON_H__ */