/**
*   @file    Eth_Ipw.c
*   @version 1.0.0
*
*   @brief   AUTOSAR Eth driver implementation
*   @details Implementation of the AUTOSAR Ethernet driver
*
*   @addtogroup ETH_DRIVER
*   @{
*/
/*==================================================================================================
*   Project              : AUTOSAR 4.3 MCAL
*   Platform             : PA
*   Peripheral           : FEC
*   Dependencies         : 
*
*   Autosar Version      : 4.3.1
*   Autosar Revision     : ASR_REL_4_3_REV_0001
*   Autosar Conf.Variant :
*   SW Version           : 1.0.0
*   Build Version        : MPC5777C_MCAL_1_0_0_RTM_ASR_REL_4_3_REV_0001_20190315
*
*   (c) Copyright 2006-2016 Freescale Semiconductor, Inc. 
*       Copyright 2017-2019 NXP
*   All Rights Reserved.
==================================================================================================*/
/*==================================================================================================
==================================================================================================*/

#ifdef __cplusplus
extern "C"{
#endif

/**
* @page misra_violations MISRA-C:2012 violations
* 
* @section Eth_Ipw_c_REF_1
* Violates MISRA 2012 Required Directive 4.10, Precautions shall be taken in order to prevent the contents
* of a header file being included more than once. This comes from the order of includes in the .c file
* and from include dependencies. As a safe approach, any file must include all its dependencies.
* Header files are already protected against double inclusions. The inclusion of Eth_Memmap.h is as
* per AUTOSAR requirement (SWS_MemMap_00003)
*
* @section [global]
*          Violates MISRA 2012 Required Rule 5.1, External identifiers shall be distinct.
*          The used compilers use more than 31 chars for identifiers.
*
* @section [global]
*          Violates MISRA 2012 Required Rule 5.2, Identifiers declared in the same scope and name space shall be distinct.
*          The used compilers use more than 31 chars for identifiers.
*
* @section [global]
*          Violates MISRA 2012 Required Rule 5.4, Macro identifiers shall be distinct.
*          The used compilers use more than 31 chars for identifiers.
*
* @section [global]
*          Violates MISRA 2012 Required Rule 5.5, Identifiers shall be distinct from macro names.
*          The used compilers use more than 31 chars for identifiers.
*
* @section Eth_Ipw_c_REF_2
* Violates MISRA 2012 Advisory Rule 20.1, #include directives should only be preceded by preprocessor 
* directives or comments. AUTOSAR imposes the specification of the sections in which certain parts
* of the driver must be placed.
*
* @section Eth_Ipw_c_REF_3
* Violates MISRA 2012 Advisory Rule 8.7,  Functions and objects should not be defined with external 
* linkage if they are referenced in only one translation unit.
*
*/


/*==================================================================================================
*                                        INCLUDE FILES
* 1) system and project includes
* 2) needed interfaces from external units
* 3) internal and external interfaces from this unit
==================================================================================================*/
#include "Eth.h" /* Includes also Eth_GeneralTypes.h, Eth_Cfg.h,
                    Eth_ComStack_Types.h, Dem.h, Det.h and Mcal.h */
#include "SchM_Eth.h" /* RTE module header for critical sections protection */
#include "EthIf_Cbk.h" /* EthIf callbacks to be called from Eth driver */
#include "Eth_Fec.h" /* Lower layer header */
#include "Eth_Ipw.h" /* Own header */
#include "Eth_Fec_Reg_Sys.h"
#if defined (ETH_MII_MODE_SEL)
#if STD_ON == ETH_MII_MODE_SEL
    #include "Eth_SIU.h"
#endif
#endif
/*==================================================================================================
*                              SOURCE FILE VERSION INFORMATION
==================================================================================================*/
#define ETH_VENDOR_ID_C                      43
#define ETH_MODULE_ID_C                      88
#define ETH_AR_RELEASE_MAJOR_VERSION_C       4
#define ETH_AR_RELEASE_MINOR_VERSION_C       3
#define ETH_AR_RELEASE_REVISION_VERSION_C    1
#define ETH_SW_MAJOR_VERSION_C               1
#define ETH_SW_MINOR_VERSION_C               0
#define ETH_SW_PATCH_VERSION_C               0

/*==================================================================================================
*                                     FILE VERSION CHECKS
==================================================================================================*/
/* Check if current file and ETH header file are of the same vendor */
#if (ETH_VENDOR_ID_C != ETH_VENDOR_ID)
    #error "Eth_Ipw.c and Eth_Ipw.h have different vendor ids"
#endif
/* Check if current file and ETH header file are of the same Autosar version */
#if ((ETH_AR_RELEASE_MAJOR_VERSION_C    != ETH_AR_RELEASE_MAJOR_VERSION) || \
     (ETH_AR_RELEASE_MINOR_VERSION_C    != ETH_AR_RELEASE_MINOR_VERSION) || \
     (ETH_AR_RELEASE_REVISION_VERSION_C != ETH_AR_RELEASE_REVISION_VERSION))
    #error "AutoSar Version Numbers of Eth_Ipw.c and Eth.h are different"
