Specifications

You need not edit the NicheStack TCP/IP Stack source code to implement a NicheStack-compatible
driver. Nevertheless, Altera provides the source code for your reference. The files are installed with the
Nios II EDS in the <iniche path> directory. The Ethernet device driver interface is defined in <iniche
path>/inc/alt_iniche_dev.h.
Related Information
NicheStack Technical Reference Manual
For more information about the NicheStack TCP/IP Stack implementation, refer to the NicheStack
Technical Reference Manual, available on the Nios II Processor Documentation website.
NicheStackRef.zip
For access to the NicheStackRef.zip file.
Provide the NicheStack Hardware Interface Routines
The NicheStack TCP/IP Stack architecture requires several network hardware interface routines:
Initialize hardware
Send packet
Receive packet
Close
Dump statistics
For more information about these routines, refer to "Porting Engineer Provided Functions" in the
NicheStack Technical Reference Manual.
The NicheStack TCP/IP Stack system code uses the
Table 7-3: SMSC LAN91C111 Hardware Interface Routines
Prototype Function LAN91C111 Function File Notes
n_init() s91_init() smsc91x.c The initialization routine can
install an ISR if applicable
pkt_send() s91_pkt_send() smsc91x.c
Packet receive mechanism
s91_isr() smsc91x.c Packet receive includes three
key actions:
pk_alloc()—Allocate a
netbuf structure
putq()—Place netbuf
structure on rcvdq
SignalPktDemux()
Notify the Internet
protocol (IP) layer that it
can demux the packet
s91_rcv() smsc91x.c
s91_dma_rx_done() smsc_mem.c
n_close() s91_close() smsc91x.c
n_stats() s91_stats() smsc91x.c
NII5V2
2015.05.14
Provide the NicheStack Hardware Interface Routines
7-13
Developing Device Drivers for the Hardware Abstraction Layer
Altera Corporation
Send Feedback