VxWorks Reference Manual : Libraries
ultraEnd - SMC Ultra Elite END network interface driver
ultraLoad( ) - initialize the driver and device
ultraParse( ) - parse the init string
ultraMemInit( ) - initialize memory for the chip
ultraAddrFilterSet( ) - set the address filter for multicast addresses
This module implements the SMC Elite Ultra Ethernt network interface driver.
This driver supports single transmission and multiple reception. The Current register is a write pointer to the ring. The Bound register is a read pointer from the ring. This driver gets the Current register at the interrupt level and sets the Bound register at the task level. The interrupt is only masked during configuration or in polled mode.
The W1 jumper should be set in the position of "Software Configuration". The defined I/O address in config.h must match the one stored in EEROM. The RAM address, the RAM size, and the IRQ level are defined in config.h. IRQ levels 2,3,5,7,10,11,15 are supported.
This driver requires several external support functions, defined as macros:
SYS_INT_CONNECT(pDrvCtrl, routine, arg) SYS_INT_DISCONNECT (pDrvCtrl, routine, arg) SYS_INT_ENABLE(pDrvCtrl) SYS_INT_DISABLE(pDrvCtrl) SYS_IN_BYTE(pDrvCtrl, reg, pData) SYS_OUT_BYTE(pDrvCtrl, reg, pData)These macros allow the driver to be customized for BSPs that use special versions of these routines.The macro SYS_INT_CONNECT is used to connect the interrupt handler to the appropriate vector. By default it is the routine intConnect( ).
The macro SYS_INT_DISCONNECT is used to disconnect the interrupt handler prior to unloading the module. By default this is a dummy routine that returns OK.
The macro SYS_INT_ENABLE is used to enable the interrupt level for the end device. It is called once during initialization. It calls an external board level routine sysUltraIntEnable( ).
The macro SYS_INT_DISABLE is used to disable the interrupt level for the end device. It is called once during shutdown. It calls an external board level routine sysUltraIntDisable( ).
The macros SYS_IN_BYTE and SYS_OUT_BYTE are used for accessing the ultra device. The default macros map these operations onto sysInByte( ) and sysOutByte( ).
end.h endLib.h etherMultiLib.h
ultraEnd, muxLib, endLib Writing an Enhanced Network Driver
ultraLoad( ) - initialize the driver and device
END_OBJ* ultraLoad ( char * initString /* String to be parsed by the driver. */ )
This routine initializes the driver and the device to the operational state. All of the device-specific parameters are passed in initString, which expects a string of the following format:
unit:ioAddr:memAddr:vecNum:intLvl:config:offset"
This routine can be called in two modes. If it is called with an empty but allocated string, it places the name of this device (that is, "ultra") into the initString and returns 0.
If the string is allocated and not empty, the routine attempts to load the driver using the values specified in the string.
An END object pointer, or NULL on error, or 0 and the name of the device if the initString was NULL.
ultraParse( ) - parse the init string
STATUS ultraParse ( ULTRA_DEVICE * pDrvCtrl, /* device pointer */ char * initString /* information string */ )
Parse the input string. Fill in values in the driver control structure. The initialization string format is: unit:ioAddr:memAddr:vecNum:intLvl:config:offset"
- unit
- Device unit number, a small integer.
- ioAddr
- I/O address
- memAddr
- Memory address, assumed to be 16k bytes in length.
- vecNum
- Interrupt vector number (used with sysIntConnect( )).
- intLvl
- Interrupt level.
- config
- Ultra config (0: RJ45 + AUI(Thick) 1: RJ45 + BNC(Thin)).
- offset
- Memory offset for alignment.
OK, or ERROR if any arguments are invalid.
ultraMemInit( ) - initialize memory for the chip
STATUS ultraMemInit ( ULTRA_DEVICE * pDrvCtrl, /* device to be initialized */ int clNum /* number of clusters to allocate */ )
Using data in the control structure, setup and initialize the memory areas needed. If the memory address is not already specified, then allocate cache safe memory.
OK or ERROR.
ultraAddrFilterSet( ) - set the address filter for multicast addresses
void ultraAddrFilterSet ( ULTRA_DEVICE * pDrvCtrl /* device pointer */ )
This routine goes through all of the multicast addresses on the list of addresses (added with the ultraMCastAdd( ) routine) and sets the device's filter correctly.
N/A.