📄 lan_saa9730.c
字号:
* ------------ * * buffer_index Index for next buffer to be enabled * * Return values : * --------------- * * - * ************************************************************************/staticvoid LAN_SAA9730_enable_buffer( t_LAN_SAA9730_device *pdevice, UINT32 buffer_index ) ;/************************************************************************ * * LAN_SAA9730_allocate_buffers * Description : * ------------- * This routine allocates memory for: * * - Receive buffers * - Transmit buffer * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_allocate_buffers( t_LAN_SAA9730_device *pdevice ) ; /************************************************************************ * * LAN_SAA9730_stop * Description : * ------------- * This routine stops the SAA9730 LAN controller * by stoping DMA transfer and resetting the chip. * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_stop( t_LAN_SAA9730_device *pdevice ) ; /************************************************************************ * * LAN_SAA9730_CAM_init * Description : * ------------- * Initialize the SAA9730 LAN CAM * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_CAM_init( t_LAN_SAA9730_device *pdevice ) ; /************************************************************************ * * LAN_SAA9730_MII_status * Description : * ------------- * Display MII status * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_MII_status( t_LAN_SAA9730_device *pdevice ) ; /************************************************************************ * * LAN_SAA9730_check_MII_opmode * Description : * ------------- * Check MII opmode and align with MAC * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_check_MII_opmode( t_LAN_SAA9730_device *pdevice ) ;/************************************************************************ * * LAN_SAA9730_check_RX_controller_state * Description : * ------------- * Check LAN controllers RX state machine for any lock-up * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_check_RX_controller_state( t_LAN_SAA9730_device *pdevice ) ;/************************************************************************ * * LAN_SAA9730_CAM_load * Description : * ------------- * Load the Ethernet address into SAA9730 CAM registers * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_CAM_load( t_LAN_SAA9730_device *pdevice ) ; /************************************************************************ * * LAN_SAA9730_DMA_init * Description : * ------------- * Setup the SAA9730 DMA registers * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_DMA_init( t_LAN_SAA9730_device *pdevice ) ; /************************************************************************ * * LAN_SAA9730_start * Description : * ------------- * Start the SAA9730 LAN controller operation * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/#ifdef ETH_DEBUGstaticINT32 LAN_SAA9730_start( t_LAN_SAA9730_device *pdevice ) ; #endif/************************************************************************ * * LAN_SAA9730_dump_regs * Description : * ------------- * Dump all SAA9730 LAN controller registers * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/#ifdef ETH_DEBUGstaticINT32 LAN_SAA9730_dump_regs( t_LAN_SAA9730_device *pdevice ) ;#endif/************************************************************************ * * LAN_SAA9730_dump_status * Description : * ------------- * Dump all SAA9730 LAN controller statistics * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticvoid LAN_SAA9730_dump_status( t_LAN_SAA9730_device *pdevice ) ;/************************************************************************ * * LAN_SAA9730_dump_packetstatus * Description : * ------------- * Dump all SAA9730 LAN controller packet status * * * Parameters : * ------------ * * 'pdevice', IN, reference for this device context * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/#ifdef ETH_DEBUGstaticvoid LAN_SAA9730_dump_packetstatus( t_LAN_SAA9730_device *pdevice ) ;#endif/************************************************************************ * Static function prototypes, device driver IO functions ************************************************************************//************************************************************************ * * LAN_SAA9730_init * Description : * ------------- * This service initializes the lan driver and configures * the MAC-address for the 'EN0' LAN interface. * The MAC-address is read during 'init' via the 'syscon' parameter: * -'SYSCON_COM_EN0_MAC_ADDR_ID'. * * * Parameters : * ------------ * * 'major', IN, major device number * 'minor', IN, not used * 'p_param', INOUT, not used * * * Return values : * --------------- * * 'OK'(=0) * * * ************************************************************************/staticINT32 LAN_SAA9730_init( UINT32 major, /* IN: major device number */ UINT32 minor, /* IN: minor device number */ void *p_param ) ; /* INOUT: device parameter block *//************************************************************************ * * LAN_SAA9730_open * Description : * ------------- * This service registers a mac-layer defined receive-handler in the * LAN-drivers ISR-context to allow for interrupt controlled receive * frame processing in the network stack. No external buffer * administration is required as the protocol-layers are responsible for * handling buffer-allocation and data copy-ing to the allocated buffer * payload area. At return from 'receive' handler, the LAN-drivers * local RX-buffer (packet) is released for re-use. After 'open' * has been called, the LAN-driver's 'read' service will call the * registered receive-handler by any frame reception with direct * reference to the LAN-drivers packet space and no read data will be * delivered in the IO-descriptor. * * * * Parameters : * ------------ * * 'major', IN, major device number * 'minor', IN, not used * 'p_param', IN, LAN variable of type, t_LAN_IO_desc. * * * Return values : * --------------- *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -