Specifications

The prepare() function must be defined. If the ioctl field is set to null, calls to
alt_dma_rxchan_ioctl() return -ENOTTY for this device.
After creating an instance of the alt_dma_rxchan structure, you must register the device driver with the
HAL system to make it available by calling the following function:
int alt_dma_rxchan_reg (alt_dma_rxchan_dev* dev)
The input argument dev is the device to register. The return value is zero on success, or negative if the
device cannot be registered.
Table 7-2: Fields in the alt_dma_rxchan Structure
Field Function
llist This function is for internal use and must always be set to the value
ALT_LLIST_ENTRY.
name The name that refers to this channel in calls to alt_dma_rxchan_
open(). name is the name of the device as defined in system.h.
depth The total number of receive requests that can be outstanding at any
given time.
prepa
re
A pointer to a function that is called as a result of a call to the
application API function alt_dma_rxchan_prepare(). This function
posts a receive request to the DMA device. The parameters passed to
alt_dma_rxchan_prepare() are passed directly to prepare(). For a
description of parameters and return values, refer to the "HAL API
Reference" chapter of the Nios II Software Developer’s Handbook.
ioctl This is a function that provides device specific I/O control. Refer to
sys/alt_dma_dev.h for a list of the generic options that a device might
wish to support.
Related Information
HAL API Reference on page 14-1
Ethernet Device Drivers
The HAL generic device model for Ethernet devices provides access to the NicheStack
®
TCP/IP Stack -
Nios II Edition running on the MicroC/OS-II operating system. You can provide support for a new
Ethernet device by supplying the driver functions that this section defines.
Before you consider writing a device driver for a new Ethernet device, you need a basic understanding of
the Altera implementation of the NicheStack TCP/IP Stack and its usages.
NII5V2
2015.05.14
Ethernet Device Drivers
7-11
Developing Device Drivers for the Hardware Abstraction Layer
Altera Corporation
Send Feedback