#endif
/* Check if current file and ETH header file are of the same Software version */
#if ((ETH_SW_MAJOR_VERSION_C != ETH_SW_MAJOR_VERSION) || \
     (ETH_SW_MINOR_VERSION_C != ETH_SW_MINOR_VERSION) || \
     (ETH_SW_PATCH_VERSION_C != ETH_SW_PATCH_VERSION))
    #error "Software Version Numbers of Eth_Ipw.c and Eth.h are different"
#endif
/* Check if current file and Eth_FEC_LLD header file are of the same Autosar version */
#if((ETH_AR_RELEASE_MAJOR_VERSION_C     != ETH_AR_RELEASE_MAJOR_VERSION_FEC) || \
     (ETH_AR_RELEASE_MINOR_VERSION_C    != ETH_AR_RELEASE_MINOR_VERSION_FEC) || \
     (ETH_AR_RELEASE_REVISION_VERSION_C != ETH_AR_RELEASE_REVISION_VERSION_FEC))
    #error "AutoSar Version Numbers of Eth_Ipw.c and Eth_Fec.h are different"
#endif
/* Check if current file and Eth_FEC_LLD header file are of the same Software version */
#if((ETH_SW_MAJOR_VERSION_C  != ETH_SW_MAJOR_VERSION_FEC) || \
     (ETH_SW_MINOR_VERSION_C != ETH_SW_MINOR_VERSION_FEC) || \
     (ETH_SW_PATCH_VERSION_C != ETH_SW_PATCH_VERSION_FEC))
    #error "Software Version Numbers of Eth_Ipw.c and Eth_Fec.h are different"
#endif
/* Check if current file and Eth_Fec_Reg_Sys header file are of the same vendor */
#if (ETH_VENDOR_ID_C != ETH_VENDOR_ID_REG_SYS_H)
    #error "Eth_Ipw.c and Eth_Fec_Reg_Sys.h have different vendor ids"
#endif
/* Check if current file and Eth_Fec_Reg_Sys header file are of the same module */
#if (ETH_MODULE_ID_C != ETH_MODULE_ID_REG_SYS_H)
    #error "Eth_Ipw.c and Eth_Fec_Reg_Sys.h have different vendor ids"
#endif
/* Check if current file and Eth_Fec_Reg_Sys header file are of the same Autosar version */
#if ((ETH_AR_RELEASE_MAJOR_VERSION_C    != ETH_AR_RELEASE_MAJOR_VERSION_REG_SYS_H) || \
     (ETH_AR_RELEASE_MINOR_VERSION_C    != ETH_AR_RELEASE_MINOR_VERSION_REG_SYS_H) || \
     (ETH_AR_RELEASE_REVISION_VERSION_C != ETH_AR_RELEASE_REVISION_VERSION_REG_SYS_H))
    #error "AutoSar Version Numbers of Eth_Ipw.c and Eth_Fec_Reg_Sys.h are different"
