Functions | |
void | NicRxLanc (void *arg) |
int | DmOutput (NUTDEVICE *dev, NETBUF *nb) |
Send Ethernet packet. | |
int | DmInit (NUTDEVICE *dev) |
Initialize Ethernet hardware. | |
Variables | |
NUTDEVICE | devDm9000 |
Device information structure. |
void NicRxLanc | ( | void * | arg | ) |
References _BV, _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, ETHER_IS_BROADCAST, ETHER_IS_ZERO, ifnet::if_mac, ifnet::if_recv, IRQ0_ID, _NETBUF::nb_dl, NICINFO::ni_rx_rdy, NIC_RSR, NIC_RSR_MF, NIC_SIGNAL, NIC_SIGNAL_BIT, NIC_SIGNAL_PDR, NIC_SIGNAL_XSR, NUT_IRQMODE_HIGHLEVEL, NUT_PERFMON_ADD, NUT_PERFMON_INC, NutEventPost(), NutEventWait(), NutIrqEnable(), NutIrqSetMode(), NutNetBufFree(), NutSleep(), NutThreadSetPriority(), outr, PMC_PCER, and _NBDATA::sz.
Send Ethernet packet.
dev | Identifies the device to use. |
nb | Network buffer structure containing the packet to be sent. The structure must have been allocated by a previous call NutNetBufAlloc(). |
References _NUTDEVICE::dev_dcb, _NUTDEVICE::dev_icb, _NETBUF::nb_ap, _NETBUF::nb_dl, _NETBUF::nb_nw, _NETBUF::nb_tp, NICINFO::ni_tx_rdy, NUT_PERFMON_ADD, NUT_PERFMON_INC, NutEventPost(), NutEventWait(), rc, and _NBDATA::sz.
int DmInit | ( | NUTDEVICE * | dev | ) |
Initialize Ethernet hardware.
Resets the LAN91C111 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.
dev | Identifies the device to initialize. |
References _NUTDEVICE::dev_dcb, memset(), NIC_ISR, NIC_ISR_IOM, NIC_ISR_M32, NIC_PID, NIC_SIGNAL, NIC_VID, NicRxLanc(), NULL, NUT_THREAD_NICRXSTACK, NUT_THREAD_STACK_ADD, NUT_THREAD_STACK_MULT, NutRegisterIrqHandler(), NutRegisterPhy(), and NutThreadCreate().
{ 0, {'e', 't', 'h', '0', 0, 0, 0, 0, 0}, IFTYP_NET, 0, 0, &ifn_eth0, &dcb_eth0, DmInit, DmIOCtl, 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.