OMAPDSS: VENC: fix NULL pointer dereference in DSS2 VENC sysfs debug attr on OMAP4
[zen-stable.git] / drivers / net / ethernet / chelsio / cxgb3 / firmware_exports.h
blob0d9b0e6dccff41f58544345b0570cd762241b0c3
1 /*
2 * Copyright (c) 2004-2008 Chelsio, Inc. All rights reserved.
4 * This software is available to you under a choice of one of two
5 * licenses. You may choose to be licensed under the terms of the GNU
6 * General Public License (GPL) Version 2, available from the file
7 * COPYING in the main directory of this source tree, or the
8 * OpenIB.org BSD license below:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
12 * conditions are met:
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
16 * disclaimer.
18 * - Redistributions in binary form must reproduce the above
19 * copyright notice, this list of conditions and the following
20 * disclaimer in the documentation and/or other materials
21 * provided with the distribution.
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30 * SOFTWARE.
32 #ifndef _FIRMWARE_EXPORTS_H_
33 #define _FIRMWARE_EXPORTS_H_
35 /* WR OPCODES supported by the firmware.
37 #define FW_WROPCODE_FORWARD 0x01
38 #define FW_WROPCODE_BYPASS 0x05
40 #define FW_WROPCODE_TUNNEL_TX_PKT 0x03
42 #define FW_WROPOCDE_ULPTX_DATA_SGL 0x00
43 #define FW_WROPCODE_ULPTX_MEM_READ 0x02
44 #define FW_WROPCODE_ULPTX_PKT 0x04
45 #define FW_WROPCODE_ULPTX_INVALIDATE 0x06
47 #define FW_WROPCODE_TUNNEL_RX_PKT 0x07
49 #define FW_WROPCODE_OFLD_GETTCB_RPL 0x08
50 #define FW_WROPCODE_OFLD_CLOSE_CON 0x09
51 #define FW_WROPCODE_OFLD_TP_ABORT_CON_REQ 0x0A
52 #define FW_WROPCODE_OFLD_HOST_ABORT_CON_RPL 0x0F
53 #define FW_WROPCODE_OFLD_HOST_ABORT_CON_REQ 0x0B
54 #define FW_WROPCODE_OFLD_TP_ABORT_CON_RPL 0x0C
55 #define FW_WROPCODE_OFLD_TX_DATA 0x0D
56 #define FW_WROPCODE_OFLD_TX_DATA_ACK 0x0E
58 #define FW_WROPCODE_RI_RDMA_INIT 0x10
59 #define FW_WROPCODE_RI_RDMA_WRITE 0x11
60 #define FW_WROPCODE_RI_RDMA_READ_REQ 0x12
61 #define FW_WROPCODE_RI_RDMA_READ_RESP 0x13
62 #define FW_WROPCODE_RI_SEND 0x14
63 #define FW_WROPCODE_RI_TERMINATE 0x15
64 #define FW_WROPCODE_RI_RDMA_READ 0x16
65 #define FW_WROPCODE_RI_RECEIVE 0x17
66 #define FW_WROPCODE_RI_BIND_MW 0x18
67 #define FW_WROPCODE_RI_FASTREGISTER_MR 0x19
68 #define FW_WROPCODE_RI_LOCAL_INV 0x1A
69 #define FW_WROPCODE_RI_MODIFY_QP 0x1B
70 #define FW_WROPCODE_RI_BYPASS 0x1C
72 #define FW_WROPOCDE_RSVD 0x1E
74 #define FW_WROPCODE_SGE_EGRESSCONTEXT_RR 0x1F
76 #define FW_WROPCODE_MNGT 0x1D
77 #define FW_MNGTOPCODE_PKTSCHED_SET 0x00
79 /* Maximum size of a WR sent from the host, limited by the SGE.
81 * Note: WR coming from ULP or TP are only limited by CIM.
83 #define FW_WR_SIZE 128
85 /* Maximum number of outstanding WRs sent from the host. Value must be
86 * programmed in the CTRL/TUNNEL/QP SGE Egress Context and used by
87 * offload modules to limit the number of WRs per connection.
89 #define FW_T3_WR_NUM 16
90 #define FW_N3_WR_NUM 7
92 #ifndef N3
93 # define FW_WR_NUM FW_T3_WR_NUM
94 #else
95 # define FW_WR_NUM FW_N3_WR_NUM
96 #endif
98 /* FW_TUNNEL_NUM corresponds to the number of supported TUNNEL Queues. These
99 * queues must start at SGE Egress Context FW_TUNNEL_SGEEC_START and must
100 * start at 'TID' (or 'uP Token') FW_TUNNEL_TID_START.
102 * Ingress Traffic (e.g. DMA completion credit) for TUNNEL Queue[i] is sent
103 * to RESP Queue[i].
105 #define FW_TUNNEL_NUM 8
106 #define FW_TUNNEL_SGEEC_START 8
107 #define FW_TUNNEL_TID_START 65544
109 /* FW_CTRL_NUM corresponds to the number of supported CTRL Queues. These queues
110 * must start at SGE Egress Context FW_CTRL_SGEEC_START and must start at 'TID'
111 * (or 'uP Token') FW_CTRL_TID_START.
113 * Ingress Traffic for CTRL Queue[i] is sent to RESP Queue[i].
115 #define FW_CTRL_NUM 8
116 #define FW_CTRL_SGEEC_START 65528
117 #define FW_CTRL_TID_START 65536
119 /* FW_OFLD_NUM corresponds to the number of supported OFFLOAD Queues. These
120 * queues must start at SGE Egress Context FW_OFLD_SGEEC_START.
122 * Note: the 'uP Token' in the SGE Egress Context fields is irrelevant for
123 * OFFLOAD Queues, as the host is responsible for providing the correct TID in
124 * every WR.
126 * Ingress Trafffic for OFFLOAD Queue[i] is sent to RESP Queue[i].
128 #define FW_OFLD_NUM 8
129 #define FW_OFLD_SGEEC_START 0
134 #define FW_RI_NUM 1
135 #define FW_RI_SGEEC_START 65527
136 #define FW_RI_TID_START 65552
139 * The RX_PKT_TID
141 #define FW_RX_PKT_NUM 1
142 #define FW_RX_PKT_TID_START 65553
144 /* FW_WRC_NUM corresponds to the number of Work Request Context that supported
145 * by the firmware.
147 #define FW_WRC_NUM \
148 (65536 + FW_TUNNEL_NUM + FW_CTRL_NUM + FW_RI_NUM + FW_RX_PKT_NUM)
151 * FW type and version.
153 #define S_FW_VERSION_TYPE 28
154 #define M_FW_VERSION_TYPE 0xF
155 #define V_FW_VERSION_TYPE(x) ((x) << S_FW_VERSION_TYPE)
156 #define G_FW_VERSION_TYPE(x) \
157 (((x) >> S_FW_VERSION_TYPE) & M_FW_VERSION_TYPE)
159 #define S_FW_VERSION_MAJOR 16
160 #define M_FW_VERSION_MAJOR 0xFFF
161 #define V_FW_VERSION_MAJOR(x) ((x) << S_FW_VERSION_MAJOR)
162 #define G_FW_VERSION_MAJOR(x) \
163 (((x) >> S_FW_VERSION_MAJOR) & M_FW_VERSION_MAJOR)
165 #define S_FW_VERSION_MINOR 8
166 #define M_FW_VERSION_MINOR 0xFF
167 #define V_FW_VERSION_MINOR(x) ((x) << S_FW_VERSION_MINOR)
168 #define G_FW_VERSION_MINOR(x) \
169 (((x) >> S_FW_VERSION_MINOR) & M_FW_VERSION_MINOR)
171 #define S_FW_VERSION_MICRO 0
172 #define M_FW_VERSION_MICRO 0xFF
173 #define V_FW_VERSION_MICRO(x) ((x) << S_FW_VERSION_MICRO)
174 #define G_FW_VERSION_MICRO(x) \
175 (((x) >> S_FW_VERSION_MICRO) & M_FW_VERSION_MICRO)
177 #endif /* _FIRMWARE_EXPORTS_H_ */