#endif
/* Check if current file and Eth_Fec_Reg_Sys header file are of the same Software version */
#if ((ETH_SW_MAJOR_VERSION_C != ETH_SW_MAJOR_VERSION_REG_SYS_H) || \
     (ETH_SW_MINOR_VERSION_C != ETH_SW_MINOR_VERSION_REG_SYS_H) || \
     (ETH_SW_PATCH_VERSION_C != ETH_SW_PATCH_VERSION_REG_SYS_H))
    #error "Software Version Numbers of Eth_Ipw.c and Eth_Fec_Reg_Sys.h are different"
#endif
/* Check if current file and Eth_Fec_LLD header file are of the same Autosar version */
#if ((ETH_AR_RELEASE_MAJOR_VERSION_C    != ETH_AR_RELEASE_MAJOR_VERSION_FEC) || \
     (ETH_AR_RELEASE_MINOR_VERSION_C    != ETH_AR_RELEASE_MINOR_VERSION_FEC) || \
     (ETH_AR_RELEASE_REVISION_VERSION_C != ETH_AR_RELEASE_REVISION_VERSION_FEC) \
    )
    #error "AutoSar Version Numbers of Eth_Ipw.c and Eth_Fec.h are different"
#endif
/* Check if current file and Eth_Fec_LLD header file are of the same Software version */
#if( (ETH_SW_MAJOR_VERSION_C != ETH_SW_MAJOR_VERSION_FEC) || \
     (ETH_SW_MINOR_VERSION_C != ETH_SW_MINOR_VERSION_FEC) || \
     (ETH_SW_PATCH_VERSION_C != ETH_SW_PATCH_VERSION_FEC)    \
   )
    #error "Software Version Numbers of Eth_Ipw.c and Eth_SIU.h are different"
#endif
#if defined (ETH_MII_MODE_SEL)
#if STD_ON == ETH_MII_MODE_SEL
/* Check if current file and Eth_Fec_LLD header file are of the same Autosar version */
#if ((ETH_AR_RELEASE_MAJOR_VERSION_C    != ETH_SIU_AR_RELEASE_MAJOR_VERSION_H) || \
     (ETH_AR_RELEASE_MINOR_VERSION_C    != ETH_SIU_AR_RELEASE_MINOR_VERSION_H) || \
     (ETH_AR_RELEASE_REVISION_VERSION_C != ETH_SIU_AR_RELEASE_REVISION_VERSION_H) \
    )
    #error "AutoSar Version Numbers of Eth_Ipw.c and Eth_SIU.h are different"
#endif
/* Check if current file and Eth_Fec_LLD header file are of the same Software version */
#if( (ETH_SW_MAJOR_VERSION_C != ETH_SIU_SW_MAJOR_VERSION_H) || \
     (ETH_SW_MINOR_VERSION_C != ETH_SIU_SW_MINOR_VERSION_H) || \
     (ETH_SW_PATCH_VERSION_C != ETH_SIU_SW_PATCH_VERSION_H)    \
   )
    #error "Software Version Numbers of Eth_Ipw.c and Eth_SIU.h are different"
#endif
#endif 
#endif
/*==================================================================================================
*                          LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)
==================================================================================================*/


/*==================================================================================================
*                                       LOCAL MACROS
==================================================================================================*/
/*==================================================================================================
*                                      LOCAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                      LOCAL VARIABLES
==================================================================================================*/


/*==================================================================================================
*                                      GLOBAL CONSTANTS
==================================================================================================*/


/*==================================================================================================
*                                      GLOBAL VARIABLES
==================================================================================================*/


/*==================================================================================================
*                                   LOCAL FUNCTION PROTOTYPES
==================================================================================================*/


/*==================================================================================================
*                                       LOCAL FUNCTIONS
==================================================================================================*/
#define ETH_START_SEC_CODE
/* @violates @ref Eth_Ipw_c_REF_1 This violation is not fixed since the inclusion of Eth_MemMap.h is as per AUTOSAR requirement*/
#include "Eth_MemMap.h"

