source: SVN/cambria/redboot/packages/devs/eth/intel/npe/common/current/include/IxQMgr.h @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 8.5 KB
Line 
1/**
2 * @file    IxQMgr.h
3 *
4 * @date    28-July-2005
5 *
6 * @brief This file contains the public API of IxQMgr component.
7 *
8 * @par
9 * IXP400 SW Release version 2.3
10 *
11 * -- Copyright Notice --
12 *
13 * @par
14 * Copyright (c) 2001-2005, Intel Corporation.
15 * All rights reserved.
16 *
17 * @par
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 *    notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 *    notice, this list of conditions and the following disclaimer in the
25 *    documentation and/or other materials provided with the distribution.
26 * 3. Neither the name of the Intel Corporation nor the names of its contributors
27 *    may be used to endorse or promote products derived from this software
28 *    without specific prior written permission.
29 *
30 *
31 * @par
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
33 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
34 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
35 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
36 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
41 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * SUCH DAMAGE.
43 *
44 *
45 * @par
46 * -- End of Copyright Notice --
47*/
48
49/* ------------------------------------------------------
50   Doxygen group definitions
51   ------------------------------------------------------ */
52/**
53 * @defgroup IxQMgrAPI IXP Queue Manager (qmgr) Public API
54 *
55 * @brief The public API for the IXP qmgr component.
56 *
57 * IxQMgr is a low level public interface to the Queue Manager
58 *
59 * @{
60 */
61
62#ifndef IXQMGR_H
63#define IXQMGR_H
64
65/*
66 * User defined include files
67 */
68
69#include "IxOsal.h"
70
71/*
72 * Typedefs
73 */
74 
75/**
76 * @ingroup IxQMgrAPI
77 * @enum IxQMgrDispatcherState
78 *
79 * @brief Queue dispatcher State.
80 *
81 * Indicates the Queue dispatcher state busy or free.
82 *
83 */
84typedef enum{
85   IX_QMGR_DISPATCHER_LOOP_FREE,
86   IX_QMGR_DISPATCHER_LOOP_BUSY
87}IxQMgrDispatcherState;
88/**
89 * @ingroup IxQMgrAPI
90 *
91 * @enum IxQMgrDispatchGroup
92 *
93 * @brief QMgr queue group select identifiers.
94 *
95 * This enum defines the groups into which the queues are divided. Each group
96 * contains 32 queues. Each qmgr interface function that works on a group of
97 * queues takes one of these identifiers as a parameter.
98 *
99 */
100typedef enum
101{
102    IX_QMGR_GROUP_Q0_TO_Q31 = 0,  /**< Queues 0-31  */
103    IX_QMGR_GROUP_Q32_TO_Q63,     /**< Queues 32-63  */
104    IX_QMGR_GROUP_MAX
105} IxQMgrDispatchGroup;
106
107#if defined(__ixp42X) || defined(__ixp46X) || defined(__ixp43X)
108/**
109 * @ingroup IxQMgrAPI
110 *
111 * @def IX_QMGR_QUELOW_GROUP
112 *
113 * @brief Backward compatability for QMgr queue group select identifier,
114 *        IX_QMGR_QUELOW_GROUP.
115 *
116 * This #define provides backward compatability for the IX_QMGR_QUELOW_GROUP,
117 * which has been replaced by IX_QMGR_GROUP_Q0_TO_Q31.
118 *
119 * This #define has been DEPRECATED and will be removed in a future release.
120 *
121 */
122#define IX_QMGR_QUELOW_GROUP IX_QMGR_GROUP_Q0_TO_Q31
123
124/**
125 * @ingroup IxQMgrAPI
126 *
127 * @def IX_QMGR_QUEUPP_GROUP
128 *
129 * @brief Backward compatability for QMgr queue group select identifier,
130 *        IX_QMGR_QUEUPP_GROUP.
131 *
132 * This #define provides backward compatability for the IX_QMGR_QUEUPP_GROUP,
133 * which has been replaced by IX_QMGR_GROUP_Q32_TO_Q63.
134 *
135 * This #define has been DEPRECATED and will be removed in a future release.
136 *
137 */
138#define IX_QMGR_QUEUPP_GROUP IX_QMGR_GROUP_Q32_TO_Q63
139#endif /* __ixp42X */
140
141/**
142 * @ingroup IxQMgrAPI
143 *
144 * @typedef IxQMgrDispatcherFuncPtr
145 *
146 * @brief QMgr Dispatcher Loop function pointer.
147 *
148 * This defines the interface for QMgr Dispather functions.
149 *
150 * @param group @ref IxQMgrDispatchGroup [in] - the group of the
151 *                  queue of which the dispatcher will run   
152 */
153#if defined(__ixp42X) || defined(__ixp46X) || defined(__ixp43X)
154typedef void (*IxQMgrDispatcherFuncPtr)(IxQMgrDispatchGroup group);
155#endif /* __ixp42X */
156
157/*
158 * Function Prototypes
159 */
160
161/* ------------------------------------------------------------
162   Initialisation related functions
163   ---------------------------------------------------------- */
164
165/**
166 *
167 * @ingroup IxQMgrAPI
168 *
169 * @fn ixQMgrInit (void)
170 *
171 * @brief Initialise the QMgr.
172 *
173 * This function must be called before any other QMgr function. It
174 * sets up internal data structures.
175 *
176 * @return @li IX_SUCCESS, the IxQMgr successfully initialised
177 * @return @li IX_FAIL, failed to initialize the Qmgr
178 *
179 */
180PUBLIC IX_STATUS
181ixQMgrInit (void);
182
183/**
184 *
185 * @ingroup IxQMgrAPI
186 *
187 * @fn ixQMgrUnload (void)
188 *
189 * @brief Uninitialise the QMgr.
190 *
191 * This function will perform the tasks required to unload the QMgr component
192 * cleanly. This includes unmapping kernel memory and unconfigures the access
193 * layer component's queue configuration.
194 *
195 * This should be called before a soft reboot or unloading of a kernel module.
196 *
197 * @pre It should only be called if @ref ixQMgrInit has already been called.
198 *
199 * @post No QMgr functions should be called until ixQMgrInit is called again.
200 *
201 * @return @li IX_SUCCESS, the IxQMgr successfully uninitialised
202 * @return @li IX_FAIL, failed to uninitialize the Qmgr
203 *
204 */
205PUBLIC IX_STATUS
206ixQMgrUnload (void);
207
208/**
209 *
210 * @ingroup IxQMgrAPI
211 *
212 * @fn ixQMgrShow (void)
213 *
214 * @brief Describe queue configuration and statistics for active queues.
215 *
216 * This function shows active queues, their configurations and statistics.
217 *
218 * @return @li void
219 *
220 */
221PUBLIC void
222ixQMgrShow (void);
223
224/* ------------------------------------------------------------
225   Queue dispatch related functions
226   ---------------------------------------------------------- */
227
228/**
229 *
230 * @ingroup IxQMgrAPI
231 *
232 * @fn ixQMgrDispatcherLoopGet (IxQMgrDispatcherFuncPtr *qDispatcherFuncPtr)
233 *
234 * @brief Get QMgr DispatcherLoopRun for respective silicon device
235 */
236#if defined(__ixp42X) || defined(__ixp46X) || defined(__ixp43X)
237/* This function gets a function pointer to ixQMgrDispatcherLoopRunB0() for IXP42X B0
238 * Silicon. However if live lock prevention is enabled a function pointer to
239 * ixQMgrDispatcherLoopRunB0LLP() is given.
240 */
241#endif /* __ixp42X */
242/*
243 * @param *qDispatchFuncPtr @ref IxQMgrDispatcherFuncPtr [out]  -
244 *              the function pointer of QMgr Dispatcher
245 *
246 */
247PUBLIC void
248ixQMgrDispatcherLoopGet (IxQMgrDispatcherFuncPtr *qDispatcherFuncPtr);
249
250#if defined(__ixp42X) || defined(__ixp46X) || defined(__ixp43X)
251#if defined(__ECOS)
252#include "IxQMgr_sp.h"
253#else
254#include "../qmgr/IxQMgr_sp.h"
255#endif
256#endif /* __ixp42X */
257
258/**
259 * @ingroup IxQMgrAPI
260 *
261 * @fn ixQMgrDispatcherLoopEnable(void)
262 *
263 * @brief Enables the Queue Manager Dispatcher.
264 * @note API used by the ixErrHdlAcc to re-enable the
265 * queue manager dispatcher.
266 * @return None
267 *
268 */
269PUBLIC void 
270ixQMgrDispatcherLoopEnable(void);
271
272/**
273 * @ingroup IxQMgrAPI
274 *
275 * @fn ixQMgrDispatcherLoopDisable(void)
276 *
277 * @brief Disables the Queue Manager Dispatcher
278 * @note API used by the ixErrHdlAcc to disable the
279 * queue manager dispatcher to prevent QM Read/Write
280 * access.
281 * @return None
282 *
283 */
284PUBLIC void 
285ixQMgrDispatcherLoopDisable(void);
286
287/**
288 * @ingroup IxQMgrAPI
289 *
290 * @fn IxQMgrDispatcherState ixQMgrDispatcherLoopStatusGet(void )
291 *
292 * @brief Gets the Queue dispatcher Loop status.
293 * @return Returns an enum @IxQMgrDispatcherState that indicates
294 *          the dispatcher state (RUN or STOP)
295 *
296 */
297PUBLIC
298IxQMgrDispatcherState ixQMgrDispatcherLoopStatusGet(void );
299
300/**
301 * @ingroup IxQMgrAPI
302 *
303 * @fn void ixQMgrDispatcherInterruptModeSet(BOOL mode)
304 *
305 * @brief Notifies the ixQMgr that the Dispatcher is in Interrupt mode.
306 * @note This function records whether the Queue Dispatcher is bind
307 * to the QM Interrupt notification IRQ.
308 *
309 * @param BOOL mode [in] - TRUE - dispatcher mode is bind to Queue Manager
310 *                         IRQ for queue notifications (0-63).
311 *                         FALSE - dispatcher is in poll mode.
312 * @return None
313 *
314 */
315PUBLIC
316void ixQMgrDispatcherInterruptModeSet(BOOL mode);
317
318#endif /* IXQMGR_H */
319
320/**
321 * @} defgroup IxQMgrAPI
322 */
Note: See TracBrowser for help on using the repository browser.