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 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 * 3. Neither the name of the Intel Corporation nor the names of its contributors
29 * may be used to endorse or promote products derived from this software
30 * without specific prior written permission.
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
34 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * -- End of Copyright Notice --
53 #include <IxOsBuffMgt.h>
57 * @defgroup IxEthAcc IXP400 Ethernet Access (IxEthAcc) API
59 * @brief ethAcc is a library that does provides access to the internal IXP400 10/100Bt Ethernet MACs.
66 * @brief Definition of the Ethernet Access status
68 typedef enum /* IxEthAccStatus */
70 IX_ETH_ACC_SUCCESS = IX_SUCCESS, /**< return success*/
71 IX_ETH_ACC_FAIL = IX_FAIL, /**< return fail*/
72 IX_ETH_ACC_INVALID_PORT, /**< return invalid port*/
73 IX_ETH_ACC_PORT_UNINITIALIZED, /**< return uninitialized*/
74 IX_ETH_ACC_MAC_UNINITIALIZED, /**< return MAC uninitialized*/
75 IX_ETH_ACC_INVALID_ARG, /**< return invalid arg*/
76 IX_ETH_TX_Q_FULL, /**< return tx queue is full*/
77 IX_ETH_ACC_NO_SUCH_ADDR /**< return no such address*/
82 * @enum IxEthAccPortId
83 * @brief Definition of the IXP400 Mac Ethernet device.
87 IX_ETH_PORT_1 = 0, /**< Ethernet Port 1 */
88 IX_ETH_PORT_2 = 1 /**< Ethernet port 2 */
89 ,IX_ETH_PORT_3 = 2 /**< Ethernet port 3 */
95 * @def IX_ETH_ACC_NUMBER_OF_PORTS
97 * @brief Definition of the number of ports
101 #define IX_ETH_ACC_NUMBER_OF_PORTS (3)
103 #define IX_ETH_ACC_NUMBER_OF_PORTS (2)
109 * @def IX_IEEE803_MAC_ADDRESS_SIZE
111 * @brief Definition of the size of the MAC address
114 #define IX_IEEE803_MAC_ADDRESS_SIZE (6)
119 * @brief Definition of the IEEE 802.3 Ethernet MAC address structure.
121 * The data should be packed with bytes xx:xx:xx:xx:xx:xx
123 * The data must be packed in network byte order.
127 UINT8 macAddress[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< MAC address */
132 * @def IX_ETH_ACC_NUM_TX_PRIORITIES
133 * @brief Definition of the number of transmit priorities
136 #define IX_ETH_ACC_NUM_TX_PRIORITIES (8)
140 * @enum IxEthAccTxPriority
141 * @brief Definition of the relative priority used to transmit a frame
146 IX_ETH_ACC_TX_PRIORITY_0 = 0, /**<Lowest Priority submission */
147 IX_ETH_ACC_TX_PRIORITY_1 = 1, /**<submission prority of 1 (0 is lowest)*/
148 IX_ETH_ACC_TX_PRIORITY_2 = 2, /**<submission prority of 2 (0 is lowest)*/
149 IX_ETH_ACC_TX_PRIORITY_3 = 3, /**<submission prority of 3 (0 is lowest)*/
150 IX_ETH_ACC_TX_PRIORITY_4 = 4, /**<submission prority of 4 (0 is lowest)*/
151 IX_ETH_ACC_TX_PRIORITY_5 = 5, /**<submission prority of 5 (0 is lowest)*/
152 IX_ETH_ACC_TX_PRIORITY_6 = 6, /**<submission prority of 6 (0 is lowest)*/
153 IX_ETH_ACC_TX_PRIORITY_7 = 7, /**<Highest priority submission */
155 IX_ETH_ACC_TX_DEFAULT_PRIORITY = IX_ETH_ACC_TX_PRIORITY_0 /**< By default send all
156 packets with lowest priority */
157 } IxEthAccTxPriority;
161 * @enum IxEthAccRxFrameType
162 * @brief Identify the type of a frame.
164 * @sa IX_ETHACC_NE_FLAGS
165 * @sa IX_ETHACC_NE_LINKMASK
169 IX_ETHACC_RX_LLCTYPE = 0x00, /**< 802.3 - 8802, with LLC/SNAP */
170 IX_ETHACC_RX_ETHTYPE = 0x10, /**< 802.3 (Ethernet) without LLC/SNAP */
171 IX_ETHACC_RX_STATYPE = 0x20, /**< 802.11, AP <=> STA */
172 IX_ETHACC_RX_APTYPE = 0x30 /**< 802.11, AP <=> AP */
173 } IxEthAccRxFrameType;
177 * @enum IxEthAccDuplexMode
178 * @brief Definition to provision the duplex mode of the MAC.
183 IX_ETH_ACC_FULL_DUPLEX, /**< Full duplex operation of the MAC */
184 IX_ETH_ACC_HALF_DUPLEX /**< Half duplex operation of the MAC */
185 } IxEthAccDuplexMode;
191 * @brief Definition of service-specific informations.
193 * This structure defines the Ethernet service-specific informations
194 * and enable QoS and VLAN features.
198 UINT32 ixReserved_next; /**< reserved for chaining */
199 UINT32 ixReserved_lengths; /**< reserved for buffer lengths */
200 UINT32 ixReserved_data; /**< reserved for buffer pointer */
201 UINT8 ixDestinationPortId; /**< Destination portId for this packet, if known by NPE */
202 UINT8 ixSourcePortId; /**< Source portId for this packet */
203 UINT16 ixFlags; /**< BitField of option for this frame */
204 UINT8 ixQoS; /**< QoS class of the frame */
205 UINT8 ixReserved; /**< reserved */
206 UINT16 ixVlanTCI; /**< Vlan TCI */
207 UINT8 ixDestMac[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< Destination MAC address */
208 UINT8 ixSourceMac[IX_IEEE803_MAC_ADDRESS_SIZE]; /**< Source MAC address */
214 * @def IX_ETHACC_NE_PORT_UNKNOWN
216 * @brief Contents of the field @a IX_ETHACC_NE_DESTPORTID when no
217 * destination port can be found by the NPE for this frame.
220 #define IX_ETHACC_NE_PORT_UNKNOWN (0xff)
225 * @def IX_ETHACC_NE_DESTMAC
227 * @brief The location of the destination MAC address in the Mbuf header.
230 #define IX_ETHACC_NE_DESTMAC(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixDestMac
235 * @def IX_ETHACC_NE_SOURCEMAC
237 * @brief The location of the source MAC address in the Mbuf header.
240 #define IX_ETHACC_NE_SOURCEMAC(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixSourceMac
245 * @def IX_ETHACC_NE_VLANTCI
247 * @brief The VLAN Tag Control Information associated with this frame
249 * The VLAN Tag Control Information associated with this frame. On Rx
250 * path, this field is extracted from the packet header.
251 * On Tx path, the value of this field is inserted in the frame when
252 * the port is configured to insert or replace vlan tags in the
255 * @sa IX_ETHACC_NE_FLAGS
257 #define IX_ETHACC_NE_VLANTCI(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixVlanTCI
262 * @def IX_ETHACC_NE_SOURCEPORTID
264 * @brief The port where this frame came from.
266 * The port where this frame came from. This field is set on receive
267 * with the port information. This field is ignored on Transmit path.
269 #define IX_ETHACC_NE_SOURCEPORTID(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixSourcePortId
274 * @def IX_ETHACC_NE_DESTPORTID
276 * @brief The destination port where this frame should be sent.
278 * The destination port where this frame should be sent.
280 * @li In the transmit direction, this field contains the destination port
281 * and is ignored unless @a IX_ETHACC_NE_FLAG_DST is set.
283 * @li In the receive direction, this field contains the port where the
284 * destination MAC addresses has been learned. If the destination
285 * MAC address is unknown, then this value is set to the reserved value
286 * @a IX_ETHACC_NE_PORT_UNKNOWN
289 #define IX_ETHACC_NE_DESTPORTID(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixDestinationPortId
294 * @def IX_ETHACC_NE_QOS
296 * @brief QualityOfService class (QoS) for this received frame.
299 #define IX_ETHACC_NE_QOS(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixQoS
304 * @def IX_ETHACC_NE_FLAGS
306 * @brief Bit Mask of the different flags associated with a frame
308 * The flags are the bit-oring combination
309 * of the following different fields :
311 * @li IP flag (Rx @a IX_ETHACC_NE_IPMASK)
312 * @li Spanning Tree flag (Rx @a IX_ETHACC_NE_STMASK)
313 * @li Link layer type (Rx and Tx @a IX_ETHACC_NE_LINKMASK)
314 * @li VLAN Tagged Frame (Rx @a IX_ETHACC_NE_VLANMASK)
315 * @li New source MAC address (Rx @a IX_ETHACC_NE_NEWSRCMASK)
316 * @li Multicast flag (Rx @a IX_ETHACC_NE_MCASTMASK)
317 * @li Broadcast flag (Rx @a IX_ETHACC_NE_BCASTMASK)
318 * @li Destination port flag (Tx @a IX_ETHACC_NE_PORTMASK)
319 * @li Tag/Untag Tx frame (Tx @a IX_ETHACC_NE_TAGMODEMASK)
320 * @li Overwrite destination port (Tx @a IX_ETHACC_NE_PORTOVERMASK)
321 * @li Filtered frame (Rx @a IX_ETHACC_NE_STMASK)
322 * @li VLAN Enabled (Rx and Tx @a IX_ETHACC_NE_VLANENABLEMASK)
324 #define IX_ETHACC_NE_FLAGS(mBufPtr) ((IxEthAccNe *)&((mBufPtr)->ix_ne))->ixFlags
329 * @def IX_ETHACC_NE_BCASTMASK
331 * @brief This mask defines if a received frame is a broadcast frame.
333 * This mask defines if a received frame is a broadcast frame.
334 * The BCAST flag is set when the destination MAC address of
335 * a frame is broadcast.
337 * @sa IX_ETHACC_NE_FLAGS
340 #define IX_ETHACC_NE_BCASTMASK (0x1)
345 * @def IX_ETHACC_NE_MCASTMASK
347 * @brief This mask defines if a received frame is a multicast frame.
349 * This mask defines if a received frame is a multicast frame.
350 * The MCAST flag is set when the destination MAC address of
351 * a frame is multicast.
353 * @sa IX_ETHACC_NE_FLAGS
356 #define IX_ETHACC_NE_MCASTMASK (0x1 << 1)
361 * @def IX_ETHACC_NE_IPMASK
363 * @brief This mask defines if a received frame is a IP frame.
365 * This mask applies to @a IX_ETHACC_NE_FLAGS and defines if a received
366 * frame is a IP frame. The IP flag is set on Rx direction, depending on
367 * the frame contents. The flag is set when the length/type field of a
368 * received frame is 0x8000.
370 * @sa IX_ETHACC_NE_FLAGS
373 #define IX_ETHACC_NE_IPMASK (0x1 << 2)
378 * @def IX_ETHACC_NE_VLANMASK
380 * @brief This mask defines if a received frame is VLAN tagged.
382 * This mask defines if a received frame is VLAN tagged.
383 * When set, the Rx frame is VLAN-tagged and the tag value
384 * is available thru @a IX_ETHACC_NE_VLANID.
385 * Note that when sending frames which are already tagged
386 * this flag should be set, to avoid inserting another VLAN tag.
388 * @sa IX_ETHACC_NE_FLAGS
389 * @sa IX_ETHACC_NE_VLANID
392 #define IX_ETHACC_NE_VLANMASK (0x1 << 3)
397 * @def IX_ETHACC_NE_LINKMASK
399 * @brief This mask is the link layer protocol indicator
401 * This mask applies to @a IX_ETHACC_NE_FLAGS.
402 * It reflects the state of a frame as it exits an NPE on the Rx path
403 * or enters an NPE on the Tx path. Its values are as follows:
404 * @li 0x00 - IEEE802.3 - 8802 (Rx) / IEEE802.3 - 8802 (Tx)
405 * @li 0x01 - IEEE802.3 - Ethernet (Rx) / IEEE802.3 - Ethernet (Tx)
406 * @li 0x02 - IEEE802.11 AP -> STA (Rx) / IEEE802.11 STA -> AP (Tx)
407 * @li 0x03 - IEEE802.11 AP -> AP (Rx) / IEEE802.11 AP->AP (Tx)
409 * @sa IX_ETHACC_NE_FLAGS
412 #define IX_ETHACC_NE_LINKMASK (0x3 << 4)
417 * @def IX_ETHACC_NE_STMASK
419 * @brief This mask defines if a received frame is a Spanning Tree frame.
421 * This mask applies to @a IX_ETHACC_NE_FLAGS.
422 * On rx direction, it defines if a received if frame is a Spanning Tree frame.
423 * Setting this fkag on transmit direction overrides the port settings
424 * regarding the VLAN options and
426 * @sa IX_ETHACC_NE_FLAGS
429 #define IX_ETHACC_NE_STMASK (0x1 << 6)
434 * @def IX_ETHACC_NE_FILTERMASK
436 * @brief This bit indicates whether a frame has been filtered by the Rx service.
438 * This mask applies to @a IX_ETHACC_NE_FLAGS.
439 * Certain frames, which should normally be fully filtered by the NPE to due
440 * the destination MAC address being on the same segment as the Rx port are
441 * still forwarded to the XScale (although the payload is invalid) in order
442 * to learn the MAC address of the transmitting station, if this is unknown.
443 * Normally EthAcc will filter and recycle these framess internally and no
444 * frames with the FILTER bit set will be received by the client.
446 * @sa IX_ETHACC_NE_FLAGS
449 #define IX_ETHACC_NE_FILTERMASK (0x1 << 7)
454 * @def IX_ETHACC_NE_PORTMASK
456 * @brief This mask defines the rule to transmit a frame
458 * This mask defines the rule to transmit a frame. When set, a frame
459 * is transmitted to the destination port as set by the macro
460 * @a IX_ETHACC_NE_DESTPORTID. If not set, the destination port
461 * is searched using the destination MAC address.
463 * @note This flag is meaningful only for multiport Network Engines.
465 * @sa IX_ETHACC_NE_FLAGS
466 * @sa IX_ETHACC_NE_DESTPORTID
469 #define IX_ETHACC_NE_PORTOVERMASK (0x1 << 8)
474 * @def IX_ETHACC_NE_TAGMODEMASK
476 * @brief This mask defines the tagging rules to apply to a transmit frame.
478 * This mask defines the tagging rules to apply to a transmit frame
479 * regardless of the default setting for a port. When used together
480 * with @a IX_ETHACC_NE_TAGOVERMASK and when set, the
481 * frame will be tagged prior to transmission. When not set,
482 * the frame will be untagged prior to transmission. This is accomplished
483 * irrespective of the Egress tagging rules, constituting a per-frame override.
485 * @sa IX_ETHACC_NE_FLAGS
486 * @sa IX_ETHACC_NE_TAGOVERMASK
489 #define IX_ETHACC_NE_TAGMODEMASK (0x1 << 9)
494 * @def IX_ETHACC_NE_TAGOVERMASK
496 * @brief This mask defines the rule to transmit a frame
498 * This mask defines the rule to transmit a frame. When set, the
499 * default transmit rules of a port are overriden.
500 * When not set, the default rules as set by @ref IxEthDB should apply.
502 * @sa IX_ETHACC_NE_FLAGS
503 * @sa IX_ETHACC_NE_TAGMODEMASK
506 #define IX_ETHACC_NE_TAGOVERMASK (0x1 << 10)
511 * @def IX_ETHACC_NE_VLANENABLEMASK
513 * @brief This mask defines if a frame is a VLAN frame or not
515 * When set, frames undergo normal VLAN processing on the Tx path
516 * (membership filtering, tagging, tag removal etc). If this flag is
517 * not set, the frame is considered to be a regular non-VLAN frame
518 * and no VLAN processing will be performed.
520 * Note that VLAN-enabled NPE images will always set this flag in all
521 * Rx frames, and images which are not VLAN enabled will clear this
522 * flag for all received frames.
524 * @sa IX_ETHACC_NE_FLAGS
527 #define IX_ETHACC_NE_VLANENABLEMASK (0x1 << 14)
532 * @def IX_ETHACC_NE_NEWSRCMASK
534 * @brief This mask defines if a received frame has been learned.
536 * This mask defines if the source MAC address of a frame is
537 * already known. If the bit is set, the source MAC address was
538 * unknown to the NPE at the time the frame was received.
540 * @sa IX_ETHACC_NE_FLAGS
543 #define IX_ETHACC_NE_NEWSRCMASK (0x1 << 15)
548 * @brief This defines the recommanded minimum size of MBUF's submitted
549 * to the frame receive service.
552 #define IX_ETHACC_RX_MBUF_MIN_SIZE (2048)
557 * @brief This defines the highest MII address of any attached PHYs
559 * The maximum number for PHY address is 31, add on for range checking.
562 #define IXP425_ETH_ACC_MII_MAX_ADDR 32
567 * @fn ixEthAccInit(void)
569 * @brief Initializes the IXP400 Ethernet Access Service.
572 * @li ISR Callable - no
574 * This should be called once per module initialization.
576 * The NPE must first be downloaded with the required microcode which supports all
579 * @return IxEthAccStatus
580 * @li @a IX_ETH_ACC_SUCCESS
581 * @li @a IX_ETH_ACC_FAIL : Service has failed to initialize.
585 PUBLIC IxEthAccStatus ixEthAccInit(void);
591 * @fn ixEthAccUnload(void)
593 * @brief Unload the Ethernet Access Service.
596 * @li ISR Callable - no
602 PUBLIC void ixEthAccUnload(void);
607 * @fn ixEthAccPortInit( IxEthAccPortId portId)
609 * @brief Initializes an NPE/Ethernet MAC Port.
611 * The NPE/Ethernet port initialisation includes the following steps
612 * @li Initialize the NPE/Ethernet MAC hardware.
613 * @li Verify NPE downloaded and operational.
614 * @li The NPE shall be available for usage once this API returns.
615 * @li Verify that the Ethernet port is present before initializing
618 * @li ISR Callable - no
620 * This should be called once per mac device.
621 * The NPE/MAC shall be in disabled state after init.
624 * The component must be initialized via @a ixEthAccInit
625 * The NPE must first be downloaded with the required microcode which supports all
628 * Dependant on Services: (Must be initialized before using this service may be initialized)
629 * ixNPEmh - NPE Message handling service.
630 * ixQmgr - Queue Manager component.
632 * @param portId @ref IxEthAccPortId [in]
634 * @return IxEthAccStatus
635 * @li @a IX_ETH_ACC_SUCCESS: if the ethernet port is not present, a warning is issued.
636 * @li @a IX_ETH_ACC_FAIL : The NPE processor has failed to initialize.
637 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
641 PUBLIC IxEthAccStatus ixEthAccPortInit(IxEthAccPortId portId);
644 /*************************************************************************
646 ##### ## ##### ## ##### ## ##### # #
647 # # # # # # # # # # # # # #
648 # # # # # # # # # # # # ######
649 # # ###### # ###### ##### ###### # # #
650 # # # # # # # # # # # # #
651 ##### # # # # # # # # # # #
653 *************************************************************************/
659 * @fn ixEthAccPortTxFrameSubmit(
660 IxEthAccPortId portId,
661 IX_OSAL_MBUF *buffer,
662 IxEthAccTxPriority priority)
664 * @brief This function shall be used to submit MBUFs buffers for transmission on a particular MAC device.
666 * When the frame is transmitted, the buffer shall be returned thru the
667 * callback @a IxEthAccPortTxDoneCallback.
669 * In case of over-submitting, the order of the frames on the
670 * network may be modified.
672 * Buffers shall be not queued for transmission if the port is disabled.
673 * The port can be enabled using @a ixEthAccPortEnable
676 * @li Reentrant - yes
677 * @li ISR Callable - yes
681 * @a ixEthAccPortTxDoneCallbackRegister must be called to register a function to allow this service to
682 * return the buffer to the calling service.
685 * If the buffer submit fails for any reason the user has retained ownership of the buffer.
687 * @param portId @ref IxEthAccPortId [in] - MAC port ID to transmit Ethernet frame on.
688 * @param buffer @ref IX_OSAL_MBUF [in] - pointer to an MBUF formatted buffer. Chained buffers are supported for transmission.
689 * Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is ignored.
690 * @param priority @ref IxEthAccTxPriority [in]
692 * @return IxEthAccStatus
693 * @li @a IX_ETH_ACC_SUCCESS
694 * @li @a IX_ETH_ACC_FAIL : Failed to queue frame for transmission.
695 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
696 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
701 PUBLIC IxEthAccStatus ixEthAccPortTxFrameSubmit(
702 IxEthAccPortId portId,
703 IX_OSAL_MBUF *buffer,
704 IxEthAccTxPriority priority);
709 * @brief Function prototype for Ethernet Tx Buffer Done callback. Registered
710 * via @a ixEthAccTxBufferDoneCallbackRegister
712 * This function is called once the previously submitted buffer is no longer required by this service.
713 * It may be returned upon successful transmission of the frame or during the shutdown of
714 * the port prior to the transmission of a queued frame.
715 * The calling of this registered function is not a guarantee of successful transmission of the buffer.
718 * @li Reentrant - yes , The user provided function should be reentrant.
719 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
722 * <b>Calling Context </b>:
724 * This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun
725 * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread.
726 * The decision is system specific.
728 * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC
729 * via @a ixEthAccPortTxDoneCallbackRegister. It allows the same callback to be used for multiple MACs.
730 * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Tx mbuf descriptor.
735 * The field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is modified by the access layer and reset to NULL.
739 typedef void (*IxEthAccPortTxDoneCallback) ( UINT32 callbackTag, IX_OSAL_MBUF *buffer );
746 * @fn ixEthAccPortTxDoneCallbackRegister( IxEthAccPortId portId,
747 IxEthAccPortTxDoneCallback txCallbackFn,
750 * @brief Register a callback function to allow
751 * the transmitted buffers to return to the user.
753 * This function registers the transmit buffer done function callback for a particular port.
755 * The registered callback function is called once the previously submitted buffer is no longer required by this service.
756 * It may be returned upon successful transmission of the frame or shutdown of port prior to submission.
757 * The calling of this registered function is not a guarantee of successful transmission of the buffer.
759 * If called several times the latest callback shall be registered for a particular port.
761 * @li Reentrant - yes
762 * @li ISR Callable - yes
765 * The port must be initialized via @a ixEthAccPortInit
768 * @param portId @ref IxEthAccPortId [in] - Register callback for a particular MAC device.
769 * @param txCallbackFn @ref IxEthAccPortTxDoneCallback [in] - Function to be called to return transmit buffers to the user.
770 * @param callbackTag UINT32 [in] - This tag shall be provided to the callback function.
772 * @return IxEthAccStatus
773 * @li @a IX_ETH_ACC_SUCCESS
774 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
775 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
776 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
780 PUBLIC IxEthAccStatus
781 ixEthAccPortTxDoneCallbackRegister(IxEthAccPortId portId,
782 IxEthAccPortTxDoneCallback txCallbackFn,
790 * @brief Function prototype for Ethernet Frame Rx callback. Registered via @a ixEthAccPortRxCallbackRegister
792 * It is the responsibility of the user function to free any MBUF's which it receives.
794 * @li Reentrant - yes , The user provided function should be reentrant.
795 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
798 * This function dispatches frames to the user level
799 * via the provided function. The invocation shall be made for each
800 * frame dequeued from the Ethernet QM queue. The user is required to free any MBUF's
801 * supplied via this callback. In addition the registered callback must free up MBUF's
802 * from the receive free queue when the port is disabled
804 * If called several times the latest callback shall be registered for a particular port.
806 * <b>Calling Context </b>:
808 * This callback is called in the context of the queue manager dispatch loop @a ixQmgrgrDispatcherLoopRun
809 * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread.
810 * The decision is system specific.
813 * @param callbackTag UINT32 [in] - This tag is that provided when the callback was registered for a particular MAC
814 * via @a ixEthAccPortRxCallbackRegister. It allows the same callback to be used for multiple MACs.
815 * @param mbuf @ref IX_OSAL_MBUF [in] - Pointer to the Rx mbuf header. Mbufs may be chained if
816 * the frame length is greater than the supplied mbuf length.
817 * @param reserved [in] - deprecated parameter The information is passed
818 * thru the IxEthAccNe header destination port ID field
819 * (@sa IX_ETHACC_NE_DESTPORTID). For backward
820 * compatibility,the value is equal to IX_ETH_DB_UNKNOWN_PORT (0xff).
825 * Buffers may not be filled up to the length supplied in
826 * @a ixEthAccPortRxFreeReplenish(). The firmware fills
827 * them to the previous 64 bytes boundary. The user has to be aware
828 * that the length of the received mbufs may be smaller than the length
829 * of the supplied mbufs.
830 * The mbuf header contains the following modified field
831 * @li @a IX_OSAL_MBUF_PKT_LEN is set in the header of the first mbuf and indicates
832 * the total frame size
833 * @li @a IX_OSAL_MBUF_MLEN is set each mbuf header and indicates the payload length
834 * @li @a IX_OSAL_MBUF_NEXT_BUFFER_IN_PKT_PTR contains a pointer to the next
835 * mbuf, or NULL at the end of a chain.
836 * @li @a IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR is modified. Its value is reset to NULL
837 * @li @a IX_OSAL_MBUF_FLAGS contains the bit 4 set for a broadcast packet and the bit 5
838 * set for a multicast packet. Other bits are unmodified.
842 typedef void (*IxEthAccPortRxCallback) (UINT32 callbackTag, IX_OSAL_MBUF *buffer, UINT32 reserved);
847 * @brief Function prototype for Ethernet Frame Rx callback. Registered via @a ixEthAccPortMultiBufferRxCallbackRegister
849 * It is the responsibility of the user function to free any MBUF's which it receives.
851 * @li Reentrant - yes , The user provided function should be reentrant.
852 * @li ISR Callable - yes , The user provided function must be callable from an ISR.
855 * This function dispatches many frames to the user level
856 * via the provided function. The invocation shall be made for multiple frames
857 * dequeued from the Ethernet QM queue. The user is required to free any MBUF's
858 * supplied via this callback. In addition the registered callback must free up MBUF's
859 * from the receive free queue when the port is disabled
861 * If called several times the latest callback shall be registered for a particular port.
863 * <b>Calling Context </b>:
865 * This callback is called in the context of the queue manager dispatch loop @a ixQmgrDispatcherLoopRun
866 * within the @ref IxQMgrAPI component. The calling context may be from interrupt or high priority thread.
867 * The decision is system specific.
870 * @param callbackTag - This tag is that provided when the callback was registered for a particular MAC
871 * via @a ixEthAccPortMultiBufferRxCallbackRegister. It allows the same callback to be used for multiple MACs.
872 * @param mbuf - Pointer to an array of Rx mbuf headers. Mbufs
874 * the frame length is greater than the supplied mbuf length.
875 * The end of the array contains a zeroed entry (NULL pointer).
879 * @note The mbufs passed to this callback have the same structure than the
880 * buffers passed to @a IxEthAccPortRxCallback interfac.
882 * @note The usage of this callback is exclusive with the usage of
883 * @a ixEthAccPortRxCallbackRegister and @a IxEthAccPortRxCallback
885 * @sa ixEthAccPortMultiBufferRxCallbackRegister
886 * @sa IxEthAccPortMultiBufferRxCallback
887 * @sa ixEthAccPortRxCallbackRegister
888 * @sa IxEthAccPortRxCallback
892 typedef void (*IxEthAccPortMultiBufferRxCallback) (UINT32 callbackTag, IX_OSAL_MBUF **buffer);
900 * @fn ixEthAccPortRxCallbackRegister( IxEthAccPortId portId, IxEthAccPortRxCallback rxCallbackFn, UINT32 callbackTag)
902 * @brief Register a callback function to allow
903 * the reception of frames.
905 * The registered callback function is called once a frame is received by this service.
907 * If called several times the latest callback shall be registered for a particular port.
910 * @li Reentrant - yes
911 * @li ISR Callable - yes
914 * @param portId @ref IxEthAccPortId [in] - Register callback for a particular MAC device.
915 * @param rxCallbackFn @ref IxEthAccPortRxCallback [in] - Function to be called when Ethernet frames are availble.
916 * @param callbackTag UINT32 [in] - This tag shall be provided to the callback function.
918 * @return IxEthAccStatus
919 * @li @a IX_ETH_ACC_SUCCESS
920 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
921 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
922 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
926 PUBLIC IxEthAccStatus
927 ixEthAccPortRxCallbackRegister(IxEthAccPortId portId,
928 IxEthAccPortRxCallback rxCallbackFn,
935 * @fn ixEthAccPortMultiBufferRxCallbackRegister( IxEthAccPortId portId, IxEthAccPortMultiBufferRxCallback rxCallbackFn, UINT32 callbackTag)
937 * @brief Register a callback function to allow
938 * the reception of frames.
940 * The registered callback function is called once a frame is
941 * received by this service. If many frames are already received,
942 * the function is called once.
944 * If called several times the latest callback shall be registered for a particular port.
946 * @li Reentrant - yes
947 * @li ISR Callable - yes
950 * @param portId - Register callback for a particular MAC device.
951 * @param rxCallbackFn - @a IxEthAccMultiBufferRxCallbackFn - Function to be called when Ethernet frames are availble.
952 * @param callbackTag - This tag shall be provided to the callback function.
954 * @return IxEthAccStatus
955 * @li @a IX_ETH_ACC_SUCCESS
956 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
957 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
958 * @li @a IX_ETH_ACC_INVALID_ARG : An argument other than portId is invalid.
960 * @sa ixEthAccPortMultiBufferRxCallbackRegister
961 * @sa IxEthAccPortMultiBufferRxCallback
962 * @sa ixEthAccPortRxCallbackRegister
963 * @sa IxEthAccPortRxCallback
966 PUBLIC IxEthAccStatus
967 ixEthAccPortMultiBufferRxCallbackRegister(IxEthAccPortId portId,
968 IxEthAccPortMultiBufferRxCallback rxCallbackFn,
974 * @fn ixEthAccPortRxFreeReplenish( IxEthAccPortId portId, IX_OSAL_MBUF *buffer)
976 * @brief This function provides buffers for the Ethernet receive path.
978 * This component does not have a buffer management mechanisms built in. All Rx buffers must be supplied to it
979 * via this interface.
981 * @li Reentrant - yes
982 * @li ISR Callable - yes
984 * @param portId @ref IxEthAccPortId [in] - Provide buffers only to specific Rx MAC.
985 * @param buffer @ref IX_OSAL_MBUF [in] - Provide an MBUF to the Ethernet receive mechanism.
986 * Buffers size smaller than IX_ETHACC_RX_MBUF_MIN_SIZE may result in poor
987 * performances and excessive buffer chaining. Buffers
988 * larger than this size may be suitable for jumbo frames.
989 * Chained packets are not supported and the field IX_OSAL_MBUF_NEXT_PKT_IN_CHAIN_PTR must be NULL.
991 * @return IxEthAccStatus
992 * @li @a IX_ETH_ACC_SUCCESS
993 * @li @a IX_ETH_ACC_FAIL : Buffer has was not able to queue the
994 * buffer in the receive service.
995 * @li @a IX_ETH_ACC_FAIL : Buffer size is less than IX_ETHACC_RX_MBUF_MIN_SIZE
996 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
997 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1000 * If the buffer replenish operation fails it is the responsibility
1001 * of the user to free the buffer.
1004 * Sufficient buffers must be supplied to the component to maintain
1005 * receive throughput and avoid rx buffer underflow conditions.
1006 * To meet this goal, It is expected that the user preload the
1007 * component with a sufficent number of buffers prior to enabling the
1008 * NPE Ethernet receive path. The recommended minimum number of
1012 * For maximum performances, the mbuf size should be greater
1013 * than the maximum frame size (Ethernet header, payload and FCS) + 64.
1014 * Supplying smaller mbufs to the service results in mbuf
1015 * chaining and degraded performances. The recommended size
1016 * is @a IX_ETHACC_RX_MBUF_MIN_SIZE, which is
1017 * enough to take care of 802.3 frames and "baby jumbo" frames without
1018 * chaining, and "jumbo" frame within chaining.
1021 * Buffers may not be filled up to their length. The firware fills
1022 * them up to the previous 64 bytes boundary. The user has to be aware
1023 * that the length of the received mbufs may be smaller than the length
1024 * of the supplied mbufs.
1026 * @warning This function checks the parameters if the NDEBUG
1027 * flag is not defined. Turning on the argument checking (disabled by
1028 * default) results in a lower EthAcc performance as this function
1029 * is part of the data path.
1033 PUBLIC IxEthAccStatus
1034 ixEthAccPortRxFreeReplenish( IxEthAccPortId portId, IX_OSAL_MBUF *buffer);
1038 /***************************************************************
1040 #### #### # # ##### ##### #### #
1041 # # # # ## # # # # # # #
1042 # # # # # # # # # # # #
1043 # # # # # # # ##### # # #
1044 # # # # # ## # # # # # #
1045 #### #### # # # # # #### ######
1048 ##### # ## # # ######
1050 # # # # # # # # #####
1051 ##### # ###### # # # #
1053 # ###### # # # # ######
1055 ***************************************************************/
1060 * @fn ixEthAccPortEnable(IxEthAccPortId portId)
1062 * @brief This enables an Ethernet port for both Tx and Rx.
1064 * @li Reentrant - yes
1065 * @li ISR Callable - no
1067 * @pre The port must first be initialized via @a ixEthAccPortInit and the MAC address
1068 * must be set using @a ixEthAccUnicastMacAddressSet before enabling it
1069 * The rx and Tx Done callbacks registration via @a
1070 * ixEthAccPortTxDoneCallbackRegister amd @a ixEthAccPortRxCallbackRegister
1071 * has to be done before enabling the traffic.
1073 * @param portId @ref IxEthAccPortId [in] - Port id to act upon.
1075 * @return IxEthAccStatus
1076 * @li @a IX_ETH_ACC_SUCCESS
1077 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1078 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is not initialized
1079 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized
1083 PUBLIC IxEthAccStatus ixEthAccPortEnable(IxEthAccPortId portId);
1088 * @fn ixEthAccPortDisable(IxEthAccPortId portId)
1090 * @brief This disables an Ethernet port for both Tx and Rx.
1092 * Free MBufs are returned to the user via the registered callback when the port is disabled
1094 * @li Reentrant - yes
1095 * @li ISR Callable - no
1097 * @pre The port must be enabled with @a ixEthAccPortEnable, otherwise this
1098 * function has no effect
1100 * @param portId @ref IxEthAccPortId [in] - Port id to act upon.
1102 * @return IxEthAccStatus
1103 * @li @a IX_ETH_ACC_SUCCESS
1104 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1105 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is not initialized
1106 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized
1110 PUBLIC IxEthAccStatus ixEthAccPortDisable(IxEthAccPortId portId);
1115 * @fn ixEthAccPortEnabledQuery(IxEthAccPortId portId, BOOL *enabled)
1117 * @brief Get the enabled state of a port.
1119 * @li Reentrant - yes
1120 * @li ISR Callable - yes
1122 * @pre The port must first be initialized via @a ixEthAccPortInit
1124 * @param portId @ref IxEthAccPortId [in] - Port id to act upon.
1125 * @param enabled BOOL [out] - location to store the state of the port
1127 * @return IxEthAccStatus
1128 * @li @a IX_ETH_ACC_SUCCESS
1129 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid
1133 PUBLIC IxEthAccStatus
1134 ixEthAccPortEnabledQuery(IxEthAccPortId portId, BOOL *enabled);
1139 * @fn ixEthAccPortPromiscuousModeClear(IxEthAccPortId portId)
1141 * @brief Put the Ethernet MAC device in non-promiscuous mode.
1143 * In non-promiscuous mode the MAC filters all frames other than
1144 * destination MAC address which matches the following criteria:
1145 * @li Unicast address provisioned via @a ixEthAccUnicastMacAddressSet
1146 * @li All broadcast frames.
1147 * @li Multicast addresses provisioned via @a ixEthAccMulticastAddressJoin
1149 * Other functions modify the MAC filtering
1151 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1152 * frames are forwarded to the application
1153 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1154 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1155 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1157 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1159 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1160 * forwarded to the application regardless of the multicast
1161 * address provisioned
1162 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1163 * to the application following the multicast address provisioned
1165 * In all cases, unicast and broadcast addresses are forwarded to
1168 * @li Reentrant - yes
1169 * @li ISR Callable - no
1171 * @sa ixEthAccPortPromiscuousModeSet
1173 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1175 * @return IxEthAccStatus
1176 * @li @a IX_ETH_ACC_SUCCESS
1177 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1178 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1182 PUBLIC IxEthAccStatus ixEthAccPortPromiscuousModeClear(IxEthAccPortId portId);
1188 * @fn ixEthAccPortPromiscuousModeSet(IxEthAccPortId portId)
1190 * @brief Put the MAC device in promiscuous mode.
1192 * If the device is in promiscuous mode then all all received frames shall be forwared
1193 * to the NPE for processing.
1195 * Other functions modify the MAC filtering
1197 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1198 * frames are forwarded to the application
1199 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1200 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1201 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1203 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1205 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1206 * forwarded to the application regardless of the multicast
1207 * address provisioned
1208 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1209 * to the application following the multicast address provisioned
1211 * In all cases, unicast and broadcast addresses are forwarded to
1214 * @li Reentrant - yes
1215 * @li ISR Callable - no
1217 * @sa ixEthAccPortPromiscuousModeClear
1219 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
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 ixEthAccPortPromiscuousModeSet(IxEthAccPortId portId);
1233 * @fn ixEthAccPortUnicastMacAddressSet( IxEthAccPortId portId,
1234 IxEthAccMacAddr *macAddr)
1236 * @brief Configure unicast MAC address for a particular port
1239 * @li Reentrant - yes
1240 * @li ISR Callable - no
1242 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1243 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
1245 * @return IxEthAccStatus
1246 * @li @a IX_ETH_ACC_SUCCESS
1247 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1248 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1252 PUBLIC IxEthAccStatus ixEthAccPortUnicastMacAddressSet(IxEthAccPortId portId,
1253 IxEthAccMacAddr *macAddr);
1258 * @fn ixEthAccPortUnicastMacAddressGet( IxEthAccPortId portId,
1259 IxEthAccMacAddr *macAddr)
1261 * @brief Get unicast MAC address for a particular MAC port
1264 * The MAC address must first be set via @a ixEthAccMacPromiscuousModeSet
1265 * If the MAC address has not been set, the function returns a
1266 * IX_ETH_ACC_MAC_UNINITIALIZED status
1268 * @li Reentrant - yes
1269 * @li ISR Callable - no
1271 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1272 * @param *macAddr @ref IxEthAccMacAddr [out] - Ethernet MAC address.
1274 * @return IxEthAccStatus
1275 * @li @a IX_ETH_ACC_SUCCESS
1276 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1277 * @li @a IX_ETH_ACC_MAC_UNINITIALIZED : port MAC address is not initialized.
1278 * @li @a IX_ETH_ACC_FAIL : macAddr is invalid.
1282 PUBLIC IxEthAccStatus
1283 ixEthAccPortUnicastMacAddressGet(IxEthAccPortId portId,
1284 IxEthAccMacAddr *macAddr);
1292 * @fn ixEthAccPortMulticastAddressJoin( IxEthAccPortId portId,
1293 IxEthAccMacAddr *macAddr)
1295 * @brief Add a multicast address to the MAC address table.
1298 * Due to the operation of the Ethernet MAC multicast filtering mechanism, frames which do not
1299 * have a multicast destination address which were provisioned via this API may be forwarded
1300 * to the NPE's. This is a result of the hardware comparison algorithm used in the destination mac address logic
1301 * within the Ethernet MAC.
1303 * See Also: IXP425 hardware development manual.
1305 * Other functions modify the MAC filtering
1307 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1308 * frames are forwarded to the application
1309 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1310 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1311 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1313 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1315 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1316 * forwarded to the application regardless of the multicast
1317 * address provisioned
1318 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1319 * to the application following the multicast address provisioned
1321 * In all cases, unicast and broadcast addresses are forwarded to
1324 * @li Reentrant - yes
1325 * @li ISR Callable - no
1327 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1328 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
1330 * @return IxEthAccStatus
1331 * @li @a IX_ETH_ACC_SUCCESS
1332 * @li @a IX_ETH_ACC_FAIL : Error writing to the MAC registers
1333 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1334 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1338 PUBLIC IxEthAccStatus
1339 ixEthAccPortMulticastAddressJoin(IxEthAccPortId portId,
1340 IxEthAccMacAddr *macAddr);
1345 * @fn ixEthAccPortMulticastAddressJoinAll( IxEthAccPortId portId)
1347 * @brief Filter all frames with multicast dest.
1349 * This function clears the MAC address table, and then sets
1350 * the MAC to forward ALL multicast frames to the NPE.
1351 * Specifically, it forwards all frames whose destination address
1352 * has the LSB of the highest byte set (01:00:00:00:00:00). This
1353 * bit is commonly referred to as the "multicast bit".
1354 * Broadcast frames will still be forwarded.
1356 * Other functions modify the MAC filtering
1358 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1359 * frames are forwarded to the application
1360 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1361 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1362 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1364 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1366 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1367 * forwarded to the application regardless of the multicast
1368 * address provisioned
1369 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1370 * to the application following the multicast address provisioned
1372 * In all cases, unicast and broadcast addresses are forwarded to
1375 * @li Reentrant - yes
1376 * @li ISR Callable - no
1378 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1380 * @return IxEthAccStatus
1381 * @li @a IX_ETH_ACC_SUCCESS
1382 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1383 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1387 PUBLIC IxEthAccStatus
1388 ixEthAccPortMulticastAddressJoinAll(IxEthAccPortId portId);
1393 * @fn ixEthAccPortMulticastAddressLeave( IxEthAccPortId portId,
1394 IxEthAccMacAddr *macAddr)
1396 * @brief Remove a multicast address from the MAC address table.
1398 * Other functions modify the MAC filtering
1400 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1401 * frames are forwarded to the application
1402 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1403 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1404 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1406 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1408 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1409 * forwarded to the application regardless of the multicast
1410 * address provisioned
1411 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1412 * to the application following the multicast address provisioned
1414 * In all cases, unicast and broadcast addresses are forwarded to
1417 * @li Reentrant - yes
1418 * @li ISR Callable - no
1420 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1421 * @param *macAddr @ref IxEthAccMacAddr [in] - Ethernet Mac address.
1423 * @return IxEthAccStatus
1424 * @li @a IX_ETH_ACC_SUCCESS
1425 * @li @a IX_ETH_ACC_NO_SUCH_ADDR : Failed if MAC address was not in the table.
1426 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1427 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1431 PUBLIC IxEthAccStatus
1432 ixEthAccPortMulticastAddressLeave(IxEthAccPortId portId,
1433 IxEthAccMacAddr *macAddr);
1438 * @fn ixEthAccPortMulticastAddressLeaveAll( IxEthAccPortId portId)
1440 * @brief This function unconfigures the multicast filtering settings
1442 * This function first clears the MAC address table, and then sets
1443 * the MAC as configured by the promiscuous mode current settings.
1445 * Other functions modify the MAC filtering
1447 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1448 * frames are forwarded to the application
1449 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1450 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1451 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1453 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1455 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1456 * forwarded to the application regardless of the multicast
1457 * address provisioned
1458 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1459 * to the application following the multicast address provisioned
1461 * In all cases, unicast and broadcast addresses are forwarded to
1464 * @li Reentrant - yes
1465 * @li ISR Callable - no
1467 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1469 * @return IxEthAccStatus
1470 * @li @a IX_ETH_ACC_SUCCESS
1471 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1472 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1476 PUBLIC IxEthAccStatus
1477 ixEthAccPortMulticastAddressLeaveAll(IxEthAccPortId portId);
1482 * @fn ixEthAccPortUnicastAddressShow(IxEthAccPortId portId)
1484 * @brief Displays unicast MAC address
1486 * Displays unicast address which is configured using
1487 * @a ixEthAccUnicastMacAddressSet. This function also displays the MAC filter used
1488 * to filter multicast frames.
1490 * Other functions modify the MAC filtering
1492 * @li @a ixEthAccPortMulticastAddressJoinAll() - all multicast
1493 * frames are forwarded to the application
1494 * @li @a ixEthAccPortMulticastAddressLeaveAll() - rollback the
1495 * effects of @a ixEthAccPortMulticastAddressJoinAll()
1496 * @li @a ixEthAccPortMulticastAddressLeave() - unprovision a new
1498 * @li @a ixEthAccPortMulticastAddressJoin() - provision a new
1500 * @li @a ixEthAccPortPromiscuousModeSet() - all frames are
1501 * forwarded to the application regardless of the multicast
1502 * address provisioned
1503 * @li @a ixEthAccPortPromiscuousModeClear() - frames are forwarded
1504 * to the application following the multicast address provisioned
1506 * In all cases, unicast and broadcast addresses are forwarded to
1509 * @li Reentrant - yes
1510 * @li ISR Callable - no
1512 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1518 PUBLIC IxEthAccStatus ixEthAccPortUnicastAddressShow(IxEthAccPortId portId);
1524 * @fn ixEthAccPortMulticastAddressShow( IxEthAccPortId portId)
1526 * @brief Displays multicast MAC address
1528 * Displays multicast address which have been configured using @a ixEthAccMulticastAddressJoin
1530 * @li Reentrant - yes
1531 * @li ISR Callable - no
1533 * @param portId @ref IxEthAccPortId [in] - Ethernet port id.
1539 PUBLIC void ixEthAccPortMulticastAddressShow( IxEthAccPortId portId);
1544 * @fn ixEthAccPortDuplexModeSet( IxEthAccPortId portId, IxEthAccDuplexMode mode )
1546 * @brief Set the duplex mode for the MAC.
1548 * Configure the IXP400 MAC to either full or half duplex.
1551 * The configuration should match that provisioned on the PHY.
1553 * @li Reentrant - yes
1554 * @li ISR Callable - no
1556 * @param portId @ref IxEthAccPortId [in]
1557 * @param mode @ref IxEthAccDuplexMode [in]
1559 * @return IxEthAccStatus
1560 * @li @a IX_ETH_ACC_SUCCESS
1561 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1562 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1566 PUBLIC IxEthAccStatus
1567 ixEthAccPortDuplexModeSet(IxEthAccPortId portId,IxEthAccDuplexMode mode);
1572 * @fn ixEthAccPortDuplexModeGet( IxEthAccPortId portId, IxEthAccDuplexMode *mode )
1574 * @brief Get the duplex mode for the MAC.
1576 * return the duplex configuration of the IXP400 MAC.
1579 * The configuration should match that provisioned on the PHY.
1580 * See @a ixEthAccDuplexModeSet
1582 * @li Reentrant - yes
1583 * @li ISR Callable - no
1585 * @param portId @ref IxEthAccPortId [in]
1586 * @param *mode @ref IxEthAccDuplexMode [out]
1588 * @return IxEthAccStatus
1589 * @li @a IX_ETH_ACC_SUCCESS
1590 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1591 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1596 PUBLIC IxEthAccStatus
1597 ixEthAccPortDuplexModeGet(IxEthAccPortId portId,IxEthAccDuplexMode *mode );
1602 * @fn ixEthAccPortTxFrameAppendPaddingEnable( IxEthAccPortId portId)
1604 * @brief Enable padding bytes to be appended to runt frames submitted to
1607 * Enable up to 60 null-bytes padding bytes to be appended to runt frames
1608 * submitted to this port. This is the default behavior of the access
1611 * @warning Do not change this behaviour while the port is enabled.
1613 * @note When Tx padding is enabled, Tx FCS generation is turned on
1615 * @li Reentrant - yes
1616 * @li ISR Callable - no
1618 * @sa ixEthAccPortTxFrameAppendFCSDusable
1620 * @param portId @ref IxEthAccPortId [in]
1622 * @return IxEthAccStatus
1623 * @li @a IX_ETH_ACC_SUCCESS
1624 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1625 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1629 PUBLIC IxEthAccStatus
1630 ixEthAccPortTxFrameAppendPaddingEnable(IxEthAccPortId portId);
1635 * @fn ixEthAccPortTxFrameAppendPaddingDisable( IxEthAccPortId portId)
1637 * @brief Disable padding bytes to be appended to runt frames submitted to
1640 * Disable padding bytes to be appended to runt frames
1641 * submitted to this port. This is not the default behavior of the access
1644 * @warning Do not change this behaviour while the port is enabled.
1646 * @li Reentrant - yes
1647 * @li ISR Callable - no
1649 * @param portId @ref IxEthAccPortId [in]
1651 * @return IxEthAccStatus
1652 * @li @a IX_ETH_ACC_SUCCESS
1653 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1654 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1658 PUBLIC IxEthAccStatus
1659 ixEthAccPortTxFrameAppendPaddingDisable(IxEthAccPortId portId);
1664 * @fn ixEthAccPortTxFrameAppendFCSEnable( IxEthAccPortId portId)
1666 * @brief Enable the appending of Ethernet FCS to all frames submitted to this port
1668 * When enabled, the FCS is added to the submitted frames. This is the default
1669 * behavior of the access component.
1670 * Do not change this behaviour while the port is enabled.
1672 * @li Reentrant - yes
1673 * @li ISR Callable - no
1675 * @param portId @ref IxEthAccPortId [in]
1677 * @return IxEthAccStatus
1678 * @li @a IX_ETH_ACC_SUCCESS
1679 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1680 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1684 PUBLIC IxEthAccStatus
1685 ixEthAccPortTxFrameAppendFCSEnable(IxEthAccPortId portId);
1690 * @fn ixEthAccPortTxFrameAppendFCSDisable( IxEthAccPortId portId)
1692 * @brief Disable the appending of Ethernet FCS to all frames submitted to this port.
1694 * When disabled, the Ethernet FCS is not added to the submitted frames.
1695 * This is not the default
1696 * behavior of the access component.
1698 * @note Since the FCS is not appended to the frame it is expected that the frame submitted to the
1699 * component includes a valid FCS at the end of the data, although this will not be validated.
1701 * The component shall forward the frame to the Ethernet MAC WITHOUT modification.
1703 * Do not change this behaviour while the port is enabled.
1705 * @note Tx FCS append is not disabled while Tx padding is enabled.
1707 * @li Reentrant - yes
1708 * @li ISR Callable - no
1710 * @sa ixEthAccPortTxFrameAppendPaddingEnable
1712 * @param portId @ref IxEthAccPortId [in]
1714 * @return IxEthAccStatus
1715 * @li @a IX_ETH_ACC_SUCCESS
1716 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1717 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1721 PUBLIC IxEthAccStatus
1722 ixEthAccPortTxFrameAppendFCSDisable(IxEthAccPortId portId);
1727 * @fn ixEthAccPortRxFrameAppendFCSEnable( IxEthAccPortId portId)
1729 * @brief Forward frames with FCS included in the receive buffer.
1731 * The FCS is not striped from the receive buffer.
1732 * The received frame length includes the FCS size (4 bytes). ie.
1733 * A minimum sized ethernet frame shall have a length of 64bytes.
1735 * Frame FCS validity checks are still carried out on all received frames.
1737 * This is not the default
1738 * behavior of the access component.
1740 * @li Reentrant - yes
1741 * @li ISR Callable - no
1743 * @param portId @ref IxEthAccPortId [in]
1745 * @return IxEthAccStatus
1746 * @li @a IX_ETH_ACC_SUCCESS
1747 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1748 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1752 PUBLIC IxEthAccStatus
1753 ixEthAccPortRxFrameAppendFCSEnable(IxEthAccPortId portId);
1758 * @fn ixEthAccPortRxFrameAppendFCSDisable( IxEthAccPortId portId)
1760 * @brief Do not forward the FCS portion of the received Ethernet frame to the user.
1761 * The FCS is striped from the receive buffer.
1762 * The received frame length does not include the FCS size (4 bytes).
1763 * Frame FCS validity checks are still carried out on all received frames.
1765 * This is the default behavior of the component.
1766 * Do not change this behaviour while the port is enabled.
1768 * @li Reentrant - yes
1769 * @li ISR Callable - no
1771 * @param portId @ref IxEthAccPortId [in]
1773 * @return IxEthAccStatus
1774 * @li @a IX_ETH_ACC_SUCCESS
1775 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1776 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1780 PUBLIC IxEthAccStatus
1781 ixEthAccPortRxFrameAppendFCSDisable(IxEthAccPortId portId);
1789 * @enum IxEthAccSchedulerDiscipline
1791 * @brief Definition for the port scheduling discipline
1793 * Select the port scheduling discipline on receive and transmit path
1794 * @li FIFO : No Priority : In this configuration all frames are processed
1795 * in the access component in the strict order in which
1796 * the component received them.
1797 * @li FIFO : Priority : This shall be a very simple priority mechanism.
1798 * Higher prior-ity frames shall be forwarded
1799 * before lower priority frames. There shall be no
1800 * fairness mechanisms applied across different
1801 * priorities. Higher priority frames could starve
1802 * lower priority frames indefinitely.
1806 FIFO_NO_PRIORITY, /**<frames submitted with no priority*/
1807 FIFO_PRIORITY /**<higher prority frames submitted before lower priority*/
1808 }IxEthAccSchedulerDiscipline;
1813 * @def IxEthAccTxSchedulerDiscipline
1815 * @brief Deprecated definition for the port transmit scheduling discipline
1817 #define IxEthAccTxSchedulerDiscipline IxEthAccSchedulerDiscipline
1824 * @fn ixEthAccTxSchedulingDisciplineSet( IxEthAccPortId portId, IxEthAccSchedulerDiscipline sched)
1826 * @brief Set the port scheduling to one of @a IxEthAccSchedulerDiscipline
1828 * The default behavior of the component is @a FIFO_NO_PRIORITY.
1830 * @li Reentrant - yes
1831 * @li ISR Callable - no
1836 * @param portId @ref IxEthAccPortId [in]
1837 * @param sched @ref IxEthAccSchedulerDiscipline [in]
1839 * @return IxEthAccStatus
1840 * @li @a IX_ETH_ACC_SUCCESS : Set appropriate discipline.
1841 * @li @a IX_ETH_ACC_FAIL : Invalid/unsupported discipline.
1842 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
1843 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
1847 PUBLIC IxEthAccStatus
1848 ixEthAccTxSchedulingDisciplineSet(IxEthAccPortId portId,
1849 IxEthAccSchedulerDiscipline sched);
1855 * @fn ixEthAccRxSchedulingDisciplineSet(IxEthAccSchedulerDiscipline sched)
1857 * @brief Set the Rx scheduling to one of @a IxEthAccSchedulerDiscipline
1859 * The default behavior of the component is @a FIFO_NO_PRIORITY.
1861 * @li Reentrant - yes
1862 * @li ISR Callable - no
1866 * @param sched : @a IxEthAccSchedulerDiscipline
1868 * @return IxEthAccStatus
1869 * @li @a IX_ETH_ACC_SUCCESS : Set appropriate discipline.
1870 * @li @a IX_ETH_ACC_FAIL : Invalid/unsupported discipline.
1874 PUBLIC IxEthAccStatus
1875 ixEthAccRxSchedulingDisciplineSet(IxEthAccSchedulerDiscipline sched);
1880 * @fn IxEthAccStatus ixEthAccNpeLoopbackEnable(IxEthAccPortId portId)
1882 * @brief Enable NPE loopback
1884 * When this loopback mode is enabled all the transmitted frames are
1885 * received on the same port, without payload.
1887 * This function is recommended for power-up diagnostic checks and
1888 * should never be used under normal Ethernet traffic operations.
1890 * @li Reentrant - yes
1891 * @li ISR Callable - no
1895 * @param portId : ID of the port
1897 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1898 * guaranteed to restore correct Ethernet Tx/Rx operation.
1900 * @return IxEthAccStatus
1901 * @li @a IX_ETH_ACC_SUCCESS : NPE loopback mode enabled
1902 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1906 PUBLIC IxEthAccStatus
1907 ixEthAccPortNpeLoopbackEnable(IxEthAccPortId portId);
1912 * @fn IxEthAccStatus ixEthAccPortNpeLoopbackDisable(IxEthAccPortId portId)
1914 * @brief Disable NPE loopback
1916 * This function is used to disable the NPE loopback if previously
1917 * enabled using ixEthAccNpeLoopbackEnable.
1919 * This function is recommended for power-up diagnostic checks and
1920 * should never be used under normal Ethernet traffic operations.
1922 * @li Reentrant - yes
1923 * @li ISR Callable - no
1927 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1928 * guaranteed to restore correct Ethernet Tx/Rx operation.
1930 * @param portId : ID of the port
1932 * @return IxEthAccStatus
1933 * @li @a IX_ETH_ACC_SUCCESS : NPE loopback successfully disabled
1934 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1938 PUBLIC IxEthAccStatus
1939 ixEthAccPortNpeLoopbackDisable(IxEthAccPortId portId);
1944 * @fn IxEthAccStatus ixEthAccPortTxEnable(IxEthAccPortId portId)
1946 * @brief Enable Tx on the port
1948 * This function is the complement of ixEthAccPortTxDisable and should
1949 * be used only after Tx was disabled. A MAC core reset is required before
1950 * this function is called (see @a ixEthAccPortMacReset).
1952 * This function is the recommended usage scenario for emergency security
1953 * shutdown and hardware failure recovery and should never be used for throttling
1956 * @li Reentrant - yes
1957 * @li ISR Callable - no
1961 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1962 * guaranteed to restore correct Ethernet Tx/Rx operation.
1964 * @param portId : ID of the port
1966 * @return IxEthAccStatus
1967 * @li @a IX_ETH_ACC_SUCCESS : Tx successfully enabled
1968 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
1972 PUBLIC IxEthAccStatus
1973 ixEthAccPortTxEnable(IxEthAccPortId portId);
1978 * @fn IxEthAccStatus ixEthAccPortTxDisable(IxEthAccPortId portId)
1980 * @brief Disable Tx on the port
1982 * This function can be used to disable Tx in the MAC core.
1983 * Tx can be re-enabled, although this is not guaranteed, by performing
1984 * a MAC core reset (@a ixEthAccPortMacReset) and calling ixEthAccPortTxEnable.
1985 * Note that using this function is not recommended, except for shutting
1986 * down Tx for emergency reasons. For proper port shutdown and re-enabling
1987 * see ixEthAccPortEnable and ixEthAccPortDisable.
1989 * This function is the recommended usage scenario for emergency security
1990 * shutdown and hardware failure recovery and should never be used for throttling
1993 * @li Reentrant - yes
1994 * @li ISR Callable - no
1996 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
1997 * guaranteed to restore correct Ethernet Tx/Rx operation.
2001 * @param portId : ID of the port
2003 * @return IxEthAccStatus
2004 * @li @a IX_ETH_ACC_SUCCESS : Tx successfully disabled
2005 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2009 PUBLIC IxEthAccStatus
2010 ixEthAccPortTxDisable(IxEthAccPortId portId);
2015 * @fn IxEthAccStatus ixEthAccPortRxEnable(IxEthAccPortId portId)
2017 * @brief Enable Rx on the port
2019 * This function is the complement of ixEthAccPortRxDisable and should
2020 * be used only after Rx was disabled.
2022 * This function is the recommended usage scenario for emergency security
2023 * shutdown and hardware failure recovery and should never be used for throttling
2026 * @li Reentrant - yes
2027 * @li ISR Callable - no
2029 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
2030 * guaranteed to restore correct Ethernet Tx/Rx operation.
2034 * @param portId : ID of the port
2036 * @return IxEthAccStatus
2037 * @li @a IX_ETH_ACC_SUCCESS : Rx successfully enabled
2038 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2042 PUBLIC IxEthAccStatus
2043 ixEthAccPortRxEnable(IxEthAccPortId portId);
2048 * @fn IxEthAccStatus ixEthAccPortRxDisable(IxEthAccPortId portId)
2050 * @brief Disable Rx on the port
2052 * This function can be used to disable Rx in the MAC core.
2053 * Rx can be re-enabled, although this is not guaranteed, by performing
2054 * a MAC core reset (@a ixEthAccPortMacReset) and calling ixEthAccPortRxEnable.
2055 * Note that using this function is not recommended, except for shutting
2056 * down Rx for emergency reasons. For proper port shutdown and re-enabling
2057 * see ixEthAccPortEnable and ixEthAccPortDisable.
2059 * This function is the recommended usage scenario for emergency security
2060 * shutdown and hardware failure recovery and should never be used for throttling
2063 * @li Reentrant - yes
2064 * @li ISR Callable - no
2068 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
2069 * guaranteed to restore correct Ethernet Tx/Rx operation.
2071 * @param portId : ID of the port
2073 * @return IxEthAccStatus
2074 * @li @a IX_ETH_ACC_SUCCESS : Rx successfully disabled
2075 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2079 PUBLIC IxEthAccStatus
2080 ixEthAccPortRxDisable(IxEthAccPortId portId);
2085 * @fn IxEthAccStatus ixEthAccPortMacReset(IxEthAccPortId portId)
2087 * @brief Reset MAC core on the port
2089 * This function will perform a MAC core reset (NPE Ethernet coprocessor).
2090 * This function is inherently unsafe and the NPE recovery is not guaranteed
2091 * after this function is called. The proper manner of performing port disable
2092 * and enable (which will reset the MAC as well) is ixEthAccPortEnable/ixEthAccPortDisable.
2094 * This function is the recommended usage scenario for hardware failure recovery
2095 * and should never be used for throttling traffic.
2097 * @li Reentrant - yes
2098 * @li ISR Callable - no
2102 * @note Calling ixEthAccPortDisable followed by ixEthAccPortEnable is
2103 * guaranteed to restore correct Ethernet Tx/Rx operation.
2105 * @param portId : ID of the port
2107 * @return IxEthAccStatus
2108 * @li @a IX_ETH_ACC_SUCCESS : MAC core reset
2109 * @li @a IX_ETH_ACC_FAIL : Invalid port or Ethernet service not initialized
2113 PUBLIC IxEthAccStatus
2114 ixEthAccPortMacReset(IxEthAccPortId portId);
2116 /*********************************************************************************
2117 #### ##### ## ##### # #### ##### # #### ####
2118 # # # # # # # # # # # #
2119 #### # # # # # #### # # # ####
2120 # # ###### # # # # # # #
2121 # # # # # # # # # # # # # # #
2122 #### # # # # # #### # # #### ####
2123 **********************************************************************************/
2128 * @brief This struct defines the statistics returned by this component.
2130 * The component returns MIB2 EthObj variables which are obtained from the
2131 * hardware or maintained by this component.
2137 UINT32 dot3StatsAlignmentErrors; /**< link error count (rx) */
2138 UINT32 dot3StatsFCSErrors; /**< link error count (rx) */
2139 UINT32 dot3StatsInternalMacReceiveErrors; /**< link error count (rx) */
2140 UINT32 RxOverrunDiscards; /**< NPE: discarded frames count (rx) */
2141 UINT32 RxLearnedEntryDiscards; /**< NPE: discarded frames count(rx) */
2142 UINT32 RxLargeFramesDiscards; /**< NPE: discarded frames count(rx) */
2143 UINT32 RxSTPBlockedDiscards; /**< NPE: discarded frames count(rx) */
2144 UINT32 RxVLANTypeFilterDiscards; /**< NPE: discarded frames count (rx) */
2145 UINT32 RxVLANIdFilterDiscards; /**< NPE: discarded frames count (rx) */
2146 UINT32 RxInvalidSourceDiscards; /**< NPE: discarded frames count (rx) */
2147 UINT32 RxBlackListDiscards; /**< NPE: discarded frames count (rx) */
2148 UINT32 RxWhiteListDiscards; /**< NPE: discarded frames count (rx) */
2149 UINT32 RxUnderflowEntryDiscards; /**< NPE: discarded frames count (rx) */
2150 UINT32 dot3StatsSingleCollisionFrames; /**< link error count (tx) */
2151 UINT32 dot3StatsMultipleCollisionFrames; /**< link error count (tx) */
2152 UINT32 dot3StatsDeferredTransmissions; /**< link error count (tx) */
2153 UINT32 dot3StatsLateCollisions; /**< link error count (tx) */
2154 UINT32 dot3StatsExcessiveCollsions; /**< link error count (tx) */
2155 UINT32 dot3StatsInternalMacTransmitErrors; /**< link error count (tx) */
2156 UINT32 dot3StatsCarrierSenseErrors; /**< link error count (tx) */
2157 UINT32 TxLargeFrameDiscards; /**< NPE: discarded frames count (tx) */
2158 UINT32 TxVLANIdFilterDiscards; /**< NPE: discarded frames count (tx) */
2165 * @fn ixEthAccMibIIStatsGet(IxEthAccPortId portId ,IxEthEthObjStats *retStats )
2167 * @brief Returns the statistics maintained for a port.
2169 * @li Reentrant - yes
2170 * @li ISR Callable - no
2175 * @param portId @ref IxEthAccPortId [in]
2176 * @param retStats @ref IxEthEthObjStats [out]
2177 * @note Please note the user is responsible for cache coheriency of the retStat
2178 * buffer. The data is actually populated via the NPE's. As such cache safe
2179 * memory should be used in the retStats argument.
2181 * @return IxEthAccStatus
2182 * @li @a IX_ETH_ACC_SUCCESS
2183 * @li @a IX_ETH_ACC_FAIL : Invalid arguments.
2184 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2185 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
2189 PUBLIC IxEthAccStatus
2190 ixEthAccMibIIStatsGet(IxEthAccPortId portId, IxEthEthObjStats *retStats );
2195 * @fn ixEthAccMibIIStatsGetClear(IxEthAccPortId portId, IxEthEthObjStats *retStats)
2197 * @brief Returns and clears the statistics maintained for a port.
2199 * @li Reentrant - yes
2200 * @li ISR Callable - yes
2204 * @param portId @ref IxEthAccPortId [in]
2205 * @param retStats @ref IxEthEthObjStats [out]
2206 * @note Please note the user is responsible for cache coheriency of the retStats
2207 * buffer. The data is actually populated via the NPE's. As such cache safe
2208 * memory should be used in the retStats argument.
2210 * @return IxEthAccStatus
2211 * @li @a IX_ETH_ACC_SUCCESS
2212 * @li @a IX_ETH_ACC_FAIL : invalid arguments.
2213 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2214 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
2218 PUBLIC IxEthAccStatus
2219 ixEthAccMibIIStatsGetClear(IxEthAccPortId portId, IxEthEthObjStats *retStats);
2224 * @fn ixEthAccMibIIStatsClear(IxEthAccPortId portId)
2226 * @brief Clears the statistics maintained for a port.
2228 * @li Reentrant - yes
2229 * @li ISR Callable - no
2233 * @param portId @ref IxEthAccPortId [in]
2235 * @return IxEthAccStatus
2236 * @li @a IX_ETH_ACC_SUCCESS
2237 * @li @a IX_ETH_ACC_FAIL : Invalid arguments.
2238 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2239 * @li @a IX_ETH_ACC_PORT_UNINITIALIZED : portId is un-initialized
2243 PUBLIC IxEthAccStatus ixEthAccMibIIStatsClear(IxEthAccPortId portId);
2248 * @fn ixEthAccMacInit(IxEthAccPortId portId)
2250 * @brief Initializes the ethernet MAC settings
2252 * @li Reentrant - no
2253 * @li ISR Callable - no
2255 * @param portId @ref IxEthAccPortId [in]
2257 * @return IxEthAccStatus
2258 * @li @a IX_ETH_ACC_SUCCESS
2259 * @li @a IX_ETH_ACC_INVALID_PORT : portId is invalid.
2263 PUBLIC IxEthAccStatus ixEthAccMacInit(IxEthAccPortId portId);
2268 * @fn ixEthAccStatsShow(IxEthAccPortId portId)
2271 * @brief Displays a ports statistics on the standard io console using printf.
2273 * @li Reentrant - no
2274 * @li ISR Callable - no
2278 * @param portId @ref IxEthAccPortId [in]
2284 PUBLIC void ixEthAccStatsShow(IxEthAccPortId portId);
2286 /*************************************************************************
2288 # # # # # # ##### # ####
2289 ## ## # # ## ## # # # # #
2290 # ## # # # # ## # # # # # #
2291 # # # # # # # # # # #
2292 # # # # # # # # # # #
2293 # # # # # # ##### # ####
2295 *************************************************************************/
2301 * @fn ixEthAccMiiReadRtn (UINT8 phyAddr,
2306 * @brief Reads a 16 bit value from a PHY
2308 * Reads a 16-bit word from a register of a MII-compliant PHY. Reading
2309 * is performed through the MII management interface. This function returns
2310 * when the read operation has successfully completed, or when a timeout has elapsed.
2312 * @li Reentrant - no
2313 * @li ISR Callable - no
2315 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
2317 * @param phyAddr UINT8 [in] - the address of the Ethernet PHY (0-31)
2318 * @param phyReg UINT8 [in] - the number of the MII register to read (0-31)
2319 * @param value UINT16 [in] - the value read from the register
2321 * @return IxEthAccStatus
2322 * @li @a IX_ETH_ACC_SUCCESS
2323 * @li @a IX_ETH_ACC_FAIL : failed to read the register.
2327 PUBLIC IxEthAccStatus
2328 ixEthAccMiiReadRtn (UINT8 phyAddr, UINT8 phyReg, UINT16 *value);
2333 * @fn ixEthAccMiiWriteRtn (UINT8 phyAddr,
2338 * @brief Writes a 16 bit value to a PHY
2340 * Writes a 16-bit word from a register of a MII-compliant PHY. Writing
2341 * is performed through the MII management interface. This function returns
2342 * when the write operation has successfully completed, or when a timeout has elapsed.
2344 * @li Reentrant - no
2345 * @li ISR Callable - no
2347 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
2349 * @param phyAddr UINT8 [in] - the address of the Ethernet PHY (0-31)
2350 * @param phyReg UINT8 [in] - the number of the MII register to write (0-31)
2351 * @param value UINT16 [out] - the value to write to the register
2353 * @return IxEthAccStatus
2354 * @li @a IX_ETH_ACC_SUCCESS
2355 * @li @a IX_ETH_ACC_FAIL : failed to write register.
2359 PUBLIC IxEthAccStatus
2360 ixEthAccMiiWriteRtn (UINT8 phyAddr, UINT8 phyReg, UINT16 value);
2365 * @fn ixEthAccMiiAccessTimeoutSet(UINT32 timeout)
2367 * @brief Overrides the default timeout value and retry count when reading or
2368 * writing MII registers using ixEthAccMiiWriteRtn or ixEthAccMiiReadRtn
2370 * The default behavior of the component is to use a IX_ETH_ACC_MII_10TH_SEC_IN_MILLIS ms
2371 * timeout (declared as 100 in IxEthAccMii_p.h) and a retry count of IX_ETH_ACC_MII_TIMEOUT_10TH_SECS
2372 * (declared as 5 in IxEthAccMii_p.h).
2374 * The MII read and write functions will attempt to read the status of the register up
2375 * to the retry count times, delaying between each attempt with the timeout value.
2377 * @li Reentrant - no
2378 * @li ISR Callable - no
2382 * @param timeout UINT32 [in] - new timeout value, in milliseconds
2383 * @param timeout UINT32 [in] - new retry count (a minimum value of 1 must be used)
2385 * @return IxEthAccStatus
2386 * @li @a IX_ETH_ACC_SUCCESS
2387 * @li @a IX_ETH_ACC_FAIL : invalid parameter(s)
2391 PUBLIC IxEthAccStatus
2392 ixEthAccMiiAccessTimeoutSet(UINT32 timeout, UINT32 retryCount);
2397 * @fn ixEthAccMiiStatsShow (UINT32 phyAddr)
2400 * @brief Displays detailed information on a specified PHY
2402 * Displays the current values of the first eigth MII registers for a PHY,
2404 * @li Reentrant - no
2405 * @li ISR Callable - no
2407 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and
2408 * generating the MDIO clock.
2410 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
2412 * @return IxEthAccStatus
2413 * @li @a IX_ETH_ACC_SUCCESS
2414 * @li @a IX_ETH_ACC_FAIL : invalid arguments.
2418 PUBLIC IxEthAccStatus ixEthAccMiiStatsShow (UINT32 phyAddr);
2422 /******* BOARD SPECIFIC DEPRECATED API *********/
2424 /* The following functions are high level functions which rely
2425 * on the properties and interface of some Ethernet PHYs. The
2426 * implementation is hardware specific and has been moved to
2427 * the hardware-specific component IxEthMii.
2430 #include "IxEthMii.h"
2435 * @def ixEthAccMiiPhyScan
2437 * @brief : deprecated API entry point. This definition
2438 * ensures backward compatibility
2440 * See @ref ixEthMiiPhyScan
2442 * @note this feature is board specific
2445 #define ixEthAccMiiPhyScan(phyPresent) ixEthMiiPhyScan(phyPresent,IXP425_ETH_ACC_MII_MAX_ADDR)
2450 * @def ixEthAccMiiPhyConfig
2452 * @brief : deprecated API entry point. This definition
2453 * ensures backward compatibility
2455 * See @ref ixEthMiiPhyConfig
2457 * @note this feature is board specific
2459 #define ixEthAccMiiPhyConfig(phyAddr,speed100,fullDuplex,autonegotiate) \
2460 ixEthMiiPhyConfig(phyAddr,speed100,fullDuplex,autonegotiate)
2465 * @def ixEthAccMiiPhyReset
2467 * @brief : deprecated API entry point. This definition
2468 * ensures backward compatibility
2470 * See @ref ixEthMiiPhyReset
2472 * @note this feature is board specific
2474 #define ixEthAccMiiPhyReset(phyAddr) \
2475 ixEthMiiPhyReset(phyAddr)
2480 * @def ixEthAccMiiLinkStatus
2482 * @brief : deprecated API entry point. This definition
2483 * ensures backward compatibility
2485 * See @ref ixEthMiiLinkStatus
2487 * @note this feature is board specific
2489 #define ixEthAccMiiLinkStatus(phyAddr,linkUp,speed100,fullDuplex,autoneg) \
2490 ixEthMiiLinkStatus(phyAddr,linkUp,speed100,fullDuplex,autoneg)
2497 * @def ixEthAccMiiShow
2499 * @brief : deprecated API entry point. This definition
2500 * ensures backward compatibility
2502 * See @ref ixEthMiiPhyShow
2504 * @note this feature is board specific
2506 #define ixEthAccMiiShow(phyAddr) \
2507 ixEthMiiPhyShow(phyAddr)
2509 #endif /* ndef IxEthAcc_H */