/*==================================================================================================
*                                       GLOBAL FUNCTIONS
==================================================================================================*/

/*================================================================================================*/
/**
* @brief         Reports received frames to the upper layer
* @param[in]     u8CtrlIdx Index of the controller to report receptions
* @param[in]     bIrq Selects between the poll driven and interrupt driven
*                mode (algorithm). The value TRUE means interrupt driven mode.
* @return        In the poll driven mode signalizes whether a frame has been
*                reported to the EthIf module and whether another frame is
*                available. It shall be ignored in the interrupt driven mode.
* @retval        ETH_RECEIVED Only one frame received
* @retval        ETH_NOT_RECEIVED No frame received
* @retval        ETH_RECEIVED_MORE_DATA_AVAILABLE More frames received
*                frame was discarded.
* @implements    Eth_Ipw_ReportReception_Activity
*/
FUNC(Eth_RxStatusType, ETH_CODE) Eth_Ipw_ReportReception ( \
                                                CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                                                CONST(uint8, AUTOMATIC) u8FifoIdx, \
                                                CONST(boolean, AUTOMATIC) bIrq \
                                                         )
{
    return(Eth_Fec_ReportReception(u8CtrlIdx, u8FifoIdx, bIrq));
}
/*================================================================================================*/
/**
* @brief         Confirms transmission of all transmitted buffers
* @param[in]     u8CtrlIdx Index of the controller to report transmissions
* @details       Function examines all transmit buffers whether some of them
*                have been already sent and whether they should be confirmed.
*                EthIf_TxConfirmation is called for each such buffer.
* @return        Error report
* @retval        TRUE No error has occurred.
* @retval        FALSE Some error has occurred.
* @implements    Eth_Ipw_ReportTransmission_Activity
*/

FUNC(void, ETH_CODE) Eth_Ipw_ReportTransmission(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    Eth_Fec_ReportTransmission(u8CtrlIdx, u8FifoIdx);
}

/*================================================================================================*/
/**
*//*!
* @brief         Safely disables the controller
* @param[in]     u8CtrlIdx Index of the controller to disable
* @details       Function disables the Ethernet controller and clears all
*                buffers to ensure safe start in the future i.e. no buffer is
*                retransmitted and all received frames are discarded - nothing
*                is received after the controller is disabled.
* @warning       Transmission which is in progress is terminated and frame
*                being transmitted is appended by bad CRC when the
*                Eth_Ipw_DisableController function is called.
*/

FUNC(void, ETH_CODE) Eth_Ipw_DisableController(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    /* Disable the controller */
    Eth_Fec_DisableController(u8CtrlIdx);
}
/*================================================================================================*/
/**
* @brief         Find Queue Index coressponding with DMA Channel
* @param[in]     u8CtrlIdx Index of controller in which TxIRQ flag will be checked
* @param[in]     u8DMAChannel DMA Channel
* @retval        Index of queue
*/
FUNC(uint8, ETH_CODE) Eth_Ipw_FindQueueIdx(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8DMAChannel)
{
    (void)u8DMAChannel;
    (void)u8CtrlIdx;
    return 0U;
}
#if (STD_OFF == ETH_TXFIFO_SINGLE_MODE)
/*================================================================================================*/
/**
* @brief         Find Fifo idx from index of buffer
* @param[in]     u8CtrlIdx Index of controller in which TxIRQ flag will be checked
* @param[in]     u8BufIdx buffer index
* @retval        Index of Fifo
*/
FUNC(uint8, ETH_CODE) Eth_Ipw_FindFifoIdx(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(Eth_BufIdxType, AUTOMATIC) BufIdx)
{
    return Eth_Fec_FindFifoIdx (u8CtrlIdx, BufIdx);
}
#endif
FUNC(void, ETH_CODE) Eth_Ipw_ResetController(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    Eth_Fec_ResetController(u8CtrlIdx);
}

FUNC(boolean, ETH_CODE) Eth_Ipw_CheckAccessToController(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    return Eth_Fec_CheckAccessToCtrl(u8CtrlIdx);
}

