Nut/OS  5.0.5
API Reference
Realtek RTL8019AS

10 MBit NE2000 compatible controller. More...

Collaboration diagram for Realtek RTL8019AS:

Data Structures

struct  nic_pkt_header

Modules

 Device eth0
 

Realtek 8019AS Ethernet device.


Defines

#define NICINB(reg)   (*((volatile uint8_t *)RTL_BASE_ADDR + reg))
#define NICOUTB(reg, val)   (*((volatile uint8_t *)RTL_BASE_ADDR + reg) = val)

Functions

void NicRx (void *arg)
 NIC receiver thread.
int NicOutput (NUTDEVICE *dev, NETBUF *nb)
 Send Ethernet packet.
int NicInit (NUTDEVICE *dev)
 Initialize Ethernet hardware.

Detailed Description

10 MBit NE2000 compatible controller.

The RTL8019AS chip is used on the Ethernut 1 board.


Define Documentation

#define NICINB (   reg)    (*((volatile uint8_t *)RTL_BASE_ADDR + reg))
#define NICOUTB (   reg,
  val 
)    (*((volatile uint8_t *)RTL_BASE_ADDR + reg) = val)

Function Documentation

NicRx ( void *  arg)

NIC receiver thread.

It runs with high priority.

References cbi, _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, ifnet::if_mac, ifnet::if_recv, NICINFO::ni_rx_packets, NICINFO::ni_rx_rdy, NutEventWait(), NutSleep(), NutThreadSetPriority(), RTL_SIGNAL_IRQ, and sbi.

Referenced by NicInit().

Here is the call graph for this function:

int NicOutput ( 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 NicInit ( NUTDEVICE dev)

Initialize Ethernet hardware.

Resets RTL8019AS 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(). Note, that base address and interrupt number passed to NutRegisterDevice() are silently ignored by this driver for performance reasons. These values can be changed only by using the Nut/OS Configurator to rebuild the system.

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 cbi, _CONFNET::cd_size, _CONFNET::cdn_mac, confnet, _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, _NUTDEVICE::dev_name, ifnet::if_mac, memcpy(), memset(), NicRx(), NUT_THREAD_NICRXSTACK, NUT_THREAD_STACK_ADD, NUT_THREAD_STACK_MULT, NutNetLoadConfig(), NutRegisterIrqHandler(), NutSleep(), NutThreadCreate(), RTL_RISING_EDGE_MODE, RTL_SIGNAL, RTL_SIGNAL_IRQ, sbi, and WAIT500.

Here is the call graph for this function: