blob: 20bfa76c363c39fb97f0e1b4a2de2ba8e45dcd70 [file] [log] [blame]
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02001#ifndef __doxygen_HIDE /* This file is not part of the API */
2
3/**
4 * @file IxEthNpe.h
5 *
6 * @par
7 * IXP400 SW Release version 2.0
8 *
9 * -- Copyright Notice --
10 *
11 * @par
12 * Copyright 2001-2005, Intel Corporation.
13 * All rights reserved.
14 *
15 * @par
Wolfgang Denkc57eadc2013-07-28 22:12:47 +020016 * SPDX-License-Identifier: BSD-3-Clause
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020017 * @par
18 * -- End of Copyright Notice --
19*/
20
21/**
22 * @defgroup IxEthNpe IXP400 Ethernet NPE (IxEthNpe) API
23 *
24 * @brief Contains the API for Ethernet NPE.
25 *
26 * All messages given to NPE, get back an acknowledgment. The acknowledgment
27 * is identical to the message sent to the NPE (except for NPE_GETSTATUS message).
28 *
29 * @{
30 */
31
32
33/*--------------------------------------------------------------------------
34 * APB Message IDs - XScale->NPE
35 *------------------------------------------------------------------------*/
36
37/**
38 * @def IX_ETHNPE_NPE_GETSTATUS
39 *
40 * @brief Request from the XScale client for the NPE to return the firmware
41 * version of the currently executing image.
42 *
43 * Acknowledgment message id is same as the request message id.
44 * NPE returns the firmware version ID to XScale.
45 */
46#define IX_ETHNPE_NPE_GETSTATUS 0x00
47
48/**
49 * @def IX_ETHNPE_EDB_SETPORTADDRESS
50 *
51 * @brief Request from the XScale client for the NPE to set the Ethernet
52 * port's port ID and MAC address.
53 */
54#define IX_ETHNPE_EDB_SETPORTADDRESS 0x01
55
56/**
57 * @def IX_ETHNPE_EDB_GETMACADDRESSDATABASE
58 *
59 * @brief Request from XScale client to the NPE requesting upload of
60 * Ethernet Filtering Database or Header Conversion Database from NPE's
61 * data memory to XScale accessible SDRAM.
62 */
63#define IX_ETHNPE_EDB_GETMACADDRESSDATABASE 0x02
64
65/**
66 * @def IX_ETHNPE_EDB_SETMACADDRESSSDATABASE
67 *
68 * @brief Request from XScale client to the NPE requesting download of
69 * Ethernet Filtering Database or Header Conversion Database from SDRAM
70 * to the NPE's datamemory.
71 */
72#define IX_ETHNPE_EDB_SETMACADDRESSSDATABASE 0x03
73
74/**
75 * @def IX_ETHNPE_GETSTATS
76 *
77 * @brief Request from the XScale client for the current MAC port statistics
78 * data to be written to the (empty) statistics structure and the specified
79 * location in externa memory.
80 */
81#define IX_ETHNPE_GETSTATS 0x04
82
83/**
84 * @def IX_ETHNPE_RESETSTATS
85 *
86 * @brief Request from the XScale client to the NPE to reset all of its internal
87 * MAC port statistics state variables.
88 *
89 * As a side effect, this message entails an implicit request that the NPE
90 * write the current MAC port statistics into the MAC statistics structure
91 * at the specified location in external memory.
92 */
93#define IX_ETHNPE_RESETSTATS 0x05
94
95/**
96 * @def IX_ETHNPE_SETMAXFRAMELENGTHS
97 *
98 * @brief Request from the XScale client to the NPE to configure maximum framelengths
99 * and block sizes in receive and transmit direction.
100 */
101#define IX_ETHNPE_SETMAXFRAMELENGTHS 0x06
102
103/**
104 * @def IX_ETHNPE_VLAN_SETRXTAGMODE
105 *
106 * @brief Request from the XScale client to the NPE to configure VLAN frame type
107 * filtering and VLAN the tagging mode for the receiver.
108 */
109#define IX_ETHNPE_VLAN_SETRXTAGMODE 0x07
110
111/**
112 * @def IX_ETHNPE_VLAN_SETDEFAULTRXVID
113 *
114 * @brief Request from the XScale client to the NPE to set receiver's default
115 * VLAN tag (PVID)and internal traffic class.
116 */
117#define IX_ETHNPE_VLAN_SETDEFAULTRXVID 0x08
118
119/**
120 * @def IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY
121 *
122 * @brief Request from the XScale client to the NPE to configure VLAN Port
123 * membership and Tx tagging for 8 consecutive VLANID's.
124 */
125#define IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY 0x09
126
127/**
128 * @def IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE
129 *
130 * @brief Request from the XScale client to the NPE to configure VLAN Port
131 * membership and Tx tagging for a range of VLANID's.
132 */
133#define IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE 0x0A
134
135/**
136 * @def IX_ETHNPE_VLAN_SETRXQOSENTRY
137 *
138 * @brief Request from the XScale client to the NPE to map a user priority
139 * to QoS class and an AQM queue number.
140 */
141#define IX_ETHNPE_VLAN_SETRXQOSENTRY 0x0B
142
143/**
144 * @def IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE
145 *
146 * @brief Request from the XScale client to the NPE to enable or disable
147 * portID extraction from VLAN-tagged frames for the specified port.
148 */
149#define IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE 0x0C
150
151/**
152 * @def IX_ETHNPE_STP_SETBLOCKINGSTATE
153 *
154 * @brief Request from the XScale client to the NPE to block or unblock
155 * forwarding for spanning tree BPDUs.
156 */
157#define IX_ETHNPE_STP_SETBLOCKINGSTATE 0x0D
158
159/**
160 * @def IX_ETHNPE_FW_SETFIREWALLMODE
161 *
162 * @brief Request from the XScale client to the NPE to configure firewall
163 * services modes of operation and/or download Ethernet Firewall Database from
164 * SDRAM to NPE.
165 */
166#define IX_ETHNPE_FW_SETFIREWALLMODE 0x0E
167
168/**
169 * @def IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID
170 *
171 * @brief Request from the XScale client to the NPE to set global frame control
172 * and duration/ID field for the 802.3 to 802.11 protocol header conversion
173 * service.
174 */
175#define IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID 0x0F
176
177/**
178 * @def IX_ETHNPE_PC_SETBBSID
179 *
180 * @brief Request from the XScale client to the NPE to set global BBSID field
181 * value for the 802.3 to 802.11 protocol header conversion service.
182 */
183#define IX_ETHNPE_PC_SETBBSID 0x10
184
185/**
186 * @def IX_ETHNPE_PC_SETAPMACTABLE
187 *
188 * @brief Request from the XScale client to the NPE to update a block/section/
189 * range of the AP MAC Address Table.
190 */
191#define IX_ETHNPE_PC_SETAPMACTABLE 0x11
192
193/**
194 * @def IX_ETHNPE_SETLOOPBACK_MODE
195 *
196 * @brief Turn on or off the NPE frame loopback.
197 */
198#define IX_ETHNPE_SETLOOPBACK_MODE (0x12)
199
200/*--------------------------------------------------------------------------
201 * APB Message IDs - NPE->XScale
202 *------------------------------------------------------------------------*/
203
204/**
205 * @def IX_ETHNPE_NPE_GETSTATUS_ACK
206 *
207 * @brief Acknowledgment to IX_ETHNPE_NPE_GETSTATUS message. NPE firmware version
208 * id is returned in the message.
209 */
210#define IX_ETHNPE_NPE_GETSTATUS_ACK 0x00
211
212/**
213 * @def IX_ETHNPE_EDB_SETPORTADDRESS_ACK
214 *
215 * @brief Acknowledgment to IX_ETHNPE_EDB_SETPORTADDRESS message.
216 */
217#define IX_ETHNPE_EDB_SETPORTADDRESS_ACK 0x01
218
219/**
220 * @def IX_ETHNPE_EDB_GETMACADDRESSDATABASE_ACK
221 *
222 * @brief Acknowledgment to IX_ETHNPE_EDB_GETMACADDRESSDATABASE message
223 */
224#define IX_ETHNPE_EDB_GETMACADDRESSDATABASE_ACK 0x02
225
226/**
227 * @def IX_ETHNPE_EDB_SETMACADDRESSSDATABASE_ACK
228 *
229 * @brief Acknowledgment to IX_ETHNPE_EDB_SETMACADDRESSSDATABASE message.
230 */
231#define IX_ETHNPE_EDB_SETMACADDRESSSDATABASE_ACK 0x03
232
233/**
234 * @def IX_ETHNPE_GETSTATS_ACK
235 *
236 * @brief Acknowledgment to IX_ETHNPE_GETSTATS message.
237 */
238#define IX_ETHNPE_GETSTATS_ACK 0x04
239
240/**
241 * @def IX_ETHNPE_RESETSTATS_ACK
242 *
243 * @brief Acknowledgment to IX_ETHNPE_RESETSTATS message.
244 */
245#define IX_ETHNPE_RESETSTATS_ACK 0x05
246
247/**
248 * @def IX_ETHNPE_SETMAXFRAMELENGTHS_ACK
249 *
250 * @brief Acknowledgment to IX_ETHNPE_SETMAXFRAMELENGTHS message.
251 */
252#define IX_ETHNPE_SETMAXFRAMELENGTHS_ACK 0x06
253
254/**
255 * @def IX_ETHNPE_VLAN_SETRXTAGMODE_ACK
256 *
257 * @brief Acknowledgment to IX_ETHNPE_VLAN_SETRXTAGMODE message.
258 */
259#define IX_ETHNPE_VLAN_SETRXTAGMODE_ACK 0x07
260
261/**
262 * @def IX_ETHNPE_VLAN_SETDEFAULTRXVID_ACK
263 *
264 * @brief Acknowledgment to IX_ETHNPE_VLAN_SETDEFAULTRXVID message.
265 */
266#define IX_ETHNPE_VLAN_SETDEFAULTRXVID_ACK 0x08
267
268/**
269 * @def IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY_ACK
270 *
271 * @brief Acknowledgment to IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY message.
272 */
273#define IX_ETHNPE_VLAN_SETPORTVLANTABLEENTRY_ACK 0x09
274
275/**
276 * @def IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE_ACK
277 *
278 * @brief Acknowledgment to IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE message.
279 */
280#define IX_ETHNPE_VLAN_SETPORTVLANTABLERANGE_ACK 0x0A
281
282/**
283 * @def IX_ETHNPE_VLAN_SETRXQOSENTRY_ACK
284 *
285 * @brief Acknowledgment to IX_ETHNPE_VLAN_SETRXQOSENTRY message.
286 */
287#define IX_ETHNPE_VLAN_SETRXQOSENTRY_ACK 0x0B
288
289/**
290 * @def IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE_ACK
291 *
292 * @brief Acknowledgment to IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE message.
293 */
294#define IX_ETHNPE_VLAN_SETPORTIDEXTRACTIONMODE_ACK 0x0C
295
296/**
297 * @def IX_ETHNPE_STP_SETBLOCKINGSTATE_ACK
298 *
299 * @brief Acknowledgment to IX_ETHNPE_STP_SETBLOCKINGSTATE message.
300 */
301#define IX_ETHNPE_STP_SETBLOCKINGSTATE_ACK 0x0D
302
303/**
304 * @def IX_ETHNPE_FW_SETFIREWALLMODE_ACK
305 *
306 * @brief Acknowledgment to IX_ETHNPE_FW_SETFIREWALLMODE message.
307 */
308#define IX_ETHNPE_FW_SETFIREWALLMODE_ACK 0x0E
309
310/**
311 * @def IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID_ACK
312 *
313 * @brief Acknowledgment to IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID message.
314 */
315#define IX_ETHNPE_PC_SETFRAMECONTROLDURATIONID_ACK 0x0F
316
317/**
318 * @def IX_ETHNPE_PC_SETBBSID_ACK
319 *
320 * @brief Acknowledgment to IX_ETHNPE_PC_SETBBSID message.
321 */
322#define IX_ETHNPE_PC_SETBBSID_ACK 0x10
323
324/**
325 * @def IX_ETHNPE_PC_SETAPMACTABLE_ACK
326 *
327 * @brief Acknowledgment to IX_ETHNPE_PC_SETAPMACTABLE message.
328 */
329#define IX_ETHNPE_PC_SETAPMACTABLE_ACK 0x11
330
331/**
332 * @def IX_ETHNPE_SETLOOPBACK_MODE_ACK
333 *
334 * @brief Acknowledgment to IX_ETHNPE_SETLOOPBACK_MODE message.
335 */
336#define IX_ETHNPE_SETLOOPBACK_MODE_ACK (0x12)
337
338/*--------------------------------------------------------------------------
339 * Queue Manager Queue entry bit field boundary definitions
340 *------------------------------------------------------------------------*/
341
342/**
343 * @def MASK(hi,lo)
344 *
345 * @brief Macro for mask
346 */
347#define MASK(hi,lo) (((1 << (1 + ((hi) - (lo)))) - 1) << (lo))
348
349/**
350 * @def BITS(x,hi,lo)
351 *
352 * @brief Macro for bits
353 */
354#define BITS(x,hi,lo) (((x) & MASK(hi,lo)) >> (lo))
355
356/**
357 * @def IX_ETHNPE_QM_Q_RXENET_LENGTH_MASK
358 *
359 * @brief QMgr Queue LENGTH field mask
360 */
361#define IX_ETHNPE_QM_Q_RXENET_LENGTH_MASK 0x3fff
362
363/**
364 * @def IX_ETHNPE_QM_Q_FIELD_FLAG_R
365 *
366 * @brief QMgr Queue FLAG field right boundary
367 */
368#define IX_ETHNPE_QM_Q_FIELD_FLAG_R 20
369
370/**
371 * @def IX_ETHNPE_QM_Q_FIELD_FLAG_MASK
372 *
373 * @brief QMgr Queue FLAG field mask
374 *
375 * Multicast bit : BIT(4)
376 * Broadcast bit : BIT(5)
377 * IP bit : BIT(6) (linux only)
378 *
379 */
380#ifdef __vxworks
381#define IX_ETHNPE_QM_Q_FIELD_FLAG_MASK 0x30
382#else
383#define IX_ETHNPE_QM_Q_FIELD_FLAG_MASK 0x70
384#endif
385
386
387/**
388 * @def IX_ETHNPE_QM_Q_FIELD_NPEID_L
389 *
390 * @brief QMgr Queue NPE ID field left boundary
391 */
392#define IX_ETHNPE_QM_Q_FIELD_NPEID_L 1
393
394/**
395 * @def IX_ETHNPE_QM_Q_FIELD_NPEID_R
396 *
397 * @brief QMgr Queue NPE ID field right boundary
398 */
399#define IX_ETHNPE_QM_Q_FIELD_NPEID_R 0
400
401/**
402 * @def IX_ETHNPE_QM_Q_FIELD_PRIOR_L
403 *
404 * @brief QMgr Queue Priority field left boundary
405 */
406#define IX_ETHNPE_QM_Q_FIELD_PRIOR_L 2
407
408/**
409 * @def IX_ETHNPE_QM_Q_FIELD_PRIOR_R
410 *
411 * @brief QMgr Queue Priority field right boundary
412 */
413#define IX_ETHNPE_QM_Q_FIELD_PRIOR_R 0
414
415/**
416 * @def IX_ETHNPE_QM_Q_FIELD_ADDR_L
417 *
418 * @brief QMgr Queue Address field left boundary
419 */
420#define IX_ETHNPE_QM_Q_FIELD_ADDR_L 31
421
422/**
423 * @def IX_ETHNPE_QM_Q_FIELD_ADDR_R
424 *
425 * @brief QMgr Queue Address field right boundary
426 */
427#define IX_ETHNPE_QM_Q_FIELD_ADDR_R 5
428
429/*--------------------------------------------------------------------------
430 * Queue Manager Queue entry bit field masks
431 *------------------------------------------------------------------------*/
432
433/**
434 * @def IX_ETHNPE_QM_Q_FREEENET_ADDR_MASK
435 *
436 * @brief Macro to mask the Address field of the FreeEnet Queue Manager Entry
437 */
438#define IX_ETHNPE_QM_Q_FREEENET_ADDR_MASK \
439 MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
440 IX_ETHNPE_QM_Q_FIELD_ADDR_R)
441
442/**
443 * @def IX_ETHNPE_QM_Q_RXENET_NPEID_MASK
444 *
445 * @brief Macro to mask the NPE ID field of the RxEnet Queue Manager Entry
446 */
447#define IX_ETHNPE_QM_Q_RXENET_NPEID_MASK \
448 MASK (IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
449 IX_ETHNPE_QM_Q_FIELD_NPEID_R)
450
451/**
452 * @def IX_ETHNPE_QM_Q_RXENET_ADDR_MASK
453 *
454 * @brief Macro to mask the Mbuf Address field of the RxEnet Queue Manager Entry
455 */
456#define IX_ETHNPE_QM_Q_RXENET_ADDR_MASK \
457 MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
458 IX_ETHNPE_QM_Q_FIELD_ADDR_R)
459
460/**
461 * @def IX_ETHNPE_QM_Q_TXENET_PRIOR_MASK
462 *
463 * @brief Macro to mask the Priority field of the TxEnet Queue Manager Entry
464 */
465#define IX_ETHNPE_QM_Q_TXENET_PRIOR_MASK \
466 MASK (IX_ETHNPE_QM_Q_FIELD_PRIOR_L, \
467 IX_ETHNPE_QM_Q_FIELD_PRIOR_R)
468
469/**
470 * @def IX_ETHNPE_QM_Q_TXENET_ADDR_MASK
471 *
472 * @brief Macro to mask the Mbuf Address field of the TxEnet Queue Manager Entry
473 */
474#define IX_ETHNPE_QM_Q_TXENET_ADDR_MASK \
475 MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
476 IX_ETHNPE_QM_Q_FIELD_ADDR_R)
477
478/**
479 * @def IX_ETHNPE_QM_Q_TXENETDONE_NPEID_MASK
480 *
481 * @brief Macro to mask the NPE ID field of the TxEnetDone Queue Manager Entry
482 */
483#define IX_ETHNPE_QM_Q_TXENETDONE_NPEID_MASK \
484 MASK (IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
485 IX_ETHNPE_QM_Q_FIELD_NPEID_R)
486
487/**
488 * @def IX_ETHNPE_QM_Q_TXENETDONE_ADDR_MASK
489 *
490 * @brief Macro to mask the Mbuf Address field of the TxEnetDone Queue Manager
491 * Entry
492 */
493#define IX_ETHNPE_QM_Q_TXENETDONE_ADDR_MASK \
494 MASK (IX_ETHNPE_QM_Q_FIELD_ADDR_L, \
495 IX_ETHNPE_QM_Q_FIELD_ADDR_R)
496
497/*--------------------------------------------------------------------------
498 * Queue Manager Queue entry bit field value extraction macros
499 *------------------------------------------------------------------------*/
500
501/**
502 * @def IX_ETHNPE_QM_Q_FREEENET_ADDR_VAL(x)
503 *
504 * @brief Extraction macro for Address field of FreeNet Queue Manager Entry
505 *
506 * Pointer to an mbuf buffer descriptor
507 */
508#define IX_ETHNPE_QM_Q_FREEENET_ADDR_VAL(x) \
509 ((x) & IX_ETHNPE_QM_Q_FREEENET_ADDR_MASK)
510
511/**
512 * @def IX_ETHNPE_QM_Q_RXENET_NPEID_VAL(x)
513 *
514 * @brief Extraction macro for NPE ID field of RxEnet Queue Manager Entry
515 *
516 * Set to 0 for entries originating from the Eth0 NPE;
517 * Set to 1 for entries originating from the Eth1 NPE.
518 */
519#define IX_ETHNPE_QM_Q_RXENET_NPEID_VAL(x) \
520 BITS (x, IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
521 IX_ETHNPE_QM_Q_FIELD_NPEID_R)
522
523/**
524 * @def IX_ETHNPE_QM_Q_RXENET_PORTID_VAL(x)
525 *
526 * @brief Extraction macro for Port ID field of RxEnet Queue Manager Entry
527 *
528 * 0-5: Assignable (by the XScale client) to any of the physical ports.
529 * 6: It is reserved
530 * 7: Indication that the NPE did not find the associated frame's destination MAC address within
531 * its internal filtering database.
532 */
533#define IX_ETHNPE_QM_Q_RXENET_PORTID_VAL(x) \
534 BITS (x, IX_ETHNPE_QM_Q_FIELD_PORTID_L, \
535 IX_ETHNPE_QM_Q_Field_PortID_R)
536
537/**
538 * @def IX_ETHNPE_QM_Q_RXENET_ADDR_VAL(x)
539 *
540 * @brief Extraction macro for Address field of RxEnet Queue Manager Entry
541 *
542 * Pointer to an mbuf buffer descriptor
543 */
544#define IX_ETHNPE_QM_Q_RXENET_ADDR_VAL(x) \
545 ((x) & IX_ETHNPE_QM_Q_RXENET_ADDR_MASK)
546
547/**
548 * @def IX_ETHNPE_QM_Q_TXENET_PRIOR_VAL(x)
549 *
550 * @brief Extraction macro for Priority field of TxEnet Queue Manager Entry
551 *
552 * Priority of the packet (as described in IEEE 802.1D). This field is
553 * cleared upon return from the Ethernet NPE to the TxEnetDone queue.
554 */
555#define IX_ETHNPE_QM_Q_TXENET_PRIOR_VAL(x) \
556 BITS (x, IX_ETHNPE_QM_Q_FIELD_PRIOR_L, \
557 IX_ETHNPE_QM_Q_FIELD_PRIOR_R)
558
559/**
560 * @def IX_ETHNPE_QM_Q_TXENET_ADDR_VAL(x)
561 *
562 * @brief Extraction macro for Address field of Queue Manager TxEnet Queue
563 * Manager Entry
564 *
565 * Pointer to an mbuf buffer descriptor
566 */
567#define IX_ETHNPE_QM_Q_TXENET_ADDR_VAL(x) \
568 ((x) & IX_ETHNPE_QM_Q_TXENET_ADDR_MASK)
569
570/**
571 * @def IX_ETHNPE_QM_Q_TXENETDONE_NPEID_VAL(x)
572 *
573 * @brief Extraction macro for NPE ID field of TxEnetDone Queue Manager Entry
574 *
575 * Set to 0 for entries originating from the Eth0 NPE; set to 1 for en-tries
576 * originating from the Eth1 NPE.
577 */
578#define IX_ETHNPE_QM_Q_TXENETDONE_NPEID_VAL(x) \
579 BITS (x, IX_ETHNPE_QM_Q_FIELD_NPEID_L, \
580 IX_ETHNPE_QM_Q_FIELD_NPEID_R)
581
582/**
583 * @def IX_ETHNPE_QM_Q_TXENETDONE_ADDR_VAL(x)
584 *
585 * @brief Extraction macro for Address field of TxEnetDone Queue Manager Entry
586 *
587 * Pointer to an mbuf buffer descriptor
588 */
589#define IX_ETHNPE_QM_Q_TXENETDONE_ADDR_VAL(x) \
590 ((x) & IX_ETHNPE_QM_Q_TXENETDONE_ADDR_MASK)
591
592
593/*--------------------------------------------------------------------------
594 * NPE limits
595 *------------------------------------------------------------------------*/
596
597/**
598 * @def IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MIN
599 *
600 * @brief Macro to check the minimum length of a rx free buffer
601 */
602#define IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MIN (64)
603
604/**
605 * @def IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MASK
606 *
607 * @brief Mask to apply to the mbuf length before submitting it to the NPE
608 * (the NPE handles only rx free mbufs which are multiple of 64)
609 *
610 * @sa IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MASK
611 */
612#define IX_ETHNPE_ACC_RXFREE_BUFFER_LENGTH_MASK (~63)
613
614/**
615 * @def IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_UP(size)
616 *
617 * @brief Round up to get the size necessary to receive without chaining
618 * the frames which are (size) bytes (the NPE operates by multiple of 64)
619 * e.g. To receive 1514 bytes frames, the size of the buffers in replenish
620 * has to be at least (1514+63)&(~63) = 1536 bytes.
621 *
622 */
623#define IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_UP(size) (((size) + 63) & ~63)
624
625/**
626 * @def IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_DOWN(size)
627 *
628 * @brief Round down to apply to the mbuf length before submitting
629 * it to the NPE. (the NPE operates by multiple of 64)
630 *
631 */
632#define IX_ETHNPE_ACC_RXFREE_BUFFER_ROUND_DOWN(size) ((size) & ~63)
633
634/**
635 * @def IX_ETHNPE_ACC_FRAME_LENGTH_MAX
636 *
637 * @brief maximum mbuf length supported by the NPE
638 *
639 * @sa IX_ETHNPE_ACC_FRAME_LENGTH_MAX
640 */
641#define IX_ETHNPE_ACC_FRAME_LENGTH_MAX (16320)
642
643/**
644 * @def IX_ETHNPE_ACC_FRAME_LENGTH_DEFAULT
645 *
646 * @brief default mbuf length supported by the NPE
647 *
648 * @sa IX_ETHNPE_ACC_FRAME_LENGTH_DEFAULT
649 */
650#define IX_ETHNPE_ACC_FRAME_LENGTH_DEFAULT (1522)
651
652/**
653 * @def IX_ETHNPE_ACC_LENGTH_OFFSET
654 *
655 * @brief Offset of the cluster length field in the word shared with the NPEs
656 */
657#define IX_ETHNPE_ACC_LENGTH_OFFSET 16
658
659/**
660 * @def IX_ETHNPE_ACC_PKTLENGTH_MASK
661 *
662 * @brief Mask of the cluster length field in the word shared with the NPEs
663 */
664#define IX_ETHNPE_ACC_PKTLENGTH_MASK 0x3fff
665
666
667/**
668 *@}
669 */
670
671#endif /* __doxygen_HIDE */