2 * Copyright(c) 2002-2011 Exar Corp.
5 * Redistribution and use in source and binary forms, with or without
6 * modification are permitted provided the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the Exar Corporation nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 #ifndef VXGE_HAL_DOOR_BELLS_H
34 #define VXGE_HAL_DOOR_BELLS_H
39 * struct __hal_non_offload_db_wrapper_t - Non-offload Doorbell Wrapper
40 * @control_0: Bits 0 to 7 - Doorbell type.
41 * Bits 8 to 31 - Reserved.
42 * Bits 32 to 39 - The highest TxD in this TxDL.
43 * Bits 40 to 47 - Reserved.
44 * Bits 48 to 55 - Reserved.
45 * Bits 56 to 63 - No snoop flags.
46 * @txdl_ptr: The starting location of the TxDL in host memory.
48 * Created by the host and written to the adapter via PIO to a Kernel Doorbell
49 * FIFO. All non-offload doorbell wrapper fields must be written by the host as
50 * part of a doorbell write. Consumed by the adapter but is not written by the
53 typedef __vxge_os_attr_cacheline_aligned struct __hal_non_offload_db_wrapper_t {
55 #define VXGE_HAL_NODBW_GET_TYPE(ctrl0) bVAL8(ctrl0, 0)
56 #define VXGE_HAL_NODBW_TYPE(val) vBIT(val, 0, 8)
57 #define VXGE_HAL_NODBW_TYPE_NODBW 0
59 #define VXGE_HAL_NODBW_GET_LAST_TXD_NUMBER(ctrl0) bVAL8(ctrl0, 32)
60 #define VXGE_HAL_NODBW_LAST_TXD_NUMBER(val) vBIT(val, 32, 8)
62 #define VXGE_HAL_NODBW_GET_NO_SNOOP(ctrl0) bVAL8(ctrl0, 56)
63 #define VXGE_HAL_NODBW_LIST_NO_SNOOP(val) vBIT(val, 56, 8)
64 #define VXGE_HAL_NODBW_LIST_NO_SNOOP_TXD_READ_TXD0_WRITE 0x2
65 #define VXGE_HAL_NODBW_LIST_NO_SNOOP_TX_FRAME_DATA_READ 0x1
68 } __hal_non_offload_db_wrapper_t;
71 * struct __hal_offload_db_wrapper_t - Tx-Offload Doorbell Wrapper
72 * @control_0: Bits 0 to 7 - Doorbell type.
73 * Bits 8 to 31 - Identifies the session to which this Tx
74 * offload doorbell applies.
75 * Bits 32 to 40 - Identifies the incarnation of this Session
76 * Number. The adapter assigns a Session Instance
77 * Number of 0 to a session when that Session Number
78 * is first used. Each subsequent assignment of that
79 * Session Number from the free pool causes this
80 * number to be incremented, with wrap eventually
81 * occurring from 255 back to 0.
82 * Bits 40 to 63 - Identifies the end of the TOWI list for
83 * this session to the adapter.
84 * @control_1: Bits 0 to 7 - Identifies what is included in this doorbell
85 * Bits 8 to 15 - The number of Immediate data bytes included in
87 * Bits 16 to 63 - Reserved.
89 * Created by the host and written to the adapter via PIO to a Kernel Doorbell
90 * FIFO. All Tx Offload doorbell wrapper fields must be written by the host as
91 * part of a doorbell write. Consumed by the adapter but is never written by the
94 typedef __vxge_os_attr_cacheline_aligned struct __hal_offload_db_wrapper_t {
96 #define VXGE_HAL_ODBW_GET_TYPE(ctrl0) bVAL8(ctrl0, 0)
97 #define VXGE_HAL_ODBW_TYPE(val) vBIT(val, 0, 8)
98 #define VXGE_HAL_ODBW_TYPE_ODBW 1
100 #define VXGE_HAL_ODBW_GET_SESSION_NUMBER(ctrl0) bVAL24(ctrl0, 8)
101 #define VXGE_HAL_ODBW_SESSION_NUMBER(val) vBIT(val, 8, 24)
103 #define VXGE_HAL_ODBW_GET_SESSION_INST_NUMBER(ctrl0) bVAL8(ctrl0, 32)
104 #define VXGE_HAL_ODBW_SESSION_INST_NUMBER(val) vBIT(val, 32, 8)
106 #define VXGE_HAL_ODBW_GET_HIGH_TOWI_NUMBER(ctrl0) bVAL24(ctrl0, 40)
107 #define VXGE_HAL_ODBW_HIGH_TOWI_NUMBER(val) vBIT(val, 40, 24)
110 #define VXGE_HAL_ODBW_GET_ENTRY_TYPE(ctrl1) bVAL8(ctrl1, 0)
111 #define VXGE_HAL_ODBW_ENTRY_TYPE(val) vBIT(val, 0, 8)
112 #define VXGE_HAL_ODBW_ENTRY_TYPE_WRAPPER_ONLY 0x0
113 #define VXGE_HAL_ODBW_ENTRY_TYPE_WRAPPER_TOWI 0x1
114 #define VXGE_HAL_ODBW_ENTRY_TYPE_WRAPPER_TOWI_DATA 0x2
116 #define VXGE_HAL_ODBW_GET_IMMEDIATE_BYTE_COUNT(ctrl1) bVAL8(ctrl1, 8)
117 #define VXGE_HAL_ODBW_IMMEDIATE_BYTE_COUNT(val) vBIT(val, 8, 8)
119 } __hal_offload_db_wrapper_t;
122 * struct __hal_offload_atomic_db_wrapper_t - Atomic Tx-Offload Doorbell
124 * @control_0: Bits 0 to 7 - Doorbell type.
125 * Bits 8 to 31 - Identifies the session to which this Tx
126 * offload doorbell applies.
127 * Bits 32 to 40 - Identifies the incarnation of this Session
128 * Number. The adapter assigns a Session Instance
129 * Number of 0 to a session when that Session Number
130 * is first used. Each subsequent assignment of that
131 * Session Number from the free pool causes this
132 * number to be incremented, with wrap eventually
133 * occurring from 255 back to 0.
134 * Bits 40 to 63 - Identifies the end of the TOWI list for
135 * this session to the adapter.
137 * Created by the host and written to the adapter via PIO to a Kernel Doorbell
138 * FIFO. All Tx Offload doorbell wrapper fields must be written by the host as
139 * part of a doorbell write. Consumed by the adapter but is never written by the
142 typedef __vxge_os_attr_cacheline_aligned
143 struct __hal_offload_atomic_db_wrapper_t {
145 #define VXGE_HAL_ODBW_GET_TYPE(ctrl0) bVAL8(ctrl0, 0)
146 #define VXGE_HAL_ODBW_TYPE(val) vBIT(val, 0, 8)
147 #define VXGE_HAL_ODBW_TYPE_ATOMIC 2
149 #define VXGE_HAL_ODBW_GET_SESSION_NUMBER(ctrl0) bVAL24(ctrl0, 8)
150 #define VXGE_HAL_ODBW_SESSION_NUMBER(val) vBIT(val, 8, 24)
152 #define VXGE_HAL_ODBW_GET_SESSION_INST_NUMBER(ctrl0) bVAL8(ctrl0, 32)
153 #define VXGE_HAL_ODBW_SESSION_INST_NUMBER(val) vBIT(val, 32, 8)
155 #define VXGE_HAL_ODBW_GET_HIGH_TOWI_NUMBER(ctrl0) bVAL24(ctrl0, 40)
156 #define VXGE_HAL_ODBW_HIGH_TOWI_NUMBER(val) vBIT(val, 40, 24)
158 } __hal_offload_atomic_db_wrapper_t;
163 * struct __hal_messaging_db_wrapper_t - Messaging Doorbell Wrapper
164 * @control_0: Bits 0 to 7 - Doorbell type.
165 * Bits 8 to 31 - Reserved.
166 * Bits 32 to 63 - The number of new message bytes made available
167 * by this doorbell entry.
168 * @control_1: Bits 0 to 7 - Reserved.
169 * Bits 8 to 15 - The number of Immediate messaging bytes included
171 * Bits 16 to 63 - Reserved.
173 * Created by the host and written to the adapter via PIO to a Kernel Doorbell
174 * FIFO. All message doorbell wrapper fields must be written by the host as
175 * part of a doorbell write. Consumed by the adapter but not written by adapter.
177 typedef __vxge_os_attr_cacheline_aligned struct __hal_messaging_db_wrapper_t {
179 #define VXGE_HAL_MDBW_GET_TYPE(ctrl0) bVAL8(ctrl0, 0)
180 #define VXGE_HAL_MDBW_TYPE(val) vBIT(val, 0, 8)
181 #define VXGE_HAL_MDBW_TYPE_MDBW 3
183 #define VXGE_HAL_MDBW_GET_MESSAGE_BYTE_COUNT(ctrl0) bVAL32(ctrl0, 32)
184 #define VXGE_HAL_MDBW_MESSAGE_BYTE_COUNT(val) vBIT(val, 32, 32)
187 #define VXGE_HAL_MDBW_GET_IMMEDIATE_BYTE_COUNT(ctrl1) bVAL8(ctrl1, 8)
188 #define VXGE_HAL_MDBW_IMMEDIATE_BYTE_COUNT(val) vBIT(val, 8, 8)
190 } __hal_messaging_db_wrapper_t;
194 __hal_non_offload_db_post(vxge_hal_vpath_h vpath_handle,
200 __hal_rxd_db_post(vxge_hal_vpath_h vpath_handle,
204 __hal_non_offload_db_reset(vxge_hal_vpath_h vpath_handle);
208 __hal_message_db_post(vxge_hal_vpath_h vpath_handle,
214 __hal_message_db_reset(vxge_hal_vpath_h vpath_handle);
218 #endif /* VXGE_HAL_DOOR_BELLS_H */