VxWorks Reference Manual : Libraries
sh7615End - sh7615End END network interface driver
sh7615EndLoad( ) - initialize the driver and device
sh7615EndParse( ) - parse the init string
sh7615EndMemInit( ) - initialize memory for the chip
dp83843SingleBitRead( ) - reads a single bit value from the dp83843
dp83843RegPrint( ) - reads all the dp83843 registers and print the value
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).
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"
- 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, especially as regards the physical layer interface.
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.
sh7615End, muxLib, endLib Writing and Enhanced Network Driver SH7615 Hardware Manual
sh7615EndLoad( ) - initialize the driver and device
END_OBJ* sh7615EndLoad ( 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 the initString.
The string contains the target specific parameters like this:
"ivec:ilevel:numRds:numTds:phyDefMode:userFlags"
An END object pointer or NULL on error.
sh7615EndParse( ) - parse the init string
STATUS sh7615EndParse ( DRV_CTRL * pDrvCtrl, /* device pointer */ char * initString /* information string */ )
Parse the input string. Fill in values in the driver control structure.
The muxLib.o module automatically prepends the unit number to the user's initialization string from the BSP (configNet.h).
OK or ERROR for invalid arguments.
sh7615EndMemInit( ) - initialize memory for the chip
STATUS sh7615EndMemInit ( DRV_CTRL * pDrvCtrl /* device to be initialized */ )
This routine is highly specific to the device.
OK or ERROR.
dp83843SingleBitRead( ) - reads a single bit value from the dp83843
UINT16 dp83843SingleBitRead (void)
This routine reads a single bit value from the dp83843 via the etherc's PHY Interface Register (PIR).
N/A.
dp83843RegPrint( ) - reads all the dp83843 registers and print the value
void dp83843RegPrint (void)
This routine reads all the registers of a dp83843 via the etherc's PHY Interface Register (PIR) and prints the values. Only for debug purpose.
N/A.