summaryrefslogtreecommitdiffstats
path: root/arch/arm/cpu/ixp/npe/include/IxAtmTypes.h
blob: 8624c3328e377fb48f992d4a26bbbde88e19255b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
/**
 * @file IxAtmTypes.h
 *
 * @date 24-MAR-2002
 *
 * @brief This file contains Atm types common to a number of Atm components.
 * 
 * @par
 * IXP400 SW Release version 2.0
 * 
 * -- Copyright Notice --
 * 
 * @par
 * Copyright 2001-2005, Intel Corporation.
 * All rights reserved.
 * 
 * @par
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the Intel Corporation nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 * 
 * @par
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 * @par
 * -- End of Copyright Notice --
 */

/* ------------------------------------------------------
   Doxygen group definitions
   ------------------------------------------------------ */
/**
 * @defgroup IxAtmTypes IXP400 ATM Types (IxAtmTypes)
 *
 * @brief The common set of types used in many Atm components
 *
 * @{ */

#ifndef IXATMTYPES_H
#define IXATMTYPES_H

#include "IxNpeA.h"

/**
 * @enum IxAtmLogicalPort
 *
 * @brief Logical Port Definitions  :
 *
 * Only 1 port is available in SPHY configuration
 * 12 ports are enabled in MPHY configuration
 *
 */
typedef enum
{
    IX_UTOPIA_PORT_0 = 0,  /**< Port 0 */
#ifdef IX_NPE_MPHYMULTIPORT
    IX_UTOPIA_PORT_1,      /**< Port 1 */
    IX_UTOPIA_PORT_2,      /**< Port 2 */
    IX_UTOPIA_PORT_3,      /**< Port 3 */
    IX_UTOPIA_PORT_4,      /**< Port 4 */
    IX_UTOPIA_PORT_5,      /**< Port 5 */
    IX_UTOPIA_PORT_6,      /**< Port 6 */
    IX_UTOPIA_PORT_7,      /**< Port 7 */
    IX_UTOPIA_PORT_8,      /**< Port 8 */
    IX_UTOPIA_PORT_9,      /**< Port 9 */
    IX_UTOPIA_PORT_10,     /**< Port 10 */
    IX_UTOPIA_PORT_11,     /**< Port 11 */
#endif /* IX_NPE_MPHY */
    IX_UTOPIA_MAX_PORTS    /**< Not a port - just a definition for the
                           * maximum possible ports
                           */
} IxAtmLogicalPort;

/**
 * @def IX_ATM_CELL_PAYLOAD_SIZE
 * @brief Size of a ATM cell payload
 */
#define IX_ATM_CELL_PAYLOAD_SIZE             (48)

/**
 * @def IX_ATM_CELL_SIZE
 * @brief Size of a ATM cell, including header
 */
#define IX_ATM_CELL_SIZE                     (53)

/**
 * @def IX_ATM_CELL_SIZE_NO_HEC
 * @brief Size of a ATM cell, excluding HEC byte
 */
#define IX_ATM_CELL_SIZE_NO_HEC              (IX_ATM_CELL_SIZE - 1)

/**
 * @def IX_ATM_OAM_CELL_SIZE_NO_HEC
 * @brief Size of a OAM cell, excluding HEC byte
 */
#define IX_ATM_OAM_CELL_SIZE_NO_HEC          IX_ATM_CELL_SIZE_NO_HEC

/**
 * @def IX_ATM_AAL0_48_CELL_PAYLOAD_SIZE
 * @brief Size of a AAL0 48 Cell payload
 */
#define IX_ATM_AAL0_48_CELL_PAYLOAD_SIZE     IX_ATM_CELL_PAYLOAD_SIZE

/**
 * @def IX_ATM_AAL5_CELL_PAYLOAD_SIZE
 * @brief Size of a AAL5 Cell payload
 */
#define IX_ATM_AAL5_CELL_PAYLOAD_SIZE        IX_ATM_CELL_PAYLOAD_SIZE

/**
 * @def IX_ATM_AAL0_52_CELL_SIZE_NO_HEC
 * @brief Size of a AAL0 52 Cell, excluding HEC byte
 */
#define IX_ATM_AAL0_52_CELL_SIZE_NO_HEC      IX_ATM_CELL_SIZE_NO_HEC


/**
 * @def IX_ATM_MAX_VPI
 * @brief Maximum value of an ATM VPI
 */
#define IX_ATM_MAX_VPI 255

/**
 * @def IX_ATM_MAX_VCI
 * @brief Maximum value of an ATM VCI
 */
#define IX_ATM_MAX_VCI 65535

 /**
 * @def IX_ATM_MAX_NUM_AAL_VCS
 * @brief Maximum number of active AAL5/AAL0 VCs in the system
 */
#define IX_ATM_MAX_NUM_AAL_VCS 32

/**
 * @def IX_ATM_MAX_NUM_VC
 * @brief Maximum number of active AAL5/AAL0 VCs in the system
 * The use of this macro is depreciated, it is retained for
 * backward compatiblity. For current software release
 * and beyond the define IX_ATM_MAX_NUM_AAL_VC should be used.
 */
#define IX_ATM_MAX_NUM_VC IX_ATM_MAX_NUM_AAL_VCS



/**
 * @def IX_ATM_MAX_NUM_OAM_TX_VCS
 * @brief Maximum number of active OAM Tx VCs in the system, 
 *        1 OAM VC per port
 */
#define IX_ATM_MAX_NUM_OAM_TX_VCS IX_UTOPIA_MAX_PORTS

/**
 * @def IX_ATM_MAX_NUM_OAM_RX_VCS
 * @brief Maximum number of active OAM Rx VCs in the system, 
 *        1 OAM VC shared accross all ports
 */
#define IX_ATM_MAX_NUM_OAM_RX_VCS 1

/**
 * @def IX_ATM_MAX_NUM_AAL_OAM_TX_VCS
 * @brief Maximum number of active AAL5/AAL0/OAM Tx VCs in the system
 */
#define IX_ATM_MAX_NUM_AAL_OAM_TX_VCS (IX_ATM_MAX_NUM_AAL_VCS + IX_ATM_MAX_NUM_OAM_TX_VCS)

/**
 * @def IX_ATM_MAX_NUM_AAL_OAM_RX_VCS
 * @brief Maximum number of active AAL5/AAL0/OAM Rx VCs in the system
 */
#define IX_ATM_MAX_NUM_AAL_OAM_RX_VCS (IX_ATM_MAX_NUM_AAL_VCS + IX_ATM_MAX_NUM_OAM_RX_VCS)

/**
 *  @def IX_ATM_IDLE_CELLS_CONNID
 *  @brief VC Id used to indicate idle cells in the returned schedule table.
 */
#define IX_ATM_IDLE_CELLS_CONNID 0


/**
 *  @def IX_ATM_CELL_HEADER_VCI_GET
 *  @brief get the VCI field from a cell header
 */
#define IX_ATM_CELL_HEADER_VCI_GET(cellHeader) \
    (((cellHeader) >> 4) & IX_OAM_VCI_BITS_MASK);

/**
 *  @def IX_ATM_CELL_HEADER_VPI_GET
 *  @brief get the VPI field from a cell header
 */
#define IX_ATM_CELL_HEADER_VPI_GET(cellHeader) \
    (((cellHeader) >> 20) & IX_OAM_VPI_BITS_MASK);

/**
 *  @def IX_ATM_CELL_HEADER_PTI_GET
 *  @brief get the PTI field from a cell header
 */
#define IX_ATM_CELL_HEADER_PTI_GET(cellHeader) \
    ((cellHeader) >> 1) & IX_OAM_PTI_BITS_MASK;

/**
 * @typedef IxAtmCellHeader
 *
 * @brief ATM Cell Header, does not contain 4 byte HEC, added by NPE-A 
 */
typedef unsigned int IxAtmCellHeader;


/**
 * @enum IxAtmServiceCategory
 *
 * @brief Enumerated type representing available ATM service categories.
 *   For more informatoin on these categories, see "Traffic Management
 *   Specification" v4.1, published by the ATM Forum -
 *   http://www.atmforum.com
 */
typedef enum
{
    IX_ATM_CBR,    /**< Constant Bit Rate */
    IX_ATM_RTVBR,  /**< Real Time Variable Bit Rate */
    IX_ATM_VBR,    /**< Variable Bit Rate */
    IX_ATM_UBR,    /**< Unspecified Bit Rate */
    IX_ATM_ABR     /**< Available Bit Rate (not supported) */

} IxAtmServiceCategory;

/**
 *
 * @enum IxAtmRxQueueId
 *
 * @brief Rx Queue Type for RX traffic
 *
 * IxAtmRxQueueId defines the queues involved for receiving data.
 *
 * There are two queues to facilitate prioritisation handling
 * and processing the 2 queues with different algorithms and
 * constraints
 *
 * e.g. : one queue can carry voice (or time-critical traffic), the
 * other queue can carry non-voice traffic
 *
 */
typedef enum
{
    IX_ATM_RX_A = 0,      /**< RX queue A */
    IX_ATM_RX_B,          /**< RX queue B */
    IX_ATM_MAX_RX_STREAMS /**< Maximum number of RX streams */
} IxAtmRxQueueId;

