1 /* Copyright (c) 2008-2011 Freescale Semiconductor, Inc.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 * * Redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer.
8 * * Redistributions in binary form must reproduce the above copyright
9 * notice, this list of conditions and the following disclaimer in the
10 * documentation and/or other materials provided with the distribution.
11 * * Neither the name of Freescale Semiconductor nor the
12 * names of its contributors may be used to endorse or promote products
13 * derived from this software without specific prior written permission.
16 * ALTERNATIVELY, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL") as published by the Free Software
18 * Foundation, either version 2 of that License or (at your option) any
21 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 /**************************************************************************//**
36 @Description FM MAC ...
37 *//***************************************************************************/
38 #ifndef __FM_MAC_EXT_H
39 #define __FM_MAC_EXT_H
45 /**************************************************************************//**
47 @Group FM_grp Frame Manager API
49 @Description FM API functions, definitions and enums
52 *//***************************************************************************/
54 /**************************************************************************//**
55 @Group FM_mac_grp FM MAC
57 @Description FM MAC API functions, definitions and enums
60 *//***************************************************************************/
63 /**************************************************************************//**
64 @Description FM MAC Exceptions
65 *//***************************************************************************/
66 typedef enum e_FmMacExceptions {
67 e_FM_MAC_EX_10G_MDIO_SCAN_EVENTMDIO = 0
68 ,e_FM_MAC_EX_10G_MDIO_CMD_CMPL
69 ,e_FM_MAC_EX_10G_REM_FAULT
70 ,e_FM_MAC_EX_10G_LOC_FAULT
71 ,e_FM_MAC_EX_10G_1TX_ECC_ER
72 ,e_FM_MAC_EX_10G_TX_FIFO_UNFL
73 ,e_FM_MAC_EX_10G_TX_FIFO_OVFL
74 ,e_FM_MAC_EX_10G_TX_ER
75 ,e_FM_MAC_EX_10G_RX_FIFO_OVFL
76 ,e_FM_MAC_EX_10G_RX_ECC_ER
77 ,e_FM_MAC_EX_10G_RX_JAB_FRM
78 ,e_FM_MAC_EX_10G_RX_OVRSZ_FRM
79 ,e_FM_MAC_EX_10G_RX_RUNT_FRM
80 ,e_FM_MAC_EX_10G_RX_FRAG_FRM
81 ,e_FM_MAC_EX_10G_RX_LEN_ER
82 ,e_FM_MAC_EX_10G_RX_CRC_ER
83 ,e_FM_MAC_EX_10G_RX_ALIGN_ER
84 ,e_FM_MAC_EX_1G_BAB_RX
85 ,e_FM_MAC_EX_1G_RX_CTL
86 ,e_FM_MAC_EX_1G_GRATEFUL_TX_STP_COMPLET
87 ,e_FM_MAC_EX_1G_BAB_TX
88 ,e_FM_MAC_EX_1G_TX_CTL
89 ,e_FM_MAC_EX_1G_TX_ERR
90 ,e_FM_MAC_EX_1G_LATE_COL
91 ,e_FM_MAC_EX_1G_COL_RET_LMT
92 ,e_FM_MAC_EX_1G_TX_FIFO_UNDRN
93 ,e_FM_MAC_EX_1G_MAG_PCKT
94 ,e_FM_MAC_EX_1G_MII_MNG_RD_COMPLET
95 ,e_FM_MAC_EX_1G_MII_MNG_WR_COMPLET
96 ,e_FM_MAC_EX_1G_GRATEFUL_RX_STP_COMPLET
97 ,e_FM_MAC_EX_1G_TX_DATA_ERR
98 ,e_FM_MAC_EX_1G_RX_DATA_ERR
99 ,e_FM_MAC_EX_1G_1588_TS_RX_ERR
100 ,e_FM_MAC_EX_1G_RX_MIB_CNT_OVFL
103 /**************************************************************************//**
104 @Description TM MAC statistics level
105 *//***************************************************************************/
106 typedef enum e_FmMacStatisticsLevel {
107 e_FM_MAC_NONE_STATISTICS = 0, /**< No statistics */
108 e_FM_MAC_PARTIAL_STATISTICS, /**< Only error counters are available. Optimized for performance */
109 e_FM_MAC_FULL_STATISTICS /**< All counters available. Not optimized for performance */
110 } e_FmMacStatisticsLevel;
113 /**************************************************************************//**
114 @Function t_FmMacExceptionCallback
116 @Description Fm Mac Exception Callback from FM MAC to the user
118 @Param[in] h_App - Handle to the upper layer handler
120 @Param[in] exceptions - The exception that occurred
124 *//***************************************************************************/
125 typedef void (t_FmMacExceptionCallback)(t_Handle h_App, e_FmMacExceptions exceptions);
128 /**************************************************************************//**
129 @Description TM MAC statistics rfc3635
130 *//***************************************************************************/
131 typedef struct t_FmMacStatistics {
133 uint64_t eStatPkts64; /**< r-10G tr-DT 64 byte frame counter */
134 uint64_t eStatPkts65to127; /**< r-10G 65 to 127 byte frame counter */
135 uint64_t eStatPkts128to255; /**< r-10G 128 to 255 byte frame counter */
136 uint64_t eStatPkts256to511; /**< r-10G 256 to 511 byte frame counter */
137 uint64_t eStatPkts512to1023; /**< r-10G 512 to 1023 byte frame counter */
138 uint64_t eStatPkts1024to1518; /**< r-10G 1024 to 1518 byte frame counter */
139 uint64_t eStatPkts1519to1522; /**< r-10G 1519 to 1522 byte good frame count */
141 uint64_t eStatFragments; /**< Total number of packets that were less than 64 octets long with a wrong CRC.*/
142 uint64_t eStatJabbers; /**< Total number of packets longer than valid maximum length octets */
143 uint64_t eStatsDropEvents; /**< number of dropped packets due to internal errors of the MAC Client. */
144 uint64_t eStatCRCAlignErrors; /**< Incremented when frames of correct length but with CRC error are received.*/
145 uint64_t eStatUndersizePkts; /**< Total number of packets that were less than 64 octets long with a good CRC.*/
146 uint64_t eStatOversizePkts; /**< T,B.D*/
148 uint64_t teStatPause; /**< Pause MAC Control received */
149 uint64_t reStatPause; /**< Pause MAC Control sent */
152 uint64_t ifInOctets; /**< Total number of byte received. */
153 uint64_t ifInPkts; /**< Total number of packets received.*/
154 uint64_t ifInMcastPkts; /**< Total number of multicast frame received*/
155 uint64_t ifInBcastPkts; /**< Total number of broadcast frame received */
156 uint64_t ifInDiscards; /**< Frames received, but discarded due to problems within the MAC RX. */
157 uint64_t ifInErrors; /**< Number of frames received with error:
158 - FIFO Overflow Error
160 - Frame Too Long Error
162 - The dedicated Error Code (0xfe, not a code error) was received */
163 uint64_t ifOutOctets; /**< Total number of byte sent. */
164 uint64_t ifOutPkts; /**< Total number of packets sent .*/
165 uint64_t ifOutMcastPkts; /**< Total number of multicast frame sent */
166 uint64_t ifOutBcastPkts; /**< Total number of multicast frame sent */
167 uint64_t ifOutDiscards; /**< Frames received, but discarded due to problems within the MAC TX N/A!.*/
168 uint64_t ifOutErrors; /**< Number of frames transmitted with error:
169 - FIFO Overflow Error
170 - FIFO Underflow Error
175 /**************************************************************************//**
176 @Group FM_mac_init_grp Initialization Unit
178 @Description FM MAC Initialization Unit
181 *//***************************************************************************/
183 /**************************************************************************//**
184 @Description FM MAC config input
185 *//***************************************************************************/
186 typedef struct t_FmMacParams {
187 uintptr_t baseAddr; /**< Base of memory mapped FM MAC registers */
188 t_EnetAddr addr; /**< MAC address of device; First octet is sent first */
189 uint8_t macId; /**< MAC ID <dTSEC 0-3> <10G 0> */
190 e_EnetMode enetMode; /**< Ethernet operation mode (MAC-PHY interface and speed) */
191 t_Handle h_Fm; /**< A handle to the FM object this port related to */
192 int mdioIrq; /**< MDIO exceptions interrupt source - not valid for all
193 MACs; MUST be set to 'NO_IRQ' for MACs that don't have
194 mdio-irq, or for polling */
195 t_FmMacExceptionCallback *f_Event; /**< MDIO Events Callback Routine */
196 t_FmMacExceptionCallback *f_Exception; /**< Exception Callback Routine */
197 t_Handle h_App; /**< A handle to an application layer object; This handle will
198 be passed by the driver upon calling the above callbacks */
202 /**************************************************************************//**
203 @Function FM_MAC_Config
205 @Description Creates descriptor for the FM MAC module.
207 The routine returns a handle (descriptor) to the FM MAC object.
208 This descriptor must be passed as first parameter to all other
209 FM MAC function calls.
211 No actual initialization or configuration of FM MAC hardware is
212 done by this routine.
214 @Param[in] p_FmMacParam - Pointer to data structure of parameters
216 @Retval Handle to FM MAC object, or NULL for Failure.
217 *//***************************************************************************/
218 t_Handle FM_MAC_Config (t_FmMacParams *p_FmMacParam);
220 /**************************************************************************//**
221 @Function FM_MAC_Init
223 @Description Initializes the FM MAC module
225 @Param[in] h_FmMac - FM module descriptor
227 @Return E_OK on success; Error code otherwise.
228 *//***************************************************************************/
229 t_Error FM_MAC_Init (t_Handle h_FmMac);
231 /**************************************************************************//**
234 @Description Frees all resources that were assigned to FM MAC module.
236 Calling this routine invalidates the descriptor.
238 @Param[in] h_FmMac - FM module descriptor
240 @Return E_OK on success; Error code otherwise.
241 *//***************************************************************************/
242 t_Error FM_MAC_Free (t_Handle h_FmMac);
245 /**************************************************************************//**
246 @Group FM_mac_advanced_init_grp Advanced Configuration Unit
248 @Description Configuration functions used to change default values.
251 *//***************************************************************************/
253 /**************************************************************************//**
254 @Function FM_MAC_ConfigResetOnInit
256 @Description Tell the driver whether to reset the FM MAC before initialization or
257 not. It changes the default configuration [FALSE].
259 @Param[in] h_FmMac A handle to a FM MAC Module.
260 @Param[in] enable When TRUE, FM will be reset before any initialization.
262 @Return E_OK on success; Error code otherwise.
264 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
265 *//***************************************************************************/
266 t_Error FM_MAC_ConfigResetOnInit (t_Handle h_FmMac, bool enable);
268 /**************************************************************************//**
269 @Function FM_MAC_ConfigLoopback
271 @Description Enable/Disable internal loopback mode
273 @Param[in] h_FmMac A handle to a FM MAC Module.
274 @Param[in] enable TRUE to enable or FALSE to disable.
276 @Return E_OK on success; Error code otherwise.
278 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
279 *//***************************************************************************/
280 t_Error FM_MAC_ConfigLoopback (t_Handle h_FmMac, bool enable);
282 /**************************************************************************//**
283 @Function FM_MAC_ConfigMaxFrameLength
285 @Description Setup maximum Frame Length
287 @Param[in] h_FmMac A handle to a FM MAC Module.
288 @Param[in] newVal MAX Frame length
290 @Return E_OK on success; Error code otherwise.
292 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
293 *//***************************************************************************/
294 t_Error FM_MAC_ConfigMaxFrameLength (t_Handle h_FmMac, uint16_t newVal);
296 /**************************************************************************//**
297 @Function FM_MAC_ConfigWan
299 @Description ENABLE WAN mode in 10G MAC
301 @Param[in] h_FmMac A handle to a FM MAC Module.
302 @Param[in] enable TRUE to enable or FALSE to disable.
304 @Return E_OK on success; Error code otherwise.
306 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
307 *//***************************************************************************/
308 t_Error FM_MAC_ConfigWan (t_Handle h_FmMac, bool enable);
310 /**************************************************************************//**
311 @Function FM_MAC_ConfigPadAndCrc
313 @Description Config PAD and CRC mode
315 @Param[in] h_FmMac A handle to a FM MAC Module.
316 @Param[in] enable TRUE to enable or FALSE to disable.
318 @Return E_OK on success; Error code otherwise.
320 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
321 *//***************************************************************************/
322 t_Error FM_MAC_ConfigPadAndCrc (t_Handle h_FmMac, bool enable);
324 /**************************************************************************//**
325 @Function FM_MAC_ConfigHalfDuplex
327 @Description Config Half Duplex Mode
329 @Param[in] h_FmMac A handle to a FM MAC Module.
330 @Param[in] enable TRUE to enable or FALSE to disable.
332 @Return E_OK on success; Error code otherwise.
334 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
335 *//***************************************************************************/
336 t_Error FM_MAC_ConfigHalfDuplex (t_Handle h_FmMac, bool enable);
338 /**************************************************************************//**
339 @Function FM_MAC_ConfigLengthCheck
341 @Description Configure thef frame length checking.
343 @Param[in] h_FmMac A handle to a FM MAC Module.
344 @Param[in] enable TRUE to enable or FALSE to disable.
346 @Return E_OK on success; Error code otherwise.
348 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
349 *//***************************************************************************/
350 t_Error FM_MAC_ConfigLengthCheck (t_Handle h_FmMac, bool enable);
352 /**************************************************************************//**
353 @Function FM_MAC_ConfigException
355 @Description Change Exception selection from default
357 @Param[in] h_FmMac A handle to a FM MAC Module.
358 @Param[in] ex Type of the desired exceptions
359 @Param[in] enable TRUE to enable the specified exception, FALSE to disable it.
362 @Return E_OK on success; Error code otherwise.
364 @Cautions Allowed only following FM_MAC_Config() and before FM_MAC_Init().
365 *//***************************************************************************/
366 t_Error FM_MAC_ConfigException(t_Handle h_FmMac, e_FmMacExceptions ex, bool enable);
368 #ifdef FM_TX_ECC_FRMS_ERRATA_10GMAC_A004
369 t_Error FM_MAC_ConfigSkipFman11Workaround (t_Handle h_FmMac);
370 #endif /* FM_TX_ECC_FRMS_ERRATA_10GMAC_A004 */
371 /** @} */ /* end of FM_mac_advanced_init_grp group */
372 /** @} */ /* end of FM_mac_init_grp group */
375 /**************************************************************************//**
376 @Group FM_mac_runtime_control_grp Runtime Control Unit
378 @Description FM MAC Runtime control unit API functions, definitions and enums.
381 *//***************************************************************************/
383 /**************************************************************************//**
384 @Function FM_MAC_Enable
386 @Description Enable the MAC
388 @Param[in] h_FmMac A handle to a FM MAC Module.
389 @Param[in] mode Mode of operation (RX, TX, Both)
391 @Return E_OK on success; Error code otherwise.
393 @Cautions Allowed only following FM_MAC_Init().
394 *//***************************************************************************/
395 t_Error FM_MAC_Enable (t_Handle h_FmMac, e_CommMode mode);
397 /**************************************************************************//**
398 @Function FM_MAC_Disable
400 @Description DISABLE the MAC
402 @Param[in] h_FmMac A handle to a FM MAC Module.
403 @Param[in] mode Define what part to Disable (RX, TX or BOTH)
405 @Return E_OK on success; Error code otherwise.
407 @Cautions Allowed only following FM_MAC_Init().
408 *//***************************************************************************/
409 t_Error FM_MAC_Disable (t_Handle h_FmMac, e_CommMode mode);
411 /**************************************************************************//**
412 @Function FM_MAC_Enable1588TimeStamp
414 @Description Enables the TSU operation.
416 @Param[in] h_Fm - Handle to the PTP as returned from the FM_MAC_PtpConfig.
418 @Return E_OK on success; Error code otherwise.
420 @Cautions Allowed only following FM_MAC_Init().
421 *//***************************************************************************/
422 t_Error FM_MAC_Enable1588TimeStamp(t_Handle h_Fm);
424 /**************************************************************************//**
425 @Function FM_MAC_Disable1588TimeStamp
427 @Description Disables the TSU operation.
429 @Param[in] h_Fm - Handle to the PTP as returned from the FM_MAC_PtpConfig.
431 @Return E_OK on success; Error code otherwise.
433 @Cautions Allowed only following FM_MAC_Init().
434 *//***************************************************************************/
435 t_Error FM_MAC_Disable1588TimeStamp(t_Handle h_Fm);
437 /**************************************************************************//**
438 @Function FM_MAC_SetTxAutoPauseFrames
440 @Description Enable/Disable transmition of Pause-Frames.
442 @Param[in] h_FmMac A handle to a FM MAC Module.
443 @Param[in] pauseTime Pause quanta value used with transmitted pause frames.
444 Each quanta represents a 512 bit-times; Note that '0'
445 as an input here will be used as disabling the
446 transmission of the pause-frames.
448 @Return E_OK on success; Error code otherwise.
450 @Cautions Allowed only following FM_MAC_Init().
451 *//***************************************************************************/
452 t_Error FM_MAC_SetTxAutoPauseFrames (t_Handle h_FmMac, uint16_t pauseTime);
454 /**************************************************************************//**
455 @Function FM_MAC_SetRxIgnorePauseFrames
457 @Description Enable/Disable ignoring of Pause-Frames.
459 @Param[in] h_FmMac A handle to a FM MAC Module.
460 @Param[in] en boolean indicates whether to ignore the incoming pause
463 @Return E_OK on success; Error code otherwise.
465 @Cautions Allowed only following FM_MAC_Init().
466 *//***************************************************************************/
467 t_Error FM_MAC_SetRxIgnorePauseFrames (t_Handle h_FmMac, bool en);
469 /**************************************************************************//**
470 @Function FM_MAC_ResetCounters
472 @Description reset all statistics counters
474 @Param[in] h_FmMac A handle to a FM MAC Module.
476 @Return E_OK on success; Error code otherwise.
478 @Cautions Allowed only following FM_MAC_Init().
479 *//***************************************************************************/
480 t_Error FM_MAC_ResetCounters (t_Handle h_FmMac);
482 /**************************************************************************//**
483 @Function FM_MAC_SetException
485 @Description Enable/Disable a specific Exception
487 @Param[in] h_FmMac A handle to a FM MAC Module.
488 @Param[in] ex Type of the desired exceptions
489 @Param[in] enable TRUE to enable the specified exception, FALSE to disable it.
492 @Return E_OK on success; Error code otherwise.
494 @Cautions Allowed only following FM_MAC_Init().
495 *//***************************************************************************/
496 t_Error FM_MAC_SetException(t_Handle h_FmMac, e_FmMacExceptions ex, bool enable);
498 /**************************************************************************//**
499 @Function FM_MAC_SetStatistics
501 @Description Define Statistics level.
502 Where applicable, the routine also enables the MIB counters
503 overflow interrupt in order to keep counters accurate
504 and account for overflows.
506 @Param[in] h_FmMac A handle to a FM MAC Module.
507 @Param[in] statisticsLevel Full statistics level provides all standard counters but may
508 reduce performance. Partial statistics provides only special
509 event counters (errors etc.). If selected, regular counters (such as
510 byte/packet) will be invalid and will return -1.
512 @Return E_OK on success; Error code otherwise.
514 @Cautions Allowed only following FM_MAC_Init().
515 *//***************************************************************************/
516 t_Error FM_MAC_SetStatistics (t_Handle h_FmMac, e_FmMacStatisticsLevel statisticsLevel);
518 /**************************************************************************//**
519 @Function FM_MAC_GetStatistics
521 @Description get all statistics counters
523 @Param[in] h_FmMac A handle to a FM MAC Module.
524 @Param[in] p_Statistics Staructure with statistics
526 @Return E_OK on success; Error code otherwise.
528 @Cautions Allowed only following FM_Init().
529 *//***************************************************************************/
530 t_Error FM_MAC_GetStatistics (t_Handle h_FmMac, t_FmMacStatistics *p_Statistics);
532 /**************************************************************************//**
533 @Function FM_MAC_ModifyMacAddr
535 @Description Replace the main MAC Address
537 @Param[in] h_FmMac - A handle to a FM Module.
538 @Param[in] p_EnetAddr - Ethernet Mac address
540 @Return E_OK on success; Error code otherwise.
542 @Cautions Allowed only after FM_MAC_Init().
543 *//***************************************************************************/
544 t_Error FM_MAC_ModifyMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
546 /**************************************************************************//**
547 @Function FM_MAC_AddHashMacAddr
549 @Description Add an Address to the hash table. This is for filter purpose only.
551 @Param[in] h_FmMac - A handle to a FM Module.
552 @Param[in] p_EnetAddr - Ethernet Mac address
554 @Return E_OK on success; Error code otherwise.
556 @Cautions Allowed only following FM_MAC_Init(). It is a filter only address.
557 @Cautions Some address need to be filterd out in upper FM blocks.
558 *//***************************************************************************/
559 t_Error FM_MAC_AddHashMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
561 /**************************************************************************//**
562 @Function FM_MAC_RemoveHashMacAddr
564 @Description Delete an Address to the hash table. This is for filter purpose only.
566 @Param[in] h_FmMac - A handle to a FM Module.
567 @Param[in] p_EnetAddr - Ethernet Mac address
569 @Return E_OK on success; Error code otherwise.
571 @Cautions Allowed only following FM_MAC_Init().
572 *//***************************************************************************/
573 t_Error FM_MAC_RemoveHashMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
575 /**************************************************************************//**
576 @Function FM_MAC_AddExactMatchMacAddr
578 @Description Add a unicast or multicast mac address for exact-match filtering
579 (8 on dTSEC, 2 for 10G-MAC)
581 @Param[in] h_FmMac - A handle to a FM Module.
582 @Param[in] p_EnetAddr - MAC Address to ADD
584 @Return E_OK on success; Error code otherwise.
586 @Cautions Allowed only after FM_MAC_Init().
587 *//***************************************************************************/
588 t_Error FM_MAC_AddExactMatchMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
590 /**************************************************************************//**
591 @Function FM_MAC_RemovelExactMatchMacAddr
593 @Description Remove a uni cast or multi cast mac address.
595 @Param[in] h_FmMac - A handle to a FM Module.
596 @Param[in] p_EnetAddr - MAC Address to remove
598 @Return E_OK on success; Error code otherwise..
600 @Cautions Allowed only after FM_MAC_Init().
601 *//***************************************************************************/
602 t_Error FM_MAC_RemovelExactMatchMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr);
604 /**************************************************************************//**
605 @Function FM_MAC_SetPromiscuous
607 @Description Enable/Disable MAC Promiscuous mode for ALL mac addresses.
609 @Param[in] h_FmMac - A handle to a FM MAC Module.
610 @Param[in] enable - TRUE to enable or FALSE to disable.
612 @Return E_OK on success; Error code otherwise.
614 @Cautions Allowed only after FM_MAC_Init().
615 *//***************************************************************************/
616 t_Error FM_MAC_SetPromiscuous (t_Handle h_FmMac, bool enable);
618 /**************************************************************************//**
619 @Function FM_MAC_AdjustLink
621 @Description Adjusts the Ethernet link with new speed/duplex setup.
623 @Param[in] h_FmMac - A handle to a FM Module.
624 @Param[in] speed - Ethernet speed.
625 @Param[in] fullDuplex - TRUE for Full-Duplex mode;
626 FALSE for Half-Duplex mode.
628 @Return E_OK on success; Error code otherwise.
629 *//***************************************************************************/
630 t_Error FM_MAC_AdjustLink(t_Handle h_FmMac, e_EnetSpeed speed, bool fullDuplex);
632 /**************************************************************************//**
633 @Function FM_MAC_GetId
635 @Description Return the MAC ID
637 @Param[in] h_FmMac - A handle to a FM Module.
638 @Param[out] p_MacId - MAC ID of device
640 @Return E_OK on success; Error code otherwise.
642 @Cautions Allowed only after FM_MAC_Init().
643 *//***************************************************************************/
644 t_Error FM_MAC_GetId (t_Handle h_FmMac, uint32_t *p_MacId);
646 /**************************************************************************//**
647 @Function FM_MAC_GetVesrion
649 @Description Return Mac HW chip version
651 @Param[in] h_FmMac - A handle to a FM Module.
652 @Param[out] p_MacVresion - Mac version as defined by the chip
654 @Return E_OK on success; Error code otherwise.
656 @Cautions Allowed only after FM_MAC_Init().
657 *//***************************************************************************/
658 t_Error FM_MAC_GetVesrion (t_Handle h_FmMac, uint32_t *p_MacVresion);
660 /**************************************************************************//**
661 @Function FM_MAC_MII_WritePhyReg
663 @Description Write data into Phy Register
665 @Param[in] h_FmMac - A handle to a FM Module.
666 @Param[in] phyAddr - Phy Address on the MII bus
667 @Param[in] reg - Register Number.
668 @Param[in] data - Data to write.
670 @Return E_OK on success; Error code otherwise.
672 @Cautions Allowed only after FM_MAC_Init().
673 *//***************************************************************************/
674 t_Error FM_MAC_MII_WritePhyReg (t_Handle h_FmMac, uint8_t phyAddr, uint8_t reg, uint16_t data);
676 /**************************************************************************//**
677 @Function FM_MAC_MII_ReadPhyReg
679 @Description Read data from Phy Register
681 @Param[in] h_FmMac - A handle to a FM Module.
682 @Param[in] phyAddr - Phy Address on the MII bus
683 @Param[in] reg - Register Number.
684 @Param[out] p_Data - Data from PHY.
686 @Return E_OK on success; Error code otherwise.
688 @Cautions Allowed only after FM_MAC_Init().
689 *//***************************************************************************/
690 t_Error FM_MAC_MII_ReadPhyReg(t_Handle h_FmMac, uint8_t phyAddr, uint8_t reg, uint16_t *p_Data);
692 #if (defined(DEBUG_ERRORS) && (DEBUG_ERRORS > 0))
693 /**************************************************************************//**
694 @Function FM_MAC_DumpRegs
696 @Description Dump internal registers
698 @Param[in] h_FmMac - A handle to a FM Module.
700 @Return E_OK on success; Error code otherwise.
702 @Cautions Allowed only after FM_MAC_Init().
703 *//***************************************************************************/
704 t_Error FM_MAC_DumpRegs(t_Handle h_FmMac);
705 #endif /* (defined(DEBUG_ERRORS) && ... */
707 /** @} */ /* end of FM_mac_runtime_control_grp group */
708 /** @} */ /* end of FM_mac_grp group */
709 /** @} */ /* end of FM_grp group */
713 #endif /* __FM_MAC_EXT_H */