VxWorks Reference Manual : Libraries

sn83932End

NAME

sn83932End - Nat. Semi DP83932B SONIC Ethernet driver

ROUTINES

sn83932EndLoad( ) - initialize the driver and device

DESCRIPTION

This module implements the National Semiconductor DP83932 SONIC Ethernet network interface driver.

This driver is designed to be moderately generic. Thus, it operates unmodified across the range of architectures and targets supported by VxWorks. To achieve this, the driver load routine requires several target-specific parameters. The driver also depends on a few external support routines. These parameters and support routines are described below. If any of the assumptions stated below are not true for your particular hardware, this driver probably cannot function correctly with that hardware. This driver supports up to four individual units per CPU.

BOARD LAYOUT

This device is on-board. No jumpering diagram is necessary.

EXTERNAL INTERFACE

This driver provides the END external interface. Thus, the only normal external interface is the sn83932EndLoad( ) routine, although snEndClkEnable( ) and snEndClkDisable( ) are provided for the use (optional) of the internal clock. All required parameters are passed into the load function by means of a single colon-delimited string. The sn83932Load( ) function uses strtok( ) to parse the string, which it expects to be of the following format:

    unit_ID:devIO_addr:ivec:e_addr

The entry point for sn83932EndLoad( ) is defined within the endDevTbl in configNet.h.

TARGET-SPECIFIC PARAMETERS

unit_ID
A convenient holdover from the former model, this is only used in the string name for the driver.

devIO_addr
Denotes the base address of the device's I/O register set.

ivec
Denotes the interrupt vector to be used by the driver to service an interrupt from the SONIC device. The driver connects the interrupt handler to this vector by calling intConnect( ).

e_addr
This parameter is obtained by calling sysEnetAddrGet( ), an external support routine. It specifies the unique six-byte address assigned to the VxWorks target on the Ethernet.

EXTERNAL SUPPORT REQUIREMENTS

This driver requires the following external support routines:

sysEnetInit( )
    void sysEnetInit (int unit)
This routine performs any target-specific operations that must be executed before the SONIC device is initialized. The driver calls this routine, once per unit, during the unit start-up phase.

sysEnetAddrGet( )
    STATUS sysEnetAddrGet (int unit, char *pCopy)
This routine provides the six-byte Ethernet address used by unit. It must copy the six-byte address to the space provided by pCopy. This routine returns OK, or ERROR if it fails. The driver calls this routine, once per unit, during the unit start-up phase.

sysEnetIntEnable( )
    void sysEnetIntEnable (int unit), void sysEnetIntDisable (int unit)
These routines enable or disable the interrupt from the SONIC device for the specified unit. Typically, this involves interrupt controller hardware, either internal or external to the CPU. The driver calls these routines only during initialization, during the unit start-up phase.

sysEnetIntAck( )
    void sysEnetIntAck (int unit)
This routine performs any interrupt acknowledgment or clearing that may be required. This typically involves an operation to some interrupt control hardware. The driver calls this routine from the interrupt handler.

DEVICE CONFIGURATION

Two global variables, snEndDcr and snEndDcr2, are used to set the SONIC device configuration registers. By default, the device is programmed in 32-bit mode with zero-wait states. If these values are not suitable, the snEndDcr and snEndDcr2 variables should be modified before loading the driver. See the SONIC manual for information on appropriate values for these parameters.

SYSTEM RESOURCE USAGE

When implemented, this driver requires the following system resources:

    - one interrupt vector
    - 0 bytes in the initialized data section (data)
    - 696 bytes in the uninitialized data section (BSS)

The above data and BSS requirements are for the MC68020 architecture and can vary for other architectures. Code size (text) varies greatly between architectures and is therefore not quoted here.

This driver uses cacheDmaMalloc( ) to allocate the memory to be shared with the SONIC device. The size requested is 117,188 bytes.

The SONIC device can only be operated if the shared memory region is write-coherent with the data cache. The driver cannot maintain cache coherency for the device for data that is written by the driver because fields within the shared structures are asynchronously modified by the driver and the device, and these fields may share the same cache line.

SEE ALSO

sn83932End, ifLib


Libraries : Routines

sn83932EndLoad( )

NAME

sn83932EndLoad( ) - initialize the driver and device

SYNOPSIS

END_OBJ * sn83932EndLoad
    (
    char * initString /* String to be parse by the driver. */
    )

DESCRIPTION

This routine initializes the driver and the device to the operational state. All of the device specific parameters are passed in the initString parameter. This string must be of the format:

    unit_number:device_reg_addr:ivec

These parameters are all individually described in the sn83932End man page.

RETURNS

An END object pointer or NULL on error.

SEE ALSO

sn83932End