FUNC(void, ETH_CODE) Eth_Ipw_ConfigureController(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
#if defined (ETH_MII_MODE_SEL)
#if STD_ON == ETH_MII_MODE_SEL
    Eth_SIU_ModeSelect();
#endif
#endif
    Eth_Fec_ConfigureCtrl(u8CtrlIdx);
}
/*================================================================================================*/
/**
* @brief        Get errors and lost frames.
* @details      The function checks for controller errors and lost frames.
*               Used for polling state changes. Calls EthIf_CtrlModeIndication when
*               the controller mode changed.
*/
FUNC(void, ETH_CODE) Eth_Ipw_MainFunction(VAR(void, AUTOMATIC))
{
    Eth_Fec_MainFunction();
}
FUNC(void, ETH_CODE) Eth_Ipw_EnableController(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    Eth_Fec_EnableController(u8CtrlIdx);
}
FUNC(Eth_ModeType, ETH_CODE) Eth_Ipw_CheckControllerIsActive(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    return Eth_Fec_CheckCtrlIsActive(u8CtrlIdx);
}

FUNC(uint32, ETH_CODE) Eth_Ipw_GetPhysicalAddressLow(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    return Eth_Fec_GetPhysAddressLow(u8CtrlIdx);
}

FUNC(uint16, ETH_CODE) Eth_Ipw_GetPhysicalAddressHigh(CONST(uint8, AUTOMATIC) u8CtrlIdx)
{
    return Eth_Fec_GetPhysAddressHigh(u8CtrlIdx);
}

#if STD_ON == ETH_GETCOUNTVALAPI 
/*================================================================================================*/
/**
* @brief         Reads a list with drop counter values of the corresponding controller.
* @param[in]     u8CtrlIdx Index of controller within the context of the Ethernet Driver.
* @param[out]    CounterPtr Counter values according to IETF RFC 1757, RFC 1643 and RFC 2233.
* @details       Reads a list with drop counter values of the corresponding controller.
*                The meaning of these values is described at Eth_CounterType.
*/
FUNC(void, ETH_CODE) Eth_Ipw_GetCounterValues  ( \
                               VAR(uint8, AUTOMATIC) u8CtrlIdx, \
                               P2VAR(Eth_CounterType, AUTOMATIC, ETH_APPL_DATA) CounterPtr \
                                           )
{
   Eth_Fec_GetCounterValues(u8CtrlIdx, CounterPtr);
}
#endif
#if STD_ON == ETH_GET_TXSTATS_API
/*================================================================================================*/
/**
* @brief         Return the list of Transmission Statistics.
* @param[in]     u8CtrlIdx Index of controller within the context of the Ethernet Driver.
* @param[out]     TxStats List of the controller within the context of the Ethernet Driver.
* @details       Return the list of Transmission Sratistics out of IETF RFC1213
*                defined with Eth_TxStatsType, where the maximal possible value shall
*                denote an invalid value.
*                e.g. this counter is not available..
*/
FUNC(void, ETH_CODE) Eth_Ipw_GetTxStats ( \
                       VAR(uint8, AUTOMATIC) u8CtrlIdx, \
                       P2VAR(Eth_TxStatsType, AUTOMATIC, ETH_APPL_DATA) TxStats \
                                               )
{
    Eth_Fec_GetTxStats(u8CtrlIdx, TxStats);
}
#endif
#if STD_ON == ETH_GET_RXSTATS_API
/*================================================================================================*/
/**
* @brief         Return the list of Receive Statistics.
* @param[in]     u8CtrlIdx Index of controller within the context of the Ethernet Driver.
* @param[out]    RxStats List of values according to IETF RFC 2819.
* @details       RxStats List of values according to IETF RFC 2819, where the maximal possible value shall
*                denote an invalid value.
*                e.g. if this counter is not available.
*/
FUNC(void, ETH_CODE) Eth_Ipw_GetRxStats ( \
                       VAR(uint8, AUTOMATIC) u8CtrlIdx, \
                       P2VAR(Eth_RxStatsType, AUTOMATIC, ETH_APPL_DATA) RxStats \
                                               )
{
    Eth_Fec_GetRxStats(u8CtrlIdx, RxStats);
}
#endif
#if STD_ON == ETH_GET_GETTXCOUNT_API
/*================================================================================================*/
/**
* @brief         Return the list of Transmission Statistics.
* @param[in]     u8CtrlIdx Index of controller within the context of the Ethernet Driver.
* @param[out]    Eth_TxErrorCounterValuesType List of values to read statistic error values for transmiision.
* @details       Return the list of Transmission Error Counters out of IETF RFC1213 and RFC1643
*                defined with Eth_TxErrorCounterValuesType, where the maximal possible value shall
*                denote an invalid value.
*                e.g. this counter is not available..
*/
FUNC(void, ETH_CODE) Eth_Ipw_GetTxErrorCounterValues ( \
                       VAR(uint8, AUTOMATIC) u8CtrlIdx, \
                       P2VAR(Eth_TxErrorCounterValuesType, AUTOMATIC, ETH_APPL_DATA) TxErrorCounterValues \
                                               )
{
    Eth_Fec_GetTxErrorCounterValues(u8CtrlIdx, TxErrorCounterValues);
}
#endif
FUNC(boolean, ETH_CODE) Eth_Ipw_SetPhysAddr ( \
                                CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                                P2CONST(uint8, AUTOMATIC, ETH_APPL_CONST) pPhysAddrPtr \
                                            )
{
    return Eth_Fec_SetPhysAddr(u8CtrlIdx, pPhysAddrPtr);
}

