/**
 * cpsw_ethdriver.h
 *
 *
 * Copyright (c) 2012 Texas Instruments Incorporated ALL RIGHTS RESERVED
 *
*/
#ifndef CPSW_ETHDRIVER_H_
#define CPSW_ETHDRIVER_H_

#include "cpsw_nimu_eth.h"

/**
 * @ingroup cpsw_link_change_notification_t
 *
 * The @ref cpsw_link_change_notification_t routine prototype is used for the registraton
 * of a callback routine called
 * by the the ethernet driver on a link change of an ethernet port.
 *
 * @param link_status corresponding to the MDIO Link Status Values definition in cpsw_middio.h
 * -->
 *    MDIO Link Status Values
 *
 *    These values indicate current PHY link status.
 *    Codes are constructed as follows
 *    Bit0: 0  for HD, 1 for FullDuplex
 *    Bit[2:1]: 10Mbps- 1, 100Mbps - 2, 1000Mbps - 3
 *
 *    #define MDIO_LINKSTATUS_NOLINK    0u
 *    #define MDIO_LINKSTATUS_HD10      2u
 *    #define MDIO_LINKSTATUS_FD10      3u
 *    #define MDIO_LINKSTATUS_HD100     4u
 *    #define MDIO_LINKSTATUS_FD100     5u
 *    #define MDIO_LINKSTATUS_FD1000    7u
 * @param port Port number - Port1 = 0, Port2 = 1
 *
 *-----------------------------------------------------------------------*/
typedef void (*cpsw_link_change_notification_t)(UInt32 link_status, UInt32 port);
typedef Uint8 (*cpsw_callback_ret_t)(void* arg, void* arg2);

void cpsw_register_link_change_notification(cpsw_link_change_notification_t routine);
void cpsw_register_tx_exception_callback(cpsw_callback_ret_t callBack);

/*
 * Functions Provided by Hw specific code
 */
uint CpswHwPktInit();
void CpswHwPktShutdown();
uint CpswHwPktOpen( CPSW_PDINFO *pi );
void CpswHwPktClose( CPSW_PDINFO *pi );
void CpswHwPktSetRx( CPSW_PDINFO *pi );
void CpswHwPktTxNext( CPSW_PDINFO *pi );
void Cpsw_HwPktPoll( CPSW_PDINFO *pi, uint fTimerTick );
Uint32 CpswHwPktIoctl(CPSW_PDINFO *pi, uint cmd, void* param, uint size);

#endif /* CPSW_ETHDRIVER_H_ */
