Nut/OS  5.0.5
API Reference
Asix AX88796L

10/100 MBit NE2000 compatible controller. More...

Collaboration diagram for Asix AX88796L:

Data Structures

struct  nic_pkt_header

Functions

void Delay16Cycles (void)
uint16_t NicPhyRead (uint8_t reg)
 Read contents of internel PHY register on 0x10 adress.
void NicPhyWrite (uint8_t reg, uint16_t val)
 Write value to PHY register.
void NicRxAsix (void *arg)
 NIC receiver thread.
void NicInterruptEntry (void)
int AsixOutput (NUTDEVICE *dev, NETBUF *nb)
 Send Ethernet packet.
int AsixInit (NUTDEVICE *dev)
 Initialize Ethernet hardware.

Variables

NUTDEVICE devAx88796
 Device information structure.

Detailed Description

10/100 MBit NE2000 compatible controller.

Highly experimental.


Function Documentation

void Delay16Cycles ( void  )

References _NOP.

uint16_t NicPhyRead ( uint8_t  reg)

Read contents of internel PHY register on 0x10 adress.

Returns:
Contents of the specified register.

References Asix_Read, Asix_Write, CR, CR_PS0, and rc.

void NicPhyWrite ( uint8_t  reg,
uint16_t  val 
)

Write value to PHY register.

Note:
NIC interrupts must have been disabled before calling this routine.
Parameters:
regPHY register number.
valValue to write.

References Asix_Read, Asix_Write, CR, and CR_PS0.

void NicRxAsix ( void *  arg)

NIC receiver thread.

References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, devAx88796, ETHER_IS_UNICAST, ifnet::if_mac, ifnet::if_recv, NICINFO::ni_rx_packets, NICINFO::ni_rx_rdy, NutEnterCritical, NutEventWait(), NutExitCritical, NutSleep(), and NutThreadSetPriority().

Referenced by AsixInit().

Here is the call graph for this function:

void NicInterruptEntry ( void  )

References IRQ_ENTRY, and IRQ_EXIT.

Referenced by AsixInit().

int AsixOutput ( NUTDEVICE dev,
NETBUF nb 
)

Send Ethernet packet.

Parameters:
devIdentifies the device to use.
nbNetwork buffer structure containing the packet to be sent. The structure must have been allocated by a previous call NutNetBufAlloc().
Returns:
0 on success, -1 in case of any errors.

References _NUTDEVICE::dev_dcb, NICINFO::ni_tx_packets, and rc.

int AsixInit ( NUTDEVICE dev)

Initialize Ethernet hardware.

Resets the Asix Asix_L Ethernet controller, initializes all required hardware registers and starts a background thread for incoming Ethernet traffic.

Applications should do not directly call this function. It is automatically executed during during device registration by NutRegisterDevice().

If the network configuration hasn't been set by the application before registering the specified device, this function will call NutNetLoadConfig() to get the MAC address.

Parameters:
devIdentifies the device to initialize.

References _BV, AIC_ICCR, AIC_IDCR, AIC_IECR, AIC_SMR, AIC_SRCTYPE_EXT_NEGATIVE_EDGE, AIC_SVR, _CONFNET::cd_name, _CONFNET::cd_size, _CONFNET::cdn_mac, confnet, _NUTDEVICE::dev_dcb, IRQ0_ID, memset(), NicInterruptEntry(), NicRxAsix(), NutThreadCreate(), outr, and strcpy().

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
    0,                          
    {'e', 't', 'h', '0', 0, 0, 0, 0, 0},        
    IFTYP_NET,                  
    0,                          
    0,                          
    &ifn_eth0,                  
    &dcb_eth0,                  
    AsixInit,                   
    0,                          
    0,                          
    0,                          
    0,                          
    0,                          
    0                           
}

Device information structure.

A pointer to this structure must be passed to NutRegisterDevice() to bind this Ethernet device driver to the Nut/OS kernel. An application may then call NutNetIfConfig() with the name eth0 of this driver to initialize the network interface.

Referenced by NicRxAsix().