#if STD_ON == ETH_UPDATE_PHYS_ADDR_FILTER
FUNC(void, ETH_CODE) Eth_Ipw_UpdatePhysAddrFilter   ( \
                                    CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                                    P2CONST(uint8, AUTOMATIC, ETH_APPL_CONST) pPhysAddrPtr, \
                                    VAR(Eth_FilterActionType, AUTOMATIC) eAction \
                                                  )
{
    Eth_Fec_UpdtePhysAddrFiltr(u8CtrlIdx, pPhysAddrPtr, eAction);
}
#endif
FUNC(boolean, ETH_CODE) Eth_Ipw_ProvideBufferDataArea   ( \
                        CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                        CONST(uint8, AUTOMATIC) u8FifoIdx, \
                        CONSTP2VAR(Eth_BufIdxType, AUTOMATIC, ETH_APPL_DATA) pBufIdx, \
                        P2P2VAR(uint8, AUTOMATIC, ETH_APPL_DATA) pData, \
                        CONSTP2VAR(uint16, AUTOMATIC, ETH_APPL_DATA) pLength \
                                                        )
{
    return Eth_Fec_BorrowTxBuffer(u8CtrlIdx, u8FifoIdx, pBufIdx, pData, pLength);
}

/*================================================================================================*/
/**
* @brief         Triggers the transmission of the given buffer
* @param[in]     u8CtrlIdx Index of controller which will be triggered the transmission
* @param[in]     u8Buf DA Index of the buffer to be transmitted
* @param[in]     u16Type Type or length field value in the 802.3 frame header
* @param[in]     u16Length Payload length
* @param[in]     bConfirm Selects whether the frame transmission shall
*                be confirmed or not
* @param[in]     pDest Frame destination address
*/
FUNC(void, ETH_CODE) Eth_Ipw_Transmit   (
                        CONST(uint8, AUTOMATIC) u8CtrlIdx,
                        CONST(uint8, AUTOMATIC) u8FifoIdx,
                        CONST(Eth_BufIdxType, AUTOMATIC) u16Buf,
                        CONST(Eth_FrameType, AUTOMATIC) u16Type,
                        CONST(uint16, AUTOMATIC) u16Length,
                        CONST(boolean, AUTOMATIC) bConfirm,
                        P2CONST(uint8, AUTOMATIC, ETH_APPL_DATA) pDest
#if STD_ON == ETH_BRIDGE_SUPPORT
                      , P2CONST(uint8, AUTOMATIC, ETH_APPL_DATA) pSource
#endif /* ETH_BRIDGE_SUPPORT  */
                                        )
{
    Eth_Fec_Transmit(u8CtrlIdx, u8FifoIdx, u16Buf, u16Type, u16Length, bConfirm, pDest   
                #if STD_ON == ETH_BRIDGE_SUPPORT
                      , pSource 
                #endif /* ETH_BRIDGE_SUPPORT  */
                    );
    
}