/**
 * @brief Structure describing an ATM traffic contract for a Virtual
 *         Connection (VC).
 *
 * Structure is used to specify the requested traffic contract for a
 * VC to the IxAtmSch component using the @ref ixAtmSchVcModelSetup
 * interface.
 *
 * These parameters are defined by the ATM forum working group
 * (http://www.atmforum.com).
 *
 * @note Typical values for a voice channel 64 Kbit/s
 * - atmService @a IX_ATM_RTVBR
 * - pcr   400  (include IP overhead, and AAL5 trailer)
 * - cdvt  5000000 (5 ms)
 * - scr = pcr
 *
 * @note Typical values for a data channel 800 Kbit/s
 * - atmService @a IX_ATM_UBR
 * - pcr   1962  (include IP overhead, and AAL5 trailer)
 * - cdvt  5000000 (5 ms)
 *
 */
typedef struct
{
    IxAtmServiceCategory atmService; /**< ATM service category */
    unsigned pcr;   /**< Peak Cell Rate - cells per second */
    unsigned cdvt;  /**< Cell Delay Variation Tolerance - in nanoseconds */
    unsigned scr;   /**< Sustained Cell Rate - cells per second */
    unsigned mbs;   /**< Max Burst Size - cells */
    unsigned mcr;   /**< Minimum Cell Rate - cells per second */
    unsigned mfs;   /**< Max Frame Size - cells */
} IxAtmTrafficDescriptor;

/**
 * @typedef IxAtmConnId
 *
 * @brief ATM VC data connection identifier.
 *
 * This is is generated by IxAtmdAcc when a successful connection is
 * made on a VC. The is the ID by which IxAtmdAcc knows an active
 * VC and should be used in IxAtmdAcc API calls to reference a
 * specific VC.
 */
typedef unsigned int IxAtmConnId;

/**
 * @typedef IxAtmSchedulerVcId
 *
 * @brief ATM VC scheduling connection identifier.
 *
 * This id is generated and used by ATM Tx controller, generally
 * the traffic shaper (e.g. IxAtmSch). The IxAtmdAcc component
 * will request one of these Ids whenever a data connection on
 * a Tx VC is requested. This ID will be used in callbacks to
 * the ATM Transmission Ctrl s/w (e.g. IxAtmm) to reference a
 * particular VC.
 */
typedef int IxAtmSchedulerVcId;

/**
 * @typedef IxAtmNpeRxVcId
 *
 * @brief ATM Rx VC identifier used by the ATM Npe.
 *
 * This Id is generated by IxAtmdAcc when a successful data connection
 * is made on a rx VC.
 */
typedef unsigned int IxAtmNpeRxVcId;

/**
 * @brief ATM Schedule Table entry
 *
 * This IxAtmScheduleTableEntry is used by an ATM scheduler to inform
 * IxAtmdAcc about the data to transmit (in term of cells per VC)
 *
 * This structure defines
 * @li the number of cells to be transmitted (numberOfCells)
 * @li the VC connection to be used for transmission (connId).
 *
 * @note - When the connection Id value is IX_ATM_IDLE_CELLS_CONNID, the
 * corresponding number of idle cells will be transmitted to the hardware.
 *
 */
typedef struct
{
    IxAtmConnId connId; /**< connection Id
                 *
                 * Identifier of VC from which cells are to be transmitted.
                 * When this valus is IX_ATM_IDLE_CELLS_CONNID, this indicates
                 * that the system should transmit the specified number
                 * of idle cells. Unknown connIds result in the transmission
                 * idle cells.
                 */
    unsigned int numberOfCells; /**< number of cells to transmit
                 *
                 * The number of contiguous cells to schedule from this VC
                 * at this point. The valid range is from 1 to
                 * @a IX_ATM_SCHEDULETABLE_MAXCELLS_PER_ENTRY. This
                 * number can swap over mbufs and pdus. OverSchduling results
                 * in the transmission of idle cells.
                 */
} IxAtmScheduleTableEntry;

/**
 * @brief This structure defines a schedule table which gives details
 *         on which data (from which VCs) should be transmitted for a
 *         forthcoming period of time for a particular port and the
 *         order in which that data should be transmitted.
 *
 *  The schedule table consists of a series of entries each of which
 *  will schedule one or more cells from a particular registered VC.
 *  The total number of cells scheduled and the total number of
 *  entries in the table are also indicated.
 *
 */
typedef struct
{
    unsigned tableSize;      /**< Number of entries
                              *
                              * Indicates the total number of
                              *   entries in the table.
                              */
    unsigned totalCellSlots; /**< Number of cells
                              *
                              * Indicates the total number of ATM
                              *   cells which are scheduled by all the
                              *   entries in the table.
                              */
    IxAtmScheduleTableEntry *table; /**< Pointer to schedule entries
                                     *
                                     * Pointer to an array
                                     *   containing tableSize entries
                                     */
} IxAtmScheduleTable;

#endif /* IXATMTYPES_H */

/**
 * @} defgroup IxAtmTypes
 */


OpenPOWER on IntegriCloud