]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - drivers/net/npe/include/IxNpeA.h
doc: SPI: Add qspi test details on AM43xx
[karo-tx-uboot.git] / drivers / net / npe / include / IxNpeA.h
1 #ifndef __doxygen_HIDE  /* This file is not part of the API */
2
3 /**
4  * @file    IxNpeA.h
5  *
6  * @date    22-Mar-2002
7  *
8  * @brief   Header file for the IXP400 ATM NPE API
9  *
10  * 
11  * @par
12  * IXP400 SW Release version 2.0
13  * 
14  * -- Copyright Notice --
15  * 
16  * @par
17  * Copyright 2001-2005, Intel Corporation.
18  * All rights reserved.
19  * 
20  * @par
21  * SPDX-License-Identifier:     BSD-3-Clause
22  * @par
23  * -- End of Copyright Notice --
24  */
25
26 /**
27  * @defgroup IxNpeA IXP400 NPE-A (IxNpeA) API
28  *
29  * @brief The Public API for the IXP400 NPE-A
30  *
31  * @{
32  */
33
34 #ifndef IX_NPE_A_H
35 #define IX_NPE_A_H
36
37 #include "IxQMgr.h"
38 #include "IxOsal.h"
39 #include "IxQueueAssignments.h"
40
41 /* General Message Ids */
42
43 /* ATM Message Ids */
44
45 /**
46  * @def IX_NPE_A_MSSG_ATM_UTOPIA_CONFIG_WRITE
47  *
48  * @brief ATM Message ID command to write the data to the offset in the
49  * Utopia Configuration Table
50  */
51 #define IX_NPE_A_MSSG_ATM_UTOPIA_CONFIG_WRITE       0x20
52
53 /**
54  * @def IX_NPE_A_MSSG_ATM_UTOPIA_CONFIG_LOAD
55  *
56  * @brief ATM Message ID command triggers the NPE to copy the Utopia
57  * Configuration Table to the Utopia coprocessor
58  */
59 #define IX_NPE_A_MSSG_ATM_UTOPIA_CONFIG_LOAD        0x21
60
61 /**
62  * @def IX_NPE_A_MSSG_ATM_UTOPIA_STATUS_UPLOAD
63  *
64  * @brief ATM Message ID command triggers the NPE to read-back the Utopia
65  * status registers and update the Utopia Status Table.
66  */
67 #define IX_NPE_A_MSSG_ATM_UTOPIA_STATUS_UPLOAD      0x22
68
69 /**
70  * @def IX_NPE_A_MSSG_ATM_UTOPIA_STATUS_READ
71  *
72  * @brief ATM Message ID command to read the Utopia Status Table at the
73  * specified offset.
74  */
75 #define IX_NPE_A_MSSG_ATM_UTOPIA_STATUS_READ        0x23
76
77 /**
78  * @def IX_NPE_A_MSSG_ATM_TX_ENABLE
79  *
80  * @brief ATM Message ID command triggers the NPE to re-enable processing
81  * of any entries on the TxVcQ for this port.
82  *
83  * This command will be ignored for a port already enabled
84  */
85 #define IX_NPE_A_MSSG_ATM_TX_ENABLE                 0x25
86
87  /**
88  * @def IX_NPE_A_MSSG_ATM_TX_DISABLE
89  *
90  * @brief ATM Message ID command triggers the NPE to disable processing on
91  * this port
92  *
93  * This command will be ignored for a port already disabled
94  */
95 #define IX_NPE_A_MSSG_ATM_TX_DISABLE                0x26
96
97 /**
98  * @def IX_NPE_A_MSSG_ATM_RX_ENABLE
99  *
100  * @brief ATM Message ID command triggers the NPE to process any received
101  * cells for this VC according to the VC Lookup Table.
102  *
103  * Re-issuing this command with different contents for a VC that is not
104  * disabled will cause unpredictable behavior.
105  */
106 #define IX_NPE_A_MSSG_ATM_RX_ENABLE                 0x27
107
108 /**
109  * @def IX_NPE_A_MSSG_ATM_RX_DISABLE
110  *
111  * @brief ATM Message ID command triggers the NPE to disable processing for
112  * this VC.
113  *
114  * This command will be ignored for a VC already disabled
115  */
116 #define IX_NPE_A_MSSG_ATM_RX_DISABLE                0x28
117
118 /**
119  * @def IX_NPE_A_MSSG_ATM_STATUS_READ
120  *
121  * @brief ATM Message ID command to read the ATM status. The data is returned via
122  * a response message
123  */
124 #define IX_NPE_A_MSSG_ATM_STATUS_READ               0x29
125
126 /*--------------------------------------------------------------------------
127  * HSS Message IDs
128  *--------------------------------------------------------------------------*/
129
130 /**
131  * @def IX_NPE_A_MSSG_HSS_PORT_CONFIG_WRITE
132  *
133  * @brief HSS Message ID command writes the ConfigWord value to the location
134  * in the HSS_CONFIG_TABLE specified by offset for HSS port hPort.
135  */
136 #define IX_NPE_A_MSSG_HSS_PORT_CONFIG_WRITE         0x40
137
138 /**
139  * @def IX_NPE_A_MSSG_HSS_PORT_CONFIG_LOAD
140  *
141  * @brief HSS Message ID command triggers the NPE to copy the contents of the
142  * HSS Configuration Table to the appropriate configuration registers in the
143  * HSS coprocessor for the port specified by hPort.
144  */
145 #define IX_NPE_A_MSSG_HSS_PORT_CONFIG_LOAD          0x41
146
147 /**
148  * @def IX_NPE_A_MSSG_HSS_PORT_ERROR_READ
149  *
150  * @brief HSS Message ID command triggers the NPE to return an HssErrorReadResponse
151  * message for HSS port hPort.
152  */
153 #define IX_NPE_A_MSSG_HSS_PORT_ERROR_READ           0x42
154
155 /**
156  * @def IX_NPE_A_MSSG_HSS_CHAN_FLOW_ENABLE
157  *
158  * @brief HSS Message ID command triggers the NPE to reset internal status and
159  * enable the HssChannelized operation on the HSS port specified by hPort.
160  */
161 #define IX_NPE_A_MSSG_HSS_CHAN_FLOW_ENABLE          0x43
162
163 /**
164  * @def IX_NPE_A_MSSG_HSS_CHAN_FLOW_DISABLE
165  *
166  * @brief HSS Message ID command triggers the NPE to disable the HssChannelized
167  * operation on the HSS port specified by hPort.
168  */
169 #define IX_NPE_A_MSSG_HSS_CHAN_FLOW_DISABLE         0x44
170
171 /**
172  * @def  IX_NPE_A_MSSG_HSS_CHAN_IDLE_PATTERN_WRITE
173  *
174  * @brief HSS Message ID command writes the HSSnC_IDLE_PATTERN value for HSS
175  * port hPort. (n=hPort)
176  */
177 #define IX_NPE_A_MSSG_HSS_CHAN_IDLE_PATTERN_WRITE   0x45
178
179 /**
180  * @def IX_NPE_A_MSSG_HSS_CHAN_NUM_CHANS_WRITE
181  *
182  * @brief HSS Message ID command writes the HSSnC_NUM_CHANNELS value for HSS
183  * port hPort. (n=hPort)
184  */
185 #define IX_NPE_A_MSSG_HSS_CHAN_NUM_CHANS_WRITE      0x46
186
187 /**
188  * @def IX_NPE_A_MSSG_HSS_CHAN_RX_BUF_ADDR_WRITE
189  *
190  * @brief HSS Message ID command writes the HSSnC_RX_BUF_ADDR value for HSS
191  * port hPort. (n=hPort)
192  */
193 #define IX_NPE_A_MSSG_HSS_CHAN_RX_BUF_ADDR_WRITE    0x47
194
195 /**
196  * @def IX_NPE_A_MSSG_HSS_CHAN_RX_BUF_CFG_WRITE
197  *
198  * @brief HSS Message ID command  writes the HSSnC_RX_BUF_SIZEB and
199  * HSSnC_RX_TRIG_PERIOD values for HSS port hPort.  (n=hPort)
200  */
201 #define IX_NPE_A_MSSG_HSS_CHAN_RX_BUF_CFG_WRITE     0x48
202
203 /**
204  * @def IX_NPE_A_MSSG_HSS_CHAN_TX_BLK_CFG_WRITE
205  *
206  * @brief HSS Message ID command writes the HSSnC_TX_BLK1_SIZEB,
207  * HSSnC_TX_BLK1_SIZEW, HSSnC_TX_BLK2_SIZEB, and HSSnC_TX_BLK2_SIZEW  values
208  * for HSS port hPort. (n=hPort)
209  */
210 #define IX_NPE_A_MSSG_HSS_CHAN_TX_BLK_CFG_WRITE     0x49
211
212 /**
213  * @def IX_NPE_A_MSSG_HSS_CHAN_TX_BUF_ADDR_WRITE
214  * @brief HSS Message ID command writes the HSSnC_TX_BUF_ADDR value for HSS
215  * port hPort. (n=hPort)
216  */
217 #define IX_NPE_A_MSSG_HSS_CHAN_TX_BUF_ADDR_WRITE    0x4A
218
219 /**
220  * @def IX_NPE_A_MSSG_HSS_CHAN_TX_BUF_SIZE_WRITE
221  *
222  * @brief HSS Message ID command writes the HSSnC_TX_BUF_SIZEN value for HSS
223  * port hPort. (n=hPort)
224  */
225 #define IX_NPE_A_MSSG_HSS_CHAN_TX_BUF_SIZE_WRITE    0x4B
226
227 /**
228  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_FLOW_ENABLE
229  *
230  * @brief HSS Message ID command triggers the NPE to reset internal status and
231  * enable the HssPacketized operation for the flow specified by pPipe on
232  * the HSS port specified by hPort.
233  */
234 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_FLOW_ENABLE      0x50
235
236 /**
237  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_FLOW_DISABLE
238  * @brief HSS Message ID command triggers the NPE to disable the HssPacketized
239  * operation for the flow specified by pPipe on the HSS port specified by hPort.
240  */
241 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_FLOW_DISABLE     0x51
242
243 /**
244  * @def IX_NPE_A_MSSG_HSS_PKT_NUM_PIPES_WRITE
245  * @brief HSS Message ID command writes the HSSnP_NUM_PIPES value for HSS
246  * port hPort.(n=hPort)
247  */
248 #define IX_NPE_A_MSSG_HSS_PKT_NUM_PIPES_WRITE       0x52
249
250 /**
251  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_FIFO_SIZEW_WRITE
252  *
253  * @brief HSS Message ID command writes the HSSnP_PIPEp_FIFOSIZEW value for
254  * packet-pipe pPipe on HSS port hPort.  (n=hPort, p=pPipe)
255  */
256 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_FIFO_SIZEW_WRITE 0x53
257
258 /**
259  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_HDLC_CFG_WRITE
260  *
261  * @brief HSS Message ID command writes the HSSnP_PIPEp_HDLC_RXCFG and
262  * HSSnP_PIPEp_HDLC_TXCFG values for packet-pipe pPipe on HSS port hPort.
263  * (n=hPort, p=pPipe)
264  */
265 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_HDLC_CFG_WRITE   0x54
266
267 /**
268  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_IDLE_PATTERN_WRITE
269  *
270  * @brief HSS Message ID command writes the HSSnP_PIPEp_IDLE_PATTERN value
271  * for packet-pipe pPipe on HSS port hPort.  (n=hPort, p=pPipe)
272  */
273 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_IDLE_PATTERN_WRITE 0x55
274
275 /**
276  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_RX_SIZE_WRITE
277  *
278  * @brief HSS Message ID command writes the HSSnP_PIPEp_RXSIZEB value for
279  * packet-pipe pPipe on HSS port hPort.  (n=hPort, p=pPipe)
280  */
281 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_RX_SIZE_WRITE    0x56
282
283 /**
284  * @def IX_NPE_A_MSSG_HSS_PKT_PIPE_MODE_WRITE
285  *
286  * @brief HSS Message ID command writes the HSSnP_PIPEp_MODE value for
287  * packet-pipe pPipe on HSS port hPort.  (n=hPort, p=pPipe)
288  */
289 #define IX_NPE_A_MSSG_HSS_PKT_PIPE_MODE_WRITE       0x57
290
291
292
293 /* Queue Entry Masks */
294
295 /*--------------------------------------------------------------------------
296  *  ATM Descriptor Structure offsets
297  *--------------------------------------------------------------------------*/
298
299 /**
300  * @def IX_NPE_A_RXDESCRIPTOR_STATUS_OFFSET
301  *
302  * @brief ATM Descriptor structure offset for Receive Descriptor Status field
303  *
304  * It is used for descriptor error reporting.
305  */
306 #define IX_NPE_A_RXDESCRIPTOR_STATUS_OFFSET          0
307
308 /**
309  * @def IX_NPE_A_RXDESCRIPTOR_VCID_OFFSET
310  *
311  * @brief ATM Descriptor structure offset for Receive Descriptor VC ID field
312  *
313  * It is used to hold an identifier number for this VC
314  */
315 #define IX_NPE_A_RXDESCRIPTOR_VCID_OFFSET            1
316
317 /**
318  * @def IX_NPE_A_RXDESCRIPTOR_CURRMBUFSIZE_OFFSET
319  *
320  * @brief ATM Descriptor structure offset for Receive Descriptor Current Mbuf
321  * Size field
322  *
323  * Number of bytes the current mbuf data buffer can hold
324  */
325 #define IX_NPE_A_RXDESCRIPTOR_CURRMBUFSIZE_OFFSET    2
326
327 /**
328  * @def IX_NPE_A_RXDESCRIPTOR_ATMHEADER_OFFSET
329  *
330  * @brief ATM Descriptor structure offset for Receive Descriptor ATM Header
331  */
332 #define IX_NPE_A_RXDESCRIPTOR_ATMHEADER_OFFSET       4
333
334 /**
335  * @def IX_NPE_A_RXDESCRIPTOR_CURRMBUFLEN_OFFSET
336  *
337  * @brief ATM Descriptor structure offset for Receive Descriptor Current MBuf length
338  *
339  *
340  * RX - Initialized to zero.  The NPE updates this field as each cell is received and
341  * zeroes it with every new mbuf for chaining. Will not be bigger than currBbufSize.
342  */
343 #define IX_NPE_A_RXDESCRIPTOR_CURRMBUFLEN_OFFSET    12
344
345 /**
346  * @def IX_NPE_A_RXDESCRIPTOR_TIMELIMIT__OFFSET
347  *
348  * @brief ATM Descriptor structure offset for Receive Descriptor Time Limit field
349  *
350  * Contains the Payload Reassembly Time Limit (used for aal0_xx only)
351  */
352 #define IX_NPE_A_RXDESCRIPTOR_TIMELIMIT_OFFSET        14
353
354 /**
355  * @def IX_NPE_A_RXDESCRIPTOR_PCURRMBUFF_OFFSET
356  *
357  * @brief ATM Descriptor structure offset for Receive Descriptor Current MBuf Pointer
358  *
359  * The current mbuf pointer of a chain of mbufs.
360  */
361 #define IX_NPE_A_RXDESCRIPTOR_PCURRMBUFF_OFFSET     20
362
363 /**
364  * @def IX_NPE_A_RXDESCRIPTOR_PCURRMBUFDATA_OFFSET
365  *
366  * @brief ATM Descriptor structure offset for Receive Descriptor Current MBuf Pointer
367  *
368  * Pointer to the next byte to be read or next free location to be written.
369  */
370 #define IX_NPE_A_RXDESCRIPTOR_PCURRMBUFDATA_OFFSET  24
371
372 /**
373  * @def IX_NPE_A_RXDESCRIPTOR_PNEXTMBUF_OFFSET
374  *
375  * @brief ATM Descriptor structure offset for Receive Descriptor Next MBuf Pointer
376  *
377  * Pointer to the next MBuf in a chain of MBufs.
378  */
379 #define IX_NPE_A_RXDESCRIPTOR_PNEXTMBUF_OFFSET      28
380
381 /**
382  * @def IX_NPE_A_RXDESCRIPTOR_TOTALLENGTH_OFFSET
383  *
384  * @brief ATM Descriptor structure offset for Receive Descriptor Total Length
385  *
386  * Total number of bytes written to the chain of MBufs by the NPE
387  */
388 #define IX_NPE_A_RXDESCRIPTOR_TOTALLENGTH_OFFSET    32
389
390 /**
391  * @def IX_NPE_A_RXDESCRIPTOR_AAL5CRCRESIDUE_OFFSET
392  *
393  * @brief ATM Descriptor structure offset for Receive Descriptor AAL5 CRC Residue
394  *
395  * Current CRC value for a PDU
396  */
397 #define IX_NPE_A_RXDESCRIPTOR_AAL5CRCRESIDUE_OFFSET 36
398
399 /**
400  * @def IX_NPE_A_RXDESCRIPTOR_SIZE
401  *
402  * @brief ATM Descriptor structure offset for Receive Descriptor Size
403  *
404  * The size of the Receive descriptor
405  */
406 #define IX_NPE_A_RXDESCRIPTOR_SIZE                  40
407
408 /**
409  * @def IX_NPE_A_TXDESCRIPTOR_PORT_OFFSET
410  *
411  * @brief ATM Descriptor structure offset for Transmit Descriptor Port
412  *
413  * Port identifier.
414  */
415 #define IX_NPE_A_TXDESCRIPTOR_PORT_OFFSET            0
416
417 /**
418  * @def IX_NPE_A_TXDESCRIPTOR_RSVD_OFFSET
419  *
420  * @brief ATM Descriptor structure offset for Transmit Descriptor RSVD
421  */
422 #define IX_NPE_A_TXDESCRIPTOR_RSVD_OFFSET            1
423
424 /**
425  * @def IX_NPE_A_TXDESCRIPTOR_CURRMBUFLEN_OFFSET
426  *
427  * @brief ATM Descriptor structure offset for Transmit Descriptor Current MBuf Length
428  *
429  * TX - Initialized by the XScale to the number of bytes in the current MBuf data buffer.
430  * The NPE decrements this field for every transmitted cell.  Thus, when the NPE writes a
431  * descriptor the TxDone queue, this field will equal zero.
432  */
433 #define IX_NPE_A_TXDESCRIPTOR_CURRMBUFLEN_OFFSET     2
434
435 /**
436  * @def IX_NPE_A_TXDESCRIPTOR_ATMHEADER_OFFSET
437  * @brief ATM Descriptor structure offset for Transmit Descriptor ATM Header
438  */
439 #define IX_NPE_A_TXDESCRIPTOR_ATMHEADER_OFFSET       4
440
441 /**
442  * @def IX_NPE_A_TXDESCRIPTOR_PCURRMBUFF_OFFSET
443  *
444  * @brief ATM Descriptor structure offset for Transmit Descriptor Pointer to the current MBuf chain
445  */
446 #define IX_NPE_A_TXDESCRIPTOR_PCURRMBUFF_OFFSET      8
447
448 /**
449  * @def IX_NPE_A_TXDESCRIPTOR_PCURRMBUFDATA_OFFSET
450  *
451  * @brief ATM Descriptor structure offset for Transmit Descriptor Pointer to the current MBuf Data
452  *
453  * Pointer to the next byte to be read or next free location to be written.
454  */
455 #define IX_NPE_A_TXDESCRIPTOR_PCURRMBUFDATA_OFFSET  12
456
457 /**
458  * @def IX_NPE_A_TXDESCRIPTOR_PNEXTMBUF_OFFSET
459  *
460  * @brief ATM Descriptor structure offset for Transmit Descriptor Pointer to the Next MBuf chain
461  */
462 #define IX_NPE_A_TXDESCRIPTOR_PNEXTMBUF_OFFSET      16
463
464 /**
465  * @def IX_NPE_A_TXDESCRIPTOR_TOTALLENGTH_OFFSET
466  *
467  * @brief ATM Descriptor structure offset for Transmit Descriptor Total Length
468  *
469  * Total number of bytes written to the chain of MBufs by the NPE
470  */
471 #define IX_NPE_A_TXDESCRIPTOR_TOTALLENGTH_OFFSET    20
472
473 /**
474  * @def IX_NPE_A_TXDESCRIPTOR_AAL5CRCRESIDUE_OFFSET
475  *
476  * @brief ATM Descriptor structure offset for Transmit Descriptor AAL5 CRC Residue
477  *
478  * Current CRC value for a PDU
479  */
480 #define IX_NPE_A_TXDESCRIPTOR_AAL5CRCRESIDUE_OFFSET 24
481
482 /**
483  * @def IX_NPE_A_TXDESCRIPTOR_SIZE
484  *
485  * @brief ATM Descriptor structure offset for Transmit Descriptor Size
486  */
487 #define IX_NPE_A_TXDESCRIPTOR_SIZE                  28
488
489 /**
490  * @def IX_NPE_A_CHAIN_DESC_COUNT_MAX
491  *
492  * @brief Maximum number of chained MBufs that can be chained together
493  */
494 #define IX_NPE_A_CHAIN_DESC_COUNT_MAX            256
495
496 /*
497  *  Definition of the ATM cell header
498  *
499  * This would most conviently be defined as the bit field shown below.
500  * Endian portability prevents this, therefore a set of macros
501  * are defined to access the fields within the cell header assumed to
502  * be passed as a UINT32.
503  *
504  * Changes to field sizes or orders must be reflected in the offset
505  * definitions above.
506  *
507  *    typedef struct
508  *    {
509  *       unsigned int gfc:4;
510  *       unsigned int vpi:8;
511  *       unsigned int vci:16;
512  *       unsigned int pti:3;
513  *       unsigned int clp:1;
514  *    } IxNpeA_AtmCellHeader;
515  *
516  */
517
518 /** Mask to acess GFC */
519 #define GFC_MASK        0xf0000000
520
521 /** return GFC from ATM cell header */
522 #define IX_NPE_A_ATMCELLHEADER_GFC_GET( header ) \
523 (((header) & GFC_MASK) >> 28)
524
525 /** set GFC into ATM cell header */
526 #define IX_NPE_A_ATMCELLHEADER_GFC_SET( header,gfc ) \
527 do { \
528     (header) &= ~GFC_MASK; \
529     (header) |= (((gfc) << 28) & GFC_MASK); \
530 } while(0)
531
532 /** Mask to acess VPI */
533 #define VPI_MASK        0x0ff00000
534
535 /** return VPI from ATM cell header */
536 #define IX_NPE_A_ATMCELLHEADER_VPI_GET( header ) \
537 (((header) & VPI_MASK) >> 20)
538
539 /** set VPI into ATM cell header */
540 #define IX_NPE_A_ATMCELLHEADER_VPI_SET( header, vpi ) \
541 do { \
542     (header) &= ~VPI_MASK; \
543     (header) |= (((vpi) << 20) & VPI_MASK); \
544 } while(0)
545
546 /** Mask to acess VCI */
547 #define VCI_MASK        0x000ffff0
548
549 /** return VCI from ATM cell header */
550 #define IX_NPE_A_ATMCELLHEADER_VCI_GET( header ) \
551 (((header) & VCI_MASK) >> 4)
552
553 /** set VCI into ATM cell header */
554 #define IX_NPE_A_ATMCELLHEADER_VCI_SET( header, vci ) \
555 do { \
556     (header) &= ~VCI_MASK; \
557     (header) |= (((vci) << 4) & VCI_MASK); \
558 } while(0)
559
560 /** Mask to acess PTI */
561 #define PTI_MASK        0x0000000e
562
563 /** return PTI from ATM cell header */
564 #define IX_NPE_A_ATMCELLHEADER_PTI_GET( header ) \
565 (((header) & PTI_MASK) >> 1)
566
567 /** set PTI into ATM cell header */
568 #define IX_NPE_A_ATMCELLHEADER_PTI_SET( header, pti ) \
569 do { \
570     (header) &= ~PTI_MASK; \
571     (header) |= (((pti) << 1) & PTI_MASK); \
572 } while(0)
573
574 /** Mask to acess CLP */
575 #define CLP_MASK        0x00000001
576
577 /** return CLP from ATM cell header */
578 #define IX_NPE_A_ATMCELLHEADER_CLP_GET( header ) \
579 ((header) & CLP_MASK)
580
581 /** set CLP into ATM cell header */
582 #define IX_NPE_A_ATMCELLHEADER_CLP_SET( header, clp ) \
583 do { \
584     (header) &= ~CLP_MASK; \
585     (header) |= ((clp) & CLP_MASK); \
586 } while(0)
587
588
589 /*
590 * Definition of the Rx bitfield
591 *
592 * This would most conviently be defined as the bit field shown below.
593 * Endian portability prevents this, therefore a set of macros
594 * are defined to access the fields within the rxBitfield assumed to
595 * be passed as a UINT32.
596 *
597 * Changes to field sizes or orders must be reflected in the offset
598 * definitions above.
599 *
600 * Rx bitfield
601 *    struct
602 *    {   IX_NPEA_RXBITFIELD(
603 *        unsigned int status:1,
604 *        unsigned int port:7,
605 *        unsigned int vcId:8,
606 *        unsigned int currMbufSize:16);
607 *    } rxBitField;
608 *
609 */
610
611 /** Mask to acess the rxBitField status */
612 #define STATUS_MASK     0x80000000
613
614 /** return the rxBitField status */
615 #define IX_NPE_A_RXBITFIELD_STATUS_GET( rxbitfield ) \
616 (((rxbitfield) & STATUS_MASK) >> 31)
617
618 /** set the rxBitField status */
619 #define IX_NPE_A_RXBITFIELD_STATUS_SET( rxbitfield, status ) \
620 do { \
621     (rxbitfield) &= ~STATUS_MASK; \
622     (rxbitfield) |= (((status) << 31) & STATUS_MASK); \
623 } while(0)
624
625 /** Mask to acess the rxBitField port */
626 #define PORT_MASK       0x7f000000
627
628 /** return the rxBitField port */
629 #define IX_NPE_A_RXBITFIELD_PORT_GET( rxbitfield ) \
630 (((rxbitfield) & PORT_MASK) >> 24)
631
632 /** set the rxBitField port */
633 #define IX_NPE_A_RXBITFIELD_PORT_SET( rxbitfield, port ) \
634 do { \
635     (rxbitfield) &= ~PORT_MASK; \
636     (rxbitfield) |= (((port) << 24) & PORT_MASK); \
637 } while(0)
638
639 /** Mask to acess the rxBitField vcId */
640 #define VCID_MASK       0x00ff0000
641
642 /** return the rxBitField vcId */
643 #define IX_NPE_A_RXBITFIELD_VCID_GET( rxbitfield ) \
644 (((rxbitfield) & VCID_MASK) >> 16)
645
646 /** set the rxBitField vcId */
647 #define IX_NPE_A_RXBITFIELD_VCID_SET( rxbitfield, vcid ) \
648 do { \
649     (rxbitfield) &= ~VCID_MASK; \
650     (rxbitfield) |= (((vcid) << 16) & VCID_MASK); \
651 } while(0)
652
653 /** Mask to acess the rxBitField mbuf size */
654 #define CURRMBUFSIZE_MASK       0x0000ffff
655
656 /** return the rxBitField mbuf size */
657 #define IX_NPE_A_RXBITFIELD_CURRMBUFSIZE_GET( rxbitfield ) \
658 ((rxbitfield) & CURRMBUFSIZE_MASK)
659
660 /** set the rxBitField mbuf size */
661 #define IX_NPE_A_RXBITFIELD_CURRMBUFSIZE_SET( rxbitfield, currmbufsize ) \
662 do { \
663     (rxbitfield) &= ~CURRMBUFSIZE_MASK; \
664     (rxbitfield) |= ((currmbufsize) & CURRMBUFSIZE_MASK); \
665 } while(0)
666
667
668
669 /**
670  * @brief Tx Descriptor definition
671  */
672 typedef struct
673 {
674     UINT8 port;                         /**< Tx Port number */
675     UINT8 aalType;                      /**< AAL Type */
676     UINT16 currMbufLen;                 /**< mbuf length */
677     UINT32 atmCellHeader;               /**< ATM cell header */
678     IX_OSAL_MBUF *pCurrMbuf;            /**< pointer to mbuf */
679     unsigned char *pCurrMbufData;       /**< Pointer to mbuf->dat */
680     IX_OSAL_MBUF *pNextMbuf;            /**< Pointer to next mbuf */
681     UINT32  totalLen;                   /**< Total Length */
682     UINT32  aal5CrcResidue;             /**< AAL5 CRC Residue */
683 } IxNpeA_TxAtmVc;
684
685 /* Changes to field sizes or orders must be reflected in the offset
686  * definitions above. */
687
688
689
690
691 /**
692  * @brief Rx Descriptor definition
693  */
694 typedef struct
695 {
696     UINT32  rxBitField;                 /**< Received bit field */
697     UINT32  atmCellHeader;              /**< ATM Cell Header */
698     UINT32  rsvdWord0;                  /**< Reserved field */
699     UINT16  currMbufLen;                /**< Mbuf Length */
700     UINT8   timeLimit;                  /**< Payload Reassembly timeLimit (used for aal0_xx only) */
701     UINT8   rsvdByte0;                  /**< Reserved field */ 
702     UINT32  rsvdWord1;                  /**< Reserved field */
703     IX_OSAL_MBUF *pCurrMbuf;            /**< Pointer to current mbuf */
704     unsigned char *pCurrMbufData;       /**< Pointer to current mbuf->data */
705     IX_OSAL_MBUF *pNextMbuf;            /**< Pointer to next mbuf */
706     UINT32  totalLen;                   /**< Total Length */
707     UINT32  aal5CrcResidue;             /**< AAL5 CRC Residue */
708 } IxNpeA_RxAtmVc;
709
710
711 /**
712  * @brief NPE-A AAL Type
713  */
714 typedef enum
715 {
716     IX_NPE_A_AAL_TYPE_INVALID = 0,      /**< Invalid AAL type */
717     IX_NPE_A_AAL_TYPE_0_48    = 0x1,    /**< AAL0 - 48 byte */
718     IX_NPE_A_AAL_TYPE_0_52    = 0x2,    /**< AAL0 - 52 byte */
719     IX_NPE_A_AAL_TYPE_5       = 0x5,    /**< AAL5 */
720     IX_NPE_A_AAL_TYPE_OAM     = 0xF     /**< OAM */
721 } IxNpeA_AalType;
722
723 /**
724  * @brief NPE-A Payload format 52-bytes & 48-bytes
725  */
726 typedef enum
727 {
728     IX_NPE_A_52_BYTE_PAYLOAD = 0,       /**< 52 byte payload */
729     IX_NPE_A_48_BYTE_PAYLOAD            /**< 48 byte payload */
730 } IxNpeA_PayloadFormat;
731
732 /**
733  * @brief  HSS Packetized NpePacket Descriptor Structure
734  */
735 typedef struct
736 {
737     UINT8   status;             /**< Status of the packet passed to the client */
738     UINT8   errorCount;         /**< Number of errors */
739     UINT8   chainCount;         /**< Mbuf chain count e.g. 0 - No mbuf chain */
740     UINT8   rsvdByte0;          /**< Reserved byte to make the descriptor word align */
741
742     UINT16  packetLength;       /**< Packet Length */
743     UINT16  rsvdShort0;         /**< Reserved short to make the descriptor a word align */
744
745     IX_OSAL_MBUF *pRootMbuf;    /**< Pointer to Root mbuf */
746     IX_OSAL_MBUF *pNextMbuf;    /**< Pointer to next mbuf */
747     UINT8   *pMbufData;         /**< Pointer to the current mbuf->data */
748     UINT32  mbufLength;         /**< Current mbuf length */
749
750 } IxNpeA_NpePacketDescriptor;
751
752
753 #endif
754 /**
755  *@}
756  */
757
758 #endif /* __doxygen_HIDE */