FUNC(boolean, ETH_CODE) Eth_Ipw_IsTxBufLockedBT(CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                                                CONST(uint8, AUTOMATIC) u8FifoIdx, \
                                                CONST(Eth_BufIdxType, AUTOMATIC) u8Buf   \
                                                )
{
    return Eth_Fec_IsTxBufLockedBT(u8CtrlIdx, u8FifoIdx, u8Buf);    
}
   
#if STD_ON == ETH_CTRLENABLE_MII
FUNC(boolean, ETH_CODE) Eth_Ipw_WriteMii    ( \
                        CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                        CONST(uint8, AUTOMATIC) u8Trcv, \
                        CONST(uint8, AUTOMATIC) u8Reg, \
                        CONSTP2VAR(uint16, AUTOMATIC, ETH_APPL_DATA) pData \
                                            )
{
    return Eth_Fec_DoMiiMMF(u8CtrlIdx, u8Trcv, u8Reg, pData, FEC_MMFR_OP_WRITE_U32);    
}

FUNC(boolean, ETH_CODE) Eth_Ipw_ReadMii ( \
                        CONST(uint8, AUTOMATIC) u8CtrlIdx, \
                        CONST(uint8, AUTOMATIC) u8Trcv, \
                        CONST(uint8, AUTOMATIC) u8Reg, \
                        CONSTP2VAR(uint16, AUTOMATIC, ETH_APPL_DATA) pData \
                                        )
{ 
    return Eth_Fec_DoMiiMMF(u8CtrlIdx, u8Trcv, u8Reg, pData, FEC_MMFR_OP_READ_U32);
}
#endif /* ETH_CTRLENABLE_MII */

FUNC(void, ETH_CODE) Eth_Ipw_ClearRxInterruptFlag(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    Eth_Fec_ClearRxIrqFlag(u8CtrlIdx, u8FifoIdx);
}

FUNC(void, ETH_CODE) Eth_Ipw_ClearTxInterruptFlag(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    Eth_Fec_ClearTxIrqFlag(u8CtrlIdx, u8FifoIdx);
}

FUNC(boolean, ETH_CODE) Eth_Ipw_IsTxInterruptFlagSet(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    return Eth_Fec_IsTxIrqFlagSet(u8CtrlIdx, u8FifoIdx);
}

FUNC(boolean, ETH_CODE) Eth_Ipw_IsRxInterruptFlagSet(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    return Eth_Fec_IsRxIrqFlagSet(u8CtrlIdx, u8FifoIdx);
}

FUNC(boolean, ETH_CODE) Eth_Ipw_IsTxInterruptEnabled(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    return Eth_Fec_IsTxIrqEnabled(u8CtrlIdx, u8FifoIdx);
}

FUNC(boolean, ETH_CODE) Eth_Ipw_IsRxInterruptEnabled(CONST(uint8, AUTOMATIC) u8CtrlIdx, CONST(uint8, AUTOMATIC) u8FifoIdx)
{
    return Eth_Fec_IsRxIrqEnabled(u8CtrlIdx, u8FifoIdx);
}


#define ETH_STOP_SEC_CODE
/**
 * @violates @ref Eth_Ipw_c_REF_1 MISRA rule 19.1
 * @violates @ref Eth_Ipw_c_REF_2 MISRA rule 19.15
 */
#include "Eth_MemMap.h"

#ifdef __cplusplus
}
#endif
/** @} */
