VxWorks API Reference : Driver Libraries

sh7615End

NAME

sh7615End - sh7615End END network interface driver

ROUTINES

sh7615EndLoad( ) - initialize the driver and device

DESCRIPTION

This module implements an network interface driver for the Hitachi SH7615 on-chip Ethernet controller (EtherC) and EtherNet COntroller Direct Memory Access Controller (E-DMAC). The EtherC is fully compliant with the IEEE 802.3 10Base-T and 100Base-T specifications. Hardware support of the Media Independent Interface (MII) is off-chip.

The Ethernet controller is connected to dedicated transmit and receive Ethernet DMACs (E-DMACs) in the SH7615, and carries out high-speed data transfer to and from memory. The operation of the E-DMAC is controlled with the transmit and receive descriptor rings. The start address of the descriptors is set in the RDLAR and TDLAR registers, so they can reside anywhwere. The descriptors must reside on boundaries that are multiple of their size (16, 32, or 64 bytes).

EXTERNAL INTERFACE

The driver provides the standard external interface, sh7615EndLoad( ), which takes a string of colon-separated parameters. The parameters should be specified in hexadecimal, optionally preceeded by "0x" or a minus sign "-".

The parameter string is parsed using strtok_r( ) and each parameter is converted from a string representation to binary by a call to strtoul(parameter, NULL, 16).

The format of the parameter string is:

"ivec:ilevel:numRds:numTds:phyDefMode:userFlags"

TARGET-SPECIFIC PARAMETERS

ivec
This is the interrupt vector number of the hardware interrupt generated by this Ethernet device. The driver uses intConnect( ) to attach an interrupt handler for this interrupt.

ilevel
This parameter defines the level of the hardware interrupt.

numRds
The number of receive descriptors to use. This controls how much data the device can absorb under load. If this is specified as NONE (-1), the default of 32 is used.

numTds
The number of transmit descriptors to use. This controls how much data the device can absorb under load. If this is specified as NONE (-1) then the default of 64 is used.

phyDefMode
This parameter specifies the operating mode that will be set up by the default physical layer initialization routine in case all the attempts made to establish a valid link failed. If that happens, the first PHY that matches the specified abilities will be chosen to work in that mode, and the physical link will not be tested.

userFlags
This field enables the user to give some degree of customization to the driver. Bit [0-3] reserved for receive FIFO depth and bit [4-7] reserved for transmit FIFO depth. The actual FIFO size is 256 times + 256 the set value for each FIFO. The max FIFO depth is 512 bytes for SH7615 (i.e. 0x1 for receive FIFO, 0x10 for transmit FIFO) and 2048 bytes for SH7616 (i.e. 0x7 for receive FIFO, 0x70 for transmit FIFO).

The macros SYS_INT_CONNECT, SYS_INT_DISCONNECT, and SYS_INT_ENABLE 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. By default this is the routine sysLanIntEnable( ), defined in the module sysLib.o.

The macro SYS_ENET_ADDR_GET is used to get the ethernet address (MAC) for the device. The single argument to this routine is the SH7615END_DRV_CTRL pointer. By default this routine copies the ethernet address stored in the global variable sysTemplateEnetAddr into the SH7615END_DRV_CTRL structure.

SEE ALSO

muxLib, endLib Writing and Enhanced Network Driver SH7615 Hardware Manual


Driver Libraries : Routines

sh7615EndLoad( )

NAME

sh7615EndLoad( ) - initialize the driver and device

SYNOPSIS

END_OBJ* sh7615EndLoad
    (
    char * initString         /* String to be parsed 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.

The string contains the target specific parameters like this:
 "ivec:ilevel:numRds:numTds:phyDefMode:userFlags"

RETURNS

An END object pointer or NULL on error.

SEE ALSO

sh7615End