3 * @brief this file contains the public API of @ref IxEthAcc component
6 * The IX_OSAL_MBUF address is to be specified on bits [31-5] and must
7 * be cache aligned (bits[4-0] cleared)
11 * IXP400 SW Release version 2.0
13 * -- Copyright Notice --
16 * Copyright 2001-2005, Intel Corporation.
17 * All rights reserved.
20 * SPDX-License-Identifier: BSD-3-Clause
22 * -- End of Copyright Notice --
29 #include <IxOsBuffMgt.h>
33 * @defgroup IxEthAcc IXP400 Ethernet Access (IxEthAcc) API
35 * @brief ethAcc is a library that does provides access to the internal IXP400 10/100Bt Ethernet MACs.
42 * @brief Definition of the Ethernet Access status
44 typedef enum /* IxEthAccStatus */
46 IX_ETH_ACC_SUCCESS = IX_SUCCESS, /**< return success*/
47 IX_ETH_ACC_FAIL = IX_FAIL, /**< return fail*/
48 IX_ETH_ACC_INVALID_PORT, /**< return invalid port*/
49 IX_ETH_ACC_PORT_UNINITIALIZED, /**< return uninitialized*/
50 IX_ETH_ACC_MAC_UNINITIALIZED, /**< return MAC uninitialized*/
51 IX_ETH_ACC_INVALID_ARG, /**< return invalid arg*/
52 IX_ETH_TX_Q_FULL, /**< return tx queue is full*/
53 IX_ETH_ACC_NO_SUCH_ADDR /**< return no such address*/
58 * @enum IxEthAccPortId
59 * @brief Definition of the IXP400 Mac Ethernet device.
63 IX_ETH_PORT_1 = 0, /**< Ethernet Port 1 */
64 IX_ETH_PORT_2 = 1 /**< Ethernet port 2 */
65 ,IX_ETH_PORT_3 = 2 /**< Ethernet port 3 */
71 * @def IX_ETH_ACC_NUMBER_OF_PORTS
73 * @brief Definition of the number of ports
77 #define IX_ETH_ACC_NUMBER_OF_PORTS (3)
79 #define IX_ETH_ACC_NUMBER_OF_PORTS (2)
85 * @def IX_IEEE803_MAC_ADDRESS_SIZE
87 * @brief Definition of the size of the MAC address
90 #define IX_IEEE803_MAC_ADDRESS_SIZE (6)
95 * @brief Definition of the IEEE 802.3 Ethernet MAC address structure.
97 * The data should be packed with bytes xx:xx:xx:xx:xx:xx
99 * The data must be packed in network byte order.
103 UINT8 macAddress[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< MAC address */
108 * @def IX_ETH_ACC_NUM_TX_PRIORITIES
109 * @brief Definition of the number of transmit priorities
112 #define IX_ETH_ACC_NUM_TX_PRIORITIES (8)
116 * @enum IxEthAccTxPriority
117 * @brief Definition of the relative priority used to transmit a frame
122 IX_ETH_ACC_TX_PRIORITY_0 = 0, /**<Lowest Priority submission */
123 IX_ETH_ACC_TX_PRIORITY_1 = 1, /**<submission prority of 1 (0 is lowest)*/
124 IX_ETH_ACC_TX_PRIORITY_2 = 2, /**<submission prority of 2 (0 is lowest)*/
125 IX_ETH_ACC_TX_PRIORITY_3 = 3, /**<submission prority of 3 (0 is lowest)*/
126 IX_ETH_ACC_TX_PRIORITY_4 = 4, /**<submission prority of 4 (0 is lowest)*/
127 IX_ETH_ACC_TX_PRIORITY_5 = 5, /**<submission prority of 5 (0 is lowest)*/
128 IX_ETH_ACC_TX_PRIORITY_6 = 6, /**<submission prority of 6 (0 is lowest)*/
129 IX_ETH_ACC_TX_PRIORITY_7 = 7, /**<Highest priority submission */
131 IX_ETH_ACC_TX_DEFAULT_PRIORITY = IX_ETH_ACC_TX_PRIORITY_0 /**< By default send all
132 packets with lowest priority */
133 } IxEthAccTxPriority;
137 * @enum IxEthAccRxFrameType
138 * @brief Identify the type of a frame.
140 * @sa IX_ETHACC_NE_FLAGS
141 * @sa IX_ETHACC_NE_LINKMASK
145 IX_ETHACC_RX_LLCTYPE = 0x00, /**< 802.3 - 8802, with LLC/SNAP */
146 IX_ETHACC_RX_ETHTYPE = 0x10, /**< 802.3 (Ethernet) without LLC/SNAP */
147 IX_ETHACC_RX_STATYPE = 0x20, /**< 802.11, AP <=> STA */
148 IX_ETHACC_RX_APTYPE = 0x30 /**< 802.11, AP <=> AP */
149 } IxEthAccRxFrameType;
153 * @enum IxEthAccDuplexMode
154 * @brief Definition to provision the duplex mode of the MAC.
159 IX_ETH_ACC_FULL_DUPLEX, /**< Full duplex operation of the MAC */
160 IX_ETH_ACC_HALF_DUPLEX /**< Half duplex operation of the MAC */
161 } IxEthAccDuplexMode;
167 * @brief Definition of service-specific informations.
169 * This structure defines the Ethernet service-specific informations
170 * and enable QoS and VLAN features.
174 UINT32 ixReserved_next; /**< reserved for chaining */
175 UINT32 ixReserved_lengths; /**< reserved for buffer lengths */
176 UINT32 ixReserved_data; /**< reserved for buffer pointer */
177 UINT8 ixDestinationPortId; /**< Destination portId for this packet, if known by NPE */
178 UINT8 ixSourcePortId; /**< Source portId for this packet */
179 UINT16 ixFlags; /**< BitField of option for this frame */
180 UINT8 ixQoS; /**< QoS class of the frame */
181 UINT8 ixReserved; /**< reserved */
182 UINT16 ixVlanTCI; /**< Vlan TCI */
183 UINT8 ixDestMac[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< Destination MAC address */
184 UINT8 ixSourceMac[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< Source MAC address */
190 * @def IX_ETHACC_NE_PORT_UNKNOWN
192 * @brief Contents of the field @a IX_ETHACC_NE_DESTPORTID when no
193 * destination port can be found by the NPE for this frame.
196 #define IX_ETHACC_NE_PORT_UNKNOWN (0xff)
201 * @def IX_ETHACC_NE_DESTMAC
203 * @brief The location of the destination MAC address in the Mbuf header.
206 #define IX_ETHACC_NE_DESTMAC(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixDestMac
211 * @def IX_ETHACC_NE_SOURCEMAC
213 * @brief The location of the source MAC address in the Mbuf header.
216 #define IX_ETHACC_NE_SOURCEMAC(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixSourceMac
221 * @def IX_ETHACC_NE_VLANTCI
223 * @brief The VLAN Tag Control Information associated with this frame
225 * The VLAN Tag Control Information associated with this frame. On Rx
226 * path, this field is extracted from the packet header.
227 * On Tx path, the value of this field is inserted in the frame when
228 * the port is configured to insert or replace vlan tags in the
231 * @sa IX_ETHACC_NE_FLAGS
233 #define IX_ETHACC_NE_VLANTCI(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixVlanTCI
238 * @def IX_ETHACC_NE_SOURCEPORTID
240 * @brief The port where this frame came from.
242 * The port where this frame came from. This field is set on receive
243 * with the port information. This field is ignored on Transmit path.
245 #define IX_ETHACC_NE_SOURCEPORTID(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixSourcePortId
250 * @def IX_ETHACC_NE_DESTPORTID
252 * @brief The destination port where this frame should be sent.
254 * The destination port where this frame should be sent.
256 * @li In the transmit direction, this field contains the destination port
257 * and is ignored unless @a IX_ETHACC_NE_FLAG_DST is set.
259 * @li In the receive direction, this field contains the port where the
260 * destination MAC addresses has been learned. If the destination
261 * MAC address is unknown, then this value is set to the reserved value
262 * @a IX_ETHACC_NE_PORT_UNKNOWN
265 #define IX_ETHACC_NE_DESTPORTID(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixDestinationPortId
270 * @def IX_ETHACC_NE_QOS
272 * @brief QualityOfService class (QoS) for this received frame.
275 #define IX_ETHACC_NE_QOS(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixQoS
280 * @def IX_ETHACC_NE_FLAGS
282 * @brief Bit Mask of the different flags associated with a frame
284 * The flags are the bit-oring combination
285 * of the following different fields :
287 * @li IP flag (Rx @a IX_ETHACC_NE_IPMASK)
288 * @li Spanning Tree flag (Rx @a IX_ETHACC_NE_STMASK)
289 * @li Link layer type (Rx and Tx @a IX_ETHACC_NE_LINKMASK)
290 * @li VLAN Tagged Frame (Rx @a IX_ETHACC_NE_VLANMASK)
291 * @li New source MAC address (Rx @a IX_ETHACC_NE_NEWSRCMASK)
292 * @li Multicast flag (Rx @a IX_ETHACC_NE_MCASTMASK)
293 * @li Broadcast flag (Rx @a IX_ETHACC_NE_BCASTMASK)
294 * @li Destination port flag (Tx @a IX_ETHACC_NE_PORTMASK)
295 * @li Tag/Untag Tx frame (Tx @a IX_ETHACC_NE_TAGMODEMASK)
296 * @li Overwrite destination port (Tx @a IX_ETHACC_NE_PORTOVERMASK)
297 * @li Filtered frame (Rx @a IX_ETHACC_NE_STMASK)
298 * @li VLAN Enabled (Rx and Tx @a IX_ETHACC_NE_VLANENABLEMASK)
300 #define IX_ETHACC_NE_FLAGS(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixFlags
305 * @def IX_ETHACC_NE_BCASTMASK
307 * @brief This mask defines if a received frame is a broadcast frame.
309 * This mask defines if a received frame is a broadcast frame.
310 * The BCAST flag is set when the destination MAC address of
311 * a frame is broadcast.
313 * @sa IX_ETHACC_NE_FLAGS
316 #define IX_ETHACC_NE_BCASTMASK (0x1)
321 * @def IX_ETHACC_NE_MCASTMASK
323 * @brief This mask defines if a received frame is a multicast frame.
325 * This mask defines if a received frame is a multicast frame.
326 * The MCAST flag is set when the destination MAC address of
327 * a frame is multicast.
329 * @sa IX_ETHACC_NE_FLAGS
332 #define IX_ETHACC_NE_MCASTMASK (0x1 << 1)
337 * @def IX_ETHACC_NE_IPMASK
339 * @brief This mask defines if a received frame is a IP frame.
341 * This mask applies to @a IX_ETHACC_NE_FLAGS and defines if a received
342 * frame is a IP frame. The IP flag is set on Rx direction, depending on
343 * the frame contents. The flag is set when the length/type field of a
344 * received frame is 0x8000.
346 * @sa IX_ETHACC_NE_FLAGS
349 #define IX_ETHACC_NE_IPMASK (0x1 << 2)
354 * @def IX_ETHACC_NE_VLANMASK
356 * @brief This mask defines if a received frame is VLAN tagged.
358 * This mask defines if a received frame is VLAN tagged.
359 * When set, the Rx frame is VLAN-tagged and the tag value
360 * is available thru @a IX_ETHACC_NE_VLANID.
361 * Note that when sending frames which are already tagged
362 * this flag should be set, to avoid inserting another VLAN tag.
364 * @sa IX_ETHACC_NE_FLAGS
365 * @sa IX_ETHACC_NE_VLANID
368 #define IX_ETHACC_NE_VLANMASK (0x1 << 3)
373 * @def IX_ETHACC_NE_LINKMASK
375 * @brief This mask is the link layer protocol indicator
377 * This mask applies to @a IX_ETHACC_NE_FLAGS.
378 * It reflects the state of a frame as it exits an NPE on the Rx path
379 * or enters an NPE on the Tx path. Its values are as follows:
380 * @li 0x00 - IEEE802.3 - 8802 (Rx) / IEEE802.3 - 8802 (Tx)
381 * @li 0x01 - IEEE802.3 - Ethernet (Rx) / IEEE802.3 - Ethernet (Tx)
382 * @li 0x02 - IEEE802.11 AP -> STA (Rx) / IEEE802.11 STA -> AP (Tx)
383 * @li 0x03 - IEEE802.11 AP -> AP (Rx) / IEEE802.11 AP->AP (Tx)
385 * @sa IX_ETHACC_NE_FLAGS
388 #define IX_ETHACC_NE_LINKMASK (0x3 << 4)
393 * @def IX_ETHACC_NE_STMASK
395 * @brief This mask defines if a received frame is a Spanning Tree frame.
397 * This mask applies to @a IX_ETHACC_NE_FLAGS.
398 * On rx direction, it defines if a received if frame is a Spanning Tree frame.
399 * Setting this fkag on transmit direction overrides the port settings
400 * regarding the VLAN options and
402 * @sa IX_ETHACC_NE_FLAGS
405 #define IX_ETHACC_NE_STMASK (0x1 << 6)
410 * @def IX_ETHACC_NE_FILTERMASK
412 * @brief This bit indicates whether a frame has been filtered by the Rx service.
414 * This mask applies to @a IX_ETHACC_NE_FLAGS.
415 * Certain frames, which should normally be fully filtered by the NPE to due
416 * the destination MAC address being on the same segment as the Rx port are
417 * still forwarded to the XScale (although the payload is invalid) in order
418 * to learn the MAC address of the transmitting station, if this is unknown.
419 * Normally EthAcc will filter and recycle these framess internally and no
420 * frames with the FILTER bit set will be received by the client.
422 * @sa IX_ETHACC_NE_FLAGS
425 #define IX_ETHACC_NE_FILTERMASK (0x1 << 7)
430 * @def IX_ETHACC_NE_PORTMASK
432 * @brief This mask defines the rule to transmit a frame
434 * This mask defines the rule to transmit a frame. When set, a frame
435 * is transmitted to the destination port as set by the macro
436 * @a IX_ETHACC_NE_DESTPORTID. If not set, the destination port
437 * is searched using the destination MAC address.
439 * @note This flag is meaningful only for multiport Network Engines.
441 * @sa IX_ETHACC_NE_FLAGS
442 * @sa IX_ETHACC_NE_DESTPORTID
445 #define IX_ETHACC_NE_PORTOVERMASK (0x1 << 8)
450 * @def IX_ETHACC_NE_TAGMODEMASK
452 * @brief This mask defines the tagging rules to apply to a transmit frame.
454 * This mask defines the tagging rules to apply to a transmit frame
455 * regardless of the default setting for a port. When used together
456 * with @a IX_ETHACC_NE_TAGOVERMASK and when set, the
457 * frame will be tagged prior to transmission. When not set,
458 * the frame will be untagged prior to transmission. This is accomplished
459 * irrespective of the Egress tagging rules, constituting a per-frame override.
461 * @sa IX_ETHACC_NE_FLAGS
462 * @sa IX_ETHACC_NE_TAGOVERMASK
465 #define IX_ETHACC_NE_TAGMODEMASK (0x1 << 9)
470 * @def IX_ETHACC_NE_TAGOVERMASK
472 * @brief This mask defines the rule to transmit a frame
474 * This mask defines the rule to transmit a frame. When set, the
475 * default transmit rules of a port are overriden.
476 * When not set, the default rules as set by @ref IxEthDB should apply.
478 * @sa IX_ETHACC_NE_FLAGS
479 * @sa IX_ETHACC_NE_TAGMODEMASK
482 #define IX_ETHACC_NE_TAGOVERMASK (0x1 << 10)
487 * @def IX_ETHACC_NE_VLANENABLEMASK
489 * @brief This mask defines if a frame is a VLAN frame or not
491 * When set, frames undergo normal VLAN processing on the Tx path
492 * (membership filtering, tagging, tag removal etc). If this flag is
493 * not set, the frame is considered to be a regular non-VLAN frame
494 * and no VLAN processing will be performed.
496 * Note that VLAN-enabled NPE images will always set this flag in all
497 * Rx frames, and images which are not VLAN enabled will clear this
498 * flag for all received frames.
500 * @sa IX_ETHACC_NE_FLAGS
503 #define IX_ETHACC_NE_VLANENABLEMASK (0x1 << 14)
508 * @def IX_ETHACC_NE_NEWSRCMASK
510 * @brief This mask defines if a received frame has been learned.
512 * This mask defines if the source MAC address of a frame is
513 * already known. If the bit is set, the source MAC address was
514 * unknown to the NPE at the time the frame was received.
516 * @sa IX_ETHACC_NE_FLAGS
519 #define IX_ETHACC_NE_NEWSRCMASK (0x1 << 15)
524 * @brief This defines the recommanded minimum size of MBUF's submitted
525 * to the frame receive service.
528 #define IX_ETHACC_RX_MBUF_MIN_SIZE (2048)
533 * @brief This defines the highest MII address of any attached PHYs
535 * The maximum number for PHY address is 31, add on for range checking.
538 #define IXP425_ETH_ACC_MII_MAX_ADDR 32
543 * @fn ixEthAccInit(void)
545 * @brief Initializes the IXP400 Ethernet Access Service.
548 * @li ISR Callable - no
550 * This should be called once per module initialization.
552 * The NPE must first be downloaded with the required microcode which supports all
555 * @return IxEthAccStatus
556 * @li @a IX_ETH_ACC_SUCCESS
557 * @li @a IX_ETH_ACC_FAIL : Service has failed to initialize.
561 PUBLIC IxEthAccStatus ixEthAccInit(void);
567 * @fn ixEthAccUnload(void)
569 * @brief Unload the Ethernet Access Service.
572 * @li ISR Callable - no
578 PUBLIC void ixEthAccUnload(void);
583 * @fn ixEthAccPortInit( IxEthAccPortId portId)
585 * @brief Initializes an NPE/Ethernet MAC Port.
587 * The NPE/Ethernet port initialisation includes the following steps
588 * @li Initialize the NPE/Ethernet MAC hardware.
589 * @li Verify NPE downloaded and operational.
590 * @li The NPE shall be available for usage once this API returns.
591 * @li Verify that the Ethernet port is present before initializing
594 * @li ISR Callable - no
596 * This should be called once per mac device.
597 * The NPE/MAC shall be in disabled state after init.
600 * The component must be initialized via @a ixEthAccInit
601 * The NPE must first be downloaded with the required microcode which supports all
604 * Dependant on Services: (Must be initialized before using this service may be initialized)
605 * ixNPEmh - NPE Message handling service.
606 * ixQmgr - Queue Manager component.
608 * @param portId @ref IxEthAccPortId [in]
610 * @return IxEthAccStatus
611 * @li @a IX_ETH_ACC_SUCCESS: if the ethernet port is not present, a warning is issued.
612 * @li @a IX_ETH_ACC_FAIL : The NPE processor has failed to initialize.
613 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
617 PUBLIC IxEthAccStatus ixEthAccPortInit(IxEthAccPortId portId);
620 /*************************************************************************
622 ##### ## ##### ## ##### ## ##### # #
623 # # # # # # # # # # # # # #
624 # # # # # # # # # # # # ######
625 # # ###### # ###### ##### ###### # # #
626 # # # # # # # # # # # # #
627 ##### # # # # # # # # # # #
629 *************************************************************************/
635 * @fn ixEthAccPortTxFrameSubmit(
636 IxEthAccPortId portId,
637 IX_OSAL_MBUF *buffer,
638 IxEthAccTxPriority priority)
640 * @brief This function shall be used to submit MBUFs buffers for transmission on a particular MAC device.
642 * When the frame is transmitted, the buffer shall be returned thru the
643 * callback @a IxEthAccPortTxDoneCallback.
645 * In case of over-submitting, the order of the frames on the
646 * network may be modified.
648 * Buffers shall be not queued for transmission if the port is disabled.
649 * The port can be enabled using @a ixEthAccPortEnable
652 * @li Reentrant - yes
653 * @li ISR Callable - yes
657 * @a ixEthAccPortTxDoneCallbackRegister must be called to register a function to allow this service to
658 * return the buffer to the calling service.
661 * If the buffer submit fails for any reason the user has retained ownership of the buffer.
663 * @param portId @ref IxEthAccPortId [in] - MAC port ID to transmit Ethernet frame on.
664 * @param buffer @ref IX_OSAL_MBUF [in] - pointer to an MBUF formatted buffer. Chained buffers are supported for transmission.
665 * Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is ignored.
666 * @param priority @ref IxEthAccTxPriority [in]
668 * @return IxEthAccStatus
669 * @li @a IX_ETH_ACC_SUCCESS
670 * @li @a IX_ETH_ACC_FAIL : Failed to queue frame for transmission.
671 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
672 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
677 PUBLIC IxEthAccStatus ixEthAccPortTxFrameSubmit(
678 IxEthAccPortId portId,
679 IX_OSAL_MBUF *buffer,
680 IxEthAccTxPriority priority);
685 * @brief Function prototype for Ethernet Tx Buffer Done callback. Registered
686 * via @a ixEthAccTxBufferDoneCallbackRegister
688 * This function is called once the previously submitted buffer is no longer required by this service.
689 * It may be returned upon successful transmission of the frame or during the shutdown of
690 * the port prior to the transmission of a queued frame.
691 * The calling of this registered function is not a guarantee of successful transmission of the buffer.
694 * @li Reentrant - yes , The user provided function should be reentrant.
695 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
698 * <b>Calling Context </b>:
700 * This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun
701 * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread.
702 * The decision is system specific.
704 * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC
705 * via @a ixEthAccPortTxDoneCallbackRegister. It allows the same callback to be used for multiple MACs.
706 * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Tx mbuf descriptor.
711 * The field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is modified by the access layer and reset to NULL.
715 typedef void (*IxEthAccPortTxDoneCallback) ( UINT32 callbackTag, IX_OSAL_MBUF *buffer );
722 * @fn ixEthAccPortTxDoneCallbackRegister( IxEthAccPortId portId,
723 IxEthAccPortTxDoneCallback txCallbackFn,
726 * @brief Register a callback function to allow
727 * the transmitted buffers to return to the user.
729 * This function registers the transmit buffer done function callback for a particular port.
731 * The registered callback function is called once the previously submitted buffer is no longer required by this service.
732 * It may be returned upon successful transmission of the frame or shutdown of port prior to submission.
733 * The calling of this registered function is not a guarantee of successful transmission of the buffer.
735 * If called several times the latest callback shall be registered for a particular port.
737 * @li Reentrant - yes
738 * @li ISR Callable - yes
741 * The port must be initialized via @a ixEthAccPortInit
744 * @param portId @ref IxEthAccPortId [in] - Register callback for a particular MAC device.
745 * @param txCallbackFn @ref IxEthAccPortTxDoneCallback [in] - Function to be called to return transmit buffers to the user.
746 * @param callbackTag UINT32 [in] - This tag shall be provided to the callback function.
748 * @return IxEthAccStatus
749 * @li @a IX_ETH_ACC_SUCCESS
750 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
751 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
752 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
756 PUBLIC IxEthAccStatus
757 ixEthAccPortTxDoneCallbackRegister(IxEthAccPortId portId,
758 IxEthAccPortTxDoneCallback txCallbackFn,
766 * @brief Function prototype for Ethernet Frame Rx callback. Registered via @a ixEthAccPortRxCallbackRegister
768 * It is the responsibility of the user function to free any MBUF's which it receives.
770 * @li Reentrant - yes , The user provided function should be reentrant.
771 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
774 * This function dispatches frames to the user level
775 * via the provided function. The invocation shall be made for each
776 * frame dequeued from the Ethernet QM queue. The user is required to free any MBUF's
777 * supplied via this callback. In addition the registered callback must free up MBUF's
778 * from the receive free queue when the port is disabled
780 * If called several times the latest callback shall be registered for a particular port.
782 * <b>Calling Context </b>:
784 * This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun
785 * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread.
786 * The decision is system specific.
789 * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC
790 * via @a ixEthAccPortRxCallbackRegister. It allows the same callback to be used for multiple MACs.
791 * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Rx mbuf header. Mbufs may be chained if
792 * the frame length is greater than the supplied mbuf length.
793 * @param reserved [in] - deprecated parameter The information is passed
794 * thru the IxEthAccNe header destination port ID field
795 * (@sa IX_ETHACC_NE_DESTPORTID). For backward
796 * compatibility,the value is equal to IX_ETH_DB_UNKNOWN_PORT (0xff).
801 * Buffers may not be filled up to the length supplied in
802 * @a ixEthAccPortRxFreeReplenish(). The firmware fills
803 * them to the previous 64 bytes boundary. The user has to be aware
804 * that the length of the received mbufs may be smaller than the length
805 * of the supplied mbufs.
806 * The mbuf header contains the following modified field
807 * @li @a IX_OSAL_MBUF_PKT_LEN is set in the header of the first mbuf and indicates
808 * the total frame size
809 * @li @a IX_OSAL_MBUF_MLEN is set each mbuf header and indicates the payload length
810 * @li @a IX_OSAL_MBUF_NEXT_BUFFER_IN_PKT_PTR contains a pointer to the next
811 * mbuf, or NULL at the end of a chain.
812 * @li @a IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is modified. Its value is reset to NULL
813 * @li @a IX_OSAL_MBUF_FLAGS contains the bit 4 set for a broadcast packet and the bit 5
814 * set for a multicast packet. Other bits are unmodified.
818 typedef void (*IxEthAccPortRxCallback) (UINT32 callbackTag, IX_OSAL_MBUF *buffer, UINT32 reserved);
823 * @brief Function prototype for Ethernet Frame Rx callback. Registered via @a ixEthAccPortMultiBufferRxCallbackRegister
825 * It is the responsibility of the user function to free any MBUF's which it receives.
827 * @li Reentrant - yes , The user provided function should be reentrant.
828 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
831 * This function dispatches many frames to the user level
832 * via the provided function. The invocation shall be made for multiple frames
833 * dequeued from the Ethernet QM queue. The user is required to free any MBUF's
834 * supplied via this callback. In addition the registered callback must free up MBUF's
835 * from the receive free queue when the port is disabled
837 * If called several times the latest callback shall be registered for a particular port.
839 * <b>Calling Context </b>:
841 * This callback is called in the context of the queue manager dispatch loop @a ixQmgrDispatcherLoopRun
842 * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread.
843 * The decision is system specific.
846 * @param callbackTag - This tag is that provided when the callback was registered for a particular MAC
847 * via @a ixEthAccPortMultiBufferRxCallbackRegister. It allows the same callback to be used for multiple MACs.
848 * @param mbuf - Pointer to an array of Rx mbuf headers. Mbufs
850 * the frame length is greater than the supplied mbuf length.
851 * The end of the array contains a zeroed entry (NULL pointer).
855 * @note The mbufs passed to this callback have the same structure than the
856 * buffers passed to @a IxEthAccPortRxCallback interfac.
858 * @note The usage of this callback is exclusive with the usage of
859 * @a ixEthAccPortRxCallbackRegister and @a IxEthAccPortRxCallback
861 * @sa ixEthAccPortMultiBufferRxCallbackRegister
862 * @sa IxEthAccPortMultiBufferRxCallback
863 * @sa ixEthAccPortRxCallbackRegister
864 * @sa IxEthAccPortRxCallback
868 typedef void (*IxEthAccPortMultiBufferRxCallback) (UINT32 callbackTag, IX_OSAL_MBUF **buffer);
876 * @fn ixEthAccPortRxCallbackRegister( IxEthAccPortId portId, IxEthAccPortRxCallback rxCallbackFn, UINT32 callbackTag)
878 * @brief Register a callback function to allow
879 * the reception of frames.
881 * The registered callback function is called once a frame is received by this service.
883 * If called several times the latest callback shall be registered for a particular port.
886 * @li Reentrant - yes
887 * @li ISR Callable - yes
890 * @param portId @ref IxEthAccPortId [in] - Register callback for a particular MAC device.
891 * @param rxCallbackFn @ref IxEthAccPortRxCallback [in] - Function to be called when Ethernet frames are availble.
892 * @param callbackTag UINT32 [in] - This tag shall be provided to the callback function.
894 * @return IxEthAccStatus
895 * @li @a IX_ETH_ACC_SUCCESS
896 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
897 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
898 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
902 PUBLIC IxEthAccStatus
903 ixEthAccPortRxCallbackRegister(IxEthAccPortId portId,
904 IxEthAccPortRxCallback rxCallbackFn,
911 * @fn ixEthAccPortMultiBufferRxCallbackRegister( IxEthAccPortId portId, IxEthAccPortMultiBufferRxCallback rxCallbackFn, UINT32 callbackTag)
913 * @brief Register a callback function to allow
914 * the reception of frames.
916 * The registered callback function is called once a frame is
917 * received by this service. If many frames are already received,
918 * the function is called once.
920 * If called several times the latest callback shall be registered for a particular port.
922 * @li Reentrant - yes
923 * @li ISR Callable - yes
926 * @param portId - Register callback for a particular MAC device.
927 * @param rxCallbackFn - @a IxEthAccMultiBufferRxCallbackFn - Function to be called when Ethernet frames are availble.
928 * @param callbackTag - This tag shall be provided to the callback function.
930 * @return IxEthAccStatus
931 * @li @a IX_ETH_ACC_SUCCESS
932 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
933 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
934 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
936 * @sa ixEthAccPortMultiBufferRxCallbackRegister
937 * @sa IxEthAccPortMultiBufferRxCallback
938 * @sa ixEthAccPortRxCallbackRegister
939 * @sa IxEthAccPortRxCallback
942 PUBLIC IxEthAccStatus
943 ixEthAccPortMultiBufferRxCallbackRegister(IxEthAccPortId portId,
944 IxEthAccPortMultiBufferRxCallback rxCallbackFn,
950 * @fn ixEthAccPortRxFreeReplenish( IxEthAccPortId portId, IX_OSAL_MBUF *buffer)
952 * @brief This function provides buffers for the Ethernet receive path.
954 * This component does not have a buffer management mechanisms built in. All Rx buffers must be supplied to it
955 * via this interface.
957 * @li Reentrant - yes
958 * @li ISR Callable - yes
960 * @param portId @ref IxEthAccPortId [in] - Provide buffers only to specific Rx MAC.
961 * @param buffer @ref IX_OSAL_MBUF [in] - Provide an MBUF to the Ethernet receive mechanism.
962 * Buffers size smaller than IX_ETHACC_RX_MBUF_MIN_SIZE may result in poor
963 * performances and excessive buffer chaining. Buffers
964 * larger than this size may be suitable for jumbo frames.
965 * Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR must be NULL.
967 * @return IxEthAccStatus
968 * @li @a IX_ETH_ACC_SUCCESS
969 * @li @a IX_ETH_ACC_FAIL : Buffer has was not able to queue the
970 * buffer in the receive service.
971 * @li @a IX_ETH_ACC_FAIL : Buffer size is less than IX_ETHACC_RX_MBUF_MIN_SIZE
972 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
973 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
976 * If the buffer replenish operation fails it is the responsibility
977 * of the user to free the buffer.
980 * Sufficient buffers must be supplied to the component to maintain
981 * receive throughput and avoid rx buffer underflow conditions.
982 * To meet this goal, It is expected that the user preload the
983 * component with a sufficent number of buffers prior to enabling the
984 * NPE Ethernet receive path. The recommended minimum number of
988 * For maximum performances, the mbuf size should be greater
989 * than the maximum frame size (Ethernet header, payload and FCS) + 64.
990 * Supplying smaller mbufs to the service results in mbuf
991 * chaining and degraded performances. The recommended size
992 * is @a IX_ETHACC_RX_MBUF_MIN_SIZE, which is
993 * enough to take care of 802.3 frames and "baby jumbo" frames without
994 * chaining, and "jumbo" frame within chaining.
997 * Buffers may not be filled up to their length. The firware fills
998 * them up to the previous 64 bytes boundary. The user has to be aware
999 * that the length of the received mbufs may be smaller than the length
1000 * of the supplied mbufs.
1002 * @warning This function checks the parameters if the NDEBUG
1003 * flag is not defined. Turning on the argument checking (disabled by
1004 * default) results in a lower EthAcc performance as this function
1005 * is part of the data path.
1009 PUBLIC IxEthAccStatus
1010 ixEthAccPortRxFreeReplenish( IxEthAccPortId portId, IX_OSAL_MBUF *buffer);
1014 /***************************************************************
1016 #### #### # # ##### ##### #### #
1017 # # # # ## # # # # # # #
1018 # # # # # # # # # # # #
1019 # # # # # # # ##### # # #
1020 # # # # # ## # # # # # #
1021 #### #### # # # # # #### ######
1024 ##### # ## # # ######
1026 # # # # # # # # #####
1027 ##### # ###### # # # #
1029 # ###### # # # # ######
1031 ***************************************************************/
1036 * @fn ixEthAccPortEnable(IxEthAccPortId portId)
1038 * @brief This enables an Ethernet port for both Tx and Rx.
1040 * @li Reentrant - yes
1041 * @li ISR Callable - no
1043 * @pre The port must first be initialized via @a ixEthAccPortInit and the MAC address
1044 * must be set using @a ixEthAccUnicastMacAddressSet before enabling it
1045 * The rx and Tx Done callbacks registration via @a
1046 * ixEthAccPortTxDoneCallbackRegister amd @a ixEthAccPortRxCallbackRegister
1047 * has to be done before enabling the traffic.
1049 * @param portId @ref IxEthAccPortId [in] - Port id to act upon.
1051 * @return IxEthAccStatus
1052 * @li @a IX_ETH_ACC_SUCCESS
1053 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1054 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is not initialized
1055 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized
1059 PUBLIC IxEthAccStatus ixEthAccPortEnable(IxEthAccPortId portId);
1064 * @fn ixEthAccPortDisable(IxEthAccPortId portId)
1066 * @brief This disables an Ethernet port for both Tx and Rx.
1068 * Free MBufs are returned to the user via the registered callback when the port is disabled
1070 * @li Reentrant - yes
1071 * @li ISR Callable - no
1073 * @pre The port must be enabled with @a ixEthAccPortEnable, otherwise this
1074 * function has no effect
1076 * @param portId @ref IxEthAccPortId [in] - Port id to act upon.
1078 * @return IxEthAccStatus
1079 * @li @a IX_ETH_ACC_SUCCESS
1080 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1081 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is not initialized
1082 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized
1086 PUBLIC IxEthAccStatus ixEthAccPortDisable(IxEthAccPortId portId);
1091 * @fn ixEthAccPortEnabledQuery(IxEthAccPortId portId, BOOL *enabled)
1093 * @brief Get the enabled state of a port.
1095 * @li Reentrant - yes
1096 * @li ISR Callable - yes
1098 * @pre The port must first be initialized via @a ixEthAccPortInit
1100 * @param portId @ref IxEthAccPortId [in] - Port id to act upon.
1101 * @param enabled BOOL [out] - location to store the state of the port
1103 * @return IxEthAccStatus
1104 * @li @a IX_ETH_ACC_SUCCESS
1105 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid
1109 PUBLIC IxEthAccStatus
1110 ixEthAccPortEnabledQuery(IxEthAccPortId portId, BOOL *enabled);
1115 * @fn ixEthAccPortPromiscuousModeClear(IxEthAccPortId portId)
1117 * @brief Put the Ethernet MAC device in non-promiscuous mode.
1119 * In non-promiscuous mode the MAC filters all frames other than
1120 * destination MAC address which matches the following criteria:
1121 * @li Unicast address provisioned via @a ixEthAccUnicastMacAddressSet
1122 * @li All broadcast frames.
1123 * @li Multicast addresses provisioned via @a ixEthAccMulticastAddressJoin
1125 * Other functions modify the MAC filtering
1127 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1128 * frames are forwarded to the application
1129 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1130 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1131 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1133 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1135 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1136 * forwarded to the application regardless of the multicast
1137 * address provisioned
1138 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1139 * to the application following the multicast address provisioned
1141 * In all cases, unicast and broadcast addresses are forwarded to
1144 * @li Reentrant - yes
1145 * @li ISR Callable - no
1147 * @sa ixEthAccPortPromiscuousModeSet
1149 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1151 * @return IxEthAccStatus
1152 * @li @a IX_ETH_ACC_SUCCESS
1153 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1154 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1158 PUBLIC IxEthAccStatus ixEthAccPortPromiscuousModeClear(IxEthAccPortId portId);
1164 * @fn ixEthAccPortPromiscuousModeSet(IxEthAccPortId portId)
1166 * @brief Put the MAC device in promiscuous mode.
1168 * If the device is in promiscuous mode then all all received frames shall be forwared
1169 * to the NPE for processing.
1171 * Other functions modify the MAC filtering
1173 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1174 * frames are forwarded to the application
1175 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1176 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1177 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1179 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1181 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1182 * forwarded to the application regardless of the multicast
1183 * address provisioned
1184 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1185 * to the application following the multicast address provisioned
1187 * In all cases, unicast and broadcast addresses are forwarded to
1190 * @li Reentrant - yes
1191 * @li ISR Callable - no
1193 * @sa ixEthAccPortPromiscuousModeClear
1195 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1197 * @return IxEthAccStatus
1198 * @li @a IX_ETH_ACC_SUCCESS
1199 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1200 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1204 PUBLIC IxEthAccStatus ixEthAccPortPromiscuousModeSet(IxEthAccPortId portId);
1209 * @fn ixEthAccPortUnicastMacAddressSet( IxEthAccPortId portId,
1210 IxEthAccMacAddr *macAddr)
1212 * @brief Configure unicast MAC address for a particular port
1215 * @li Reentrant - yes
1216 * @li ISR Callable - no
1218 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1219 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
1221 * @return IxEthAccStatus
1222 * @li @a IX_ETH_ACC_SUCCESS
1223 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1224 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1228 PUBLIC IxEthAccStatus ixEthAccPortUnicastMacAddressSet(IxEthAccPortId portId,
1229 IxEthAccMacAddr *macAddr);
1234 * @fn ixEthAccPortUnicastMacAddressGet( IxEthAccPortId portId,
1235 IxEthAccMacAddr *macAddr)
1237 * @brief Get unicast MAC address for a particular MAC port
1240 * The MAC address must first be set via @a ixEthAccMacPromiscuousModeSet
1241 * If the MAC address has not been set, the function returns a
1242 * IX_ETH_ACC_MAC_UNINITIALIZED status
1244 * @li Reentrant - yes
1245 * @li ISR Callable - no
1247 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1248 * @param *macAddr @ref IxEthAccMacAddr [out] - Ethernet MAC address.
1250 * @return IxEthAccStatus
1251 * @li @a IX_ETH_ACC_SUCCESS
1252 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1253 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized.
1254 * @li @a IX_ETH_ACC_FAIL : macAddr is invalid.
1258 PUBLIC IxEthAccStatus
1259 ixEthAccPortUnicastMacAddressGet(IxEthAccPortId portId,
1260 IxEthAccMacAddr *macAddr);
1268 * @fn ixEthAccPortMulticastAddressJoin( IxEthAccPortId portId,
1269 IxEthAccMacAddr *macAddr)
1271 * @brief Add a multicast address to the MAC address table.
1274 * Due to the operation of the Ethernet MAC multicast filtering mechanism, frames which do not
1275 * have a multicast destination address which were provisioned via this API may be forwarded
1276 * to the NPE's. This is a result of the hardware comparison algorithm used in the destination mac address logic
1277 * within the Ethernet MAC.
1279 * See Also: IXP425 hardware development manual.
1281 * Other functions modify the MAC filtering
1283 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1284 * frames are forwarded to the application
1285 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1286 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1287 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1289 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1291 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1292 * forwarded to the application regardless of the multicast
1293 * address provisioned
1294 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1295 * to the application following the multicast address provisioned
1297 * In all cases, unicast and broadcast addresses are forwarded to
1300 * @li Reentrant - yes
1301 * @li ISR Callable - no
1303 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1304 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
1306 * @return IxEthAccStatus
1307 * @li @a IX_ETH_ACC_SUCCESS
1308 * @li @a IX_ETH_ACC_FAIL : Error writing to the MAC registers
1309 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1310 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1314 PUBLIC IxEthAccStatus
1315 ixEthAccPortMulticastAddressJoin(IxEthAccPortId portId,
1316 IxEthAccMacAddr *macAddr);
1321 * @fn ixEthAccPortMulticastAddressJoinAll( IxEthAccPortId portId)
1323 * @brief Filter all frames with multicast dest.
1325 * This function clears the MAC address table, and then sets
1326 * the MAC to forward ALL multicast frames to the NPE.
1327 * Specifically, it forwards all frames whose destination address
1328 * has the LSB of the highest byte set (01:00:00:00:00:00). This
1329 * bit is commonly referred to as the "multicast bit".
1330 * Broadcast frames will still be forwarded.
1332 * Other functions modify the MAC filtering
1334 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1335 * frames are forwarded to the application
1336 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1337 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1338 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1340 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1342 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1343 * forwarded to the application regardless of the multicast
1344 * address provisioned
1345 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1346 * to the application following the multicast address provisioned
1348 * In all cases, unicast and broadcast addresses are forwarded to
1351 * @li Reentrant - yes
1352 * @li ISR Callable - no
1354 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1356 * @return IxEthAccStatus
1357 * @li @a IX_ETH_ACC_SUCCESS
1358 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1359 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1363 PUBLIC IxEthAccStatus
1364 ixEthAccPortMulticastAddressJoinAll(IxEthAccPortId portId);
1369 * @fn ixEthAccPortMulticastAddressLeave( IxEthAccPortId portId,
1370 IxEthAccMacAddr *macAddr)
1372 * @brief Remove a multicast address from the MAC address table.
1374 * Other functions modify the MAC filtering
1376 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1377 * frames are forwarded to the application
1378 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1379 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1380 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1382 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1384 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1385 * forwarded to the application regardless of the multicast
1386 * address provisioned
1387 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1388 * to the application following the multicast address provisioned
1390 * In all cases, unicast and broadcast addresses are forwarded to
1393 * @li Reentrant - yes
1394 * @li ISR Callable - no
1396 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1397 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
1399 * @return IxEthAccStatus
1400 * @li @a IX_ETH_ACC_SUCCESS
1401 * @li @a IX_ETH_ACC_NO_SUCH_ADDR : Failed if MAC address was not in the table.
1402 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1403 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1407 PUBLIC IxEthAccStatus
1408 ixEthAccPortMulticastAddressLeave(IxEthAccPortId portId,
1409 IxEthAccMacAddr *macAddr);
1414 * @fn ixEthAccPortMulticastAddressLeaveAll( IxEthAccPortId portId)
1416 * @brief This function unconfigures the multicast filtering settings
1418 * This function first clears the MAC address table, and then sets
1419 * the MAC as configured by the promiscuous mode current settings.
1421 * Other functions modify the MAC filtering
1423 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1424 * frames are forwarded to the application
1425 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1426 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1427 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1429 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1431 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1432 * forwarded to the application regardless of the multicast
1433 * address provisioned
1434 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1435 * to the application following the multicast address provisioned
1437 * In all cases, unicast and broadcast addresses are forwarded to
1440 * @li Reentrant - yes
1441 * @li ISR Callable - no
1443 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1445 * @return IxEthAccStatus
1446 * @li @a IX_ETH_ACC_SUCCESS
1447 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1448 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1452 PUBLIC IxEthAccStatus
1453 ixEthAccPortMulticastAddressLeaveAll(IxEthAccPortId portId);
1458 * @fn ixEthAccPortUnicastAddressShow(IxEthAccPortId portId)
1460 * @brief Displays unicast MAC address
1462 * Displays unicast address which is configured using
1463 * @a ixEthAccUnicastMacAddressSet. This function also displays the MAC filter used
1464 * to filter multicast frames.
1466 * Other functions modify the MAC filtering
1468 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1469 * frames are forwarded to the application
1470 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1471 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1472 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1474 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1476 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1477 * forwarded to the application regardless of the multicast
1478 * address provisioned
1479 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1480 * to the application following the multicast address provisioned
1482 * In all cases, unicast and broadcast addresses are forwarded to
1485 * @li Reentrant - yes
1486 * @li ISR Callable - no
1488 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1494 PUBLIC IxEthAccStatus ixEthAccPortUnicastAddressShow(IxEthAccPortId portId);
1500 * @fn ixEthAccPortMulticastAddressShow( IxEthAccPortId portId)
1502 * @brief Displays multicast MAC address
1504 * Displays multicast address which have been configured using @a ixEthAccMulticastAddressJoin
1506 * @li Reentrant - yes
1507 * @li ISR Callable - no
1509 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1515 PUBLIC void ixEthAccPortMulticastAddressShow( IxEthAccPortId portId);
1520 * @fn ixEthAccPortDuplexModeSet( IxEthAccPortId portId, IxEthAccDuplexMode mode )
1522 * @brief Set the duplex mode for the MAC.
1524 * Configure the IXP400 MAC to either full or half duplex.
1527 * The configuration should match that provisioned on the PHY.
1529 * @li Reentrant - yes
1530 * @li ISR Callable - no
1532 * @param portId @ref IxEthAccPortId [in]
1533 * @param mode @ref IxEthAccDuplexMode [in]
1535 * @return IxEthAccStatus
1536 * @li @a IX_ETH_ACC_SUCCESS
1537 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1538 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1542 PUBLIC IxEthAccStatus
1543 ixEthAccPortDuplexModeSet(IxEthAccPortId portId,IxEthAccDuplexMode mode);
1548 * @fn ixEthAccPortDuplexModeGet( IxEthAccPortId portId, IxEthAccDuplexMode *mode )
1550 * @brief Get the duplex mode for the MAC.
1552 * return the duplex configuration of the IXP400 MAC.
1555 * The configuration should match that provisioned on the PHY.
1556 * See @a ixEthAccDuplexModeSet
1558 * @li Reentrant - yes
1559 * @li ISR Callable - no
1561 * @param portId @ref IxEthAccPortId [in]
1562 * @param *mode @ref IxEthAccDuplexMode [out]
1564 * @return IxEthAccStatus
1565 * @li @a IX_ETH_ACC_SUCCESS
1566 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1567 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1572 PUBLIC IxEthAccStatus
1573 ixEthAccPortDuplexModeGet(IxEthAccPortId portId,IxEthAccDuplexMode *mode );
1578 * @fn ixEthAccPortTxFrameAppendPaddingEnable( IxEthAccPortId portId)
1580 * @brief Enable padding bytes to be appended to runt frames submitted to
1583 * Enable up to 60 null-bytes padding bytes to be appended to runt frames
1584 * submitted to this port. This is the default behavior of the access
1587 * @warning Do not change this behaviour while the port is enabled.
1589 * @note When Tx padding is enabled, Tx FCS generation is turned on
1591 * @li Reentrant - yes
1592 * @li ISR Callable - no
1594 * @sa ixEthAccPortTxFrameAppendFCSDusable
1596 * @param portId @ref IxEthAccPortId [in]
1598 * @return IxEthAccStatus
1599 * @li @a IX_ETH_ACC_SUCCESS
1600 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1601 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1605 PUBLIC IxEthAccStatus
1606 ixEthAccPortTxFrameAppendPaddingEnable(IxEthAccPortId portId);
1611 * @fn ixEthAccPortTxFrameAppendPaddingDisable( IxEthAccPortId portId)
1613 * @brief Disable padding bytes to be appended to runt frames submitted to
1616 * Disable padding bytes to be appended to runt frames
1617 * submitted to this port. This is not the default behavior of the access
1620 * @warning Do not change this behaviour while the port is enabled.
1622 * @li Reentrant - yes
1623 * @li ISR Callable - no
1625 * @param portId @ref IxEthAccPortId [in]
1627 * @return IxEthAccStatus
1628 * @li @a IX_ETH_ACC_SUCCESS
1629 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1630 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1634 PUBLIC IxEthAccStatus
1635 ixEthAccPortTxFrameAppendPaddingDisable(IxEthAccPortId portId);
1640 * @fn ixEthAccPortTxFrameAppendFCSEnable( IxEthAccPortId portId)
1642 * @brief Enable the appending of Ethernet FCS to all frames submitted to this port
1644 * When enabled, the FCS is added to the submitted frames. This is the default
1645 * behavior of the access component.
1646 * Do not change this behaviour while the port is enabled.
1648 * @li Reentrant - yes
1649 * @li ISR Callable - no
1651 * @param portId @ref IxEthAccPortId [in]
1653 * @return IxEthAccStatus
1654 * @li @a IX_ETH_ACC_SUCCESS
1655 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1656 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1660 PUBLIC IxEthAccStatus
1661 ixEthAccPortTxFrameAppendFCSEnable(IxEthAccPortId portId);
1666 * @fn ixEthAccPortTxFrameAppendFCSDisable( IxEthAccPortId portId)
1668 * @brief Disable the appending of Ethernet FCS to all frames submitted to this port.
1670 * When disabled, the Ethernet FCS is not added to the submitted frames.
1671 * This is not the default
1672 * behavior of the access component.
1674 * @note Since the FCS is not appended to the frame it is expected that the frame submitted to the
1675 * component includes a valid FCS at the end of the data, although this will not be validated.
1677 * The component shall forward the frame to the Ethernet MAC WITHOUT modification.
1679 * Do not change this behaviour while the port is enabled.
1681 * @note Tx FCS append is not disabled while Tx padding is enabled.
1683 * @li Reentrant - yes
1684 * @li ISR Callable - no
1686 * @sa ixEthAccPortTxFrameAppendPaddingEnable
1688 * @param portId @ref IxEthAccPortId [in]
1690 * @return IxEthAccStatus
1691 * @li @a IX_ETH_ACC_SUCCESS
1692 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1693 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1697 PUBLIC IxEthAccStatus
1698 ixEthAccPortTxFrameAppendFCSDisable(IxEthAccPortId portId);
1703 * @fn ixEthAccPortRxFrameAppendFCSEnable( IxEthAccPortId portId)
1705 * @brief Forward frames with FCS included in the receive buffer.
1707 * The FCS is not striped from the receive buffer.
1708 * The received frame length includes the FCS size (4 bytes). ie.
1709 * A minimum sized ethernet frame shall have a length of 64bytes.
1711 * Frame FCS validity checks are still carried out on all received frames.
1713 * This is not the default
1714 * behavior of the access component.
1716 * @li Reentrant - yes
1717 * @li ISR Callable - no
1719 * @param portId @ref IxEthAccPortId [in]
1721 * @return IxEthAccStatus
1722 * @li @a IX_ETH_ACC_SUCCESS
1723 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1724 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1728 PUBLIC IxEthAccStatus
1729 ixEthAccPortRxFrameAppendFCSEnable(IxEthAccPortId portId);
1734 * @fn ixEthAccPortRxFrameAppendFCSDisable( IxEthAccPortId portId)
1736 * @brief Do not forward the FCS portion of the received Ethernet frame to the user.
1737 * The FCS is striped from the receive buffer.
1738 * The received frame length does not include the FCS size (4 bytes).
1739 * Frame FCS validity checks are still carried out on all received frames.
1741 * This is the default behavior of the component.
1742 * Do not change this behaviour while the port is enabled.
1744 * @li Reentrant - yes
1745 * @li ISR Callable - no
1747 * @param portId @ref IxEthAccPortId [in]
1749 * @return IxEthAccStatus
1750 * @li @a IX_ETH_ACC_SUCCESS
1751 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1752 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1756 PUBLIC IxEthAccStatus
1757 ixEthAccPortRxFrameAppendFCSDisable(IxEthAccPortId portId);
1765 * @enum IxEthAccSchedulerDiscipline
1767 * @brief Definition for the port scheduling discipline
1769 * Select the port scheduling discipline on receive and transmit path
1770 * @li FIFO : No Priority : In this configuration all frames are processed
1771 * in the access component in the strict order in which
1772 * the component received them.
1773 * @li FIFO : Priority : This shall be a very simple priority mechanism.
1774 * Higher prior-ity frames shall be forwarded
1775 * before lower priority frames. There shall be no
1776 * fairness mechanisms applied across different
1777 * priorities. Higher priority frames could starve
1778 * lower priority frames indefinitely.
1782 FIFO_NO_PRIORITY, /**<frames submitted with no priority*/
1783 FIFO_PRIORITY /**<higher prority frames submitted before lower priority*/
1784 }IxEthAccSchedulerDiscipline;
1789 * @def IxEthAccTxSchedulerDiscipline
1791 * @brief Deprecated definition for the port transmit scheduling discipline
1793 #define IxEthAccTxSchedulerDiscipline IxEthAccSchedulerDiscipline
1800 * @fn ixEthAccTxSchedulingDisciplineSet( IxEthAccPortId portId, IxEthAccSchedulerDiscipline sched)
1802 * @brief Set the port scheduling to one of @a IxEthAccSchedulerDiscipline
1804 * The default behavior of the component is @a FIFO_NO_PRIORITY.
1806 * @li Reentrant - yes
1807 * @li ISR Callable - no
1812 * @param portId @ref IxEthAccPortId [in]
1813 * @param sched @ref IxEthAccSchedulerDiscipline [in]
1815 * @return IxEthAccStatus
1816 * @li @a IX_ETH_ACC_SUCCESS : Set appropriate discipline.
1817 * @li @a IX_ETH_ACC_FAIL : Invalid/unsupported discipline.
1818 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1819 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1823 PUBLIC IxEthAccStatus
1824 ixEthAccTxSchedulingDisciplineSet(IxEthAccPortId portId,
1825 IxEthAccSchedulerDiscipline sched);
1831 * @fn ixEthAccRxSchedulingDisciplineSet(IxEthAccSchedulerDiscipline sched)
1833 * @brief Set the Rx scheduling to one of @a IxEthAccSchedulerDiscipline
1835 * The default behavior of the component is @a FIFO_NO_PRIORITY.
1837 * @li Reentrant - yes
1838 * @li ISR Callable - no
1842 * @param sched : @a IxEthAccSchedulerDiscipline
1844 * @return IxEthAccStatus
1845 * @li @a IX_ETH_ACC_SUCCESS : Set appropriate discipline.
1846 * @li @a IX_ETH_ACC_FAIL : Invalid/unsupported discipline.
1850 PUBLIC IxEthAccStatus
1851 ixEthAccRxSchedulingDisciplineSet(IxEthAccSchedulerDiscipline sched);
1856 * @fn IxEthAccStatus ixEthAccNpeLoopbackEnable(IxEthAccPortId portId)
1858 * @brief Enable NPE loopback
1860 * When this loopback mode is enabled all the transmitted frames are
1861 * received on the same port, without payload.
1863 * This function is recommended for power-up diagnostic checks and
1864 * should never be used under normal Ethernet traffic operations.
1866 * @li Reentrant - yes
1867 * @li ISR Callable - no
1871 * @param portId : ID of the port
1873 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1874 * guaranteed to restore correct Ethernet Tx/Rx operation.
1876 * @return IxEthAccStatus
1877 * @li @a IX_ETH_ACC_SUCCESS : NPE loopback mode enabled
1878 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1882 PUBLIC IxEthAccStatus
1883 ixEthAccPortNpeLoopbackEnable(IxEthAccPortId portId);
1888 * @fn IxEthAccStatus ixEthAccPortNpeLoopbackDisable(IxEthAccPortId portId)
1890 * @brief Disable NPE loopback
1892 * This function is used to disable the NPE loopback if previously
1893 * enabled using ixEthAccNpeLoopbackEnable.
1895 * This function is recommended for power-up diagnostic checks and
1896 * should never be used under normal Ethernet traffic operations.
1898 * @li Reentrant - yes
1899 * @li ISR Callable - no
1903 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1904 * guaranteed to restore correct Ethernet Tx/Rx operation.
1906 * @param portId : ID of the port
1908 * @return IxEthAccStatus
1909 * @li @a IX_ETH_ACC_SUCCESS : NPE loopback successfully disabled
1910 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1914 PUBLIC IxEthAccStatus
1915 ixEthAccPortNpeLoopbackDisable(IxEthAccPortId portId);
1920 * @fn IxEthAccStatus ixEthAccPortTxEnable(IxEthAccPortId portId)
1922 * @brief Enable Tx on the port
1924 * This function is the complement of ixEthAccPortTxDisable and should
1925 * be used only after Tx was disabled. A MAC core reset is required before
1926 * this function is called (see @a ixEthAccPortMacReset).
1928 * This function is the recommended usage scenario for emergency security
1929 * shutdown and hardware failure recovery and should never be used for throttling
1932 * @li Reentrant - yes
1933 * @li ISR Callable - no
1937 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1938 * guaranteed to restore correct Ethernet Tx/Rx operation.
1940 * @param portId : ID of the port
1942 * @return IxEthAccStatus
1943 * @li @a IX_ETH_ACC_SUCCESS : Tx successfully enabled
1944 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1948 PUBLIC IxEthAccStatus
1949 ixEthAccPortTxEnable(IxEthAccPortId portId);
1954 * @fn IxEthAccStatus ixEthAccPortTxDisable(IxEthAccPortId portId)
1956 * @brief Disable Tx on the port
1958 * This function can be used to disable Tx in the MAC core.
1959 * Tx can be re-enabled, although this is not guaranteed, by performing
1960 * a MAC core reset (@a ixEthAccPortMacReset) and calling ixEthAccPortTxEnable.
1961 * Note that using this function is not recommended, except for shutting
1962 * down Tx for emergency reasons. For proper port shutdown and re-enabling
1963 * see ixEthAccPortEnable and ixEthAccPortDisable.
1965 * This function is the recommended usage scenario for emergency security
1966 * shutdown and hardware failure recovery and should never be used for throttling
1969 * @li Reentrant - yes
1970 * @li ISR Callable - no
1972 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1973 * guaranteed to restore correct Ethernet Tx/Rx operation.
1977 * @param portId : ID of the port
1979 * @return IxEthAccStatus
1980 * @li @a IX_ETH_ACC_SUCCESS : Tx successfully disabled
1981 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1985 PUBLIC IxEthAccStatus
1986 ixEthAccPortTxDisable(IxEthAccPortId portId);
1991 * @fn IxEthAccStatus ixEthAccPortRxEnable(IxEthAccPortId portId)
1993 * @brief Enable Rx on the port
1995 * This function is the complement of ixEthAccPortRxDisable and should
1996 * be used only after Rx was disabled.
1998 * This function is the recommended usage scenario for emergency security
1999 * shutdown and hardware failure recovery and should never be used for throttling
2002 * @li Reentrant - yes
2003 * @li ISR Callable - no
2005 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
2006 * guaranteed to restore correct Ethernet Tx/Rx operation.
2010 * @param portId : ID of the port
2012 * @return IxEthAccStatus
2013 * @li @a IX_ETH_ACC_SUCCESS : Rx successfully enabled
2014 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2018 PUBLIC IxEthAccStatus
2019 ixEthAccPortRxEnable(IxEthAccPortId portId);
2024 * @fn IxEthAccStatus ixEthAccPortRxDisable(IxEthAccPortId portId)
2026 * @brief Disable Rx on the port
2028 * This function can be used to disable Rx in the MAC core.
2029 * Rx can be re-enabled, although this is not guaranteed, by performing
2030 * a MAC core reset (@a ixEthAccPortMacReset) and calling ixEthAccPortRxEnable.
2031 * Note that using this function is not recommended, except for shutting
2032 * down Rx for emergency reasons. For proper port shutdown and re-enabling
2033 * see ixEthAccPortEnable and ixEthAccPortDisable.
2035 * This function is the recommended usage scenario for emergency security
2036 * shutdown and hardware failure recovery and should never be used for throttling
2039 * @li Reentrant - yes
2040 * @li ISR Callable - no
2044 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
2045 * guaranteed to restore correct Ethernet Tx/Rx operation.
2047 * @param portId : ID of the port
2049 * @return IxEthAccStatus
2050 * @li @a IX_ETH_ACC_SUCCESS : Rx successfully disabled
2051 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2055 PUBLIC IxEthAccStatus
2056 ixEthAccPortRxDisable(IxEthAccPortId portId);
2061 * @fn IxEthAccStatus ixEthAccPortMacReset(IxEthAccPortId portId)
2063 * @brief Reset MAC core on the port
2065 * This function will perform a MAC core reset (NPE Ethernet coprocessor).
2066 * This function is inherently unsafe and the NPE recovery is not guaranteed
2067 * after this function is called. The proper manner of performing port disable
2068 * and enable (which will reset the MAC as well) is ixEthAccPortEnable/ixEthAccPortDisable.
2070 * This function is the recommended usage scenario for hardware failure recovery
2071 * and should never be used for throttling traffic.
2073 * @li Reentrant - yes
2074 * @li ISR Callable - no
2078 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
2079 * guaranteed to restore correct Ethernet Tx/Rx operation.
2081 * @param portId : ID of the port
2083 * @return IxEthAccStatus
2084 * @li @a IX_ETH_ACC_SUCCESS : MAC core reset
2085 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2089 PUBLIC IxEthAccStatus
2090 ixEthAccPortMacReset(IxEthAccPortId portId);
2092 /*********************************************************************************
2093 #### ##### ## ##### # #### ##### # #### ####
2094 # # # # # # # # # # # #
2095 #### # # # # # #### # # # ####
2096 # # ###### # # # # # # #
2097 # # # # # # # # # # # # # # #
2098 #### # # # # # #### # # #### ####
2099 **********************************************************************************/
2104 * @brief This struct defines the statistics returned by this component.
2106 * The component returns MIB2 EthObj variables which are obtained from the
2107 * hardware or maintained by this component.
2113 UINT32 dot3StatsAlignmentErrors; /**< link error count (rx) */
2114 UINT32 dot3StatsFCSErrors; /**< link error count (rx) */
2115 UINT32 dot3StatsInternalMacReceiveErrors; /**< link error count (rx) */
2116 UINT32 RxOverrunDiscards; /**< NPE: discarded frames count (rx) */
2117 UINT32 RxLearnedEntryDiscards; /**< NPE: discarded frames count(rx) */
2118 UINT32 RxLargeFramesDiscards; /**< NPE: discarded frames count(rx) */
2119 UINT32 RxSTPBlockedDiscards; /**< NPE: discarded frames count(rx) */
2120 UINT32 RxVLANTypeFilterDiscards; /**< NPE: discarded frames count (rx) */
2121 UINT32 RxVLANIdFilterDiscards; /**< NPE: discarded frames count (rx) */
2122 UINT32 RxInvalidSourceDiscards; /**< NPE: discarded frames count (rx) */
2123 UINT32 RxBlackListDiscards; /**< NPE: discarded frames count (rx) */
2124 UINT32 RxWhiteListDiscards; /**< NPE: discarded frames count (rx) */
2125 UINT32 RxUnderflowEntryDiscards; /**< NPE: discarded frames count (rx) */
2126 UINT32 dot3StatsSingleCollisionFrames; /**< link error count (tx) */
2127 UINT32 dot3StatsMultipleCollisionFrames; /**< link error count (tx) */
2128 UINT32 dot3StatsDeferredTransmissions; /**< link error count (tx) */
2129 UINT32 dot3StatsLateCollisions; /**< link error count (tx) */
2130 UINT32 dot3StatsExcessiveCollsions; /**< link error count (tx) */
2131 UINT32 dot3StatsInternalMacTransmitErrors; /**< link error count (tx) */
2132 UINT32 dot3StatsCarrierSenseErrors; /**< link error count (tx) */
2133 UINT32 TxLargeFrameDiscards; /**< NPE: discarded frames count (tx) */
2134 UINT32 TxVLANIdFilterDiscards; /**< NPE: discarded frames count (tx) */
2141 * @fn ixEthAccMibIIStatsGet(IxEthAccPortId portId ,IxEthEthObjStats *retStats )
2143 * @brief Returns the statistics maintained for a port.
2145 * @li Reentrant - yes
2146 * @li ISR Callable - no
2151 * @param portId @ref IxEthAccPortId [in]
2152 * @param retStats @ref IxEthEthObjStats [out]
2153 * @note Please note the user is responsible for cache coheriency of the retStat
2154 * buffer. The data is actually populated via the NPE's. As such cache safe
2155 * memory should be used in the retStats argument.
2157 * @return IxEthAccStatus
2158 * @li @a IX_ETH_ACC_SUCCESS
2159 * @li @a IX_ETH_ACC_FAIL : Invalid arguments.
2160 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2161 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
2165 PUBLIC IxEthAccStatus
2166 ixEthAccMibIIStatsGet(IxEthAccPortId portId, IxEthEthObjStats *retStats );
2171 * @fn ixEthAccMibIIStatsGetClear(IxEthAccPortId portId, IxEthEthObjStats *retStats)
2173 * @brief Returns and clears the statistics maintained for a port.
2175 * @li Reentrant - yes
2176 * @li ISR Callable - yes
2180 * @param portId @ref IxEthAccPortId [in]
2181 * @param retStats @ref IxEthEthObjStats [out]
2182 * @note Please note the user is responsible for cache coheriency of the retStats
2183 * buffer. The data is actually populated via the NPE's. As such cache safe
2184 * memory should be used in the retStats argument.
2186 * @return IxEthAccStatus
2187 * @li @a IX_ETH_ACC_SUCCESS
2188 * @li @a IX_ETH_ACC_FAIL : invalid arguments.
2189 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2190 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
2194 PUBLIC IxEthAccStatus
2195 ixEthAccMibIIStatsGetClear(IxEthAccPortId portId, IxEthEthObjStats *retStats);
2200 * @fn ixEthAccMibIIStatsClear(IxEthAccPortId portId)
2202 * @brief Clears the statistics maintained for a port.
2204 * @li Reentrant - yes
2205 * @li ISR Callable - no
2209 * @param portId @ref IxEthAccPortId [in]
2211 * @return IxEthAccStatus
2212 * @li @a IX_ETH_ACC_SUCCESS
2213 * @li @a IX_ETH_ACC_FAIL : Invalid arguments.
2214 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2215 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
2219 PUBLIC IxEthAccStatus ixEthAccMibIIStatsClear(IxEthAccPortId portId);
2224 * @fn ixEthAccMacInit(IxEthAccPortId portId)
2226 * @brief Initializes the ethernet MAC settings
2228 * @li Reentrant - no
2229 * @li ISR Callable - no
2231 * @param portId @ref IxEthAccPortId [in]
2233 * @return IxEthAccStatus
2234 * @li @a IX_ETH_ACC_SUCCESS
2235 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2239 PUBLIC IxEthAccStatus ixEthAccMacInit(IxEthAccPortId portId);
2244 * @fn ixEthAccStatsShow(IxEthAccPortId portId)
2247 * @brief Displays a ports statistics on the standard io console using printf.
2249 * @li Reentrant - no
2250 * @li ISR Callable - no
2254 * @param portId @ref IxEthAccPortId [in]
2260 PUBLIC void ixEthAccStatsShow(IxEthAccPortId portId);
2262 /*************************************************************************
2264 # # # # # # ##### # ####
2265 ## ## # # ## ## # # # # #
2266 # ## # # # # ## # # # # # #
2267 # # # # # # # # # # #
2268 # # # # # # # # # # #
2269 # # # # # # ##### # ####
2271 *************************************************************************/
2277 * @fn ixEthAccMiiReadRtn (UINT8 phyAddr,
2282 * @brief Reads a 16 bit value from a PHY
2284 * Reads a 16-bit word from a register of a MII-compliant PHY. Reading
2285 * is performed through the MII management interface. This function returns
2286 * when the read operation has successfully completed, or when a timeout has elapsed.
2288 * @li Reentrant - no
2289 * @li ISR Callable - no
2291 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
2293 * @param phyAddr UINT8 [in] - the address of the Ethernet PHY (0-31)
2294 * @param phyReg UINT8 [in] - the number of the MII register to read (0-31)
2295 * @param value UINT16 [in] - the value read from the register
2297 * @return IxEthAccStatus
2298 * @li @a IX_ETH_ACC_SUCCESS
2299 * @li @a IX_ETH_ACC_FAIL : failed to read the register.
2303 PUBLIC IxEthAccStatus
2304 ixEthAccMiiReadRtn (UINT8 phyAddr, UINT8 phyReg, UINT16 *value);
2309 * @fn ixEthAccMiiWriteRtn (UINT8 phyAddr,
2314 * @brief Writes a 16 bit value to a PHY
2316 * Writes a 16-bit word from a register of a MII-compliant PHY. Writing
2317 * is performed through the MII management interface. This function returns
2318 * when the write operation has successfully completed, or when a timeout has elapsed.
2320 * @li Reentrant - no
2321 * @li ISR Callable - no
2323 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
2325 * @param phyAddr UINT8 [in] - the address of the Ethernet PHY (0-31)
2326 * @param phyReg UINT8 [in] - the number of the MII register to write (0-31)
2327 * @param value UINT16 [out] - the value to write to the register
2329 * @return IxEthAccStatus
2330 * @li @a IX_ETH_ACC_SUCCESS
2331 * @li @a IX_ETH_ACC_FAIL : failed to write register.
2335 PUBLIC IxEthAccStatus
2336 ixEthAccMiiWriteRtn (UINT8 phyAddr, UINT8 phyReg, UINT16 value);
2341 * @fn ixEthAccMiiAccessTimeoutSet(UINT32 timeout)
2343 * @brief Overrides the default timeout value and retry count when reading or
2344 * writing MII registers using ixEthAccMiiWriteRtn or ixEthAccMiiReadRtn
2346 * The default behavior of the component is to use a IX_ETH_ACC_MII_10TH_SEC_IN_MILLIS ms
2347 * timeout (declared as 100 in IxEthAccMii_p.h) and a retry count of IX_ETH_ACC_MII_TIMEOUT_10TH_SECS
2348 * (declared as 5 in IxEthAccMii_p.h).
2350 * The MII read and write functions will attempt to read the status of the register up
2351 * to the retry count times, delaying between each attempt with the timeout value.
2353 * @li Reentrant - no
2354 * @li ISR Callable - no
2358 * @param timeout UINT32 [in] - new timeout value, in milliseconds
2359 * @param timeout UINT32 [in] - new retry count (a minimum value of 1 must be used)
2361 * @return IxEthAccStatus
2362 * @li @a IX_ETH_ACC_SUCCESS
2363 * @li @a IX_ETH_ACC_FAIL : invalid parameter(s)
2367 PUBLIC IxEthAccStatus
2368 ixEthAccMiiAccessTimeoutSet(UINT32 timeout, UINT32 retryCount);
2373 * @fn ixEthAccMiiStatsShow (UINT32 phyAddr)
2376 * @brief Displays detailed information on a specified PHY
2378 * Displays the current values of the first eigth MII registers for a PHY,
2380 * @li Reentrant - no
2381 * @li ISR Callable - no
2383 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and
2384 * generating the MDIO clock.
2386 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
2388 * @return IxEthAccStatus
2389 * @li @a IX_ETH_ACC_SUCCESS
2390 * @li @a IX_ETH_ACC_FAIL : invalid arguments.
2394 PUBLIC IxEthAccStatus ixEthAccMiiStatsShow (UINT32 phyAddr);
2398 /******* BOARD SPECIFIC DEPRECATED API *********/
2400 /* The following functions are high level functions which rely
2401 * on the properties and interface of some Ethernet PHYs. The
2402 * implementation is hardware specific and has been moved to
2403 * the hardware-specific component IxEthMii.
2406 #include "IxEthMii.h"
2411 * @def ixEthAccMiiPhyScan
2413 * @brief : deprecated API entry point. This definition
2414 * ensures backward compatibility
2416 * See @ref ixEthMiiPhyScan
2418 * @note this feature is board specific
2421 #define ixEthAccMiiPhyScan(phyPresent) ixEthMiiPhyScan(phyPresent,IXP425_ETH_ACC_MII_MAX_ADDR)
2426 * @def ixEthAccMiiPhyConfig
2428 * @brief : deprecated API entry point. This definition
2429 * ensures backward compatibility
2431 * See @ref ixEthMiiPhyConfig
2433 * @note this feature is board specific
2435 #define ixEthAccMiiPhyConfig(phyAddr,speed100,fullDuplex,autonegotiate) \
2436 ixEthMiiPhyConfig(phyAddr,speed100,fullDuplex,autonegotiate)
2441 * @def ixEthAccMiiPhyReset
2443 * @brief : deprecated API entry point. This definition
2444 * ensures backward compatibility
2446 * See @ref ixEthMiiPhyReset
2448 * @note this feature is board specific
2450 #define ixEthAccMiiPhyReset(phyAddr) \
2451 ixEthMiiPhyReset(phyAddr)
2456 * @def ixEthAccMiiLinkStatus
2458 * @brief : deprecated API entry point. This definition
2459 * ensures backward compatibility
2461 * See @ref ixEthMiiLinkStatus
2463 * @note this feature is board specific
2465 #define ixEthAccMiiLinkStatus(phyAddr,linkUp,speed100,fullDuplex,autoneg) \
2466 ixEthMiiLinkStatus(phyAddr,linkUp,speed100,fullDuplex,autoneg)
2473 * @def ixEthAccMiiShow
2475 * @brief : deprecated API entry point. This definition
2476 * ensures backward compatibility
2478 * See @ref ixEthMiiPhyShow
2480 * @note this feature is board specific
2482 #define ixEthAccMiiShow(phyAddr) \
2483 ixEthMiiPhyShow(phyAddr)
2485 #endif /* ndef IxEthAcc_H */