Vxworks Drivers Api Reference 6.6
Vxworks Drivers Api Reference 6.6
VxWorks
®
6.6
Copyright © 2007 Wind River Systems, Inc.
All rights reserved. No part of this publication may be reproduced or transmitted in any
form or by any means without the prior written permission of Wind River Systems, Inc.
Wind River, Tornado, and VxWorks are registered trademarks of Wind River Systems, Inc.
The Wind River logo is a trademark of Wind River Systems, Inc. Any third-party
trademarks referenced are the property of their respective owners. For further information
regarding Wind River trademarks, please see:
http://www.windriver.com/company/terms/trademark.html
This product may include software licensed to Wind River by third parties. Relevant
notices (if any) are provided in your product installation at the following location:
installDir/product_name/3rd_party_licensor_notice.pdf.
Wind River may refer to third-party documentation by listing publications or providing
links to third-party Web sites for informational purposes. Wind River accepts no
responsibility for the information provided in such third-party documentation.
Corporate Headquarters
Wind River Systems, Inc.
500 Wind River Way
Alameda, CA 94501-1153
U.S.A.
For additional contact information, please visit the Wind River URL:
http://www.windriver.com
For information on how to contact Customer Support, please visit the following URL:
http://www.windriver.com/support
16 Nov 07
Part #: DOC-16104-ND-00
Contents
This book provides reference entries that describe VxWorks drivers. For reference
entries that describe the facilities available for VxWorks process-based application
development, see the VxWorks Application API Reference. For reference entries that
describe facilities available in the VxWorks kernel, see the VxWorks Kernel API
Reference.
1. Libraries
This section provides reference entries for each of the VxWorks driver libraries,
arranged alphabetically. Each entry lists the routines found in the library, including
a one-line synopsis of each and a general description of their use.
Individual reference entries for each of the available functions in these libraries is
provided in section 2.
2. Routines
This section provides reference entries for each of the routines found in the
VxWorks driver libraries documented in section 1.
iii
VxWorks Drivers API Reference, 6.6
iv
1
Libraries
1
VxWorks Drivers API Reference, 6.6
2
1 Libraries
3
VxWorks Drivers API Reference, 6.6
4
1 Libraries
ambaSio
ambaSio 1
DESCRIPTION This is the device driver for the Advanced RISC Machines (ARM) AMBA UART. This is a
generic design of UART used within a number of chips containing (or for use with) ARM
CPUs such as in the Digital Semiconductor 21285 chip as used in the EBSA-285 BSP.
This design contains a universal asynchronous receiver/transmitter, a baud-rate generator,
and an InfraRed Data Association (IrDa) Serial InfraRed (SiR) protocol encoder. The Sir
encoder is not supported by this driver. The UART contains two 16-entry deep FIFOs for
receive and transmit: if a framing, overrun or parity error occurs during reception, the
appropriate error bits are stored in the receive FIFO along with the received data. The FIFOs
can be programmed to be one byte deep only, like a conventional UART with double
buffering, but the only mode of operation supported is with the FIFOs enabled.
The UART design does not support the modem control output signals: DTR, RI and RTS.
Moreover, the implementation in the 21285 chip does not support the modem control
inputs: DCD, CTS and DSR.
The UART design can generate four interrupts: Rx, Tx, modem status change and a UART
disabled interrupt (which is asserted when a start bit is detected on the receive line when
the UART is disabled). The implementation in the 21285 chip has only two interrupts: Rx
and Tx, but the Rx interrupt is a combination of the normal Rx interrupt status and the
UART disabled interrupt status.
Only asynchronous serial operation is supported by the UART which supports 5 to 8 bit bit
word lengths with or without parity and with one or two stop bits. The only serial word
format supported by the driver is 8 data bits, 1 stop bit, no parity, The default baud rate is
determined by the BSP by filling in the AMBA_CHAN structure before calling
ambaDevInit( ).
The exact baud rates supported by this driver will depend on the crystal fitted (and
consequently the input clock to the baud-rate generator), but in general, baud rates from
about 300 to about 115200 are possible.
In theory, any number of UART channels could be implemented within a chip. This driver
has been designed to cope with an arbitrary number of channels, but at the time of writing,
has only ever been tested with one channel.
DATA STRUCTURES
An AMBA_CHAN data structure is used to describe each channel, this structure is described
in h/drv/sio/ambaSio.h.
5
VxWorks Drivers API Reference, 6.6
ambaSio
CALLBACKS Servicing a "transmitter ready" interrupt involves making a callback to a higher level library
in order to get a character to transmit. By default, this driver installs dummy callback
routines which do nothing. A higher layer library that wants to use this driver (e.g. ttyDrv)
will install its own callback routine using the SIO_INSTALL_CALLBACK ioctl command.
Likewise, a receiver interrupt handler makes a callback to pass the character to the higher
layer library.
USAGE The driver is typically only called by the BSP. The directly callable routines in this modules
are ambaDevInit( ), ambaIntTx( ) and ambaIntRx( ).
The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ), which initialises the
hardware-specific fields in the AMBA_CHAN structure (e.g. register I/O addresses etc)
before calling ambaDevInit( ) which resets the device and installs the driver function
pointers. After this the UART will be enabled and ready to generate interrupts, but those
interrupts will be disabled in the interrupt controller.
The following example shows the first parts of the initialisation:
#include "drv/sio/ambaSio.h"
ambaChan[i].levelRx = devParas[i].intLevelRx;
ambaChan[i].levelTx = devParas[i].intLevelTx;
/*
* Initialise driver functions, getTxChar, putRcvChar and
* channelMode, then initialise UART
*/
ambaDevInit(&ambaChan[i]);
}
}
The BSP's sysHwInit2( ) routine typically calls sysSerialHwInit2( ), which connects the
chips interrupts via intConnect( ) (the two interrupts ambaIntTx and ambaIntRx) and
enables those interrupts, as shown in the following example:
6
1 Libraries
amd8111LanEnd
/* connect Tx interrupt */
BSP By convention all the BSP-specific serial initialisation is performed in a file called
sysSerial.c, which is #include'ed by sysLib.c. sysSerial.c implements at least four functions,
sysSerialHwInit( ) sysSerialHwInit2( ), sysSerialChanGet( ), and sysSerialReset( ). The
first two have been described above, the others work as follows:
sysSerialChanGet is called by usrRoot to get the serial channel descriptor associated with a
serial channel number. The routine takes a single parameter which is a channel number
ranging between zero and NUM_TTY. It returns a pointer to the corresponding channel
descriptor, SIO_CHAN *, which is just the address of the AMBA_CHAN structure.
sysSerialReset is called from sysToMonitor( ) and should reset the serial devices to an
inactive state (prevent them from generating any interrupts).
SEE ALSO: Advanced RISC Machines AMBA UART (AP13) Data Sheet, Sheet," Digital Semiconductor
EBSA-285 Evaluation Board Reference Manual.
amd8111LanEnd
NAME amd8111LanEnd – END style AMD8111 LAN Ethernet driver
7
VxWorks Drivers API Reference, 6.6
amd8111LanEnd
DESCRIPTION This module implements the Advanced Micro Devices 8111 LAN END PCI Ethernet 32-bit
network interface driver.
This driver is designed to be moderately generic, operating unmodified across the range of
architectures and targets supported by VxWorks. To achieve this, the driver must be given
several target-specific parameters, and some external support routines must be provided.
These target-specific values and the external support routines are described below.
This driver supports multiple units per CPU. The driver can be configured to support
big-endian or little-endian architectures. It contains error recovery code to handle known
device errata related to DMA activity.
Some big-endian processors may be connected to a PCI bus through a host/PCI bridge
which performs byte swapping during data phases. On such platforms, the controller need
not perform byte swapping during a DMA access to memory shared with the host
processor.
EXTERNAL INTERFACE
The driver provides one standard external interface, amd8111LanEndLoad( ). As input, this
routine takes a string of colon-separated parameters. The parameters should be specified in
hexadecimal (optionally preceded by 0x or a minus sign -). The parameter string is parsed
using strtok_r( ).
TARGET-SPECIFIC PARAMETERS
The format of the parameter string is:
unit:memAdrs:memSize:memWidth:offset:tdnum:rdnum:flags
unit
The unit number of the device. Unit numbers start at zero and increase for each device
controlled by the same driver. The driver does not use this value directly. The unit
number is passed through the MUX API where it is used to differentiate between
multiple instances of a particular driver.
memAdrs
This parameter gives the driver the memory address to carve out its buffers and data
structures. If this parameter is specified to be NONE then the driver allocates cache
coherent memory for buffers and descriptors from the system memory pool. The PCnet
device is a DMA type of device and typically shares access to some region of memory
with the CPU. This driver is designed for systems that directly share memory between
the CPU and the PCnet. It assumes that this shared memory is directly available to it
without any arbitration or timing concerns.
memSize
This parameter can be used to explicitly limit the amount of shared memory (bytes) this
driver will use. The constant NONE can be used to indicate no specific size limitation.
This parameter is used only if a specific memory region is provided to the driver.
8
1 Libraries
amd8111LanEnd
memWidth
1
Some target hardware that restricts the shared memory region to a specific location also
restricts the access width to this region by the CPU. On these targets, performing an
access of an invalid width will cause a bus error.
This parameter can be used to specify the number of bytes of access width to be used
by the driver during access to the shared memory. The constant NONE can be used to
indicate no restrictions.
Current internal support for this mechanism is not robust; implementation may not
work on all targets requiring these restrictions.
offset
This parameter specifies a memory alignment offset. Normally this parameter is zero
except for architectures which can only access 32-bit words on 4-byte aligned address
boundaries. For these architectures the value of this offset should be 2.
tdnum
This parameter specifies the number of Transmit Descriptors to allocate. Must be a
power of 2.
rdnum
This parameter specifies the number of Receive Descriptors to allocate. Must be a
power of 2.
flags
This is parameter is used for future use. Currently its value should be zero.
PERFORMANCE This driver has been empirically shown to give better performance when passed a cacheable
region of memory for use by the driver provided the BSP supports caching.
The driver allocates clusters of size 1520 bytes for receive frames and
transmit frames.
9
VxWorks Drivers API Reference, 6.6
ataDrv
SEE ALSO muxLib, endLib, netBufLib, the network stack documentation, "AMD-8111 HyperTransport
I/O Hub Data Sheet"
ataDrv
NAME ataDrv – ATA/IDE and ATAPI CDROM (LOCAL and PCMCIA) disk device driver
10
1 Libraries
ataDrv
DESCRIPTION
1
BLOCK DEVICE DRIVER:
This is a Block Device Driver for ATA/ATAPI devices on IDE host controller. It also
provides neccessary functions to user for device and its features control which are not used
or utilized by file system.
This driver provides standard Block Device Driver functions,(blkRd, blkWrt, ioctl,
statusChk, and reset) for ATA and ATAPI devices separately as the scheme of
implementation differs. These functions are implemented as ataBlkRd( ), ataBlkWrt( ),
ataBlkIoctl( ), ataStatus( ) and ataReset( ) for ATA devices and atapiBlkRd( ),
atapiBlkWrt( ), atapiBlkIoctl( ), atapiStatusChk( ) and atapiReset( ) for ATAPI devices.
The Block Device Structure BLK_DEV is updated with these function pointers ata
initialization of the driver depending on the type of the device in function ataDevCreate( ).
ataDrv( ), a user callable function, initializes ATA/ATAPI devices present on the specified
IDE controller(either primary or secondary), which must be called once for each controller,
before usage of this driver, usally called from usrRoot( )in usrConfig.c.
The routine ataDevCreate( ), which is user callable function, is used to mount a logical drive
on an ATAPI drive.This routine returns a pointer to BLK_DEV structure, which is used to
mount the file system on the logical drive.
11
VxWorks Drivers API Reference, 6.6
ataDrv
PARAMETERS:
The ataPiDrv( ) function requires a configuration flag as a parameter. The configuration flag
is one of the following or Bitwise OR of any of the following combination:
configuration flag =
Transfer mode | Transfer bits | Transfer unit | Geometry parameters
12
1 Libraries
ataDrv
13
VxWorks Drivers API Reference, 6.6
ataDrv
This driver supports UDMA mode data transfer from device to host, provided 80 conductor
cable is used for required controller device. This check done at the initilisation of the device
from the device parameters and if 80 conductor cable is connected then UDMA mode
transfer is selected for operation subject to condition that required UDMA mode is
supported by device as well as host. This driver follows ref-3 Chapter 4 "Determining a
Drive's Transfer Rate Capability" to determine drives best transfer rate for all modes ( ie
UDMA, MDMA, SDMA and PIO modes).
The host IDE Bus master functions are to be mapped to follwing macro defined for various
functionality in header file which are used in this driver.
ATA_HOST_CTRL_INIT - initialize the controller
ATA_HOST_DMA_ENGINE_INIT - initialize bus master DMA engine
ATA_HOST_DMA_ENGINE_START - Start bus master operation
ATA_HOST_DMA_ENGINE_STOP - Stop bus master operation
ATA_HOST_DMA_TRANSFER_CHK - check bus master data transfer complete
ATA_HOST_DMA_MODE_NEGOTIATE - get mode supported by controller
ATA_HOST_SET_DMA_RWMODE - set controller to required mode
ATA_HOST_CTRL_RESET - reset the controller
If ATA_GEO_PHYSICAL is specified, the driver uses the physical geometry parameters
stored in the drive. If ATA_GEO_CURRENT is specified, the driver uses current geometry
parameters initialized by BIOS. If ATA_GEO_FORCE is specified, the driver uses geometry
parameters stored in sysLib.c.
The geometry parameters are stored in the structure table ataTypes[] in sysLib.c. That table
has two entries, the first for drive 0, the second for drive 1. The members of the structure are:
int cylinders; /* number of cylinders */
int heads; /* number of heads */
int sectors; /* number of sectors per track */
int bytes; /* number of bytes per sector */
int precomp; /* precompensation cylinder */
The driver supports two controllers and two drives on each. This is dependent on the
configuration parameters supplied to ataPiDrv( ).
SMP CONSIDERATIONS
Most of the processing in this driver occurs in the context of a dedicated task, and therefore
is inherently SMP-safe. One area of possible concurrence occurs in the interrupt service
routine, ataIntr( ). An ISR-callable spin lock take/give pair has been placed around the code
which acknowledges/clears the ATA controller's interrupt status register. If the BSP or
application provides functions for ataIntPreProcessing or ataIntPostProcessing,
consideration will have to be given to making these functions SMP-safe. Most likely, some
portion(s) of these functions will need to be protected by a spin lock. The spin lock allocated
for the controller can be used. Consult the SMP Migration Guide for hints.
14
1 Libraries
ataShow
References:
1
1) ATAPI-5 specification "T13-1321D Revision 1b, 7 July 1999"
2) ATAPI for CD-ROMs "SFF-8020i Revision 2.6, Jan 22,1996"
3) Intel 82801BA (ICH2), 82801AA (ICH), and 82801AB (ICH0) IDE Controller
Programmer's Reference Manual, Revision 1.0 July 2000
ataShow
NAME ataShow – ATA/IDE (LOCAL and PCMCIA) disk device driver show routine
15
VxWorks Drivers API Reference, 6.6
auEnd
DESCRIPTION This library contains a driver show routine for the ATA/IDE (PCMCIA and LOCAL)
devices supported on the IBM PC.
auEnd
NAME auEnd – END style Au MAC Ethernet driver
DESCRIPTION This module implements the Alchemey Semiconductor au on-chip ethernet MACs.
The software interface to the driver is divided into three parts. The first part is the interrupt
registers and their setup. This part is done at the BSP level in the various BSPs which use
this driver. The second and third part are addressed in the driver. The second part of the
interface comprises of the I/O control registers and their programming. The third part of
the interface comprises of the descriptors and the buffers.
This driver is designed to be moderately generic. Though it currently is implemented on one
processor, in the future it may be added to other Alchemey product offerings. Thus, it
would be desirable to use the same driver with no source level changes. To achieve this, the
driver must be given several target-specific parameters, and some external support routines
must be provided. These target-specific values and the external support routines are
described below.
This driver supports multiple units per CPU. The driver can be configured to support
big-endian or little-endian architectures.
16
1 Libraries
auEnd
EXTERNAL INTERFACE
1
The only external interface is the auEndLoad( ) routine, which expects the initString
parameter as input. This parameter passes in a colon-delimited string of the format:
unit:devMemAddr:devIoAddr:enableAddr:vecNum:intLvl:offset :qtyCluster:flags
The auEndLoad( ) function uses strtok( ) to parse the string.
TARGET-SPECIFIC PARAMETERS
unit
A convenient holdover from the former model. This parameter is used only in the
string name for the driver.
devAddr
This parameter is the memory base address of the device registers in the memory map
of the CPU. It indicates to the driver where to find the base MAC register.
devIoAddr
This parameter in the base address of the device registers for the dedicated DMA
channel for the MAC device. It indicates to the driver where to find the DMA registers.
enableAddr
This parameter is the address MAC enable register. It is necessary to specify selection
between MAC 0 and MAC 1.
vecNum
This parameter is the vector associated with the device interrupt. This driver configures
the MAC device to generate hardware interrupts for various events within the device;
thus it contains an interrupt handler routine. The driver calls intConnect( ) via the
macro SYS_INT_CONNECT( ) to connect its interrupt handler to the interrupt vector
generated as a result of the MAC interrupt.
intLvl
Some targets use additional interrupt controller devices to help organize and service
the various interrupt sources. This driver avoids all board- specific knowledge of such
devices. During the driver's initialization, the external routine sysLanAuIntEnable( )
is called to perform any board-specific operations required to allow the servicing of an
interrupt. For a description of sysLanAuIntEnable( ), see "External Support
Requirements" below.
offset
This parameter specifies the offset from which the packet has to be loaded from the
beginning of the device buffer. Normally this parameter is zero except for architectures
which access long words only on aligned addresses. For these architectures the value
of this offset should be 2.
qtyCluster
This parameter is used to explicitly allocate the number of clusters that will be
allocated. This allows the user to suit the stack to the amount of physical memory on
the board.
17
VxWorks Drivers API Reference, 6.6
auEnd
flags
This is parameter is reserved for future use. Its value should be zero.
18
1 Libraries
bcm1250MacEnd
SEE ALSO muxLib, endLib, netBufLib, VxWorks Device Driver Developer's Guide
bcm1250MacEnd
NAME bcm1250MacEnd – END style BCM1250 MAC Ethernet driver
DESCRIPTION This module implements the Broadcom BCM1250 on-chip ethernet MACs. The BCM1250
ethernet DMA has two channels, but this module only supports channel 0. The dual DMA
channel feature is intended for packet classification and quality of service applications.
EXTERNAL INTERFACE
The only external interface is the bcm1250MacEndLoad( ) routine, which has the initString
as its only parameter. The initString parameter must be a colon- delimited string in the
following format:
unit:hwunit:vecnum:flags:numRds0:numTds0
TARGET-SPECIFIC PARAMETERS
unit
This parameter defines which ethernet interface is being loaded.
hwunit
This parameter is no longer used, but must be present so the string can be parsed
properly. Its value should be zero.
vecnum
This parameter specifies the interrupt vector number. This driver configures the MAC
device to generate hardware interrupts for various events within the device; thus it
19
VxWorks Drivers API Reference, 6.6
bio
SEE ALSO muxLib, endLib, netBufLib, VxWorks Device Driver Developer's Guide
bio
NAME bio – buffer IO Implementation
20
1 Libraries
cisShow
cisLib 1
DESCRIPTION This library contains routines to manipulate the CIS (Configuration Information Structure)
tuples and the card configuration registers. The library uses a memory window which is
defined in pcmciaMemwin to access the CIS of a PC card. All CIS tuples in a PC card are
read and stored in a linked list, cisTupleList. If there are configuration tuples, they are
interpreted and stored in another link list, cisConifigList. After the CIS is read, the PC
card's enabler routine allocates resources and initializes a device driver for the PC card.
If a PC card is inserted, the CSC (Card Status Change) interrupt handler gets a CSC event
from the PCMCIA chip and adds a cisGet( ) job to the PCMCIA daemon. The PCMCIA
daemon initiates the cisGet( ) work. The CIS library reads the CIS from the PC card and
makes a linked list of CIS tuples. It then enables the card.
If the PC card is removed, the CSC interrupt handler gets a CSC event from the PCMCIA
chip and adds a cisFree( ) job to the PCMCIA daemon. The PCMCIA daemon initiates the
cisFree( ) work. The CIS library frees allocated memory for the linked list of CIS tuples.
cisShow
NAME cisShow – PCMCIA CIS show library
DESCRIPTION This library provides a show routine for CIS tuples. This is provided for engineering debug
use.
This module uses floating point calculations. Any task calling cisShow( ) needs to have the
VX_FP_TASK bit set in the task flags.
21
VxWorks Drivers API Reference, 6.6
cmdLineBuild
cmdLineBuild
NAME cmdLineBuild – source file included in sysLib.c for command-line builds
DESCRIPTION This library contains the hwif initialization for the command line build environment.
ctB69000Vga
NAME ctB69000Vga – a CHIPS B69000 initialization source module
ROUTINES ctB69000VgaInit( ) – initializes the B69000 chip and loads font in memory.
DESCRIPTION The 69000 is the first product in the CHIPS family of portable graphics accelerator product
line that integrates high performance memory technology for the graphics frame buffer.
Based on the proven HiQVideo graphics accelerator core, the 69000 combines
state-of-the-art flat panel controller capabilities with low power, high performance
integrated memory. The result is the start of a high performance, low power, highly
integrated solution for the premier family of portable graphics products.
High Performance Integrated Memory
The 69000 is the first member of the HiQVideo family to provide integrated high
performance synchronous DRAM (SDRAM) memory technology. Targeted at the
mainstream notebook market, the 69000 incorporates 2MB of proprietary integrated
SDRAM for the graphics/video frame buffer. The integrated SDRAM memory can
support up to 83MHz operation, thus increasing the available memory bandwidth for
the graphics subsystem. The result is support for additional high color / high
resolution graphics modes combined with real-time video acceleration. This additional
bandwidth also allows more flexibility in the other graphics functions intensely used in
Graphical User Interfaces (GUIs) such as Microsoft Windows.
Frame-Based AGP Compatibility
The 69000 graphics is designed to be used with either 33MHz PCI, or with AGP as a
frame-based AGP device, allowing it to be used with the AGP interface provided by the
latest core logic chipsets.
22
1 Libraries
ctB69000Vga
HiQColor TM Technology
1
The 69000 integrates CHIPS breakthrough HiQColor technology. Based on the CHIPS
proprietary TMED (Temporal Modulated Energy Distribution) algorithm, HiQColor
technology is a unique process that allows the display of 16.7 million true colors on STN
panels without using Frame Rate Control (FRC) or dithering. In addition, TMED also
reduces the need for the panel tuning associated with current FRC-based algorithms.
Independent of panel response, the TMED algorithm eliminates all of the flaws (such
as shimmer, Mach banding, and other motion artifacts) normally associated with
dithering and FRC. Combined with the new fast response, high-contrast, and
low-crosstalk technology found in new STN panels, HiQColor technology enables the
best display quality and color fidelity previously only available with TFT technology.
Versatile Panel Support
The HiQVideo family supports a wide variety of monochrome and color Single- Panel,
Single-Drive (SS) and Dual-Panel, Dual Drive (DD), standard and high- resolution,
passive STN and active matrix TFT/MIM LCD, and EL panels. With HiQColor
technology, up to 256 gray scales are supported on passive STN LCDs. Up to 16.7M
different colors can be displayed on passive STN LCDs and up to 16.7M colors on 24-
bit active matrix LCDs.
The 69000 offers a variety of programmable features to optimize display quality.
Vertical centering and stretching are provided for handling modes with less than 480
lines on 480-line panels. Horizontal and vertical stretching capabilities are also
available for both text and graphics modes for optimal display of VGA text and
graphics modes on 800x600, 1024x768 and 1280x1024 panels.
Television NTSC/PAL Flicker Free Output
The 69000 uses a flicker reduction process which makes text of all fonts and sizes
readable by reducing the flicker and jumping lines on the display.
HiQVideo T Multimedia Support
The 69000 uses independent multimedia capture and display systems on-chip. The
capture system places data in display memory (usually off screen) and the display
system places the data in a window on the screen.
Low Power Consumption
The 69000 uses a variety of advanced power management features to reduce power
consumption of the display sub-system and to extend battery life. Optimized for 3.3V
operation, the 69000 internal logic, bus and panel interfaces operate at 3.3V but can
tolerate 5V operation.
Software Compatibility / Flexibility
The HiQVideo controllers are fully compatible with the VGA standard at both the
register and BIOS levels. CHIPS and third-party vendors supply a fully VGA
compatible BIOS, end-user utilities and drivers for common application programs.
Acceleration for All Panels and All Modes
The 69000 graphics engine is designed to support high performance graphics and video
acceleration for all supported display resolutions, display types, and color modes.
23
VxWorks Drivers API Reference, 6.6
dec21x40End
dec21x40End
NAME dec21x40End – END-style DEC 21x40 PCI Ethernet network interface driver
EXTERNAL INTERFACE
The driver provides one standard external interface, dec21x40EndLoad( ). As input, this
function expects a string of colon-separated parameters. The parameters should be
specified as hexadecimal strings (optionally preceded by "0x" or a minus sign "-").
Although the parameter string is parsed using endTok_r( ), each parameter is converted
from string to binary by a call to:
strtoul(parameter, NULL, 16).
The format of the parameter string is:
"<deviceAddr>:<pciAddr>:<iVec>:<iLevel>:<numRds>:<numTds>:\
<memBase>:<memSize>:<userFlags>:<phyAddr>:<pPhyTbl>:<phyFlags>:<offset>:\
<loanBufs>:<drvFlags>"
24
1 Libraries
dec21x40End
TARGET-SPECIFIC PARAMETERS
1
deviceAddr
This is the base address at which the hardware device registers are located.
pciAddr
This parameter defines the main memory address over the PCI bus. It is used to
translate a physical memory address into a PCI-accessible address.
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. The BSP can change this by modifying the global pointer
dec21x40IntConnectRtn with the desired routines (usually pciIntConnect).
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.
memBase
This parameter specifies the base address of a DMA-able cache-free pre-allocated
memory region for use as a memory pool for transmit/receive descriptors and buffers
including loaner buffers. If there is no pre-allocated memory available for the driver,
this parameter should be -1 (NONE). In which case, the driver allocates cache safe
memory for its use using cacheDmaAlloc( ).
memSize
The memory size parameter specifies the size of the pre-allocated memory region. If
memory base is specified as NONE (-1), the driver ignores this parameter. When
specified this value must account for transmit/receive descriptors and buffers and
loaner buffers
userFlags
User flags control the run-time characteristics of the Ethernet chip. Most flags specify
non default CSR0 and CSR6 bit values. Refer to dec21x40End.h for the bit values of the
flags and to the device hardware reference manual for details about device capabilities,
CSR6 and CSR0.
phyAddr
This optional parameter specifies the address on the MII (Media Independent Interface)
bus of a MII-compliant PHY (Physical Layer Entity). The module that is responsible for
optimally configuring the media layer will start scanning the MII bus from the address
in phyAddr. It will retrieve the PHY's address regardless of that, but, since the MII
management interface, through which the PHY is configured, is a very slow one,
25
VxWorks Drivers API Reference, 6.6
dec21x40End
26
1 Libraries
dec21x40End
Cache Alignment:
1
the DEC_USR_CAL_xxx flags specify the address boundaries for data burst
transfers.
DMA burst length:
the DEC_USR_PBL_xxx flags specify the maximum number of long words in a
DMA burst.
PCI multiple read:
the DEC_USR_RML flag specifies that a device supports PCI
memory-read-multiple.
Full Duplex Mode:
when set, the DEC_USR_FD flag allows the device to work in full duplex mode, as
long as the PHY used has this capability. It is worth noting here that in this
operation mode, the dec21x40 chip ignores the Collision and the Carrier Sense
signals.
MII interface:
some boards feature an MII-compliant Physical Layer Entity (PHY). In this case,
and if the flag DEC_USR_MII is set, then the optional fields phyAddr, pPhyTbl, and
phyFlags may be used to affect the PHY's configuration on the network.
10Base-T Mode:
when the flag DEC_USR_MII_10MB is set, then the PHY will negotiate this
technology ability, if present.
100Base-T Mode:
when the flag DEC_USR_MII_100MB is set, then the PHY will negotiate this
technology ability, if present.
Half duplex Mode:
when the flag DEC_USR_MII_HD is set, then the PHY will negotiate this
technology ability, if present.
Full duplex Mode:
when the flag DEC_USR_MII_FD is set, then the PHY will negotiate this
technology ability, if present.
Auto-negotiation:
the driver's default behaviour is to enable auto-negotiation, as defined in "IEEE
802.3u Standard". However, the user may disable this feature by setting the flag
DEC_USR_MII_NO_AN in the phyFlags field of the load string.
Auto-negotiation table:
the driver's default behaviour is to enable the standard auto-negotiation process,
as defined in "IEEE 802.3u Standard". However, the user may wish to force the
PHY to negotiate its technology abilities a subset at a time, and according to a
particular order. The flag DEC_USR_MII_AN_TBL in the phyFlags field may be
used to tell the driver that the PHY should negotiate its abilities as dictated by the
27
VxWorks Drivers API Reference, 6.6
dec21x40End
entries in the pPhyTbl of the load string. If the flag DEC_USR_MII_NO_AN is set,
this parameter is ignored.
Link monitoring:
this feature enables the netTask to periodically monitor the PHY's link status for
link down events. If any such event occurs, and if the flag
DEC_USR_MII_BUS_MON is set, then a driver's optionally provided routine is
executed, and the link is renegotiated.
Transmit threshold value:
the DEC_USR_THR_XXX flags enable the user to choose among different threshold
values for the transmit FIFO. Transmission starts when the frame size within the
transmit FIFO is larger than the threshold value. This should be selected taking
into account the actual operating speed of the PHY. Again, see the device
hardware reference manual for details.
28
1 Libraries
dec21x40End
...
} 1
The pDrvCtrl parameter is a pointer to the driver control structure that this routine can
use to access the Ethernet device. The driver control structure member mediaCount, is
initialized to 0xff at startup, while the other media control members (mediaDefault,
mediaCurrent, and gprModeVal) are initialized to zero. This routine can use these
fields in any manner. However, all other driver control structure members should be
considered read-only and should not be modified.
This routine should reset, initialize, and select an appropriate media. It should also
write necessary the CSR6 bits (port select, PCS, SCR, and full duplex) to the memory
location pointed to by pCsr6Val. The driver uses this value to program register CSR6.
This routine should return OK or ERROR.
_func_dec21x40NanoDelay
VOIDFUNCPTR _func_dec21x40NanoDelay
This driver uses a delay function that is dependent on the speed of the microprocessor.
The delays generated by the generic driver delay function should be sufficient for most
processors but are likely to cause some excessively slow functionality especially on the
slower processors. On the other hand, insufficient delays generated on extremely fast
processors may cause networking failures.
The variable _func_dec21x40NanoDelay may be used by the BSP to point to a function
which will force a delay of a specified number of nanoseconds. The delay does not need
to be very accurate but it must be equal to or greater than the requested amount.
Typically _func_dec21x40NanoDelay will be initialized in sysHwInit( ) to a
target-specific delay routine.
A 1nS delay routine is typically defined as:
void sysNanoDelay
(
UINT32 nsec /* number of nanoseconds to delay */
)
{
volatile int delay;
volatile int i;
_func_dec21x40NanoDelay = sysNanoDelay;
29
VxWorks Drivers API Reference, 6.6
device
"_func_dec2114xIntAck" "" 9 -1
VOIDFUNCPTR _func_dec2114xIntAck
This driver does acknowledge the LAN interrupts. However if the board hardware
requires specific interrupt acknowledgement, not provided by this driver, the BSP
should define such a routine and attach it to the driver via _func_dec2114xIntAck.
PCI ID VALUES The dec21xxx series chips are now owned and manufactured by Intel. Chips may be
identified by either PCI Vendor ID. ID value 0x1011 for Digital, or ID value 0x8086 for Intel.
Check the Intel web site for latest information. The information listed below may be out of
date.
Chip Vendor ID Device ID
dec 21040 0x1011 0x0002
dec 21041 0x1011 0x0014
dec 21140 0x1011 0x0009
dec 21143 0x1011 0x0019
dec 21145 0x8086 0x0039
SEE ALSO ifLib, "DECchip 21040 Ethernet LAN Controller for PCI, ", "Digital Semiconductor 21140A PCI
Fast Ethernet LAN Controller, ", "Using the Digital Semiconductor 21140A with Boot ROM, Serial
ROM, and External Register: An Application Note", "Intel 21145 Phoneline/Ethernet LAN
Controller Hardware Ref. Manual", "Intel 21145 Phoneline/Ethernet LAN Controller Specification
Update"
device
NAME device – Device Infrastructure Library
DESCRIPTION This library provides the interface for the device infrastructure.
30
1 Libraries
el3c90xEnd
drvDownLoad 1
el3c90xEnd
NAME el3c90xEnd – END network interface driver for 3COM 3C90xB XL
DESCRIPTION This module implements the device driver for the 3COM EtherLink Xl and Fast EtherLink
XL PCI network interface cards.
The 3c90x PCI ethernet controller is inherently little endian because the chip is designed to
operate on a PCI bus which is a little endian bus. The software interface to the driver is
divided into three parts. The first part is the PCI configuration registers and their set up.
This part is done at the BSP level in the various BSPs which use this driver. The second and
third part are dealt in the driver. The second part of the interface comprises of the I/O
control registers and their programming. The third part of the interface comprises of the
descriptors and the buffers.
This driver is designed to be moderately generic, operating unmodified across the range of
architectures and targets supported by VxWorks. To achieve this, the driver must be given
several target-specific parameters, and some external support routines must be provided.
These target-specific values and the external support routines are described below.
This driver supports multiple units per CPU. The driver can be configured to support
big-endian or little-endian architectures. It contains error recovery code to handle known
device errata related to DMA activity.
Big endian processors can be connected to the PCI bus through some controllers which take
care of hardware byte swapping. In such cases all the registers which the chip DMAs to,
have to be swapped and written to, so that when the hardware swaps the accesses, the chip
would see them correctly. The chip still has to be programmed to operated in little endian
mode as it is on the PCI bus. If the cpu board hardware automatically swaps all the accesses
to and from the PCI bus, then input and output byte stream need not be swapped.
31
VxWorks Drivers API Reference, 6.6
el3c90xEnd
The 3c90x series chips use a bus-master DMA interface for transferring packets to and from
the controller chip. Some of the old 3c59x cards also supported a bus master mode, however
for those chips you could only DMA packets to and from a contiguous memory buffer. For
transmission this would mean copying the contents of the queued M_BLK chain into a an
M_BLK cluster and then DMAing the cluster. This extra copy would sort of defeat the
purpose of the bus master support for any packet that doesn't fit into a single M_BLK. By
contrast, the 3c90x cards support a fragment-based bus master mode where M_BLK chains
can be encapsulated using TX descriptors. This is also called the gather technique, where the
fragments in an mBlk chain are directly incorporated into the download transmit descriptor.
This avoids any copying of data from the mBlk chain.
EXTERNAL INTERFACE
The only external interface is the el3c90xEndLoad( ) routine, which expects the initString
parameter as input. This parameter passes in a colon-delimited string of the format:
unit:devMemAddr:devIoAddr:pciMemBase:vecNum:intLvl:memAdrs:
memSize:memWidth:flags:buffMultiplier
The el3c90xEndLoad( ) function uses strtok( ) to parse the string.
TARGET-SPECIFIC PARAMETERS
unit
A convenient holdover from the former model. This parameter is used only in the
string name for the driver.
32
1 Libraries
el3c90xEnd
devMemAddr
1
This parameter in the memory base address of the device registers in the memory map
of the CPU. It indicates to the driver where to find the register set. < This parameter
should be equal to NONE if the device does not support memory mapped registers.
devIoAddr
This parameter in the IO base address of the device registers in the IO map of some
CPUs. It indicates to the driver where to find the RDP register. If both devIoAddr and
devMemAddr are given then the device chooses devMemAddr which is a memory
mapped register base address. This parameter should be equal to NONE if the device
does not support IO mapped registers.
pciMemBase
This parameter is the base address of the CPU memory as seen from the PCI bus. This
parameter is zero for most intel architectures.
vecNum
This parameter is the vector associated with the device interrupt. This driver configures
the LANCE device to generate hardware interrupts for various events within the
device; thus it contains an interrupt handler routine. The driver calls intConnect( ) to
connect its interrupt handler to the interrupt vector generated as a result of the LANCE
interrupt. The BSP can use a different routine for interrupt connection by changing the
point el3c90xIntConnectRtn to point to a different routine.
intLvl
Some targets use additional interrupt controller devices to help organize and service
the various interrupt sources. This driver avoids all board-specific knowledge of such
devices. During the driver's initialization, the external routine sysEl3c90xIntEnable( )
is called to perform any board-specific operations required to allow the servicing of a
NIC interrupt. For a description of sysEl3c90xIntEnable( ), see "External Support
Requirements" below.
memAdrs
This parameter gives the driver the memory address to carve out its buffers and data
structures. If this parameter is specified to be NONE then the driver allocates cache
coherent memory for buffers and descriptors from the system pool. The 3C90x NIC is
a DMA type of device and typically shares access to some region of memory with the
CPU. This driver is designed for systems that directly share memory between the CPU
and the NIC. It assumes that this shared memory is directly available to it without any
arbitration or timing concerns.
memSize
This parameter can be used to explicitly limit the amount of shared memory (bytes) this
driver will use. The constant NONE can be used to indicate no specific size limitation.
This parameter is used only if a specific memory region is provided to the driver.
33
VxWorks Drivers API Reference, 6.6
el3c90xEnd
memWidth
Some target hardware that restricts the shared memory region to a specific location also
restricts the access width to this region by the CPU. On these targets, performing an
access of an invalid width will cause a bus error.
This parameter can be used to specify the number of bytes of access width to be used
by the driver during access to the shared memory. The constant NONE can be used to
indicate no restrictions.
Current internal support for this mechanism is not robust; implementation may not
work on all targets requiring these restrictions.
flags
This is parameter is used for future use, currently its value should be zero.
buffMultiplier
This parameter is used increase the number of buffers allocated in the driver pool. If
this parameter is -1 then a default multiplier of 2 is chosen. With a multiplier of 2 the
total number of clusters allocated is 64 which is twice the cumulative number of upload
and download descriptors. The device has 16 upload and 16 download descriptors. For
example on choosing the buffer multiplier of 3, the total number of clusters allocated
will be 96 ((16 + 16)*3). There are as many clBlks as the number of clusters. The number
of mBlks allocated are twice the number of clBlks. By default there are 64 clusters, 64
clBlks and 128 mBlks allocated in the pool for the device. Depending on the load of the
system increase the number of clusters allocated by incrementing the buffer multiplier.
34
1 Libraries
el3c90xEnd
SEE ALSO muxLib, endLib, netBufLib, VxWorks Device Driver Developer's Guide.
35
VxWorks Drivers API Reference, 6.6
elt3c509End
elt3c509End
NAME elt3c509End – END network interface driver for 3COM 3C509
DESCRIPTION This module implements the 3COM 3C509 EtherLink III 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 an input string consisting of several target-specific values. The driver also
requires some external support routines. These target-specific values and the external
support routines are described below.
EXTERNAL INTERFACE
The only external interface is the elt3c509Load( ) routine, which expects the initString
parameter as input. This parameter passes in a colon-delimited string of the format:
unit:port:intVector:intLevel:attachementType:nRxFrames
The elt3c509Load( ) function uses strtok( ) to parse the string.
TARGET-SPECIFIC PARAMETERS
unit
A convenient holdover from the former model. This parameter is used only in the
string name for the driver.
intVector
Configures the ELT device to generate hardware interrupts for various events within
the device. Thus, it contains an interrupt handler routine. The driver calls intConnect( )
to connect its interrupt handler to the interrupt vector generated as a result of the ELT
interrupt.
intLevel
This parameter is passed to an external support routine, sysEltIntEnable( ), which is
described below in "External Support Requirements." This routine is called during as
part of driver's initialization. It handles any board-specific operations required to
allow the servicing of a ELT interrupt on targets that use additional interrupt controller
devices to help organize and service the various interrupt sources. This parameter
makes it possible for this driver to avoid all board-specific knowledge of such devices.
attachmentType
This parameter is used to select the transceiver hardware attachment. This is then used
by the elt3c509BoardInit( ) routine to activate the selected attachment.
elt3c509BoardInit( ) is called as a part of the driver's initialization.
36
1 Libraries
elt3c509End
nRxFrames
1
This parameter is used as number of receive frames by the driver.
sysEltIntEnable(pDrvCtrl->intLevel)
sysEltIntDisable(pDrvCtrl->intLevel)
There are default values in the source code for these macros. They presume IO-mapped
accesses to the device registers and the normal intConnect( ), and intEnable( ) BSP
functions. The first argument to each is the device controller structure. Thus, each has access
back to all the device-specific information. Having the pointer in the macro facilitates the
addition of new features to this driver.
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. It calls an external board level routine sysEltIntEnable( ).
The macro SYS_INT_DISABLE is used to disable the interrupt level for the end device. It is
called during stop. It calls an external board level routine sysEltIntDisable( ).
37
VxWorks Drivers API Reference, 6.6
endLib
The driver requires 1520 bytes of preallocation for Transmit Buffer and 1520*nRxFrames of
receive buffers. The default value of nRxFrames is 64 therefore total pre-allocation is (64 +
1)*1520.
TUNING HINTS nRxFrames parameter can be used for tuning no of receive frames to be used for handling
packet receive. More no. of these could help receiving more loaning in case of massive
reception.
endLib
NAME endLib – support library for END-based drivers
DESCRIPTION This library contains support routines for Enhanced Network Drivers. These routines are
common to ALL ENDs. Specialized routines should only appear in the drivers themselves.
To use this feature, include the following component: INCLUDE_END
INCLUDE FILES
38
1 Libraries
evbNs16550Sio
erfLib 1
DESCRIPTION This module provides an Event Reporting Framework for use by other libraries.
INCLUDE FILES erfLib.h erfLibP.h vxWorks.h errnoLib.h semLib.h , spinLockLib.h stdio.h stdlib.h
string.h taskLib.h
erfShow
NAME erfShow – Event Reporting Framework Library Show routines
DESCRIPTION This module provides a Show routine for the an Event Reporting Framework.
evbNs16550Sio
NAME evbNs16550Sio – NS16550 serial driver for the IBM PPC403GA evaluation
39
VxWorks Drivers API Reference, 6.6
fei82557End
DESCRIPTION This is the driver for the National NS 16550 UART Chip used on the IBM PPC403GA
evaluation board. It uses the SCCs in asynchronous mode only.
USAGE An EVBNS16550_CHAN structure is used to describe the chip. The BSP's sysHwInit( )
routine typically calls sysSerialHwInit( ) which initializes all the register values in the
EVBNS16550_CHAN structure (except the SIO_DRV_FUNCS) before calling
evbNs16550HrdInit( ). The BSP's sysHwInit2( ) routine typically calls sysSerialHwInit2( )
which connects the chip interrupt handler evbNs16550Int( ) via intConnect( ).
IOCTL FUNCTIONS
This driver responds to the same ioctl( ) codes as other serial drivers; for more information,
see sioLib.h.
fei82557End
NAME fei82557End – END style Intel 82557 Ethernet network interface driver
DESCRIPTION This module implements an Intel 82557 and 82559 Ethernet network interface driver. (For
the sake of brevity this document will only refer to the 82557.) This is a fast Ethernet PCI bus
controller, IEEE 802.3 10Base-T and 100Base-T compatible. It also features a glueless 32-bit
PCI bus master interface, fully compliant with PCI Spec version 2.1. An interface to MII
compliant physical layer devices is built-in to the card. The 82557 Ethernet PCI bus
controller also includes Flash support up to 1 MByte and EEPROM support, although these
features are not dealt with in this driver.
The 82557 establishes a shared memory communication system with the CPU, which is
divided into three parts: the Control/Status Registers (CSR), the Command Block List (CBL)
and the Receive Frame Area (RFA). The CSR is on chip and is either accessible with I/O or
memory cycles, whereas the other structures reside on the host.
The CSR is the main means of communication between the device and the host, meaning
that the host issues commands through these registers while the chip posts status changes
40
1 Libraries
fei82557End
in it, occurred as a result of those commands. Pointers to both the CBL and RFA are also
1
stored in the CSR.
The CBL consists of a linked list of frame descriptors through which individual action
commands can be performed. These may be transmit commands as well as non-transmit
commands, e.g. Configure or Multicast setup commands. While the CBL list may function
in two different modes, only the simplified memory mode is implemented in the driver.
The RFA consists of a pair of linked list rings, the Receive Frame Descriptor (RFD) ring and
the Receive Buffer Descriptor (RBD) ring. The RFDs hold the status of completed DMAs.
The RBDs hold the pointers to the DMA buffers, referred to as clusters.
When the device is initialized or restarted it is passed a pointer to an RFD. This RFD is
considered to be the "first" RFD. This RFD holds a pointer to one of the RBDs. This RBD is
then considered the "first" RBD. All other RFDs only have a NULL RBD pointer, actually
0xffffffff. Once the device is started the rings are traversed by the device independently.
Either descriptor type RFD or RBD can have a bit set in it to indicate that it is the End of the
List (EL). This is initially set in the RBD descriptor immediately before the first RBD. This
acts as a stop which prevents the DMA engine from wrapping around the ring and
encountering a used descriptor. This is an unallowable condition and results in the device
stopping operation without an interrupt or and indication of failure. When the EL RBD is
encountered the device goes into the receive stall state. The driver must then restart the
device. To reduce, if not eliminate, the occurrence of this costly, time consuming operation,
the driver continually advances the EL to the last cleared RBD. Then when the driver
services an incoming frame it clears the RFD RBD pair and advances the EL. If the driver is
not able to service an incoming frame, because of a shortage of resources such as clusters,
the driver will throw that frame away and clear the RFD RBD pair and advance EL.
Because the rings are independently traversed by the device it is imperative that they be
kept in sync. Unfortunately, there is no indication from one or the other as to which
descriptor it is pared with. It is left to the driver to keep track of which descriptor goes with
its counter part. If this synchronization is lost then the performance of the driver will be
greatly impaired or worse. To keep this synchronization this driver embeds the RBD
descriptors in tags. To do this it utilizes memory that would otherwise have been wasted.
The DMA engine purportedly works most efficiently when the descriptors are on a 32 byte
boundary. The descriptors are only 16 bytes so there are 16 bytes to work with. The
RBD_TAG s have as their first 16 bytes the RBD itself, then it holds the RFD pointer to its
counter part, a pointer to itself, a 16 bit index, a 16 bit next index, and 4 bytes of spare. This
arrangement allows the driver to traverse only the RBD ring and discover the
corresponding RFD through the RBD_TAG and guaranteeing synchronization.
The driver is designed to be moderately generic, operating unmodified across the range of
architectures and targets supported by VxWorks. To achieve this, this driver must be given
several target-specific parameters, and some external support routines must be provided.
These parameters, and the mechanisms used to communicate them to the driver, are
detailed below.
41
VxWorks Drivers API Reference, 6.6
fei82557End
EXTERNAL INTERFACE
The driver provides the standard external interface, fei82557EndLoad( ), which takes a
string of colon separated parameters. The parameters should be specified in hexadecimal,
optionally preceded 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:
"memBase:memSize:nTfds:nRfds:flags:offset:maxRxFrames: clToRfdRatio:nClusters"
In addition, the two global variables feiEndIntConnect and feiEndIntDisconnect specify
respectively the interrupt connect routine and the interrupt disconnect routine to be used
depending on the BSP. The former defaults to intConnect( ) and the user can override this
to use any other interrupt connect routine (say pciIntConnect( )) in sysHwInit( ) or any
device specific initialization routine called in sysHwInit( ). Likewise, the latter is set by
default to NULL, but it may be overridden in the BSP in the same way.
TARGET-SPECIFIC PARAMETERS
memBase
This parameter is passed to the driver via fei82557EndLoad( ).
The Intel 82557 device is a DMA-type device and typically shares access to some region
of memory with the CPU. This driver is designed for systems that directly share
memory between the CPU and the 82557.
This parameter can be used to specify an explicit memory region for use by the 82557.
This should be done on targets that restrict the 82557 to a particular memory region.
Since use of this parameter indicates that the device has limited access to this specific
memory region all buffers and descriptors directly accessed by the device (RFDs,
RBDs, CFDs, and clusters) must be carved from this region. Since the transmit buffers
must reside in this region the driver will revert to using simple mode buffering for
transmit meaning that zero copy transmit is not supported. This then requires that
there be enough space for clusters to be attached to the CFDs. The minimum memory
requirement is for 32 bytes for all descriptors plus at lease two 1536 byte clusters for
each RFD and one 1536 byte cluster for each CFD. Also, it should be noted that this
memory must be non-cached.
The constant NONE can be used to indicate that there are no memory limitations, in
which case the driver will allocate cache aligned memory for its use using memalign( ).
memSize
The memory size parameter specifies the size of the pre-allocated memory region. If
memory base is specified as NONE (-1), the driver ignores this parameter. Otherwise,
the driver checks the size of the provided memory region is adequate with respect to
the given number of descriptors and clusters specified. The amount of memory
42
1 Libraries
fei82557End
allocated must be enough to hold the RFDs, RBDs, CFDs and clusters. The minimum
1
memory requirement is for 32 bytes each for all descriptors, 32 bytes each for alignment
of the descriptor types (RFDs, RBDs, and CFDs), plus at least two 1536 byte clusters
for each RFD and one 1536 byte cluster for each CFD. Otherwise the End Load routine
will return ERROR. The number of clusters can be specified by either passing a value
in the nCluster parameter, in which case the nCluster value must be at least nRFDs * 2,
or by setting the cluster to RFD ratio (clToRfdRatio) to a number equal or greater than
2.
nTfds
This parameter specifies the number of transmit descriptor/buffers to be allocated. If
this parameter is less than two, a default of 64 is used.
nRfds
This parameter specifies the number of receive descriptors to be allocated. If this
parameter is less than two, a default of 128 is used.
flags
User flags may control the run-time characteristics of the Ethernet chip. Not
implemented.
offset
Offset used to align IP header on word boundary for CPUs that need long word aligned
access to the IP packet (this will normally be zero or two). This parameter is optional,
the default value is zero.
deviceId
This parameter is used to indicate the specific type of device being used, the 82557 or
subsequent. This is used to determine if features which were introduced after the
82557 can be used. The default is the 82557. If this is set to any value other than ZERO
(0), NONE (-1), or FEI82557_DEVICE_ID (0x1229) it is assumed that the device will
support features not in the 82557.
maxRxFrames
This parameter limits the number of frames the receive handler will service in one pass.
It is intended to prevent the tNetTask from hogging the CPU and starving applications.
This parameter is optional, the default value is nRFDs * 2.
clToRfdRatio
Cluster To RFD Ratio sets the number of clusters as a ratio of nRFDs. The minimum
setting for this parameter is 2. This parameter is optional, the default value is 5.
nClusters
Number of clusters to allocate. This value must be at least nRFD * 2. If this value is set
then the clToRfdRatio is ignored. This parameter is optional, the default is nRFDs *
clToRfdRatio.
43
VxWorks Drivers API Reference, 6.6
fei82557End
ALIGNMENT Some architectures do not support unaligned access to 32-bit data items. On these
architectures (eg ARM and MIPs), it will be necessary to adjust the offset parameter in the
load string to realign the packet. Failure to do so will result in received packets being
absorbed by the network stack, although transmit functions should work OK. Also, some
architectures do not support SNOOPING, for these architectures the utilities FLUSH and
INVALIDATE are used for cache coherency of DMA buffers (clusters). These utilities
depend on the buffers being cache line aligned and being cache line multiple. Therefore, if
memory for these buffers is pre-allocated then it is imperative that this memory be cache
line aligned and being cache line multiple.
44
1 Libraries
gei82543End
SEE ALSO ifLib, Intel 82557 User's Manual, Intel 32-bit Local Area Network (LAN) Component User's
Manual 1
g64120aMf
NAME g64120aMf – VxBus driver for galileo 64120a system controller
DESCRIPTION This is the VxBus driver for the Galileo 64120a system controller.
Note that this is a multi-function device. Therefore, this driver manages the subordinate
functions. However, each subordinate function has its own driver. So, for example, the PCI
controller on the 64120a has a driver called g64120aPci.
g64120aPci
NAME g64120aPci – VxBus Galileo 64120A PCI bus controller driver
DESCRIPTION This module provides VxBus driver support for the PCI bridge in the Marvell/Galileo
GT64120A system controller. This bridge is used most frequently on MIPS Malta boards.
This driver support for PCI memory mapped and I/O mapped register access, PCI
configuration access and PCI bus-master DMA.
gei82543End
NAME gei82543End – Intel 82540/82541/82543/82544/82545/82546/ MAC driver
45
VxWorks Drivers API Reference, 6.6
gei82543End
DESCRIPTION The gei82543End driver supports Intel PRO1000 T/F/XF/XT/MT/MF adaptors These
adaptors use Intel 82543GC/82544GC/EI/82540/82541/82545/82546EB/ Gigabit Ethernet
controllers.The 8254x are highly integrated, high-performance LAN controllers for
1000/100/10Mb/s transfer rates. They provide 32/64 bit 33/66Mhz interfaces to the PCI
bus with 32/64 bit addressing and are fully compliant with PCI bus specification version
2.2. The 82544, 82545 and 82546 also provide PCI-X interface.
The 8254x controllers implement all IEEE 802.3 receive and transmit MAC functions. They
provide a Ten-Bit Interface (TBI) as specified in the IEEE 802.3z standard for 1000Mb/s
full-duplex operation with 1.25 GHz Ethernet transceivers (SERDES), as well as a GMII
interface as specified in IEEE 802.3ab for 10/100/1000 BASE-T transceivers, and also an MII
interface as specified in IEEE 802.3u for 10/100 BASE-T transceivers.
The 8254x controllers offer auto-negotiation capability for TBI and GMII/MII modes and
also support IEEE 802.3x compliant flow control. This driver supports the checksum offload
features of the 8254x family as follows:
--- Chip --- ---- TX offload capabilities ---- ---- RX offload capabilities
82543 TCP/IPv4, UDP/IPv4, IPv4 TCP/IPv4, UDP/IPv4
82544 TCP/IPv4, UDP/IPv4, IPv4 TCP/IPv4, UDP/IPv4, IPv4
8254[5601] TCP/IPv4, UDP/IPv4, IPv4 TCP/IPv4, UDP/IPv4, IPv4
TCP/IPv6, UDP/IPv6 TCP/IPv6, UDP/IPv6
For the 82540/82541/82545/82546, the driver supports the transport checksum over IPv6
on receive via the packet checksum feature. (The RX IPv6 checksum offload apparently does
not function on these chips as documented.) To avoid doing additional work massaging the
packet checksum value when the received packets might not be destined for this target,
receive checksum offload of TCP or UDP over IPv6 is attempted only when the IPv6 header
follows immediately after a 14-byte ethernet header, there are no IPv6 extension headers,
and there is no excess padding after the end of the IPv6 payload.
Although these devices also support other features such as jumbo frames, and provide flash
support up to 512KB and EEPROM support, this driver does NOT support these features.
The 8254x establishes a shared memory communication system with the CPU, which is
divided into two parts: the control/status registers and the receive/transmit
descriptors/buffers. The control/status registers are on the 8254x chips and are only
accessible with PCI or PCI-X memory cycles, whereas the other structures reside on the
46
1 Libraries
gei82543End
host. The buffer size can be programmed between 256 bytes to 16k bytes. This driver uses
1
the receive buffer size of 2048 bytes for an MTU of 1500.
The Intel PRO/1000 F/XF/MF adapters only implement the TBI mode of the 8254x
controller with built-in SERDESs in the adaptors.
The Intel PRO/1000 T adapters based on 82543GC implement the GMII mode with a
Gigabit Ethernet Transceiver (PHY) of MARVELL's Alaska 88E1000/88E1000S. However,
the PRO/1000 XT/MT adapters based on 82540/82544/82545/82546 use the built-in PHY
in controllers.
The driver on the current release supports both GMII mode for Intel PRO1000T/XT/MT
adapters and TBI mode for Intel PRO1000 F/XF/MF adapters. However, it requires the
target-specific initialization code -- sys543BoardInit () -- to distinguish these kinds of
adapters by PCI device IDs.
EXTERNAL INTERFACE
The driver provides the standard external interface, gei82543EndLoad( ), which takes a
string of colon separated parameters. The parameter string is parsed using strtok_r( ) and
each parameter in converted from a string representation to a binary.
The format of the parameter string is:
"memBase:memSize:nRxDes:nTxDes:flags:offset:mtu"
TARGET-SPECIFIC PARAMETERS
memBase
This parameter is passed to the driver via gei82543EndLoad( ).
The 8254x is a DMA-type device and typically shares access to some region of memory
with the CPU. This driver is designed for systems that directly share memory between
the CPU and the 8254x.
This parameter can be used to specify an explicit memory region for use by the 8254x
chip. This should be done on targets that restrict the 8254x to a particular memory
region. The constant NONE can be used to indicate that there are such memory, in
which case the driver will allocate cache safe memory for its use using
cacheDmaAlloc( ).
memSize
The memory size parameter specifies the size of the pre-allocated memory region. The
driver checks the size of the provided memory region is adequate with respect to the
given number of transmit Descriptor and Receive Descriptor.
nRxDes
This parameter specifies the number of transmit descriptors to be allocated. If this
number is 0, a default value of 24 will be used.
47
VxWorks Drivers API Reference, 6.6
gei82543End
nTxDes
This parameter specifies the number of receive descriptors to be allocated. If this
parameter is 0, a default of 24 is used.
flags
This parameter is provided for user to customize this device driver for their
application.
GEI_END_SET_TIMER (0x01): a timer will be started to constantly free back the loaned
transmit mBlks.
GEI_END_SET_RX_PRIORITY (0x02): packet transfer (receive) from device to host
memory will have higher priority than the packet transfer (transmit) from host memory
to device in the PCI bus. For end-station application, it is suggested to set this priority
in favor of receive operation to avoid receive overrun. However, for routing
applications, it is not necessary to use this priority. This option is only for 82543-based
adapters.
GEI_END_FREE_RESOURCE_DELAY (0x04): when transmitting larger packets, the
driver will hold mblks(s) from the network stack and return them after the driver has
completed transmitting the packet, and either the timer has expired or there are no
more available descriptors. If this option is not used, the driver will free mblk(s) when
ever the packet transmission is done. This option will place greater demands on the
network pool and should only be used in systems which have sufficient memory to
allocate a large network pool. It is not advised for the memory-limited target systems.
GEI_END_TBI_COMPATIBILITY (0x200): if this driver enables the workaround for TBI
compatibility HW bugs (#define INCLUDE_TBI_COMPATIBLE), user can set this bit to
enable a software workaround for the well-known TBI compatibility HW bug in the
Intel PRO1000 T adapter. This bug is only occurred in the copper-and-82543-based
adapter, and the link partner has advertised only 1000Base-T capability.
GEI_END_USER_MEM_FOR_DESC_ONLY (0x400): User can provide memory for this
driver through the shMemBase and shMemSize in the load string. By default, this
memory is used for TX/RX descriptors and RX buffer. However, if this flag is set, that
memory will be only used for TX/RX descriptors, and the driver will malloc other
memory for RX buffers and maintain cache coherency for RX buffers. It is user's
responsibility to maintain the cache coherence for memory they provided.
GEI_END_FORCE_FLUSH_CACHE: Set this flag to force flushing the data cache for
transmit data buffers even when bus snooping is enabled on the target.
GEI_END_FORCE_INVALIDATE_CACHE: Set this flag to force invalidating the data
cache for receive data buffers even when bus snooping is enabled on the target.
offset
This parameter is provided for the architectures which need DWORD (4 byte)
alignment of the IP header. In that case, the value of OFFSET should be two, otherwise,
the default value is zero.
48
1 Libraries
gei82543End
49
VxWorks Drivers API Reference, 6.6
hwConfig
reduce this effect is to carefully adjust application tasks' priorities and possibly increase
number of receive clusters.
Callback functions defined in the sysGei82543End.c can be used to dynamically and/or
statically change the internal timer registers such as ITR, RADV, and RDTR to reduce RX
interrupt rate.
hwConfig
NAME hwConfig – vxBus resource library
DESCRIPTION This library contains the functions which handle the vxBus hardware resources.
hwMemLib
NAME hwMemLib – hardware memory allocation library
50
1 Libraries
iOlicomEnd
i8250Sio
NAME i8250Sio – I8250 serial driver
DESCRIPTION This is the driver for the Intel 8250 UART Chip used on the PC 386. It uses the SCCs in
asynchronous mode only.
USAGE An I8250_CHAN structure is used to describe the chip. The BSP's sysHwInit( ) routine
typically calls sysSerialHwInit( ) which initializes all the register values in the
I8250_CHAN structure (except the SIO_DRV_FUNCS) before calling i8250HrdInit( ). The
BSP's sysHwInit2( ) routine typically calls sysSerialHwInit2( ) which connects the chips
interrupt handler (i8250Int) via intConnect( ).
IOCTL FUNCTIONS
This driver responds to all the same ioctl( ) codes as a normal serial driver; for more
information, see the comments in sioLib.h. As initialized, the available baud rates are 110,
300, 600, 1200, 2400, 4800, 9600, 19200, and 38400.
This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the handshakes RTS/CTS. The
function HUPCL(hang up on last close) is available.
iOlicomEnd
NAME iOlicomEnd – END style Intel Olicom PCMCIA network interface driver
BOARD LAYOUT The device resides on a PCMCIA card and is soft configured. No jumpering diagram is
necessary.
51
VxWorks Drivers API Reference, 6.6
iOlicomEnd
EXTERNAL INTERFACE
This driver provides the END external interface with the following exceptions. The only
external interface is the iOlicomEndLoad( ) routine. All of the parameters are passed as
strings in a colon (:) separated list to the load function as an initString. The
iOlicomEndLoad( ) function uses strtok( ) to parse the string.
The string contains the target specific parameters like this:
"io_baseA:attr_baseA:mem_baseA:io_baseB:attr_baseB:mem_baseB: \
ctrl_base:intVectA:intLevelA:intVectB:intLevelB: \
txBdNum:rxBdNum:pShMem:shMemSize"
TARGET-SPECIFIC PARAMETERS
I/O base address A
This is the first parameter passed to the driver init string. This parameter indicates the
base address of the PCMCIA I/O space for socket A.
Attribute base address A
This is the second parameter passed to the driver init string. This parameter indicates
the base address of the PCMCIA attribute space for socket A. On the PID board, this
should be the offset of the beginning of the attribute space from the beginning of the
memory space.
Memory base address A
This is the third parameter passed to the driver init string. This parameter indicates the
base address of the PCMCIA memory space for socket A.
I/O base address B
This is the fourth parameter passed to the driver init string. This parameter indicates
the base address of the PCMCIA I/O space for socket B.
Attribute base address B
This is the fifth parameter passed to the driver init string. This parameter indicates the
base address of the PCMCIA attribute space for socket B. On the PID board, this should
be the offset of the beginning of the attribute space from the beginning of the memory
space.
Memory base address B
This is the sixth parameter passed to the driver init string. This parameter indicates the
base address of the PCMCIA memory space for socket B.
PCMCIA controller base address
This is the seventh parameter passed to the driver init string. This parameter indicates
the base address of the Vadem PCMCIA controller.
interrupt vectors and levels
These are the eighth, ninth, tenth and eleventh parameters passed to the driver init
string.
52
1 Libraries
iOlicomEnd
The mapping of IRQs generated at the Card/PCMCIA level to interrupt levels and
1
vectors is system dependent. Furthermore the slot holding the PCMCIA card is not
initially known. The interrupt levels and vectors for both socket A and socket B must
be passed to iOlicomEndLoad( ), allowing the driver to select the required parameters
later.
number of transmit and receive buffer descriptors
These are the twelfth and thirteenth parameters passed to the driver init string.
The number of transmit and receive buffer descriptors (BDs) used is configurable by the
user upon attaching the driver. There must be a minimum of two transmit and two
receive BDs, and there is a maximum of twenty transmit and twenty receive BDs. If this
parameter is "NULL" a default value of 16 BDs will be used.
offset
This is the fourteenth parameter passed to the driver in the init string.
This parameter defines the offset which is used to solve alignment problem.
base address of buffer pool
This is the fifteenth parameter passed to the driver in the init string.
This parameter is used to notify the driver that space for the transmit and receive
buffers need not be allocated, but should be taken from a private memory space
provided by the user at the given address. The user should be aware that memory used
for buffers must be 4-byte aligned but need not be non-cacheable. If this parameter is
"NONE", space for buffers will be obtained by calling malloc( ) in iOlicomEndLoad( ).
mem size of buffer pool
This is the sixteenth parameter passed to the driver in the init string.
The memory size parameter specifies the size of the pre-allocated memory region. If
memory base is specified as NONE (-1), the driver ignores this parameter.
Ethernet address
This parameter is obtained from the Card Information Structure on the Olicom
PCMCIA card.
53
VxWorks Drivers API Reference, 6.6
iPIIX4
void sysBusIntAck(void)
This routine acknowledge the interrupt if it's necessary.
SEE ALSO muxLib, endLib, Intel 82595TX ISA/PCMCIA High Integration Ethernet Controller User
Manual, Vadem VG-468 PC Card Socket Controller Data Manual.
iPIIX4
NAME iPIIX4 – low level initialization code for PCI ISA/IDE Xcelerator
DESCRIPTION The 82371AB PCI ISA IDE Xcelerator (PIIX4) is a multi-function PCI device implementing a
PCI-to-ISA bridge function, a PCI IDE function, a Universal Serial Bus host/hub function,
and an Enhanced Power Management function. As a PCI-to-ISA bridge, PIIX4 integrates
many common I/O functions found in ISA-based PC systems-two 82C37 DMA Controllers,
two 82C59 Interrupt Controllers, an 82C54 Timer/Counter, and a Real Time Clock. In
addition to compatible transfers, each DMA channel supports Type F transfers. PIIX4 also
contains full support for both PC/PCI and Distributed DMA protocols implementing
PCI-based DMA. The Interrupt Controller has Edge or Level sensitive programmable inputs
and fully supports the use of an external I/O Advanced Programmable Interrupt Controller
(APIC) and Serial Interrupts. Chip select decoding is provided for BIOS, Real Time Clock,
Keyboard Controller, second external microcontroller, as well as two Programmable Chip
Selects.
PIIX4 is a multi-function PCI device that integrates many system-level functions. PIIX4 is
compatible with the PCI Rev 2.1 specification, as well as the IEEE 996 specification for the
ISA (AT) bus.
PCI to ISA/EIO Bridge
PIIX4 can be configured for a full ISA bus or a subset of the ISA bus called the Extended
IO (EIO) bus. The use of the EIO bus allows unused signals to be configured as general
purpose inputs and outputs. PIIX4 can directly drive up to five ISA slots without
external data or address buffering. It also provides byte-swap logic, I/O recovery
support, wait-state generation, and SYSCLK generation. X-Bus chip selects are
provided for Keyboard Controller, BIOS, Real Time Clock, a second microcontroller, as
54
1 Libraries
iPIIX4
well as two programmable chip selects. PIIX4 can be configured as either a subtractive
1
decode PCI to ISA bridge or as a positive decode bridge. This gives a system designer
the option of placing another subtractive decode bridge in the system (e.g., an Intel
380FB Dock Set).
IDE Interface (Bus Master capability and synchronous DMA Mode)
The fast IDE interface supports up to four IDE devices providing an interface for IDE
hard disks and CD ROMs. Each IDE device can have independent timings. The IDE
interface supports PIO IDE transfers up to 14 Mbytes/sec and Bus Master IDE transfers
up to 33 Mbytes/sec. It does not consume any ISA DMA resources. The IDE interface
integrates 16x32-bit buffers for optimal transfers.
PIIX4's IDE system contains two independent IDE signal channels. They can be
configured to the standard primary and secondary channels (four devices) or primary
drive 0 and primary drive 1 channels (two devices).This allows flexibility in system
design and device power management.
Compatibility Modules
The DMA controller incorporates the logic of two 82C37 DMA controllers, with seven
independently programmable channels. Channels [0:3] are hardwired to 8-bit,
count-by-byte transfers, and channels [5:7] are hardwired to 16-bit, count-by-word
transfers. Any two of the seven DMA channels can be programmed to support fast
Type-F transfers. The DMA controller also generates the ISA refresh cycles.
The DMA controller supports two separate methods for handling legacy DMA via the
PCI bus. The PC/PCI protocol allows PCI-based peripherals to initiate DMA cycles by
encoding requests and grants via three PC/PCI REQ#/GNT# pairs. The second
method, Distributed DMA, allows reads and writes to 82C37 registers to be distributed
to other PCI devices. The two methods can be enabled concurrently. The serial
interrupt scheme typically associated with Distributed DMA is also supported.
The timer/counter block contains three counters that are equivalent in function to those
found in one 82C54 programmable interval timer. These three counters are combined
to provide the system timer function, refresh request, and speaker tone. The
14.31818-MHz oscillator input provides the clock source for these three counters.
PIIX4 provides an ISA-Compatible interrupt controller that incorporates the
functionality of two 82C59 interrupt controllers. The two interrupt controllers are
cascaded so that 14 external and two internal interrupts are possible. In addition, PIIX4
supports a serial interrupt scheme. PIIX4 provides full support for the use of an external
IO APIC.
Enhanced Universal Serial Bus (USB) Controller
The PIIX4 USB controller provides enhanced support for the Universal Host Controller
Interface (UHCI). This includes support that allows legacy software to use a USB-based
keyboard and mouse.
55
VxWorks Drivers API Reference, 6.6
iPIIX4
RTC
PIIX4 contains a Motorola MC146818A-compatible real-time clock with 256 bytes of
battery-backed RAM. The real-time clock performs two key functions: keeping track of
the time of day and storing system data, even when the system is powered down. The
RTC operates on a 32.768-kHz crystal and a separate 3V lithium battery that provides
up to 7 years of protection.
The RTC also supports two lockable memory ranges. By setting bits in the
configuration space, two 8-byte ranges can be locked to read and write accesses. This
prevents unauthorized reading of passwords or other system security information. The
RTC also supports a date alarm, that allows for scheduling a wake up event up to 30
days in advance, rather than just 24 hours in advance.
GPIO and Chip Selects
Various general purpose inputs and outputs are provided for custom system design.
The number of inputs and outputs varies depending on PIIX4 configuration. Two
programmable chip selects are provided which allows the designer to place devices on
the X-Bus without the need for external decode logic.
Pentium and Pentium II Processor Interface
The PIIX4 CPU interface allows connection to all Pentium and Pentium II processors.
The Sleep mode for the Pentium II processors is also supported.
Enhanced Power Management
PIIX4's power management functions include enhanced clock control, local and global
monitoring support for 14 individual devices, and various low-power (suspend) states,
such as Power-On Suspend, Suspend-to-DRAM, and Suspend-to-Disk. A
hardware-based thermal management circuit permits software-independent entrance
to low-power states. PIIX4 has dedicated pins to monitor various external events (e.g.,
interfaces to a notebook lid, suspend/resume button, battery low indicators, etc.). PIIX4
contains full support for the Advanced Configuration and Power Interface (ACPI)
Specification.
System Management Bus (SMBus)
PIIX4 contains an SMBus Host interface that allows the CPU to communicate with
SMBus slaves and an SMBus Slave interface that allows external masters to activate
power management events.
Configurability
PIIX4 provides a wide range of system configuration options. This includes full 16-bit
I/O decode on internal modules, dynamic disable on all the internal modules, various
peripheral decode options, and many options on system configuration.
USAGE This library provides low level routines for PCI - ISA bridge initialization, and PCI
interrupts routing. There are many functions provided here for enabling different logical
devices existing on ISA bus.
The functions addressed here include:
56
1 Libraries
iPIIX4
- Creating a logical device using an instance of physical device on PCI bus and
1
initializing internal database accordingly.
- Initializing keyboard (logical device number 11) on PIIX4.
- Initializing floppy disk drive (logical device number 5) on PIIX4.
- Initializing ATA device (IDE interface) on PIIX4.
- Route PIRQ[A:D] from PCI expansion slots on given PIIX4.
- Get interrupt level for a given device on PCI expansion slot.
57
VxWorks Drivers API Reference, 6.6
isrDeferLib
isrDeferLib
NAME isrDeferLib – ISR deferral library
DESCRIPTION This module is used by interrupt service routines to defer interrupt processing from
interrupt context to task context. Device drivers use this library by allocating a deferral
task, and then enqueueing work on the task's work queue. This library is designed to work
with VxBus-compliant device drivers.
This module operates in two distinct modes depending on the module's configuration. If
the mode is configured for "per-CPU" deferral tasks, this module creates (as needed) a single
deferral task on each CPU in the system. This single queue handles all deferral operations
performed by device drivers that are servicing their interrupts on that CPU.
If the mode is configured for "per-ISR" deferral tasks, this module creates a unique deferral
task for each requester, and sets the CPU affinity for the created task to the requested CPU
index.
Device drivers call isrDeferQueueGet to gain access to a (possibly shared) deferral task. To
enqueue work onto the deferral task, a device driver's interrupt service routine initializes
the data fields of an ISR_DEFER_JOB structure, and then calls isrDeferJobAdd. It is the
responsibilty of the driver to ensure that any deferred work enqueued by the driver has
been completed before reusing the ISR_DEFER_JOB structure to enqueue additional work.
SMP-aware device drivers are informed by the VxBus subsystem when their interrupts have
been rorouted to a new CPU in the system. At this point, the driver can call
isrDeferIsrReroute to exchange its currently-held deferral queue for a new queue.
ixp400I2c
NAME ixp400I2c – Intel IXP400 I2C source file
58
1 Libraries
ixp400I2c
DESCRIPTION This is a driver for the Intel IXP400 I2C bus protocol. When the INCLUDE_I2C_HW_CTRL
BSP configuration constant is defined, the routines in this module support the IXP465 I2C
controller. Otherwise, this is a software only implementation which uses two pins on the
IXP400 GPIO Controller.
USAGE An example read from an I2C device using the individual protocol functions is shown
below:
...
{
if (OK == ixp400I2CStart ())
{
ixp400I2CByteTransmit ((devAddr & IXP400_I2C_WRITE_MSK));
ixp400I2CAckReceive();
ixp400I2CByteTransmit (offset);
ixp400I2CAckReceive();
IXP400_I2C_SCL_SET_HIGH;
IXP400_I2C_SDA_SET_HIGH;
if(ixp400I2CStart() != OK)
{
ixp400I2CStop ();
return ERROR;
}
ixp400I2CStop();
}
}
...
59
VxWorks Drivers API Reference, 6.6
ln97xEnd
ln97xEnd
NAME ln97xEnd – END style AMD Am79C97X PCnet-PCI Ethernet driver
DESCRIPTION This module implements the Advanced Micro Devices Am79C970A, Am79C971,
Am79C972, and Am79C973 PCnet-PCI Ethernet 32-bit network interface driver.
The PCnet-PCI ethernet controller is inherently little-endian because the chip is designed to
operate on a PCI bus which is a little-endian bus. The software interface to the driver is
divided into three parts. The first part is the PCI configuration registers and their set up.
This part is done at the BSP level in the various BSPs which use this driver. The second and
third part are dealt with in the driver. The second part of the interface is comprised of the
I/O control registers and their programming. The third part of the interface is comprised of
the descriptors and the buffers.
This driver is designed to be moderately generic, operating unmodified across the range of
architectures and targets supported by VxWorks. To achieve this, the driver must be given
several target-specific parameters, and some external support routines must be provided.
These target-specific values and the external support routines are described below.
This driver supports multiple units per CPU. The driver can be configured to support
big-endian or little-endian architectures. It contains error recovery code to handle known
device errata related to DMA activity.
Some big-endian processors may be connected to a PCI bus through a host/PCI bridge
which performs byte swapping during data phases. On such platforms, the PCnet-PCI
controller need not perform byte swapping during a DMA access to memory shared with
the host processor.
EXTERNAL INTERFACE
The driver provides one standard external interface, ln97xEndLoad( ). As input, this
routine takes a string of colon-separated parameters. The parameters should be specified in
hexadecimal (optionally preceded by 0x or a minus sign -). The parameter string is parsed
using strtok_r( ).
60
1 Libraries
ln97xEnd
TARGET-SPECIFIC PARAMETERS
1
The format of the parameter string is:
<unit:devMemAddr:devIoAddr:pciMemBase:vecNum:intLvl:
memAdrs:memSize:memWidth:csr3b:offset:flags>
unit
The unit number of the device. Unit numbers start at zero and increase for each device
controlled by the same driver. The driver does not use this value directly. The unit
number is passed through the MUX API where it is used to differentiate between
multiple instances of a particular driver.
devMemAddr
This parameter is the memory mapped I/O base address of the device registers in the
memory map of the CPU. The driver will locate device registers as offsets from this
base address.
The PCnet presents two registers to the external interface, the RDP (Register Data Port)
and RAP (Register Address Port) registers. This driver assumes that these two
registers occupy two unique addresses in a memory space that is directly accessible by
the CPU executing this driver. The driver assumes that the RDP register is mapped at
a lower address than the RAP register; the RDP register is therefore derived from the
"base address." This is a required parameter.
devIoAddr
This parameter specifies the I/O base address of the device registers in the I/O map of
some CPUs. It indicates to the driver where to find the RDP register. This parameter is
no longer used, but is retained so that the load string format will be compatible with
legacy initialization routines. The driver will always use memory mapped I/O registers
specified via the devMemAddr parameter.
pciMemBase
This parameter is the base address of the host processor memory as seen from the PCI
bus. This parameter is zero for most Intel architectures.
vecNum
This parameter is the vector associated with the device interrupt. This driver configures
the PCnet device to generate hardware interrupts for various events within the device;
thus it contains an interrupt handler routine. The driver calls pciIntConnect( ) to
connect its interrupt handler to the interrupt vector generated as a result of the PCnet
interrupt.
intLvl
Some targets use additional interrupt controller devices to help organize and service
the various interrupt sources. This driver avoids all board-specific knowledge of such
devices. During the driver's initialization, the external routine sysLan97xIntEnable( )
is called to perform any board-specific operations required to allow the servicing of a
PCnet interrupt. For a description of sysLan97xIntEnable( ), see "External Support
Requirements" below.
61
VxWorks Drivers API Reference, 6.6
ln97xEnd
memAdrs
This parameter gives the driver the memory address to carve out its buffers and data
structures. If this parameter is specified to be NONE then the driver allocates cache
coherent memory for buffers and descriptors from the system memory pool. The PCnet
device is a DMA type of device and typically shares access to some region of memory
with the CPU. This driver is designed for systems that directly share memory between
the CPU and the PCnet. It assumes that this shared memory is directly available to it
without any arbitration or timing concerns.
memSize
This parameter can be used to explicitly limit the amount of shared memory (bytes) this
driver will use. The constant NONE can be used to indicate no specific size limitation.
This parameter is used only if a specific memory region is provided to the driver.
memWidth
Some target hardware that restricts the shared memory region to a specific location also
restricts the access width to this region by the CPU. On these targets, performing an
access of an invalid width will cause a bus error.
This parameter can be used to specify the number of bytes of access width to be used
by the driver during access to the shared memory. The constant NONE can be used to
indicate no restrictions.
Current internal support for this mechanism is not robust; implementation may not
work on all targets requiring these restrictions.
csr3b
The PCnet-PCI Control and Status Register 3 (CSR3) controls, among other things,
big-endian and little-endian modes of operation. When big-endian mode is selected,
the PCnet-PCI controller will swap the order of bytes on the AD bus during a data
phase on access to the FIFOs only: AD[31:24] is byte 0, AD[23:16] is byte 1, AD[15:8] is
byte 2 and AD[7:0] is byte 3. In order to select the big-endian mode, set this parameter
to (0x0004). Most implementations, including natively big-endian host architectures,
should set this parameter to (0x0000) in order to select little-endian access to the FIFOs,
as the driver is currently designed to perform byte swapping as appropriate to the host
architecture.
offset
This parameter specifies a memory alignment offset. Normally this parameter is zero
except for architectures which can only access 32-bit words on 4-byte aligned address
boundaries. For these architectures the value of this offset should be 2.
flags
This is parameter is used for future use. Currently its value should be zero.
62
1 Libraries
ln97xEnd
below. To change the defaults, the BSP should create an appropriate routine and set the
1
function pointer before first use. This would normally be done within sysHwInit2( ).
Note that all of the pointers to externally defined functions must be set to a valid executable
code address. Also, note that sysLan97xIntEnable( ), sysLan97xIntDisable( ), and
sysLan97xEnetAddrGet( ) must be defined in the BSP. This was done so that the driver
would be compatible with initialization code and support routines in existing BSPs.
The function pointer convention has been introduced to facilitate future driver versions that
do not explicitly reference a named BSP-defined function. Among other things, this would
allow a BSP designer to define, for example, one endIntEnable( ) routine to support multple
END drivers.
ln97xIntConnect
IMPORT STATUS (* ln97xIntConnect)
(
VOIDFUNCPTR * vector, /* interrupt vector to attach to */
VOIDFUNCPTR routine, /* routine to be called */
int parameter /* parameter to be passed to routine */
);
/* default setting */
ln97xIntConnect = pciIntConnect;
The ln97xIntConnect pointer specifies a function used to connect the driver interrupt
handler to the appropriate vector. By default it is the pciIntLib routine pciIntConnect( ).
ln97xIntDisconnect
IMPORT STATUS (* ln97xIntDisconnect)
(
VOIDFUNCPTR * vector, /* interrupt vector to attach to */
VOIDFUNCPTR routine, /* routine to be called */
int parameter /* routine parameter */
);
/* default setting */
ln97xIntDisconnect = pciIntDisconnect2;
The ln97xIntDisconnect pointer specifies a function used to disconnect the interrupt
handler prior to unloading the driver. By default it is the pciIntLib routine
pciIntDisconnect2( ).
ln97xIntEnable
IMPORT STATUS (* ln97xIntEnable)
(
int level /* interrupt level to be enabled */
);
/* default setting */
ln97xIntEnable = sysLan97xIntEnable;
63
VxWorks Drivers API Reference, 6.6
ln97xEnd
The ln97xIntEnable pointer specifies a function used to enable the interrupt level for the
END device. It is called once during initialization. By default it is a BSP routine named
sysLan97xIntEnable( ). The implementation of this routine can vary between
architectures, and even between BSPs for a given architecture family. Generally, the
parameter to this routine will specify an interrupt level defined for an interrupt
controller on the host platform. For example, MIPS and PowerPC BSPs may implement
this routine by invoking the WRS intEnable( ) library routine. WRS Intel Pentium BSPs
may implement this routine via sysIntEnablePIC( ).
ln97xIntDisable
IMPORT STATUS (* ln97xIntDisable)
(
int level /* interrupt level to be disabled */
);
/* default setting */
ln97xIntDisable = sysLan97xIntDisable;
The ln97xIntDisable pointer specifies a function used to disable the interrupt level for
the END device. It is called during stop. By default it is a BSP routine named
sysLan97xIntDisable( ). The implementation of this routine can vary between
architectures, and even between BSPs for a given architecture family. Generally, the
parameter to this routine will specify an interrupt level defined for an interrupt
controller on the host platform. For example, MIPS and PowerPC BSPs may implement
this routine by invoking the WRS intDisable( ) library routine. WRS Intel Pentium
BSPs may implement this routine via sysIntDisablePIC( ).
ln97xEnetAddrGet
IMPORT STATUS (* ln97xEnetAddrGet)
(LN_97X_DRV_CTRL * pDrvCtrl, char * pStationAddr);
/* default setting */
ln97xEnetAddrGet = sysLan97xEnetAddrGet;
The ln97xEnetAddrGet pointer specifies a function used to get the Ethernet (IEEE
station) address of the device. By default it is a BSP routine named
sysLan97xEnetAddrGet( ).
64
1 Libraries
lptDrv
The driver allocates clusters of size 1520 bytes for receive frames and
1
transmit frames.
SEE ALSO muxLib, endLib, netBufLib, VxWorks Device Driver Developer's Guide, PCnet-PCI II
Single-Chip Full-Duplex Ethernet Controller for PCI Local Bus Product, PCnet-FAST Single-Chip
Full-Duplex 10/100 Mbps Ethernet Controller for PCI Local Bus Product
lptDrv
NAME lptDrv – parallel chip device driver for the IBM-PC LPT
DESCRIPTION This is the basic driver for the LPT used on the IBM-PC. If the component INCLUDE_LPT is
enabled, the driver initializes the LPT port on the PC.
USER-CALLABLE ROUTINES
Most of the routines in this driver are accessible only through the I/O system. However,
two routines must be called directly: lptDrv( ) to initialize the driver, and lptDevCreate( )
to create devices.
There are one other callable routines: lptShow( ) to show statistics. The argument to
lptShow( ) is a channel number, 0 to 2.
Before the driver can be used, it must be initialized by calling lptDrv( ). This routine should
be called exactly once, before any reads, writes, or calls to lptDevCreate( ). Normally, it is
called from usrRoot( ) in usrConfig.c. The first argument to lptDrv( ) is a number of
channels, 0 to 2. The second argument is a pointer to the resource table. Definitions of
members of the resource table structure are:
int ioBase; /* IO base address */
int intVector; /* interrupt vector */
int intLevel; /* interrupt level */
BOOL autofeed; /* TRUE if enable autofeed */
int busyWait; /* loop count for BUSY wait */
int strobeWait; /* loop count for STROBE wait */
int retryCnt; /* retry count */
int timeout; /* timeout second for syncSem */
65
VxWorks Drivers API Reference, 6.6
m8260SccEnd
IOCTL FUNCTIONS
This driver responds to two functions: LPT_SETCONTROL and LPT_GETSTATUS. The
argument for LPT_SETCONTROL is a value of the control register. The argument for
LPT_GETSTATUS is a integer pointer where a value of the status register is stored.
m8260SccEnd
NAME m8260SccEnd – END style Motorola MPC8260 network interface driver
EXTERNAL INTERFACE
This driver provides the standard END external interface. The only external interface is the
motSccEndLoad( ) routine. The parameters are passed into the motSccEndLoad( ) function
as a single colon-delimited string. The motSccEndLoad( ) function uses strtok( ) to parse the
string, which it expects to be of the following format:
unit:motCpmAddr:ivec:sccNum:txBdNum:rxBdNum: txBdBase: rxBdBase:bufBase
TARGET-SPECIFIC PARAMETERS
unit
A convenient holdover from the former model. This parameter is used only in the
string name for the driver.
motCpmAddr
Indicates the address at which the host processor presents its internal memory (also
known as the dual ported RAM base address). With this address, and the SCC number
(see below), the driver is able to compute the location of the SCC parameter RAM and
the SCC register map, and, ultimately, to program the SCC for proper operations. This
parameter should point to the internal memory of the processor where the SCC
physically resides. This location might not necessarily be the Dual-Port RAM of the
microprocessor configured as master on the target board.
ivec
This driver configures the host processor to generate hardware interrupts for various
events within the device. The interrupt-vector offset parameter is used to connect the
66
1 Libraries
m8260SccEnd
driver's ISR to the interrupt through a call to the VxWorks system function
1
intConnect( ).
sccNum
This driver is written to support multiple individual device units. Thus, the multiple
units supported by this driver can reside on different chips or on different SCCs within
a single host processor. This parameter is used to explicitly state which SCC is being
used (SCC1 is most commonly used, thus this parameter most often equals "1").
txBdNum and rxBdNum
Specify the number of transmit and receive buffer descriptors (BDs). Each buffer
descriptor resides in 8 bytes of the processor's dual-ported RAM space, and each one
points to a 1520 byte buffer in regular RAM. There must be a minimum of two transmit
and two receive BDs. There is no maximum, although more than a certain amount does
not speed up the driver and wastes valuable dual-ported RAM space. If any of these
parameters is "NULL", a default value of "32" BDs is used.
txBdBase and rxBdBase
Indicate the base location of the transmit and receive buffer descriptors (BDs). They are
offsets, in bytes, from the base address of the host processor's internal memory (see
above). Each BD takes up 8 bytes of dual-ported RAM, and it is the user's responsibility
to ensure that all specified BDs fit within dual-ported RAM. This includes any other
BDs the target board might be using, including other SCCs, SMCs, and the SPI device.
There is no default for these parameters. They must be provided by the user.
bufBase
Tells the driver that space for the transmit and receive buffers need not be allocated but
should be taken from a cache-coherent private memory space provided by the user at
the given address. The user should be aware that memory used for buffers must be
4-byte aligned and non-cacheable. All the buffers must fit in the given memory space.
No checking is performed. This includes all transmit and receive buffers (see above).
Each buffer is 1520 bytes. If this parameter is "NONE", space for buffers is obtained by
calling cacheDmaMalloc( ) in motSccEndLoad( ).
67
VxWorks Drivers API Reference, 6.6
m8260SccEnd
sysXxxEnetDisable( )
This is either sys360EnetDisable( ) or sysSccEnetDisable( ), based on the actual host
processor being used. See below for the actual prototypes. This routine is expected to handle
any target-specific functions required to disable the Ethernet controller. This usually
involves disabling the Transmit Enable (TENA) signal. This routine is expected to return
OK on success, or ERROR. The driver calls this routine from the motCpmEndStop( )
routine each time a unit is disabled.
sysXxxEnetAddrGet( )
This is either sys360EnetAddrGet( ) or sysSccEnetAddrGet( ), based on the actual host
processor being used. See below for the actual prototypes. The driver expects this routine to
provide the six-byte Ethernet hardware address that is used by this unit. This routine must
copy the six-byte address to the space provided by addr. This routine is expected to return
OK on success, or ERROR. The driver calls this routine, once per unit, from the
motSccEndLoad( ) routine.
In the case of the CPU32, the prototypes of the above mentioned support routines are as
follows:
STATUS sys360EnetEnable (int unit, UINT32 regBase)
void sys360EnetDisable (int unit, UINT32 regBase)
STATUS sys360EnetAddrGet (int unit, u_char * addr)
In the case of the PPC860, the prototypes of the above mentioned support routines are as
follows:
STATUS sysSccEnetEnable (int unit)
void sysSccEnetDisable (int unit)
STATUS sysSccEnetAddrGet (int unit, UINT8 * addr)
The data and BSS sections are quoted for the CPU32 architecture and could vary for other
architectures. The code size (text) varies greatly between architectures, and is therefore not
quoted here.
If the driver allocates the memory to share with the Ethernet device unit, it does so by calling
the cacheDmaMalloc( ) routine. For the default case of 32 transmit buffers, 32 receive
buffers, and 16 loaner buffers (this is not configurable), the total size requested is 121,600
bytes. If a non-cacheable memory region is provided by the user, the size of this region
should be this amount, unless the user has specified a different number of transmit or
receive BDs.
68
1 Libraries
m85xxRio
This driver can operate only if this memory region is non-cacheable or if the hardware
1
implements bus snooping. The driver cannot maintain cache coherency for the device
because the buffers are asynchronously modified by both the driver and the device, and
these fields might share the same cache line. Additionally, the chip's dual-ported RAM
must be declared as non-cacheable memory where applicable (for example, when attached
to a 68040 processor). For more information, see the Motorola MC68EN360 User's Manual ,
Motorola MPC860 User's Manual , Motorola MPC821 User's Manual Motorola MPC8260 User's
Manual
m85xxCpu
NAME m85xxCpu – device driver for remote Cpu on m85xx CPU with RapidIO
m85xxRio
NAME m85xxRio – RapidIO host controller in PowerPC 85XX CPU
DESCRIPTION This is the RAPIDIO driver to support configuration of the Serial RapidIO device on the
MPC8548 chip. It has been to to tested for configuring another agent serial rapidio 8548
device although may be developed to support other chips easily none were available for
testing.
This is a vxbus driver which needs specific configuration information provided by the board
support package. This is done via the hwconf.c file in the BSP. An example is below:
const struct hcfResource m85xxRio0Resources[] = {
{ "regBase", HCF_RES_INT, {(void *)RAPIDIO_BASE} },
69
VxWorks Drivers API Reference, 6.6
m85xxRio
70
1 Libraries
miiLib
mcf5475Pci
NAME mcf5475Pci – PCI host controller in Coldfire mcf5475/85 CPU
DESCRIPTION This module provides VxBus driver support for the PCI bridge in the coldfire onchip system
controller. This driver support for PCI memory mapped and I/O mapped register access,
PCI configuration access.
miiLib
NAME miiLib – Media Independent Interface library
71
VxWorks Drivers API Reference, 6.6
miiLib
72
1 Libraries
motFcc2End
granularity of the delay itself, whereas the field phyMaxDelay in PHY_INFO is the
1
maximum allowed delay, in phyDelayParm units. The minimum elapsed time
(phyMaxDelay * phyDelayParm) must be 5 seconds.
The user should be aware that some of these events may take as long as 2-3 seconds to
be completed, and he should therefore tune this routine and the parameter
phyMaxDelay accordingly.
If the related field phyDelayRtn in the PHY_INFO structure is initialized to NULL, no
delay is performed.
phyLinkDownRtn
STATUS phyLinkDownRtn (DRV_CTRL *);
This routine is expected to take any action necessary to re-initialize the media interface,
including possibly stopping and restarting the driver itself. It is called when a link
down event is detected for any active PHY, with the pointer to the relevant driver
control structure as only parameter.
To use this feature, include the following component: INCLUDE_MIILIB
motFcc2End
NAME motFcc2End – Second Generation Motorola FCC Ethernet network interface.
DESCRIPTION This module implements a Motorola Fast Communication Controller (FCC) Ethernet
network interface driver. This is a second generation driver that is based on the original
motFccEnd.c. It differs from the original in initialization, performance, features and SPR
fixes.
73
VxWorks Drivers API Reference, 6.6
motFcc2End
The driver "load string" interface differs from its predecessor. A parameter that contains a
pointer to a predefined array of function pointers was added to the end of the load string.
This array replaces multiple individual function pointers for dual ported RAM allocation,
MII access, duplex control, and heartbeat and disconnect functionality; it is described more
fully below. The array simplifies updating the driver and BSP code independently.
Performance of the driver has been greatly enhanced. A layer of unnecessary queuing was
removed. Time-critical functions were re-written to be more fluid and efficient. The driver's
work load is distributed between the interrupt and the net job queue. Only one
netJobAdd( ) call is made per interrupt. Multiple events pending are sent as a single net job.
A new Generic MIB interface has been implemented.
Several SPRs, written against the original motFccEnd driver and previous motFcc2End
versions, are fixed.
The FCC supports several communication protocols. This driver supports the FCC
operating in Ethernet mode, which is fully compliant with the IEEE 802.3u 10Base-T and
100Base-T specifications.
The FCC establishes a shared memory communication system with the CPU, which may be
divided into three parts: a set of Control/Status Registers (CSR) and FCC-specific
parameters, the buffer descriptors (BD), and the data buffers.
Both the CSRs and the internal parameters reside in the MPC8260's internal RAM. They are
used for mode control, and to extract status information of a global nature. For instance, by
programming these registers, the driver can specify which FCC events should generate an
interrupt, whether features like the promiscuous mode or the heartbeat are enabled, and so
on. Pointers to both the Transmit Buffer Descriptors ring (TBD) and the Receive Buffer
Descriptors ring (RBD) are stored in the internal parameter RAM. The latter also includes
protocol-specific parameters, such as the individual physical address of the station and the
maximum receive frame length.
The BDs are used to pass data buffers and related buffer information between the hardware
and the software. They may reside either on the 60x bus, or on the CPM local bus. They
include local status information, and a pointer to the receive or transmit data buffers. These
buffers are located in external memory, and may reside on the 60x bus, or the CPM local bus
(see below).
This driver is designed to be moderately generic. Without modification, it can operate across
all the FCCs in the MPC8260, regardless of where the internal memory base address is
located. To achieve this goal, this driver must be given several target-specific parameters
and some external support routines. These parameters, and the mechanisms used to
communicate them to the driver, are detailed below.
74
1 Libraries
motFcc2End
EXTERNAL INTERFACE
1
The driver provides the standard external interface, motFccEnd2Load( ), which takes a
string of parameters delineated by colons. The parameters should be specified in
hexadecimal, optionally preceded 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:
"unit:immrVal:fccNum:bdBase:bdSize:bufBase:bufSize:fifoTxBase: fifoRxBase
:tbdNum:rbdNum:phyAddr:phyDefMode:phyAnOrderTbl: userFlags:function
table(:maxRxFrames)"
TARGET-SPECIFIC PARAMETERS
unit
This driver is written to support multiple individual device units. This parameter is
used to explicitly state which unit is being used. Default is unit 0.
immrVal
Indicates the address at which the host processor presents its internal memory (also
known as the internal RAM base address). With this address, and the fccNum value (see
below), the driver is able to compute the location of the FCC parameter RAM, and,
ultimately, to program the FCC for proper operation.
fccNum
This driver is written to support multiple individual device units. This parameter is
used to explicitly state which FCC is being used.
bdBase
The Motorola Fast Communication Controller is a DMA-type device and typically
shares access to some region of memory with the CPU. This driver is designed for
systems that directly share memory between the CPU and the FCC.
This parameter tells the driver that space for both the TBDs and the RBDs need not be
allocated, but should be taken from a cache-coherent private memory space provided
by the user at the given address. TBDs and RBDs are both 8 bytes each, and individual
descriptors must be 8-byte aligned. The driver requires that an additional 8 bytes be
provided for alignment, even if bdBase is aligned to begin with.
If this parameter is "NONE", space for buffer descriptors is obtained by calling
cacheDmaMalloc( ) in motFccInitMem( ).
bdSize
The bdSize parameter specifies the size of the pre-allocated memory region for the BDs.
If bdBase is specified as NONE (-1), the driver ignores this parameter. Otherwise, the
driver checks that the size of the provided memory region is adequate with respect to
the given number of Transmit Buffer Descriptors and Receive Buffer Descriptors (plus
an additional 8 bytes for alignment).
75
VxWorks Drivers API Reference, 6.6
motFcc2End
bufBase
This parameter tells the driver that space for data buffers need not be allocated but
should be taken from a cache-coherent private memory space provided at the given
address. The memory used for buffers must be 32-byte aligned and non-cacheable. The
FCC poses one more constraint, in that DMA cycles may occur even when all the
incoming data have already been transferred to memory. This means at most 32 bytes
of memory at the end of each receive data buffer may be overwritten during reception.
The driver pads that area out, thus consuming some additional memory.
If this parameter is "NONE", space for buffer descriptors is obtained by calling
memalign( ) in motFccInitMem( ).
bufSize
The bufSize parameter specifies the size of the pre-allocated memory region for data
buffers. If bufBase is specified as NONE (-1), the driver ignores this parameter.
Otherwise, the driver checks that the size of the provided memory region is adequate
with respect to the given number of Receive Buffer Descriptors and a non-configurable
number of transmit buffers
(MOT_FCC_TX_CL_NUM). All the above should fit in the given memory space.
This area should also include room for buffer management structures.
fifoTxBase
Indicate the base location of the transmit FIFO, in internal memory. The user does not
need to initialize this parameter. The default value (see MOT_FCC_FIFO_TX_BASE) is
highly optimized for best performance. However, if the user wishes to reserve that very
area in internal RAM for other purposes, this parameter may be set to a different value.
If fifoTxBase is specified as NONE (-1), the driver uses the default value.
fifoRxBase
Indicate the base location of the receive FIFO, in internal memory. The user does not
need to initialize this parameter. The default value (see MOT_FCC_FIFO_RX_BASE) is
highly optimized for best performance. However, if the user wishes to reserve that very
area in internal RAM for other purposes, this parameter may be set to a different value.
If fifoRxBase is specified as NONE (-1), the driver uses the default value.
tbdNum
This parameter specifies the number of transmit buffer descriptors (TBDs). Each buffer
descriptor resides in 8 bytes of the processor's external RAM space. If this parameter is
less than a minimum number specified in MOT_FCC_TBD_MIN, or if it is "NULL", a
default value of MOT_FCC_TBD_DEF_NUM is used. This parameter should always be
an even number since each packet the driver sends may consume more than a single
TBD.
rbdNum
This parameter specifies the number of receive buffer descriptors (RBDs). Each buffer
descriptor resides in 8 bytes of the processor's external RAM space, and each one points
to a buffer in external RAM. If this parameter is less than a minimum number specified
76
1 Libraries
motFcc2End
77
VxWorks Drivers API Reference, 6.6
motFcc2End
78
1 Libraries
motFcc2End
functions for the m82xxDpram DPRAM allocation and, obviously, the driver does
1
not support BSP function calls for heartbeat errors, disconnect errors, and PHY
status changes that are hardware specific.
FUNCPTR miiPhyInit;
BSP Mii/Phy Init Function
This function pointer is initialized by the BSP and called by the driver to initialize
the MII driver. The driver sets up it's PHY settings and then calls this routine. The
BSP is responsible for setting BSP specific PHY parameters and then calling the
miiPhyInit. The BSP is responsible to set up any call to an interrupt. See miiPhyInt
below.
FUNCPTR miiPhyInt;
Driver Function for BSP to Call on a Phy Status Change
This function pointer is initialized by the driver and called by the BSP. The BSP
calls this function when it handles a hardware MII specific interrupt. The driver
initializes this to the function motFccPhyLSCInt. The BSP may or may not choose
to call this function. It will depend if the BSP supports an interrupt driven PHY.
The BSP can also set up the miiLib driver to poll. In this case the miiPhy driver
calls this function. See miiLib for details. Note: Not calling this function when the
PHY duplex mode changes results in a duplex mis-match. This causes TX errors in
the driver and a reduction in throughput.
FUNCPTR miiPhyBitRead;
MII Bit Read Function
This function pointer is initialized by the BSP and called by the driver. The driver
calls this function when it needs to read a bit from the MII interface. The MII
interface is hardware specific.
FUNCPTR miiPhyBitWrite;
MII Bit Write Function
This function pointer is initialized by the BSP and called by the driver. The driver
calls this function when it needs to write a bit to the MII interface. This MII
interface is hardware specific.
FUNCPTR miiPhyDuplex;
Duplex Status Call Back
This function pointer is initialized by the BSP and called by the driver. The driver
calls this function to obtain the status of the duplex setting in the PHY.
FUNCPTR miiPhySpeed;
Speed Status Call Back
This function pointer is initialized by the BSP and called by the driver. The driver
calls this function to obtain the status of the speed setting in the PHY. This interface
is hardware specific.
FUNCPTR hbFail;
79
VxWorks Drivers API Reference, 6.6
motFcc2End
sysFccEnetDisable( )
STATUS sysFccEnetDisable (UINT32 immrVal, UINT8 fccNum);
This routine is expected to perform any target specific functions required to disable the
MII interface to the FCC. This involves restoring the default values for all the Port B
and C signals. This routine is expected to return OK on success, or ERROR. The driver
calls this routine from the motFccStop( ) routine each time a device is disabled.
80
1 Libraries
motFcc2End
sysFccEnetAddrGet( )
1
STATUS sysFccEnetAddrGet (int unit,UCHAR *address);
The driver expects this routine to provide the six-byte Ethernet hardware address that
is used by this device. This routine must copy the six-byte address to the space
provided by enetAddr. This routine is expected to return OK on success, or ERROR. The
driver calls this routine, once per device, from the motFccEndLoad( ) routine.
STATUS sysFccMiiBitWr (UINT32 immrVal, UINT8 fccNum, INT32 bitVal);
This routine is expected to perform any target specific functions required to write a
single bit value to the MII management interface of a MII-compliant PHY device. The
MII management interface is made up of two lines: management data clock (MDC) and
management data input/output (MDIO). The former provides the timing reference for
transfer of information on the MDIO signal. The latter is used to transfer control and
status information between the PHY and the FCC. For this transfer to be successful, the
information itself has to be encoded into a frame format, and both the MDIO and MDC
signals have to comply with certain requirements as described in the 802.3u IEEE
Standard. There is not built-in support in the FCC for the MII management interface.
This means that the clocking on the MDC line and the framing of the information on
the MDIO signal have to be done in software. Hence, this routine is expected to write
the value in bitVal to the MDIO line while properly sourcing the MDC clock to a PHY,
for one bit time.
STATUS sysFccMiiBitRd (UINT32 immrVal, UINT8 fccNum, INT8 * bitVal);
This routine is expected to perform any target specific functions required to read a
single bit value from the MII management interface of a MII-compliant PHY device.
The MII management interface is made up of two lines: management data clock (MDC)
and management data input/output (MDIO). The former provides the timing reference
for transfer of information on the MDIO signal. The latter is used to transfer control and
status information between the PHY and the FCC. For this transfer to be successful, the
information itself has to be encoded into a frame format, and both the MDIO and MDC
signals have to comply with certain requirements as described in the 802.3u IEEE
Standard. There is not built-in support in the FCC for the MII management interface.
This means that the clocking on the MDC line and the framing of the information on
the MDIO signal have to be done in software. Hence, this routine is expected to read
the value from the MDIO line in bitVal, while properly sourcing the MDC clock to a
PHY, for one bit time.
81
VxWorks Drivers API Reference, 6.6
motFecEnd
If the driver allocates the memory for the data buffers to share with the FCC, it does so by
calling the memalign () routine. The driver does not need to use cache-safe memory for data
buffers, since the host CPU and the device are not allowed to modify buffers
asynchronously. The related cache lines are flushed or invalidated as appropriate.
TUNING HINTS The only adjustable parameters are the number of TBDs and RBDs that are created at
run-time. These parameters are given to the driver when motFccEndLoad( ) is called. There
is one RBD associated with each received frame, whereas a single transmit packet frequently
uses more than one TBD. For memory-limited applications, decreasing the number of RBDs
may be desirable. Decreasing the number of TBDs below a certain point results in
substantial performance degradation, and is not recommended. Increasing the number of
buffer descriptors can boost performance.
SPECIAL CONSIDERATIONS
SEE ALSO ifLib, MPC8260 Fast Ethernet Controller (Supplement to the MPC860 User's Manual) , Motorola
MPC860 User's Manual
motFecEnd
NAME motFecEnd – END style Motorola FEC Ethernet network interface driver
DESCRIPTION This module implements a Motorola Fast Ethernet Controller (FEC) network interface
driver. The FEC is fully compliant with the IEEE 802.3 10Base-T and 100Base-T
specifications. Hardware support of the Media Independent Interface (MII) is built in the
chip.
The FEC establishes a shared memory communication system with the CPU, which is
divided into two parts: the Control/Status Registers (CSR), and the buffer descriptors (BD).
The CSRs reside in the MPC860T Communication Controller's internal RAM. They are used
for mode control and to extract status information of a global nature. For instance, the types
of events that should generate an interrupt, or features like the promiscuous mode or the
max receive frame length may be set programming some of the CSRs properly. Pointers to
both the Transmit Buffer Descriptors ring (TBD) and the Receive Buffer Descriptors ring
(RBD) are also stored in the CSRs. The CSRs are located in on-chip RAM and must be
accessed using the big-endian mode.
82
1 Libraries
motFecEnd
The BDs are used to pass data buffers and related buffer information between the hardware
1
and the software. They reside in the host main memory and basically include local status
information and a pointer to the actual buffer, again in external memory.
This driver must be given several target-specific parameters, and some external support
routines must be provided. These parameters, and the mechanisms used to communicate
them to the driver, are detailed below.
For versions of the MPC860T starting with revision D.4 and beyond the functioning of the
FEC changes slightly. An additional bit has been added to the Ethernet Control Register
(ECNTRL), the FEC PIN MUX bit. This bit must be set prior to issuing commands involving
the other two bits in the register (ETHER_EN, RESET). The bit must also be set when either
of the other two bits are being utilized. For versions of the 860T prior to revision D.4, this bit
should not be set.
EXTERNAL INTERFACE
The driver provides the standard external interface, motFecEndLoad( ), which takes a string
of colon-separated parameters. The parameters should be specified in hexadecimal,
optionally preceded 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:
"motCpmAddr:ivec:bufBase:bufSize:fifoTxBase:fifoRxBase
:tbdNum:rbdNum:phyAddr:isoPhyAddr:phyDefMode:userFlags :clockSpeed"
TARGET-SPECIFIC PARAMETERS
motCpmAddr
Indicates the address at which the host processor presents its internal memory (also
known as the dual ported RAM base address). With this address, the driver is able to
compute the location of the FEC parameter RAM, and, ultimately, to program the FEC
for proper operations.
ivec
This driver configures the host processor to generate hardware interrupts for various
events within the device. The interrupt-vector offset parameter is used to connect the
driver's ISR to the interrupt through a call to the VxWorks system function
intConnect( ). It is also used to compute the interrupt level (0-7) associated with the
FEC interrupt (one of the MPC860T SIU internal interrupt sources). The latter is given
as a parameter to intEnable( ), in order to enable this level interrupt to the PPC core.
bufBase
The Motorola Fast Ethernet Controller is a DMA-type device and typically shares
access to some region of memory with the CPU. This driver is designed for systems that
directly share memory between the CPU and the FEC.
83
VxWorks Drivers API Reference, 6.6
motFecEnd
This parameter tells the driver that space for the both the TBDs and the RBDs needs not
be allocated but should be taken from a cache-coherent private memory space provided
by the user at the given address. The user should be aware that memory used for
buffers descriptors must be 8-byte aligned and non-cacheable. All the buffer
descriptors should fit in the given memory space.
If this parameter is "NONE", space for buffer descriptors is obtained by calling
cacheDmaMalloc( ) in motFecEndLoad( ).
bufSize
The memory size parameter specifies the size of the pre-allocated memory region. If
bufBase is specified as NONE (-1), the driver ignores this parameter. Otherwise, the
driver checks the size of the provided memory region is adequate with respect to the
given number of Transmit Buffer Descriptors and Receive Buffer Descriptors.
fifoTxBase
Indicate the base location of the transmit FIFO, in internal memory. The user does not
need to initialize this parameter, as the related FEC register defaults to a proper value
after reset. The specific reset value is microcode dependent. However, if the user wishes
to reserve some RAM for other purposes, he may set this parameter to a different value.
This should not be less than the default.
If fifoTxBase is specified as NONE (-1), the driver ignores it.
fifoRxBase
Indicate the base location of the receive FIFO, in internal memory. The user does not
need to initialize this parameter, as the related FEC register defaults to a proper value
after reset. The specific reset value is microcode dependent. However, if the user wishes
to reserve some RAM for other purposes, he may set this parameter to a different value.
This should not be less than the default.
If fifoRxBase is specified as NONE (-1), the driver ignores it.
tbdNum
This parameter specifies the number of transmit buffer descriptors (TBDs). Each buffer
descriptor resides in 8 bytes of the processor's external RAM space, and each one points
to a 1536-byte buffer again in external RAM. If this parameter is less than a minimum
number specified in the macro MOT_FEC_TBD_MIN, or if it is "NULL", a default value
of 64 is used. This default number is kept deliberately high, since each packet the driver
sends may consume more than a single TBD. This parameter should always equal a
even number.
rbdNum
This parameter specifies the number of receive buffer descriptors (RBDs). Each buffer
descriptor resides in 8 bytes of the processor's external RAM space, and each one points
to a 1536-byte buffer again in external RAM. If this parameter is less than a minimum
number specified in the macro MOT_FEC_RBD_MIN, or if it is "NULL", a default value
of 48 is used. This parameter should always equal a even number.
84
1 Libraries
motFecEnd
phyAddr
1
This parameter specifies the logical address of a MII-compliant physical device (PHY)
that is to be used as a physical media on the network. Valid addresses are in the range
0-31. There may be more than one device under the control of the same management
interface. If this parameter is "NULL", the default physical layer initialization routine
will find out the PHY actual address by scanning the whole range. The one with the
lowest address will be chosen.
isoPhyAddr
This parameter specifies the logical address of a MII-compliant physical device (PHY)
that is to be electrically isolated by the management interface. Valid addresses are in the
range 0-31. If this parameter equals 0xff, the default physical layer initialization routine
will assume there is no need to isolate any device. However, this parameter will be
ignored unless the MOT_FEC_USR_PHY_ISO bit in the userFlags is set to one.
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.
clockSpeed
This field enables the user to define the speed of the clock being used to drive the
interface. The clock speed is used to derive the MII management interface clock, which
cannot exceed 2.5 MHz. clockSpeed is optional in BSPs using clocks that are 50 MHz or
less, but it is required in faster designs to ensure proper MII interface operation.
MOT_FEC_USR_PHY_NO_AN: the default physical layer initialization routine will
exploit the auto-negotiation mechanism as described in the IEEE Std 802.3, to bring a
valid link up. According to it, all the link partners on the media will take part to the
negotiation process, and the highest priority common denominator technology ability
will be chosen. It the user wishes to prevent auto-negotiation from occurring, he may
set this bit in the user flags.
MOT_FEC_USR_PHY_TBL: in the auto-negotiation process, PHYs advertise all their
technology abilities at the same time, and the result is that the maximum common
denominator is used. However, this behaviour may be changed, and the user may
affect the order how each subset of PHY's abilities is negotiated. Hence, when the
MOT_FEC_USR_PHY_TBL bit is set, the default physical layer initialization routine will
look at the motFecPhyAnOrderTbl[] table and auto-negotiate a subset of abilities at a
time, as suggested by the table itself. It is worth noticing here, however, that if the
MOT_FEC_USR_PHY_NO_AN bit is on, the above table will be ignored.
85
VxWorks Drivers API Reference, 6.6
motFecEnd
However, in this operating mode, the FEC will ignore the collision detect and carrier
sense signals. If the user wishes not to negotiate full duplex mode, he should set the
MOT_FEC_USR_PHY_NO_FD bit in the user flags.
86
1 Libraries
motFecEnd
expected to return OK on success, or ERROR. The driver calls this routine, once per
1
device, from the motFecEndLoad( ) routine.
sysFecEnetDisable( )
STATUS sysFecEnetDisable (UINT32 motCpmAddr);
This routine is expected to perform any target specific functions required to disable the
MII interface to the FEC. This involves restoring the default values for all the Port D
signals. This routine is expected to return OK on success, or ERROR. The driver calls this
routine from the motFecEndStop( ) routine each time a device is disabled.
sysFecEnetAddrGet( )
STATUS sysFecEnetAddrGet (UINT32 motCpmAddr, UCHAR * enetAddr);
The driver expects this routine to provide the six-byte Ethernet hardware address that
is used by this device. This routine must copy the six-byte address to the space
provided by enetAddr. This routine is expected to return OK on success, or ERROR. The
driver calls this routine, once per device, from the motFecEndLoad( ) routine.
_func_motFecPhyInit
FUNCPTR _func_motFecPhyInit
This driver sets the global variable _func_motFecPhyInit to the MII-compliant media
initialization routine motFecPhyInit( ). If the user wishes to exploit a different way to
configure the PHY, he may set this variable to his own media initialization routine,
typically in sysHwInit( ).
_func_motFecHbFail
FUNCPTR _func_motFecPhyInit
The FEC may be configured to perform heartbeat check following end of transmission,
and to generate an interrupt, when this event occurs. If this is the case, and if the global
variable _func_motFecHbFail is not NULL, the routine referenced to by
_func_motFecHbFail is called, with a pointer to the driver control structure as
parameter. Hence, the user may set this variable to his own heart beat check fail routine,
where he can take any action he sees appropriate. The default value for the global
variable _func_motFecHbFail is NULL.
87
VxWorks Drivers API Reference, 6.6
motFecEnd
Data buffers are instead allocated in the external memory through the regular memory
allocation routine (memalign), and the related cache lines are then flushed or invalidated as
appropriate. The user should not allocate memory for them.
TUNING HINTS The only adjustable parameters are the number of TBDs and RBDs that will be created at
run-time. These parameters are given to the driver when motFecEndLoad( ) is called.
There is one RBD associated with each received frame whereas a single transmit packet
normally uses more than one TBD. For memory-limited applications, decreasing the
number of RBDs may be desirable. Decreasing the number of TBDs below a certain point
will provide substantial performance degradation, and is not recommended. An adequate
number of loaning buffers are also pre-allocated to provide more buffering before packets
are dropped, but this is not configurable.
The relative priority of the netTask and of the other tasks in the system may heavily affect
performance of this driver. Usually the best performance is achieved when the netTask
priority equals that of the other applications using the driver.
SPECIAL CONSIDERATIONS
Due to the FEC8 errata in the document: "MPC860 Family Device Errata Reference"
available at the Motorola web site, the number of receive buffer descriptors (RBD) for the
FEC (see configNet.h) is kept deliberately high. According to Motorola, this problem was
fixed in Rev. B3 of the silicon. In memory-bound applications, when using the above
mentioned revision of the MPC860T processor, the user may decrease the number of RBDs
to fit his needs.
88
1 Libraries
ncr810Lib
SEE ALSO ifLib, MPC860T Fast Ethernet Controller (Supplement to the MPC860 User's Manual) , Motorola
MPC860 User's Manual 1
ncr810Lib
NAME ncr810Lib – NCR 53C8xx PCI SCSI I/O Processor (SIOP) library (SCSI-2)
ROUTINES ncr810CtrlCreate( ) – create a control structure for the NCR 53C8xx SIOP
ncr810CtrlInit( ) – initialize a control structure for the NCR 53C8xx SIOP
ncr810SetHwRegister( ) – set hardware-dependent registers for the NCR 53C8xx SIOP
ncr810Show( ) – display values of all readable NCR 53C8xx SIOP registers
DESCRIPTION This is the I/O driver for the NCR 53C8xx PCI SCSI I/O Processors (SIOP), supporting the
NCR 53C810 and the NCR 53C825 SCSI controllers. It is designed to work with scsiLib and
scsi2Lib. This driver runs in conjunction with a script program for the NCR 53C8xx
controllers. These scripts use DMA transfers for all data, messages, and status. This driver
supports cache functions through cacheLib.
USER-CALLABLE ROUTINES
Most of the routines in this driver are accessible only through the I/O system. Three
routines, however, must be called directly. ncr810CtrlCreate( ) creates a controller structure
and ncr810CtrlInit( ) initializes it. The NCR 53C8xx hardware registers need to be
configured according to the hardware implementation. If the default configuration is not
correct, the routine ncr810SetHwRegister( ) must be used to properly configure the
registers.
I/O MACROS All device access for input and output is done via macros which can be customized for each
BSP. These routines are NCR810_IN_BYTE, NCR810_OUT_BYTE, NCR810_IN_16,
NCR810_OUT_16, NCR810_IN_32 and NCR810_OUT_32. By default, these are defined as
generic memory references.
89
VxWorks Drivers API Reference, 6.6
ne2000End
SEE ALSO scsiLib, scsi2Lib, cacheLib, SYM53C825 PCI-SCSI I/O Processor Data Manual, SYM53C810
PCI-SCSI I/O Processor Data Manual, NCR 53C8XX Family PCI-SCSI I/O Processors
Programming Guide, the VxWorks programmer guides.
ne2000End
NAME ne2000End – NE2000 END network interface driver
DESCRIPTION This module implements the NE2000 Ethernet network interface driver.
EXTERNAL INTERFACE
The only external interface is the ne2000EndLoad( ) routine, which expects the initString
parameter as input. This parameter passes in a colon-delimited string of the format:
unit:adrs:vecNum:intLvl:byteAccess:usePromEnetAddr:offset
The ne2000EndLoad( ) function uses strtok( ) to parse the string.
TARGET-SPECIFIC PARAMETERS
unit
A convenient holdover from the former model. This parameter is used only in the
string name for the driver.
adrs
Tells the driver where to find the ne2000.
vecNum
Configures the ne2000 device to generate hardware interrupts for various events within
the device. Thus, it contains an interrupt handler routine. The driver calls
sysIntConnect( ) to connect its interrupt handler to the interrupt vector generated as a
result of the ne2000 interrupt.
intLvl
This parameter is passed to an external support routine, sysLanIntEnable( ), which is
described below in "External Support Requirements." This routine is called during as
part of driver's initialization. It handles any board-specific operations required to allow
the servicing of a ne2000 interrupt on targets that use additional interrupt controller
devices to help organize and service the various interrupt sources. This parameter
makes it possible for this driver to avoid all board-specific knowledge of such devices.
90
1 Libraries
ne2000End
byteAccess
1
Tells the driver the NE2000 is jumpered to operate in 8-bit mode. Requires that
SYS_IN_WORD_STRING( ) and SYS_OUT_WORD_STRING( ) be written to
properly access the device in this mode.
usePromEnetAddr
Attempt to get the ethernet address for the device from the on-chip (board) PROM
attached to the NE2000. Will fall back to using the BSP-supplied ethernet address if this
parameter is 0 or if unable to read the ethernet address.
offset
Specifies the memory alignment offset.
91
VxWorks Drivers API Reference, 6.6
nec765Fd
nec765Fd
NAME nec765Fd – NEC 765 floppy disk device driver
DESCRIPTION This is the driver for the NEC 765 Floppy Chip used on the PC 386/486.
USER-CALLABLE ROUTINES
Most of the routines in this driver are accessible only through the I/O system. However,
two routines must be called directly: fdDrv( ) to initialize the driver, and fdDevCreate( ) to
create devices. Before the driver can be used, it must be initialized by calling fdDrv( ). This
routine should be called exactly once, before any reads, writes, or calls to fdDevCreate( ).
Normally, it is called from usrRoot( ) in usrConfig.c.
The routine fdRawio( ) allows physical I/O access. Its first argument is a drive number, 0
to 3; the second argument is a type of diskette; the third argument is a pointer to the
FD_RAW structure, which is defined in nec765Fd.h.
ns16550Sio
NAME ns16550Sio – NS 16550 UART tty driver
92
1 Libraries
ns83902End
DESCRIPTION This is the driver for the NS16552 DUART. This device includes two universal
asynchronous receiver/transmitters, a baud rate generator, and a complete modem control 1
capability.
A NS16550_CHAN structure is used to describe the serial channel. This data structure is
defined in ns16550Sio.h.
Only asynchronous serial operation is supported by this driver. The default serial settings
are 8 data bits, 1 stop bit, no parity, 9600 baud, and software flow control.
USAGE The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ), which creates the
NS16550_CHAN structure and initializes all the values in the structure (except the
SIO_DRV_FUNCS) before calling ns16550DevInit( ). The BSP's sysHwInit2( ) routine
typically calls sysSerialHwInit2( ), which connects the chips interrupts via intConnect( )
(either the single interrupt ns16550Int or the three interrupts ns16550IntWr, ns16550IntRd,
and ns16550IntEx).
This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the handshakes RTS/CTS. The
function HUPCL(hang up on last close) is available. When hardware flow control is
enabled, the signals RTS and DTR are set TRUE and remain set until a HUPCL is performed.
ns83902End
NAME ns83902End – National Semiconductor DP83902A ST-NIC
EXTERNAL INTERFACE
The only external interface is the ns83902EndLoad( ) routine, which expects the initString
parameter as input. This parameter passes in a colon-delimited string of the format:
"baseAdrs:intVec:intLvl:dmaPort:bufSize:options"
TARGET-SPECIFIC PARAMETERS
unit
A convenient holdover from the former model. This parameter is used only in the
string name for the driver.
93
VxWorks Drivers API Reference, 6.6
ns83902End
baseAdrs
Base address at which the NIC hardware device registers are located.
vecNum
This is the interrupt vector number of the hardware interrupt generated by this
Ethernet device.
intLvl
This parameter defines the level of the hardware interrupt.
dmaPort
Address of the DMA port used to transfer data to the host CPU.
bufSize
Size of the NIC buffer memory in bytes.
options
Target specific options:
bit0 - wide (0: byte, 1: word)
bit1 - register interval (0: 1byte, 1: 2 bytes)
SEE ALSO muxLib, DP83902A ST-NIC Serial Interface Controller for Twisted Pair
94
1 Libraries
pciAutoConfigLib
pccardLib 1
DESCRIPTION This library provides generic facilities for enabling PC CARD. Each PC card device driver
needs to provide an enabler routine and a CSC interrupt handler. The enabler routine must
be in the pccardEnabler structure. Each PC card driver has its own resource structure,
xxResources. The ATA PC card driver resource structure is ataResources in sysLib, which
also supports a local IDE disk. The resource structure has a PC card common resource
structure in the first member. Other members are device-driver dependent resources.
The PCMCIA chip initialization routines tcicInit( ) and pcicInit( ) are included in the
PCMCIA chip table pcmciaAdapter. This table is scanned when the PCMCIA library is
initialized. If the initialization routine finds the PCMCIA chip, it registers all function
pointers of the PCMCIA_CHIP structure.
A memory window defined in pcmciaMemwin is used to access the CIS of a PC card
through the routines in cisLib.
pciAutoConfigLib
NAME pciAutoConfigLib – PCI bus scan and resource allocation facility
95
VxWorks Drivers API Reference, 6.6
pciAutoConfigLib
DESCRIPTION This library provides a facility for automated PCI device scanning and configuration on
PCI-based systems.
Modern PCI based systems incorporate many peripherals and may span multiple physical
bus segments, and these bus segments may be connected via PCI-to-PCI Bridges. Bridges
are identified and properly numbered before a recursive scan identifies all resources on the
bus implemented by the bridge. Post-scan configuration of the subordinate bus number is
performed.
Resource requirements of each device are identified and allocated according to system
resource pools that are specified by the BSP Developer. Devices may be conditionally
excluded, and interrupt routing information obtained via optional routines provided by the
BSP Developer.
GENERAL ALGORITHM
The library must first be initialized by a call to pciAutoConfigLibInit( ). The return value,
pCookie, must be passed to each subsequent call from the library. Options can be set using
the function pciAutoCfgCtl( ). The available options are described in the documentation for
pciAutoCfgCtl( ).
After initialization of the library and configuration of any options, autoconfiguration takes
place in two phases. In the first phase, all devices and subordinate busses in a given system
are scanned and each device that is found causes an entry to be created in the Probelist or
list of devices found during the probe/configuration process.
In the second phase each device that is on the Probelist is checked to see if it has been
excluded from automatic configuration by the BSP developer. If a particular function has
not been excluded, then it is first disabled. The Base Address Registers of the particular
function are read to ascertain the resource requirements of the function. Each resource
requirement is checked against available resources in the applicable pool based on size and
alignment constraints.
After all functions on the Probelist have been processed, each function and it's appropriate
Memory or I/O decoder(s) are enabled for operation.
96
1 Libraries
pciAutoConfigLib
secondary bus numbers are set to their corresponding value, and the subordinate bus
1
number is set to 0xFF, because the final number of sub-busses is not known. The
subordinate bus number is later updated to indicate the highest numbered sub-bus that was
scanned once the scan is complete.
RESOURCE ALLOCATION
Resource pools include the 32-bit Prefetchable Memory pool, the 32-bit Non-prefetchable
Memory ("MemIO") pool, the 32-bit I/O pool, and the 16-bit I/O allocation pool. The
allocation in each pool begins at the specified base address and progresses to higher
numbered addresses. Each allocated address adheres to the PCI natural alignment
constraints of the given resource requirement specified in the Base Address Register.
DATA STRUCTURES
Data structures are either allocated statically or allocated dynamically, depending on the
value of the build macro PCI_AUTO_STATIC_LIST, discussed below. In either case, the
structures are initialized by the call to pciAutoConfigLibInit( ).
97
VxWorks Drivers API Reference, 6.6
pciAutoConfigLib
For ease of upgrading from the older method which used the PCI_SYSTEM structure, the
option PCI_SYSTEM_STRUCT_COPY has been implemented. See the in the documentation
for pciAutoCfgCtl( ) for more information.
pciMem32Size
Specifies the 32-bit prefetchable memory pool size. Normally, this is given by the BSP
constant PCI_MEM_SIZE. It can be set with the pciAutoCfgCtl( ) command
PCI_MEM32_SIZE_SET.
pciMemIo32
Specifies the 32-bit non-prefetchable memory pool base address. Normally, this is
given by the BSP constant PCI_MEMIO_ADRS. It can be set with the pciAutoCfgCtl( )
command PCI_MEMIO32_LOC_SET.
pciMemIo32Size
Specifies the 32-bit non-prefetchable memory pool size Normally, this is given by the
BSP constant PCI_MEMIO_SIZE. It can be set with the pciAutoCfgCtl( ) command
PCI_MEMIO32_SIZE_SET.
pciIo32
Specifies the 32-bit I/O pool base address. Normally, this is given by the BSP constant
PCI_IO_ADRS. It can be set with the pciAutoCfgCtl( ) command PCI_IO32_LOC_SET.
pciIo32Size
Specifies the 32-bit I/O pool size. Normally, this is given by the BSP constant
PCI_IO_SIZE. It can be set with the pciAutoCfgCtl( ) command PCI_IO32_SIZE_SET.
pciIo16
Specifies the 16-bit I/O pool base address. Normally, this is given by the BSP constant
PCI_ISA_IO_ADDR. It can be set with the pciAutoCfgCtl( ) command
PCI_IO16_LOC_SET.
pciIo16Size
Specifies the 16-bit I/O pool size. Normally, this is given by the BSP constant
PCI_ISA_IO_SIZE. It can be set with the pciAutoCfgCtl( ) command
PCI_IO16_SIZE_SET.
98
1 Libraries
pciAutoConfigLib
BSP-SPECIFIC ROUTINES
Several routines can be provided by the BSP Developer to customize the degree to which
the system can be automatically configured. These routines are normally put into a file
called sysBusPci.c in the BSP directory. The trivial cases of each of these routines are shown
in the USAGE section below to illustrate the API to the BSP Developer.
DEVICE INCLUSION
Specific devices other than bridges can be excluded from auto configuration and either not
used or manually configured later. For more information, see the PCI_INCLUDE_FUNC_SET
section in the documentation for pciAutoCfgCtl( ).
INTERRUPT ASSIGNMENT
Interrupt assignment can be specified by the BSP developer by specifying a routine for
pciAutoConfigLib to call at the time each device or bridge is configured. See the
PCI_INT_ASSIGN_FUNC_SET section in the documentation for pciAutoCfgCtl( ) for more
information.
99
VxWorks Drivers API Reference, 6.6
pciAutoConfigLib
device number and interrupt pin register of the device of interest to compute the
contents of the interrupt line register.
FALSE
If automatic interrupt routing is set to FALSE, then autoconfig calls the BSP interrupt
assignment routine to do all interrupt routing regardless of the bus on which the device
resides. The return value represents the contents of the interrupt line register in all
cases.
BRIDGE CONFIGURATION
The BSP developer may wish to perform configuration of bridges before and/or after the
normal configuration of the bus they reside on. Two routines can be specified for this
purpose.
The bridge pre-configuration pass initialization routine is provided so that the BSP
Developer can initialize a bridge device prior to the configuration pass on the bus that the
bridge implements.
The bridge post-configuration pass initialization routine is provided so that the BSP
Developer can initialize the bridge device after the bus that the bridge implements has been
enumerated.
These routines are configured by calling pciAutoCfgCtl( ) with the command
PCI_BRIDGE_PRE_CONFIG_FUNC_SET and the command
PCI_BRIDGE_POST_CONFIG_FUNC_SET, respectively.
100
1 Libraries
pciAutoConfigLib
PCI_AUTO_RECLAIM_LIST
1
This define may only be used if PCI_AUTO_STATIC_LIST is not defined. If defined, this
allows the autoconfig routine to perform a free( ) operation on a dynamically allocated
probe list. Note that if PCI_AUTO_RECLAIM_LIST is defined and
PCI_AUTO_STATIC_LIST is also, a compiler error will be generated.
USAGE The following code sample illustrates the usage of the PCI_SYSTEM structure and
invocation of the autoconfig library. Note that the example BSP-specific routines are merely
stubs. The code in each routine varies by BSP and application.
#include "pciAutoConfigLib.h"
/*
* Interrupt routing strategy
* across PCI-to-PCI Bridges
*/
101
VxWorks Drivers API Reference, 6.6
pciAutoConfigLib
pciAutoCfgCtl(pCookie, PCI_INCLUDE_FUNC_SET,
sysPciAutoconfigInclude);
pciAutoCfgCtl(pCookie, PCI_INT_ASSIGN_FUNC_SET,
sysPciAutoconfigIntrAssign);
/*
* PCI-to-PCI Bridge Pre-
* and Post-enumeration init
* routines
*/
pciAutoCfgCtl(pCookie, PCI_BRIDGE_PRE_CONFIG_FUNC_SET,
sysPciAutoconfigPreEnumBridgeInit);
pciAutoCfgCtl(pCookie, PCI_BRIDGE_POST_CONFIG_FUNC_SET,
sysPciAutoconfigPostEnumBridgeInit);
/*
* Perform any needed PCI Host Bridge
* Initialization that needs to be done
* before pciAutoConfig is invoked here
* utilizing the information in the
* newly-populated sysParams structure.
*/
pciAutoCfg (&sysParams);
/*
* Perform any needed post-enumeration
* PCI Host Bridge Initialization here.
* Information about the actual configuration
* from the scan and configuration passes
* can be obtained using the assorted
* PCI_*_GET commands to pciAutoCfgCtl().
*/
/*
* Local BSP-Specific routines
* supplied by BSP Developer
*/
STATUS sysPciAutoconfigInclude
(
PCI_SYSTEM * pSys, /* PCI_SYSTEM structure pointer */
PCI_LOC * pLoc, /* pointer to function in question
*/
UINT devVend /* deviceID/vendorID of device */
)
{
return OK; /* Autoconfigure all devices */
}
102
1 Libraries
pciAutoConfigLib
UCHAR sysPciAutoconfigIntrAssign
( 1
PCI_SYSTEM * pSys, /* PCI_SYSTEM structure pointer */
PCI_LOC * pLoc, /* pointer to function in question
*/
UCHAR pin /* contents of PCI int pin register
*/
)
{
return (UCHAR)0xff;
}
void sysPciAutoconfigPreEnumBridgeInit
(
PCI_SYSTEM * pSys, /* PCI_SYSTEM structure pointer */
PCI_LOC * pLoc, /* pointer to function in question
*/
UINT devVend /* deviceID/vendorID of device */
)
{
return;
}
void sysPciAutoconfigPostEnumBridgeInit
(
PCI_SYSTEM * pSys, /* PCI_SYSTEM structure pointer */
PCI_LOC * pLoc, /* pointer to function in question
*/
UINT devVend /* deviceID/vendorID of device */
)
{
return;
}
LIMITATIONS The current version of the autoconfig facility does not support 64-bit prefetchable memory
behind PCI-to-PCI bridges, but it does support 32-bit prefetchable memory.
The autoconfig code also depends upon the BSP Developer specifying resource pools that
do not conflict with any resources that are being used by statically configured devices.
103
VxWorks Drivers API Reference, 6.6
pciConfigLib
SEE ALSO "PCI Local Bus Specification, Revision 2.1, June 1, 1996", "PCI Local Bus PCI to PCI Bridge
Architecture Specification, Revision 1.0, April 5, 1994"
pciConfigLib
NAME pciConfigLib – PCI Configuration space access support for PCI drivers
DESCRIPTION This module contains routines to support accessing the PCI bus Configuration Space. The
library is PCI Revision 2.1 compliant.
In general, functions in this library should not be called from the interrupt level, (except
pciInt( )) because Configuration Space access, which is slow, should be limited to
initialization only.
The functions addressed here include:
- Initialization of the library.
- Locating a device by Device ID and Vendor ID.
- Locating a device by Class Code.
- Generation of Special Cycles.
- Accessing Configuration Space structures.
104
1 Libraries
pciConfigLib
105
VxWorks Drivers API Reference, 6.6
pciConfigLib
INITIALIZATION pciConfigLibInit( ) should be called before any other pciConfigLib functions. Generally,
this is performed by sysHwInit( ).
After the library has been initialized, it may be utilized to find devices, and access PCI
configuration space.
Any PCI device can be uniquely addressed within Configuration Space by the geographic
specification of a Bus segment number, Device number, and a Function number (BDF). The
configuration registers of a PCI device are arranged by the PCI standard according to a
Configuration Header structure. The BDF triplet specifies the location of the header
structure of one device. To access a configuration register, its location in the header must be
106
1 Libraries
pciConfigLib
given. The location of a configuration register of interest is simply the structure member
1
offset defined for the register. For further details, refer to the PCI Local Bus Specification,
Revision 2.1. Refer to the header file pciConfigLib.h for the defined standard configuration
register offsets.
The maximum number of Type-1 Configuration Space buses supported in the 2.1
Specifications is 256 (0x00 - 0xFF), far greater than most systems currently support. Most
buses are numbered sequentially from 0. An optional define called PCI_MAX_BUS may be
declared in config.h to override the default definition of 256. Similarly, the default number
of devices and functions may be overridden by defining PCI_MAX_DEV and/or
PCI_MAX_FUNC. Note that the number of devices applies only to bus zero, all others being
restricted to 16 by the 2.1 spec.
ACCESS MECHANISM 1
This is the preferred access mechanism for a PC-AT class machines. It uses two standard
PCI I/O registers to initiate a configuration cycle. The type of cycle is determined by the
Host-bridge device based on the devices primary bus number. If the configuration bus
number matches the primary bus number then a type 0 configuration cycle occurs.
Otherwise a type 1 cycle is generated. This is all transparent to the user.
The two arguments used for mechanism 1 are the CAR register address which by default is
PCI_CONFIG_ADDR (0xCF8), and the CDR register address which is normally
PCI_CONFIG_DATA (0xCFC).
e.g.
ACCESS MECHANISM 2
This is the non-preferred legacy mechanism for PC-AT class machines. The three arguments
used for mechanism 2 are the CSE register address which by default is PCI_CONFIG_CSE
(0xCF8), and the Forward register address which is normally PCI_CONFIG_FORWARD
(0xCFA), and the configuration base address which is normally PCI_CONFIG_BASE
(0xC000).
e.g.
ACCESS MECHANISM 0
We have added a non-standard access method that we call method 0. Selecting method 0
installs user supplied read and write routines to actually handle configuration read and
writes (32 bit accesses only). The BSP will supply pointers to these routines as arguments 2
and 3 (read routine is argument 2, write routine is argument 3). A user provided special
cycle routine is argument 4. The special cycle routine is optional and a NULL pointer should
be used if the special cycle routine is not provided by the BSP.
107
VxWorks Drivers API Reference, 6.6
pciConfigLib
All accesses are expected to be 32 bit accesses with these routines. The code in this library
will perform bit manipulation to emulate byte and word operations. All routines return OK
to indicate successful operation and ERROR to indicate failure.
Initialization examples using special access method 0:
pciConfigLibInit (PCI_MECHANISM_0, myReadRtn,
myWriteRtn, mySpecialRtn);
-or-
108
1 Libraries
pciConfigLib
(PCI_CFG_COMMAND). The bits in the status register are reset by writing a 1 to them. For
1
each of the listed functions, it is possible that they will emulate the operation by reading a
32 bit quantity, shifting the new data into the proper byte lane and writing back a 32 bit
value.
Improper use may inadvertently clear all error conditions indications if the user tries to
update the command bits. The user should insure that only full 32 bit operations are
performed on the command/status register. Use pciConfigInLong to read the
Command/Status reg, mask off the status bits, mask or insert the command bit changes and
then use pciConfigOutLong to rewrite the Command/Status register. Use of
pciConfigModifyLong is okay if the status bits are rewritten as zeroes.
/*
* This example turns on the write invalidate enable bit in the Command
* register without clearing the status bits or disturbing other
* command bits.
*/
109
VxWorks Drivers API Reference, 6.6
pciConfigLib
classCode
The 24-bit class of the device.
index
The instance number.
In addition, both functions return the following parameters by reference:
pBusNo
Where to return bus segment number containing the device.
pDeviceNo
Where to return the device ID of the device.
pFuncNo
Where to return the function number of the device.
These three parameters, Bus segment number, Device number, and Function number (BDF),
provide a means to access the Configuration Space of any PCI device.
110
1 Libraries
pciConfigLib
In summary, the pci configuration space access functions described above accept the
following parameters.
Input routines:
busNo
Bus segment number on which the device resides.
deviceNo
Device ID of the device.
funcNo
Function number of the device.
offset
Offset into the device configuration space.
pData
Where to return the data.
Output routines:
busNo
Bus segment number on which the device resides.
deviceNo
Device ID of the device.
funcNo
Function number of the device.
offset
Offset into the device configuration space.
Data
Data to be written.
111
VxWorks Drivers API Reference, 6.6
pciConfigLib
112
1 Libraries
pciConfigLib
recurse
1
A boolean argument specifying whether to do a recursive search or to do just the
specified bus.
funcCheckRtn
A user supplied function which will be called for each PCI function found. It must
return STATUS. It takes four arguments: "bus", "device", "function", and a
user-supplied arg "pArg". The typedef PCI_FOREACH_FUNC is defined in
pciConfigLib.h for these routines. Note that it is possible to apply "funcCheckRtn"
only to devices of a specific type by querying the device type for the class code.
Similarly, it is possible to exclude bridges or any other device type using the same
mechanism.
pArg
The fourth argument to funcCheckRtn.
SYSTEM RESET The function pciConfigReset( ) is useful at the time of a system reset. When doing a system
reset, the devices on the system should be disabled so that they do not write to RAM while
the system is trying to reboot. The function pciConfigReset( ) can be installed using
rebootHookAdd( ), or it can be called directly from sysToMonitor( ) or elsewhere in the
BSP. It accepts one argument for compatibility with rebootHookAdd( ):
startType
Ignored.
Note that this function disables all access to the PCI bus except for the use of PCI config
space. If there are devices on the PCI bus which are required to reboot, then those
devices must be re-enabled after the call to pciConfigReset( ) or the system will not be
able to reboot.
USAGE The following code sample illustrates the usage of this library. Initializa- tion of the library
is performed first, then a sample device is found and initialized.
#include "drv/pci/pciConfigLib.h"
IMPORT pciInt();
LOCAL VOID deviceIsr(int);
int param;
STATUS result;
int pciBusNo; /* PCI bus number */
int pciDevNo; /* PCI device number */
int pciFuncNo; /* PCI function number */
/*
* Initialize module to use CSAM-1
* (if not performed in sysHwInit())
*
113
VxWorks Drivers API Reference, 6.6
pciConfigShow
*/
if (pciConfigLibInit (PCI_MECHANISM_1,
PCI_PRIMARY_CAR,
PCI_PRIMARY_CDR,
0)
!= OK)
{
sysToMonitor (BOOT_NO_AUTOBOOT);
}
/*
* Find a device by its device ID, and use the
* Bus, Device, and Function number of the found
* device to configure it, using pciDevConfig(). In
* this case, the first instance of a DEC 21040
* Ethernet NIC is searched for. If the device
* is found, the Bus, Device Number, and Function
* Number are fed to pciDevConfig, along with the
* constant PCI_IO_LN2_ADRS, which defines the start
* of the I/O space utilized by the device. The
* device and its I/O space is then enabled.
*
*/
SEE ALSO PCI Local Bus Specification, Revision 2.1, June 1, 1996 , PCI Local Bus PCI to PCI Bridge
Architecture Specification, Revision 1.0, April 5, 1994"
pciConfigShow
NAME pciConfigShow – Show routines of PCI bus(IO mapped) library
114
1 Libraries
pciIntLib
DESCRIPTION This module contains show routines to see all devices and bridges on the PCI bus. This
module works in conjunction with pciConfigLib.o. There are two ways to find out an
empty device.
- check Master Abort bit after the access.
- check whether the read value is 0xffff.
It uses the second method, since I didn't see the Master Abort bit of the host/PCI bridge
changing.
INCLUDE FILES
pciIntLib
NAME pciIntLib – PCI Shared Interrupt support
115
VxWorks Drivers API Reference, 6.6
pcic
pciInt( ) executes these interrupt handlers in the link list for a PCI interrupt. Each interrupt
handler must check the device dependent interrupt status bit to determine the source of the
interrupt, since it simply execute all interrupt handlers in the link list. pciInt( ) should be
attached by intConnect( ) function in the BSP initialization with its parameter. The
parameter is an vector number associated to the PCI interrupt.
INCLUDE FILES
pcic
NAME pcic – Intel 82365SL PCMCIA host bus adaptor chip library
DESCRIPTION This library contains routines to manipulate the PCMCIA functions on the Intel 82365 series
PCMCIA chip. The following compatible chips are also supported:
- Cirrus Logic PD6712/20/22
- Vadem VG468
- VLSI 82c146
- Ricoh RF5C series
The initialization routine pcicInit( ) is the only global function and is included in the
PCMCIA chip table pcmciaAdapter. If pcicInit( ) finds the PCIC chip, it registers all
function pointers of the PCMCIA_CHIP structure.
pcicShow
NAME pcicShow – Intel 82365SL PCMCIA host bus adaptor chip show library
DESCRIPTION This is a driver show routine for the Intel 82365 series PCMCIA chip. pcicShow( ) is the only
global function and is installed in the PCMCIA chip table pcmciaAdapter in
pcmciaShowInit( ).
116
1 Libraries
pcmciaLib
pcmciaLib 1
DESCRIPTION This library provides generic facilities for handling PCMCIA events.
USER-CALLABLE ROUTINES
Before the driver can be used, it must be initialized by calling pcmciaInit( ). This routine
should be called exactly once, before any PC card device driver is used. Normally, it is
called from usrRoot( ) in usrConfig.c.
The pcmciaInit( ) routine performs the following actions:
- Creates a message queue.
- Spawns a PCMCIA daemon, which handles jobs in the message queue.
- Finds out which PCMCIA chip is installed and fills out the PCMCIA_CHIP structure.
- Connects the CSC (Card Status Change) interrupt handler.
- Searches all sockets for a PC card. If a card is found, it:
- gets CIS (Card Information Structure) information from a card
- determines what type of PC card is in the socket
- allocates a resource for the card if the card is supported
- enables the card
- Enables the CSC interrupt.
The CSC interrupt handler performs the following actions:
- Searches all sockets for CSC events.
- Calls the PC card's CSC interrupt handler, if there is a PC card in the socket.
- If the CSC event is a hot insertion, it asks the PCMCIA daemon to call cisGet( ) at
task level. This call reads the CIS, determines the type of PC card, and initializes a
device driver for the card.
- If the CSC event is a hot removal, it asks the PCMCIA daemon to call cisFree( ) at
task level. This call de-allocates resources.
117
VxWorks Drivers API Reference, 6.6
pcmciaShow
pcmciaShow
NAME pcmciaShow – PCMCIA show library
DESCRIPTION This library provides a show routine that shows the status of the PCMCIA chip and the PC
card.
pentiumPci
NAME pentiumPci – PCI host controller for Pentium CPU
DESCRIPTION This library contains the support routines for Pentium PCI host controllers on the vxBus.
ppc403Sio
NAME ppc403Sio – ppc403GA serial driver
118
1 Libraries
ppc440gpPci
DESCRIPTION This is the driver for PPC403GA serial port on the on-chip peripheral bus. The SPU (serial
port unit) consists of three main elements: receiver, transmitter, and baud-rate generator.
For details, refer to the PPC403GA Embedded Controller User's Manual.
USAGE A PPC403_CHAN structure is used to describe the chip. This data structure contains the
single serial channel. The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( )
which initializes all the values in the PPC403_CHAN structure (except the
SIO_DRV_FUNCS) before calling ppc403DevInit( ). The BSP's sysHwInit2( ) routine
typically calls sysSerialHwInit2( ) which connects the chip interrupt routines
ppc403IntWr( ) and ppc403IntRd( ) via intConnect( ).
IOCTL FUNCTIONS
This driver responds to the same ioctl( ) codes as other SIO drivers; for more information,
see sioLib.h.
ppc440gpPci
NAME ppc440gpPci – PCI host controller in PowerPC 440GP CPU
DESCRIPTION This module provides VxBus driver support for the onchip 440GP PCI bridge controller.
This driver support for PCI memory mapped and I/O mapped register access, PCI
configuration access.
119
VxWorks Drivers API Reference, 6.6
ppc860Sio
ppc860Sio
NAME ppc860Sio – Motorola MPC800 SMC UART serial driver
DESCRIPTION This is the driver for the SMCs in the internal Communications Processor (CP) of the
Motorola MPC68860/68821. This driver only supports the SMCs in asynchronous UART
mode.
USAGE A PPC800SMC_CHAN structure is used to describe the chip. The BSP's sysHwInit( )
routine typically calls sysSerialHwInit( ), which initializes all the values in the
PPC860SMC_CHAN structure (except the SIO_DRV_FUNCS) before calling
ppc860DevInit( ).
The BSP's sysHwInit2( ) routine typically calls sysSerialHwInit2( ) which connects the
chip's interrupts via intConnect( ).
rm9000x2glSio
NAME rm9000x2glSio – RM9000 tty driver
DESCRIPTION This is the driver for the RM9000x2gl DUART. This device includes two universal
asynchronous receiver/transmitters, a baud rate generator, and a complete modem control
capability.
A RM9000x2gl_CHAN structure is used to describe the serial channel. This data structure
is defined in rm9000x2glSio.h.
Only asynchronous serial operation is supported by this driver. The default serial settings
are 8 data bits, 1 stop bit, no parity, 9600 baud, and software flow control.
120
1 Libraries
shSciSio
This driver is a modification of the WindRiver ns16550Sio.c driver any changes to this
1
driver should also be reflected in the ns16550Sio.c driver.
USAGE The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ), which creates the
RM9000x2gl_CHAN structure and initializes all the values in the structure (except the
SIO_DRV_FUNCS) before calling rm9000x2glDevInit( ). The BSP's sysHwInit2( ) routine
typically calls sysSerialHwInit2( ), which connects the chips interrupts via intConnect( )
(either the single interrupt rm9000x2glInt or the three interrupts rm9000x2glIntWr,
rm9000x2glIntRd, and rm9000x2glIntEx).
This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the handshakes RTS/CTS. The
function HUPCL(hang up on last close) is available. When hardware flow control is
enabled, the signals RTS and DTR are set TRUE and remain set until a HUPCL is performed.
shSciSio
NAME shSciSio – Hitachi SH SCI (Serial Communications Interface) driver
DESCRIPTION This is the driver for the Hitachi SH series on-chip SCI (Serial Communication Interface). It
uses the SCI in asynchronous mode only.
121
VxWorks Drivers API Reference, 6.6
shScifSio
shScifSio
NAME shScifSio – Renesas SH SCIF (Serial Communications Interface) driver
DESCRIPTION This is the driver for the Renesas SH series on-chip SCIF (Serial Communication Interface
with FIFO). It uses the SCIF in asynchronous mode only.
sioChanUtil
NAME sioChanUtil – SIO Channel Utilities module
smEnd
NAME smEnd – END shared memory (SM) network interface driver
122
1 Libraries
smEnd
ROUTINES smEndLoad( ) – attach the SM interface to the MUX, initialize driver and device
1
DESCRIPTION This module implements the VxWorks shared memory (SM) Enhanced Network Driver
(END).
This driver is designed to be moderately generic, operating unmodified across most targets
supported by VxWorks. To achieve this, the driver must be given several target-specific
parameters, and some external support routines must be provided. These parameters are
detailed below.
There are no user-callable routines.
This driver is layered between the shared memory packet library and the MUX modules.
The SM END gives CPUs sharing common memory the ability to communicate using
Internet Protocol (IP).
Sending of multiple frames (mBlk chains) is supported but only single frames can be
received as there is not yet a netBufLib support routine to do so.
MUX INTERFACE The interfaces into this module from the MUX module follow.
123
VxWorks Drivers API Reference, 6.6
smEnd
smEndLoad
Called by the MUX, the routine initializes and attaches this shared memory network
interface driver to the MUX. It is the only globally accessible entry into this driver. This
routine typically gets called twice per SM interface and accepts a pointer to a string of
initialization parameters. The first call to this routine will be made with an empty
string. This action signals the routine to return a device name, not to load and initialize
the driver. The second call will be with a valid parameter string, signalling that the
driver is to be loaded and initialized with the parameter values in the string. The
shared memory region must have been setup and initialized (via smPktSetup) prior to
calling smEndLoad( ). Although initialized, no devices will become active until
smEndStart( ) is called.
The following routines are all local to this driver but are listed in the driver entry function
table:
smEndUnload( )
Called by the MUX, this routine stops all associated devices, frees driver resources, and
prepares this driver to be unloaded. If required, calls to smEndStop( ) will be made to
all active devices.
smEndStart( )
Called by the MUX, the routine starts this driver and device(s). The routine activates
this driver and its device(s). The activities performed are dependent upon the selected
mode of operation, interrupt or polled.
smEndStop( )
Called by the MUX, the routine stops this driver by inactivating the driver and its
associated device(s). Upon completion of this routine, this driver is left in the same
state it was just after smEndLoad( ) execution.
smEndRecv( )
This routine is not called from the MUX. It gets called from this drivers interrupt
service routine (ISR) to process input shared memory packets. It then passes them on
to the MUX.
smEndSend( )
Called by the MUX, this routine sends a packet via shared memory.
smEndPollRec( )
Called by the MUX, this routine polls the shared memory region designated for this
CPU to determine if any new packet buffers are available to be read. If so, it reads the
packet into the supplied mBlk and returns OK to the MUX. If the packet is too big for
the mBlk or if no packets are available, EAGAIN is returned. If the device is not in
polled mode, EIO is returned.
smEndPollSend( )
Called by the MUX, this routine does a polled send of one packet to shared memory.
Because shared memory buffers act as a message queue, this routine will attempt to put
the polled mode packet at the head of the list of buffers. If no free buffers are available,
124
1 Libraries
smEnd
the buffer currently appearing first in the list is overwritten with the packet. This
1
routine returns OK or an error code directly, not through errno. It does not free the
Mblk it is passed under any circumstances, that being the responsibility of the caller.
smEndIoctl( )
Called by the MUX, the routine accesses the control routines for this driver.
smEndMCastAddrAdd( )
Called by the MUX, this routine adds an address to a device's multicast address list.
smEndMCastAddrDel( )
Called by the MUX, this routine deletes an address from a device's multicast address
list.
smEndMCastAddrGet( )
Called by the MUX, this routine gets the multicast address list maintained for a
specified device.
The following routines do not require shared memory specific logic so the default END
library routines are referenced in the function table:
endEtherAddressForm( )
Called by the MUX, this routine forms an address by adding appropriate link-level
(shared memory) information to a specified mBlk in preparation for transmission.
endEtherPacketDataGet( )
Called by the MUX, this routine derives the protocol specific data within a specified
mBlk by stripping the link-level (shared memory) information from it. The resulting
data are copied to another mBlk.
endEtherPacketAddrGet( )
Called by the MUX, this routine extracts address information from one mBlk, ignoring
all other data. Each source and destination address is written to its own mBlk. For
ethernet packets, this routine produces two output mBlks (an address pair). However,
for non-ethernet packets, up to four mBlks (two address pairs) may be produced; two
for an intermediate address pair and two more for the terminal address pair.
125
VxWorks Drivers API Reference, 6.6
smEnd
...
result = ioctl (smFd, SMIOCSMCPYRTN, (int)myDmaCopyFunc);
...
smEndMblkCopyRtn( )
int smEndMblkCopyRtn (M_BLK_ID, char *, FUNCPTR);
A function hook to allow the BSP to specify how frames (mblk chains) are copied to and
from SM packets. The default is netMblkToBufCopy( ), a unidirectional copy. Any
function specified must have the same type, number, and order of input and output
arguments. The following IOCTL codes apply:
SMIOCGCCPYRTN - get chained mblk copy routine pointer
SMIOCSCCPYRTN - set chained mblk copy routine pointer
For example:
int myDmaMblkCopyFunc (M_BLK_ID pFrame, char * pBuf, UINT copyDirection);
int smFd; /* SM file descriptor */
STATUS result;
...
result = ioctl (smFd, SMIOCSCCPYRTN, (int)myDmaMblkCopyFunc);
...
TARGET-SPECIFIC PARAMETERS
These parameters are input to this driver in an ASCII string format, using colon delimited
values, via the smEndLoad( ) routine. Each parameter has a preselected radix in which it is
expected to be read as shown below.
Parameter Radix Use
SM_UNIT 10 Unit number assigned to shared memory device
SM_NET_DEV_NAME -- String literal name of shared memory device
SM_ANCHOR_ADRS 16 SM anchor region address within SM address
space
SM_MEM_ADRS 16 Shared memory address
SM_MEM_MEM_SIZE 16 Shared memory network size in bytes.
Used by the master CPU when building SM.
SM_TAS_TYPE 10 Test-and-set type (SM_TAS_HARD or
SM_TAS_SOFT)
SM_CPUS_MAX 10 Maximum number of CPUs supported in SM (0
= default)
SM_MASTER_CPU 10 Master CPU#
SM_LOCAL_CPU 10 This board's CPU number (NONE = use
sysProcNumGet)
SM_PKTS_SIZE 10 Max number of data bytes per shared memory
packet (0 = default)
126
1 Libraries
smEndShow
ISR LIMITATIONS
Because this driver may be used in systems without chaining of interrupts, and there can be
two or more SM subnets using the same type of SM interrupt, all shared memory subnets
are serviced each time there is an interrupt by the SM interrupt service routine (ISR)
smEndIsr( ). This is NOT optimal and does waste some time but is required due to the lack
of guaranteed SM interrupt chaining.
When and if interrupt chaining becomes a guaranteed feature for all SM interrupt types, the
ISR can be optimized.
MESSAGE LIMITATIONS
This driver does not support multicast messages or multicast operations.
INCLUDES smEnd.h
smEndShow
NAME smEndShow – shared memory network END driver show routines
DESCRIPTION This library provides show routines for the shared memory network interface END driver.
The smNetShow( ) routine is provided as a diagnostic aid to show current shared memory
network status.
127
VxWorks Drivers API Reference, 6.6
smcFdc37b78x
smcFdc37b78x
NAME smcFdc37b78x – a superIO (fdc37b78x) initialization source module
ROUTINES smcFdc37b78xDevCreate( ) – set correct IO port addresses for Super I/O chip
smcFdc37b78xInit( ) – initializes Super I/O chip Library
smcFdc37b78xKbdInit( ) – initializes the keyboard controller
DESCRIPTION The FDC37B78x with advanced Consumer IR and IrDA v1.0 support incorporates a
keyboard interface, real-time clock, SMSC's true CMOS 765B floppy disk controller,
advanced digital data separator, 16 byte data FIFO, two 16C550 compatible UARTs, one
Multi-Mode parallel port which includes ChiProtect circuitry plus EPP and ECP support,
on-chip 12 mA AT bus drivers, and two floppy direct drive support, soft power
management and SMI support and Intelligent Power Management including PME and
SCI/ACPI support. The true CMOS 765B core provides 100% compatibility with IBM
PC/XT and PC/AT architectures in addition to providing data overflow and underflow
protection. The SMSC advanced digital data separator incorporates SMSC's patented data
separator technology, allowing for ease of testing and use. Both on-chip UARTs are
compatible with the NS16C550. The parallel port, the IDE interface, and the game port select
logic are compatible with IBM PC/AT architecture, as well as EPP and ECP.
The FDC37B78x incorporates sophisticated power control circuitry (PCC) which includes
support for keyboard, mouse, modem ring, power button support and consumer infrared
wake-up events. The PCC supports multiple low power down modes.
The FDC37B78x provides features for compliance with the "Advanced Configuration and
Power Interface Specification" (ACPI). These features include support of both legacy and
ACPI power management models through the selection of SMI or SCI. It implements a
power button override event (4 second button hold to turn off the system) and either edge
triggered interrupts.
The FDC37B78x provides support for the ISA Plug-and-Play Standard (Version 1.0a) and
provides for the recommended functionality to support Windows95, PC97 and PC98.
Through internal configuration registers, each of the FDC37B78x's logical device's I/O
address, DMA channel and IRQ channel may be programmed. There are 480 I/O address
location options, 12 IRQ options or Serial IRQ option, and four DMA channel options for
each logical device.
USAGE This library provides routines to intialize various logical devices on superIO chip
(fdc37b78x).
The functions addressed here include:
128
1 Libraries
smcFdc37b78x
129
VxWorks Drivers API Reference, 6.6
sramDrv
SMCFDC37B78X_LPT1_EN
Use this mnemonic to enable LPT1 only.
SMCFDC37B78X_KBD_EN
Use this mnemonic to enable KBD only.
SMCFDC37B78X_FDD_EN
Use this mnemonic to enable FDD only.
The above mentioned can be bitwise ORed to enable more than one device at a time. e.g. if
you want COM1 and COM2 to be enable on superIO chip call:
smcFdc37b78xInit (SMCFDC37B78X_COM1_EN | SMCFDC37B78X_COM2_EN);
The prerequisites for above mentioned call, superIO chip library should be intialized using
smcFdc37b78xDevCreate( ) with parameter as per user's need.
STATUS smcFdc37b78xKbdInit
(
VOID
)
This routine sends some keyboard commands to keyboard controller embedded in superIO
chip. Call to this function is required for proper functioning of keyboard driver.
sramDrv
NAME sramDrv – PCMCIA SRAM device driver
DESCRIPTION This is a device driver for the SRAM PC card. The memory location and size are specified
when the "disk" is created.
USER-CALLABLE ROUTINES
Most of the routines in this driver are accessible only through the I/O system. However,
two routines must be called directly: sramDrv( ) to initialize the driver, and
sramDevCreate( ) to create block devices. Additionally, the sramMap( ) routine is called
directly to map the PCMCIA memory onto the ISA address space. Note that this routine
does not use any mutual exclusion or synchronization mechanism; thus, special care must
be taken in the multitasking environment.
130
1 Libraries
sym895Lib
Before using this driver, it must be initialized by calling sramDrv( ). This routine should be
1
called only once, before any reads, writes, or calls to sramDevCreate( ) or sramMap( ). It
can be called from usrRoot( ) in usrConfig.c or at some later point.
sym895Lib
NAME sym895Lib – SCSI-2 driver for Symbios SYM895 SCSI Controller.
DESCRIPTION The SYM53C895 PCI-SCSI I/O Processor (SIOP) brings Ultra2 SCSI performance to Host
adapter, making it easy to add a high performance SCSI Bus to any PCI System. It supports
Ultra-2 SCSI rates and allows increased SCSI connectivity and cable length Low Voltage
Differential (LVD) signaling for SCSI. This driver runs in conjunction with SCRIPTS
Assembly program for the Symbios SCSI controllers. These scripts use DMA transfers for
all data, messages, and status transfers.
For each controller device a manager task is created to manage SCSI threads on each bus. A
SCSI thread represents each unit of SCSI work.
This driver supports multiple initiators, disconnect/reconnect, tagged command queuing
and synchronous data transfer protocol. In general, the SCSI system and this driver will
automatically choose the best combination of these features to suit the target devices used.
However, the default choices may be over-ridden by using the function
"scsiTargetOptionsSet( )" (see scsiLib).
Scatter/ Gather memory support: Scatter-Gather transfers are used when data scattered
across memory must be transferred across the SCSI bus together with out CPU
intervention. This is achieved by a chain of block move script instructions together with the
support from the driver. The driver is expected to provide a set of addresses and byte counts
for the SCRIPTS code. However there is no support as such from vxworks SCSI Manager
for this kind of data transfers. So the implementation, as of today, is not completely
integrated with vxworks, and assumes support from SCSI manager in the form of array of
131
VxWorks Drivers API Reference, 6.6
sym895Lib
USER-CALLABLE ROUTINES
Most of the routines in this driver are accessible only through the I/O system. Three
routines, however, must be called directly sym895CtrlCreate( ) to create a controller
structure, and sym895CtrlInit( ) to initialize it. If the default configuration is not correct, the
routine sym895SetHwRegister( ) must be used to properly configure the registers.
Critical events, which are to be logged anyway irrespective of whether debugging is being
done or not, can be logged by using the SCSI_MSG macro.
INTERFACE The BSP must connect the interrupt service routine for the controller device to the
appropriate interrupt system. The routine to be called is sym895Intr( ), and the argument
is the pointer to the controller device pSiop. i.e.
pSiop = sym895CtrlCreate (...);
intConnect (XXXX, sym895Intr, pSiop);
sym895CtrlInit (pSiop, ...);
HARDWARE ACCESS
All hardware access is to be done through macros. The default definition of the
SYM895_REGx_READ( ) and SYM895_REGx_WRITE( ) macros (where x stands for the
width of the register being accessed ) assumes an I/O mapped model. Register access mode
can be set to either IO/memory using SYM895_IO_MAPPED macro in sym895.h. The
macros can be redefined as necessary to accommodate other models, and situations where
timing and write pipe considerations need to be addressed. In IO mapped mode, BSP
routines sysInByte( ), sysOutByte( ) are used for accessing SYM895 registers. If these
standard calls are not supported, the calls supported by respective BSP are to be mapped
to these standard calls. Memory mapped mode makes use of pointers to register offsets.
The macro SYM895_REGx_READ(pDev, reg) is used to read a register of width x bits. The
two arguments are the device structure pointer and the register offset.
132
1 Libraries
tcicShow
SEE ALSO scsiLib, scsi2Lib, cacheLib, SYM53C895 PCI-SCSI I/O Processor Data Manual Version 3.0,
Symbios Logic PCI-SCSI I/O Processors Programming Guide Version 2.1
tcic
NAME tcic – Databook TCIC/2 PCMCIA host bus adaptor chip driver
DESCRIPTION This library contains routines to manipulate the PCMCIA functions on the Databook
DB86082 PCMCIA chip.
The initialization routine tcicInit( ) is the only global function and is included in the
PCMCIA chip table pcmciaAdapter. If tcicInit( ) finds the TCIC chip, it registers all
function pointers of the PCMCIA_CHIP structure.
tcicShow
NAME tcicShow – Databook TCIC/2 PCMCIA host bus adaptor chip show library
DESCRIPTION This is a driver show routine for the Databook DB86082 PCMCIA chip. tcicShow( ) is the
only global function and is installed in the PCMCIA chip table pcmciaAdapter in
pcmciaShowInit( ).
133
VxWorks Drivers API Reference, 6.6
tffsConfig
tffsConfig
NAME tffsConfig – TrueFFS configuration file for VxWorks
DESCRIPTION This source file, with the help of sysTffs.c, configures TrueFFS for VxWorks. The functions
defined here are generic to all BSPs. To include these functions in the BSP-specific module,
the BSP's sysTffs.c file includes this file. Within the sysTffs.c file, define statements
determine which functions from the tffsConfig.c file are ultimately included in TrueFFS.
The only externally callable routines defined in this file are tffsShow( ), tffsShowAll( ), and
tffsBootImagePut( ). You can exclude the show utilities if you edit config.h and undefine
INCLUDE_SHOW_ROUTINES. You can exclude tffsBootImagePut( ) if you edit sysTffs.c
and undefine INCLUDE_TFFS_BOOT_IMAGE. (If you find these utilities are missing and
you want them included, edit config.h and define INCLUDE_SHOW_ROUTINES and
INCLUDE_TFFS_BOOT_IMAGE.)
If you wish to include only the TrueFFS specific show routines you could define
INCLUDE_TFFS_SHOW instead of INCLUDE_SHOW_ROUTINES in config.h.
However, for the most part, these externally callable routines are only a small part of the
TrueFFS configuration needs handled by this file. The routines internal to this file make
calls into the MTDs and translation layer modules of TrueFFS. At link time, resolving the
symbols associated with these calls pulls MTD and translation layer modules into
VxWorks.
However, each of these calls to the MTDs and the translation layer modules is only
conditionally included. The constants that control the includes are defined in sysTffs.c. To
exclude an MTD or translation layer module, you edit sysTffs.c, undefine the appropriate
constant, and rebuild sysTffs.o. These constants are described in the reference entry for
sysTffs.
vgaInit
NAME vgaInit – a VGA 3+ mode initialization source module
ROUTINES vgaInit( ) – initializes the VGA chip and loads font in memory.
134
1 Libraries
vxBus
DESCRIPTION This library provides initialization routines to configure VGA in 3+ alphanumeric mode.
1
The functions addressed here include:
- Initialization of the VGA specific register set.
REFERENCES Programmer's Guide to the EGA, VGA, and Super VGA Cards - Ferraro. Programmer's Guide to
PC & PS/2 Video Systems - Richard Wilton.
vxBus
NAME vxBus – vxBus subsystem source file
135
VxWorks Drivers API Reference, 6.6
vxbArchAccess
DESCRIPTION This library contains the support routines for the vxBus subsystem.
vxbArchAccess
NAME vxbArchAccess – vxBus access routines specific to an architecture
136
1 Libraries
vxbArchAccess
137
VxWorks Drivers API Reference, 6.6
vxbAuxClkLib
DESCRIPTION This library contains the support routines for architecture dependent access on the vxBus.
vxbAuxClkLib
NAME vxbAuxClkLib – vxBus auxiliary clock library
138
1 Libraries
vxbCn3xxxTimer
vxbCn3xxxTimer
NAME vxbCn3xxxTimer – Cn3xxxTimer driver for VxBus
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
timers on Cavium CN3xxx Core.
The cn3xxx timer has 23-bit counter and clock upto a frequency of 1MHz. Hence it allows a
maximum count of 8388608. It can operate in two modes:
i) One shot mode - The timer counts down to 0 and stops. ii) Repeated mode - The timer
counts done to 0 and gets automatically reloaded
A timer specific data structure (struct cn3xxxTimerData) is maintained within this driver.
This is given as pCookie in cn3xxxTimerAllocate and can be used from there-on by the
Timer Abstraction Layer/application to communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
cn3xxxTimerInstInit (), cn3xxxTimerInstInit2 () and cn3xxxTimerInstConnect ().
A variable of type struct cn3xxxTimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in cn3xxxTimerInstInit ()
cn3xxxTimerInstInit2 () hooks an ISR to be used for the timer device and also hooks the
decrementer exception handler.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer/application to retrieve the characteristics of a
timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
Abstraction Layer/application and pointer to this structure is given as the parameter to this
method. The timer driver populates this data structure with the features of the timer device.
The driver is SMP-Aware. It uses ISR-Task Callable spinlock instead of inlocks for locking
of interrupt. Hence it will work on SMP Environment.
139
VxWorks Drivers API Reference, 6.6
vxbColdFireSio
vxbColdFireSio
NAME vxbColdFireSio – coldfire vxBus Serial Communications driver
DESCRIPTION This is the driver for the UART contained in the ColdFire Microcontroller.
vxbDelayLib
NAME vxbDelayLib – vxBus delay function interfaces file
DESCRIPTION This file implements the vxbus delay functionalities like vxbDelay (), vxbMsDelay () and
vxbMsDelay (). All the delay functions are busy wait functions.
vxbDelay () gives a delay of 1 ms vxbMsDelay () is used to give a delay in units of
milliseconds vxbUsDelay () is used to give a delay in units of microseconds
vxbDevTable
NAME vxbDevTable – Support utils for table-based device enumeration
DESCRIPTION This library contains the utility functions used for the table based device enumeration.
140
1 Libraries
vxbDmaBufLib
vxbDmaBufLib 1
DESCRIPTION This module provides support for driver DMA. The organization of this follows the
FreeBSD bus_dma to some extent.
DMA devices are supported by use of a DMA Tag. Each DMA tag corresponds to a set of
restrictions on DMA. These restrictions include information such as alignment, transaction
size, minimum and maximum address ranges, and so on. Tags are created with the
vxbDmaBufTagCreate( ) function.
Once a DMA tag is available, the driver should create DMA maps to describe pending
operations. A map is created when a buffer address (or a set of buffer addresses) is provided
to this module. The map contains the physical addresses representing the buffer which the
driver can use to fill in to descriptor fields. Each map usually represents a single pending
transfer. Scatter/gather is supported both with the UIO structure or with mBlks.
Buffers may be cached, and that is handled by the use of flush and invalidate operations,
vxbDmaBufMapFlush( ) and vxbDmaBufMapInvalidate( ). Before initiating a write
operation, the driver must call the flush function. After a buffer has been filled by the DMA
device, the driver must call the invalidate function before passing the data to the
OS/middleware module (e.g. the network stack or filesystem). The vxbDmaBufSync( )
operation, with the same semantics as the FreeBSD version, is available to help ease porting
of FreeBSD drivers to VxWorks.
Device descriptors are special in several ways. Memory for the descriptors must be
allocated somehow, but DMA restrictions are still in place for the descriptors, since both the
141
VxWorks Drivers API Reference, 6.6
vxbDmaBufLib
CPU and the device access the data contained in the descriptors. This module provides a
memory allocation function, vxbDmaBufMemAlloc( ), intended primarily for use as
descriptors. In addition, descriptors require DMA maps in order for the driver to program
the descriptor location into device register(s). However, flush and invalidate operations
should be performed on an individual descriptor, and not on the entire descriptor table.
Drivers may choose to have a map for each descriptor, or a single map for all descriptors. If
a single map is used, flush and invalidate operations can be performed on a range within a
DMA map with the vxbDmaBufFlush( ) and vxbDmaBufInvalidate( ) functions, which
accept offset and size arguments.
Typical calling sequences include:
descriptors:
vxbDmaBufTagCreate( )
vxbDmaBufMemAlloc( )
vxbDmaBufFlush( ) and vxbDmaBufInvalidate( )
buffers:
during initialization:
vxbDmaBufTagCreate( )
vxbDmaBufMapCreate( )
142
1 Libraries
vxbEndQctrl
pool has been initialized, which occurs before the VxBus init2 routine. So
1
vxbDmaBufMemAlloc( ) cannot be used in the driver's probe or init1 routines. Second,
some hardware platforms cannot use memory from the system memory pool (whether
cached or not). Therefore, this module allows BSP hooks for the BSP to override the
memory allocation and free routines. The routines must take the VXB_DEVICE_ID and size
as arguments to the allocation routine, and the VXB_DEVICE_ID and address as arguments
to the free routine. If provided, the BSP routines must allocate buffers for all devices, though
internally they can default to malloc( ) and free( ) for everything except the
special-requirements devices. Once installed, the BSP hooks must not be changed.
vxbDmaLib
NAME vxbDmaLib – vxBus DMA interfaces module
DESCRIPTION This library provides the DMA specific interfaces which can be used by device drivers to
perform DMA operations.
vxbEndQctrl
NAME vxbEndQctrl – utility to change the RX job queue of a vxbus END device
DESCRIPTION This module provides convenient functions to change the job queue used by an END device
to deliver received packets to the MUX (and to attached network protocols). In SMP
systems, assigning different interfaces to different job queues may improve performance for
some network loads.
This component may be added to the VxWorks image by including the component
INCLUDE_VXBUS_END_QCTRL.
143
VxWorks Drivers API Reference, 6.6
vxbEpicIntCtlr
By default, a VxBus END device will post work to the job queue serviced by the network
daemon tNet0, i.e. to network job queue number 0. To set the job queue used by a VxBus
END device to a different job queue, use the routine vxbEndRxQnumByNameSet( ). For
instance, to set the interface gei2 to use job queue number 1 (serviced by tNet1), call:
vxbEndRxQnumByNameSet ("gei", 2, 1);
vxbEpicIntCtlr
NAME vxbEpicIntCtlr – Driver for Embedded Programmable Interrupt Controller
DESCRIPTION This module implements the Embedded Programmable Interrupt Controller (EPIC) driver
for the MPC8548.
The EPIC is an integrated interrupt controller in the 8548 which provides following major
capabilities:
Support for twelve external interrupt sources and thirty-two internal
interrupt sources
The current implementation of this EPIC controller does not support the following features
or mode of operations:
144
1 Libraries
vxbEpicIntCtlr
EPIC features are customized by writing into general control registers or into interrupt level
specific registers (IVPRs).
This driver allows a basic interface to the EPIC such as initializing it, setting interrupt
vectors, priorities, level/edge sense and interrupt polarities, as well as enabling and
disabling specific interrupts.
This driver implements a complete interrupt architecture system, complete with vector
table.
Since interrupt vectors can be shared, this driver does provide for overloading of interrupt
routines (i.e. there is a list of interrupt routines for each interrupt vector (level)). To service
a vector requires that all connected interrupt routines be called in order of their connection.
The following diagram shows an example of how interrupts can be configured in this
system.
EPIC Vector table
0 |-------| <-- external INT0 starts
|-------|
|-------|------------------------------+
.... |
|-------| |
|-------| |
12 |-------| <-- internal INT0 starts | (EPIC_MAX_EXT_IRQS) = 12
|-------| |
|-------| |
.... |
|-------| |
|-------| |
44 |-------| <-- global timer INT0 starts | (EPIC_MAX_EXT_IRQS + \
|-------| | EPIC_MAX_IN_IRQS) = 44
|-------| |
|-------| |
48 |-------| <-- message INT0 starts | (EPIC_MAX_EXT_IRQS + \
|-------| | EPIC_MAX_IN_IRQS + \
|-------| | EPIC_MAX_GT_IRQS) = 48
|-------| |
52 |-------| <-- IPI INT0 starts | (EPIC_MAX_EXT_IRQS + \
|-------| | EPIC_MAX_IN_IRQS + \
|-------| | EPIC_MAX_GT_IRQS + \
55 |-------| | EPIC_MAX_MSG_IRQS) = 52 56 |-------|<-----------------------------+
sysVectorIRQ0 = 56 \
.... WinBond int handler | = 52 + EPIC_MAX_IPI_IRQS
145
VxWorks Drivers API Reference, 6.6
vxbEpicIntCtlr
|-------| +-------------+
|-------| |
|-------| PCI slot 3 int handler
|-------|
|-------|<----- Cascaded 8259s
|-------|
|-------|
....
|-------|
|-------|
|-------|
|-------|
256|-------|
The driver is designed to put external interrupts at the beginning of the vector table. As a
result, devices that route their interrupt to the EPIC on the MPC8540 does not need to
translate the vector number. Therefore, the macros IVEC_TO_INUM(x) and
INUM_TO_IVEC(x) are not necessary. For some existing drivers, it may be necessary to use
the following defines:
#undef INUM_TO_IVEC
#define INUM_TO_IVEC(x) (x)
#undef IVEC_TO_INUM
#define IVEC_TO_INUM(x) (x)
If there are other devices in the system capable of generating their own vectors then we
presume that an appropriate interrupt handler is created and attached to the vector
associated with the correct IRQ number. That interrupt handler would get a new vector
directly from the device and then call all of the handlers attached to that new vector. Vector
information is stored in a linked list of INT_HANDLER_DESC structures. The vxbEpicIntTbl
array contains a pointer to the first entry for each vector.
INITIALIZATION This driver is initialized from the BSP, usually as part of sysHwInit( ). The first routine to
be called is vxbSysEpicInit( ). The routine resets the global configuration register and resets
the vxbEpic registers to default values.
The second routine to be called is vxbSysEpicIntrInit( ). This routine takes no arguments.
This routine allocates the vector table and initializes the chips to a default state. All
individual interrupt sources are disabled. Each has to be individually enabled by
intEnable( ) before it will be unmasked and allowed to generate an interrupt.
CRITICAL INTERRUPT
To enable the EPIC to handle also critical interrupt, or if a normal interrupt is to be rerouted
to the critical input pin, add the following to the hcfResource table for the epic in hwconf.c:
const struct hcfResource epic0Resources[] = {
/* ... */
{ "crtEnable", HCF_RES_INT, {(void *)TRUE } },
146
1 Libraries
vxbHwifDebug
/* ... */
1
};
The critical interrupt handler uses information from the summary registers CISR0 and
CISR1. The EPIC does not manage critical interrupts and hence Iack or EOI do not apply.
It was seen that the summary registers go through a transient state before settling on the
result. This causes spurious interrupts to be generated, and the vectors being called. A
typical behavior is the printout of "uninitialized PIC interrupt vector 0xXX". This is
observed only when at least one source has been routed to critical pin.
The macros CPU_INT_LOCK( ) and CPU_INT_UNLOCK provide the access to the CPU level
interrupt lock/unlock routines. We presume that there is a single interrupt line to the CPU.
By default these macros call intLock( ) and intUnlock( ) respectively.
INCLUDE FILES
vxbHwifDebug
NAME vxbHwifDebug – - HWIF Debug Utilities
147
VxWorks Drivers API Reference, 6.6
vxbI8253Timer
DESCRIPTION This library implements the debug functions for the hwif modules
vxbI8253Timer
NAME vxbI8253Timer – driver for the intel 8253 timer
DESCRIPTION This is the vxBus compliant timer driver which interacts with the Intel 8253 timer.
A timer specific data structure (struct i8253TimerData) is maintained for each of the 3 timers
supported by this driver. An array of such data structures is stored in struct i8253Data;
The driver implements all the vxBus driver specific initialization routines like
i8253TimerInstInit (), i8253TimerInstInit2 () and i8253TimerInstConnect ().
A variable of type struct i8253Data is allocated for the instance and stored in
pInst->pDrvCtrl in i8253TimerInstInit ()
i8253TimerInstInit2 () hooks the ISRs to be used.
A method for methodId vxbTimerFuncGet_desc is implemented in this driver and is used
by the Timer Abstraction Layer/application to retrieve the characteristics of a timer device.
TARGET-SPECIFIC PARAMETERS
The parameters are retrieved from hwconf.c in the target BSP.
regBase
i8253 base address. The parameter type is HCF_RES_INT.
countRegAddr
count register address The parameter type is HCF_RES_INT.
irq
Interrupt vector number for the timer interrupt source. The parameter type is
HCF_RES_INT.
irqLevel
Interrupt number for the timer interrupt source. The parameter type is HCF_RES_INT.
clkFreq
clock frequency of i8253 timer. The parameter type is HCF_RES_INT.
148
1 Libraries
vxbI8259IntCtlr
clkRateMin
1
Specify the minimum clock rate(in ticks/sec) which can be supported by the i8253
timer. The parameter type is HCF_RES_INT.
clkRateMax
Specify the maximum clock rate(in ticks/sec) which can be supported by the i8253
timer. The parameter type is HCF_RES_INT.
vxbI8259IntCtlr
NAME vxbI8259IntCtlr – Intel 8259A Programmable Interrupt Controller driver
DESCRIPTION This module is a driver for the Intel 8259A PIC (Programmable Interrupt Controller). The
Intel 8259A handles up to 8 vectored priority interrupts for the CPU. It is cascade-able for
up to 64 vectored priority interrupts. Hence we can cascade 8 Intel 8259 Controllers together
to obtain 64 vectored priority interrupts.
The 8259A accepts two types of command words generated by the CPU:
1. Initialization Command Words (ICWs): Before normal operation can begin, each 8259A
in the system must be brought to a starting point by a sequence of 2 to 4 bytes timed by WR
pulses. There are 4 ICWs.
2. Operation Command Words (OCWs): These are the command words which command
the 8259A to operate in various interrupt modes.
Communicating with I8259A
Communication with the 8259A is facilitated by sending various commands over the bus
to the two I/O ports (port A and port B) of the controller. ICW1 is sent over Port A and
ICW2, ICW3 and ICW4 is send over portB
The 8259A PIC can be controlled by sending specific operation command words (OCWs) to
either port B (OCW-1) or port A (OCW-2 and OCW-3).
Intel 8259 PIC can work in following modes: a. Fully nested mode : b. Rotating priority
mode c. Special mask mode d. Polled mode For more information on these modes, please
refer to Intel 8259 PIC (Programmable Interrupt Controller Manual.
149
VxWorks Drivers API Reference, 6.6
vxbIntCtlrLib
INITIALIZATION This driver is initialized from the BSP, usually as part of sysHwInit( ). The driver registers
its self with vxBus using the vxbDevRegister () function. During initialization, the interrupt
controller is initialized by issuing the ICW commands.
The interrupt controller drive also registers following method: i) Method to connect an ISR
to an interrupt pin ii) Method to disconnect an ISR from an interrupt pin iii) Method to
enable interrupt iv) Method to disable interrpt v) Method to acknowledge the interrupt
LEGACY SUPPORT This driver provides legacy support to older I8259 PIC. It maintains some global pointers
which get polulated only if legacy support is defined.
PLEASE NOTE THAT WE NEED TO REMOVE THIS LEGACY SUPPORT ONCE ALL THE DRIVERS
vxbIntCtlrLib
NAME vxbIntCtlrLib – - VxBus Interrupt Controller support library
150
1 Libraries
vxbIntelTimestamp
DESCRIPTION This is the library file for vxBus Interrupt Controller Drivers. This file provides the interfaces
that are used by vxBus Interrupt Controller Drivers. 1
vxbIntDynaCtlrLib
NAME vxbIntDynaCtlrLib – - VxBus Dynamic Interrupt support library
DESCRIPTION This is the library file for vxbus dynamic interrupt support.
vxbIntelTimestamp
NAME vxbIntelTimestamp – Driver for the timestamp on the intel chip
DESCRIPTION
NOTE It is strongly recommended that 32-bit software only operate the timer in 32-bit mode. A
race condition arises if the 32-bit CPU reads the 64-bit register using two seperate 32-bit
reads.
This is the vxBus compliant timer driver which interacts with the timestamp on the intel
chip.
The timestamp details are maintained in struct iaTimestampData.
The driver implements all the vxBus driver specific initialization routines like
iaTimestampInstInit (), iaTimestampInstInit2 () and iaTimestampInstConnect ().
151
VxWorks Drivers API Reference, 6.6
vxbIoApicIntr
A variable of type struct iaTimestampData is allocated for the instance and stored in
pInst->pDrvCtrl in iaTimestampInstInit ()
A method for methodId vxbTimerFuncGet_desc is implemented in this driver and is used
by the Timer Abstraction Layer/application to retrieve the characteristics of a timer device.
TARGET-SPECIFIC PARAMETERS
The following parameter is retrieved from hwconf.c in the target BSP.
clkFreq
Specify the clock frequency of the timestamp timer. The parameter type is
HCF_RES_INT.
vxbIoApicIntr
NAME vxbIoApicIntr – VxBus driver for the Intel IO APIC/xAPIC driver
DESCRIPTION This is the VxBus driver for the Io APIC Interrupt Driver
This module is a driver for the IO APIC/xAPIC (Advanced Programmable Interrupt
Controller) for P6 (PentiumPro, II, III) family processors and P7 (Pentium4) family
processors. The IO APIC/xAPIC is included in the Intel's system chip set, such as ICH2.
Software intervention may be required to enable the IO APIC/xAPIC in some chip sets.
The 8259A interrupt controller is intended for use in a uni-processor system, IO APIC can
be used in either a uni-processor or multi-processor system. The IO APIC handles
interrupts very differently than the 8259A. Briefly, these differences are:
- Method of Interrupt Transmission. The IO APIC transmits interrupts
through a 3-wire bus and interrupts are handled without the need for
the processor to run an interrupt acknowledge cycle.
- Interrupt Priority. The priority of interrupts in the IO APIC is
independent of the interrupt number. For example, interrupt 10 can
be given a higher priority than interrupt 3.
- More Interrupts. The IO APIC supports a total of 24 interrupts.
The IO APIC unit consists of a set of interrupt input signals, a 24-entry by 64-bit Interrupt
Redirection Table, programmable registers, and a message unit for sending and receiving
APIC messages over the APIC bus or the Front-Side (system) bus. IO devices inject
152
1 Libraries
vxbIxp400Sio
interrupts into the system by asserting one of the interrupt lines to the IO APIC. The IO
1
APIC selects the corresponding entry in the Redirection Table and uses the information in
that entry to format an interrupt request message. Each entry in the Redirection Table can
be individually programmed to indicate edge/level sensitive interrupt signals, the interrupt
vector and priority, the destination processor, and how the processor is selected (statically
and dynamically). The information in the table is used to transmit a message to other APIC
units (via the APIC bus or the Front-Side (system) bus).
IO APIC is used in the Symmetric IO Mode (define SYMMETRIC_IO_MODE in the BSP). The
base address of IO APIC is determined in loApicInit( ) and stored in the global variable
ioApicBase and ioApicData. ioApicInit( ) initializes the IO APIC with information stored
in ioApicRed0_15 and ioApicRed16_23. The ioApicRed0_15 is the default lower 32 bit value
of the redirection table entries for IRQ 0 to 15 that are edge triggered positive high, and the
ioApicRed16_23 is for IRQ 16 to 23 that are level triggered positive low. ioApicRedSet( )
and ioApicRedGet( ) are used to access the redirection table. ioApicEnable( ) enables the
IO APIC or xAPIC. ioApicIrqSet( ) set the specific IRQ to be delivered to the specific Local
APIC.
vxbIxp400Sio
NAME vxbIxp400Sio – IXP400 UART tty driver
DESCRIPTION This is the driver for the Intel IXP400 internal UART. This device comprises an
asynchronous receiver/transmitter, a baud rate generator, and some modem control
capability.
An IXP400_SIO_CHAN structure is used to describe the serial channel. This data structure
is defined in ixp400Sio.h.
Only asynchronous serial operation is supported by this driver. The default serial settings
are 8 data bits, 1 stop bit, no parity, 9600 baud, and software flow control.
USAGE This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the handshakes RTS/CTS.
153
VxWorks Drivers API Reference, 6.6
vxbIxp400Timer
vxbIxp400Timer
NAME vxbIxp400Timer – ixp4xx processor timer library
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
ixp400 timers.
A timer-specific data structure (struct ixp400TimerData) is maintained within this driver.
This is given as pCookie in ixp400TimerAllocate( ) and is used from then on by the Timer
Abstraction Layer or application to communicate with this driver.
The driver implements all the vxBus driver-specific initialization routines like
ixp400TimerInstInit( ), ixp400TimerInstInit2( ) and ixp400TimerInstConnect( ).
A variable of type struct ixp400TimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in ixp400TimerInstInit( )
ixp400TimerInstInit2( ) hooks an ISR to be used for the timer device.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer or application to retrieve the characteristics of
a timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
Abstraction Layer or application and pointer to this structure is given as the parameter to
this method. The timer driver populates this data structure with the features of the timer
device.
vxbLoApicIntr
NAME vxbLoApicIntr – VxBus driver template
154
1 Libraries
vxbLoApicIntr
DESCRIPTION This is the VxBus driver for the Local APIC Interrupt Driver
This module is a driver for the local APIC/xAPIC (Advanced Programmable Interrupt
Controller) in P6 (PentiumPro, II, III) family processors and P7 (Pentium4) family
processors. The local APIC/xAPIC is included in selected P6 (PentiumPro, II, III) and P7
(Pentium4) family processors. Beginning with the P6 family processors, the presence or
absence of an on-chip local APIC can be detected using the CPUID instruction. When the
CPUID instruction is executed, bit 9 of the feature flags returned in the EDX register
indicates the presence (set) or absence (clear) of an on-chip local APIC.
The local APIC performs two main functions for the processor: - It processes local external
interrupts that the processor receives at its
interrupt pins and local internal interrupts that software generates.
- In multiple-processor systems, it communicates with an external IO APIC
chip. The external IO APIC receives external interrupt events from the
system and interprocessor interrupts from the processors on the system bus
and distributes them to the processors on the system bus. The IO APIC is
part of Intel's system chip set.
The local APIC controls the dispatching of interrupts (to its associated processor) that it
receives either locally or from the IO APIC. It provides facilities for queuing, nesting and
masking of interrupts. It handles the interrupt delivery protocol with its local processor and
accesses to APIC registers, and also manages interprocessor interrupts and remote APIC
register reads. A timer on the local APIC allows local generation of interrupts, and local
interrupt pins permit local reception of processor-specific interrupts. The local APIC can be
disabled and used in conjunction with a standard 8259A style interrupt controller.
Disabling the local APIC can be done in hardware for the Pentium processors or in software
for the P6 and P7 (Pentium4) family processors.
The local APIC in the Pentium4 processors (called the xAPIC) is an extension of the local
APIC found in the P6 family processors. The primary difference between the APIC
architecture and xAPIC architecture is that with Pentium4 processors, the local xAPICs and
IO xAPIC communicate with one another through the processors system bus; whereas, with
the P6 family processors, communication between the local APICs and the IO APIC is
handled through a dedicated 3-wire APIC bus. Also, some of the architectural features of
the local APIC have been extended and/or modified in the local xAPIC.
The base address of the local APIC and IO APIC is taken from the MP configuration table
(see Intel MP Specification Version 1.4) or the IA32_APIC_BASE MSR. It uses
155
VxWorks Drivers API Reference, 6.6
vxbLoApicTimer
LOAPIC_BASE and IOAPIC_BASE defined in the BSP, if it is not able to find the addresses.
This driver contains three routines for use. They are:
loApicInit( ) initializes the Local APIC for the interrupt mode chosen. loApicEnable( )
enables or disables the Local APIC. loApicIpi( ) delivers the inter processor interrupt to the
specified local APIC.
Local APIC is used in the Virtual Wire Mode (define VIRTUAL_WIRE_MODE in the BSP) and
the Symmetric IO Mode (define SYMMETRIC_IO_MODE in the BSP), but not in the PIC
Mode which is the default interrupt mode and uses 8259A PIC.
Virtual Wire Mode is one of three interrupt modes defined by the MP specification. In this
mode, interrupts are generated by the 8259A equivalent PICs, but delivered to the Boot
Strap Processor by the local APIC that is programmed to act as a "virtual Wire"; that is, the
local APIC is logically indistinguishable from a hardware connection. This is a uniprocessor
compatibility mode.
Symmetric IO Mode is one of three interrupt modes defined by the MP specification. In this
mode, the local and IO APICs are fully functional, and interrupts are generated and
delivered to the processors by the APICs. Any interrupt can be delivered to any processor.
This is the only multiprocessor interrupt mode.
The local and IO APICs support interrupts in the range of 32 to 255. Interrupt priority is
implied by its vector, according to the following relationship: "priority = vector / 16".
Here the quotient is rounded down to the nearest integer value to determine the priority,
with 1 being the lowest and 15 is the highest. Because vectors 0 through 31 are reserved for
exclusive use by the processor, the priority of user defined interrupts range from 2 to 15. A
value of 15 in the Interrupt Class field of the Task Priority Register (TPR) will mask off all
interrupts, which require interrupt service.
The P6 family processor's local APIC includes an in-service entry and a holding entry for
each priority level. To avoid losing interrupts, software should allocate no more than 2
interrupt vectors per priority. The Pentium4 processor expands this support of all
acceptance of two interrupts per vector rather than per priority level.
vxbLoApicTimer
NAME vxbLoApicTimer – Driver for the loApic timer
DESCRIPTION This is the vxBus compliant timer driver which interacts with the loApic timer.
156
1 Libraries
vxbM548xDma
TARGET-SPECIFIC PARAMETERS
The parameters are retrieved from hwconf.c in the target BSP.
regBase
loApic timer register base address. The parameter type is HCF_RES_INT.
irq
Interrupt vector number for the timer interrupt source. The parameter type is
HCF_RES_INT.
irqLevel
Interrupt number for the timer interrupt source. The parameter type is HCF_RES_INT.
clkFreq
clock frequency of loApic timer. The parameter type is HCF_RES_INT.
clkRateMin
Specify the minimum clock rate(in ticks/sec) which can be supported by loApic timer.
The parameter type is HCF_RES_INT.
clkRateMax
Specify the maximum clock rate(in ticks/sec) which can be supported by loApic timer.
The parameter type is HCF_RES_INT.
vxbM548xDma
NAME vxbM548xDma – Coldfire MCD slave DMA VxBus driver
157
VxWorks Drivers API Reference, 6.6
vxbM54x5SliceTimer
DESCRIPTION This module implements a VxBus slave DMA driver front-end for the Coldfire
Multi-Channel DMA controller. The DMA controller is needed in order to support the
on-board FEC ethernet ports.
The MCD controller is driven by microcode, which is loaded from and manipulated using
an API library provided by Freescale. The library provides the ability to start, stop, pause
and resume DMA operations. For the FEC, once a DMA channel is started, it continues to
run until the DMA task is killed. The MCD controller has a single interrupt dedicated to it,
which fires whenever a transfer completes. The dma_utils module determines which
channel triggered the interrupt and invokes the callback which has been associated with
that channel. Note that callbacks occur in interrupt context, and as a resume, so do the DMA
completion routines registered via this module.
BOARD LAYOUT The Multi-Channel DMA controller is internal to the Coldfire CPU.
EXTERNAL INTERFACE
vxbM54x5SliceTimer
NAME vxbM54x5SliceTimer – timer driver for m54x5 Slice timers
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
m54x5 Slice timers
A timer specific data structure (struct m54x5TimerData) is maintained within this driver.
This is given as pCookie in m54x5TimerAllocate and can be used from there-on by the
Timer Abstraction Layer/application to communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
m54x5TimerInstInit (), m54x5TimerInstInit2 () and m54x5TimerInstConnect ().
A variable of type struct m54x5TimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in m54x5TimerInstInit ()
m54x5TimerInstInit2 () hooks an ISR to be used for the timer device.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer/application to retrieve the characteristics of a
timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
158
1 Libraries
vxbM85xxFITimer
Abstraction Layer/application and pointer to this structure is given as the parameter to this
1
method. The timer driver populates this data structure with the features of the timer device.
vxbM85xxDecTimer
NAME vxbM85xxDecTimer – driver for Book E PowerPC decrementer
ROUTINES
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to the
Book E PowerPC decrementer.
The Book E PowerPc specific decrementer is a enhanced one and it differs from legacy PPC
Decrementer. The Book E decrementer supports auto reload feature and provides seperate
registers for interrupt handling.
Decrmenter specific routines in this driver are appropriated from m85xxTimer.c.
The timer specific data structures are declared in vxbM85xxTimer.h and its populated by
m85xxTimerInstInit( ) during systme boot up, defined in vxbM85xxTimer.c.
m85xx Timer instance will allocate an array of per Timer data structure which contains the
members specific to the timers.
A pointer to the this timer data structure is recieved (*pCookie) by the timer driver
functions.
The Decremeter is initialized as one of two timers registered by the m85xxTimer instance.
This source file provides the Decrementer functionality specific routines to Timer
abstraction layer.
Note: This source file is not an independent one which needs to build along with other
m85xx timer driver files.
vxbM85xxFITimer
NAME vxbM85xxFITimer – driver for PowerPC Book E Fixed Interval Timer(FIT)
159
VxWorks Drivers API Reference, 6.6
vxbM85xxTimer
ROUTINES
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to the
Book E PowerPC Fixed Interval Timer(FIT).
The Book E PowerPc specific FIT gives time periods in a fixed range.
The FIT specific routines in this driver are appropriated from m85xxTimer.c.
A common timer specific data structure is declared in vxbM85xxTimer.h, which consists of
members required by the timer like Count, timerState etc.,
The timer data structure is populated by m85xxTimerInstInit( ) during system boot up, as
defined in vxbM85xxTimer.c.
FIT is initialized as one of two timers registered by the m85xxTimer instance.
This source file provides the FIT functionality specific routines to Timer abstraction layer.
Note: This source file is not an independent one which needs to build along with other
m85xx timer driver files.
vxbM85xxTimer
NAME vxbM85xxTimer – timer driver for m85xx PowerPC Book E Architecture
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to the
PowerPC Book E Timer Device.
The Book E Timer Device consists of three timer devices with single time base.
1. Decrementer
2. Fixed Interval Timer (FIT)
3. Watch Dog Timer
All the 3 timer devices uses the same Timer Registers (i.e.Control and Status registers) for
enabling, count loading and interrupt handling etc., Hence this driver implements three
timer functionalities in a single timer device instance.
The timer specific functions are defined in three seperate source files named
vxbM85xxDecTimer.c, vxbM85xxFITimer.c and vxbM85xxWDTimer.c
160
1 Libraries
vxbM85xxTimer
TARGET-SPECIFIC PARAMETERS
The parameters are retrieved from hwconf.c in the target BSP.
numTimers
no.of timer in this instance. The parameter type is HCF_RES_INT.
vectorDec
Decrementer Exception Vector The parameter type is HCF_RES_INT.
vectorFit
Fixed Interval Timer(FIT) Exception Vector The parameter type is HCF_RES_INT.
sysClockFreq
sytem clock frequency retrieving function address. The parameter type is
HCF_RES_ADDR.
decMaxClkRate
Specifies the maximum clock rate(in ticks/sec) of Decrementer The parameter type is
HCF_RES_INT.
decMinClkRate
Specifies the minimum clock rate(in ticks/sec) of Decrementer The parameter type is
HCF_RES_INT.
161
VxWorks Drivers API Reference, 6.6
vxbM85xxWDTimer
fitMaxClkRate
Specifies the maximum clock rate(in ticks/sec) of FIT The parameter type is
HCF_RES_INT.
fitMinClkRate
Specifies the minimum clock rate(in ticks/sec) of FIT The parameter type is
HCF_RES_INT.
vxbM85xxWDTimer
NAME vxbM85xxWDTimer – driver for PowerPC Book E Watch Dog Timer(FIT)
ROUTINES
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to the
Book E PowerPC Watch Dog Timer (WDT).
The Book E PowerPc specific WDT gives time periods in a fixed range and it can reset the
CPU after a selected period.
The WDT specific routines in this driver are appropriated from m85xxTimer.c.
A common timer specific data structure is declared in vxbM85xxTimer.h, which consists of
members required by the timer like Count, timerState etc.,
The timer data structure is populated by m85xxTimerInstInit( ) during system boot up, as
defined in vxbM85xxTimer.c.
WDT is initialized as one of three timers registered by the m85xxTimer instance.
This source file provides the WDT functionality specific routines to Timer abstraction layer.
Note: This source file is not an independent one which needs to build along with other
m85xx timer driver files.
vxbMc146818Rtc
NAME vxbMc146818Rtc – driver for the MC146818 real time clock
162
1 Libraries
vxbMipsCavIntCtlr
TARGET-SPECIFIC PARAMETERS
The parameters are retrieved from hwconf.c in the target BSP.
regBase
RTC base address. The parameter type is HCF_RES_INT.
irq
Interrupt vector number for the timer interrupt source. The parameter type is
HCF_RES_INT.
irqLevel
Interrupt number for the timer interrupt source. The parameter type is HCF_RES_INT.
clkFreq
clock frequency of RTC. The parameter type is HCF_RES_INT.
clkRateMin
Specify the minimum clock rate(in ticks/sec) which can be supported by the RTC. The
parameter type is HCF_RES_INT.
clkRateMax
Specify the maximum clock rate(in ticks/sec) which can be supported by the RTC. The
parameter type is HCF_RES_INT.
vxbMipsCavIntCtlr
NAME vxbMipsCavIntCtlr – interrupt controller for Cavium CN3xxx family
163
VxWorks Drivers API Reference, 6.6
vxbMipsIntCtlr
DESCRIPTION This file supplies routines that handle the vxbus interrupt controller requirements for the
Cavium CN3xxx family of targets. This driver handles interrupt connect, disconnect, enable
and disable functions.
Functions are published for interrupt connect, disconnect, enable, disable and acknowledge.
The file hwconf.c in the BSP directory is used as the configuration source. It defines the
device inputs into the interrupt controller and controller output pin crossconnects and
destination cpu devices.
This file is included by cmdLineBuild.c when DRV_INTCTLR_MIPS_CN3xxx is defined.
The macro DRV_INTCTLR_MIPS also needs to be defined to include the registration of the
generic MIPS interrupt controller and INCLUDE_INTCTLR_LIB to bring in the vxbus
interrupt controller library.
vxbMipsIntCtlr
NAME vxbMipsIntCtlr – - generic interrupt controller for MIPS CPU
DESCRIPTION This is the VxBus interrupt controller driver for MIPS cpu interrupts. It supplies the
standard set of vxBus initialization routines to register the driver and to allow for
configuration during the 3 phases of vxBus device init during startup. Note that this driver
only uses the first phase of initialization for a vxBus device (vxbMipsIntCtlrInstInit) with
the other phases left NULL (see mipsIntCtlrFuncs structure).
Beside vxBus device initialization the driver supplies functions to handle interrupt connect,
enabling, disabling, disconnecting and acknowledgement. All of these function are
exported as methods using the mipsIntCtlr_methods structure which holds their function
name and type. This structure is exported when a pointer to it is placed in the interrupt
controller's device structure in the pMethods field.
The driver's interrupt handler (vxbMipsIntCtlrISR) is registered as a callback function for
interrupt handling by loading the address of the vxbMipsIntCtlrISR into
_func_vxBusIntHdlr. The global _func_vxBusIntHdl is declared in the file excALib.s in the
MIPS architecture code and its examined by the architecture code during an interrupt to
determine if a vxBus interrupt handler is available. If a vxBus ISR isn't configured into
_func_vxBusIntHdl, the interrupt will be processed per the legacy interrupt handling rules.
164
1 Libraries
vxbMipsR4KTimer
vxbMipsR4KTimer
NAME vxbMipsR4KTimer – MIPS R4000 on CPU Timer driver for VxBus
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
MIPs R4000 CPU Based Timer
A timer specific data structure (struct r4kTimerData) is maintained within this driver. This
is given as pCookie in r4kTimerAllocate and can be used from there-on by the Timer
Abstraction Layer/application to communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
r4KTimerInstInit (), r4KTimerInstInit2 () and r4KTimerInstConnect ().
A variable of type struct r4KTimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in r4KTimerInstInit ()
r4KTimerInstInit2 () hooks an ISR to be used for the timer device and also hooks the
decrementer exception handler.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer/application to retrieve the characteristics of a
timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
Abstraction Layer/application and pointer to this structure is given as the parameter to this
method. The timer driver populates this data structure with the features of the timer device.
This driver requires the external routines sysCompareSet( ), sysCompareGet( ),
sysCountGet( ), and sysCountSet( ) to be defined.
The driver is SMP-Aware. It uses intCpuLocks instead of inlocks for locking of interrupt.
Hence it will work on SMP Environment.
165
VxWorks Drivers API Reference, 6.6
vxbMipsSbIntCtlr
vxbMipsSbIntCtlr
NAME vxbMipsSbIntCtlr – interrupt controller for BCM1480
DESCRIPTION This file supplies routines that handle the vxbus interrupt controller requirements for the
Broadcom sibyte family of targets. This driver handles interrupt connect, disconnect, enable
and disable functions.
Functions are published for interrupt connect, disconnect, enable, disable and acknowledge.
The file hwconf.c in the BSP directory is used as the configuration source. It defines the
device inputs into the interrupt controller and controller output pin crossconnects and
destination cpu devices.
This file is included by cmdLineBuild.c when DRV_INTCTLR_MIPS_SBE is defined. The
macro DRV_INTCTLR_MIPS also needs to be defined to include the registration of the
generic MIPS interrupt controller and INCLUDE_INTCTLR_LIB to bring in the vxbus
interrupt controller library.
vxbMpApic
NAME vxbMpApic – VxBus driver for the Intel MP APIC/xAPIC (Advanced PIC)
DESCRIPTION This is the VxBus driver for the Local APIC Interrupt Driver
166
1 Libraries
vxbOcteonSio
vxbNs16550Sio 1
DESCRIPTION This is the driver for the NS16550 (or compatible) DUART. This device includes two
universal asynchronous receiver/transmitters, a baud rate generator, and a complete
modem control capability.
A NS16550VXB_CHAN structure is used to describe the serial channel. This data structure
is defined in ns16550vxb.h.
Only asynchronous serial operation is supported by this driver. The default serial settings
are 8 data bits, 1 stop bit, no parity, 9600 baud, and software flow control.
USAGE The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ), which creates the
NS16550VXB_CHAN structure and initializes all the values in the structure (except the
SIO_DRV_FUNCS) before calling ns16550vxbDevInit( ). The BSP's sysHwInit2( ) routine
typically calls sysSerialHwInit2( ), which connects the chips interrupts via intConnect( ) to
single interrupt ` ns16550vxbInt'.
This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the handshaking RTS/CTS. The
function HUPCL(hang up on last close) is available. When hardware flow control is
enabled, the signals RTS and DTR are set TRUE and remain set until a HUPCL is performed.
vxbOcteonSio
NAME vxbOcteonSio – Octeon 16550ish Serial Driver
167
VxWorks Drivers API Reference, 6.6
vxbOpenPicTimer
DESCRIPTION This is the driver for the OCTEON (or compatible) DUART. This device includes two
universal asynchronous receiver/transmitters, a baud rate generator, and a complete
modem control capability.
A OCTEONVXB_CHAN structure is used to describe the serial channel. This data structure
is defined in octeonVxb.h.
Only asynchronous serial operation is supported by this driver. The default serial settings
are 8 data bits, 1 stop bit, no parity, 9600 baud, and software flow control.
USAGE The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ), which creates the
OCTEONVXB_CHAN structure and initializes all the values in the structure (except the
SIO_DRV_FUNCS) before calling octeonVxbDevInit( ). The BSP's sysHwInit2( ) routine
typically calls sysSerialHwInit2( ), which connects the chips interrupts via intConnect( )
(either the single interrupt octeonVxbInt or the three interrupts octeonVxbIntWr,
octeonVxbIntRd, and octeonVxbIntEx).
This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the handshaking RTS/CTS. The
function HUPCL(hang up on last close) is available. When hardware flow control is
enabled, the signals RTS and DTR are set TRUE and remain set until a HUPCL is performed.
vxbOpenPicTimer
NAME vxbOpenPicTimer – Driver for OpenPIC timers
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality of OpenPIC
timers.
A driver-specific data structure (struct openPicTimerInstance) is allocated for each timer
instance and a pointer to it is stored in pInst->pDrvCtrl during openPicTimerInstInit( ).
openPicTimerInstance contains an array of (struct openPicTimerData), one for each timer in
the instance; openPicTimerAllocate( ) returns a pointer to the corresponding (struct
openPicTimerData) as pCookie for use by the Timer Abstraction Layer/application to
communicate with this driver.
The driver implements the vxBus driver specific initialization routines
openPicTimerInstInit( ) and openPicTimerInstInit2( ), but omits the Connect function
because it is not needed.
168
1 Libraries
vxbOpenPicTimer
DRIVER_NAME "openPicTimer";
169
VxWorks Drivers API Reference, 6.6
vxbParamSys
vxbParamSys
NAME vxbParamSys – vxBus parameter system
DESCRIPTION This module provides the mechanism for drivers to obtain parameter values. Driver
parameters are values which have a useful default value which can be overridden by BSPs
and/or middleware.
The driver provides a pointer to a table containing the driver default values of each
parameter of interest. This is supplied during driver registration. Each parameter consists
of name, type, and default value.
At any time after the instance is created, middleware is able to specify parameters for the
instance by calling the vxbInstParamSet( ) routine. If middleware tries to set a parameter
before the instance is created, it will fail. If middleware tries to set a parameter after the
instance is created, it will succeed, but the driver will probably ignore it.
The BSP can provide instance override values for any parameter for any instance, using the
table formats defined above. This is done at compile time.
When the driver needs to fetch a parameter value, it makes a call to
vxbInstParamByNameGet( ) or vxbInstParamByIndexGet( ).
How do they all fit together?
First of all, the first time a non-default parameter needs to be set, regardless of what is
causing the change from the default value, "the system" will allocate memory and copy the
default parameter table into it. It then overwrites the modified value. Subsequent
modifications simply update the value fields of table entries. This means that memory is
allocated at most once for each instance.
If any middleware module calls vxbInstParamSet( ), "the system" first checks whether this
is the first changed parameter for the instance. If not, then the parameter table is already
present, so it just modifies the table value in-place. However, if this is the first time a
parameter is being changed for that instance, then it allocates the table as specified above,
170
1 Libraries
vxbPci
searches through the BSP-provided table, and finally sets the parameter as specified by
1
middleware.
When the driver calls vxbInstParamByNameGet( ) or vxbInstParamByIndexGet( ) the first
time, it first checks to see whether any parameters were overridden. If so, then it simply
reads the value from the table and returns the value. However, if no modified parameters
are known, then it reads (once) through the BSP-provided table, if any, to see if there are any
BSP-provided parameters. If there are any, then it modifies all the parameters as specified
by the BSP-supplied table.
This means that every instance reads through the BSP-supplied table exactly once.
The efficiency of modifying the value of a parameter is the same as the efficiency of reading
the value of the parameter by name using the parameter system. That equals the number of
driver parameters divided by two, since on average you search halfway through the table
before finding a match. The time to read the value of a parameter by index is constant.
How does the system know whether a parameter has been modified?
The instance (current) parameter table is kept in the VXB_DEVICE structure. We can refer
to this as pInst->paramList. The default parameter table will now be part of the driver
DRIVER_REGISTRATION structure, and is supplied to VxBus when the driver registers. We
can refer to this as pDriver->paramList or pInst->pDriver->paramList.
if pInst->paramList is non-NULL, then some parameter has been changed from the default,
either by the BSP or by middleware. In this case, ALL parameters are obtained from
pInst->paramList. If pInst->paramList is NULL, then neither the BSP nor middleware has
specified any changes from the default value, so the value can be obtained from
pInst->pDriver->paramList.
------------------------------------------------------------ Another option
------------------------------------------------------------
If the driver can handle modifications to parameters on-the-fly, then the driver should
publish the instParamModify driver method. When middleware modifies a parameter with
a call to vxbInstParamSet( ), it checks for the driver method. If the driver method is present,
vxbInstParamSet( ) first modifies pInst->paramList, and then calls the driver method with
the VXB_PARAMETERS structure as the second argument. (Of course, the first argument is
the VXB_DEVICE_ID.)
vxbPci
NAME vxbPci – PCI bus support module for vxBus
171
VxWorks Drivers API Reference, 6.6
vxbPci
172
1 Libraries
vxbPci
vxbPciAutoCardBusConfig( ) – set mem and I/O registers for a single PCI-Cardbus bridge
1
vxbPciAutoAddrAlign( ) – align a PCI address and check boundary conditions
vxbPciDeviceShow( ) – print information about PCI devices
vxbPciHeaderShow( ) – print a header of the specified PCI device
vxbPciFindDeviceShow( ) – find a PCI device and display the information
vxbPciFindClassShow( ) – find a device by 24-bit class code
vxbPciConfigStatusWordShow( ) – show the decoded value of the status word
vxbPciConfigCmdWordShow( ) – show the decoded value of the command word
vxbPciConfigFuncShow( ) – show configuration details about a function
vxbPciConfigTopoShow( ) – show PCI topology
pciDeviceShow( ) – print information about PCI devices
pciHeaderShow( ) – print a header of the specified PCI device
pciFindDeviceShow( ) – find a PCI device and display the information
pciConfigStatusWordShow( ) – show the decoded value of the status word
pciConfigCmdWordShow( ) – show the decoded value of the command word
pciFindClassShow( ) – find a device by 24-bit class code
pciConfigFuncShow( ) – show configuration details about a function
pciConfigTopoShow( ) – show PCI topology
pciConfigEnable( ) – Set the globalBusCtrlID for the other LEGACY pci
pciConfigInByte( ) – read one byte from the PCI configuration space
pciConfigInWord( ) – read one word from the PCI configuration space
pciConfigInLong( ) – read one longword from the PCI configuration space
pciConfigOutByte( ) – write one byte to the PCI configuration space
pciConfigOutWord( ) – write one 16-bit word to the PCI configuration space
pciConfigOutLong( ) – write one longword to the PCI configuration space
pciConfigForeachFunc( ) – check condition on specified bus
pciIntConnect( ) – connect the interrupt handler to the PCI interrupt.
pciIntDisconnect( ) – disconnect the interrupt handler (OBSOLETE)
pciIntDisconnect2( ) – disconnect the interrupt handler
pciFindDevice( ) – find the nth device with the given device & vendor ID
pciConfigExtCapFind( ) – find extended capability in ECP linked list
pciDevConfig( ) – configure a device on a PCI bus
pciFindClass( ) – find the nth occurrence of a device by PCI class code.
pciAutoCfgCtl( ) – set or get autoConfigLib options
DESCRIPTION This library contains the support routines for PCI host controllers on the vxBus.
173
VxWorks Drivers API Reference, 6.6
vxbPciAccess
vxbPciAccess
NAME vxbPciAccess – vxBus access routines for PCI bus type
DESCRIPTION This library contains the support routines for PCI bus access on the vxBus.
vxbPlb
NAME vxbPlb – Processor Local Bus support module for vxBus
DESCRIPTION This library contains the support routines for PLB host controllers on the vxBus.
vxbPlbAccess
NAME vxbPlbAccess – vxBus access routines for PLB
DESCRIPTION This library contains the support routines for PLB bus access on the vxBus.
174
1 Libraries
vxbPpcQuiccTimer
vxbPpcDecTimer
NAME vxbPpcDecTimer – timer driver for the PowerPC decrementer
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to the
PowerPC decrementer.
A timer specific data structure (struct ppcDecTimerData), maintained within this driver, is
allocated for the timer device. A pointer to the allocated structure is stored in
pInst->pDrvCtrl during ppcDecTimerInstInit( ) and is also returned as pCookie in
ppcDecTimerAllocate( ) for use by the Timer Abstraction Layer/application to
communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
ppcDecTimerInstInit( ), ppcDecTimerInstInit2( ) and ppcDecTimerInstConnect( ).
ppcDecTimerInstInit2( ) attempts to connect the driver to the VxBus interrupt mechanism
using vxbIntConnect( ). If this fails, presumably because the BSP has not been adapted to
support the VxBus interrupt mechanism, it attaches the ISR to the decrementer vector via a
stub function. A global pointer to the struct ppcDecTimerData * is maintained so that the
stub can pass the structure's address to the VxBus-compliant ISR.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer/application to retrieve the characteristics of a
timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
Abstraction Layer/application and pointer to this structure is given as the parameter to this
method. The timer driver populates this data structure with the features of the timer device.
vxbPpcQuiccTimer
NAME vxbPpcQuiccTimer – timer driver for quiccTimer
175
VxWorks Drivers API Reference, 6.6
vxbPrimeCellSio
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
quiccTimer (General purpose timers in PPC BSP). Not necessarily all the PPC BSP's will
have these general purpose timers.
A timer specific data structure (struct quiccTimerData) is maintained within this driver.
This is given as pCookie in quiccTimerAllocate and can be used from there-on by the Timer
Abstraction Layer/application to communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
quiccTimerInstInit (), quiccTimerInstInit2 () and quiccTimerInstConnect ().
A variable of type struct quiccTimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in quiccTimerInstInit ()
quiccTimerInstInit2 () hooks an ISR to be used for the timer device.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer/application to retrieve the characteristics of a
timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
Abstraction Layer/application and pointer to this structure is given as the parameter to this
method. The timer driver populates this data structure with the features of the timer device.
vxbPrimeCellSio
NAME vxbPrimeCellSio – ARM AMBA UART tty driver for VxBus
DESCRIPTION This is the device driver for the Advanced RISC Machines (ARM) AMBA UART. This is a
generic design of UART used within a number of chips containing (or for use with) ARM
CPUs
This design contains a universal asynchronous receiver/transmitter, a baud-rate generator,
and an InfraRed Data Association (IrDa) Serial InfraRed (SiR) protocol encoder. The Sir
encoder is not supported by this driver. The UART contains two 16-entry deep FIFOs for
receive and transmit: if a framing, overrun or parity error occurs during reception, the
appropriate error bits are stored in the receive FIFO along with the received data. The FIFOs
can be programmed to be one byte deep only, like a conventional UART with double
buffering, but the only mode of operation supported is with the FIFOs enabled.
The UART design does not support the modem control output signals: DTR, RI and RTS.
Moreover, the implementation in the 21285 chip does not support the modem control
inputs: DCD, CTS and DSR.
176
1 Libraries
vxbPrimeCellSio
The UART design can generate four interrupts: Rx, Tx, modem status change and a UART
1
disabled interrupt (which is asserted when a start bit is detected on the receive line when
the UART is disabled). The implementation in the 21285 chip has only two interrupts: Rx
and Tx, but the Rx interrupt is a combination of the normal Rx interrupt status and the
UART disabled interrupt status.
Only asynchronous serial operation is supported by the UART which supports 5 to 8 bit
word lengths with or without parity and with one or two stop bits. The only serial word
format supported by the driver is 8 data bits, 1 stop bit, no parity.
The exact baud rates supported by this driver will depend on the crystal fitted (and
consequently the input clock to the baud-rate generator), but in general, baud rates from
about 300 to about 115200 are possible.
In theory, any number of UART channels could be implemented within a chip. This driver
has been designed to cope with an arbitrary number of channels, but at the time of writing,
has only ever been tested with one channel.
TARGET-SPECIFIC PARAMETERS
The parameters are provided through registration defined in hwconf.c in the target BSP.
regBase
ARM PrimeCellII UART register base address. Specify serial mode register address.
The parameter type is HCF_RES_INT.
irq
Interrupt vector number for the ARM PrimeCellII UART single interrupt source. The
parameter type is HCF_RES_INT.
irqLevel
Interrupt number for the ARM PrimeCellII UART single interrupt source. The
parameter type is HCF_RES_INT.
pclkFreq
Clock frequency for ARM PrimeCellII UART in Hz. The parameter type is
HCF_RES_INT.
CALLBACKS Servicing a "transmitter ready" interrupt involves making a callback to a higher level library
in order to get a character to transmit. By default, this driver installs dummy callback
routines which do nothing. A higher layer library that wants to use this driver (e.g. ttyDrv)
will install its own callback routine using the SIO_INSTALL_CALLBACK ioctl command.
Likewise, a receiver interrupt handler makes a callback to pass the character to the higher
layer library.
177
VxWorks Drivers API Reference, 6.6
vxbQeIntCtlr
SEE ALSO Advanced RISC Machines AMBA UART (AP13) Data Sheet, ARM PrimeCell UART PL011
Technical Reference manual
vxbQeIntCtlr
NAME vxbQeIntCtlr – Quicc Engine interrupt controller driver
DESCRIPTION The quiccEngine interrupt controller is a subordinate interrupt controller to the main CPU
PIC. The CPU PIC receives interrupts from the quiccEngine and it calls this driver to service
them. The interrupts are attached to the PIC and then interrupts from quiccengine devices
are signalled to the quiccEngine and then over to the PIC. The knowledge of the PIC and
the exact interrupt that is connected is in the hwconf file of the BSP. It is assumed that two
outputs exist from the quicc engine that connect to the PIC hence the two calls to
vxbIntConnect/Enable.
vxbQuiccIntCtlr
NAME vxbQuiccIntCtlr – Motorola MPC 83XX interrupt controller driver
178
1 Libraries
vxbRapidIOCfgTable
vxbRapidIO
NAME vxbRapidIO – - RapidIO bus support module
DESCRIPTION This library contains the support routines for the RapidIO bus architecture.
vxbRapidIOCfgTable
NAME vxbRapidIOCfgTable – RapidIO table-based device enumeration
DESCRIPTION This library contains the RapidIO table-based device enumeration functionality.
179
VxWorks Drivers API Reference, 6.6
vxbSb1DuartSio
vxbSb1DuartSio
NAME vxbSb1DuartSio – BCM1250/1480 serial communications driver
DESCRIPTION This is the driver for the Broadcom BCM1250/1480 DUART. This device includes two
universal asynchronous receiver/transmitters, and baud rate generators. This device shares
similarities with the m68681 Duart. However it is different enough to justify a separate
device driver. This is because the BCM1250/1480 DUART has been enhanced to operate
more like two independent UARTs instead of a single DUART. Where one channel may be
used by first processor and the other channel used by the second processor. This is possible
because, unlike the m68681, the BCM1250/1480 Duart asserts a separate interrupt line for
each channel. Additional enhancements allow each channel is driven by a separate baud
rate generator which is capable of run each channel at up to 1 Megabaud. In summary, this
driver module provides control over each of the two serial channels and the baud-rate
generators as two independent devices.
A SB1_DUART_CHAN structure is used to describe the chip. The SB1_DUART_CHAN
structure is defined in vxbSb1DuartSio.h.
Although, the BCM1250/1480 DUART is capable of running in synchronous mode (HDLC),
only asynchronous serial operation is supported by this driver.
The default serial settings are 8 data bits, 1 stop bit, no parity, 9600 baud, and no control.
These default settings can be overridden on a channel-by-channel basis by setting the
options and baudRate fields to the desired values in the BSP file hwconf.c. See sioLib.h
for option values. The defaults for the module can be changed by redefining the macros
SB1_DUART_DEFAULT_OPTIONS and SB1_DUART_DEFAULT_BAUD and recompiling
this driver.
SPECIAL CONSIDERATIONS
The CLOCAL hardware option presumes that OP0 and OP1 output bits are wired to the
CTS outputs for channel 0 and channel 1 respectively. If not wired correctly, then the user
must not select the CLOCAL option.
This driver does not manipulate the output port or its configuration register in any way. If
the user selects the CLOCAL option, then the output port bit must be wired correctly or the
hardware flow control will not function correctly.
180
1 Libraries
vxbSh7700Timer
vxbSb1Timer 1
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
timers on BCM Core.
The sb1 timer has 23-bit counter and clock upto a frequency of 1MHz. Hence it allows a
maximum count of 8388608. It can operate in two modes:
i) One shot mode - The timer counts down to 0 and stops. ii) Repeated mode - The timer
counts done to 0 and gets automatically reloaded
A timer specific data structure (struct sb1TimerData) is maintained within this driver. This
is given as pCookie in sb1TimerAllocate and can be used from there-on by the Timer
Abstraction Layer/application to communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
sb1TimerInstInit (), sb1TimerInstInit2 () and sb1TimerInstConnect ().
A variable of type struct sb1TimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in sb1TimerInstInit ()
sb1TimerInstInit2 () hooks an ISR to be used for the timer device and also hooks the
decrementer exception handler.
A method for methodId VXB_METHOD_TIMER_FUNC_GET is implemented in this driver
and is used by the Timer Abstraction Layer/application to retrieve the characteristics of a
timer device. A pointer to struct vxbTimerFunctionality is allocated by the Timer
Abstraction Layer/application and pointer to this structure is given as the parameter to this
method. The timer driver populates this data structure with the features of the timer device.
The driver is SMP-Aware. It uses ISR-Task Callable spinlock instead of inlocks for locking
of interrupt. Hence it will work on SMP Environment.
vxbSh7700Timer
NAME vxbSh7700Timer – SH77xx on-chip Timer driver for VxBus
181
VxWorks Drivers API Reference, 6.6
vxbSh7700Timer
DESCRIPTION This is the vxBus compliant timer driver which implements the functionality specific to
SH77xx Timer
A timer specific data structure (struct sh7700TimerData) is maintained within this driver.
This is given as pCookie in sh7700TimerAllocate and can be used from there-on by the
Timer Abstraction Layer/application to communicate with this driver.
The driver implements all the vxBus driver specific initialization routines like
sh7700TimerInstInit (), sh7700TimerInstInit2 () and sh7700TimerInstConnect ().
A variable of type struct sh7700TimerData is allocated for a timer device and stored in
pInst->pDrvCtrl in sh7700TimerInstInit ()
sh7700TimerInstInit2 () hooks an ISR to be used for the timer device and also hooks the
decrementer exception handler.
A method for methodId vxbTimerFuncGet_desc is implemented in this driver and is used
by the Timer Abstraction Layer/application to retrieve the characteristics of a timer device.
A pointer to struct vxbTimerFunctionality is allocated by the Timer Abstraction
Layer/application and pointer to this structure is given as the parameter to this method.
The timer driver populates this data structure with the features of the timer device.
TARGET-SPECIFIC PARAMETERS
The parameters are provided through sh7700TimerDev registration defined in hwconf.c in
the target BSP.
regBase
SH77xx Timer register base address. Specify the TCOR (timer constant register)
address. The parameter type is HCF_RES_INT.
pclkFreq
Peripheral clock frequency in Hz. The parameter type is HCF_RES_INT.
irq
Interrupt vector number for the timer interrupt source. The parameter type is
HCF_RES_INT.
irqLevel
Interrupt number for the timer interrupt source. The parameter type is HCF_RES_INT.
clkRateMin
Specify the minimum period timer. Only required by the system and AUX timer which
is the first and second sh7700TimerDev resources. The parameter type is HCF_RES_INT.
clkRateMax
Specify the maximum period timer. Only required by the system and AUX timer which
is the first and second sh7700TimerDev resources. The parameter type is HCF_RES_INT.
182
1 Libraries
vxbSh77xxPci
vxbSh77xxPci 1
DESCRIPTION This is the VxBus driver for the PCI bus controller on the SH7751/SH7780 CPUs.
This driver works on PLB bus, and gets configuration information from the hwconf.c file
entry. This driver supports only 1-1 address mappings, so it uses the PCI addresses and
sizes specified in hwconf as the local addresses.
TARGET-SPECIFIC PARAMETERS
The parameters are provided through sh77xxPci registration defined in hwconf.c in the
target BSP.
regBase
PCI controller configuration register base address. The parameter type is
HCF_RES_INT.
mem32Addr
Specifies the 32-bit prefetchable memory pool base address. Normally, this is given by
the BSP constant PCI_MEM_ADRS. It can be set with the pciAutoCfgCtl( ) command
PCI_MEM32_LOC_SET. The parameter type is HCF_RES_ADDR.
mem32Size
Specifies the 32-bit prefetchable memory pool size. Normally, this is given by the BSP
constant PCI_MEM_SIZE. It can be set with the pciAutoCfgCtl( ) command
PCI_MEM32_SIZE_SET. The parameter type is HCF_RES_INT.
memIo32Addr
Specifies the 32-bit non-prefetchable memory pool base address. Normally, this is
given by the BSP constant PCI_MEMIO_ADRS. It can be set with the pciAutoCfgCtl( )
command PCI_MEMIO32_LOC_SET. The parameter type is HCF_RES_ADDR.
memIo32Size
Specifies the 32-bit non-prefetchable memory pool size Normally, this is given by the
BSP constant PCI_MEMIO_SIZE. It can be set with the pciAutoCfgCtl( ) command
PCI_MEMIO32_SIZE_SET. The parameter type is HCF_RES_INT.
io32Addr
Specifies the 32-bit I/O pool base address. Normally, this is given by the BSP constant
PCI_IO_ADRS. It can be set with the pciAutoCfgCtl( ) command PCI_IO32_LOC_SET.
The parameter type is HCF_RES_ADDR.
183
VxWorks Drivers API Reference, 6.6
vxbSh77xxPci
io32Size
Specifies the 32-bit I/O pool size. Normally, this is given by the BSP constant
PCI_IO_SIZE. It can be set with the pciAutoCfgCtl( ) command PCI_IO32_SIZE_SET.
The parameter type is HCF_RES_INT.
io16Addr
Specifies the 16-bit I/O pool base address. Normally, this is given by the BSP constant
PCI_ISA_IO_ADDR. It can be set with the pciAutoCfgCtl( ) command
PCI_IO16_LOC_SET. The parameter type is HCF_RES_ADDR.
io16Size
Specifies the 16-bit I/O pool size. Normally, this is given by the BSP constant
PCI_ISA_IO_SIZE. It can be set with the pciAutoCfgCtl( ) command
PCI_IO16_SIZE_SET. The parameter type is HCF_RES_INT.
maxBusSet
Specifies the highest sub-bus number. This parameter is optional, the default is zero.
The parameter type is HCF_RES_INT.
cacheSize
Specifies the PCI cache line size. This parameter is optional, the default is zero. The
parameter type is HCF_RES_INT.
maxLatAllSet
Specifies the maximum latency. This parameter is optional, the default is zero. The
parameter type is HCF_RES_INT.
autoIntRouteSet
Can be set to TRUE to configure pciAutoConfig( ) only to call the BSP interrupt routing
routine for devices on bus number 0. Setting autoIntRoutine to FALSE will configure
pciAutoConfig( ) to call the BSP interrupt routing routine for every device regardless
of the bus on which the device resides. This parameter is optional, the default is FALSE.
The parameter type is HCF_RES_INT.
msgLogSet
The argument specifies a routine which is called to print warning or error messages
from pciAutoConfigLib if logMsg( ) has not been initialized at the time
pciAutoConfigLib is used. The specified routine must accept arguments in the same
format as logMsg( ), but it does not necessarily need to print the actual message. An
example of this routine is presented below, which saves the message into a safe
memory space and turns on an LED. This command is useful for BSPs which call
pciAutoCfg( ) before message logging is enabled. Note that after logMsg( ) is
configured, output goes to logMsg( ) even if this command has been called. Default =
NULL.
/* sample PCI_MSG_LOG_SET function */
int pciLogMsg(char *fmt,int a1,int a2,int a3,int a4,int a5,int a6)
{
int charsPrinted;
184
1 Libraries
vxbSh77xxPci
sysLedOn(4);
charsPrinted = sprintf (sysExcMsg, fmt, a1, a2, a3, a4, a5, a6); 1
sysExcMsg += charsPrinted;
return (charsPrinted);
}
This parameter is optional. The parameter type is HCF_RES_ADDR.
maxLatencyFuncSet
This routine is called for each function present on the bus when discovery takes place.
The routine must accept four arguments, specifying bus, device, function, and a
user-supplied argument of type void *. See maxLatencyArgSet. The routine should
return a UINT8 value, which will be put into the MAX_LAT field of the header structure.
The user supplied routine must return a valid value each time it is called. There is no
mechanism for any ERROR condition, but a default value can be returned in such a case.
Default = NULL. This parameter is optional. The parameter type is HCF_RES_ADDR.
maxLatencyArgSet
When the routine specified in maxLatencyFuncSet is called, this will be passed to it as the
fourth argument. This parameter is optional. The parameter type is HCF_RES_ADDR.
includeFuncSet
The device inclusion routine is specified by assigning a function pointer with the
PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pSystem, PCI_INCLUDE_FUNC_SET,sysPciAutoconfigInclude);
This optional user-supplied routine takes as input both the bus-device-function tuple,
and a 32-bit quantity containing both the PCI vendorID and deviceID of the function.
The function prototype for this function is shown below:
STATUS sysPciAutoconfigInclude
(
PCI_SYSTEM *pSys,
PCI_LOC *pLoc,
UINT devVend
);
This optional user-specified routine is called by PCI AutoConfig for each and every
function encountered in the scan phase. The BSP developer may use any combination
of the input data to ascertain whether a device is to be excluded from the autoconfig
process. The exclusion routine then returns ERROR if a device is to be excluded, and OK
if a device is to be included in the autoconfiguration process.
Note that PCI-to-PCI Bridges may not be excluded, regardless of the value returned by
the BSP device inclusion routine. The return value is ignored for PCI-to-PCI bridges.
The Bridge device will be always be configured with proper primary, secondary, and
subordinate bus numbers in the device scanning phase and proper I/O and Memory
aperture settings in the configuration phase of autoconfig regardless of the value
returned by the BSP device inclusion routine.
185
VxWorks Drivers API Reference, 6.6
vxbSh77xxPci
intAssignFuncSet
The interrupt assignment routine is specified by assigning a function pointer with the
PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pCookie, PCI_INT_ASSIGN_FUNC_SET, sysPciAutoconfigIntrAssign);
This optional user-specified routine takes as input both the bus-device-function tuple,
and an 8-bit quantity containing the contents of the interrupt Pin register from the PCI
configuration header of the device under consideration. The interrupt pin register
specifies which of the four PCI Interrupt request lines available are connected. The
function prototype for this function is shown below:
UCHAR sysPciAutoconfigIntrAssign
(
PCI_SYSTEM *pSys,
PCI_LOC *pLoc,
UCHAR pin
);
This routine may use any combination of these data to ascertain the interrupt level.
This value is returned from the function, and is programmed into the interrupt line
register of the function's PCI configuration header. In this manner, device drivers may
subsequently read this register in order to calculate the appropriate interrupt vector
which to attach an interrupt service routine. The parameter type is HCF_RES_ADDR.
bridgePreConfigFuncSet
The bridge pre-configuration pass initialization routine is provided so that the BSP
Developer can initialize a bridge device prior to the configuration pass on the bus that
the bridge implements. This routine is specified by calling pciAutoCfgCtl( ) with the
PCI_BRIDGE_PRE_CONFIG_FUNC_SET command: The parameter type is
HCF_RES_ADDR.
bridgePostConfigFuncSet
The bridge post-configuration pass initialization routine is provided so that the BSP
Developer can initialize the bridge device after the bus that the bridge implements has
been enumerated. This routine is specified by calling pciAutoCfgCtl( ) with the
PCI_BRIDGE_POST_CONFIG_FUNC_SET command The parameter type is
HCF_RES_ADDR.
rollcallFuncSet
The specified routine will be configured as a roll call routine.
If a roll call routine has been configured, before any configuration is actually done, the
roll call routine is called repeatedly until it returns TRUE. A return value of TRUE
indicates that either (1) the specified number and type of devices named in the roll call
list have been found during PCI bus enumeration or (2) the timeout has expired
without finding all of the specified number and type of devices. In either case, it is
assumed that all of the PCI devices which are going to appear on the busses have
appeared and we can proceed with PCI bus configuration. The parameter type is
HCF_RES_ADDR.
186
1 Libraries
vxbSh77xxPci
fbbEnable
1
Enable and disable the functions which check Fast Back To Back functionality.
PCI_FBB_UPDATE is for use with dynamic/HA applications. It first disables FBB on all
functions, then enables FBB on all functions, if appropriate. In HA applications, it
should be called any time a card is added or removed. The BOOL pointed to by pArg
for PCI_FBB_ENABLE and PCI_FBB_UPDATE is set to TRUE if all cards allow FBB
functionality and FALSE if either any card does not allow FBB functionality or if FBB is
disabled. The BOOL pointed to by pArg for PCI_FBB_STATUS_GET is set to TRUE if
PCI_FBB_ENABLE has been called and FBB is enabled, even if FBB is not activated on
any card. It is set to FALSE otherwise. This parameter is optional, the default is FALSE.
NOTE: In the current implementation, FBB is enabled or disabled on the entire bus. If
any device anywhere on the bus cannot support FBB, then it is not enabled, even if
specific sub-busses could support it. The parameter type is HCF_RES_INT.
autoConfig
Enable and disable Auto Configuration. This parameter is optional, the default is
FALSE. The parameter type is HCF_RES_INT.
pciConfigMechanism
Specify the PCI Configuration mechanisms. This parameter is optional, the default is
PCI_MECHANISM_0 (0). Only PCI_MECHANISM_0 is supported by this driver, so far.
The parameter type is HCF_RES_INT.
Non vxbPciAutoConfig( ) values:
lclMemAddr
Specify the local memory address on the BSP. The parameter type is HCF_RES_ADDR.
lclMemSize
Specify the local memory size on the BSP. The parameter type is HCF_RES_INT.
mstrMemIoLcl
Specify the local PCI master memory IO address. The parameter type is
HCF_RES_ADDR.
mstrPcicBus
Specify the PCI master bus address. The parameter type is HCF_RES_ADDR.
mstrIoBus
Specify the PCI master bus IO address. The parameter type is HCF_RES_ADDR.
mstrIoLcl
Specify the PCI IO local address. The parameter type is HCF_RES_ADDR.
picIvecBase
Specify the PCI controller vector base address. The parameter type is HCF_RES_INT.
187
VxWorks Drivers API Reference, 6.6
vxbSh77xxPci
intr0
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr1
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr2
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr3
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr4
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr5
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr6
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr7
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr8
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
intr9
Interrupt vector number for the PCI controller. A temporary interrupt service routine
is connected to the interrupt vector. This parameter is optional. The parameter type is
HCF_RES_INT.
188
1 Libraries
vxbSh77xxPci
intr0Level
1
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr1Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr2Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr3Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr4Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr5Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr6Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr7Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr8Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
intr9Level
Interrupt number for the PCI controller. This parameter is optional. If the interrupt
number is not set, the interrupt source will not be enabled through vxbIntEnable( ).
The parameter type is HCF_RES_INT.
189
VxWorks Drivers API Reference, 6.6
vxbShScifSio
bridgeInitFuncSet
Specify the BSP bridge initialization routine that needs to be done prior to the PCI Auto
Configuration. The parameter type is HCF_RES_ADDR.
vxbShScifSio
NAME vxbShScifSio – Renesas SuperH SCIF driver for VxBus
DESCRIPTION This is the VxBus compliant driver for the Renesas SH series on-chip SCIF (Serial
Communication Interface with FIFO). It uses the SCIF in asynchronous mode only.
TARGET-SPECIFIC PARAMETERS
The parameters are provided through scifSioDev registration defined in hwconf.c in the
target BSP.
regBase
SCIF register base address. Specify serial mode register address. The parameter type is
HCF_RES_INT.
pclkFreq
Peripheral clock frequency in Hz. The parameter type is HCF_RES_INT.
intr0
Interrupt vector number for the SCIF Error. This parameter is ignored if irq parameter
is also specified. The parameter type is HCF_RES_INT.
intr1
Interrupt vector number for the SCIF Reception. This parameter is ignored if irq
parameter is also specified. The parameter type is HCF_RES_INT.
intr2
Interrupt vector number for the SCIF Transmit. This parameter is ignored if irq
parameter is also specified. The parameter type is HCF_RES_INT.
intr3
Interrupt vector number for the SCIF Break. This parameter is ignored if irq parameter
is also specified. The parameter type is HCF_RES_INT.
intr0Level
Interrupt number for the SCIF Error. This parameter is ignored if irqLevel parameter is
also specified. The parameter type is HCF_RES_INT.
190
1 Libraries
vxbShow
intr1Level
1
Interrupt number for the SCIF Reception. This parameter is ignored if irqLevel
parameter is also specified. The parameter type is HCF_RES_INT.
intr2Level
Interrupt number for the SCIF Transmit. This parameter is ignored if irqLevel parameter
is also specified. The parameter type is HCF_RES_INT.
intr3Level
Interrupt number for the SCIF Break. This parameter is ignored if irqLevel parameter is
also specified. The parameter type is HCF_RES_INT.
irq
Interrupt vector number for the SCIF single interrupt source. This parameter must not
be specified if intr0, intr1, intr2 and intr3 parameters are provided. The parameter type
is HCF_RES_INT.
irqLevel
Interrupt number for the SCIF single interrupt source. This parameter must not be
specified if intr0Level, intr1Level, intr2Level and intr3Level parameters are provided. The
parameter type is HCF_RES_INT.
rfdr
Reception FIFO data count register offset. This parameter is optional, the default value
is 0x1C. The parameter type is HCF_RES_INT.
fifoLen
Maximum FIFO length. This parameter is optional, the default value is 16. The
parameter type is HCF_RES_INT.
fcrTrg
Bit [4-7] setting on the FIFO control register. This parameter is optional, the default
value is 0xf0. The parameter type is HCF_RES_INT.
vxbShow
NAME vxbShow – bus subsystem source file
191
VxWorks Drivers API Reference, 6.6
vxbSmEnd
DESCRIPTION This library provides the interfaces which can be used for displaying information about the
elements in the vxBus subsystem.
vxbSmEnd
NAME vxbSmEnd – BSP configuration module for shared memory END driver
DESCRIPTION This is the WRS-supplied configuration module for the VxWorks shared memory END
driver. It performs the dynamic parameterization of the smEnd driver. This technique of
just-in-time parameterization allows driver parameter values to be declared as something
other than static strings.
vxbSmSupport
NAME vxbSmSupport – support for shared memory
192
1 Libraries
vxbSysClkLib
vxbSmcFdc37x 1
NAME vxbSmcFdc37x – SMsC FDC37x Ultra I/O Configuration Driver for VxBus
DESCRIPTION This module initializes and configures an SMsC FDC37x UltraIO chip which supports
floppy disk controller, IDE controller, serial port, parallel port and so on.
TARGET-SPECIFIC PARAMETERS
The parameters are provided through scifSioDev registration defined in hwconf.c in the
target BSP.
regBase
SMsC FDC37x register base address. The parameter type is HCF_RES_INT.
regInterval
Register interval size for the SMsC FDC37x controller. This parameter is optional, the
default is 1. The parameter type is HCF_RES_INT.
cfgDevNum
Logical Device Number. The parameter type is HCF_RES_INT.
cfgBaseAdrs
Base I/O address to be configured for the device. This parameter is optional. Not all the
device needs this parameter. The parameter type is HCF_RES_INT.
cfgIrq
IRQ select to be configured for the device. This parameter is optional. Not all the device
needs this parameter. The parameter type is HCF_RES_INT.
cfgIrq2
IRQ2 select to be configured for the device. This parameter is optional. Not all the
device needs this parameter. The parameter type is HCF_RES_INT.
cfgMode
Port mode to be configured for the device. This parameter is optional. Not all the device
needs this parameter. The parameter type is HCF_RES_INT.
vxbSysClkLib
NAME vxbSysClkLib – vxBus system clock library
193
VxWorks Drivers API Reference, 6.6
vxbTimerLib
vxbTimerLib
NAME vxbTimerLib – vxBus timer interfaces module
vxbTimerStub
NAME vxbTimerStub – vxBus timer stub file
DESCRIPTION This file implements the stub functions for the vxbus delay functions. This file is included
when the vxbus timer support is not available for the BSP.
194
1 Libraries
wancomEnd
vxbTimestampLib 1
vxbVxSimIpi
NAME vxbVxSimIpi – VxBus driver for Linux simulator IPI management
DESCRIPTION This driver provides inter-processor interrupts for the SMP version of VxSim.
wancomEnd
NAME wancomEnd – END style Marvell/Galileo GT642xx Ethernet network interface driver
195
VxWorks Drivers API Reference, 6.6
wancomEnd
DESCRIPTION This module implements an Galileo Ethernet network interface driver. This is a fast
Ethernet IEEE 802.3 10Base-T and 100Base-T compatible.
The Galileo establishes a shared memory communication system with the CPU, which is
divided into two parts: the Transmit Frame Area (TFA) and the Receive Frame Area (RFA).
The TFA consists of a linked list of frame descriptors through which packet are transmitted.
The linked list is in a form of a ring.
The RFA is a linked list of receive frame descriptors through which packet receive is
performed. The linked list is in a form of queue. The RFA also contains two Receive
Buffers Area. One area is used for clusters (See netBufLib) and the other one is used for
Galileo device receive buffers. This is done as we must keep receive buffers at 64bit
alignment !
EXTERNAL INTERFACE
The driver provides the standard external interface, wancomEndLoad( ), which takes a
string of colon separated parameters. The parameters should be specified in hexadecimal,
optionally preceded 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: "memBase:memSize:nCFDs:nRFDs:flags"
TARGET-SPECIFIC PARAMETERS
memBase
This parameter is passed to the driver via wancomEndLoad( ).
This parameter can be used to specify an explicit memory region for use by the
Galileo device. This should be done on targets that restrict the Galileo device
memory to a particular memory region. The constant NONE can be used to indicate
that there are no memory limitations, in which case the driver will allocate cache safe
memory for its use using cacheDmaMalloc( ).
memSize
The memory size parameter specifies the size of the pre-allocated memory region.
If memory base is specified as NONE (-1), the driver ignores this parameter.
Otherwise, the driver checks the size of the provided memory region is adequate with
respect to the given number of Command Frame Descriptor, Receive Frame Descriptor
and reception buffers.
nTfds
This parameter specifies the number of transmit descriptor/buffers to be allocated. If
this parameter is less than 32, a default of 32 is used.
196
1 Libraries
wancomEnd
nRfds
1
This parameter specifies the number of receive descriptor/buffers to be allocated. If
this parameter is less than 32, a default of 32 is used.
flags
User flags control the run-time characteristics of the Ethernet chip. The bit 0 specifies
the copy send capability which is used when CFDs are short of multiple fragmented
data sent through multiple CFDs and at least one CFD is available which can be used
to transfer the packet with copying the fragmented data to one buffer. Setting the bit 1
enables this capability and requires 1536 bytes (depends on WANCOM_BUF_DEF_SIZE
and _CACHE_ALIGN_SIZE) per CFD. Otherwise it disables the copy send.
TUNING HINTS The only adjustable parameters are the number of TFDs and RFDs that will be created at
run-time. These parameters are given to the driver when wancomEndLoad( ) is called.
There is one TFD and one RFD associated with each transmitted frame and each received
frame respectively. For memory-limited applications, decreasing the number of TFDs
and RFDs may be desirable. Increasing the number of TFDs will provide no performance
benefit after a certain point. Increasing the number of RFDs will provide more buffering
before packets are dropped. This can be useful if there are tasks running at a higher priority
than the net task.
ALIGNMENT Some architectures do not support unaligned access to 32-bit data items. On these
architectures (eg MIPS), it will be necessary to adjust the offset parameter in the port
197
VxWorks Drivers API Reference, 6.6
wdbEndPktDrv
information to realign the packet. Failure to do so will result in received packets being
absorbed by the network stack, although transmit functions should work OK.
SEE ALSO ifLib, Marvell GT64240 Data Sheet, Marvell GT64260 Data Sheet, Marvell GT64260 Errata
wdbEndPktDrv
NAME wdbEndPktDrv – END based packet driver for lightweight UDP/IP
DESCRIPTION This is an END based driver for the WDB system. It uses the MUX and END based drivers
to allow for interaction between the target and target server.
USAGE The driver is typically only called only from the configlette wdbEnd.c. The only directly
callable routine in this module is wdbEndPktDevInit( ). To use this driver, just select the
component INCLUDE_WDB_COMM_END in the folder SELECT_WDB_COMM_TYPE. This is
the default selection. To modify the MTU, change the value of parameter WDB_END_MTU
in component INCLUDE_WDB_COMM_END.
DATA BUFFERING The drivers only need to handle one input packet at a time because the WDB protocol only
supports one outstanding host-request at a time. If multiple input packets arrive, the driver
can simply drop them. The driver then loans the input buffer to the WDB agent, and the
agent invokes a driver callback when it is done with the buffer.
For output, the agent will pass the driver a chain of mbufs, which the driver must send as a
packet. When it is done with the mbufs, it calls wdbMbufChainFree( ) to free them. The
header file wdbMbufLib.h provides the calls for allocating, freeing, and initializing mbufs
for use with the lightweight UDP/IP interpreter. It ultimately makes calls to the routines
wdbMbufAlloc and wdbMbufFree, which are provided in source code in the configlette
usrWdbCore.c.
wdbNetromPktDrv
NAME wdbNetromPktDrv – NETROM packet driver for the WDB agent
198
1 Libraries
wdbPipePktDrv
ROUTINES wdbNetromPktDevInit( ) – initialize a NETROM packet device for the WDB agent
1
DESCRIPTION This is a lightweight NETROM driver that interfaces with the WDB agent's UDP/IP
interpreter. It allows the WDB agent to communicate with the host using the NETROM
ROM emulator. It uses the emulator's read-only protocol for bi-directional communication.
It requires that NetROM's udpsrcmode option is on.
wdbPipePktDrv
NAME wdbPipePktDrv – pipe packet driver for lightweight UDP/IP
DESCRIPTION
OVERVIEW This module is a pipe for drivers interfacing with the WDB agent's lightweight UDP/IP
interpreter. It can be used as a starting point when writing new drivers. Such drivers are the
lightweight equivalent of a network interface driver.
These drivers, along with the lightweight UDP-IP interpreter, have two benefits over the
stand combination of a netif driver + the full VxWorks networking stack; First, they can run
in a much smaller amout of target memory because the lightweight UDP-IP interpreter is
much smaller than the VxWorks network stack (about 800 bytes total). Second, they provide
a communication path which is independant of the OS, and thus can be used to support an
external mode (e.g., monitor style) debug agent.
Throughout this file the word "pipe" is used in place of a real driver name. For example, if
you were writing a lightweight driver for the lance ethernet chip, you would want to
substitute "pipe" with "ln" throughout this file.
MODES Ideally the driver should support both polled and interrupt mode, and be capable of
switching modes dynamically. However this is not required. When the agent is not running,
the driver will be placed in "interrupt mode" so that the agent can be activated as soon as a
199
VxWorks Drivers API Reference, 6.6
wdbPipePktDrv
packet arrives. If your driver does not support an interrupt mode, you can simulate this
mode by spawning a VxWorks task to poll the device at periodic intervals and simulate a
receiver ISR when a packet arrives.
For dynamically mode switchable drivers, be aware that the driver may be asked to switch
modes in the middle of its input ISR. A driver's input ISR will look something like this:
doSomeStuff();
pPktDev->wdbDrvIf.stackRcv (pMbuf); /* invoke the callback */
doMoreStuff();
If this channel is used as a communication path to an external mode debug agent, then the
agent's callback will lock interrupts, switch the device to polled mode, and use the device in
polled mode for awhile. Later on the agent will unlock interrupts, switch the device back to
interrupt mode, and return to the ISR. In particular, the callback can cause two mode
switches, first to polled mode and then back to interrupt mode, before it returns. This may
require careful ordering of the callback within the interrupt handler. For example, you may
need to acknowledge the interrupt within the doSomeStuff( ) processing rather than the
doMoreStuff( ) processing.
USAGE The driver is typically only called only from usrWdb.c. The only directly callable routine in
this module is wdbPipePktDevInit( ). You will need to modify usrWdb.c to allow your
driver to be initialized by the debug agent. You will want to modify usrWdb.c to include
your driver's header file, which should contain a definition of WDB_PIPE_PKT_MTU. There
is a default user-selectable macro called WDB_MTU, which must be no larger than
WDB_PIPE_PKT_MTU. Modify the begining of usrWdb.c to insure that this is the case by
copying the way it is done for the other drivers. The routine wdbCommIfInit( ) also needs
to be modified so that if your driver is selected as the WDB_COMM_TYPE, then your drivers
init routine will be called. Search usrWdb.c for the macro "WDB_COMM_CUSTOM" and
mimic that style of initialization for your driver.
DATA BUFFERING The drivers only need to handle one input packet at a time because the WDB protocol only
supports one outstanding host-request at a time. If multiple input packets arrive, the driver
can simply drop them. The driver then loans the input buffer to the WDB agent, and the
agent invokes a driver callback when it is done with the buffer.
For output, the agent will pass the driver a chain of mbufs, which the driver must send as a
packet. When it is done with the mbufs, it calls wdbMbufChainFree( ) to free them. The
header file wdbMbuflib.h provides the calls for allocating, freeing, and initializing mbufs
for use with the lightweight UDP/IP interpreter. It ultimatly makes calls to the routines
wdbMbufAlloc and wdbMbufFree, which are provided in source code in usrWdb.c. This
module is a pipe for drivers interfacing with the WDB agent's lightweight UDP/IP
interpreter. Such a driver are the lightweight equivalent of a network interface driver.
200
1 Libraries
wdbTsfsDrv
wdbSlipPktDrv 1
DESCRIPTION This is a lightweight SLIP driver that interfaces with the WDB agents UDP/IP interpreter.
It is the lightweight equivalent of the VxWorks SLIP netif driver, and uses the same protocol
to assemble serial characters into IP datagrams (namely the SLIP protocol). SLIP is a simple
protocol that uses four token characters to delimit each packet:
- FRAME_END (0300)
- FRAME_ESC (0333)
- FRAME_TRANS_END (0334)
- FRAME_TRANS_ESC (0335)
The END character denotes the end of an IP packet. The ESC character is used with
TRANS_END and TRANS_ESC to circumvent potential occurrences of END or ESC within a
packet. If the END character is to be embedded, SLIP sends "ESC TRANS_END" to avoid
confusion between a SLIP-specific END and actual data whose value is END. If the ESC
character is to be embedded, then SLIP sends "ESC TRANS_ESC" to avoid confusion. (Note
that the SLIP ESC is not the same as the ASCII ESC.)
On the receiving side of the connection, SLIP uses the opposite actions to decode the SLIP
packets. Whenever an END character is received, SLIP assumes a full packet has been
received and sends on.
This driver has an MTU of 1006 bytes. If the host is using a real SLIP driver with a smaller
MTU, then you will need to lower the definition of WDB_MTU in configAll.h so that the host
and target MTU match. If you are not using a SLIP driver on the host, but instead are using
the target server's wdbserial backend to connect to the agent, then you do not need to worry
about incompatabilities between the host and target MTUs.
wdbTsfsDrv
NAME wdbTsfsDrv – virtual generic file I/O driver for the WDB agent
ROUTINES wdbTsfsDrv( ) – initialize the TSFS device driver for a WDB agent
201
VxWorks Drivers API Reference, 6.6
wdbTsfsDrv
DESCRIPTION This library provides a virtual file I/O driver for use with the WDB agent. I/O is performed
on this virtual I/O device exactly as it would be on any device referencing a VxWorks file
system. File operations, such as read( ) and write( ), move data over a virtual I/O channel
created between the WDB agent and the Workbench target server. The operations are then
executed on the host file system. Because file operations are actually performed on the host
file system by the target server, the file system presented by this virtual I/O device is
known as the target-server file system, or TSFS.
The driver is installed with wdbTsfsDrv( ), creating a device typically called /tgtsvr. See the
manual page for wdbTsfsDrv( ) for more information about using this function. To use this
driver, just select the component INCLUDE_WDB_TSFS in the folder
FOLDER_WDB_OPTIONS. The initialization is done automatically, enabling access to TSFS,
when INCLUDE_WDB_TSFS is defined. The target server also must have TSFS enabled in
order to use TSFS. See the System Viewer User's Guide: Upload Method and Wind River
Workbench User's Guide: Target Server.
TSFS SOCKETS TSFS provides all of the functionality of other VxWorks file systems. For details, see the
VxWorks programmer guides. In addition to normal files, however, TSFS also provides
basic access to TCP sockets. This includes opening the client side of a TCP socket, reading,
writing, and closing the socket. Basic setsockopt( ) commands are also supported.
To open a TCP socket using TSFS, use a filename of the form:
To open and connect a TCP socket to a server socket located on a server named mongoose,
listening on port 2010, use the following:
fd = open ("/tgtsvr/TCP:mongoose:2010", 0, 0)
The open flags and permission arguments to the open call are ignored when opening a
socket through TSFS. If the server mongoose has an IP number of 144.12.44.12, you can use
the following equivalent form of the command:
fd = open ("/tgtsvr/TCP:144.12.44.12:2010", 0, 0)
DIRECTORIES All directory functions, such as mkdir( ), rmdir( ), opendir( ), readdir( ), closedir( ), and
rewinddir( ) are supported by TSFS, regardless of whether the target server providing TSFS
is being run on a UNIX or Windows host.
While it is possible to open and close directories using open( ) and close( ), it is not possible
to read from a directory using read( ). Instead, readdir( ) must be used. It is also not
possible to write to an open directory, and opening a directory for anything other than
read-only results in an error, with errno set to EISDIR. Calling read( ) on a directory
returns ERROR with errno set to EISDIR.
OPEN FLAGS When the target server that is providing the TSFS is running on a Windows host, the default
file-translation mode is binary translation. If text translation is required, then
WDB_TSFS_O_TEXT can be included in the mode argument to open( ). For example:
fd = open ("/tgtsvr/foo", O_CREAT | O_RDWR | WDB_TSFS_O_TEXT, 0777)
202
1 Libraries
wdbTsfsDrv
If the target server providing TSFS services is running on a UNIX host, WDB_TSFS_O_TEXT
1
is ignored.
TARGET SERVER For general information on the target server, see the reference entry for tgtsvr. In order to
use this library, the target server must support and be configured with the following
options:
-R root
Specify the root of the host's file system that is visible to target processes using TSFS.
This flag is required to use TSFS. Files under this root are by default read only. To
allow read/write access, specify -RW.
-RW
Allow read and write access to host files by target processes using TSFS. When this
option is specified, access to the target server is restricted as if -L were also specified.
IOCTL SUPPORT TSFS supports the following ioctl( ) functions for controlling files and sockets. Details about
each function can be found in the documentation listed below.
FIOSEEK
FIOWHERE
FIOMKDIR
Create a directory. The path, in this case /tgtsvr/tmp, must be an absolute path prefixed
with the device name. To create the directory /tmp on the root of the TSFS file system
use the following:
status = ioctl (fd, FIOMKDIR, "/tgtsvr/tmp");
FIORMDIR
Remove a directory. The path, in this case /tgtsvr/foo, must be an absolute path
prefixed with the device name. To remove the directory /foo from the root of the TSFS
file system, use the following:
status = ioctl (fd, FIORMDIR, "/tgtsvr/foo");
FIORENAME
Rename the file or directory represented by fd to the name in the string pointed to by
arg. The path indicated by arg may be prefixed with the device name or not. Using this
ioctl( ) function with the path /foo/goo produces the same outcome as the path
/tgtsvr/foo/goo. The path is not modified to account for the current working directory,
and therefore must be an absolute path.
char *arg = "/tgtsvr/foo/goo";
status = ioctl (fd, FIORENAME, arg);
FIOREADDIR
FIONREAD
Return the number of bytes ready to read on a TSFS socket file descriptor.
203
VxWorks Drivers API Reference, 6.6
wdbTsfsDrv
FIOFSTATGET
FIOGETFL
FIOUNLINK
Remove a file. The path, in this case /tgtsvr/foo, must be an absolute path prefixed with
the device name. To remove the file /foo from the root of the TSFS file system, use the
following:
fd = open ("/tgtsvr/foo", O_RDWR, 0);
status = ioctl (fd, FIOUNLINK, 0);
close (fd);
The following ioctl( ) functions can be used only on socket file descriptors. Using these
functions with ioctl( ) provides similar behavior to the setsockopt( ) and getsockopt( )
functions usually used with socket descriptors. Each command's name is derived from a
getsockopt( )/setsockopt( ) command and works in exactly the same way as the respective
getsockopt( )/setsockopt( ) command. The functions setsockopt( ) and getsockopt( ) can
not be used with TSFS socket file descriptors.
For example, to enable recording of debugging information on the TSFS socket file
descriptor, call:
int arg = 1;
status = ioctl (fd, SO_SETDEBUG, arg);
To determine whether recording of debugging information for the TSFS-socket file
descritptor is enabled or disabled, call:
int arg;
status = ioctl (fd, SO_GETDEBUG, & arg);
After the call to ioctl( ), arg contains the state of the debugging attribute.
The ioctl( ) functions supported for TSFS sockets are:
SO_SETDEBUG
Equivalent to setsockopt( ) with the SO_DEBUG command.
SO_GETDEBUG
Equivalent to getsockopt( ) with the SO_DEBUG command.
SO_SETSNDBUF
This command changes the size of the send buffer of the host socket. The configuration
of the WDB channel between the host and target also affects the number of bytes that
can be written to the TSFS file descriptor in a single attempt.
SO_SETRCVBUF
This command changes the size of the receive buffer of the host socket. The
configuration of the WDB channel between the host and target also affects the number
of bytes that can be read from the TSFS file descriptor in a single attempt.
SO_SETDONTROUTE
Equivalent to setsockopt( ) with the SO_DONTROUTE command.
204
1 Libraries
wdbVioDrv
SO_GETDONTROUTE
1
Equivalent to getsockopt( ) with the SO_DONTROUTE command.
SO_SETOOBINLINE
Equivalent to setsockopt( ) with the SO_OOBINLINE command.
SO_GETOOBINLINE
Equivalent to getsockopt( ) with the SO_OOBINLINE command.
SO_SNDURGB
The SO_SNDURGB command sends one out-of-band byte (pointed to by arg) through
the socket.
The routines in this library return the VxWorks error codes that most closely match the
errnos generated by the corresponding host function. If an error is encountered that is due
to a WDB failure, a WDB error is returned instead of the standard VxWorks errno. If an
errno generated on the host has no reasonable VxWorks counterpart, the host errno is
passed to the target calling routine unchanged.
SEE ALSO the VxWorks programmer guides, Wind River Workbench User's Guide.
wdbVioDrv
NAME wdbVioDrv – virtual tty I/O driver for the WDB agent
DESCRIPTION This library provides a pseudo-tty driver for use with the WDB debug agent. I/O is
performed on a virtual I/O device just like it is on a VxWorks serial device. The difference
is that the data is not moved over a physical serial channel, but rather over a virtual channel
created between the WDB debug agent and the Tornado host tools.
The driver is installed with wdbVioDrv( ). Individual virtual I/O channels are created by
opening the device (see wdbVioDrv( ) for details). The virtual I/O channels are defined as
follows:
Channel Usage
0 Virtual console
1-0xffffff Dynamically created on the host
>= 0x1000000 User defined
Once data is written to a virtual I/O channel on the target, it is sent to the host-based target
server. The target server allows this data to be sent to another host tool, redirected to the
205
VxWorks Drivers API Reference, 6.6
xbd
"virtual console," or redirected to a file. For details see the Wind River Workbench User's
Guide.
USAGE To use this driver, just select the component INCLUDE_WDB_VIO_DRV at configuration
time.
xbd
NAME xbd – Extended Block Device Library
z8530Sio
NAME z8530Sio – Z8530 SCC Serial Communications Controller driver
DESCRIPTION This is the driver for the Z8530 SCC (Serial Communications Controller). It uses the SCCs in
asynchronous mode only.
206
1 Libraries
z8530Sio
USAGE A Z8530_DUSART structure is used to describe the chip. This data structure contains two
Z8530_CHAN structures which describe the chip's two serial channels. Supported baud 1
rates range from 50 to 38400. The default baud rate is Z8530_DEFAULT_BAUD (9600). The
BSP may redefine this.
The BSP's sysHwInit( ) routine typically calls sysSerialHwInit( ) which initializes all the
values in the Z8530_DUSART structure (except the SIO_DRV_FUNCS) before calling
z8530DevInit( ).
The BSP's sysHwInit2( ) routine typically calls sysSerialHwInit2( ) which connects the
chips interrupts via intConnect( ) (either the single interrupt z8530Int or the three interrupts
z8530IntWr, z8530IntRd, and z8530IntEx).
This driver handles setting of hardware options such as parity(odd, even) and number of
data bits(5, 6, 7, 8). Hardware flow control is provided with the signals CTS on transmit and
DSR on read. Refer to the target documentation for the RS232 port configuration. The
function HUPCL(hang up on last close) is supported. Default hardware options are defined
by Z8530_DEFAULT_OPTIONS. The BSP may redefine them.
All device registers are accessed via BSP-defined macros so that memory- mapped as well
as I/O space accesses can be supported. The BSP may re- define the REG_8530_READ and
REG_8530_WRITE macros as needed. By default, they are defined as simple
memory-mapped accesses.
The BSP may define DATA_REG_8530_DIRECT to cause direct access to the Z8530 data
register, where hardware permits it. By default, it is not defined.
The BSP may redefine the macro for the channel reset delay Z8530_RESET_DELAY as well
as the channel reset delay counter value Z8530_RESET_DELAY_COUNT as required. The
delay is defined as the minimum time between successive chip accesses (6 PCLKs + 200 nSec
for a Z8530, 4 PCLKs for a Z85C30 or Z85230) plus an additional 4 PCLKs. At a typical PCLK
frequency of 10 MHz, each PCLK is 100 nSec, giving a minimum reset delay of:
207
VxWorks Drivers API Reference, 6.6
z8530Sio
208
2
Routines
209
VxWorks Drivers API Reference, 6.6
210
2 Routines
211
VxWorks Drivers API Reference, 6.6
212
2 Routines
213
VxWorks Drivers API Reference, 6.6
214
2 Routines
215
VxWorks Drivers API Reference, 6.6
216
2 Routines
ncr810Show( ) – display values of all readable NCR 53C8xx SIOP registers 421
ne2000EndLoad( ) – initialize the driver and device 422
noDev( ) – optional driver functionality not present 422 2
ns16550DevInit( ) – intialize an NS16550 channel 422
ns16550Int( ) – interrupt level processing 423
ns16550IntEx( ) – miscellaneous interrupt processing 423
ns16550IntRd( ) – handle a receiver interrupt 424
ns16550IntWr( ) – handle a transmitter interrupt 424
ns16550SioRegister( ) – register ns16550vxb driver 425
ns83902EndLoad( ) – initialize the driver and device 425
ns83902RegShow( ) – prints the current value of the NIC registers 426
nullDrv( ) – optional driver functionality not present 426
octeonSioRegister( ) – register octeonVxb driver 427
octeonVxbDevInit( ) – initialize an OCTEON channel 427
octeonVxbDevProbe( ) – probe for device presence at specific address 428
octeonVxbInt( ) – interrupt level processing 428
octeonVxbIntEx( ) – miscellaneous interrupt processing 429
octeonVxbIntRd( ) – handle a receiver interrupt 429
octeonVxbIntWr( ) – handle a transmitter interrupt 430
openPicTimerDrvRegister( ) – register openPic timer driver 430
optimizeAccessFunction( ) – optimize a function based on flags 431
pccardAtaEnabler( ) – enable the PCMCIA-ATA device 431
pccardEltEnabler( ) – enable the PCMCIA Etherlink III card 432
pccardMkfs( ) – initialize a device and mount a DOS file system 432
pccardMount( ) – mount a DOS file system 433
pccardSramEnabler( ) – enable the PCMCIA-SRAM driver 433
pccardTffsEnabler( ) – enable the PCMCIA-TFFS driver 434
pciAllHeaderShow( ) – show PCI header for all devices 434
pciAutoAddrAlign( ) – align a PCI address and check boundary conditions 434
pciAutoBusNumberSet( ) – set the primary, secondary, and subordinate bus number 435
pciAutoCardBusConfig( ) – set mem and I/O registers for a single PCI-Cardbus bridge 436
pciAutoCfg( ) – Automatically configure all nonexcluded PCI headers 436
pciAutoCfgCtl( ) – set or get pciAutoConfigLib options 437
pciAutoCfgCtl( ) – set or get autoConfigLib options 444
pciAutoConfig( ) – automatically configure all nonexcluded PCI headers (obsolete) 445
pciAutoConfigLibInit( ) – initialize PCI autoconfig library 446
pciAutoDevReset( ) – quiesce a PCI device and reset all writeable status bits 446
pciAutoFuncDisable( ) – disable a specific PCI function 447
pciAutoFuncEnable( ) – perform final configuration and enable a function 447
pciAutoGetNextClass( ) – find the next device of specific type from probe list 448
pciAutoRegConfig( ) – assign PCI space to a single PCI base address register 448
pciBusAnnounceDevices( ) – Notify the bus subsystem of all devices on PCI 449
pciConfigBdfPack( ) – pack parameters for the Configuration Address Register 449
pciConfigCmdWordShow( ) – show the decoded value of the command word 450
pciConfigCmdWordShow( ) – show the decoded value of the command word 450
217
VxWorks Drivers API Reference, 6.6
pciConfigEnable( ) – Set the globalBusCtrlID for the other LEGACY pci 451
pciConfigExtCapFind( ) – find extended capability in ECP linked list 451
pciConfigExtCapFind( ) – find extended capability in ECP linked list 452
pciConfigForeachFunc( ) – check condition on specified bus 452
pciConfigForeachFunc( ) – check condition on specified bus 453
pciConfigFuncShow( ) – show configuration details about a function 453
pciConfigFuncShow( ) – show configuration details about a function 454
pciConfigInByte( ) – read one byte from the PCI configuration space 454
pciConfigInByte( ) – read one byte from the PCI configuration space 455
pciConfigInLong( ) – read one longword from the PCI configuration space 455
pciConfigInLong( ) – read one longword from the PCI configuration space 456
pciConfigInWord( ) – read one word from the PCI configuration space 456
pciConfigInWord( ) – read one word from the PCI configuration space 457
pciConfigLibInit( ) – initialize the configuration access-method and addresses 457
pciConfigLibInit( ) – initialize the configuration access-method and addresses 459
pciConfigModifyByte( ) – Perform a masked longword register update 460
pciConfigModifyLong( ) – Perform a masked longword register update 461
pciConfigModifyWord( ) – Perform a masked longword register update 461
pciConfigOutByte( ) – write one byte to the PCI configuration space 462
pciConfigOutByte( ) – write one byte to the PCI configuration space 463
pciConfigOutLong( ) – write one longword to the PCI configuration space 463
pciConfigOutLong( ) – write one longword to the PCI configuration space 464
pciConfigOutWord( ) – write one 16-bit word to the PCI configuration space 464
pciConfigOutWord( ) – write one 16-bit word to the PCI configuration space 465
pciConfigReset( ) – disable cards for warm boot 465
pciConfigStatusWordShow( ) – show the decoded value of the status word 466
pciConfigStatusWordShow( ) – show the decoded value of the status word 466
pciConfigTopoShow( ) – show PCI topology 467
pciConfigTopoShow( ) – show PCI topology 467
pciConnect( ) – connect PCI bus type to bus subsystem 468
pciDevConfig( ) – configure a device on a PCI bus 468
pciDevConfig( ) – configure a device on a PCI bus 469
pciDevMatch( ) – check whether device and driver go together 469
pciDevShow( ) – show information about PCI device 470
pciDeviceAnnounce( ) – notify the bus subsystem of a device on PCI 470
pciDeviceShow( ) – print information about PCI devices 471
pciDeviceShow( ) – print information about PCI devices 471
pciFindClass( ) – find the nth occurrence of a device by PCI class code. 471
pciFindClass( ) – find the nth occurrence of a device by PCI class code. 472
pciFindClassShow( ) – find a device by 24-bit class code 473
pciFindClassShow( ) – find a device by 24-bit class code 473
pciFindDevice( ) – find the nth device with the given device & vendor ID 473
pciFindDevice( ) – find the nth device with the given device & vendor ID 474
pciFindDeviceShow( ) – find a PCI device and display the information 475
pciFindDeviceShow( ) – find a PCI device and display the information 475
218
2 Routines
219
VxWorks Drivers API Reference, 6.6
220
2 Routines
221
VxWorks Drivers API Reference, 6.6
222
2 Routines
223
VxWorks Drivers API Reference, 6.6
224
2 Routines
225
VxWorks Drivers API Reference, 6.6
226
2 Routines
227
VxWorks Drivers API Reference, 6.6
228
2 Routines
_archOptRegRd16_01( )
_archOptRegRd16_00( )
2
NAME _archOptRegRd16_00( ) – read 16 bits from mem space register
DESCRIPTION This is an optimized function which reads 16 bits from a mem space register.
ERRNO N/A
_archOptRegRd16_01( )
NAME _archOptRegRd16_01( ) – read 16 bits from mem space register and swap data
DESCRIPTION This is an optimized function which reads 16 bits from a mem space register and swap the
data read.
ERRNO N/A
229
VxWorks Drivers API Reference, 6.6
_archOptRegRd16_20( )
_archOptRegRd16_20( )
NAME _archOptRegRd16_20( ) – read 16 bits from IO space register
DESCRIPTION This is an optimized function which reads 16 bits from an IO space register.
ERRNO N/A
_archOptRegRd16_21( )
NAME _archOptRegRd16_21( ) – read 16 bits from IO space register and swap data
DESCRIPTION This is an optimized function which reads 16 bits from an IO space register and swap the
data read.
ERRNO N/A
230
2 Routines
_archOptRegRd32_03( )
_archOptRegRd32_00( )
2
NAME _archOptRegRd32_00( ) – read 32 bits from mem space register
DESCRIPTION This is an optimized function which reads 32 bits from a mem space register.
ERRNO N/A
_archOptRegRd32_03( )
NAME _archOptRegRd32_03( ) – read 32 bits from mem space register and swap data
DESCRIPTION This is an optimized function which reads 32 bits from a mem space register and swap the
data read.
ERRNO N/A
231
VxWorks Drivers API Reference, 6.6
_archOptRegRd32_20( )
_archOptRegRd32_20( )
NAME _archOptRegRd32_20( ) – read 32 bits from IO space register
DESCRIPTION This is an optimized function which reads 32 bits from an IO space register.
ERRNO N/A
_archOptRegRd32_23( )
NAME _archOptRegRd32_23( ) – read 32 bits from IO space register and swap data
DESCRIPTION This is an optimized function which reads 32 bits from an IO space register and swap the
data read.
ERRNO N/A
232
2 Routines
_archOptRegRd64_07( )
_archOptRegRd64_00( )
2
NAME _archOptRegRd64_00( ) – read 64 bits from mem space register
DESCRIPTION This is an optimized function which reads 64 bits from a mem space register.
ERRNO N/A
_archOptRegRd64_07( )
NAME _archOptRegRd64_07( ) – read 64 bits from mem space register and swap data
DESCRIPTION This is an optimized function which reads 64 bits from a mem space register and swap the
data read.
ERRNO N/A
233
VxWorks Drivers API Reference, 6.6
_archOptRegRd64_20( )
_archOptRegRd64_20( )
NAME _archOptRegRd64_20( ) – read 64 bits from IO space register
DESCRIPTION This is an optimized function which reads 64 bits from a IO space register.
ERRNO N/A
_archOptRegRd64_27( )
NAME _archOptRegRd64_27( ) – read 64 bits from IO space register and swap data
DESCRIPTION This is an optimized function which reads 64 bits from a IO space register and swap the data
read.
ERRNO N/A
234
2 Routines
_archOptRegRd8_20( )
_archOptRegRd8_00( )
2
NAME _archOptRegRd8_00( ) – read 8 bits from mem space register
DESCRIPTION This is an optimized function which reads 8 bits from a mem space register.
ERRNO N/A
_archOptRegRd8_20( )
NAME _archOptRegRd8_20( ) – read 8 bits from IO space register
DESCRIPTION This is an optimized function which reads 8 bits from an IO space register.
ERRNO N/A
235
VxWorks Drivers API Reference, 6.6
_archOptRegWr16_00( )
_archOptRegWr16_00( )
NAME _archOptRegWr16_00( ) – write 16 bits to a mem space register
DESCRIPTION This is an optimized function which writes 16 bit data to the mem space register.
ERRNO N/A
_archOptRegWr16_01( )
NAME _archOptRegWr16_01( ) – swap and write 16 bits to a mem space register
DESCRIPTION This is an optimized function which swaps the 16 bit data and writes to the mem space
register.
ERRNO N/A
236
2 Routines
_archOptRegWr16_11( )
_archOptRegWr16_10( )
2
NAME _archOptRegWr16_10( ) – write 16 bits to a mem space register and flush data
DESCRIPTION This is an optimized function which writes the 16 bit data to the mem space register and
flushes the data.
ERRNO N/A
_archOptRegWr16_11( )
NAME _archOptRegWr16_11( ) – swap, write 16 bits to mem space register & flush data
DESCRIPTION This is an optimized function which swaps the 16 bit data, writes to the mem space register
and flushes the data.
ERRNO N/A
237
VxWorks Drivers API Reference, 6.6
_archOptRegWr16_20( )
_archOptRegWr16_20( )
NAME _archOptRegWr16_20( ) – write 16 bits to an IO space register
DESCRIPTION This is an optimized function which writes the 16 bit data to the IO space register.
ERRNO N/A
_archOptRegWr16_21( )
NAME _archOptRegWr16_21( ) – swap and write 16 bits to an IO space register
DESCRIPTION This is an optimized function which swaps and writes the 16 bit data to the IO space register.
ERRNO N/A
238
2 Routines
_archOptRegWr16_31( )
_archOptRegWr16_30( )
2
NAME _archOptRegWr16_30( ) – write 16 bits to IO space register & flush data
DESCRIPTION This is an optimized function which writes 16 bits to the IO space register and flushes the
data.
ERRNO N/A
_archOptRegWr16_31( )
NAME _archOptRegWr16_31( ) – swap & write 16 bits to IO space register & flush data
DESCRIPTION This is an optimized function which swaps the 16 bit data and writes the data to the IO space
register and flushes the data.
ERRNO N/A
239
VxWorks Drivers API Reference, 6.6
_archOptRegWr32_00( )
_archOptRegWr32_00( )
NAME _archOptRegWr32_00( ) – write 32 bits to mem space register
DESCRIPTION This is an optimized function which writes 32 bits to the memory space register, without any
modifications to the data.
ERRNO N/A
_archOptRegWr32_03( )
NAME _archOptRegWr32_03( ) – swap the data and write 32 bits to mem space register
DESCRIPTION This is an optimized function which swaps the 32 bit data and then writes to the memory
space register.
ERRNO N/A
240
2 Routines
_archOptRegWr32_10( )
_archOptRegWr32_10( )
2
NAME _archOptRegWr32_10( ) – write 32 bits to an mem space register and flush
DESCRIPTION This is an optimized function which writes to the mem space register and then flushes the
data.
ERRNO N/A
_archOptRegWr32_10( )
NAME _archOptRegWr32_10( ) – swap & write 32 bits to an mem space register and flush
DESCRIPTION This is an optimized function which swaps the 32 bit data, writes to the mem space register
and then flushes the data.
ERRNO N/A
241
VxWorks Drivers API Reference, 6.6
_archOptRegWr32_20( )
_archOptRegWr32_20( )
NAME _archOptRegWr32_20( ) – write 32 bits to an IO space register
DESCRIPTION This is an optimized function which writes 32 bits to the IO space register, without any
modifications to the data.
ERRNO N/A
_archOptRegWr32_23( )
NAME _archOptRegWr32_23( ) – swap and write 32 bits to an IO space register
DESCRIPTION This is an optimized function which swaps the 32 bit data and then writes to the IO space
register.
ERRNO N/A
242
2 Routines
_archOptRegWr32_33( )
_archOptRegWr32_30( )
2
NAME _archOptRegWr32_30( ) – write 32 bits to an IO space register and flush
DESCRIPTION This is an optimized function which writes 32 bit data and then flushes the data.
ERRNO N/A
_archOptRegWr32_33( )
NAME _archOptRegWr32_33( ) – swap and write 32 bits to an IO space register & flush
DESCRIPTION This is an optimized function which swaps the 32 bit data, writes to the IO space register
and flushes the data.
ERRNO N/A
243
VxWorks Drivers API Reference, 6.6
_archOptRegWr64_00( )
_archOptRegWr64_00( )
NAME _archOptRegWr64_00( ) – write 64 bits to a mem space register
DESCRIPTION This is an optimized function which writes 64 bit data to the mem space register.
ERRNO N/A
_archOptRegWr64_07( )
NAME _archOptRegWr64_07( ) – swap 64 bit data and write to a mem space register
DESCRIPTION This is an optimized function which swaps the 64 bit data and writes to the mem space
register.
ERRNO N/A
244
2 Routines
_archOptRegWr64_17( )
_archOptRegWr64_10( )
2
NAME _archOptRegWr64_10( ) – write 64 bits to a mem space register and flush data
DESCRIPTION This is an optimized function which writes 64 bit data to the mem space register and flushes
the data.
ERRNO N/A
_archOptRegWr64_17( )
NAME _archOptRegWr64_17( ) – swap, write 64 bits to a mem space register & flush data
DESCRIPTION This is an optimized function which swaps the 64 bit data to be written, writes to the mem
space register and flushes the data.
ERRNO N/A
245
VxWorks Drivers API Reference, 6.6
_archOptRegWr64_20( )
_archOptRegWr64_20( )
NAME _archOptRegWr64_20( ) – write 64 bits to an IO space register
DESCRIPTION This is an optimized function which writes 64 bits to the IO space register.
ERRNO N/A
_archOptRegWr64_27( )
NAME _archOptRegWr64_27( ) – swap and write 64 bits to an IO space register
DESCRIPTION This is an optimized function which swaps the 64 bit data and writes to the IO space register.
ERRNO N/A
246
2 Routines
_archOptRegWr64_37( )
_archOptRegWr64_30( )
2
NAME _archOptRegWr64_30( ) – write 64 bits to a IO space register and flush data
DESCRIPTION This is an optimized function which writes 64 bit data to the IO space register and flushes
the data.
ERRNO N/A
_archOptRegWr64_37( )
NAME _archOptRegWr64_37( ) – swap, write 64 bits to a IO space register & flush data
DESCRIPTION This is an optimized function which swaps the 64 bit data to be written, writes to the IO
space register and flushes the data.
ERRNO N/A
247
VxWorks Drivers API Reference, 6.6
_archOptRegWr8_00( )
_archOptRegWr8_00( )
NAME _archOptRegWr8_00( ) – write 8 bits to mem space register
DESCRIPTION This is an optimized function which writes 8 bits to the memory space register.
ERRNO N/A
_archOptRegWr8_10( )
NAME _archOptRegWr8_10( ) – write 8 bits to mem space register and flush data
DESCRIPTION This is an optimized function which writes 8 bits to the mem space register and flush the
data.
ERRNO N/A
248
2 Routines
_archOptRegWr8_30( )
_archOptRegWr8_20( )
2
NAME _archOptRegWr8_20( ) – write 8 bits to IO space register
DESCRIPTION This is an optimized function which writes 8 bits to the IO space register.
ERRNO N/A
_archOptRegWr8_30( )
NAME _archOptRegWr8_30( ) – write 8 bits to IO space register and flush data
DESCRIPTION This is an optimized function which writes 8 bits to the IO space register and flush the data.
ERRNO N/A
249
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd16_00( )
_archOptRegWrRd16_00( )
NAME _archOptRegWrRd16_00( ) – write 16 bits to a mem space register & read back
DESCRIPTION This is an optimized function which writes 16 bit data to the mem space register and reads
back the data.
ERRNO N/A
_archOptRegWrRd16_01( )
NAME _archOptRegWrRd16_01( ) – swap, write 16 bits to a mem space register & read
DESCRIPTION This is an optimized function which swaps the 16 bit data, writes to the mem space register
and read back the data.
ERRNO N/A
250
2 Routines
_archOptRegWrRd16_11( )
_archOptRegWrRd16_10( )
2
NAME _archOptRegWrRd16_10( ) – write 16 bits to memspace, flush data & read
DESCRIPTION This is an optimized function which writes the 16 bit data to the mem space register, flushes
the data and reads back the data.
ERRNO N/A
_archOptRegWrRd16_11( )
NAME _archOptRegWrRd16_11( ) – swap, write 16 bits to memspace, flush & read data
DESCRIPTION This is an optimized function which swaps the 16 bit data, writes to the mem space register,
flushes the data & reads back the data.
ERRNO N/A
251
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd16_20( )
_archOptRegWrRd16_20( )
NAME _archOptRegWrRd16_20( ) – write 16 bits to an IO space register & read
DESCRIPTION This is an optimized function which writes the 16 bit data to the IO space register and reads
back the data.
ERRNO N/A
_archOptRegWrRd16_21( )
NAME _archOptRegWrRd16_21( ) – swap, write 16 bits to an IO space register & read
DESCRIPTION This is an optimized function which swaps the data, writes the 16 bit data to the IO space
register and reads back the data.
ERRNO N/A
252
2 Routines
_archOptRegWrRd16_31( )
_archOptRegWrRd16_30( )
2
NAME _archOptRegWrRd16_30( ) – write 16 bits to IO space, flush & read back data
DESCRIPTION This is an optimized function which writes 16 bits to the IO space register, flushes the data
and reads back the data.
ERRNO N/A
_archOptRegWrRd16_31( )
NAME _archOptRegWrRd16_31( ) – swap, write 16 bits to IO space, flush data & read
DESCRIPTION This is an optimized function which swaps the 16 bit data, writes the data to the IO space
register, flushes the data and reads back the data.
ERRNO N/A
253
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd32_00( )
_archOptRegWrRd32_00( )
NAME _archOptRegWrRd32_00( ) – write 32 bits to mem space register & read back
DESCRIPTION This is an optimized function which writes 32 bits to the memory space register, without any
modifications to the data and reads back the contents.
ERRNO N/A
_archOptRegWrRd32_03( )
NAME _archOptRegWrRd32_03( ) – swap, write 32 bits to mem space register & read
DESCRIPTION This is an optimized function which swaps the 32 bit data, writes to the memory space
register and reads back the data.
ERRNO N/A
254
2 Routines
_archOptRegWrRd32_13( )
_archOptRegWrRd32_10( )
2
NAME _archOptRegWrRd32_10( ) – write 32 bits to memspace register, flush & read
DESCRIPTION This is an optimized function which writes to the mem space register, flushes the data and
reads back the data.
ERRNO N/A
_archOptRegWrRd32_13( )
NAME _archOptRegWrRd32_13( ) – swap, write 32 bits to memspace, flush & read
DESCRIPTION This is an optimized function which swaps the 32 bit data, writes to the mem space register,
flushes the data and reads back the data.
ERRNO N/A
255
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd32_20( )
_archOptRegWrRd32_20( )
NAME _archOptRegWrRd32_20( ) – write 32 bits to an IO space register & read back
DESCRIPTION This is an optimized function which writes 32 bits to the IO space register, without any
modifications to the data and reads back the contents.
ERRNO N/A
_archOptRegWrRd32_23( )
NAME _archOptRegWrRd32_23( ) – swap, write 32 bits to an IO space register & read
DESCRIPTION This is an optimized function which swaps the 32 bit data, writes to the IO space register
and reads back the data.
ERRNO N/A
256
2 Routines
_archOptRegWrRd32_33( )
_archOptRegWrRd32_30( )
2
NAME _archOptRegWrRd32_30( ) – write 32 bits to an IO space register, flush & read
DESCRIPTION This is an optimized function which writes 32 bit data, flushes the data and reads back the
data.
ERRNO N/A
_archOptRegWrRd32_33( )
NAME _archOptRegWrRd32_33( ) – swap, write 32 bits to IO space, flush & read
DESCRIPTION This is an optimized function which swaps the 32 bit data, writes to the IO space register,
flushes the data and reads back the data.
ERRNO N/A
257
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd64_00( )
_archOptRegWrRd64_00( )
NAME _archOptRegWrRd64_00( ) – write 64 bits to a mem space register and read back
DESCRIPTION This is an optimized function which writes 64 bit data to the mem space register and read
back the contents.
ERRNO N/A
_archOptRegWrRd64_07( )
NAME _archOptRegWrRd64_07( ) – swap 64 bit data and write & read from mem space
DESCRIPTION This is an optimized function which swaps the 64 bit data and writes to the mem space
register and read back the contents.
ERRNO N/A
258
2 Routines
_archOptRegWrRd64_17( )
_archOptRegWrRd64_10( )
2
NAME _archOptRegWrRd64_10( ) – write 64 bits to mem space register, flush data & read
DESCRIPTION This is an optimized function which writes 64 bit data to the mem space register, flushes the
data and reads back the contents.
ERRNO N/A
_archOptRegWrRd64_17( )
NAME _archOptRegWrRd64_17( ) – swap, write 64 bits to memspace, flush data & read
DESCRIPTION This is an optimized function which swaps the 64 bit data to be written, writes to the mem
space register, flushes the data and reads back the data.
ERRNO N/A
259
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd64_20( )
_archOptRegWrRd64_20( )
NAME _archOptRegWrRd64_20( ) – write 64 bits to an IO space register and read back
DESCRIPTION This is an optimized function which writes 64 bits to the IO space register and read back the
contents.
ERRNO N/A
_archOptRegWrRd64_27( )
NAME _archOptRegWrRd64_27( ) – swap, write 64 bits & read from an IO space register
DESCRIPTION This is an optimized function which swaps the 64 bit data and writes to the IO space register
and also reads back the contents.
ERRNO N/A
260
2 Routines
_archOptRegWrRd64_37( )
_archOptRegWrRd64_30( )
2
NAME _archOptRegWrRd64_30( ) – write 64 bits to IO space register, flush and read
DESCRIPTION This is an optimized function which writes 64 bit data to the IO space register, flushes the
data and reads back the contents.
ERRNO N/A
_archOptRegWrRd64_37( )
NAME _archOptRegWrRd64_37( ) – swap, write 64 bits to IO space, flush & read data
DESCRIPTION This is an optimized function which swaps the 64 bit data to be written, writes to the IO
space register, flushes the data and reads back the contents.
ERRNO N/A
261
VxWorks Drivers API Reference, 6.6
_archOptRegWrRd8_00( )
_archOptRegWrRd8_00( )
NAME _archOptRegWrRd8_00( ) – write 8 bits to mem space register and read back data
DESCRIPTION This is an optimized function which writes 8 bits to the memory space register and reads
back the data.
ERRNO N/A
_archOptRegWrRd8_10( )
NAME _archOptRegWrRd8_10( ) – write 8 bits to mem space register, flush data & read
DESCRIPTION This is an optimized function which writes 8 bits to the mem space register, flushes the data
and reads back the data.
ERRNO N/A
262
2 Routines
_archOptRegWrRd8_30( )
_archOptRegWrRd8_20( )
2
NAME _archOptRegWrRd8_20( ) – write 8 bits to IO space register and read back
DESCRIPTION This is an optimized function which writes 8 bits to the IO space register and reads back the
data.
ERRNO N/A
_archOptRegWrRd8_30( )
NAME _archOptRegWrRd8_30( ) – write 8 bits to IO space register, flush data & read
DESCRIPTION This is an optimized function which writes 8 bits to the IO space register, flush the data and
read back the contents.
ERRNO N/A
263
VxWorks Drivers API Reference, 6.6
_archRegProbe( )
_archRegProbe( )
NAME _archRegProbe( ) – probe a register on the device
DESCRIPTION This routine is used by the driver to identify whether the device register is present and is
available.
ERRNO N/A
_archRegisterRead16( )
NAME _archRegisterRead16( ) – read 16-bit value from a register
DESCRIPTION This routine is used by the driver to read 16-bits from a device register.
ERRNO N/A
264
2 Routines
_archRegisterRead64( )
_archRegisterRead32( )
2
NAME _archRegisterRead32( ) – read 32-bit value from a register
DESCRIPTION This routine is used by the driver to read 32-bits from a device register.
ERRNO N/A
_archRegisterRead64( )
NAME _archRegisterRead64( ) – read 64-bit value from a register
DESCRIPTION This routine is used by the driver to read 64-bits from a device register.
ERRNO N/A
265
VxWorks Drivers API Reference, 6.6
_archRegisterRead8( )
_archRegisterRead8( )
NAME _archRegisterRead8( ) – read 8-bit value from a register
DESCRIPTION This routine is used by the driver to read 8-bits from a device register.
ERRNO N/A
_archRegisterWrite16( )
NAME _archRegisterWrite16( ) – write 16-bits to a register
DESCRIPTION This routine is used by the driver to write 16-bits to a device register.
ERRNO N/A
266
2 Routines
_archRegisterWrite64( )
_archRegisterWrite32( )
2
NAME _archRegisterWrite32( ) – write 32-bits to a register
DESCRIPTION This routine is used by the driver to write 32-bits to a device register.
ERRNO N/A
_archRegisterWrite64( )
NAME _archRegisterWrite64( ) – write 64-bits to a register
DESCRIPTION This routine is used by the driver to write 64-bits to a device register.
ERRNO N/A
267
VxWorks Drivers API Reference, 6.6
_archRegisterWrite8( )
_archRegisterWrite8( )
NAME _archRegisterWrite8( ) – write 8-bits to a register
DESCRIPTION This routine is used by the driver to write 8-bits to a device register.
ERRNO N/A
_archVolatileRegisterRead( )
NAME _archVolatileRegisterRead( ) – read from a volatile register
DESCRIPTION This routine is used to read from a volatile register. This function does not split the read into
multiple transactions.
ERRNO N/A
268
2 Routines
ambaDevInit( )
_archVolatileRegisterWrite( )
2
NAME _archVolatileRegisterWrite( ) – write to a volatile register
DESCRIPTION This routine is used to write to a volatile register and read back the data from the volatile
register.
ERRNO N/A
ambaDevInit( )
NAME ambaDevInit( ) – initialise an AMBA channel
DESCRIPTION This routine initialises some SIO_CHAN function pointers and then resets the chip to a
quiescent state. Before this routine is called, the BSP must already have initialised all the
device addresses, etc. in the AMBA_CHAN structure.
RETURNS N/A
269
VxWorks Drivers API Reference, 6.6
ambaIntRx( )
ambaIntRx( )
NAME ambaIntRx( ) – handle a receiver interrupt
RETURNS N/A
ambaIntTx( )
NAME ambaIntTx( ) – handle a transmitter interrupt
RETURNS N/A
amd8111LanDumpPrint( )
NAME amd8111LanDumpPrint( ) – Display statistical counters
270
2 Routines
amd8111LanEndLoad( )
(
int unit /* pointer to DRV_CTRL structure */
)
2
DESCRIPTION This routine displays i82557 statistical counters
amd8111LanEndLoad( )
NAME amd8111LanEndLoad( ) – initialize the driver and device
DESCRIPTION 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:devMemAddr:devIoAddr:pciMemBase:vecnum:intLvl:memAdrs
:memSize:memWidth:csr3b:offset:flags>
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, "lnPci") 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.
RETURNS An END object pointer, or NULL on error, or 0 and the name of the device if the initString
was NULL.
271
VxWorks Drivers API Reference, 6.6
amd8111LanErrCounterDump( )
amd8111LanErrCounterDump( )
NAME amd8111LanErrCounterDump( ) – dump statistical counters
DESCRIPTION This routine dumps statistical counters for the purpose of debugging and tuning the 82557.
The memAddr parameter is the pointer to an array of 68 bytes in the local memory. This
memory region must be allocated before this routine is called. The memory space must also
be DWORD (4 bytes) aligned. When the last DWORD (4 bytes) is written to a value, 0xa007,
it indicates the dump command has completed. To determine the meaning of each
statistical counter, see the Intel 82557 manual.
RETURNS OK or ERROR.
ataBlkRW( )
NAME ataBlkRW( ) – read or write sectors to a ATA/IDE disk.
DESCRIPTION Read or write sectors to a ATA/IDE disk. startBlk is the start Block, nBlks is the number of
blocks, pBuf is data buffer pointer and direction is the direction either to read or write. It
should be O_WRONLY for data write to drive or O_RDONLY for read data from drive.
272
2 Routines
ataCmd( )
ataCmd( )
NAME ataCmd( ) – issue a RegisterFile command to ATA/ATAPI device.
DESCRIPTION This function executes ATA command to ATA/ATAPI devices specified by arguments ctrl
and drive. cmd is command to be executed and other arguments arg0 to arg5 are interpreted
for differently in each case depending on the cmd command. Some commands (like
ATA_CMD_SET_FEATURE) have sub commands the case in which arg0 is interpreted as
subcommand and arg1 is subcommand specific.
In general these arguments arg0 to arg5 are interpreted as command registers of the device
as mentioned below.
arg0 - Feature Register
arg1 - Sector count
arg2 - Sector number
arg3 - CylLo
arg4 - CylHi
arg5 - sdh Register
As these registers are interpreted for different purpose for each command, arguments are
not named after registers.
The following commands are valid in this function and the validity of each argument for
different commands. Each command is tabulated in the form
---------------------------------------------------------------------
COMMAND
ARG0 | ARG1 | ARG2 | ARG3 | ARG4 | ARG5
---------------------------------------------------------------------
273
VxWorks Drivers API Reference, 6.6
ataCmd( )
ATA_CMD_INITP
0 0 0 0 0 0
ATA_CMD_RECALIB
0 0 0 0 0 0
ATA_PI_CMD_SRST
0 0 0 0 0 0
ATA_CMD_EXECUTE_DEVICE_DIAGNOSTIC
0 0 0 0 0 0
ATA_CMD_SEEK
cylinder head 0 0 0 0
or LBA high LBA low
ATA_CMD_SET_FEATURE
FR SC 0 0 0 0
(SUBCOMMAND) (SubCommand
Specific Value)
ATA_CMD_SET_MULTI
sectors per block 0 0 0 0 0
ATA_CMD_IDLE
SC 0 0 0 0 0
(Timer Period)
ATA_CMD_STANDBY
SC 0 0 0 0 0
(Timer Period)
ATA_CMD_STANDBY_IMMEDIATE
0 0 0 0 0 0
ATA_CMD_SLEEP
0 0 0 0 0 0
ATA_CMD_CHECK_POWER_MODE
0 0 0 0 0 0
ATA_CMD_IDLE_IMMEDIATE
0 0 0 0 0 0
ATA_CMD_SECURITY_DISABLE_PASSWORD
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_CMD_SECURITY_ERASE_PREPARE
0 0 0 0 0 0
ATA_CMD_SECURITY_ERASE_UNIT
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_CMD_SECURITY_FREEZE_LOCK
0 0 0 0 0 0
ATA_CMD_SECURITY_SET_PASSWORD
0 0 0 0 0 0
ATA_CMD_SECURITY_UNLOCK
0 0 0 0 0 0
ATA_CMD_SMART (not implemented)
FR SC SN ATA_ZERO ATA_ZERO ATA_ZERO
(SUBCOMMAND) (SubCommand (SubCommand
Specific Value) Specific Value)
ATA_CMD_GET_MEDIA_STATUS
0 0 0 0 0 0
ATA_CMD_MEDIA_EJECT
274
2 Routines
ataCmd( )
0 0 0 0 0 0
ATA_CMD_MEDIA_LOCK
0 0 0 0 0 0 2
ATA_CMD_MEDIA_UNLOCK
0 0 0 0 0 0
ATA_CMD_CFA_ERASE_SECTORS
0 0 0 0 0 0
ATA_CMD_CFA_WRITE_SECTORS_WITHOUT_ERASE
ATA_ZERO SC ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_CMD_CFA_WRITE_SECTORS_WITHOUT_ERASE
ATA_ZERO SC ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_CMD_CFA_TRANSLATE_SECTOR
ATA_ZERO ATA_ZERO SN cylLo cylHi DH
ATA_CMD_CFA_REQUEST_EXTENDED_ERROR_CODE
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_CMD_SET_MAX
FR ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
(SUBCOMMAND)
The following are the subcommands valid for ATA_CMD_SET_MAX and are tabulated as
below
---------------------------------------------------------------------
SUBCOMMAND(in ARG0)
ARG1 | ARG2 | ARG3 | ARG4 | ARG5
---------------------------------------------------------------------
ATA_SUB_SET_MAX_ADDRESS
SC sector no cylLo cylHi head + modebit
(SET_MAX_VOLATILE
or
SET_MAX_NON_VOLATILE)
ATA_SUB_SET_MAX_SET_PASS
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_SUB_SET_MAX_LOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_SUB_SET_MAX_UNLOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
ATA_SUB_SET_MAX_FREEZE_LOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
In ATA_CMD_SET_FEATURE subcommand only arg0 and arg1 are valid, all other are
ATA_ZERO.
------------------------------------------------------
SUBCOMMAND(ARG0) ARG1
------------------------------------------------------
ATA_SUB_ENABLE_8BIT ATA_ZERO
ATA_SUB_ENABLE_WCACHE ATA_ZERO
ATA_SUB_SET_RWMODE mode
(see page no 168 table 28 in atapi Spec5 )
ATA_SUB_ENB_ADV_POW_MNGMNT 0x90
ATA_SUB_ENB_POW_UP_STDBY ATA_ZERO
275
VxWorks Drivers API Reference, 6.6
ataCmd( )
ATA_SUB_POW_UP_STDBY_SPIN ATA_ZERO
ATA_SUB_BOOTMETHOD ATA_ZERO
ATA_SUB_ENA_CFA_POW_MOD1 ATA_ZERO
ATA_SUB_DISABLE_NOTIFY ATA_ZERO
ATA_SUB_DISABLE_RETRY ATA_ZERO
ATA_SUB_SET_LENGTH ATA_ZERO
ATA_SUB_SET_CACHE ATA_ZERO
ATA_SUB_DISABLE_LOOK ATA_ZERO
ATA_SUB_ENA_INTR_RELEASE ATA_ZERO
ATA_SUB_ENA_SERV_INTR ATA_ZERO
ATA_SUB_DISABLE_REVE ATA_ZERO
ATA_SUB_DISABLE_ECC ATA_ZERO
ATA_SUB_DISABLE_8BIT ATA_ZERO
ATA_SUB_DISABLE_WCACHE ATA_ZERO
ATA_SUB_DIS_ADV_POW_MNGMT ATA_ZERO
ATA_SUB_DISB_POW_UP_STDBY ATA_ZERO
ATA_SUB_ENABLE_ECC ATA_ZERO
ATA_SUB_BOOTMETHOD_REPORT ATA_ZERO
ATA_SUB_DIS_CFA_POW_MOD1 ATA_ZERO
ATA_SUB_ENABLE_NOTIFY ATA_ZERO
ATA_SUB_ENABLE_RETRY ATA_ZERO
ATA_SUB_ENABLE_LOOK ATA_ZERO
ATA_SUB_SET_PREFETCH ATA_ZERO
ATA_SUB_SET_4BYTES ATA_ZERO
ATA_SUB_ENABLE_REVE ATA_ZERO
ATA_SUB_DIS_INTR_RELEASE ATA_ZERO
ATA_SUB_DIS_SERV_INTR ATA_ZERO
276
2 Routines
ataDevCreate( )
ataCtrlReset( )
2
NAME ataCtrlReset( ) – reset the specified ATA/IDE disk controller
DESCRIPTION This routine resets the ATA controller specified by ctrl. The device control register is written
with SRST=1
ataDevCreate( )
NAME ataDevCreate( ) – create a device for a ATA/IDE disk
DESCRIPTION This routine creates a device for a specified ATA/IDE or ATAPI CDROM disk.
ctrl is a controller number for the ATA controller; the primary controller is 0. The maximum
is specified via ATA_MAX_CTRLS.
drive is the drive number for the ATA hard drive; the master drive is 0. The maximum is
specified via ATA_MAX_DRIVES.
The nBlocks parameter specifies the size of the device in blocks. If nBlocks is zero, the whole
disk is used.
The blkOffset parameter specifies an offset, in blocks, from the start of the device to be used
when writing or reading the hard disk. This offset is added to the block numbers passed by
277
VxWorks Drivers API Reference, 6.6
ataDevIdentify( )
the file system during disk accesses. (VxWorks file systems always use block numbers
beginning at zero for the start of a device.)
RETURNS A pointer to a block device structure (BLK_DEV) or NULL if memory cannot be allocated for
the device structure.
ataDevIdentify( )
NAME ataDevIdentify( ) – identify device
DESCRIPTION This routine checks whether the device is connected to the controller, if it is, this routine
determines drive type. The routine set type field in the corresponding ATA_DRIVE
structure. If device identification failed, the routine set state field in the corresponding
ATA_DRIVE structure to ATA_DEV_NONE.
ataDmaRW( )
NAME ataDmaRW( ) – read/write a number of sectors on the current track in DMA mode
278
2 Routines
ataDrv( )
UINT32 head,
UINT32 sector,
void * buffer,
UINT32 nSecs, 2
int direction,
sector_t startBlk
)
ataDmaToggle( )
NAME ataDmaToggle( ) – turn on or off an individual controllers dma support
DESCRIPTION This routine lets you toggle the DMA setting for an individual controller. The controller
number is passed in as a parameter, and the current value is toggled.
ataDrv( )
NAME ataDrv( ) – Initialize the ATA driver
279
VxWorks Drivers API Reference, 6.6
ataDumpPartTable( )
DESCRIPTION This routine initializes the ATA/ATAPI device driver, initializes IDE host controller and
sets up interrupt vectors for requested controller. This function must be called once for each
controller, before any access to drive on the controller, usually which is called by usrRoot( )
in usrConfig.c.
If it is called more than once for the same controller, it returns OK with a message display
Host controller already initialized , and does nothing as already required initialization is
done.
Additionally it identifies devices available on the controller and initializes depending on
the type of the device (ATA or ATAPI). Initialization of device includes reading parameters
of the device and configuring to the defaults.
ataDumpPartTable( )
NAME ataDumpPartTable( ) – dump the partition table from sector 0
This routine will display on stdout, the partition table of the specified hard drive.
280
2 Routines
ataInit( )
RETURNS OK or ERROR
2
ERRNO Not Available
ataDumptest( )
NAME ataDumptest( ) – a quick test of the dump functionality for ATA driver
DESCRIPTION device_t device id of the device to dump to. This can be any XBD
device. Could be the XBD of the disk device itself, or
could be the xbd of a partition overlayed on the drive.
sector sector offset to begin dump relative to start of xbd. blocks number of blocks to dump
to device *data buffer that contains data to dump
RETURNS N/A
ataInit( )
NAME ataInit( ) – initialize ATA device.
281
VxWorks Drivers API Reference, 6.6
ataParamRead( )
int drive
)
DESCRIPTION This routine issues a soft reset command to ATA device for initialization.
ataParamRead( )
NAME ataParamRead( ) – Read drive parameters
ataPiInit( )
NAME ataPiInit( ) – init a ATAPI CD-ROM disk controller
282
2 Routines
ataRawio( )
ataRW( )
NAME ataRW( ) – read/write a data from/to required sector.
ataRawio( )
NAME ataRawio( ) – do raw I/O access
283
VxWorks Drivers API Reference, 6.6
ataShow( )
ATA_RAW *pAtaRaw
)
ataShow( )
NAME ataShow( ) – show the ATA/IDE disk parameters
DESCRIPTION This routine shows the ATA/IDE disk parameters. Its first argument is a controller number,
0 or 1; the second argument is a drive number, 0 or 1.
ataShowInit( )
NAME ataShowInit( ) – initialize the ATA/IDE disk driver show routine
284
2 Routines
ataXbdDevCreate( )
DESCRIPTION This routine links the ATA/IDE disk driver show routine into the VxWorks system. It is
called automatically when this show facility is configured into VxWorks using either of the
following methods: 2
- If you use the configuration header files, define INCLUDE_SHOW_ROUTINES in
config.h.
- If you use the Tornado project facility, select INCLUDE_ATA_SHOW.
RETURNS N/A
ataStatusChk( )
NAME ataStatusChk( ) – Check status of drive and compare to requested status.
ataXbdDevCreate( )
NAME ataXbdDevCreate( ) – create an XBD device for a ATA/IDE disk
285
VxWorks Drivers API Reference, 6.6
ataXbdRawio( )
(
int ctrl, /* ATA controller number, 0 is the primary
controller */
int drive, /* ATA drive number, 0 is the master drive */
UINT32 nBlocks, /* number of blocks on device, 0 = use entire
disc */
UINT32 blkOffset, /* offset BLK_DEV nBlocks from the start of the
drive */
const char * name /* name of xbd device to create */
)
DESCRIPTION Use the existing code to create a standard block dev device, then create an XBD device
associated with the BLKDEV.
ERRNO
ataXbdRawio( )
NAME ataXbdRawio( ) – do raw I/O access
286
2 Routines
atapiBytesPerTrackGet( )
atapiBytesPerSectorGet( )
2
NAME atapiBytesPerSectorGet( ) – get the number of Bytes per sector.
DESCRIPTION This function will return the number of Bytes per sector. This function will return correct
values for drives of ATA/ATAPI-4 or less as this field is retired for the drives compliant to
ATA/ATAPI-5 or higher.
atapiBytesPerTrackGet( )
NAME atapiBytesPerTrackGet( ) – get the number of Bytes per track.
DESCRIPTION This function will return the number of Bytes per track. This function will return correct
values for drives of ATA/ATAPI-4 or less as this feild is retired for the drives compliant to
ATA/ATAPI-5 or higher.
287
VxWorks Drivers API Reference, 6.6
atapiCtrlMediumRemoval( )
atapiCtrlMediumRemoval( )
NAME atapiCtrlMediumRemoval( ) – Issues PREVENT/ALLOW MEDIUM REMOVAL packet
command
DESCRIPTION This function issues a command to drive to PREVENT or ALLOW MEDIA removal.
Argument arg0 selects to LOCK_EJECT or UNLOCK_EJECT.
To lock media eject arg0 should be LOCK_EJECT To unload media eject arg0 should be
UNLOCK_EJECT
RETURN OK or ERROR
atapiCurrentCylinderCountGet( )
NAME atapiCurrentCylinderCountGet( ) – get logical number of cylinders in the drive.
DESCRIPTION This function will return the number of logical cylinders in the drive. This value represents
the no of cylinders that can be addressed.
288
2 Routines
atapiCurrentMDmaModeGet( )
atapiCurrentHeadCountGet( )
2
NAME atapiCurrentHeadCountGet( ) – get the number of read/write heads in the drive.
DESCRIPTION This function will return the number of heads in the drive from device structure.
atapiCurrentMDmaModeGet( )
NAME atapiCurrentMDmaModeGet( ) – get the enabled Multi word DMA mode.
DESCRIPTION This function is used to get drive MDMA mode enable in the ATA/ATAPI drive specified
by ctrl and drive from drive structure. The following bit is set for corresponding mode
selected.
- Bit2 Multi DMA mode 2 is Selected
- Bit1 Multi DMA mode 1 is Selected
- Bit0 Multi DMA mode 0 is Selected
289
VxWorks Drivers API Reference, 6.6
atapiCurrentPioModeGet( )
atapiCurrentPioModeGet( )
NAME atapiCurrentPioModeGet( ) – get the enabled PIO mode.
DESCRIPTION This function is used to get drive current PIO mode enabled in the ATA/ATAPI drive
specified by ctrl and drive from drive structure.
atapiCurrentRwModeGet( )
NAME atapiCurrentRwModeGet( ) – get the current Data transfer mode.
DESCRIPTION This function will return the current Data transfer mode if it is PIO 0,1,2,3,4 mode, SDMA
0,1,2 mode, MDMA 0,1,2 mode or UDMA 0,1,2,3,4,5 mode.
290
2 Routines
atapiCurrentUDmaModeGet( )
atapiCurrentSDmaModeGet( )
2
NAME atapiCurrentSDmaModeGet( ) – get the enabled Single word DMA mode.
DESCRIPTION This function is used to get drive SDMA mode enable in the ATA/ATAPI drive specified
by ctrl and drive from drive structure
atapiCurrentUDmaModeGet( )
NAME atapiCurrentUDmaModeGet( ) – get the enabled Ultra DMA mode.
DESCRIPTION This function is used to get drive UDMA mode enable in the ATA/ATAPI drive specified
by ctrl and drive from drive structure The following bit is set for corresponding mode
selected.
- Bit4 Ultra DMA mode 4 is Selected
- Bit3 Ultra DMA mode 3 is Selected
- Bit2 Ultra DMA mode 2 is Selected
- Bit1 Ultra DMA mode 1 is Selected
- Bit0 Ultra DMA mode 0 is Selected
291
VxWorks Drivers API Reference, 6.6
atapiCylinderCountGet( )
atapiCylinderCountGet( )
NAME atapiCylinderCountGet( ) – get the number of cylinders in the drive.
DESCRIPTION This function is used to get cyclinder count of the ATA/ATAPI drive specified by ctrl and
drive from drive structure.
atapiDriveSerialNumberGet( )
NAME atapiDriveSerialNumberGet( ) – get the drive serial number.
DESCRIPTION This function is used to get drive serial number of the ATA/ATAPI drive specified by ctrl
and drive from drive structure. It returns a pointer to character array of 20 bytes length
which contains serial number in ascii.
292
2 Routines
atapiFeatureEnabledGet( )
atapiDriveTypeGet( )
NAME atapiDriveTypeGet( ) – get the drive type.
DESCRIPTION This function routine will return the type of the drive if it is CD-ROM or Printer etc. The
following table indicates the type depending on the return value.
0x00h Direct-access device
0x01h Sequential-access device
0x02h Printer Device
0x03h Processor device
0x04h Write-once device
0x05h CD-ROM device
0x06h Scanner device
0x07h Optical memory device
0x08h Medium Change Device
0x09h Communications device
0x0Ch Array Controller Device
0x0Dh Encloser Services Device
0x0Eh Reduced Block Command Devices
0x0Fh Optical Card Reader/Writer Device
0x1Fh Unknown or no device type
atapiFeatureEnabledGet( )
NAME atapiFeatureEnabledGet( ) – get the enabled features.
293
VxWorks Drivers API Reference, 6.6
atapiFeatureSupportedGet( )
DESCRIPTION This function is used to get drive Features Enabled by the ATA/ATAPI drive specified by
ctrl and drive from drive structure. It returns a 32 bit value whose bits represents the features
Enabled. The following table gives the cross reference for the bits.
Bit 21 Power-up in Standby Feature
Bit 20 Removable Media Status Notification Feature
Bit 19 Adavanced Power Management Feature
Bit 18 CFA Feature
Bit 10 Host protected Area Feature
Bit 4 Packet Command Feature
Bit 3 Power Management Feature
Bit 2 Removable Media Feature
Bit 1 Security Mode Feature
Bit 0 SMART Feature
atapiFeatureSupportedGet( )
NAME atapiFeatureSupportedGet( ) – get the features supported by the drive.
DESCRIPTION This function is used to get drive Feature supported by the ATA/ATAPI drive specified by
ctrl and drive from drive structure. It returns a 32 bit value whose bits represents the features
supported. The following table gives the cross reference for the bits.
Bit 21 Power-up in Standby Feature
Bit 20 Removable Media Status Notification Feature
Bit 19 Adavanced Power Management Feature
Bit 18 CFA Feature
294
2 Routines
atapiHeadCountGet( )
atapiFirmwareRevisionGet( )
NAME atapiFirmwareRevisionGet( ) – get the firm ware revision of the drive.
DESCRIPTION This function is used to get drive Firmware revision of the ATA/ATAPI drive specified by
ctrl and drive from drive structure. It returns a pointer to character array of 8 bytes length
which contains serial number in ascii.
atapiHeadCountGet( )
NAME atapiHeadCountGet( ) – get the number heads in the drive.
295
VxWorks Drivers API Reference, 6.6
atapiInit( )
int drive
)
DESCRIPTION This function is used to get head count of the ATA/ATAPI drive specified by ctrl and drive
from drive structure.
atapiInit( )
NAME atapiInit( ) – init ATAPI CD-ROM disk controller
atapiIoctl( )
NAME atapiIoctl( ) – Control the drive.
296
2 Routines
atapiIoctl( )
DESCRIPTION This routine is used to control the drive like setting the password, putting in power save
mode, locking/unlocking the drive, ejecting the medium etc. The argument function defines
the ioctl command, password, and integer array is the password required or set password
value for some commands. Arguments arg0, pointer arg1, pointer to pointer buffer ppBuf
are commad specific.
The following commands are supported for various functionality.
IOCTL_DIS_MASTER_PWD
Disable the master password. where 4th parameter is the master password.
IOCTL_DIS_USER_PWD
Disable the user password.
IOCTL_ERASE_PREPARE
Prepare the drive for erase incase the user password lost, and it is in max security
mode.
IOCTL_ENH_ERASE_UNIT_USR
Erase in enhanced mode supplying the user password.
IOCTL_ENH_ERASE_UNIT_MSTR
Erase in enhanced mode supplying the master password.
IOCTL_NORMAL_ERASE_UNIT_MSTR
Erase the drive in normal mode supplying the master password.
IOCTL_NORMAL_ERASE_UNIT_USR
Erase the drive in normal mode supplying the user password.
IOCTL_FREEZE_LOCK
Freeze lock the drive.
IOCTL_SET_PASS_MSTR
Set the master password.
IOCTL_SET_PASS_USR_MAX
Set the user password in Maximum security mode.
IOCTL_SET_PASS_USR_HIGH
Set the user password in High security mode.
IOCTL_UNLOCK_MSTR
Unlock the master password.
IOCTL_UNLOCK_USR
Unlock the user password.
297
VxWorks Drivers API Reference, 6.6
atapiIoctl( )
IOCTL_CHECK_POWER_MODE
Find the drive power saving mode.
IOCTL_IDLE_IMMEDIATE
Idle the drive immediatly. this will get the drive from the standby or active mode to idle
mode immediatly.
IOCTL_SLEEP
Set the drive in sleep mode. this is the highest power saving mode. to return to the
normal active or IDLE mode, drive need an hardware reset or power on reset or device
reset command.
IOCTL_STANDBY_IMMEDIATE
Standby the drive immediatly.
IOCTL_EJECT_DISK
Eject the media of an ATA drive. Use IOsystem ioctl function for ATAPI drive.
IOCTL_GET_MEDIA_STATUS
Find the media status.
IOCTL_ENA_REMOVE_NOTIFY
Enable the drive's removable media notification feature set.
The following table describes these arguments validity. These are tabulated in the following
form
----------------------------------------------------------------------
FUNCTION
password [16] arg0 *arg1 **ppBuf
----------------------------------------------------------------------
IOCTL_DIS_MASTER_PWD
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_DIS_USER_PWD
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_ERASE_PREPARE
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_ENH_ERASE_UNIT_USR
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_ENH_ERASE_UNIT_MSTR
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_NORMAL_ERASE_UNIT_MSTR
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_NORMAL_ERASE_UNIT_USR
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_FREEZE_LOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_SET_PASS_MSTR
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_SET_PASS_USR_MAX
password ATA_ZERO ATA_ZERO ATA_ZERO
298
2 Routines
atapiIoctl( )
IOCTL_SET_PASS_USR_HIGH
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_UNLOCK_MSTR 2
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_UNLOCK_USR
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_READ_NATIVE_MAX_ADDRESS - it returns address in <arg1>
ATA_ZERO (ATA_SDH_IBM or LBA/CHS add ATA_ZERO
ATA_SDH_LBA ) ( LBA 27:24 / Head
LBA 23:16 / cylHi
LBA 15:8 / cylLow
LBA 7:0 / sector no )
IOCTL_SET_MAX_ADDRESS - <arg1> is pointer to LBA address
ATA_ZERO SET_MAX_VOLATILE or LBA address ATA_ZERO
SET_MAX_NON_VOLATILE
IOCTL_SET_MAX_SET_PASS
password ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_SET_MAX_LOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_SET_MAX_UNLOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_SET_MAX_FREEZE_LOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_CHECK_POWER_MODE - returns power mode in <arg1>
ATA_ZERO ATA_ZERO returns power ATA_ZERO
mode
power modes :-1) 0x00 Device in standby mode
2) 0x80 Device in Idle mode
3) 0xff Device in Active or Idle mode
IOCTL_IDLE_IMMEDIATE
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_SLEEP
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_STANDBY_IMMEDIATE
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_ENB_POW_UP_STDBY
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_ENB_SET_ADV_POW_MNGMNT
ATA_ZERO arg0 ATA_ZERO ATA_ZERO
NOTE:- arg0 value - 1). for minimum power consumption with standby 0x01h
2). for minimum power consumption without standby 0x01h
3). for maximum performance 0xFEh
IOCTL_DISABLE_ADV_POW_MNGMNT
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_EJECT_DISK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_LOAD_DISK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_MEDIA_LOCK
ATA_ZERO ATA_ZERO ATA_ZERO ATA_ZERO
IOCTL_MEDIA_UNLOCK
299
VxWorks Drivers API Reference, 6.6
atapiIoctl( )
RETURNS OK or ERROR
300
2 Routines
atapiMaxPioModeGet( )
atapiMaxMDmaModeGet( )
NAME atapiMaxMDmaModeGet( ) – get the Maximum Multi word DMA mode the drive
supports.
DESCRIPTION This function is used to get drive maximum MDMA mode supported by the ATA/ATAPI
drive specified by ctrl and drive from drive structure The following bits are set for
corresponding modes supported.
Bit2 Multi DMA mode 2 and below are supported
Bit1 Multi DMA mode 1 and below are supported
Bit0 Multi DMA mode 0 is supported
atapiMaxPioModeGet( )
NAME atapiMaxPioModeGet( ) – get the Maximum PIO mode that drive can support.
DESCRIPTION This function is used to get drive maximum PIO mode supported by the ATA/ATAPI
drive specified by ctrl and drive from drive structure
301
VxWorks Drivers API Reference, 6.6
atapiMaxSDmaModeGet( )
atapiMaxSDmaModeGet( )
NAME atapiMaxSDmaModeGet( ) – get the Maximum Single word DMA mode the drive
supports
DESCRIPTION This function is used to get drive maximum SDMA mode supported by the ATA/ATAPI
drive specified by ctrl and drive from drive structure
atapiMaxUDmaModeGet( )
NAME atapiMaxUDmaModeGet( ) – get the Maximum Ultra DMA mode the drive can support.
DESCRIPTION This function is used to get drive maximum UDMA mode supported by the ATA/ATAPI
drive specified by ctrl and drive from drive structure. The following bits are set for
corresponding modes supported.
302
2 Routines
atapiParamsPrint( )
atapiModelNumberGet( )
NAME atapiModelNumberGet( ) – get the model number of the drive.
DESCRIPTION This function is used to get drive Model Number of the ATA/ATAPI drive specified by ctrl
and drive from drive structure. It returns a pointer to character array of 40 bytes length
which contains serial number in ascii.
atapiParamsPrint( )
NAME atapiParamsPrint( ) – Print the drive parameters.
303
VxWorks Drivers API Reference, 6.6
atapiPktCmd( )
(
int ctrl,
int drive
)
DESCRIPTION This user callable routine will read the current parameters from the corresponding drive
and will print the specified range of parameters on the console.
RETURNS N/A.
atapiPktCmd( )
NAME atapiPktCmd( ) – execute an ATAPI command with error processing
DESCRIPTION This routine executes a single ATAPI command, checks the command completion status
and tries to recover if an error encountered during command execution at any stage.
ERRNO S_ioLib_DEVICE_ERROR
atapiPktCmdSend( )
NAME atapiPktCmdSend( ) – Issue a Packet command.
304
2 Routines
atapiRead10( )
(
ATA_DEV * pAtapiDev,
ATAPI_CMD * pComPack
) 2
ERRNO S_ioLib_DEVICE_ERROR
atapiRead10( )
NAME atapiRead10( ) – read one or more blocks from an ATAPI Device.
DESCRIPTION This routine reads one or more blocks from the specified device, starting with the specified
block number.
The name of this routine relates to the SFF-8090i (Mt. Fuji), used for DVD-ROM, and
indicates that the entire packet command uses 10 bytes, rather than the normal 12.
305
VxWorks Drivers API Reference, 6.6
atapiReadCapacity( )
atapiReadCapacity( )
NAME atapiReadCapacity( ) – issue a READ CD-ROM CAPACITY command to a ATAPI device
DESCRIPTION This routine issues a READ CD-ROM CAPACITY command to a specified ATAPI device.
atapiReadTocPmaAtip( )
NAME atapiReadTocPmaAtip( ) – issue a READ TOC command to a ATAPI device
DESCRIPTION This routine issues a READ TOC command to a specified ATAPI device.
306
2 Routines
atapiScan( )
atapiRemovMediaStatusNotifyVerGet( )
2
NAME atapiRemovMediaStatusNotifyVerGet( ) – get the Media Stat Notification Version.
DESCRIPTION This function will return the removable media status notification version of the drive.
atapiScan( )
NAME atapiScan( ) – issue SCAN packet command to ATAPI drive.
DESCRIPTION This function issues SCAN packet command to ATAPI drive. The function argument should
be 0x00 for fast forward and 0x10 for fast reversed operation.
RETURN OK or ERROR
307
VxWorks Drivers API Reference, 6.6
atapiSeek( )
atapiSeek( )
NAME atapiSeek( ) – issues a SEEK packet command to drive.
DESCRIPTION This function issues a SEEK packet command (not ATA SEEK command) to the specified
drive.
RETURN OK or ERROR
atapiSetCDSpeed( )
NAME atapiSetCDSpeed( ) – issue SET CD SPEED packet command to ATAPI drive.
DESCRIPTION This function issues SET CD SPEED packet command to ATAPI drive while reading and
writing of ATAPI drive(CD-ROM) data. The arguments readDriveSpeed and writeDriveSpeed
are in Kbytes/Second.
RETURN OK or ERROR
308
2 Routines
atapiStopPlayScan( )
atapiStartStopUnit( )
2
NAME atapiStartStopUnit( ) – Issues START STOP UNIT packet command
DESCRIPTION This function issues a command to drive to MEDIA EJECT and MEDIA LOAD. Argument
arg0 selects to EJECT or LOAD.
To eject media arg0 should be EJECT_DISK To load media arg0 should be LOAD_DISK
RETURN OK or ERROR
atapiStopPlayScan( )
NAME atapiStopPlayScan( ) – issue STOP PLAY/SCAN packet command to ATAPI drive.
RETURN OK or ERROR
309
VxWorks Drivers API Reference, 6.6
atapiTestUnitRdy( )
atapiTestUnitRdy( )
NAME atapiTestUnitRdy( ) – issue a TEST UNIT READY command to a ATAPI drive
DESCRIPTION This routine issues a TEST UNIT READY command to a specified ATAPI drive.
atapiVersionNumberGet( )
NAME atapiVersionNumberGet( ) – get the ATA/ATAPI version number of the drive.
DESCRIPTION This function will return the ATA/ATAPI version number of the drive. Most significant 16
bits represent the Major Version Number and the Lease significant 16 bits represents the
minor Version Number.
Major Version Number
Bit 22 ATA/ATAPI-6
Bit 21 ATA/ATAPI-5
Bit 20 ATA/ATAPI-4
Bit 19 ATA-3
Bit 18 ATA-2
Minor version Number (bit 15 through bit 0)
0001h Obsolete
0002h Obsolete
0003h Obsolete
310
2 Routines
atapiVersionNumberGet( )
0004h ATA-2
published, ANSI
X3.279-1996 2
0005h ATA-2 X3T10
948D prior to
revision 2k
0006h ATA-3 X3T10
2008D revision 1
0007h ATA-2 X3T10
948D revision 2k
0008h ATA-3 X3T10
2008D revision 0
0009h ATA-2 X3T10
948D revision 3
000Ah ATA-3
published, ANSI
X3.298-199x
000Bh ATA-3 X3T10
2008D revision 6
000Ch ATA-3 X3T13
2008D revision 7
and 7a
000Dh ATA/ATAPI-4
X3T13 1153D
revision 6
000Eh ATA/ATAPI-4
T13 1153D
revision 13
000Fh ATA/ATAPI-4
X3T13 1153D
revision 7
0010h ATA/ATAPI-4
T13 1153D
revision 18
0011h ATA/ATAPI-4
T13 1153D
revision 15
0012h ATA/ATAPI-4
published, ANSI
NCITS 317-1998
0013h Reserved
0014h ATA/ATAPI-4
T13 1153D
revision 14
311
VxWorks Drivers API Reference, 6.6
atapiVersionNumberGet( )
0004h ATA-2
published, ANSI
X3.279-1996
0005h ATA-2 X3T10
948D prior to
revision 2k
0006h ATA-3 X3T10
2008D revision 1
0007h ATA-2 X3T10
948D revision 2k
0008h ATA-3 X3T10
2008D revision 0
0009h ATA-2 X3T10
948D revision 3
000Ah ATA-3
published, ANSI
X3.298-199x
000Bh ATA-3 X3T10
2008D revision 6
000Ch ATA-3 X3T13
2008D revision 7
and 7a
000Dh ATA/ATAPI-4
X3T13 1153D
revision 6
000Eh ATA/ATAPI-4
T13 1153D
revision 13
000Fh ATA/ATAPI-4
X3T13 1153D
revision 7
0010h ATA/ATAPI-4
T13 1153D
revision 18
0011h ATA/ATAPI-4
T13 1153D
revision 15
0012h ATA/ATAPI-4
published, ANSI
NCITS 317-1998
0013h Reserved
0014h ATA/ATAPI-4
T13 1153D
revision 14
312
2 Routines
auDump( )
000Fh ATA/ATAPI-4
X3T13 1153D
revision 7 2
0010h ATA/ATAPI-4
T13 1153D
revision 18
0011h ATA/ATAPI-4
T13 1153D
revision 15
0012h ATA/ATAPI-4
published, ANSI
NCITS 317-1998
0013h Reserved
0014h ATA/ATAPI-4
T13 1153D
revision 14
auDump( )
NAME auDump( ) – display device status
DESCRIPTION none
313
VxWorks Drivers API Reference, 6.6
auEndLoad( )
auEndLoad( )
NAME auEndLoad( ) – initialize the driver and device
DESCRIPTION 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:devMemAddr:devIoAddr:enableAddr:vecNum:intLvl:offset :qtyCluster:flags
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, "au") 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.
RETURNS An END object pointer, or NULL on error, or 0 and the name of the device if the initString
was NULL.
auInitParse( )
NAME auInitParse( ) – parse the initialization string
314
2 Routines
bcm1250MacEndLoad( )
DESCRIPTION Parse the input string. This routine is called from auEndLoad( ) which initializes some
values in the driver control structure with the values passed in the initialization string.
The initialization string format is: unit:devMemAddr:devIoAddr:vecNum:intLvl:offset:flags 2
unit
Device unit number, a small integer.
devMemAddr
Device register base memory address
devIoAddr
I/O register base memory address
enableAddr
Address of MAC enable register
vecNum
Interrupt vector number.
intLvl
Interrupt level.
offset
Offset of starting of data in the device buffers.
qtyCluster
Number of clusters to allocate
flags
Device specific flags, for future use.
bcm1250MacEndLoad( )
NAME bcm1250MacEndLoad( ) – initialize the driver and device
315
VxWorks Drivers API Reference, 6.6
bcm1250MacPhyShow( )
DESCRIPTION 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:
The initialization string format is:
"unit:hwunit:vecnum:flags:numRds0:numTds0:numRds1:numTds1"
The hwunit field is not used, but must be present to parse properly.
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, "sbe0", "sbe1", or "sbe2") into the initString and returns
NULL.
If the string is allocated and not empty, the routine attempts to load the driver using the
values specified in the string.
bcm1250MacPhyShow( )
NAME bcm1250MacPhyShow( ) – display the physical register values
RETURNS N/A
bcm1250MacRxDmaShow( )
NAME bcm1250MacRxDmaShow( ) – display RX DMA register values
316
2 Routines
bcm1250MacTxDmaShow( )
RETURNS N/A
bcm1250MacShow( )
NAME bcm1250MacShow( ) – display the MAC register values
RETURNS N/A
bcm1250MacTxDmaShow( )
NAME bcm1250MacTxDmaShow( ) – display TX DMA register values
317
VxWorks Drivers API Reference, 6.6
bioInit( )
RETURNS N/A
bioInit( )
NAME bioInit( ) – initialize the bio library
DESCRIPTION none
RETURNS OK
bio_alloc( )
NAME bio_alloc( ) – allocate memory blocks
DESCRIPTION This routine allocates numBlocks of memory. The size of the block is extracted from the xbd.
318
2 Routines
cisConfigregGet( )
bio_done( )
2
NAME bio_done( ) – terminates a bio operation
DESCRIPTION none
RETURNS N/A
bio_free( )
NAME bio_free( ) – free the bio memory
DESCRIPTION This routine frees the memory in a bio structure. Note that bio_data is NOT a pointer to the
the bio structure, but rather the pointer to the memory to free.
RETURNS N/A
cisConfigregGet( )
NAME cisConfigregGet( ) – get the PCMCIA configuration register
319
VxWorks Drivers API Reference, 6.6
cisConfigregSet( )
cisConfigregSet( )
NAME cisConfigregSet( ) – set the PCMCIA configuration register
cisFree( )
NAME cisFree( ) – free tuples from the linked list
320
2 Routines
cisShow( )
(
int sock /* socket no. */
)
2
DESCRIPTION This routine free tuples from the linked list.
RETURNS N/A
cisGet( )
NAME cisGet( ) – get information from a PC card's CIS
DESCRIPTION This routine gets information from a PC card's CIS, configures the PC card, and allocates
resources for the PC card.
RETURNS OK, or ERROR if it cannot get the CIS information, configure the PC card, or allocate
resources.
cisShow( )
NAME cisShow( ) – show CIS information
321
VxWorks Drivers API Reference, 6.6
coldFireSioRegister( )
NOTE This routine uses floating point calculations. The calling task needs to be spawned with the
VX_FP_TASK flag. If this is not done, the data printed by cisShow may be corrupted and
unreliable.
RETURNS N/A
coldFireSioRegister( )
NAME coldFireSioRegister( ) – register coldFire sio driver
DESCRIPTION This routine registers the coldFire Sio driver with the vxBus subsystem.
RETURNS N/A
ERRNO
ctB69000VgaInit( )
NAME ctB69000VgaInit( ) – initializes the B69000 chip and loads font in memory.
DESCRIPTION This routine will initialize the VGA card if present in PCI connector, sets up register set in
VGA 3+ mode and loads the font in plane 2.
RETURNS OK/ERROR
322
2 Routines
dec21145SPIReadBack( )
dec21140SromWordRead( )
NAME dec21140SromWordRead( ) – read two bytes from the serial ROM
DESCRIPTION This routine returns the two bytes of information that is associated with it the specified
ROM line number. This will later be used by the dec21140GetEthernetAdr function. It can
also be used to review the ROM contents itself. The function must first send some initial bit
patterns to the CSR9 that contains the Serial ROM Control bits. Then the line index into the
ROM is evaluated bit-by-bit to program the ROM. The 2 bytes of data are extracted and
processed into a normal pair of bytes.
dec21145SPIReadBack( )
NAME dec21145SPIReadBack( ) – Read all PHY registers out
DESCRIPTION none
RETURNS nothing
323
VxWorks Drivers API Reference, 6.6
dec21x40EndLoad( )
dec21x40EndLoad( )
NAME dec21x40EndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes the driver and the device to an operational state. All of the
device-specific parameters are passed in the initStr. If this routine is called with an empty
but allocated string, it puts the name of this device (that is, "dc") into the initStr and returns
0. If the string is allocated but not empty, this routine tries to load the device.
dec21x40PhyFind( )
NAME dec21x40PhyFind( ) – Find the first PHY connected to DEC MII port.
DESCRIPTION none
324
2 Routines
devDetach( )
devAttach( )
2
NAME devAttach( ) – attach a device
DESCRIPTION none
devDetach( )
NAME devDetach( ) – detach a device
DESCRIPTION none
325
VxWorks Drivers API Reference, 6.6
devInit( )
devInit( )
NAME devInit( ) – initialize the device manager
DESCRIPTION This routine initializes the device manager for ndevs devices.
ERRNO EINVAL
devMap( )
NAME devMap( ) – map a device
DESCRIPTION none
devMapUnsafe( )
NAME devMapUnsafe( ) – map a device unconditionally
326
2 Routines
devResourceGet( )
(
device_t dev /* device to map */
)
2
DESCRIPTION none
devName( )
NAME devName( ) – name a device
DESCRIPTION none
devResourceGet( )
NAME devResourceGet( ) – find vxBus resource
327
VxWorks Drivers API Reference, 6.6
devResourceIntrGet( )
ERRNO
devResourceIntrGet( )
NAME devResourceIntrGet( ) – find vxBus interrupt resources
DESCRIPTION This routine extracts interrupt information from the HCF record provided, creates an
interrupt structure, and updates the pDev structure.
The updates to pDev are as follows:
- Insert the interrupt structure into pDev-pIntrInfo field.
ERRNO
devResourceIntrShow( )
NAME devResourceIntrShow( ) – show interrupt values for specified device
328
2 Routines
devUnmapUnsafe( )
(
VXB_DEVICE_ID pDev
)
2
DESCRIPTION This routine displays the interrupt values of the specified device.
ERRNO
devUnmap( )
NAME devUnmap( ) – unmap a device
DESCRIPTION none
RETURNS
devUnmapUnsafe( )
NAME devUnmapUnsafe( ) – unmap a device unconditionally
DESCRIPTION none
329
VxWorks Drivers API Reference, 6.6
displayRapidIOCfgRegs( )
RETURNS
displayRapidIOCfgRegs( )
NAME displayRapidIOCfgRegs( ) – displays RIO registers given a base address
DESCRIPTION none
RETURNS N/A
drvUnloadAll( )
NAME drvUnloadAll( ) – unload all drivers which provide download/unload support
330
2 Routines
el3c90xInitParse( )
el3c90xEndLoad( )
2
NAME el3c90xEndLoad( ) – initialize the driver and device
DESCRIPTION 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:devMemAddr:devIoAddr:pciMemBase:<vecnum:intLvl:memAdrs
:memSize:memWidth:flags:buffMultiplier
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, "elPci") 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.
RETURNS An END object pointer, or NULL on error, or 0 and the name of the device if the initString
was NULL.
el3c90xInitParse( )
NAME el3c90xInitParse( ) – parse the initialization string
DESCRIPTION Parse the input string. This routine is called from el3c90xEndLoad( ) which initializes some
values in the driver control structure with the values passed in the initialization string.
331
VxWorks Drivers API Reference, 6.6
elt3c509Load( )
elt3c509Load( )
NAME elt3c509Load( ) – initialize the driver and device
332
2 Routines
elt3c509Parse( )
(
char * initString /* String to be parsed by the driver. */
)
2
DESCRIPTION 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:port:intVector:intLevel:attachementType:noRxFrames
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, "elt") 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.
RETURNS An END object pointer, or NULL on error, or 0 and the name of the device if the initString
was NULL.
elt3c509Parse( )
NAME elt3c509Parse( ) – parse the init string
DESCRIPTION Parse the input string. Fill in values in the driver control structure.
The initialization string format is:
<unit>:<port>:<intVector>:<intLevel>:<attachementType>:<noRxFrames>
unit
Device unit number, a small integer.
port
base I/O address
intVector
Interrupt vector number (used with sysIntConnect)
333
VxWorks Drivers API Reference, 6.6
emacEndLoad( )
intLevel
Interrupt level
attachmentType
type of Ethernet connector
nRxFrames
no. of Rx Frames in integer format
emacEndLoad( )
NAME emacEndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes the driver and the device to the operational state. All of the
device-specific parameters are passed in the initString.
See ibmEmacInitParse( ) for the specific format of the string.
This function is meant to be called two different times during the driver load process. If this
routine is called with the first character of the initialization string equal to NULL, this routine
will return with the name of the device "emac" copied into initString. If this routine is called
with the actual driver parameters in initString, it will use the params to initialize the device
and prepare the rest of the driver for operation.
RETURNS An END object pointer, NULL if there is an error, or 0 and the name of the device if the first
character of initString is NULL.
ERRNO
334
2 Routines
endEtherAddressForm( )
emacTimerDebugDump( )
2
NAME emacTimerDebugDump( ) – Enable debugging output in timer handler
DESCRIPTION This function will enable/diable statistic data output in timer handler
RETURN N/A
endEtherAddressForm( )
NAME endEtherAddressForm( ) – form an Ethernet address into a packet
DESCRIPTION This routine accepts the source and destination addressing information through pSrcAddr
and pDstAddr and returns an M_BLK_ID that points to the assembled link-level header. To
do this, this routine prepends the link-level header into the cluster associated with pMblk if
there is enough space available in the cluster. It then returns a pointer to the pointer
referenced in pMblk. However, if there is not enough space in the cluster associated with
pMblk, this routine reserves a new mBlk-'clBlk'-cluster construct for the header
information. It then prepends the new mBlk to the mBlk passed in pMblk. As the function
value, this routine then returns a pointer to the new mBlk, which the head of a chain of
mBlk structures. The second element of this chain is the mBlk referenced in pMblk.
335
VxWorks Drivers API Reference, 6.6
endEtherCrc32BeGet( )
ERRNO
endEtherCrc32BeGet( )
NAME endEtherCrc32BeGet( ) – calculate a big-endian CRC-32 checksum
DESCRIPTION This routine performs a big endian CRC 32 calculation over an arbitrary block of data. Many
ethernet controllers implement multicast filtering using a hash table where a CRC-32
checksum of the multicast group address is used as the table index. This function is
provided as a convenience so that each driver doesn't need its own private copy.
ERRNO N/A
endEtherCrc32LeGet( )
NAME endEtherCrc32LeGet( ) – calculate a little-endian CRC-32 checksum
DESCRIPTION This routine performs a little endian CRC 32 calculation over an arbitrary block of data.
Many ethernet controllers implement multicast filtering using a hash table where a CRC-32
checksum of the multicast group address is used as the table index. This function is
provided as a convenience so that each driver doesn't need its own private copy.
336
2 Routines
endEtherPacketDataGet( )
ERRNO N/A
endEtherPacketAddrGet( )
NAME endEtherPacketAddrGet( ) – locate the addresses in a packet
DESCRIPTION This routine takes a M_BLK_ID, locates the address information, and adjusts the
M_BLK_ID structures referenced in pSrc, pDst, pESrc, and pEDst so that their pData
members point to the addressing information in the packet. The addressing information is
not copied. All mBlk structures share the same cluster.
RETURNS OK
ERRNO
endEtherPacketDataGet( )
NAME endEtherPacketDataGet( ) – return the beginning of the packet data
DESCRIPTION This routine fills the given pLinkHdrInfo with the appropriate offsets.
RETURNS OK or ERROR.
337
VxWorks Drivers API Reference, 6.6
endMcacheFlush( )
ERRNO
endMcacheFlush( )
NAME endMcacheFlush( ) – flush all tuples from the mBlk recycle cache
DESCRIPTION This function removes all mBlk tuple pointers from the mBlk recycle cache and frees them
with netMblkClChainFree( ). This function must be called whenever any interface that
uses the recycle cache is stopped so that cached buffers can be properly reclaimed.
RETURNS N/A
ERRNO N/A
endMcacheGet( )
NAME endMcacheGet( ) – allocate an mBlk tuple from the mBlk recycle cache
DESCRIPTION This function obtains an mBlk tuple stored in a fast mBlk recycle cache.
This cache is used to provide a performance boost for drivers used in devices designed for
traffic forwarding or bridging. In this devices, buffers from the RX side of an inbound
interface are often directly retransmitted via the TX side of an outbound interface, after
which they are released back to the RX interface's mBlk pool. This may consume a lot of
overhead depending on the pool implementation.
338
2 Routines
endObjFlagSet( )
Using the mBlk recycle cache may reduce this overhead. The cache is implemented as a
simple 128-entry pointer array. When a tuple is to be released by the TX completion handler
in a network driver, it can be put in the recycle cache instead of released with 2
netMblkClChainFree( ). Whenever another interface needs a tuple to replenish its RX
resources, it can allocate it from the pool instead of doing a netTupleGet( ). The cache only
holds 128 tuple pointers, the cache get and put operations use a minimum of processing and
are usually faster than the netTupleGet( ) and netMblkClChainFree( ) paths, which shaves
some cycles off the time needed to process a given packet.
ERRNO N/A
endMcachePut( )
NAME endMcachePut( ) – store an mBlk tuple in the mBlk recycle cache
DESCRIPTION This function places a pointer to an mBlk tuple in the mBlk recycle cache, as long as there is
room to store it. The cache only holds 128 pointers, so storing the pointer will fail if the cache
is full.
ERRNO N/A
endObjFlagSet( )
NAME endObjFlagSet( ) – set the flags member of an END_OBJ structure
339
VxWorks Drivers API Reference, 6.6
endObjInit( )
(
END_OBJ * pEnd,
UINT flags
)
DESCRIPTION As input, this routine expects a pointer to an END_OBJ structure (the pEnd parameter) and
a flags value (the flags parameter). This routine sets the flags member of the END_OBJ
structure to the value of the flags parameter.
Because this routine assumes that the driver interface is now up, this routine also sets the
attached member of the referenced END_OBJ structure to TRUE.
RETURNS OK
ERRNO
endObjInit( )
NAME endObjInit( ) – initialize an END_OBJ structure
DESCRIPTION This routine initializes an END_OBJ structure and fills it with data from the argument list.
It also creates and initializes semaphores and protocol list.
RETURNS OK or ERROR.
ERRNO
340
2 Routines
endPoolCreate( )
endPollStatsInit( )
2
NAME endPollStatsInit( ) – initialize polling statistics updates
DESCRIPTION This routine is used to begin polling of the interface specified by pCookie and will
periodically call out to the pIfPollRtn function, which will collect the interface statistics. If
the driver supports polling updates, this routine will start a watchdog that will invoke the
pIfPollRtn routine periodically. The watchdog will automatically re-arm itself. The
pIfPollRtn will be passed a pointer to the driver's END_IFDRVCONF structure as an
argument.
ERRNO
endPoolCreate( )
NAME endPoolCreate( ) – create a buffer pool for an END driver
DESCRIPTION This function is a helper routine for END drivers to simplify the creation of a driver-private
buffer pool. The caller need only specify the number of tuples in the pool. The resulting pool
will have an equal number of mBlks, cluster blocks and clusters (this is the typical
requirement for driver usage). The clusters in the pool will always be the same size,
governed by the endPoolClSize global variable. The default size is 1536 bytes.
Note that clusters will be allocated from cached storage. This may be unsuitable for some
drivers, however this is not an issue for drivers that are VxBus-compliant: cache coherence
issues should be handled internally by the vxbDmaBuf API.
341
VxWorks Drivers API Reference, 6.6
endPoolCreate( )
ERRNO N/A
endPoolCreate( )
NAME endPoolCreate( ) – create a jumbo buffer pool for an END driver
DESCRIPTION This function is a helper routine for END drivers to simplify the creation of a driver-private
buffer pool. It's similar to the endPoolCreate( ) function, except that it creates a pool of 9K
jumbo buffers for drivers that support jumbo frames.
ERRNO N/A
endPoolDestroy( )
NAME endPoolDestroy( ) – destroy a pool created with endPoolCreate( )
DESCRIPTION This function is used to release a buffer pool created with the endPoolCreate( ) function. All
memory allocated for use by the pool will be returned.
342
2 Routines
endPoolTupleGet( )
ERRNO N/A
endPoolTupleFree( )
NAME endPoolTupleFree( ) – free an mBlk tuple for an END driver
DESCRIPTION This function releases an mBlk tuple from a pool created with the endPoolCreate( ) routine.
It works in conjunction with the mBlk recycle cache to optimize performance when
allocating buffers in the transmit and receive paths in END drivers. If the buffer was
allocated using endPoolTupleAlloc( ), it will be put back into the mBlk recycle cache,
assuming there's room for it. If not, it will be released back to its original pool.
For buffers not allocated using endPoolTupleFree( ), this routine is equivalent to
netMblkClChainFree( ).
RETURNS N/A
ERRNO N/A
endPoolTupleGet( )
NAME endPoolTupleGet( ) – allocate an mBlk tuple for an END driver
DESCRIPTION This function allocate an mBlk tuple from a pool created with the endPoolCreate( ) routine.
It works in conjunction with the mBlk recycle cache to optimize performance when
allocating buffers in the transmit and receive paths in END drivers. If an mBlk tuple is
343
VxWorks Drivers API Reference, 6.6
endTok_r( )
available in the cache, the buffer will be allocated from it directly. Otherwise, a tuple will be
allocated from the pool.
Buffers allocated with endPoolTupleAlloc( ) should always be released with
endPoolTupleFree( ).
ERRNO N/A
endTok_r( )
NAME endTok_r( ) – get a token string (modified version)
DESCRIPTION This modified version can be used with optional parameters. If the parameter is not
specified, this version returns NULL. It does not signify the end of the original string, but
that the parameter is null.
/* required parameters */
/* optional parameters */
344
2 Routines
erfCategoriesAvailable( )
erfCategoriesAvailable( )
NAME erfCategoriesAvailable( ) – Get the number of unallocated User Categories.
DESCRIPTION none
ERRNO
erfCategoriesAvailable( )
NAME erfCategoriesAvailable( ) – Get the maximum number of Categories.
DESCRIPTION none
ERRNO
345
VxWorks Drivers API Reference, 6.6
erfCategoriesAvailable( )
erfCategoriesAvailable( )
NAME erfCategoriesAvailable( ) – Get the maximum number of Types.
DESCRIPTION none
ERRNO
erfCategoryAllocate( )
NAME erfCategoryAllocate( ) – Allocates a User Defined Event Category.
DESCRIPTION This routine allocates an Event Category for a new User Defined Event Category.
Once defined, User defined Categories cannot be deleted.
ERRNO S_erfLib_INVALID_PARAMETER
A parameter was out of range.
S_erfLib_TOO_MANY_USER_CATS
The number of User defined Event Categories exceeds the maximum number allowed.
346
2 Routines
erfDefaultQueueSizeGet( )
erfCategoryQueueCreate( )
2
NAME erfCategoryQueueCreate( ) – Creates a Category Event Processing Queue.
DESCRIPTION This routine creates an Event Processing Queue for a Category. A new task will be created
to process events from this queue.
Once defined, all events for this category will be stored on this queue.
ERRNO S_erfLib_INVALID_PARAMETER
A parameter was out of range.
S_erfLib_QUEUE_ALREADY_CREATED
The event processing queue has already been setup for this Event Category.
S_erfLib_MEMORY_ERROR
A memory allocation failed.
erfDefaultQueueSizeGet( )
NAME erfDefaultQueueSizeGet( ) – Get the size of the default queue.
DESCRIPTION none
ERRNO
347
VxWorks Drivers API Reference, 6.6
erfEventRaise( )
erfEventRaise( )
NAME erfEventRaise( ) – Raises an event.
DESCRIPTION This function will directly call all the handlers that are registed for this Event Category and
either this Event Type or T_erfLib_ALL_TYPES.
This routine should not be called from an Exception or Interrupt handler.
If the Event Processing routine flag has the ERF_FLAG_AUTO_UNREG option set, the event
processing routine will be unregistered after the routine is called.
ERRNO S_erfLib_INVALID_PARAMETER
A parameter was out of range.
S_erfLib_AUTO_UNREG_ERROR
An error occurred during Auto Unregistration.
erfHandlerRegister( )
NAME erfHandlerRegister( ) – Registers an event handler for a particular event.
348
2 Routines
erfHandlerUnregister( )
DESCRIPTION This routine registers an event handler for an event. The handler pointer will be saved and
called when the event is raised. The userData will be sent to handler.
The handler must be ready to handle the event prior to calling this function. 2
ERRNO S_erfLib_INVALID_PARAMETER
A parameter was out of range.
S_erfLib_MEMORY_ERROR
A memory allocation failed.
erfHandlerUnregister( )
NAME erfHandlerUnregister( ) – Registers an event handler for a particular event.
DESCRIPTION This routine unregisters an event handler that was previously registered for an event. The
handler pointer will be deleted. The userData will be returned to caller for destruction.
The handler must be able to handle the event until this routine returns successfully.
If multiple instances of this handler are registered for the same event, only the first instance
matched in the database will be deleted.
ERRNO S_erfLib_INVALID_PARAMETER
A parameter was out of range.
S_erfLib_HANDLER_NOT_FOUND
An event handler was not found.
349
VxWorks Drivers API Reference, 6.6
erfLibInit( )
erfLibInit( )
NAME erfLibInit( ) – Initialize the Event Reporting Framework library
DESCRIPTION This routine initializes the library to handle registrations of event handlers. The number of
User defined Categories and Types is passed in by the caller.
ERRNO S_erfLib_INIT_ERROR
A general Initialization Error.
S_erfLib_MEMORY_ERROR
A memory allocation failed.
erfShow( )
NAME erfShow( ) – Shows debug info for this library.
DESCRIPTION none
RETURNS Nothing
ERRNO
350
2 Routines
erfTypesAvailable( )
erfTypeAllocate( )
2
NAME erfTypeAllocate( ) – Allocates a User Defined Type for this Category.
DESCRIPTION This routine allocates a User Defined Event Type for a Category. Once defined, User
defined Type cannot be deleted.
ERRNO S_erfLib_INVALID_PARAMETER
A parameter was out of range.
S_erfLib_TOO_MANY_USER_TYPES
The number of User defined Event Categories exceeds the maximum number allowed
for this category.
erfTypesAvailable( )
NAME erfTypesAvailable( ) – Get the number of unallocated User Types for a category.
DESCRIPTION none
ERRNO
351
VxWorks Drivers API Reference, 6.6
evbNs16550HrdInit( )
evbNs16550HrdInit( )
NAME evbNs16550HrdInit( ) – initialize the NS 16550 chip
DESCRIPTION This routine is called to reset the NS 16550 chip to a quiescent state.
evbNs16550Int( )
NAME evbNs16550Int( ) – handle a receiver/transmitter interrupt for the NS 16550 chip
DESCRIPTION This routine is called to handle interrupts. If there is another character to be transmitted, it
sends it. If the interrupt handler is called erroneously (for example, if a device has never
been created for the channel), it disables the interrupt.
fdDevCreate( )
NAME fdDevCreate( ) – create a device for a floppy disk
352
2 Routines
fdDevCreate( )
RETURNS A pointer to a block device structure (BLK_DEV) or NULL if memory cannot be allocated for
the device structure.
353
VxWorks Drivers API Reference, 6.6
fdDrv( )
fdDrv( )
NAME fdDrv( ) – initialize the floppy disk driver
DESCRIPTION This routine initializes the floppy driver, sets up interrupt vectors, and performs hardware
initialization of the floppy chip.
This routine should be called exactly once, before any reads, writes, or calls to
fdDevCreate( ). Normally, it is called by usrRoot( ) in usrConfig.c.
RETURNS OK.
fdRawio( )
NAME fdRawio( ) – provide raw I/O access
DESCRIPTION This routine is called when the raw I/O access is necessary.
The drive parameter is the drive number of the floppy disk; valid values are 0 to 3.
The fdType parameter specifies the type of diskette, which is described in the structure table
fdTypes[] in sysLib.c. fdType is an index to the table. Currently the table contains two
diskette types:
- An fdType of 0 indicates the first entry in the table (3.5" 2HD, 1.44MB);
- An fdType of 1 indicates the second entry in the table (5.25" 2HD, 1.2MB).
The pFdRaw is a pointer to the structure FD_RAW, defined in nec765Fd.h
354
2 Routines
fei82557EndLoad( )
RETURNS OK or ERROR.
fei82557DumpPrint( )
NAME fei82557DumpPrint( ) – Display statistical counters
fei82557EndLoad( )
NAME fei82557EndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes both, driver and device to an operational state using device specific
parameters specified by initString.
The parameter string, initString, is an ordered list of parameters each separated by a colon.
The format of initString is, "unit:memBase:memSize:nCFDs:nRFDs:flags:offset:deviceId:
maxRxFrames:clToRfdRatio:nClusters"
355
VxWorks Drivers API Reference, 6.6
fei82557EndLoad( )
The 82557 shares a region of memory with the driver. The caller of this routine can specify
the address of this memory region, or can specify that the driver must obtain this memory
region from the system resources.
A default number of transmit/receive frames of 32 and 128 respectively and can be selected
by passing zero in the parameters nTfds and nRfds. In other cases, the number of frames
selected should be greater than two.
All optional parameters can be set to their default value by specifying NONE (-1) as their
value.
The memBase parameter is used to inform the driver about the shared memory region. If this
parameter is set to the constant "NONE," then this routine will attempt to allocate the shared
memory from the system. Any other value for this parameter is interpreted by this routine
as the address of the shared memory region to be used. The memSize parameter is used to
check that this region is large enough with respect to the provided values of both
transmit/receive frames.
If the caller provides the shared memory region, then the driver assumes that this region is
non-cached.
If the caller indicates that this routine must allocate the shared memory region, then this
routine will use memalign( ) to allocate some cache aligned memory.
The memSize parameter specifies the size of the pre-allocated memory region. If memory
base is specified as NONE (-1), the driver ignores this parameter. Otherwise, the driver
checks the size of the provided memory region is adequate with respect to the given number
of RFDs, RBDs, CFDs, and clusters specified. The number of clusters required will be at least
equal to (nRFDs * 2) + nCFDs. Otherwise the End Load routine will return ERROR. The
number of clusters can be specified by either passing a value in the nCluster parameter, in
which case the nCluster value must be at least nRFDs * 2, or by setting the cluster to RFD
ratio (clToRfdRatio) to a number equal or greater than 2.
The nTfds parameter specifies the number of transmit descriptor/buffers to be allocated. If
this parameter is less than two, a default of 64 is used.
The nRfds parameter specifies the number of receive descriptors to be allocated. If this
parameter is less than two or NONE (-1) a default of 128 is used.
The flags parameter specifies the user flags may control the run-time characteristics of the
Ethernet chip. Not implemented.
The offset parameter is used to align IP header on word boundary for CPUs that need long
word aligned access to the IP packet (this will normally be zero or two). This parameter is
optional, the default value is zero.
The deviceId parameter is used to indicate the specific type of device being used, the 82557
or subsequent. This is used to determine if features which were introduced after the 82557
can be used. The default is the 82557. If this is set to any value other than ZERO (0), NONE
(-1), or FEI82557_DEVICE_ID (0x1229) it is assumed that the device will support features
not in the 82557.
356
2 Routines
fei82557ErrCounterDump( )
The maxRxFrames parameter limits the number of frames the receive handler will service in
one pass. It is intended to prevent the tNetTask from monopolizing the CPU and starving
applications. This parameter is optional, the default value is nRFDs * 2. 2
The clToRfdRatio parameter sets the number of clusters as a ratio of nRFDs. The minimum
setting for this parameter is 2. This parameter is optional, the default value is 5.
The nClusters parameter sets the number of clusters to allocate. This value must be at least
nRFD * 2. If this value is set then the clToRfdRatio is ignored. This parameter is optional, the
default is nRFDs * clToRfdRatio.
fei82557ErrCounterDump( )
NAME fei82557ErrCounterDump( ) – dump statistical counters
DESCRIPTION This routine dumps statistical counters for the purpose of debugging and tuning the 82557.
The memAddr parameter is the pointer to an array of 68 bytes in the local memory. This
memory region must be allocated before this routine is called. The memory space must also
be DWORD (4 bytes) aligned. When the last DWORD (4 bytes) is written to a value, 0xa007,
it indicates the dump command has completed. To determine the meaning of each
statistical counter, see the Intel 82557 manual.
RETURNS OK or ERROR.
357
VxWorks Drivers API Reference, 6.6
fei82557GetRUStatus( )
fei82557GetRUStatus( )
NAME fei82557GetRUStatus( ) – Return the current RU status and int mask
DESCRIPTION none
RETURNS N/A
fei82557ShowRxRing( )
NAME fei82557ShowRxRing( ) – Show the Receive ring
DESCRIPTION This routine dumps the contents of the RFDs and RBDs in the Rx ring.
RETURNS N/A
g64120aMfRegister( )
NAME g64120aMfRegister( ) – register g64120aMf driver
358
2 Routines
g64120aPciRegister( )
DESCRIPTION This routine registers the g64120aMf driver and device recognition data with the vxBus
subsystem.
2
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
g64120aMfpDrvCtrlShow( )
NAME g64120aMfpDrvCtrlShow( ) – show pDrvCtrl for g64120a system controller
DESCRIPTION none
g64120aPciRegister( )
NAME g64120aPciRegister( ) – register g64120aPci driver
DESCRIPTION This routine registers the g64120aPci driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
359
VxWorks Drivers API Reference, 6.6
gei82543EndLoad( )
RETURNS N/A
ERRNO
gei82543EndLoad( )
NAME gei82543EndLoad( ) – initialize the driver and device
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:
"unitnum:shmem_addr:shmem_size:rxDescNum:txDescNum:usrFlags:offset:mtu"
gei82543LedOff( )
NAME gei82543LedOff( ) – turn off LED
RETURNS N/A
360
2 Routines
gei82543PhyRegGet( )
gei82543LedOn( )
NAME gei82543LedOn( ) – turn on LED
RETURNS N/A
gei82543PhyRegGet( )
NAME gei82543PhyRegGet( ) – get the register value in PHY
DESCRIPTION This routine returns the PHY's register value, or -1 if an error occurs.
361
VxWorks Drivers API Reference, 6.6
gei82543PhyRegSet( )
gei82543PhyRegSet( )
NAME gei82543PhyRegSet( ) – set the register value in PHY
DESCRIPTION This routine returns the PHY's register value, or -1 if an error occurs.
gei82543RegGet( )
NAME gei82543RegGet( ) – get the specified register value in 82543 chip
DESCRIPTION This routine gets and shows the specified register value in 82543 chip
362
2 Routines
gei82543TbiCompWr( )
gei82543RegSet( )
2
NAME gei82543RegSet( ) – set the specified register value
RETURNS N/A
gei82543TbiCompWr( )
NAME gei82543TbiCompWr( ) – enable/disable the TBI compatibility workaround
RETURNS N/A
363
VxWorks Drivers API Reference, 6.6
gei82543Unit( )
gei82543Unit( )
NAME gei82543Unit( ) – return a pointer to the END_DEVICE for a gei unit
DESCRIPTION none
hardWareInterFaceInit( )
NAME hardWareInterFaceInit( ) – Hardware Interface Pre-Kernel Initialization
RETURNS None
ERRNO None
hcfDeviceGet( )
NAME hcfDeviceGet( ) – get the HCF_DEVICE pointer
364
2 Routines
hcfResourceDevShow( )
ERRNO
hcfResourceAllShow( )
NAME hcfResourceAllShow( ) – show all devices and resource values
DESCRIPTION This routines displays the device and resource values for all HCF records.
RETURNS N/A
ERRNO
hcfResourceDevShow( )
NAME hcfResourceDevShow( ) – show the device and resource values
DESCRIPTION This routine displays the device and the resource values associated with the specified
resource.
RETURNS N/A
ERRNO
365
VxWorks Drivers API Reference, 6.6
hcfResourceShow( )
hcfResourceShow( )
NAME hcfResourceShow( ) – show values for specified resource
RETURNS N/A
ERRNO
hwMemAlloc( )
NAME hwMemAlloc( ) – allocate a buffer from the hardware memory pool
DESCRIPTION This function allocates a buffer from the hardware memory pool. Buffers from this pool
have one of the following sizes:
48 bytes
112 bytes
240 bytes
496 bytes
1008 bytes
2032 bytes
These sizes are power-of-two minus 12. Each buffer is at least 4-byte aligned. Immediately
before and after each buffer is a 4-byte sentinel. Immediately before the initial sentinel is a
pointer to the next buffer in the chain.
This results in an 8-byte sentinel between each buffer, in order to detect buffer overrun or
underrun.
366
2 Routines
hwMemLibInit( )
ERRNO
hwMemFree( )
NAME hwMemFree( ) – return buffer to the hardware memory pool
ERRNO
hwMemLibInit( )
NAME hwMemLibInit( ) – initialize hardware memory allocation library
RETURNS N/A
ERRNO
367
VxWorks Drivers API Reference, 6.6
hwMemPoolCreate( )
hwMemPoolCreate( )
NAME hwMemPoolCreate( ) – create or add a memory pool for driver memory allocation
DESCRIPTION This function creates a memory pool for use by hwMemLib if one does not already exist. If
one does exist, this function creates an additional pool which can be used if/when the
previous pool(s) have insufficient space available.
RETURNS OK
ERRNO
hwMemShow( )
NAME hwMemShow( ) –
DESCRIPTION none
RETURNS N/A
ERRNO
hwifDevCfgRead( )
NAME hwifDevCfgRead( ) – read from device configuration space
368
2 Routines
hwifDevCfgWrite( )
(
VXB_DEVICE_ID pInst, /* DEVICE ID */
UINT32 size, /* size of transaction */
UINT32 offset, /* offset into register set */ 2
UINT32 flagVal /* flags */
)
DESCRIPTION This routine reads the specified size value from the specified
offset into device configuration space, and prints the value on
stdout.
RETURNS: 0, always
hwifDevCfgWrite( )
NAME hwifDevCfgWrite( ) – write device configuration space
DESCRIPTION This routine writes the specified size value into device configuration
space.
This routine supports only 8-bit, 16-bit, and 32-bit operations. Use
hwifDevCfgWrite64( ) for 64-bit write operations.
369
VxWorks Drivers API Reference, 6.6
hwifDevCfgWrite64( )
RETURNS: 0, always
hwifDevCfgWrite64( )
NAME hwifDevCfgWrite64( ) – write device register
DESCRIPTION This routine writes a 64-bit value into a device register, using
the 64-bit vxBus register write routine.
RETURNS: 0, always
370
2 Routines
hwifDevRegWrite( )
hwifDevRegRead( )
2
NAME hwifDevRegRead( ) – read device register
DESCRIPTION This routine reads the specified size value from a device register, using
the appropriate vxBus register read routine.
RETURNS: 0, always
hwifDevRegWrite( )
NAME hwifDevRegWrite( ) – write device register
371
VxWorks Drivers API Reference, 6.6
hwifDevRegWrite64( )
DESCRIPTION This routine writes the specified size value into a device register, using
the appropriate vxBus register read routine.
This routine supports only 8-bit, 16-bit, and 32-bit operations. Use
hwifDevRegWrite64( ) for 64-bit write operations.
RETURNS: 0, always
hwifDevRegWrite64( )
NAME hwifDevRegWrite64( ) – write device register
DESCRIPTION This routine writes a 64-bit value into a device register, using
the 64-bit vxBus register write routine.
RETURNS: 0, always
372
2 Routines
i8250Int( )
i8250HrdInit( )
NAME i8250HrdInit( ) – initialize the chip
RETURNS N/A
i8250Int( )
NAME i8250Int( ) – handle a receiver/transmitter interrupt
DESCRIPTION This routine handles four sources of interrupts from the UART. If there is another character
to be transmitted, the character is sent. When a modem status interrupt occurs, the transmit
interrupt is enabled if the CTS signal is TRUE.
RETURNS N/A
373
VxWorks Drivers API Reference, 6.6
iOlicomEndLoad( )
iOlicomEndLoad( )
NAME iOlicomEndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes the driver and the device to the operational state. All of the device
specific parameters are passed in the initString.
This routine can be called in two modes. If it is called with an empty, but allocated string
then it places the name of this device (i.e. oli) into the initString and returns 0.
If the string is allocated then the routine attempts to perform its load functionality.
RETURNS An END object pointer or NULL on error or 0 and the name of the device if the initString was
NULL.
iOlicomIntHandle( )
NAME iOlicomIntHandle( ) – interrupt service for card interrupts
DESCRIPTION This routine is called when an interrupt has been detected from the Olicom card.
RETURNS N/A.
374
2 Routines
iPIIX4GetIntr( )
iPIIX4AtaInit( )
2
NAME iPIIX4AtaInit( ) – low level initialization of ATA device
DESCRIPTION This routine will initialize PIIX4 - PCI-ISA/IDE bridge for proper working of ATA device.
RETURNS OK or ERROR.
ERRNO
iPIIX4FdInit( )
NAME iPIIX4FdInit( ) – initializes the floppy disk device
DESCRIPTION This routine will initialize PIIX4 - PCI-ISA/IDE bridge and DMA for proper working of
floppy disk device
RETURNS OK or ERROR.
ERRNO
iPIIX4GetIntr( )
NAME iPIIX4GetIntr( ) – give device an interrupt level to use
375
VxWorks Drivers API Reference, 6.6
iPIIX4Init( )
(
int pintx
)
DESCRIPTION This routine will give device an interrupt level to use based on PCI INT A through D, valid
values for pintx are 0, 1, 2 and 3. An autoroute in disguise.
ERRNO
iPIIX4Init( )
NAME iPIIX4Init( ) – initialize PIIX4
RETURNS OK or ERROR.
ERRNO
iPIIX4IntrRoute( )
NAME iPIIX4IntrRoute( ) – Route PIRQ[A:D]
376
2 Routines
ibmPciConfigRead( )
RETURNS OK or ERROR.
ERRNO 2
SEE ALSO iPIIX4
iPIIX4KbdInit( )
NAME iPIIX4KbdInit( ) – initializes the PCI-ISA/IDE bridge
DESCRIPTION This routine will initialize PIIX4 - PCI-ISA/IDE bridge to enable keyboard device and IRQ
routing
RETURNS OK or ERROR.
ERRNO
ibmPciConfigRead( )
NAME ibmPciConfigRead( ) – reads one PCI configuration space register
DESCRIPTION This routine reads one PCI configuration register of the specified size (1, 2 or 4 bytes) using
a Type 0 or 1 configuration transaction.
377
VxWorks Drivers API Reference, 6.6
ibmPciConfigWrite( )
ibmPciConfigWrite( )
NAME ibmPciConfigWrite( ) – write to one PCI configuration register location
DESCRIPTION This routine writes one PCI configuration space location of the specified size (1, 2 or 4 bytes)
using a Type 0 or 1 configuration transaction.
ibmPciSpecialCycle( )
NAME ibmPciSpecialCycle( ) – generates a PCI special cycle
DESCRIPTION This routine generates a PCI special cycle on the PCI bus.
378
2 Routines
intCtlrHwConfGet( )
intCtlrChainISR( )
NAME intCtlrChainISR( ) – process interrupt chain
DESCRIPTION none
intCtlrHwConfGet( )
NAME intCtlrHwConfGet( ) – get interrupt input pin configuration from BSP
DESCRIPTION This routine reads entries from the hcf record for the intCtlr
device specified by pInst, and fills them in to a table.
379
VxWorks Drivers API Reference, 6.6
intCtlrHwConfShow( )
intCtlrHwConfShow( )
NAME intCtlrHwConfShow( ) – print interrupt input pin configuration
DESCRIPTION none
intCtlrISRAdd( )
NAME intCtlrISRAdd( ) – Install ISR at specified pin
DESCRIPTION none
380
2 Routines
intCtlrISREnable( )
intCtlrISRDisable( )
2
NAME intCtlrISRDisable( ) – Disable specified ISR
DESCRIPTION This routine disables the specified ISR. If all ISRs on the chain are
disabled, then this routine returns TRUE. The interrupt controller driver
calling this routine should check the return value, and disable the
input pin in hardware if no ISRs on this chain are enabled.
intCtlrISREnable( )
NAME intCtlrISREnable( ) – Enable specified ISR
DESCRIPTION This routine marks the specified ISR as enabled and callable
when an interrupt occurs on this input. If the input is chained,
then the specified ISR is enabled as well as the top-level chain
handler.
381
VxWorks Drivers API Reference, 6.6
intCtlrISRRemove( )
intCtlrISRRemove( )
NAME intCtlrISRRemove( ) – Remove ISR from specified pin
DESCRIPTION This routine removes the specified ISR and argument from the
specified input pin. If this is the last ISR, then the stray
handler is re-installed. Note that once a chain has been created,
the only way to remove it is to remove the last ISR. We do
not replace a single-element chain with a direct call.
intCtlrPinFind( )
NAME intCtlrPinFind( ) – Retrieve input pin associated with device
382
2 Routines
intCtlrTableArgGet( )
DESCRIPTION This routine returns the input pin on the controller device, to which
the specified device is connected. If no device is connected, this
routine returns -1. 2
intCtlrStrayISR( )
NAME intCtlrStrayISR( ) – flag stray interrupt
DESCRIPTION none
intCtlrTableArgGet( )
NAME intCtlrTableArgGet( ) – Fetch ISR argument from ISR table entry
383
VxWorks Drivers API Reference, 6.6
intCtlrTableCreate( )
(
struct intCtlrHwConf * pInputs,
int inputPin
)
DESCRIPTION none
intCtlrTableCreate( )
NAME intCtlrTableCreate( ) – Create table structure
DESCRIPTION none
intCtlrTableFlagsGet( )
NAME intCtlrTableFlagsGet( ) – Fetch ISR flags from ISR table entry
384
2 Routines
intCtlrTableIsrGet( )
DESCRIPTION none
intCtlrTableFlagsSet( )
NAME intCtlrTableFlagsSet( ) – Set ISR flags in ISR table entry
DESCRIPTION none
intCtlrTableIsrGet( )
NAME intCtlrTableIsrGet( ) – Fetch ISR function pointer from ISR table entry
DESCRIPTION none
385
VxWorks Drivers API Reference, 6.6
intCtlrTableUserSet( )
intCtlrTableUserSet( )
NAME intCtlrTableUserSet( ) – Fill in ISR table entry: driver name, unit, index
DESCRIPTION none
isrDeferIsrReroute( )
NAME isrDeferIsrReroute( ) – Reroute deferral work to a new CPU in the system.
DESCRIPTION This routine is called by a driver when the driver's interrupts have been rerouted to a
different CPU within the SMP system. The driver provides the previous queue ID it has
been using for this interrupt channel, and receives a new queue in exchange.
386
2 Routines
isrDeferLibInit( )
isrDeferJobAdd( )
NAME isrDeferJobAdd( ) – Add a job to the deferral queue
DESCRIPTION This routine adds a job to a deferral queue. The caller is responsible for allocating the
ISR_DEFER_JOB storage, and for ensuring that the deferred work has completed before
attempting to reuse the storage. It is an error to enqueue an ISR_DEFER_JOB structure more
than once.
RETURNS N/A
isrDeferLibInit( )
NAME isrDeferLibInit( ) – Initialize the ISR deferral library.
DESCRIPTION This routine initializes the ISR deferral library. Queues are allocated on an as-needed basis,
so no queues are created during initialization.
387
VxWorks Drivers API Reference, 6.6
isrDeferQueueGet( )
isrDeferQueueGet( )
NAME isrDeferQueueGet( ) – Get a deferral queue
DESCRIPTION none
isrRerouteNotify( )
NAME isrRerouteNotify( ) – Notify driver that ISR has been rerouted
388
2 Routines
ixp400I2CByteReceive( )
RETURNS N/A
ixp400I2CByteReceive( )
NAME ixp400I2CByteReceive( ) – receive a byte on the I2C bus
389
VxWorks Drivers API Reference, 6.6
ixp400I2CByteTransmit( )
DESCRIPTION This routine receives a byte of data from the I2C bus and stores it to the location specified
by the dataByte parameter. All byte transfers are Most Significant Bit (MSB) first.
RETURNS N/A
ixp400I2CByteTransmit( )
NAME ixp400I2CByteTransmit( ) – transmit a byte on the I2C bus
DESCRIPTION This routine transmits a specified dataByte on the I2C bus. All byte transfers are Most
Significant Bit (MSB) first.
RETURNS N/A
ixp400I2CReadTransfer( )
NAME ixp400I2CReadTransfer( ) – read from a slave device
390
2 Routines
ixp400I2CStop (Control signal)( )
UINT8 offset
)
2
DESCRIPTION This routine reads num bytes into buffer from offset in a slave device with address devAddr.
RETURNS The number of bytes actually read, which may be zero or less than num in the event of an
error.
DESCRIPTION This routine initiates a transfer on the I2C bus. This should only be called from a master
device (i.e. GPIO controller on IXP400).
RETURNS OK when the bus is free, else ERROR if the bus is already in use by another task.
DESCRIPTION This routine terminates a transfer on the I2C bus. The I2C bus will be left in a free state;
namely, SCL HIGH and SDA HIGH. This should only be called from a master device (i.e.
GPIO controller on IXP400)
RETURNS N/A
391
VxWorks Drivers API Reference, 6.6
ixp400I2CWriteTransfer( )
ixp400I2CWriteTransfer( )
NAME ixp400I2CWriteTransfer( ) – write to a slave device
DESCRIPTION This routine writes num bytes from buffer to offset in a slave device with address devAddr.
RETURNS The number of bytes actually written, which may be zero or less than num in the event of an
error.
ixp400SioDevInit( )
NAME ixp400SioDevInit( ) – initialise a UART channel
DESCRIPTION This routine initialises some SIO_CHAN function pointers and then resets the chip in a
quiescent state. Before this routine is called, the BSP must already have initialised all the
device addresses, etc. in the IXP400_SIO_CHAN structure.
RETURNS N/A
392
2 Routines
ixp400SioIntErr( )
ixp400SioInt( )
NAME ixp400SioInt( ) – interrupt level processing
DESCRIPTION This function handles four sources of interrupts from the UART. They are prioritized in the
following order by the Interrupt Identification Register Receiver Line Status, Received
Data Ready, 'Transmit Holding Register Empty' and Modem Status.
When a modem status interrupt occurs, the transmit interrupt is enabled if the CTS signal
is TRUE.
RETURNS N/A
ixp400SioIntErr( )
NAME ixp400SioIntErr( ) – handle an error interrupt
RETURNS N/A
393
VxWorks Drivers API Reference, 6.6
ixp400SioIntWr( )
ixp400SioIntWr( )
NAME ixp400SioIntWr( ) – handle a transmitter interrupt
DESCRIPTION This routine handles write interrupts from the UART. It reads a character and puts it in the
transmit holding register of the device for transfer. If there are no more characters to
transmit, transmission is disabled by clearing the transmit interrupt enable bit in the IER(int
enable register). Any pending recieve data is also serviced.
RETURNS N/A
ixp400SioRegister( )
NAME ixp400SioRegister( ) – register ixp400Sio driver
DESCRIPTION This routine registers the ixp400Sio driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
394
2 Routines
ln97xEndLoad( )
ixp400SioStatsShow( )
2
NAME ixp400SioStatsShow( ) – display UART error statistics.
RETURNS N/A
ixp400TimerDrvRegister( )
NAME ixp400TimerDrvRegister( ) – register ixp400 timer driver
DESCRIPTION This routine registers the ixp400 timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO
ln97xEndLoad( )
NAME ln97xEndLoad( ) – initialize the driver and device
395
VxWorks Drivers API Reference, 6.6
ln97xInitParse( )
DESCRIPTION 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:devMemAddr:devIoAddr:pciMemBase:vecnum:intLvl:memAdrs
:memSize:memWidth:csr3b:offset:flags>
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, "lnPci") 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.
RETURNS An END object pointer, or NULL on error, or 0 and the name of the device if the initString
was NULL.
ln97xInitParse( )
NAME ln97xInitParse( ) – parse the initialization string
DESCRIPTION Parse the input string. This routine is called from ln97xEndLoad( ) which initializes some
values in the driver control structure with the values passed in the initialization string.
The initialization string format is:
<unit:devMemAddr:devIoAddr:pciMemBase:vecNum:intLvl:memAdrs
:memSize:memWidth:csr3b:offset:flags>
unit
The device unit number. Unit numbers are integers starting at zero and increasing for
each device controlled by the driver.
devMemAddr
The device memory mapped I/O register base address. Device registers must be
mapped into the host processor address space in order for the driver to be functional.
Thus, this is a required parameter.
396
2 Routines
lptDevCreate( )
devIoAddr
Device register base I/O address (obsolete).
pciMemBase 2
Base address of PCI memory space.
vecNum
Interrupt vector number.
intLvl
Interrupt level. Generally, this value specifies an interrupt level defined for an external
interrupt controller.
memAdrs
Memory pool address or NONE.
memSize
Memory pool size or zero.
memWidth
Memory system size, 1, 2, or 4 bytes (optional).
CSR3
Control and Status Register 3 (CSR3) options.
offset
Memory alignment offset.
flags
Device specific flags reserved for future use.
lptDevCreate( )
NAME lptDevCreate( ) – create a device for an LPT port
397
VxWorks Drivers API Reference, 6.6
lptDrv( )
DESCRIPTION This routine creates a device for a specified LPT port. Each port to be used should have
exactly one device associated with it by calling this routine.
For instance, to create the device /lpt/0, the proper call would be:
lptDevCreate ("/lpt/0", 0);
RETURNS OK, or ERROR if the driver is not installed, the channel is invalid, or the device already
exists.
lptDrv( )
NAME lptDrv( ) – initialize the LPT driver
DESCRIPTION This routine initializes the LPT driver, sets up interrupt vectors, and performs hardware
initialization of the LPT ports.
This routine should be called exactly once, before any reads, writes, or calls to
lptDevCreate( ). Normally, it is called by usrRoot( ) in usrConfig.c.
lptShow( )
NAME lptShow( ) – show LPT statistics
398
2 Routines
m54x5TimerDrvRegister( )
(
UINT channel /* channel (0 - 2) */
)
2
DESCRIPTION This routine shows statistics for a specified LPT port.
RETURNS N/A
m548xDmaDrvRegister( )
NAME m548xDmaDrvRegister( ) – register coldFire DMA driver
DESCRIPTION This routine registers the coldFire DMA driver with the vxBus subsystem.
RETURNS N/A
ERRNO
m54x5TimerDrvRegister( )
NAME m54x5TimerDrvRegister( ) – register coldFire timer driver
DESCRIPTION This routine registers the coldFire timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO
399
VxWorks Drivers API Reference, 6.6
m8260SccEndLoad( )
m8260SccEndLoad( )
NAME m8260SccEndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes the driver and the device to the operational state. All of the device
specific parameters are passed in the initString, which is of the following format:
unit:motCpmAddr:ivec:sccNum:txBdNum:rxBdNum:txBdBase:rxBdBase:bufBase
The parameters of this string are individually described in the motCpmEnd man page.
The SCC shares a region of memory with the driver. The caller of this routine can specify
the address of a non-cacheable memory region with bufBase. Or, if this parameter is
"NONE", the driver obtains this memory region by making calls to cacheDmaMalloc( ).
Non-cacheable memory space is important whenever the host processor uses cache
memory. This is also the case when the MC68EN360 is operating in companion mode and
is attached to a processor with cache memory.
After non-cacheable memory is obtained, this routine divides up the memory between the
various buffer descriptors (BDs). The number of BDs can be specified by txBdNum and
rxBdNum, or if "NULL", a default value of 32 BDs will be used. An additional number of
buffers are reserved as receive loaner buffers. The number of loaner buffers is a default
number of 16.
The user must specify the location of the transmit and receive BDs in the processor's dual
ported RAM. txBdBase and rxBdBase give the offsets from motCpmAddr for the base of the
BD rings. Each BD uses 8 bytes. Care must be taken so that the specified locations for
Ethernet BDs do not conflict with other dual ported RAM structures.
Multiple individual device units are supported by this driver. Device units can reside on
different chips, or could be on different SCCs within a single processor. The sccNum
parameter is used to explicitly state which SCC is being used. SCC1 is most commonly used,
thus this parameter most often equals "1".
Before this routine returns, it connects up the interrupt vector ivec.
400
2 Routines
m85xxRioRegister( )
m85xxCpuRegister( )
2
NAME m85xxCpuRegister( ) – register m85xxCpu driver
DESCRIPTION This routine registers the m85xxCpu driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
m85xxRioRegDbgRead( )
NAME m85xxRioRegDbgRead( ) – read rapidIO registers
DESCRIPTION none
RETURNS NONE
m85xxRioRegister( )
NAME m85xxRioRegister( ) – register PowerPC 85xx rapidIO with bus subsystem
401
VxWorks Drivers API Reference, 6.6
m85xxRioStatusShow( )
DESCRIPTION This passes the registration structure for this device to the vxBus registration function. Only
when this is called can the driver be used.
RETURNS N/A
ERRNO N/A
m85xxRioStatusShow( )
NAME m85xxRioStatusShow( ) – show state of RapidIO interface
DESCRIPTION none
RETURNS NONE
m85xxTimerDrvRegister( )
NAME m85xxTimerDrvRegister( ) – register m85xx timer driver
DESCRIPTION This routine registers the m85xx timer driver with the vxBus subsystem.
RETURNS N/A
402
2 Routines
mib2ErrorAdd( )
ERRNO
mcf5475PciRegister( )
NAME mcf5475PciRegister( ) – register Coldfire mcf5475 host controller
DESCRIPTION This routine registers the Coldfire mdf5475 host controller with the vxBus subsystem.
RETURNS N/A
ERRNO
mib2ErrorAdd( )
NAME mib2ErrorAdd( ) – change a MIB-II error count
DESCRIPTION This function adds a specified value to one of the MIB-II error counters in a MIB-II interface
table. The counter to be altered is specified by the errCode argument. errCode can be
MIB2_IN_ERRS, MIB2_IN_UCAST, MIB2_OUT_ERRS or MIB2_OUT_UCAST. Specifying
a negative value reduces the error count, a positive value increases the error count.
RETURNS OK
ERRNO
403
VxWorks Drivers API Reference, 6.6
mib2Init( )
mib2Init( )
NAME mib2Init( ) – initialize a MIB-II structure
DESCRIPTION Initialize a MIB-II structure. Set all error counts to zero. Assume a 10Mbps Ethernet device.
RETURNS OK or ERROR.
ERRNO
miiAnCheck( )
NAME miiAnCheck( ) – check the auto-negotiation process result
DESCRIPTION This routine checks the auto-negotiation process has completed successfully and no faults
have been detected by any of the PHYs engaged in the process.
NOTE In case the cable is pulled out and reconnect to the same/different hub/switch again. PHY
probably starts a new auto-negotiation process and get different negotiation results. User
should call this routine to check link status and update phyFlags. pPhyInfo should include
a valid PHY bus number (phyAddr), and include the phyFlags that was used last time to
configure auto-negotiation process.
RETURNS OK or ERROR.
404
2 Routines
miiLibUnInit( )
miiLibInit( )
NAME miiLibInit( ) – initialize the MII library
PROTECTION DOMAINS
(VxAE) This function can only be called from within the kernel protection domain.
RETURNS OK or ERROR.
miiLibUnInit( )
NAME miiLibUnInit( ) – uninitialize the MII library
DESCRIPTION This routine uninitializes the MII library. Previously allocated resources are reclaimed back
to the system.
RETURNS OK or ERROR.
405
VxWorks Drivers API Reference, 6.6
miiPhyInit( )
miiPhyInit( )
NAME miiPhyInit( ) – initialize and configure the PHY devices
DESCRIPTION This routine scans, initializes and configures the PHY device described in phyInfo. Space for
phyInfo is to be provided by the calling task.
This routine is called from the driver's Start routine to perform media initialization and
configuration. To access the PHY device through the MII-management interface, it uses the
read and write routines which are provided by the driver itself in the fields phyReadRtn( ),
phyWriteRtn( ) of the phyInfo structure. Before it attempts to use this routine, the driver has
to properly initialize some of the fields in the phyInfo structure, and optionally fill in others,
as below:
pDrvCtrl->phyInfo->phyFlags = 0;
pDrvCtrl->phyInfo->phyAddr = (UINT8) MII_PHY_DEF_ADDR;
pDrvCtrl->phyInfo->phyDefMode = (UINT8) PHY_10BASE_T;
pDrvCtrl->phyInfo->phyAnOrderTbl = (MII_AN_ORDER_TBL *)
&xxxPhyAnOrderTbl;
/*
@ fill in some more optional fields in phyInfo: the delay stuff
@ we want this routine to use our xxxDelay () routine, with
@ the constant one as an argument, and the max delay we may
@ tolerate is the constant MII_PHY_DEF_DELAY, in xxxDelay units
*/
/*
@ fill in some more optional fields in phyInfo: the PHY's callback
@ to handle "link down" events. This routine is invoked whenever
@ the link status in the PHY being used is detected to be low.
*/
406
2 Routines
miiPhyInit( )
Some of the above fields may be overwritten by this routine, since for instance, the logical
address of the PHY actually used may differ from the user's initial setting. Likewise, the 2
specific PHY being initialized, may not support all the technology abilities the user has
allowed for its operations.
This routine first scans for all possible PHY addresses in the range 0-31, checking for an
MII-compliant PHY, and attempts at running some diagnostics on it. If none is found,
ERROR is returned.
Typically PHYs are scanned from address 0, but if the user specifies an alternative start PHY
address via the parameter phyAddr in the phyInfo structure, PHYs are scanned in order
starting with the specified PHY address. In addition, if the flag MII_ALL_BUS_SCAN is set,
this routine will scan the whole bus even if a valid PHY has already been found, and stores
bus topology information. If the flags MII_PHY_ISO, MII_PHY_PWR_DOWN are set, all of
the PHYs found but the first will be respectively electrically isolated from the MII interface
and/or put in low-power mode. These two flags are meaningless in a configuration where
only one PHY is present.
The phyAddr parameter is very important from a performance point of view. Since the MII
management interface, through which the PHY is configured, is a very slow one, providing
an incorrect or invalid address in this field may result in a particularly long boot process.
If the flag MII_ALL_BUS_SCAN is not set, this routine will assume that the first PHY found
is the only one.
This routine then attempts to bring the link up. This routine offers two strategies to select a
PHY and establish a valid link. The default strategy is to use the standard 802.3 style
auto-negotiation, where both link partners negotiate all their technology abilities at the
same time, and the highest common denominator ability is chosen. Before the
auto-negotiation is started, the next-page exchange mechanism is disabled.
If GMII interface is used, users can specify it through userFlags -- MII_PHY_GMII_TYPE.
The user can prevent the PHY from negotiating certain abilities via userFlags --
MII_PHY_FD, MII_PHY_100, MII_PHY_HD, and MII_PHY_10. as well as
MII_PHY_1000T_HD and MII_PHY_1000T_FD if GMII is used. When MII_PHY_FD is not
specified, full duplex will not be negotiated; when MII_PHY_HD is not specified half
duplex will not be negotiated, when MII_PHY_100 is not specified, 100Mbps ability will
not be negotiated; when MII_PHY_10 is not specified, 10Mbps ability will not be negotiated.
Also, if GMII is used, when MII_PHY_1000T_HD is not specified, 1000T with half duplex
mode will not be negotiated. Same thing applied to 1000T with full duplex mode via
MII_PHY_1000T_FD.
Flow control ability can also be negotiated via user flags -- MII_PHY_TX_FLOW_CTRL and
MII_PHY_RX_FLOW_CTRL. For symmetric PAUSE ability (MII), user can set/clean both
flags together. For asymmetric PAUSE ability (GMII), user can separate transmit and
receive flow control ability. However, user should be aware that flow control ability is
meaningful only if full duplex mode is used.
407
VxWorks Drivers API Reference, 6.6
miiPhyOptFuncMultiSet( )
When MII_PHY_TBL is set in the user flags, the BSP specific table whose address may be
provided in the phyAnOrderTbl field of the phyInfo structure, is used to obtain the list, and
the order of technology abilities to be negotiated. The entries in this table are ordered such
that entry 0 is the highest priority, entry 1 in next and so on. Entries in this table may be
repeated, and multiple technology abilities can be OR'd to create a single entry. If a PHY
cannot support a ability in an entry, that entry is ignored.
If no PHY provides a valid link, and if MII_PHY_DEF_SET is set in the phyFlags field of the
PHY_INFO structure, the first PHY that supports the default abilities defined in the
phyDefMode of the phyInfo structure will be selected, regardless of the link status.
In addition, this routine adds an entry in a linked list of PHY devices for each active PHY it
found. If the flag MII_PHY_MONITOR is set, the link status for the relevant PHY is
continually monitored for a link down event. If such event is detected, and if the
phyLinkDownRtn in the PHY_INFO * structure is a valid function pointer, then the routine it
points at is executed in the context of the netTask (). The parameter MII_MONITOR_DELAY
may be used to define the period in seconds with which the link status is checked. Its
default value is 5.
miiPhyOptFuncMultiSet( )
NAME miiPhyOptFuncMultiSet( ) – set pointers to MII optional registers handlers
DESCRIPTION This routine sets the function pointers in pPhyInfo-optRegsFunc> to the MII optional,
PHY-specific registers handler. The handler will be executed before the PHY's technology
abilities are negotiated. If a system employees more than on type of network device
requiring a PHY-specific registers handler use this routine instead of miiPhyOptFuncSet( )
to ensure device specific handlers and to avoid overwritting one's with the other's.
PROTECTION DOMAINS
(VxAE) This function can only be called from within the kernel protection domain. The
argument optRegsFunc MUST be a pointer to function in the kernel protection domain.
408
2 Routines
miiPhyUnInit( )
RETURNS N/A.
miiPhyOptFuncSet( )
NAME miiPhyOptFuncSet( ) – set the pointer to the MII optional registers handler
DESCRIPTION This routine sets the function pointer in optRegsFunc to the MII optional, PHY-specific
registers handler. The handler will be executed before the PHY's technology abilities are
negotiated.
PROTECTION DOMAINS
(VxAE) This function can only be called from within the kernel protection domain. The
argument optRegsFunc MUST be a pointer to function in the kernel protection domain.
RETURNS N/A.
miiPhyUnInit( )
NAME miiPhyUnInit( ) – uninitialize a PHY
409
VxWorks Drivers API Reference, 6.6
miiRegsGet( )
DESCRIPTION This routine uninitializes the PHY specified in pPhyInfo. It brings it in low-power mode, and
electrically isolate it from the MII management interface to which it is attached. In addition,
it frees resources previously allocated.
miiRegsGet( )
NAME miiRegsGet( ) – get the contents of MII registers
DESCRIPTION This routine gets the contents of the first regNum MII registers, and, if buff is not NULL,
copies them to the space pointed to by buff.
miiShow( )
NAME miiShow( ) – show routine for MII library
410
2 Routines
mipsIntCtlrShow( )
mipsCavIntCtlrShow( )
NAME mipsCavIntCtlrShow( ) – show pDrvCtrl for mipsIntCtlr
DESCRIPTION Based on verboseLevel value, display interrupt controller connection and methods
information
RETURNS N/A
ERRNO
mipsIntCtlrShow( )
NAME mipsIntCtlrShow( ) – show pDrvCtrl for mipsIntCtlr
DESCRIPTION Based on verboseLevel value, display interrupt controller connection and methods
information
RETURNS N/A
411
VxWorks Drivers API Reference, 6.6
motFccDrvShow( )
ERRNO
motFccDrvShow( )
NAME motFccDrvShow( ) – debug function to show FCC parameter ram addresses, initial BD and
cluster settings
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
RETURNS N/A
motFccDumpRxRing( )
NAME motFccDumpRxRing( ) – Show the Receive Ring details
RETURNS N/A
412
2 Routines
motFccEndLoad( )
motFccDumpTxRing( )
2
NAME motFccDumpTxRing( ) – Show the Transmit Ring details
RETURNS N/A
motFccEndLoad( )
NAME motFccEndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes both driver and device to an operational state using device specific
parameters specified by initString.
The parameter string, initString, is an ordered list of parameters each separated by a colon.
The format of initString is:
"unitimmrVal:fccNum:bdBase:bdSize:bufBase:bufSize:fifoTxBase:
fifoRxBase:tbdNum:rbdNum:phyAddr:phyDefMode:phyAnOrderTbl: userFlags:function
table(:maxRxFrames)"
The FCC shares a region of memory with the driver. The caller of this routine can specify
the address of this memory region, or can specify that the driver must obtain this memory
region from the system resources.
A default number of transmit/receive buffer descriptors of 32 can be selected by passing
zero in the parameters tbdNum and rbdNum. In other cases, the number of buffers selected
should be greater than two.
413
VxWorks Drivers API Reference, 6.6
motFccEramShow( )
The bufBase parameter is used to inform the driver about the shared memory region. If this
parameter is set to the constant "NONE," then this routine attempts to allocate the shared
memory from the system. Any other value for this parameter is interpreted by this routine
as the address of the shared memory region to be used. The bufSize parameter is used to
check that this region is large enough with respect to the provided values of both
transmit/receive buffer descriptors.
If the caller provides the shared memory region, then the driver assumes that this region
does not require cache coherency operations, nor does it require conversions between
virtual and physical addresses.
If the caller indicates that this routine must allocate the shared memory region, then this
routine uses cacheDmaMalloc( ) to obtain some cache-safe memory. The attributes of this
memory is checked, and if the memory is not write coherent, this routine aborts and returns
NULL.
motFccEramShow( )
NAME motFccEramShow( ) – Debug Function to show FCC CP ethernet parameter ram.
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
RETURNS N/A
414
2 Routines
motFccMiiShow( )
motFccIramShow( )
2
NAME motFccIramShow( ) – Debug Function to show FCC CP internal ram parameters.
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
RETURNS N/A
motFccMibShow( )
NAME motFccMibShow( ) – Debug Function to show MIB statistics.
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
RETURNS N/A
motFccMiiShow( )
NAME motFccMiiShow( ) – debug function to show the Mii settings in the Phy Info structure
415
VxWorks Drivers API Reference, 6.6
motFccPramShow( )
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
RETURNS N/A
motFccPramShow( )
NAME motFccPramShow( ) – Debug Function to show FCC CP parameter ram.
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
RETURNS N/A
motFccShow( )
NAME motFccShow( ) – Debug Function to show driver specific control data.
416
2 Routines
motFecEndLoad( )
DESCRIPTION This function is only available when MOT_FCC_DBG is defined. It should be used for
debugging purposes only.
2
RETURNS N/A
motFecEndLoad( )
NAME motFecEndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes both driver and device to an operational state using device specific
parameters specified by initString.
The parameter string, initString, is an ordered list of parameters each separated by a colon.
The format of initString is:
"motCpmAddr:ivec:bufBase:bufSize:fifoTxBase:fifoRxBase
:tbdNum:rbdNum:phyAddr:isoPhyAddr:phyDefMode:userFlags :clockSpeed"
The FEC shares a region of memory with the driver. The caller of this routine can specify
the address of this memory region, or can specify that the driver must obtain this memory
region from the system resources.
A default number of transmit/receive buffer descriptors of 32 can be selected by passing
zero in the parameters tbdNum and rbdNum. In other cases, the number of buffers selected
should be greater than two.
The bufBase parameter is used to inform the driver about the shared memory region. If this
parameter is set to the constant "NONE," then this routine will attempt to allocate the shared
memory from the system. Any other value for this parameter is interpreted by this routine
as the address of the shared memory region to be used. The bufSize parameter is used to
check that this region is large enough with respect to the provided values of both
transmit/receive buffer descriptors.
If the caller provides the shared memory region, then the driver assumes that this region
does not require cache coherency operations, nor does it require conversions between
virtual and physical addresses.
417
VxWorks Drivers API Reference, 6.6
ncr810CtrlCreate( )
If the caller indicates that this routine must allocate the shared memory region, then this
routine will use cacheDmaMalloc( ) to obtain some cache-safe memory. The attributes of
this memory will be checked, and if the memory is not write coherent, this routine will abort
and return NULL.
SEE ALSO motFecEnd, ifLib, MPC860T Fast Ethernet Controller (Supplement to MPC860 User's Manual)
ncr810CtrlCreate( )
NAME ncr810CtrlCreate( ) – create a control structure for the NCR 53C8xx SIOP
DESCRIPTION This routine creates an SIOP data structure and must be called before using an SIOP chip.
It must be called exactly once for a specified SIOP controller. Since it allocates memory for
a structure needed by all routines in ncr810Lib, it must be called before any other routines
in the library. After calling this routine, ncr810CtrlInit( ) must be called at least once before
any SCSI transactions are initiated using the SIOP.
A detailed description of the input parameters follows:
baseAdrs
the address at which the CPU accesses the lowest (SCNTL0/SIEN) register of the SIOP.
clkPeriod
the period of the SIOP SCSI clock input, in nanoseconds, multiplied by 100. This is used
to determine the clock period for the SCSI core of the chip and affects the timing of both
asynchronous and synchronous transfers. Several commonly-used values are defined
in ncr810.h as follows:
NCR810_1667MHZ 6000 /* 16.67Mhz chip */
NCR810_20MHZ 5000 /* 20Mhz chip */
NCR810_25MHZ 4000 /* 25Mhz chip */
NCR810_3750MHZ 2667 /* 37.50Mhz chip */
NCR810_40MHZ 2500 /* 40Mhz chip */
NCR810_50MHZ 2000 /* 50Mhz chip */
NCR810_66MHZ 1515 /* 66Mhz chip */
418
2 Routines
ncr810CtrlInit( )
ncr810CtrlInit( )
NAME ncr810CtrlInit( ) – initialize a control structure for the NCR 53C8xx SIOP
DESCRIPTION This routine initializes an SIOP structure, after the structure is created with
ncr810CtrlCreate( ). This structure must be initialized before the SIOP can be used. It may
be called more than once if needed; however, it must only be called while there is no activity
on the SCSI interface.
A detailed description of the input parameters follows:
pSiop
a pointer to the NCR_810_SCSI_CTRL structure created with ncr810CtrlCreate( ).
scsiCtrlBusId
the SCSI bus ID of the SIOP. Its value is somewhat arbitrary: seven (7), or highest
priority, is conventional. The value must be in the range 0 - 7.
419
VxWorks Drivers API Reference, 6.6
ncr810SetHwRegister( )
ncr810SetHwRegister( )
NAME ncr810SetHwRegister( ) – set hardware-dependent registers for the NCR 53C8xx SIOP
DESCRIPTION This routine sets up the registers used in the hardware implementation of the chip.
Typically, this routine is called by the sysScsiInit( ) routine from the BSP.
The input parameters are as follows:
pSiop
a pointer to the NCR_810_SCSI_CTRL structure created with ncr810CtrlCreate( ).
pHwRegs
a pointer to a NCR810_HW_REGS structure that is filled with the logical values 0 or 1
for each bit of each register described below.
This routine includes only the bit registers that can be used to modify the behavior of
the chip. The default configuration used during ncr810CtlrCreate( ) and
ncr810CrtlInit( ) is {0,0,0,0,0,1,0,0,0,0,0}.
typedef struct
{
int stest1Bit7; /* Disable external SCSI clock */
int stest2Bit7; /* SCSI control enable */
int stest2Bit5; /* Enable differential SCSI bus */
int stest2Bit2; /* Always WIDE SCSI */
int stest2Bit1; /* Extend SREQ/SACK filtering */
int stest3Bit7; /* TolerANT enable */
int dmodeBit7; /* Burst Length transfer bit 1 */
int dmodeBit6; /* Burst Length transfer bit 0 */
int dmodeBit5; /* Source I/O memory enable */
int dmodeBit4; /* Destination I/O memory enable*/
int scntl1Bit7; /* Slow cable mode */
} NCR810_HW_REGS;
For a more detailed explanation of the register bits, see the appropriate NCR 53C8xx
data manuals.
NOTE Because this routine writes to the NCR 53C8xx chip registers, it cannot be used when there
is any SCSI bus activity.
420
2 Routines
ncr810Show( )
ncr810Show( )
NAME ncr810Show( ) – display values of all readable NCR 53C8xx SIOP registers
DESCRIPTION This routine displays the state of the SIOP registers in a user-friendly way. It is useful
primarily for debugging. The input parameter is the pointer to the SIOP information
structure returned by the ncr810CtrlCreate( ) call.
NOTE The only readable register during a script execution is the Istat register. If you use this
routine during the execution of a SCSI command, the result could be unpredictable.
421
VxWorks Drivers API Reference, 6.6
ne2000EndLoad( )
ne2000EndLoad( )
NAME ne2000EndLoad( ) – initialize the driver and device
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:
"unit:register addr:int vector:int level:shmem addr:shmem size:shmem width"
noDev( )
NAME noDev( ) – optional driver functionality not present
DESCRIPTION This routine indicates that there is no optional device driver functionality present.
ERRNO
ns16550DevInit( )
NAME ns16550DevInit( ) – intialize an NS16550 channel
422
2 Routines
ns16550IntEx( )
DESCRIPTION This routine initializes some SIO_CHAN function pointers and then resets the chip in a
quiescent state. Before this routine is called, the BSP must already have initialized all the
device addresses, etc. in the NS16550_CHAN structure.
RETURNS N/A
ns16550Int( )
NAME ns16550Int( ) – interrupt level processing
DESCRIPTION This routine handles four sources of interrupts from the UART. They are prioritized in the
following order by the Interrupt Identification Register: Receiver Line Status, Received Data
Ready, Transmit Holding Register Empty and Modem Status.
When a modem status interrupt occurs, the transmit interrupt is enabled if the CTS signal
is TRUE.
RETURNS N/A
ns16550IntEx( )
NAME ns16550IntEx( ) – miscellaneous interrupt processing
423
VxWorks Drivers API Reference, 6.6
ns16550IntRd( )
DESCRIPTION This routine handles miscellaneous interrupts on the UART. Not implemented yet.
RETURNS N/A
ns16550IntRd( )
NAME ns16550IntRd( ) – handle a receiver interrupt
RETURNS N/A
ns16550IntWr( )
NAME ns16550IntWr( ) – handle a transmitter interrupt
DESCRIPTION This routine handles write interrupts from the UART. It reads a character and puts it in the
transmit holding register of the device for transfer.
424
2 Routines
ns83902EndLoad( )
If there are no more characters to transmit, transmission is disabled by clearing the transmit
interrupt enable bit in the IER(int enable register).
2
RETURNS N/A
ns16550SioRegister( )
NAME ns16550SioRegister( ) – register ns16550vxb driver
DESCRIPTION This routine registers the ns16550vxb driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
ns83902EndLoad( )
NAME ns83902EndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes the driver and the device to the operational state. All of the
device-specific parameters are passed in initString. 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,
"ln") into the initString and returns 0.
425
VxWorks Drivers API Reference, 6.6
ns83902RegShow( )
If the string is allocated and not empty, the routine attempts to load the driver using the
values specified in the string.
RETURNS An END object pointer, or NULL on error, or 0 and the name of the device if the initString
was NULL.
ns83902RegShow( )
NAME ns83902RegShow( ) – prints the current value of the NIC registers
DESCRIPTION This routine reads and displays the register values of the NIC registers
RETURNS N/A.
nullDrv( )
NAME nullDrv( ) – optional driver functionality not present
DESCRIPTION This routine indicates that there is no optional device driver functionality present.
426
2 Routines
octeonVxbDevInit( )
ERRNO
octeonSioRegister( )
NAME octeonSioRegister( ) – register octeonVxb driver
DESCRIPTION This routine registers the octeonVxb driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
octeonVxbDevInit( )
NAME octeonVxbDevInit( ) – initialize an OCTEON channel
DESCRIPTION This routine initializes some SIO_CHAN function pointers and then resets the chip in a
quiescent state. Before this routine is called, the BSP must already have initialized all the
device addresses, etc. in the OCTEONVXB_CHAN structure.
RETURNS N/A
ERRNO
427
VxWorks Drivers API Reference, 6.6
octeonVxbDevProbe( )
octeonVxbDevProbe( )
NAME octeonVxbDevProbe( ) – probe for device presence at specific address
DESCRIPTION Check for octeonVxb (or compatible) device at the specified base address. We assume one
is present at that address, but we need to verify.
Probe the device by the following:
- set the device to loopback mode - mask interrupts - attempt to generate an interrupt - check
interrupt status
If the interrupt status register shows that an interrupt did occur, then we presume it's our
device.
NOTE This routine is called early during system initialization, and *MUST* *NOT* make calls to
OS facilities such as memory allocation and I/O.
RETURNS TRUE if probe passes and assumed a valid octeonVxb (or compatible) device. FALSE
otherwise.
octeonVxbInt( )
NAME octeonVxbInt( ) – interrupt level processing
DESCRIPTION This routine handles four sources of interrupts from the UART. They are prioritized in the
following order by the Interrupt Identification Register: Receiver Line Status, Received Data
Ready, Transmit Holding Register Empty and Modem Status.
428
2 Routines
octeonVxbIntRd( )
When a modem status interrupt occurs, the transmit interrupt is enabled if the CTS signal
is TRUE.
2
RETURNS N/A
ERRNO
octeonVxbIntEx( )
NAME octeonVxbIntEx( ) – miscellaneous interrupt processing
DESCRIPTION This routine handles miscellaneous interrupts on the UART. Not implemented yet.
RETURNS N/A
ERRNO
octeonVxbIntRd( )
NAME octeonVxbIntRd( ) – handle a receiver interrupt
RETURNS N/A
429
VxWorks Drivers API Reference, 6.6
octeonVxbIntWr( )
ERRNO
octeonVxbIntWr( )
NAME octeonVxbIntWr( ) – handle a transmitter interrupt
RETURNS N/A
ERRNO
openPicTimerDrvRegister( )
NAME openPicTimerDrvRegister( ) – register openPic timer driver
DESCRIPTION This routine registers the openPic timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO
430
2 Routines
pccardAtaEnabler( )
optimizeAccessFunction( )
2
NAME optimizeAccessFunction( ) – optimize a function based on flags
DESCRIPTION This routine is used to determine an optimized function based on the flags for the operation
and update the access function pointer with the pointer to the optimized function
RETURNS N/A
ERRNO
pccardAtaEnabler( )
NAME pccardAtaEnabler( ) – enable the PCMCIA-ATA device
RETURNS OK, ERROR_FIND if there is no ATA card, or ERROR if another error occurs.
431
VxWorks Drivers API Reference, 6.6
pccardEltEnabler( )
pccardEltEnabler( )
NAME pccardEltEnabler( ) – enable the PCMCIA Etherlink III card
DESCRIPTION This routine enables the PCMCIA Etherlink III (ELT) card.
RETURNS OK, ERROR_FIND if there is no ELT card, or ERROR if another error occurs.
pccardMkfs( )
NAME pccardMkfs( ) – initialize a device and mount a DOS file system
DESCRIPTION This routine initializes a device and mounts a DOS file system.
RETURNS OK or ERROR.
432
2 Routines
pccardSramEnabler( )
pccardMount( )
2
NAME pccardMount( ) – mount a DOS file system
RETURNS OK or ERROR.
pccardSramEnabler( )
NAME pccardSramEnabler( ) – enable the PCMCIA-SRAM driver
RETURNS OK, ERROR_FIND if there is no SRAM card, or ERROR if another error occurs.
433
VxWorks Drivers API Reference, 6.6
pccardTffsEnabler( )
pccardTffsEnabler( )
NAME pccardTffsEnabler( ) – enable the PCMCIA-TFFS driver
RETURNS OK, ERROR_FIND if there is no TFFS(Flash) card, or ERROR if another error occurs.
pciAllHeaderShow( )
NAME pciAllHeaderShow( ) – show PCI header for all devices
DESCRIPTION This routine displays the PCI header information of all PCI devices in the system.
RETURNS N/A
ERRNO
pciAutoAddrAlign( )
NAME pciAutoAddrAlign( ) – align a PCI address and check boundary conditions
434
2 Routines
pciAutoBusNumberSet( )
(
UINT32 base, /* base of available memory */
UINT32 limit, /* last addr of available memory */
UINT32 reqSize, /* required size */ 2
UINT32 *pAlignedBase /* output: aligned address put here */
)
ERRNO
pciAutoBusNumberSet( )
NAME pciAutoBusNumberSet( ) – set the primary, secondary, and subordinate bus number
DESCRIPTION This routine sets the primary, secondary, and subordinate bus numbers for a device that
implements the Type 1 PCI Configuration Space Header.
This routine has external visibility to enable it to be used by BSP Developers for initialization
of PCI Host Bridges that may implement registers similar to those found in the Type 1
Header.
ERRNO
435
VxWorks Drivers API Reference, 6.6
pciAutoCardBusConfig( )
pciAutoCardBusConfig( )
NAME pciAutoCardBusConfig( ) – set mem and I/O registers for a single PCI-Cardbus bridge
DESCRIPTION This routine sets up memory and I/O base/limit registers for an individual PCI-Cardbus
bridge.
Cardbus bridges have four windows - 2 memory windows and 2 IO windows. The 2
memory windows can be setup individually for either prefetchable or non-prefetchable
memory accesses.
Since PC Cards can be inserted at any time, and are not necessarily present when this code
is run, the code does not probe any further after encountering a Cardbus bridge. Instead, the
code allocates default window sizes for the Cardbus bridge. Three windows are used:
Warning: do not sort the include function list before this routine is called. This routine
requires each function in the list to be in the same order as the probe occurred.
RETURNS N/A
ERRNO
pciAutoCfg( )
NAME pciAutoCfg( ) – Automatically configure all nonexcluded PCI headers
436
2 Routines
pciAutoCfgCtl( )
CALLING SEQUENCE
pCookie = pciAutoConfigLibInit(NULL);
pciAutoCfgCtl(pCookie, COMMAND, VALUE);
... 2
pciAutoCfgCtl(pCookie, COMMAND, VALUE);
pciAutoCfg(pCookie);
For ease in converting from the old interface to the new one, a pciAutoCfgCtl( ) command
PCI_PSYSTEM_STRUCT_COPY has been implemented. This can be used just like any other
pciAutoCfgCtl( ) command, and it initializes all the values in pSystem. If used, it should be
the first call to pciAutoCfgCtl( ).
For a description of the COMMANDs and VALUEs to pciAutoCfgCtl( ), see the
pciAutoCfgCtl( ) documentation.
For all nonexcluded PCI functions on all PCI bridges, this routine automatically configures
the PCI configuration headers for PCI devices and subbridges. The fields that are
programmed are:
1. Status register.
2. Command Register.
3. Latency timer.
4. Cache Line size.
5. Memory and/or I/O base address and limit registers.
6. Primary, secondary, subordinate bus number (for PCI-PCI bridges).
7. Expansion ROM disable.
8. Interrupt Line.
ALGORITHM Probe PCI config space and create a list of available PCI functions. Call device exclusion
function, if registered, to exclude/include device. Disable all devices before we initialize
any. Allocate and assign PCI space to each device. Calculate and set interrupt line value.
Initialize and enable each device.
RETURNS N/A
ERRNO
pciAutoCfgCtl( )
NAME pciAutoCfgCtl( ) – set or get pciAutoConfigLib options
437
VxWorks Drivers API Reference, 6.6
pciAutoCfgCtl( )
DESCRIPTION pciAutoCfgCtl( ) can be considered analogous to ioctl( ) calls: the call takes arguments of
(1) a pCookie, returned by pciAutoConfigLibInit( ). (2) A command, macros for which are
defined in pciAutoConfigLib.h. And, (3) an argument, the type of which depends on the
specific command, but will always fit in a pointer variable. Currently, only globally
effective commands are implemented.
The commands available are:
PCI_FBB_ENABLE - BOOL * pArg
PCI_FBB_DISABLE - void
PCI_FBB_UPDATE - BOOL * pArg
PCI_FBB_STATUS_GET - BOOL * pArg
Enable and disable the functions which check Fast Back To Back functionality.
PCI_FBB_UPDATE is for use with dynamic/HA applications. It first disables FBB on all
functions, then enables FBB on all functions, if appropriate. In HA applications, it
should be called any time a card is added or removed. The BOOL pointed to by pArg
for PCI_FBB_ENABLE and PCI_FBB_UPDATE is set to TRUE if all cards allow FBB
functionality and FALSE if either any card does not allow FBB functionality or if FBB is
disabled. The BOOL pointed to by pArg for PCI_FBB_STATUS_GET is set to TRUE if
PCI_FBB_ENABLE has been called and FBB is enabled, even if FBB is not activated on
any card. It is set to FALSE otherwise.
NOTE: In the current implementation, FBB is enabled or disabled on the entire bus. If
any device anywhere on the bus cannot support FBB, then it is not enabled, even if
specific sub-busses could support it.
PCI_MAX_LATENCY_FUNC_SET - FUNCPTR * pArg
This routine is called for each function present on the bus when discovery takes place.
The routine must accept four arguments, specifying bus, device, function, and a
user-supplied argument of type void *. See PCI_MAX_LATENCY_ARG_SET. The
routine should return a UINT8 value, which will be put into the MAX_LAT field of the
header structure. The user supplied routine must return a valid value each time it is
called. There is no mechanism for any ERROR condition, but a default value can be
returned in such a case. Default = NULL.
PCI_MAX_LATENCY_ARG_SET - void * pArg
When the routine specified in PCI_MAX_LATENCY_FUNC_SET is called, this will be
passed to it as the fourth argument.
438
2 Routines
pciAutoCfgCtl( )
sysLedOn(4);
charsPrinted = sprintf (sysExcMsg, fmt, a1, a2, a3, a4, a5, a6);
sysExcMsg += charsPrinted;
return (charsPrinted);
}
PCI_MAX_BUS_GET - int * pArg
During autoconfiguration, the library maintains a counter with the highest numbered
bus. This can be retrieved by
pciAutoCfgCtl(pCookie, PCI_MAX_BUS_GET, &maxBus)
PCI_CACHE_SIZE_SET - int pArg
Sets the pci cache line size to the specified value. See CONFIGURATION SPACE
PARAMETERS in the pciAutoConfigLib documentation for more details.
PCI_CACHE_SIZE_GET - int * pArg
Retrieves the value of the pci cache line size.
PCI_AUTO_INT_ROUTE_SET - BOOL pArg
Enables or disables automatic interrupt routing across bridges during the autoconfig
process. See "INTERRUPT ROUTING ACROSS PCI-TO-PCI BRIDGES" in the
pciAutoConfigLib documentation for more details.
PCI_AUTO_INT_ROUTE_GET - BOOL * pArg
Retrieves the status of automatic interrupt routing.
439
VxWorks Drivers API Reference, 6.6
pciAutoCfgCtl( )
440
2 Routines
pciAutoCfgCtl( )
pciAutoCfgCtl(pSystem, PCI_INCLUDE_FUNC_SET,sysPciAutoconfigInclude);
This optional user-supplied routine takes as input both the bus-device-function tuple,
and a 32-bit quantity containing both the PCI vendorID and deviceID of the function. 2
The function prototype for this function is shown below:
STATUS sysPciAutoconfigInclude
(
PCI_SYSTEM *pSys,
PCI_LOC *pLoc,
UINT devVend
);
This optional user-specified routine is called by PCI AutoConfig for each and every
function encountered in the scan phase. The BSP developer may use any combination
of the input data to ascertain whether a device is to be excluded from the autoconfig
process. The exclusion routine then returns ERROR if a device is to be excluded, and OK
if a device is to be included in the autoconfiguration process.
Note that PCI-to-PCI Bridges may not be excluded, regardless of the value returned by
the BSP device inclusion routine. The return value is ignored for PCI-to-PCI bridges.
The Bridge device will be always be configured with proper primary, secondary, and
subordinate bus numbers in the device scanning phase and proper I/O and Memory
aperture settings in the configuration phase of autoconfig regardless of the value
returned by the BSP device inclusion routine.
PCI_INT_ASSIGN_FUNC_SET - FUNCPTR * pArg
The interrupt assignment routine is specified by assigning a function pointer with the
PCI_INCLUDE_FUNC_SET pciAutoCfgCtl( ) command:
pciAutoCfgCtl(pCookie, PCI_INT_ASSIGN_FUNC_SET, sysPciAutoconfigIntrAssign);
This optional user-specified routine takes as input both the bus-device-function tuple,
and an 8-bit quantity containing the contents of the interrupt Pin register from the PCI
configuration header of the device under consideration. The interrupt pin register
specifies which of the four PCI Interrupt request lines available are connected. The
function prototype for this function is shown below:
UCHAR sysPciAutoconfigIntrAssign
(
PCI_SYSTEM *pSys,
PCI_LOC *pLoc,
UCHAR pin
);
This routine may use any combination of these data to ascertain the interrupt level.
This value is returned from the function, and is programmed into the interrupt line
register of the function's PCI configuration header. In this manner, device drivers may
subsequently read this register in order to calculate the appropriate interrupt vector
which to attach an interrupt service routine.
441
VxWorks Drivers API Reference, 6.6
pciAutoCfgCtl( )
442
2 Routines
pciAutoCfgCtl( )
list have been found during PCI bus enumeration or (2) the timeout has expired
without finding all of the specified number and type of devices. In either case, it is
assumed that all of the PCI devices which are going to appear on the busses have 2
appeared and we can proceed with PCI bus configuration.
PCI_TEMP_SPACE_SET - char * pArg
This command is not currently implemented. It allows the user to set aside memory for
use during pciAutoConfigLib execution, e.g. memory set aside using
USER_RESERVED_MEM. After PCI configuration has been completed, the memory can
be added to the system memory pool using memAddToPool( ).
PCI_MINIMIZE_RESOURCES
This command is not currently implemented. It specifies that pciAutoConfigLib
minimize requirements for memory and I/O space.
PCI_PSYSTEM_STRUCT_COPY - PCI_SYSTEM * pArg
This command has been added for ease of converting from the old interface to the new
one. This will set each value as specified in the pSystem structure. If the PCI_SYSTEM
structure has already been filled, the pciAutoConfig(pSystem) call can be changed to:
void *pCookie;
pCookie = pciAutoConfigLibInit(NULL);
pciAutoCfgCtl(pCookie, PCI_PSYSTEM_STRUCT_COPY, (void *)pSystem);
pciAutoCfgFunc(pCookie);
The fields of the PCI_SYSTEM structure are defined below. For more information about
each one, see the paragraphs above and the documentation for pciAutoConfigLib.
pciMem32
Specifies the 32-bit prefetchable memory pool base address.
pciMem32Size
Specifies the 32-bit prefetchable memory pool size.
pciMemIo32
Specifies the 32-bit non-prefetchable memory pool base address.
pciMemIo32Size
Specifies the 32-bit non-prefetchable memory pool size
pciIo32
Specifies the 32-bit I/O pool base address.
pciIo32Size
Specifies the 32-bit I/O pool size.
pciIo16
Specifies the 16-bit I/O pool base address.
pciIo16Size
Specifies the 16-bit I/O pool size.
443
VxWorks Drivers API Reference, 6.6
pciAutoCfgCtl( )
includeRtn
Specifies the device inclusion routine.
intAssignRtn
Specifies the interrupt assignment routine.
autoIntRouting
Can be set to TRUE to configure pciAutoConfig( ) only to call the BSP interrupt
routing routine for devices on bus number 0. Setting autoIntRoutine to FALSE will
configure pciAutoConfig( ) to call the BSP interrupt routing routine for every
device regardless of the bus on which the device resides.
bridgePreInit
Specifies the bridge initialization routine to call before initializing devices on the
bus that the bridge implements.
bridgePostInit
Specifies the bridge initialization routine to call after initializing devices on the bus
that the bridge implements.
ERRNO EINVAL
if pCookie is not NULL or cmd is not recognized
pciAutoCfgCtl( )
NAME pciAutoCfgCtl( ) – set or get autoConfigLib options
444
2 Routines
pciAutoConfig( )
pciAutoConfig( )
2
NAME pciAutoConfig( ) – automatically configure all nonexcluded PCI headers (obsolete)
DESCRIPTION This routine is obsolete. It is included for backward compatibility only. It is recommended
that you use the pciAutoCfg( ) interface instead of this one.
Top level function in the PCI configuration process.
For all nonexcluded PCI functions on all PCI bridges, this routine will automatically
configure the PCI configuration headers for PCI devices and subbridges. The fields that are
programmed are:
1. Status register.
2. Command Register.
3. Latency timer.
4. Cache Line size.
5. Memory and/or I/O base address and limit registers.
6. Primary, secondary, subordinate bus number (for PCI-PCI bridges).
7. Expansion ROM disable.
8. Interrupt Line.
ALGORITHM Probe PCI config space and create a list of available PCI functions. Call device exclusion
function, if registered, to exclude/include device. Disable all devices before we initialize
any. Allocate and assign PCI space to each device. Calculate and set interrupt line value.
Initialize and enable each device.
RETURNS N/A
ERRNO
445
VxWorks Drivers API Reference, 6.6
pciAutoConfigLibInit( )
pciAutoConfigLibInit( )
NAME pciAutoConfigLibInit( ) – initialize PCI autoconfig library
ERRNO
pciAutoDevReset( )
NAME pciAutoDevReset( ) – quiesce a PCI device and reset all writeable status bits
DESCRIPTION This routine turns off a PCI device by disabling the Memory decoders, I/O decoders, and
Bus Master capability. The routine also resets all writeable status bits in the status word that
follows the command word sequentially in PCI config space by performing a longword
access.
ERRNO
446
2 Routines
pciAutoFuncEnable( )
pciAutoFuncDisable( )
2
NAME pciAutoFuncDisable( ) – disable a specific PCI function
DESCRIPTION This routine clears the I/O, mem, master, & ROM space enable bits for a single PCI function.
The PCI spec says that devices should normally clear these by default after reset but in
actual practice, some PCI devices do not fully comply. This routine ensures that the devices
have all been disabled before configuration is started.
RETURNS N/A
ERRNO
pciAutoFuncEnable( )
NAME pciAutoFuncEnable( ) – perform final configuration and enable a function
DESCRIPTION Depending upon whether the device is included, this routine initializes a single PCI
function as follows:
Initialize the cache line size register Initialize the PCI-PCI bridge latency timers Enable the
master PCI bit for non-display devices Set the interrupt line value with the value from the
BSP.
RETURNS N/A
ERRNO
447
VxWorks Drivers API Reference, 6.6
pciAutoGetNextClass( )
pciAutoGetNextClass( )
NAME pciAutoGetNextClass( ) – find the next device of specific type from probe list
DESCRIPTION The function uses the probe list which was built during the probing process. Using
configuration accesses, it searches for the occurrence of the device subject to the class and
mask restrictions outlined below. Setting class to zero and mask to zero allows searching
the entire set of devices found regardless of class.
ERRNO
pciAutoRegConfig( )
NAME pciAutoRegConfig( ) – assign PCI space to a single PCI base address register
DESCRIPTION This routine allocates and assigns PCI space (either memory or I/O) to a single PCI base
address register.
RETURNS Returns (1) if BAR supports mapping anywhere in 64-bit address space. Returns (0)
otherwise.
448
2 Routines
pciConfigBdfPack( )
ERRNO
pciBusAnnounceDevices( )
NAME pciBusAnnounceDevices( ) – Notify the bus subsystem of all devices on PCI
DESCRIPTION none
RETURNS N/A
ERRNO
pciConfigBdfPack( )
NAME pciConfigBdfPack( ) – pack parameters for the Configuration Address Register
DESCRIPTION This routine packs three parameters into one integer for accessing the Configuration
Address Register
RETURNS packed integer encoded version of bus, device, and function numbers.
449
VxWorks Drivers API Reference, 6.6
pciConfigCmdWordShow( )
ERRNO
pciConfigCmdWordShow( )
NAME pciConfigCmdWordShow( ) – show the decoded value of the command word
DESCRIPTION This routine reads the value of the command word for the specified bus, device, function
and displays the information.
ERRNO
pciConfigCmdWordShow( )
NAME pciConfigCmdWordShow( ) – show the decoded value of the command word
DESCRIPTION This routine reads the value of the command word for the specified bus, device, function
and displays the information.
450
2 Routines
pciConfigExtCapFind( )
ERRNO
pciConfigEnable( )
NAME pciConfigEnable( ) – Set the globalBusCtrlID for the other LEGACY pci
DESCRIPTION routines.
RETURNS N/A
ERRNO
pciConfigExtCapFind( )
NAME pciConfigExtCapFind( ) – find extended capability in ECP linked list
DESCRIPTION This routine searches for an extended capability in the linked list of capabilities in config
space. If found, the offset of the first byte of the capability of interest in config space is
returned via pOffset.
451
VxWorks Drivers API Reference, 6.6
pciConfigExtCapFind( )
ERRNO
pciConfigExtCapFind( )
NAME pciConfigExtCapFind( ) – find extended capability in ECP linked list
ERRNO
pciConfigForeachFunc( )
NAME pciConfigForeachFunc( ) – check condition on specified bus
DESCRIPTION pciConfigForeachFunc( ) discovers the PCI functions present on the bus and calls a
specified C-function for each one. If the function returns ERROR, further processing stops.
pciConfigForeachFunc( ) does not affect any HOST-PCI bridge on the system.
452
2 Routines
pciConfigFuncShow( )
pciConfigForeachFunc( )
NAME pciConfigForeachFunc( ) – check condition on specified bus
DESCRIPTION pciConfigForeachFunc( ) discovers the PCI functions present on the bus and calls a
specified C-function for each one. If the function returns ERROR, further processing stops.
pciConfigForeachFunc( ) does not affect any HOST-PCI bridge on the system.
pciConfigFuncShow( )
NAME pciConfigFuncShow( ) – show configuration details about a function
453
VxWorks Drivers API Reference, 6.6
pciConfigFuncShow( )
DESCRIPTION This routine reads various information from the specified bus, device, function, and
displays the information.
ERRNO
pciConfigFuncShow( )
NAME pciConfigFuncShow( ) – show configuration details about a function
DESCRIPTION This routine reads various information from the specified bus, device, function, and
displays the information.
ERRNO
pciConfigInByte( )
NAME pciConfigInByte( ) – read one byte from the PCI configuration space
454
2 Routines
pciConfigInLong( )
DESCRIPTION This routine reads one byte from the PCI configuration space
ERRNO
pciConfigInByte( )
NAME pciConfigInByte( ) – read one byte from the PCI configuration space
DESCRIPTION This routine reads one byte from the PCI configuration space
ERRNO
pciConfigInLong( )
NAME pciConfigInLong( ) – read one longword from the PCI configuration space
455
VxWorks Drivers API Reference, 6.6
pciConfigInLong( )
DESCRIPTION This routine reads one longword from the PCI configuration space
ERRNO
pciConfigInLong( )
NAME pciConfigInLong( ) – read one longword from the PCI configuration space
DESCRIPTION This routine reads one longword from the PCI configuration space
ERRNO
pciConfigInWord( )
NAME pciConfigInWord( ) – read one word from the PCI configuration space
456
2 Routines
pciConfigLibInit( )
DESCRIPTION This routine reads one word from the PCI configuration space
ERRNO
pciConfigInWord( )
NAME pciConfigInWord( ) – read one word from the PCI configuration space
DESCRIPTION This routine reads one word from the PCI configuration space
ERRNO
pciConfigLibInit( )
NAME pciConfigLibInit( ) – initialize the configuration access-method and addresses
457
VxWorks Drivers API Reference, 6.6
pciConfigLibInit( )
Configuration mechanism one utilizes two 32-bit IO ports located at addresses 0x0cf8 and
0x0cfc. These two ports are:
Port 1
32-bit configuration address port, at 0x0cf8
Port 2
32-bit configuration data port, at 0x0cfc
Accessing a PCI function's configuration port is two step process.
Step 1
Write the bus number, physical device number, function number and register number
to the configuration address port.
Step 2
Perform an IO read from or an write to the configuration data port.
Configuration mechanism two uses following two single-byte IO ports.
Port 1
Configuration space enable, or CSE, register, at 0x0cf8
Port 2
Forward register, at 0x0cfa
To generate a PCI configuration transaction, the following actions are performed.
- Write the target bus number into the forward register.
- Write a one byte value to the CSE register at 0x0cf8. The bit pattern written to this
register has three effects: disables the generation of special cycles; enables the
generation of configuration transactions; specifies the target PCI functional device.
- Perform a one, two or four byte IO read or write transaction within the IO range 0xc000
through 0xcfff.
Configuration mechanism zero is for non-PC/PowerPC environments where an area of
address space produces PCI configuration transactions. No support for special cycles is
included.
ERRNO
458
2 Routines
pciConfigLibInit( )
pciConfigLibInit( )
2
NAME pciConfigLibInit( ) – initialize the configuration access-method and addresses
459
VxWorks Drivers API Reference, 6.6
pciConfigModifyByte( )
ERRNO
pciConfigModifyByte( )
NAME pciConfigModifyByte( ) – Perform a masked longword register update
DESCRIPTION This function writes a field into a PCI configuration header without altering any bits not
present in the field. It does this by first doing a PCI configuration read (into a temporary
location) of the PCI configuration header word which contains the field to be altered. It then
alters the bits in the temporary location to match the desired value of the field. It then writes
back the temporary location with a configuration write. All configuration accesses are long
and the field to alter is specified by the "1" bits in the bitMask parameter.
Do not use this routine to modify any register that contains 'write 1 to clear' type of status
bits in the same longword. This specifically applies to the command register. Modify byte
operations could potentially be implemented as longword operations with bit shifting and
masking. This could have the effect of clearing status bits in registers that aren't being
updated. Use pciConfigInLong and pciConfigOutLong, or pciModifyLong, to read and
update the entire longword.
ERRNO
460
2 Routines
pciConfigModifyWord( )
pciConfigModifyLong( )
2
NAME pciConfigModifyLong( ) – Perform a masked longword register update
DESCRIPTION This function writes a field into a PCI configuration header without altering any bits not
present in the field. It does this by first doing a PCI configuration read (into a temporary
location) of the PCI configuration header word which contains the field to be altered. It then
alters the bits in the temporary location to match the desired value of the field. It then writes
back the temporary location with a configuration write. All configuration accesses are long
and the field to alter is specified by the "1" bits in the bitMask parameter.
Be careful to using pciConfigModifyLong for updating the Command and status register.
The status bits must be written back as zeroes, else they will be cleared. Proper use involves
including the status bits in the mask value, but setting their value to zero in the data value.
The following example will set the PCI_CMD_IO_ENABLE bit without clearing any status
bits. The macro PCI_CMD_MASK includes all the status bits as part of the mask. The fact
that PCI_CMD_MASTER doesn't include these bits, causes them to be written back as zeroes,
therefore they aren't cleared.
pciConfigModifyLong (b,d,f,PCI_CFG_COMMAND,
(PCI_CMD_MASK | PCI_CMD_IO_ENABLE), PCI_CMD_IO_ENABLE);
Use of explicit longword read and write operations for dealing with any register containing
"write 1 to clear" bits is sound policy.
ERRNO
pciConfigModifyWord( )
NAME pciConfigModifyWord( ) – Perform a masked longword register update
461
VxWorks Drivers API Reference, 6.6
pciConfigOutByte( )
DESCRIPTION This function writes a field into a PCI configuration header without altering any bits not
present in the field. It does this by first doing a PCI configuration read (into a temporary
location) of the PCI configuration header word which contains the field to be altered. It then
alters the bits in the temporary location to match the desired value of the field. It then writes
back the temporary location with a configuration write. All configuration accesses are long
and the field to alter is specified by the "1" bits in the bitMask parameter.
Do not use this routine to modify any register that contains 'write 1 to clear' type of status
bits in the same longword. This specifically applies to the command register. Modify byte
operations could potentially be implemented as longword operations with bit shifting and
masking. This could have the effect of clearing status bits in registers that aren't being
updated. Use pciConfigInLong and pciConfigOutLong, or pciModifyLong, to read and
update the entire longword.
ERRNO
pciConfigOutByte( )
NAME pciConfigOutByte( ) – write one byte to the PCI configuration space
DESCRIPTION This routine writes one byte to the PCI configuration space.
462
2 Routines
pciConfigOutLong( )
ERRNO
pciConfigOutByte( )
NAME pciConfigOutByte( ) – write one byte to the PCI configuration space
DESCRIPTION This routine writes one byte to the PCI configuration space.
ERRNO
pciConfigOutLong( )
NAME pciConfigOutLong( ) – write one longword to the PCI configuration space
DESCRIPTION This routine writes one longword to the PCI configuration space.
463
VxWorks Drivers API Reference, 6.6
pciConfigOutLong( )
ERRNO
pciConfigOutLong( )
NAME pciConfigOutLong( ) – write one longword to the PCI configuration space
DESCRIPTION This routine writes one longword to the PCI configuration space.
ERRNO
pciConfigOutWord( )
NAME pciConfigOutWord( ) – write one 16-bit word to the PCI configuration space
DESCRIPTION This routine writes one 16-bit word to the PCI configuration space.
464
2 Routines
pciConfigReset( )
ERRNO
pciConfigOutWord( )
NAME pciConfigOutWord( ) – write one 16-bit word to the PCI configuration space
DESCRIPTION This routine writes one 16-bit word to the PCI configuration space.
ERRNO
pciConfigReset( )
NAME pciConfigReset( ) – disable cards for warm boot
DESCRIPTION pciConfigReset( ) goes through the list of PCI functions at the top-level bus and disables
them, preventing them from writing to memory while the system is trying to reboot.
465
VxWorks Drivers API Reference, 6.6
pciConfigStatusWordShow( )
pciConfigStatusWordShow( )
NAME pciConfigStatusWordShow( ) – show the decoded value of the status word
DESCRIPTION This routine reads the value of the status word for the specified bus, device, function and
displays the information.
ERRNO
pciConfigStatusWordShow( )
NAME pciConfigStatusWordShow( ) – show the decoded value of the status word
DESCRIPTION This routine reads the value of the status word for the specified bus, device, function and
displays the information.
466
2 Routines
pciConfigTopoShow( )
ERRNO
pciConfigTopoShow( )
NAME pciConfigTopoShow( ) – show PCI topology
DESCRIPTION This routine traverses the PCI bus and prints assorted information about every device
found. The information is intended to present the topology of the PCI bus. In includes: (1)
the device type, (2) the command and status words, (3) for PCI to PCI bridges the memory
and I/O space configuration, and (4) the values of all implemented BARs.
RETURNS N/A
ERRNO
pciConfigTopoShow( )
NAME pciConfigTopoShow( ) – show PCI topology
DESCRIPTION This routine traverses the PCI bus and prints assorted information about every device
found. The information is intended to present the topology of the PCI bus. In includes: (1)
the device type, (2) the command and status words, (3) for PCI to PCI bridges the memory
and I/O space configuration, and (4) the values of all implemented BARs.
RETURNS N/A
ERRNO
467
VxWorks Drivers API Reference, 6.6
pciConnect( )
pciConnect( )
NAME pciConnect( ) – connect PCI bus type to bus subsystem
ERRNO
pciDevConfig( )
NAME pciDevConfig( ) – configure a device on a PCI bus
DESCRIPTION This routine configures a device that is on a Peripheral Component Interconnect (PCI) bus
by writing to the configuration header of the selected device.
It first disables the device by clearing the command register in the configuration header. It
then sets the I/O and/or memory space base address registers, the latency timer value and
the cache line size. Finally, it re-enables the device by loading the command register with
the specified command.
NOTE This routine is designed for Type 0 PCI Configuration Headers ONLY. It is NOT usable for
configuring, for example, a PCI-to-PCI bridge.
RETURNS OK always.
468
2 Routines
pciDevMatch( )
ERRNO
pciDevConfig( )
NAME pciDevConfig( ) – configure a device on a PCI bus
RETURNS OK always.
ERRNO
pciDevMatch( )
NAME pciDevMatch( ) – check whether device and driver go together
DESCRIPTION This routine checks that the specified device and device driver are a matched pair.
469
VxWorks Drivers API Reference, 6.6
pciDevShow( )
ERRNO
pciDevShow( )
NAME pciDevShow( ) – show information about PCI device
DESCRIPTION none
ERRNO
pciDeviceAnnounce( )
NAME pciDeviceAnnounce( ) – notify the bus subsystem of a device on PCI
DESCRIPTION This routine tells the vxBus subsystem that a PCI device has been found on the PCI bus.
ERRNO
470
2 Routines
pciFindClass( )
pciDeviceShow( )
2
NAME pciDeviceShow( ) – print information about PCI devices
DESCRIPTION This routine prints information about the PCI devices on a given PCI bus segment (specified
by busNo).
ERRNO
pciDeviceShow( )
NAME pciDeviceShow( ) – print information about PCI devices
DESCRIPTION This routine prints information about the PCI devices on a given PCI bus segment (specified
by busNo).
ERRNO
pciFindClass( )
NAME pciFindClass( ) – find the nth occurrence of a device by PCI class code.
471
VxWorks Drivers API Reference, 6.6
pciFindClass( )
DESCRIPTION This routine finds the nth device with the given 24-bit PCI class code (class subclass prog_if).
The classcode arg of must be carefully constructed from class and sub-class macros.
Example : To find an ethernet class device, construct the classcode arg as follows:
((PCI_CLASS_NETWORK_CTLR << 16 | PCI_SUBCLASS_NET_ETHERNET << 8))
ERRNO
pciFindClass( )
NAME pciFindClass( ) – find the nth occurrence of a device by PCI class code.
DESCRIPTION This routine finds the nth device with the given 24-bit PCI class code (class subclass prog_if).
The classcode arg of must be carefully constructed from class and sub-class macros.
Example : To find an ethernet class device, construct the classcode arg as follows:
((PCI_CLASS_NETWORK_CTLR << 16 | PCI_SUBCLASS_NET_ETHERNET << 8))
ERRNO
472
2 Routines
pciFindDevice( )
pciFindClassShow( )
2
NAME pciFindClassShow( ) – find a device by 24-bit class code
DESCRIPTION This routine finds a device by its 24-bit PCI class code, then prints its information.
ERRNO
pciFindClassShow( )
NAME pciFindClassShow( ) – find a device by 24-bit class code
DESCRIPTION This routine finds a device by its 24-bit PCI class code, then prints its information.
ERRNO
pciFindDevice( )
NAME pciFindDevice( ) – find the nth device with the given device & vendor ID
473
VxWorks Drivers API Reference, 6.6
pciFindDevice( )
DESCRIPTION This routine finds the nth device with the given device & vendor ID.
ERRNO
pciFindDevice( )
NAME pciFindDevice( ) – find the nth device with the given device & vendor ID
DESCRIPTION This routine finds the nth device with the given device & vendor ID.
ERRNO
474
2 Routines
pciFindDeviceShow( )
pciFindDeviceShow( )
2
NAME pciFindDeviceShow( ) – find a PCI device and display the information
DESCRIPTION This routine finds a device by deviceId, then displays the information.
ERRNO
pciFindDeviceShow( )
NAME pciFindDeviceShow( ) – find a PCI device and display the information
DESCRIPTION This routine finds a device by deviceId, then displays the information.
ERRNO
475
VxWorks Drivers API Reference, 6.6
pciHcfRecordFind( )
pciHcfRecordFind( )
NAME pciHcfRecordFind( ) – find device's HCF pciSlot record
DESCRIPTION This routine finds HCF pciSlot record for the specified bus and device.
ERRNO
pciHeaderShow( )
NAME pciHeaderShow( ) – print a header of the specified PCI device
DESCRIPTION This routine prints a header of the PCI device specified by busNo, deviceNo, and funcNo.
ERRNO
pciHeaderShow( )
NAME pciHeaderShow( ) – print a header of the specified PCI device
476
2 Routines
pciInit2( )
DESCRIPTION This routine prints a header of the PCI device specified by busNo, deviceNo, and funcNo.
ERRNO
pciInit( )
NAME pciInit( ) – first-pass bus type initialization
ERRNO
pciInit2( )
NAME pciInit2( ) – second-pass bus type initialization
477
VxWorks Drivers API Reference, 6.6
pciInt( )
ERRNO
pciInt( )
NAME pciInt( ) – interrupt handler for shared PCI interrupt.
DESCRIPTION This routine executes multiple interrupt handlers for a PCI interrupt. Each interrupt handler
must check the device dependent interrupt status bit to determine the source of the
interrupt, since it simply execute all interrupt handlers in the link list.
This is not a user callable routine
RETURNS N/A
ERRNO
pciIntConnect( )
NAME pciIntConnect( ) – connect the interrupt handler to the PCI interrupt.
DESCRIPTION This routine connects an interrupt handler to a shared PCI interrupt vector. A link list is
created for each shared interrupt used in the system. It is created when the first interrupt
handler is attached to the vector. Subsequent calls to pciIntConnect just add their routines
to the linked list for that vector.
478
2 Routines
pciIntDisconnect( )
ERRNO 2
SEE ALSO pciIntLib
pciIntConnect( )
NAME pciIntConnect( ) – connect the interrupt handler to the PCI interrupt.
DESCRIPTION This routine connects an interrupt handler to a shared PCI interrupt vector. A link list is
created for each shared interrupt used in the system. It is created when the first interrupt
handler is attached to the vector. Subsequent calls to pciIntConnect just add their routines
to the linked list for that vector.
ERRNO
pciIntDisconnect( )
NAME pciIntDisconnect( ) – disconnect the interrupt handler (OBSOLETE)
DESCRIPTION This routine disconnects the interrupt handler from the PCI interrupt line.
479
VxWorks Drivers API Reference, 6.6
pciIntDisconnect( )
In a system where one driver and one ISR services multiple devices, this routine removes all
instances of the ISR because it completely ignores the parameter argument used to install
the handler.
NOTE Use of this routine is discouraged and will be obsoleted in the future. New code should use
the pciIntDisconnect2( ) routine instead.
ERRNO
pciIntDisconnect( )
NAME pciIntDisconnect( ) – disconnect the interrupt handler (OBSOLETE)
DESCRIPTION This routine disconnects the interrupt handler from the PCI interrupt line.
In a system where one driver and one ISR services multiple devices, this routine removes all
instances of the ISR because it completely ignores the parameter argument used to install
the handler.
NOTE Use of this routine is discouraged and will be obsoleted in the future. New code should use
the pciIntDisconnect2( ) routine instead.
ERRNO
480
2 Routines
pciIntDisconnect2( )
pciIntDisconnect2( )
2
NAME pciIntDisconnect2( ) – disconnect an interrupt handler from the PCI interrupt.
DESCRIPTION This routine disconnects a single instance of an interrupt handler from the PCI interrupt
line.
NOTE This routine should be used in preference to the original pciIntDisconnect( ) routine. This
routine is compatible with drivers that are managing multiple device instances, using the
same basic ISR, but with different parameters.
ERRNO
pciIntDisconnect2( )
NAME pciIntDisconnect2( ) – disconnect the interrupt handler
DESCRIPTION This routine disconnects the interrupt handler from the PCI interrupt line.
Use this routine in a system where one driver and one ISR services multiple devices.
ERRNO
481
VxWorks Drivers API Reference, 6.6
pciIntLibInit( )
pciIntLibInit( )
NAME pciIntLibInit( ) – initialize the pciIntLib module
DESCRIPTION This routine initializes the linked lists used to chain together the PCI interrupt service
routines.
ERRNO
pciRegister( )
NAME pciRegister( ) – register PCI bus type
DESCRIPTION This routine registers the PCI bus type with the vxBus subsystem.
ERRNO
pciSpecialCycle( )
NAME pciSpecialCycle( ) – generate a special cycle with a message
482
2 Routines
pcicInit( )
ERRNO
pciSpecialCycle( )
NAME pciSpecialCycle( ) – generate a special cycle with a message
ERRNO
pcicInit( )
NAME pcicInit( ) – initialize the PCIC chip
483
VxWorks Drivers API Reference, 6.6
pcicShow( )
pcicShow( )
NAME pcicShow( ) – show all configurations of the PCIC chip
RETURNS N/A
pcmciaInit( )
NAME pcmciaInit( ) – initialize the PCMCIA event-handling package
DESCRIPTION This routine installs the PCMCIA event-handling facilities and spawns pcmciad( ), which
performs special PCMCIA event-handling functions that need to be done at task level. It
also creates the message queue used to communicate with pcmciad( ).
RETURNS OK, or ERROR if a message queue cannot be created or pcmciad( ) cannot be spawned.
484
2 Routines
pcmciad( )
pcmciaShow( )
2
NAME pcmciaShow( ) – show all configurations of the PCMCIA chip
RETURNS N/A
pcmciaShowInit( )
NAME pcmciaShowInit( ) – initialize all show routines for PCMCIA drivers
DESCRIPTION This routine initializes all show routines related to PCMCIA drivers.
RETURNS N/A
pcmciad( )
NAME pcmciad( ) – handle task-level PCMCIA events
485
VxWorks Drivers API Reference, 6.6
pentiumPciAllHeaderShow( )
DESCRIPTION This routine is spawned as a task by pcmciaInit( ) to perform functions that cannot be
performed at interrupt or trap level. It has a priority of 0. Do not suspend, delete, or change
the priority of this task.
RETURNS N/A
pentiumPciAllHeaderShow( )
NAME pentiumPciAllHeaderShow( ) – show PCI header for specified device
DESCRIPTION This routine displays the PCI header for the specified device.
ERRNO
pentiumPciBusDevGet( )
NAME pentiumPciBusDevGet( ) – find bus controller
DESCRIPTION none
486
2 Routines
pentiumPciPhysMemHandle( )
RETURNS a pointer to the pDev structure for the Pentium PCI bus controller
pentiumPciMmuMapAdd( )
NAME pentiumPciMmuMapAdd( ) – memory map sysPhysMemDesc
ERRNO
pentiumPciPhysMemHandle( )
NAME pentiumPciPhysMemHandle( ) – configure PCI memory for a device
DESCRIPTION This routine maps memory for the specified PCI device.
487
VxWorks Drivers API Reference, 6.6
pentiumPciPhysMemShow( )
ERRNO
pentiumPciPhysMemShow( )
NAME pentiumPciPhysMemShow( ) – display sysPhysMemDesc entries
RETURNS N/A
ERRNO
pentiumPciRegAddrShow( )
NAME pentiumPciRegAddrShow( ) – debug routine to print register addresses
DESCRIPTION This routine prints the actual processor addresses used by the access methods to read and
write device registers.
ERRNO
488
2 Routines
plbConnect( )
pentiumPciRegister( )
2
NAME pentiumPciRegister( ) – register Pentium PCI host bridge device driver
DESCRIPTION This routine registers the Pentium PCI host bridge with vxbus subsystem.
RETURNS N/A
ERRNO
plbAccessInit( )
NAME plbAccessInit( ) – initialize the plb access module
DESCRIPTION This routine is used to initialize the access module of the PLB
RETURNS N/A
ERRNO
plbConnect( )
NAME plbConnect( ) – third-stage PLB bus initialization
DESCRIPTION This routine executes the third stage of the PLB bus initialization and connection.
489
VxWorks Drivers API Reference, 6.6
plbDevMatch( )
ERRNO
plbDevMatch( )
NAME plbDevMatch( ) – check whether device and driver go together
RETURNS TRUE if the device and driver match up, FALSE otherwise
ERRNO
plbInit1( )
NAME plbInit1( ) – first-stage PLB bus initialization
DESCRIPTION This routine executes the first stage of the PLB bus initialization.
ERRNO
490
2 Routines
plbIntrSet( )
plbInit2( )
2
NAME plbInit2( ) – second-stage PLB bus initialization
DESCRIPTION This routine executes the second stage of the PLB bus initialization.
ERRNO
plbIntrGet( )
NAME plbIntrGet( ) – Get interrupt controller for device
DESCRIPTION This routine retrieves the interrupt controller for a specific device interrupt output. The
values for interrupt controller and input pin on the interrupt controller are set in the
variables pointed to by the 3rd and 4th arguments.
plbIntrSet( )
NAME plbIntrSet( ) – set interrupt controller for device
491
VxWorks Drivers API Reference, 6.6
plbIntrShow( )
DESCRIPTION This routine modifies the interrupt information structure associated with the device, to
indicate which interrupt controller it is connected to.
plbIntrShow( )
NAME plbIntrShow( ) – Show interrupt controllers for device's interrupts
DESCRIPTION This routine shows the interrupt connectivity information for the specified device.
plbRegister( )
NAME plbRegister( ) – register PLB with bus subsystem
492
2 Routines
ppc403DummyCallback( )
DESCRIPTION This routine registers the PLB with the vxBus subsystem. 2
RETURNS N/A
ERRNO
ppc403DevInit( )
NAME ppc403DevInit( ) – initialize the serial port unit
DESCRIPTION The BSP must already have initialized all the device addresses in the PPC403_CHAN
structure. This routine initializes some SIO_CHAN function pointers and then resets the chip
in a quiescent state.
RETURNS N/A.
ppc403DummyCallback( )
NAME ppc403DummyCallback( ) – dummy callback routine
DESCRIPTION none
493
VxWorks Drivers API Reference, 6.6
ppc403IntEx( )
ppc403IntEx( )
NAME ppc403IntEx( ) – handle error interrupts
DESCRIPTION This routine handles miscellaneous interrupts on the seial communication controller.
RETURNS N/A
ppc403IntRd( )
NAME ppc403IntRd( ) – handle a receiver interrupt
DESCRIPTION This routine handles read interrupts from the serial commonication controller.
RETURNS N/A
494
2 Routines
ppc440gpPciHostBridgeInit( )
ppc403IntWr( )
2
NAME ppc403IntWr( ) – handle a transmitter interrupt
DESCRIPTION This routine handles write interrupts from the serial communication controller.
RETURNS N/A
ppc440gpPciHostBridgeInit( )
NAME ppc440gpPciHostBridgeInit( ) – Initialize the PCI-X Host Bridge
DESCRIPTION Initializes the PCI bridge so it can operate as both a PCI master and slave. Parameters set are:
- CPU->PCI (master/initiator/outbound) address translation
- PCI->CPU (slave/target/inbound) address translation
This routine allocates virtual memory from the BSP-supplied virtual memory pools named
pVmPref and pVmNoPref. The physical addresses for non-prefetchable and prefetchable
PCI regions are hard-coded in this file to the values 0x3.0000.0000, 0x3.1000.0000,
respectively. The pVmIO and pVmIOExtra pools are ignored, since addresses and
configuration for the I/O and "Extra" I/O regions (in POM2) are hardwired in the device.
In addition, the upper 32-bits of all 64-bit addresses are hard-coded to 0x00000000.
The inbound window is hard-coded to start at 0x00000000 and have size of 1GB. See the
macros in config.h for details.
32 bit PCI bus memory map:
size CPU (virt) PLB (real) PCI usage map by
0x40000000 0x00000000 0x0.00000000 0x00000000 440GP slave PIM0
0x10000000 pVmNoPref 0x3.00000000 pVmNoPref Mem no prefetch POM1
0x10000000 pVmPref 0x3.10000000 pVmPref Mem w/ prefetch POM0
495
VxWorks Drivers API Reference, 6.6
ppc440gpPciRegAddrShow( )
ppc440gpPciRegAddrShow( )
NAME ppc440gpPciRegAddrShow( ) – debug routine to print register addresses
DESCRIPTION This routine prints the actual processor addresses used by the access methods to read and
write device registers.
RETURNS N/A
ppc440gpPciRegister( )
NAME ppc440gpPciRegister( ) – register PowerPC 440GP host bridge
DESCRIPTION This routine registers the PPC440GP host bridge with the vxBus subsystem.
RETURNS N/A
496
2 Routines
ppc860Int( )
ppc860DevInit( )
NAME ppc860DevInit( ) – initialize the SMC
DESCRIPTION This routine is called to initialize the chip to a quiescent state. Note that the smcNum field
of PPC860SMC_CHAN must be either 1 or 2.
ppc860Int( )
NAME ppc860Int( ) – handle an SMC interrupt
497
VxWorks Drivers API Reference, 6.6
ppcDecTimerDrvRegister( )
ppcDecTimerDrvRegister( )
NAME ppcDecTimerDrvRegister( ) – register ppcDec timer driver
DESCRIPTION This routine registers the ppcDec timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO
qeAnd32( )
NAME qeAnd32( ) – Read then Write 32 bit register usign and mask
DESCRIPTION none
RETURNS NONE.
ERRNO
qeIvecToInum( )
NAME qeIvecToInum( ) – get the relevant interrupt number
498
2 Routines
quiccAnd32( )
(
VOIDFUNCPTR * vector /* interrupt vector to attach to */
)
2
DESCRIPTION This routine finds out the interrupt number associated with the vector in vector.
vector types are defined in h/drv/intrClt/vxbQeIntr.h.
qeOr32( )
NAME qeOr32( ) – Read then Write 32 bit register using or mask
DESCRIPTION none
RETURNS NONE.
ERRNO
quiccAnd32( )
NAME quiccAnd32( ) – Read then Write 32 bit register usign and mask
499
VxWorks Drivers API Reference, 6.6
quiccIntrInit( )
UINT32 andMask
)
DESCRIPTION none
RETURNS NONE.
ERRNO
quiccIntrInit( )
NAME quiccIntrInit( ) – initialize the interrupt manager for the PowerPC 83XX
DESCRIPTION This routine connects the default demultiplexer, quiccIntrDeMux( ), to the external
interrupt vector and associates all interrupt sources with the default interrupt handler. This
routine is called by sysHwInit( ) in sysLib.c.
NOTE All interrupt from the SIU unit are enabled, CICR is setup so that SCC1 has the highest
relative interrupt priority, through SCC4 with the lowest.
RETURNS OK always
ERRNO
quiccIvecToInum( )
NAME quiccIvecToInum( ) – get the relevant interrupt number
500
2 Routines
quiccTimerDrvRegister( )
DESCRIPTION This routine finds out the interrupt number associated with the vector in vector.
vector types are defined in h/drv/intrClt/quiccIntr.h.
2
RETURNS the interrupt number for the vector
ERRNO
quiccOr32( )
NAME quiccOr32( ) – Read then Write 32 bit register using or mask
DESCRIPTION none
RETURNS NONE.
ERRNO
quiccTimerDrvRegister( )
NAME quiccTimerDrvRegister( ) – register coldFire timer driver
DESCRIPTION This routine registers the quicc timer driver with the vxBus subsystem.
RETURNS N/A
501
VxWorks Drivers API Reference, 6.6
rapidIoRegister( )
ERRNO
rapidIoRegister( )
NAME rapidIoRegister( ) – register RapidIO bus type
DESCRIPTION none
rioConnect( )
NAME rioConnect( ) – connect RapidIO bus type to bus subsystem
DESCRIPTION none
RETURNS N/A
rioDevMatch( )
NAME rioDevMatch( ) – check whether device and driver go together
502
2 Routines
rioInit2( )
DESCRIPTION none
RETURNS TRUE if the device and driver match up, FALSE otherwise
rioInit1( )
NAME rioInit1( ) – first-pass bus type initialization
DESCRIPTION none
RETURNS N/A
rioInit2( )
NAME rioInit2( ) – second-pass bus type initialization
DESCRIPTION none
RETURNS N/A
503
VxWorks Drivers API Reference, 6.6
rm9000x2glDevInit( )
rm9000x2glDevInit( )
NAME rm9000x2glDevInit( ) – intialize an NS16550 channel
DESCRIPTION This routine initializes some SIO_CHAN function pointers and then resets the chip in a
quiescent state. Before this routine is called, the BSP must already have initialized all the
device addresses, etc. in the RM9000x2gl_CHAN structure.
RETURNS N/A
rm9000x2glInt( )
NAME rm9000x2glInt( ) – interrupt level processing
DESCRIPTION This routine handles four sources of interrupts from the UART. They are prioritized in the
following order by the Interrupt Identification Register: Receiver Line Status, Received Data
Ready, Transmit Holding Register Empty and Modem Status.
When a modem status interrupt occurs, the transmit interrupt is enabled if the CTS signal
is TRUE.
RETURNS N/A
504
2 Routines
rm9000x2glIntMod( )
rm9000x2glIntEx( )
NAME rm9000x2glIntEx( ) – miscellaneous interrupt processing
DESCRIPTION This routine handles miscellaneous interrupts on the UART. Not implemented yet.
RETURNS N/A
rm9000x2glIntMod( )
NAME rm9000x2glIntMod( ) – interrupt level processing
DESCRIPTION This routine handles four sources of interrupts from the UART. They are prioritized in the
following order by the Interrupt Identification Register: Receiver Line Status, Received Data
Ready, Transmit Holding Register Empty and Modem Status.
When a modem status interrupt occurs, the transmit interrupt is enabled if the CTS signal
is TRUE.
RETURNS N/A
505
VxWorks Drivers API Reference, 6.6
rm9000x2glIntRd( )
rm9000x2glIntRd( )
NAME rm9000x2glIntRd( ) – handle a receiver interrupt
RETURNS N/A
rm9000x2glIntWr( )
NAME rm9000x2glIntWr( ) – handle a transmitter interrupt
DESCRIPTION This routine handles write interrupts from the UART. It reads a character and puts it in the
transmit holding register of the device for transfer.
If there are no more characters to transmit, transmission is disabled by clearing the transmit
interrupt enable bit in the IER(int enable register).
RETURNS N/A
506
2 Routines
sh77xxPcipDrvCtrlShow( )
sh7700TimerDrvRegister( )
2
NAME sh7700TimerDrvRegister( ) – register sh7700 timer driver
DESCRIPTION This routine registers the sh7700 timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO
sh77xxPciRegister( )
NAME sh77xxPciRegister( ) – register sh77xxPci driver
sh77xxPcipDrvCtrlShow( )
NAME sh77xxPcipDrvCtrlShow( ) – show pDrvCtrl for sh77xxPci bus controller
507
VxWorks Drivers API Reference, 6.6
shSciDevInit( )
DESCRIPTION none
shSciDevInit( )
NAME shSciDevInit( ) – initialize a on-chip serial communication interface
DESCRIPTION This routine initializes the driver function pointers and then resets the chip in a quiescent
state. The BSP must have already initialized all the device addresses and the baudFreq fields
in the SCI_CHAN structure before passing it to this routine.
RETURNS N/A
shSciIntErr( )
NAME shSciIntErr( ) – handle a channel's error interrupt.
DESCRIPTION none
RETURNS N/A
508
2 Routines
shSciIntTx( )
shSciIntRcv( )
NAME shSciIntRcv( ) – handle a channel's receive-character interrupt.
DESCRIPTION none
RETURNS N/A
shSciIntTx( )
NAME shSciIntTx( ) – handle a channels transmitter-ready interrupt.
DESCRIPTION none
RETURNS N/A
509
VxWorks Drivers API Reference, 6.6
shScifDevInit( )
shScifDevInit( )
NAME shScifDevInit( ) – initialize a on-chip serial communication interface
DESCRIPTION This routine initializes the driver function pointers and then resets the chip in a quiescent
state. The BSP must have already initialized all the device addresses and the baudFreq fields
in the SCIF_CHAN structure before passing it to this routine.
RETURNS N/A
shScifIntErr( )
NAME shScifIntErr( ) – handle a channel's error interrupt.
DESCRIPTION none
RETURNS N/A
shScifIntRcv( )
NAME shScifIntRcv( ) – handle a channel's receive-character interrupt.
510
2 Routines
shScifSioRegister( )
DESCRIPTION none
RETURNS N/A
shScifIntTx( )
NAME shScifIntTx( ) – handle a channels transmitter-ready interrupt.
DESCRIPTION none
RETURNS N/A
shScifSioRegister( )
NAME shScifSioRegister( ) – register shScif driver
DESCRIPTION This routine registers the shScif driver and device recognition data with the vxBus
subsystem.
511
VxWorks Drivers API Reference, 6.6
sioNextChannelNumberAssign( )
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
sioNextChannelNumberAssign( )
NAME sioNextChannelNumberAssign( ) – assign a new serial channel number
DESCRIPTION This routine assigns the next serial channel number available.
ERRNO
smEndLoad( )
NAME smEndLoad( ) – attach the SM interface to the MUX, initialize driver and device
DESCRIPTION This routine attaches an SM Ethernet interface to the network MUX. This routine makes the
interface available by allocating and filling in an END_OBJ structure, a driver entry table,
and a MIB2 interface table.
Calls to this routine evoke different results depending upon the parameter string it receives.
If the string is empty, the MUX is requesting that the device name be returned, not an
initialized END_OBJ pointer. If the string is not empty, a load operation is being requested
with initialization being done with the parameters parsed from the string.
512
2 Routines
smEndLoad( )
Upon successful completion of a load operation by this routine, the driver will be ready to
be started, not active. The system will start the driver when it is ready to accept packets.
The shared memory region will be initialized, via smPktSetup( ), during the call to this 2
routine if it is executing on the designated master CPU. The smEndLoad( ) routine can be
called to load only one device unit at a time.
Input parameters are specified in the form of an ASCII string of colon (:) delimited values of
the form:
"unit:pAnchor:smAddr:memSize:tasType:
maxCpus:masterCpu:localCpu:maxPktBytes:maxInputPkts:
intType:intArg1:intArg2:intArg3:mbNum:cbNum:
configFlg:pBootParams"
The unit parameter denotes the logical device unit number assigned by the operating
system. Specified using radix 10.
The pAnchor parameter is the address of the SM anchor in the given adrsSpace. If adrsSpace
is SM_M_LOCAL, this is the local virtual address on the SM master node by which the local
CPU may access the shared memory anchor. Specified using radix 16.
The smAddr parameter specify the shared memory address; It could be in the master node,
or in the off-board memory. The address is the local address of the master CPU. If smAddr
is NONE, the driver may allocate a cache-safe memory region from the system memory in
the master node as the shared memory region; and Currently, it is users' responsibility to
make sure slave nodes can access this memory, and maintain atomic operations on this
region.
The memSize parameter is the size, in bytes, of the shared memory region. Specified using
radix 16.
The tasType parameter specifies the test-and-set operation to be used to obtain exclusive
access to the shared data structures. It is preferable to use a genuine test-and-set instruction,
if the hardware permits it. In this case, tasType should be SM_TAS_HARD. If any of the
CPUs on the SM network do not support the test-and-set instruction, tasType should be
SM_TAS_SOFT. Specified using radix 10.
The maxCpus parameter specifies the maximum number of CPUs that may use the shared
memory region. Specified using radix 10.
The masterCpu parameter indicates the shared memory master CPU number. Specified in
radix 10.
The localCpu parameter specifies this CPU's number in the SM subnet.
The maxPktBytes parameter specifies the size, in bytes, of the data buffer in shared memory
packets. This is the largest amount of data that may be sent in a single packet. If this value
is not an exact multiple of 4 bytes, it will be rounded up to the next multiple of 4. If zero, the
default size specified in DEFAULT_PKT_SIZE is used. Specified using radix 10.
513
VxWorks Drivers API Reference, 6.6
smEndRegister( )
The maxInputPkts parameter specifies the maximum number of incoming shared memory
packets which may be queued to this CPU at one time. If zero, the default value is used.
Specified using radix 10.
The intType parameter allows a CPU to announce the method by which it is to be notified of
input packets which have been queued to it. Specified using radix 10.
The intArg1, intArg2, and intArg3 parameters are arguments chosen based on, and required
by, the interrupt method specified. They are used to generate an interrupt of type intType.
Specified using radix 16.
If mbNum is non-zero, it specifies the number of mBlks to allocate in the driver memory
pool. If mbNum is less than 0x10, a default value is used. Specified using radix 16.
If cbNum is non-zero, it specifies the number of clBlks and, therefore, the number of clusters,
to allocate in the driver memory pool. If cbNum is less than 0x10, a default value is used.
Specified using radix 16.
The number of clBlks is also the number of clusters which will be allocated. The clusters
allocated in the driver memory pool all have a size of maxPktBytes bytes.
The configFlg parameter indicate some configuration flags for smEnd. The flag includes, but
not limited to, SMEND_PROXY_SERVER, SMEND_PROXY_CLIENT,
SMEND_PROXY_DEFAULT_ADDR, and SMEND_INCLUDE_SEQ_ADDR.
The pBootParams parameter is the address of a BOOT_PARAMS. The smEnd will use this
structure to get the backplane IP address, and/or anchor address.
RETURNS return values are dependent upon the context implied by the input parameter string length
as shown below.
Length Return Value
0 OK and device name copied to input string pointer or ERROR if
NULL string pointer.
non-0 END_OBJ * to initialized object or NULL if bogus string or an
internal error occurs.
smEndRegister( )
NAME smEndRegister( ) – register smEnd driver
514
2 Routines
smNetShow( )
DESCRIPTION This routine registers the smEnd driver and device recognition data with the vxBus
subsystem.
2
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
smNetShow( )
NAME smNetShow( ) – show information about a shared memory network
DESCRIPTION This routine displays information about the different CPUs configured in a shared memory
network specified by endName. It prints error statistics and zeros these fields if zero is set to
TRUE.
PACKETS ERRORS
Unicast Brdcast
Input Output Input Output Input Output
======= ======= ======= ======= + ======= =======
3 2 0 2 | 0 0
value = 0 = 0x0
RETURNS OK, or ERROR if there is a hardware setup problem or the routine cannot be initialized.
515
VxWorks Drivers API Reference, 6.6
smcFdc37b78xDevCreate( )
smcFdc37b78xDevCreate( )
NAME smcFdc37b78xDevCreate( ) – set correct IO port addresses for Super I/O chip
DESCRIPTION This routine will initialize smcFdc37b78xIoPorts data structure. These ioports can either be
changed on-the-fly or overriding SMCFDC37B78X_CONFIG_PORT,
SMCFDC37B78X_INDEX_PORT and SMCFDC37B78X_DATA_PORT. This is a necassary
step in intialization of superIO chip and logical devices embedded in it.
RETURNS NONE
smcFdc37b78xInit( )
NAME smcFdc37b78xInit( ) – initializes Super I/O chip Library
DESCRIPTION This routine will initialize serial, keyboard, floppy disk, parallel port and gpio pins as a part
super i/o intialization
RETURNS NONE
516
2 Routines
sramDevCreate( )
smcFdc37b78xKbdInit( )
NAME smcFdc37b78xKbdInit( ) – initializes the keyboard controller
RETURNS OK/ERROR
sramDevCreate( )
NAME sramDevCreate( ) – create a PCMCIA memory disk device
RETURNS A pointer to a block device structure (BLK_DEV), or NULL if memory cannot be allocated for
the device structure.
517
VxWorks Drivers API Reference, 6.6
sramDrv( )
sramDrv( )
NAME sramDrv( ) – install a PCMCIA SRAM memory driver
DESCRIPTION This routine initializes a PCMCIA SRAM memory driver. It must be called once, before any
other routines in the driver.
RETURNS OK, or ERROR if the I/O system cannot install the driver.
sramMap( )
NAME sramMap( ) – map PCMCIA memory onto a specified ISA address space
DESCRIPTION This routine maps PCMCIA memory onto a specified ISA address space.
518
2 Routines
sym895CtrlCreate( )
sym895CtrlCreate( )
2
NAME sym895CtrlCreate( ) – create a structure for a SYM895 device
DESCRIPTION This routine creates a SCSI Controller data structure and must be called before using a SCSI
Controller chip. It should be called once and only once for a specified SCSI Controller. Since
it allocates memory for a structure needed by all routines in sym895Lib, it must be called
before any other routines in the library. After calling this routine, sym895CtrlInit( ) should
be called at least once before any SCSI transactions are initiated using the SCSI Controller.
A Detailed description of parameters follows.
siopBaseAdrs
base address of the SCSI controller.
clkPeriod
clock controller period (nsec*100).This is used to determine the clock period for the
SCSI core and affects the timing of both asynchronous and synchronous transfers.
Several Commonly used values are
SYM895_1667MHZ 6000 16.67Mhz chip
SYM895_20MHZ 5000 20Mhz chip
SYM895_25MHZ 4000 25Mhz chip
SYM895_3750MHZ 2667 37.50Mhz chip
SYM895_40MHZ 2500 40Mhz chip
SYM895_50MHZ 2000 50Mhz chip
SYM895_66MHZ 1515 66Mhz chip
SYM895_6666MHZ 1500 66Mhz chip
SYM895_75MHZ 1333 75Mhz chip
SYM895_80MHZ 1250 80Mhz chip
SYM895_160MHZ 625 40Mhz chip with Quadrupler
devType
SCSI sym8xx device type
siopRamBaseAdrs
base address of the internal scripts RAM
flags
various device/debug options for the driver. Commonly used values are
SYM895_ENABLE_PARITY_CHECK 0x01
SYM895_ENABLE_SINGLE_STEP 0x02
519
VxWorks Drivers API Reference, 6.6
sym895CtrlInit( )
SYM895_COPY_SCRIPTS 0x04
ERRORS N/A
sym895CtrlInit( )
NAME sym895CtrlInit( ) – initialize a SCSI Controller Structure
DESCRIPTION This routine initializes an SCSI Controller structure, after the structure is created with
sym895CtrlCreate( ). This structure must be initialized before the SCSI Controller can be
used. It may be called more than once if needed; however, it should only be called while
there is no activity on the SCSI interface.
A Detailed description of parameters follows.
pSiop
pointer to the SCSI controller structure created with sym895CtrlCreate( )
scsiCtrlBusId
SCSI Bus Id of the SIOP.
ERRORS N/A
sym895GPIOConfig( )
NAME sym895GPIOConfig( ) – configures general purpose pins GPIO 0-4
520
2 Routines
sym895GPIOCtrl( )
DESCRIPTION This routine uses the GPCNTL register to configure the general purpose pins available on
Sym895 chip. Bits 0-4 of GPCNTL register map to GPIO 0-4 pins. A bit set in GPCNTL
configures corresponding pin as input and a bit reset configures the pins as output.
pSiop
pointer to the SIOP structure.
ioEnable
bits 0-4 of this parameter configure GPIO 0-4 pins. 1 => input, 0 => output.
mask
bits 0-4 of this parameter identify valid bits in ioEnable parameter. Only those pins are
configured, which have a corresonding bit set in this parameter.
sym895GPIOCtrl( )
NAME sym895GPIOCtrl( ) – controls general purpose pins GPIO 0-4
DESCRIPTION This routine uses the GPREG register to set/reset of the general purpose pins available on
Sym895 chip.
pSiop
pointer to the SIOP structure.
ioState
bits 0-4 of this parameter controls GPIO 0-4 pins. 1 => set, 0 => reset.
521
VxWorks Drivers API Reference, 6.6
sym895Intr( )
mask
bits 0-4 of this parameter identify valid bits in ioState parameter. Only those pins are
activated, which have a corresonding bit set in this parameter.
sym895Intr( )
NAME sym895Intr( ) – interrupt service routine for the SCSI Controller
DESCRIPTION The first thing to determine is whether the device is generating an interrupt If not, then this
routine must exit as quickly as possible.
Find the event type corresponding to this interrupt, and carry out any actions which must
be done before the SCSI Controller is re-started. Determine whether or not the SCSI
Controller is connected to the bus (depending on the event type - see note below). If not,
start a client script if possible or else just make the SCSI Controller wait for something else
to happen.
The "connected" variable, at the end of switch statement, reflects the status of the currently
executing thread. If it is TRUE it means that the thread is suspended and must be processed
at the task level. Set the state of SIOP to IDLE and leave the control to the SCSI Manager.
The SCSI Manager, in turn invokes the driver through a "resume" call.
Notify the SCSI manager of a controller event.
RETURNS N/A
522
2 Routines
sym895SetHwOptions( )
sym895Loopback( )
2
NAME sym895Loopback( ) – this routine performs loopback diagnotics on 895 chip
DESCRIPTION Loopback mode allows 895 chip to control all signals, regardless of whether it is in initiator
or target role. This mode insures proper SCRIPTS instruction fetches and data paths.
SYM895 executes initiator instructions through the SCRIPTS, and this routine implements
the target role by asserting and polling the appropriate SCSI signals in the SOCL, SODL,
SBCL, and SBDL registers.
To configure 895 in loopback mode,
(1) Bits 3 and 4 of STEST2 should be set to put SCSI pins in High-Impedance mode, so that
signals are not asserted on to the SCSI bus.
(2) Bit 4 of DCNTL should be set to turn on single step mode. This allows the target
program (this routine) to monitor when an initiator SCRIPTS instruction has
completed.
In this routine, SELECTION, MSG_OUT and DATA_OUT phases are checked. This ensures
that data and control paths are proper.
sym895SetHwOptions( )
NAME sym895SetHwOptions( ) – sets the Sym895 chip Options
523
VxWorks Drivers API Reference, 6.6
sym895Show( )
DESCRIPTION This function sets optional bits required for tweaking the performance of 895 to the Ultra2
SCSI. The routine should be called with SYM895_HW_OPTIONS structure as defined in
sym895.h file.
The input parameters are
pSiop
pointer to the SIOP structure
pHwOptions
pointer to the a SYM895_HW_OPTIONS structure.
struct sym895HWOptions
{
int SCLK : 1; /* STEST1:b7,if false, uses PCI Clock for SCSI */
int SCE : 1; /* STEST2:b7, enable assertion of SCSI thro SOCL*/
/* and SODL registers */
int DIF : 1; /* STEST2:b5, enable differential SCSI */
int AWS : 1; /* STEST2:b2, Always Wide SCSI */
int EWS : 1; /* SCNTL3:b3, Enable Wide SCSI */
int EXT : 1; /* STEST2:b1, Extend SREQ/SACK filtering */
int TE : 1; /* STEST3:b7, TolerANT Enable */
int BL : 3; /* DMODE:b7,b6, CTEST5:b2 : Burst length */
/* when set to any of 32/64/128 burst length */
/* transfers, requires the DMA Fifo size to be */
/* 816 bytes (ctest5:b5 = 1). */
int SIOM : 1; /* DMODE:b5, Source I/O Memory Enable */
int DIOM : 1; /* DMODE:b4, Destination I/O Memory Enable */
int EXC : 1; /* SCNTL1:b7, Slow Cable Mode */
int ULTRA : 1; /* SCNTL3:b7, Ultra Enable */
int DFS : 1; /* CTEST5:b5, DMA Fifo size 112/816 bytes */
} SYM895_HW_OPTIONS;
This routine should not be called when there is SCSI Bus Activity as this modifies the SIOP
Registers.
ERRORS N/A
sym895Show( )
NAME sym895Show( ) – display values of all readable SYM 53C8xx SIOP registers
524
2 Routines
sysAuxClkConnect( )
(
SIOP * pSiop /* pointer to SCSI controller */
)
2
DESCRIPTION This routine displays the state of the SIOP registers in a user-friendly way. It is useful
primarily for debugging. The input parameter is the pointer to the SIOP information
structure returned by the sym895CtrlCreate( ) call.
NOTE The only readable register during a script execution is the Istat register. If you use this
routine during the execution of a SCSI command, the result could be unpredictable.
sysAuxClkConnect( )
NAME sysAuxClkConnect( ) – connect a routine to the auxiliary clock interrupt
525
VxWorks Drivers API Reference, 6.6
sysAuxClkDisable( )
DESCRIPTION This routine later specifies the interrupt service routine to be called at each auxiliary clock
interrupt. It does not enable auxiliary clock interrupts.
sysAuxClkDisable( )
NAME sysAuxClkDisable( ) – turn off auxiliary clock interrupts
RETURNS N/A
sysAuxClkEnable( )
NAME sysAuxClkEnable( ) – turn on auxiliary clock interrupts
RETURNS N/A
526
2 Routines
sysAuxClkRateSet( )
sysAuxClkHandleGet( )
NAME sysAuxClkHandleGet( ) – get the timer handle for auxiliary clock
DESCRIPTION This routine returns the timer handle for the auxiliary clock.
sysAuxClkRateGet( )
NAME sysAuxClkRateGet( ) – get the auxiliary clock rate
DESCRIPTION This routine returns the interrupt rate of the auxiliary clock.
sysAuxClkRateSet( )
NAME sysAuxClkRateSet( ) – set the auxiliary clock rate
527
VxWorks Drivers API Reference, 6.6
sysBusIntAck( )
(
int ticksPerSecond /* number of clock interrupts per second */
)
DESCRIPTION This routine sets the interrupt rate of the auxiliary clock. It does not enable auxiliary clock
interrupts.
RETURNS OK, or ERROR if the tick rate is invalid or the timer cannot be set.
sysBusIntAck( )
NAME sysBusIntAck( ) – acknowledge an interrupt
RETURNS OK
ERRNO
sysBusIntAckHelpr( )
NAME sysBusIntAckHelpr( ) – locate the correct call to acknowledge an interrupt
528
2 Routines
sysBusIntGenHelpr( )
DESCRIPTION This routine iterates through all devices looking for the correct call to acknowledge an
interrupt.
2
RETURNS NONE
ERRNO
sysBusIntGen( )
NAME sysBusIntGen( ) – call interrupt generator function hook
DESCRIPTION This routine either calls interrupt generator function hook directly or calls VxBus helper to
find the correct device and then calls the interrupt generator function hook.
RETURNS STATUS
ERRNO
sysBusIntGenHelpr( )
NAME sysBusIntGenHelpr( ) – locate the correct call to generate an interrupt
DESCRIPTION This routine iterates through all devices looking for the correct call to generate the interrupt.
RETURNS NONE
529
VxWorks Drivers API Reference, 6.6
sysBusTas( )
ERRNO
sysBusTas( )
NAME sysBusTas( ) – establish a reservation for a particular address
DESCRIPTION This routine establishes a reservation for a particular address. If no direct hook is available,
it calls the VxBus helper function to find the correct call.
RETURNS NONE
ERRNO
sysBusTasClear( )
NAME sysBusTasClear( ) – clear a reservation for a particular address
DESCRIPTION This routine clears a reservation for a particular address. If no direct hook is available, it
calls the VxBus helper function to find the correct call.
RETURNS NONE
ERRNO
530
2 Routines
sysClkConnect( )
sysBusTasClearHelper( )
2
NAME sysBusTasClearHelper( ) – locate and clear a reservation for a particular address
DESCRIPTION This routine clears a reservation for a particular address by calling all devices which
support this functionality.
RETURNS NONE
ERRNO
sysBusTasHelper( )
NAME sysBusTasHelper( ) – locate the correct device to do TAS
DESCRIPTION This routine iterates through all VxBus devices to find the correct device to do TAS.
ERRNO
sysClkConnect( )
NAME sysClkConnect( ) – connect a routine to the system clock interrupt
531
VxWorks Drivers API Reference, 6.6
sysClkDisable( )
DESCRIPTION This routine specifies the interrupt service routine to be called at each clock interrupt.
Normally, it is called from usrRoot( ) in usrConfig.c to connect usrClock( ) to the system
clock interrupt.
sysClkDisable( )
NAME sysClkDisable( ) – turn off system clock interrupts
RETURNS N/A
sysClkEnable( )
NAME sysClkEnable( ) – turn on system clock interrupts
532
2 Routines
sysClkRateGet( )
RETURNS N/A
sysClkHandleGet( )
NAME sysClkHandleGet( ) – get the timer handle for system clock
DESCRIPTION This routine returns the timer handle for the system clock.
sysClkRateGet( )
NAME sysClkRateGet( ) – get the system clock rate
533
VxWorks Drivers API Reference, 6.6
sysClkRateSet( )
sysClkRateSet( )
NAME sysClkRateSet( ) – set the system clock rate
DESCRIPTION This routine sets the interrupt rate of the system clock. It is called by usrRoot( ) in
usrConfig.c.
RETURNS OK, or ERROR if the tick rate is invalid or the timer cannot be set.
sysMailboxConnect( )
NAME sysMailboxConnect( ) – TBD
DESCRIPTION none
RETURNS STATUS
ERRNO
sysMailboxEnable( )
NAME sysMailboxEnable( ) – TBD
534
2 Routines
sysPciHostBridgeInit( )
DESCRIPTION none
RETURNS STATUS
ERRNO
sysPciHostBridgeInit( )
NAME sysPciHostBridgeInit( ) – Initialize the PCI Host Bridge
DESCRIPTION Initializes the PCI bridge so it can operate as both a PCI master and slave.
Parameters set are:
CPU->PCI (master/initiator/outbound) address translation
PCI->CPU (slave/target/inbound) address translation
ERRNO
sysPciHostBridgeInit( )
NAME sysPciHostBridgeInit( ) – initialize the PCI Host Bridge
535
VxWorks Drivers API Reference, 6.6
sysPciHostBridgeInit( )
ERRNO
sysPciHostBridgeInit( )
NAME sysPciHostBridgeInit( ) – Initialize the PCI-X Host Bridge
DESCRIPTION Initializes the PCI bridge so it can operate as both a PCI master and slave. Parameters set are:
- CPU->PCI (master/initiator/outbound) address translation
- PCI->CPU (slave/target/inbound) address translation
sysSerialChanConnect( )
NAME sysSerialChanConnect( ) – connect the SIO_CHAN device
DESCRIPTION This routine connects the specified serial channel to the I/O system.
This routine first checks for BSP-supplied serial channels. For BSP-supplied serial channels,
this routine does nothing. If the specified channel number is not supplied by the BSP, then
this routine runs the connect method on the appropriate serial device instance.
536
2 Routines
sysSerialConnectAll( )
ERRNO 2
SEE ALSO sioChanUtil
sysSerialChanGet( )
NAME sysSerialChanGet( ) – get the SIO_CHAN device associated with a serial channel
DESCRIPTION This routine returns a pointer to the SIO_CHAN device associated with a specified serial
channel. It is called by usrRoot( ) to obtain pointers when creating the system serial devices,
/tyCo/x. It is also used by the WDB agent to locate its serial channel.
This routine first checks for BSP-supplied serial channels, then queries the bus subsystem
for a serial channel matching the specified channel number.
RETURNS pointer to the SIO_CHAN structure for the channel, or ERROR if an invalid channel
ERRNO
sysSerialConnectAll( )
NAME sysSerialConnectAll( ) – connect all SIO_CHAN devices
DESCRIPTION This routine connects all serial channel to the I/O system.
This routine first checks for BSP-supplied serial channels. For BSP-supplied serial channels,
this routine does nothing. If the specified channel number is not supplied by the BSP, then
this routine runs the connect method for all serial device instances.
RETURNS N/A
537
VxWorks Drivers API Reference, 6.6
sysSmEndLoad( )
ERRNO
sysSmEndLoad( )
NAME sysSmEndLoad( ) – load the shared memory END driver
DESCRIPTION This function packs the loadstring, and calls the smEndLoad to load the the shared memory
END driver
sysTimestamp( )
NAME sysTimestamp( ) – get the timestamp timer tick count
DESCRIPTION This routine returns the current value of the timestamp timer tick counter. The tick count
can be converted to seconds by dividing by the return of sysTimestampFreq( ).
This routine should be called with interrupts locked. If interrupts are not already locked,
sysTimestampLock( ) should be used instead.
538
2 Routines
sysTimestampDisable( )
sysTimestampConnect( )
NAME sysTimestampConnect( ) – connect a user routine to the timestamp timer interrupt
DESCRIPTION This routine specifies the user interrupt routine to be called at each timestamp timer
interrupt. It does not enable the timestamp timer itself. If the timestamp timer is same as
the system clock the ISR should not be replaced Hence returns ERROR.
sysTimestampDisable( )
NAME sysTimestampDisable( ) – disable the timestamp timer
DESCRIPTION This routine disables the timestamp timer. Interrupts are not disabled, although the tick
counter will not increment after the timestamp timer is disabled, thus interrupts will no
longer be generated.
539
VxWorks Drivers API Reference, 6.6
sysTimestampEnable( )
sysTimestampEnable( )
NAME sysTimestampEnable( ) – initialize and enable the timestamp timer
DESCRIPTION This routine connects the timestamp timer interrupt and initializes the counter registers. If
the timestamp timer is already running, this routine merely resets the timer counter.
The rate of the timestamp timer should be set explicitly within the BSP, in the sysHwInit( )
routine. This routine does not intialize the timer rate.
sysTimestampFreq( )
NAME sysTimestampFreq( ) – get the timestamp timer clock frequency
DESCRIPTION This routine returns the frequency of the timer clock, in ticks per second. The rate of the
timestamp timer should be set explicitly within the BSP, in the sysHwInit( ) routine.
sysTimestampHandleGet( )
NAME sysTimestampHandleGet( ) – get the timer handle for timestamp timer
540
2 Routines
sysTimestampPeriod( )
DESCRIPTION This routine returns the timer handle for the timestamp timer.
sysTimestampLock( )
NAME sysTimestampLock( ) – get the timestamp timer tick count
DESCRIPTION This routine returns the current value of the timestamp timer tick counter. The tick count
can be converted to seconds by dividing by the return of sysTimestampFreq( ).
This routine locks interrupts for cases where it is necessary to stop the tick counter in order
to read it, or when two independent counters must be read. If interrupts are already locked,
sysTimestamp( ) should be used instead.
sysTimestampPeriod( )
NAME sysTimestampPeriod( ) – get the timestamp timer period
DESCRIPTION This routine returns the period of the timestamp timer in ticks. The period, or terminal
count, is the number of ticks to which the timestamp timer will count before rolling over and
restarting the counting process.
541
VxWorks Drivers API Reference, 6.6
tcicInit( )
tcicInit( )
NAME tcicInit( ) – initialize the TCIC chip
tcicShow( )
NAME tcicShow( ) – show all configurations of the TCIC chip
RETURNS N/A
542
2 Routines
tffsBootImagePut( )
tffsBootImagePut( )
2
NAME tffsBootImagePut( ) – write to the boot-image region of the flash device
DESCRIPTION This routine writes an input stream to the boot-image region (if any) of a flash memory
device. Typically, the input stream contains a boot image, such as the VxWorks boot image,
but you are free to use this function to write any data needed. The size of the boot-image
region is set by the tffsDevFormat( ) call (or the sysTffsFormat( ) call, a BSP-specific helper
function that calls tffsDevFormat( ) internally) that formats the flash device for use with
TrueFFS.
If tffsBootImagePut( ) is used to put a VxWorks boot image in flash, you should not use the
s-record version of the boot image typically produced by make. Instead, you should take
the pre s-record version (usually called bootrom instead of bootrom.hex), and filter out its
loader header information using an xxxToBin utility. For example:
elfToBin < bootrom > bootrom.bin
Use the resulting bootrom.bin as input to tffsBootImagePut( ).
The discussion above assumes that you want only to use the flash device to store a VxWorks
image that is retrieved from the flash device and then run out of RAM. However, because
it is possible to map many flash devices directly into the target's memory, it is also possible
run the VxWorks image from flash memory, although there are some restrictions:
- The flash device must be non-NAND.
- Only the text segment of the VxWorks image (vxWorks.res_rom) may run out of flash
memory. The data segment of the image must reside in standard RAM.
- No part of the flash device may be erased while the VxWorks image is running from
flash memory.
Because TrueFFS garbage collection triggers an erase, this last restriction means that you
cannot run a VxWorks boot image out of a flash device that must also support a writable
file system (although a read-only file system is OK).
This last restriction arises from the way in which flash devices are constructed. The current
physical construction of flash memory devices does not allow access to the device while an
erase is in progress anywhere on the flash device. As a result, if TrueFFS tries to erase a
portion of the flash device, the entire device becomes inaccessible to all other users. If that
other user happens to be the VxWorks image looking for its next instruction, the VxWorks
image crashes.
543
VxWorks Drivers API Reference, 6.6
tffsShow( )
RETURNS OK or ERROR
tffsShow( )
NAME tffsShow( ) – show device information on a specific socket interface
DESCRIPTION This routine prints device information on the specified socket interface. This information is
particularly useful when trying to determine the number of Erase Units required to contain
a boot image. The field called unitSize reports the size of an Erase Unit.
If the process of getting physical information fails, an error code is printed. The error codes
can be found in flbase.h.
RETURNS N/A
tffsShowAll( )
NAME tffsShowAll( ) – show device information on all socket interfaces
RETURNS N/A
544
2 Routines
vxBusShow( )
vgaInit( )
NAME vgaInit( ) – initializes the VGA chip and loads font in memory.
DESCRIPTION This routine will initialize the VGA specific register set to bring a VGA card in VGA 3+
mode and loads the font in plane 2.
RETURNS OK/ERROR
vxBusShow( )
NAME vxBusShow( ) – show vxBus subsystem
RETURNS N/A
ERRNO
545
VxWorks Drivers API Reference, 6.6
vxbAccessMethodGet( )
vxbAccessMethodGet( )
NAME vxbAccessMethodGet( ) – find specific method for accessing device
DESCRIPTION This routine finds the specified method for accessing the specified device.
ERRNO
vxbAuxClkLibInit( )
NAME vxbAuxClkLibInit( ) – initialize the auxiliary clock library
DESCRIPTION This routine initializes the auxiliary clock library by selecting the timer which is best suited
for use as auxiliary clock from the timers available in the system.
RETURNS OK or ERROR.
vxbAuxClkShow( )
NAME vxbAuxClkShow( ) – show the auxiliary clock information
546
2 Routines
vxbBusListPrint( )
RETURNS None. 2
vxbBusAnnounce( )
NAME vxbBusAnnounce( ) – announce bus discovery to bus subsystem
DESCRIPTION This routine is called by bus controller drivers, whenever a new bus is found.
The pBusDev->pParentBus must be populated before calling this function. Otherwise, the
bus shows up as a lost bus when vxBusShow () is called
ERRNO
vxbBusListPrint( )
NAME vxbBusListPrint( ) – Show bus topology
RETURNS N/A
547
VxWorks Drivers API Reference, 6.6
vxbBusTypeRegister( )
ERRNO
vxbBusTypeRegister( )
NAME vxbBusTypeRegister( ) – register a bus type
DESCRIPTION This routine registers a bus type with the vxBus subsystem.
ERRNO
vxbBusTypeString( )
NAME vxbBusTypeString( ) – retrieve bus type string
DESCRIPTION This routine returns the bus type string based on the bus type integer value
ERRNO
548
2 Routines
vxbDelay( )
vxbBusTypeUnregister( )
2
NAME vxbBusTypeUnregister( ) – unregister a bus type
DESCRIPTION This routine unregisters a bus type with the vxBus subsystem.
ERRNO
vxbCn3xxxTimerDrvRegister( )
NAME vxbCn3xxxTimerDrvRegister( ) – register cn3xxx timer driver
DESCRIPTION This routine registers the cn3xxx timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO none
vxbDelay( )
NAME vxbDelay( ) – delay for a moment
549
VxWorks Drivers API Reference, 6.6
vxbDelayLibInit( )
RETURNS N/A.
vxbDelayLibInit( )
NAME vxbDelayLibInit( ) – initialize the delay library
DESCRIPTION This routine initializes the delay library by selecting the timers which are best suited for use
as delay timers from the timers available in the system.
RETURNS OK or ERROR.
vxbDelayTimersShow( )
NAME vxbDelayTimersShow( ) – show the delay timers information
RETURNS None.
550
2 Routines
vxbDevConnectInternal( )
vxbDevAccessShow( )
2
NAME vxbDevAccessShow( ) – Show bus access methods
DESCRIPTION This routine prints the access methods for the specified device.
RETURNS N/A
ERRNO
vxbDevConnect( )
NAME vxbDevConnect( ) – HWIF Post-Kernel Connection
DESCRIPTION This function performs the hardware interface post kernel device connection.
RETURNS OK or ERROR
ERRNO None
vxbDevConnectInternal( )
NAME vxbDevConnectInternal( ) – third-pass initialization of devices
DESCRIPTION Note: This is called from the vxbUsrCmdLine.c in command line builds
551
VxWorks Drivers API Reference, 6.6
vxbDevError( )
ERRNO
vxbDevError( )
NAME vxbDevError( ) – driver does not support specified functionality
DESCRIPTION This routine provides and error if the device driver does not support the specified
functionality.
ERRNO
vxbDevInit( )
NAME vxbDevInit( ) – HWIF Post-Kernel Init
DESCRIPTION This function performs the hardware interface post kernel initialization
RETURNS OK or ERROR
ERRNO None
552
2 Routines
vxbDevMethodGet( )
vxbDevInitInternal( )
2
NAME vxbDevInitInternal( ) – second-pass initialization of devices
DESCRIPTION This routine executes the second stage of device initialization. Note: This is called from the
vxbUsrCmdLine.c in command line builds
ERRNO
vxbDevIterate( )
NAME vxbDevIterate( ) – perform specified action for each device
DESCRIPTION This routine performs the specified action for each device.
ERRNO
vxbDevMethodGet( )
NAME vxbDevMethodGet( ) – find entry point of method
553
VxWorks Drivers API Reference, 6.6
vxbDevMethodRun( )
(
struct vxbDev * pDev, /* Device information */
UINT32 method /* Specified method */
)
RETURNS a pointer to the entry point routine for accessing the specified functionality of the specified
device, or NULL if no such functionality is available.
ERRNO
vxbDevMethodRun( )
NAME vxbDevMethodRun( ) – run method on devices
DESCRIPTION This routine runs the specified method for all instances which provide a specified method.
ERRNO
vxbDevParent( )
NAME vxbDevParent( ) – find parent device
554
2 Routines
vxbDevPathShow( )
DESCRIPTION This routine finds the parent device of the specified device.
ERRNO
vxbDevPath( )
NAME vxbDevPath( ) – trace from device to nexus
DESCRIPTION This routine traces the specified device to the PLB bus.
ERRNO
vxbDevPathShow( )
NAME vxbDevPathShow( ) – Show bus hierarchy
DESCRIPTION This routine prints the path of busses between a specified device and the nexus
RETURNS N/A
555
VxWorks Drivers API Reference, 6.6
vxbDevRegister( )
ERRNO
vxbDevRegister( )
NAME vxbDevRegister( ) – register a device driver
DESCRIPTION This routine registers a device driver with the vxBus subsystem.
RETURNS OK or ERROR
ERRNO
vxbDevRemovalAnnounce( )
NAME vxbDevRemovalAnnounce( ) – announce device removal to bus subsystem
DESCRIPTION This routine removes the device from the bus subsystem. If there is an instance associated
with this device, then the driver's method for unlink is called and device is removed from
the instances list. If the driver does not implement this method, then this function returns
an ERROR. If the device is present in the orphans list, it is removed from the orphans list.
ERRNO
556
2 Routines
vxbDevStructShow( )
vxbDevStructAlloc( )
2
NAME vxbDevStructAlloc( ) – allocate VXB_DEVICE structure
ERRNO
vxbDevStructFree( )
NAME vxbDevStructFree( ) – free VXB_DEVICE structure
RETURNS N/A
ERRNO
vxbDevStructShow( )
NAME vxbDevStructShow( ) – Show device information
557
VxWorks Drivers API Reference, 6.6
vxbDevTblEnumerate( )
(
struct vxbDev * pDev
)
RETURNS N/A
ERRNO
vxbDevTblEnumerate( )
NAME vxbDevTblEnumerate( ) – enumerate VxBus devices from hwconf device table
NOTE: This routine puts the HCF record pointer into the VXB_DEVICE
field pBusSpecificDevInfo. This allows the bus controller or bus
type access to all configuration information which might be kept
there. The bus controller and/or bus type code are free to
use this field for their own purposes and override the HCF record
pointer, but they should save the HCF pointer or extract all
information from the record first, if they want to have access
to that information later.
558
2 Routines
vxbDeviceDriverRelease( )
2
RETURNS Not Available
vxbDeviceAnnounce( )
NAME vxbDeviceAnnounce( ) – announce device discovery to bus subsystem
DESCRIPTION This routine goes through existing bus types and drivers, attempting to match the device
which has been discovered with a driver. If a driver is found, then an instance is created,
and the instance is added to the bus on which the device resides.
If no driver is found for the device, then the device is added to a list of unattached devices.
At some future time, a driver matching this device may be added to the system.
The pDev->pParentBus must be populated before calling this function. Otherwise, this
device shows up in the lost Devices list(under "Lost devices in vxBus system") when
vxBusShow () is called
ERRNO
vxbDeviceDriverRelease( )
NAME vxbDeviceDriverRelease( ) – turn an instance into an orphan
559
VxWorks Drivers API Reference, 6.6
vxbDeviceMethodRun( )
(
struct vxbDev *pDev
)
DESCRIPTION This routine dissociates the specified device from its driver.
RETURNS OK or ERROR
ERRNO
vxbDeviceMethodRun( )
NAME vxbDeviceMethodRun( ) – run method on device
RETURNS OK or ERROR
ERRNO
vxbDmaBufFlush( )
NAME vxbDmaBufFlush( ) – partial cache flush for DMA map
560
2 Routines
vxbDmaBufInvalidate( )
ERRNO N/A
vxbDmaBufInit( )
NAME vxbDmaBufInit( ) – initialize buffer and DMA system
RETURNS N/A
ERRNO N/A
vxbDmaBufInvalidate( )
NAME vxbDmaBufInvalidate( ) – partial cache invalidate for DMA map
DESCRIPTION This routine does cache invalidate for a portion of the specified DMA map within one
fragment.
561
VxWorks Drivers API Reference, 6.6
vxbDmaBufMapCreate( )
ERRNO N/A
vxbDmaBufMapCreate( )
NAME vxbDmaBufMapCreate( ) – create/allocate a DMA map
DESCRIPTION This routine creates/allocates a DMA map for a transfer (used as an argument for
vxbDmaBufMapLoad( )/vxbDmaBufMapUnload( ) later -- a map holds state like pointers
to allocated bounce buffers).
NOTE Allocate a handle for mapping from kva/uva/physical address space into bus device space.
ERRNO N/A
vxbDmaBufMapDestroy( )
NAME vxbDmaBufMapDestroy( ) – release a DMA map
DESCRIPTION This routine releases a DMA map and zeros the memory associated with it
562
2 Routines
vxbDmaBufMapInvalidate( )
NOTE Destroy a handle for mapping from kva/uva/physical address space into bus device space.
RETURNS OK if the map was valid and the storage could be freed, ERROR otherwise 2
ERRNO N/A
vxbDmaBufMapFlush( )
NAME vxbDmaBufMapFlush( ) – flush DMA Map cache
DESCRIPTION This routine does cache flush for the specified DMA map.
ERRNO N/A
vxbDmaBufMapInvalidate( )
NAME vxbDmaBufMapInvalidate( ) – invalidate DMA Map cache
DESCRIPTION This routine does cache invalidate for the specified DMA map.
563
VxWorks Drivers API Reference, 6.6
vxbDmaBufMapIoVecLoad( )
ERRNO N/A
vxbDmaBufMapIoVecLoad( )
NAME vxbDmaBufMapIoVecLoad( ) – map a virtual buffer with scatter/gather
DESCRIPTION This routine maps a virtual buffer. Its behavior is like vxbDmaBufMapLoad( ), but works
on a scatter/gather array of virtual buffers (called a struct iovec in BSD) -- useful for disk
transfers of multiple data blocks.
ERRNO N/A
vxbDmaBufMapLoad( )
NAME vxbDmaBufMapLoad( ) – map a virtual buffer
564
2 Routines
vxbDmaBufMapUnload( )
DESCRIPTION This routine maps a virtual buffer into a physical address and length, using info in DMA tag
to decided what sort of address translation and possible bounce-buffering may need to be
done. Consumes a DMA map allocated with vxbDmaBufMapCreate( ). 2
NOTE Map the buffer buf into bus space using the dmamap map.
ERRNO N/A
vxbDmaBufMapMblkLoad( )
NAME vxbDmaBufMapMblkLoad( ) – map a virtual buffer with mBlk
DESCRIPTION This routine maps a virtual buffer. Its behavior is like vxbDmaBufMapLoad( ), but uses an
mBlk tuple.
ERRNO N/A
vxbDmaBufMapUnload( )
NAME vxbDmaBufMapUnload( ) – unmap/destroy a previous virtual buffer mapping
565
VxWorks Drivers API Reference, 6.6
vxbDmaBufMemAlloc( )
(
VXB_DMA_TAG_ID dmaTagID,
VXB_DMA_MAP_ID map
)
DESCRIPTION This routine unmaps/destroys a previous virtual buffer mapping after a transfer completes,
possibly releasing any bounce buffers or other system resources consumed by mapping the
virtual buffer.
ERRNO N/A
vxbDmaBufMemAlloc( )
NAME vxbDmaBufMemAlloc( ) – allocate DMA-able memory
DESCRIPTION This routine allocates DMA-able memory that satisfies requirements encoded in the
supplied DMA tag -- note: in the BSD API, the DMA tag controls the size of the memory
block returned by this function. So if you need, say, 1536 byte blocks, you would create a tag
that lets you allocate 1536-byte chunks of memory from whatever pool you need to satisfy
the DMA constraints of your device. Note also that this offers the possibility of using a slab
allocator to speed up allocation time
NOTE Allocate a piece of memory that can be efficiently mapped into bus device space based on
the constraints listed in the DMA tag. A dmamap to for use with dmamap_load is also
allocated.
ERRNO N/A
566
2 Routines
vxbDmaBufSync( )
vxbDmaBufMemFree( )
2
NAME vxbDmaBufMemFree( ) – release DMA-able memory
NOTE Free a piece of memory and it's allocated dmamap, that was allocated via
bus_dmamem_alloc( ). Make the same choice for free/contigfree.
ERRNO N/A
vxbDmaBufSync( )
NAME vxbDmaBufSync( ) – do cache flushes or invalidates
ERRNO N/A
567
VxWorks Drivers API Reference, 6.6
vxbDmaBufTagCreate( )
vxbDmaBufTagCreate( )
NAME vxbDmaBufTagCreate( ) – create a DMA tag
DESCRIPTION This function creates a device-specific DMA tag with the given characteristics (type of
allocation (general heap, uncached, dual-ported RAM, specific partition), required
alignment, max and min physical address boundaries (can the PCI bridge see all memory in
a 64-bit system, or just a 4GB window?), DMAable memory allocation size, max number of
allowed entries in a DMA fragment list, etc...)
ERRNO N/A
vxbDmaBufTagDestroy( )
NAME vxbDmaBufTagDestroy( ) – destroy a DMA tag
DESCRIPTION This routine destroys the tag when we're done with it (usually during driver unload)
568
2 Routines
vxbDmaChanAlloc( )
RETURNS OK if the tag was valid and the tag structure's memory was freed, ERROR otherwise.
ERRNO N/A 2
vxbDmaBufTagParentGet( )
NAME vxbDmaBufTagParentGet( ) – retrieve parent DMA tag
DESCRIPTION This function retrieves the DMA tag associated with the upstream bus controller closest to
the device, which provides a DMA tag.
RETURNS NULL
ERRNO N/A
vxbDmaChanAlloc( )
NAME vxbDmaChanAlloc( ) – allocate and initialize a DMA channel
DESCRIPTION This routine allocates and initializes a DMA channel for use by an instance.
If a dedicated channel is available, this routine searches through all the instances in the
system to locate the DMA engine which provides the dedicated channel. If the DMA engine
569
VxWorks Drivers API Reference, 6.6
vxbDmaChanFree( )
ERRNO
vxbDmaChanFree( )
NAME vxbDmaChanFree( ) – free a DMA channel
DESCRIPTION This routine frees a DMA channel for allocation by another instance
RETURNS None
ERRNO
vxbDmaLibInit( )
NAME vxbDmaLibInit( ) – initialize the VxBus slave DMA library
570
2 Routines
vxbDrvRescan( )
RETURNS N/A 2
ERRNO N/A
vxbDriverUnregister( )
NAME vxbDriverUnregister( ) – remove a device driver from the bus subsystem
DESCRIPTION This routine is the final stage of driver removal. The driver must disconnect itself from the
OS, free resources, and then finally call this routine. If the vxbDevRegInfo structure was
dynamically allocated by the driver, the driver is responsible for freeing it.
This routine dissociates the driver from each device to which it has been connected, and
moves each such device onto the orphan list of the bus it resides on.
RETURNS OK or ERROR
ERRNO
vxbDrvRescan( )
NAME vxbDrvRescan( ) – rescan all orphans to match against driver
DESCRIPTION This routine re-scans all orphan device, checking to see whether they match the specified
driver.
571
VxWorks Drivers API Reference, 6.6
vxbEndQctrlInit( )
ERRNO
vxbEndQctrlInit( )
NAME vxbEndQctrlInit( ) – initialize the vxbEndQctrl library
RETURNS OK or ERROR.
ERRNO N/A
vxbEndQnumSet( )
NAME vxbEndQnumSet( ) – set the network job queue for a VxBus END device
DESCRIPTION This function sets the receive job queue used by a VxBus END device, identified by its
VxBus instance name, to the job queue corresponding to network daemon number qnum.
If the END device is already started, then in order to change the job queue, the END device
must be stopped and restarted after a short delay. In the interim, some traffic may be
dropped. If you call this routine when the END device is stopped, the change does not take
effect until you subsequently call muxDevStart( ) to start the device.
572
2 Routines
vxbEpicIntCtlrpDrvCtrlShow( )
WARNING This routine is not protected against concurrent access to the device by other tasks
attempting to stop, start, or change the queue parameters of the device.
2
RETURNS OK if the routine successfully sets the new job queue ID;
ERROR otherwise.
ERRNO N/A
vxbEpicIntCtlrRegister( )
NAME vxbEpicIntCtlrRegister( ) – register epicIntCtlr driver
DESCRIPTION This routine registers the EPCI driver and device recognition data with the vxBus
subsystem.
vxbEpicIntCtlrpDrvCtrlShow( )
NAME vxbEpicIntCtlrpDrvCtrlShow( ) – show pDrvCtrl for template controller
DESCRIPTION none
RETURNS 0 always
573
VxWorks Drivers API Reference, 6.6
vxbEpicSharedMsgHandler( )
vxbEpicSharedMsgHandler( )
NAME vxbEpicSharedMsgHandler( ) – Handles the interrupt and calls the relevent ISRs
DESCRIPTION none
RETURNS NONE
ERRNO None
vxbGetPciDevice( )
NAME vxbGetPciDevice( ) – Locates a PCI device
DESCRIPTION Called using vxbSubDevAction it locates a PCI device and then returns the vxBus device
ID.
ERRNO
574
2 Routines
vxbI8259IntDisablePIC( )
vxbI8253TimerDrvRegister( )
2
NAME vxbI8253TimerDrvRegister( ) – registers the driver for i8253 timer
DESCRIPTION This routine registers the driver for the i8253 timer with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbI8259IntCtlrRegister( )
NAME vxbI8259IntCtlrRegister( ) – registers I8259 driver with vxBus
DESCRIPTION This routine registers the Intel 8259 Programmer Interrupt Controller Driver with vxBus.
RETURNS NA
ERRNO L none
vxbI8259IntDisablePIC( )
NAME vxbI8259IntDisablePIC( ) – disables a PIC interrupt level
575
VxWorks Drivers API Reference, 6.6
vxbI8259IntEOI( )
DESCRIPTION This routine disables a specified PIC interrupt level. This function implements the disabling
of PIC level for legacy (non-vxBus) devices.
ERRNO none
vxbI8259IntEOI( )
NAME vxbI8259IntEOI( ) – to send an EOI signal
DESCRIPTION This routine send the EOI for all instances of i8259 Interrupt Controller driver. The function
implements the legacy support for same.
vxbI8259IntEnablePIC( )
NAME vxbI8259IntEnablePIC( ) – enable a PIC interrupt level
DESCRIPTION This routine enables a specified PIC interrupt level. This function implements the enabling
of PIC level for legacy (non-vxBus) devices.
ERRNO none
576
2 Routines
vxbInstByNameFind( )
vxbIaTimestampDrvRegister( )
NAME vxbIaTimestampDrvRegister( ) – register intel timestamp driver
DESCRIPTION This routine registers the intel timestamp driver with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbInit( )
NAME vxbInit( ) – initialize vxBus
ERRNO
vxbInstByNameFind( )
NAME vxbInstByNameFind( ) – retrieve the VXB_DEVICE_ID for an instance
577
VxWorks Drivers API Reference, 6.6
vxbInstParamByIndexGet( )
(
char * instName,
int unit
)
DESCRIPTION This routine returns the VXB_DEVICE_ID for a given instance identified by name and unit
number.
ERRNO N/A
vxbInstParamByIndexGet( )
NAME vxbInstParamByIndexGet( ) – retrieve driver parameter value
ERRNO N/A
578
2 Routines
vxbInstParamSet( )
vxbInstParamByNameGet( )
2
NAME vxbInstParamByNameGet( ) – retrieve driver parameter value
ERRNO N/A
vxbInstParamSet( )
NAME vxbInstParamSet( ) – set driver parameter for specified instance
DESCRIPTION This routine provides a programmatic API for middleware modules to set a parameter for
a specific instance.
The instance is identified by a VXB_DEVICE_ID.
579
VxWorks Drivers API Reference, 6.6
vxbInstUnitGet( )
The parameter consists of three fields: parameter value, parameter name, and parameter
type. The parameter name is specific to the driver. The supported parameter types of
storage are unsigned integer 32, unsigned integer 64, character string, function pointer, and
generic "void" pointer.
Note that when 64-bit values are specified, the value must be specified with a pointer. That
is, value is interpreted in that case as "UINT64 * pValue" rather than as "UINT64 value".
This routine should not be used from any BSP code, but only by application or middleware
code. Parameter setting in the BSP should be done in the BSP-resident parameter override
table.
RETURNS OK, or ERROR if the specified parameter could not be set for the instance
ERRNO N/A
vxbInstUnitGet( )
NAME vxbInstUnitGet( ) – get the unit number
DESCRIPTION This routine gets the unit number for the device.
RETURNS OK or ERROR
ERRNO
vxbInstUnitSet( )
NAME vxbInstUnitSet( ) – set the unit number
580
2 Routines
vxbIntConnect( )
(
VXB_DEVICE_ID pDev,
UINT32 unitNumber
) 2
DESCRIPTION This routine sets the unit number for the device.
RETURNS OK or ERROR
ERRNO
vxbIntAcknowledge( )
NAME vxbIntAcknowledge( ) – Acknowledge device's interrupt
DESCRIPTION This routine acknowledges and clears the specified interrupt on any interrupt controller
intervening between the processor and the device. It does not affect the interrupt source or
the processor.
RETURNS OK or ERROR
ERRNO
vxbIntConnect( )
NAME vxbIntConnect( ) – connect device's interrupt
581
VxWorks Drivers API Reference, 6.6
vxbIntDisable( )
(
struct vxbDev * pDev, /* Device Information */
int index, /* index of interrupt vector */
VOIDFUNCPTR pIsr, /* ISR */
void * pArg /* parameter */
)
DESCRIPTION This routine connects the specified ISR to the interrupt source.
RETURNS OK or ERROR
ERRNO
vxbIntDisable( )
NAME vxbIntDisable( ) – disable device's interrupt
DESCRIPTION This routine disables the specified interrupt on the lowest-level interrupt controller between
the processor and the device. It does not affect the interrupt source nor the processor.
RETURNS OK or ERROR
ERRNO
vxbIntDisconnect( )
NAME vxbIntDisconnect( ) – disconnect device's interrupt
582
2 Routines
vxbIntDynaCtlrInit( )
(
struct vxbDev * pDev, /* Device Information */
int index, /* index of interrupt vector */
VOIDFUNCPTR pIsr, /* ISR */ 2
void * pArg /* parameter */
)
DESCRIPTION This routine disconnects the specified ISR from the interrupt source.
RETURNS OK or ERROR
ERRNO
vxbIntDynaConnect( )
NAME vxbIntDynaConnect( ) – Initializes/connects the dynamic interrupt
DESCRIPTION This routine finds the interrupt controller then calls the method for connecting dynamic
interrupt.
RETURNS STATUS
ERRNO
vxbIntDynaCtlrInit( )
NAME vxbIntDynaCtlrInit( ) – Intializes function pointers to enable library use.
583
VxWorks Drivers API Reference, 6.6
vxbIntDynaVecAlloc( )
DESCRIPTION none
RETURNS NONE
ERRNO
vxbIntDynaVecAlloc( )
NAME vxbIntDynaVecAlloc( ) – Finds the the next vector for dynamic interrupt
DESCRIPTION This routine calls the vector owner to allocate a vector for the dynamic interrupt. Only
needed if interrupt controller isn't the vector owner.
RETURNS NONE
ERRNO
vxbIntDynaVecDevMultiProgram( )
NAME vxbIntDynaVecDevMultiProgram( ) – program multiple vectors
DESCRIPTION none
584
2 Routines
vxbIntDynaVecOwnerFind( )
RETURNS STATUS
ERRNO 2
SEE ALSO vxbIntDynaCtlrLib
vxbIntDynaVecMultiConnect( )
NAME vxbIntDynaVecMultiConnect( ) – connect to multiple vectors
DESCRIPTION none
RETURNS STATUS
ERRNO
vxbIntDynaVecOwnerFind( )
NAME vxbIntDynaVecOwnerFind( ) – Finds the owner of dynnamic vector alloc
DESCRIPTION This routine finds the vector owner that can allocate a vector for the dynamic interrupt. Only
needed if interrupt controller isn't the vector owner.
RETURNS NONE
585
VxWorks Drivers API Reference, 6.6
vxbIntEnable( )
ERRNO
vxbIntEnable( )
NAME vxbIntEnable( ) – Enable device's interrupt
DESCRIPTION This routine enables the specified interrupt on any interrupt controller intervening between
the processor and the device. It does not affect the interrupt source nor the processor.
RETURNS OK or ERROR
ERRNO
vxbIntReroute( )
NAME vxbIntReroute( ) – Route specified interrupt to destination CPU
RETURNS OK always
586
2 Routines
vxbIntVectorGet( )
ERRNO
vxbIntToCpuRoute( )
NAME vxbIntToCpuRoute( ) – reroute all interrupts for a specified CPU
DESCRIPTION This routine calls all interrupt controllers that support interrupt routing functions (method
vxbIntCpuReroute declared by the controller) passing this function the specified CPU for
the reroute operation.
RETURNS OK always
ERRNO
vxbIntVectorGet( )
NAME vxbIntVectorGet( ) – get device's interrupt vector
DESCRIPTION This routine returns the vector for the specified interrupt on the specified device. The return
value of this routine can be passed as the vector to intConnect( ) and other system-level
interrupt support routines.
587
VxWorks Drivers API Reference, 6.6
vxbIoApicIntrDataShow( )
ERRNO
vxbIoApicIntrDataShow( )
NAME vxbIoApicIntrDataShow( ) – show IO APIC register data acquired by vxBus
RETURNS N/A
vxbIoApicIntrDrvRegister( )
NAME vxbIoApicIntrDrvRegister( ) – register ioApic driver
DESCRIPTION This routine registers the ioApic driver with the vxBus subsystem.
RETURNS N/A
ERRNO
588
2 Routines
vxbLibInit( )
vxbIoApicIntrShowAll( )
2
NAME vxbIoApicIntrShowAll( ) – show All IO APIC registers
RETURNS N/A
vxbLibError( )
NAME vxbLibError( ) – handle error conditions
ERRNO
vxbLibInit( )
NAME vxbLibInit( ) – initialize vxBus library
589
VxWorks Drivers API Reference, 6.6
vxbLoApicIntrDrvRegister( )
ERRNO
vxbLoApicIntrDrvRegister( )
NAME vxbLoApicIntrDrvRegister( ) – register loApic driver
DESCRIPTION This routine registers the loApic driver with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbLoApicIntrShow( )
NAME vxbLoApicIntrShow( ) – show Local APIC registers
590
2 Routines
vxbLoApicIpiDisable( )
vxbLoApicIpiConnect( )
2
NAME vxbLoApicIpiConnect( ) – Connect ISR to specified IPI
DESCRIPTION This function connects the specified ISR and argument to the specified
IPI.
FIXME
vxbLoApicIpiDisable( )
NAME vxbLoApicIpiDisable( ) – Disable specified IPI
591
VxWorks Drivers API Reference, 6.6
vxbLoApicIpiDisconn( )
vxbLoApicIpiDisconn( )
NAME vxbLoApicIpiDisconn( ) – Disconnect ISR from specified IPI
vxbLoApicIpiEnable( )
NAME vxbLoApicIpiEnable( ) – Enable ISR for specified IPI
592
2 Routines
vxbLoApicIpiPrioGet( )
vxbLoApicIpiGen( )
NAME vxbLoApicIpiGen( ) – Generate specified IPI
vxbLoApicIpiPrioGet( )
NAME vxbLoApicIpiPrioGet( ) – Find priority of specified IPI
593
VxWorks Drivers API Reference, 6.6
vxbLoApicIpiPrioSet( )
vxbLoApicIpiPrioSet( )
NAME vxbLoApicIpiPrioSet( ) – Set priority of specified IPI
DESCRIPTION This function is not implemented for IA32 architecture. The IPI priority
is determined by the ipiID used, and cannot be set after the IPI has
been connected.
vxbLoApicStatusShow( )
NAME vxbLoApicStatusShow( ) – show Local APIC TMR, IRR, ISR registers
594
2 Routines
vxbLockGive( )
int verboseLevel
)
2
DESCRIPTION This routine shows Local APIC TMR, IRR, ISR registers
vxbLoApicTimerDrvRegister( )
NAME vxbLoApicTimerDrvRegister( ) – register loApic timer driver
DESCRIPTION This routine registers the loApic timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbLockGive( )
NAME vxbLockGive( ) – release a VxBus lock
DESCRIPTION none
595
VxWorks Drivers API Reference, 6.6
vxbLockInit( )
vxbLockInit( )
NAME vxbLockInit( ) – initialize a VxBus lock
DESCRIPTION none
vxbLockTake( )
NAME vxbLockTake( ) – take a VxBus lock
DESCRIPTION none
596
2 Routines
vxbMipsCavIntCtlrRegister( )
vxbMalRegister( )
2
NAME vxbMalRegister( ) – register the vxbMalDma driver
DESCRIPTION This routine registers the vxbMalDma driver with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbMc146818RtcDrvRegister( )
NAME vxbMc146818RtcDrvRegister( ) – registers the driver for MC146818 RTC
DESCRIPTION This routine registers the driver for MC146818 Real Time Clock with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbMipsCavIntCtlrRegister( )
NAME vxbMipsCavIntCtlrRegister( ) – register the mipsIntCtlr driver
DESCRIPTION This routine registers the Cavium interrupt controller driver and device recognition data
with the vxBus subsystem.
RETURNS N/A
597
VxWorks Drivers API Reference, 6.6
vxbMipsIntCtlrRegister( )
ERRNO
vxbMipsIntCtlrRegister( )
NAME vxbMipsIntCtlrRegister( ) – register the mips cpu driver
DESCRIPTION This routine registers the mips Core driver and device recognition data with the vxBus
subsystem.
RETURNS N/A
ERRNO N/A
vxbMipsSbIntCtlrRegister( )
NAME vxbMipsSbIntCtlrRegister( ) – register the mipsIntCtlr driver
DESCRIPTION This routine registers the SB interrupt controller driver and device recognition data with
the vxBus subsystem.
RETURNS N/A
ERRNO
598
2 Routines
vxbMpApicpDrvCtrlShow( )
vxbMpApicDataShow( )
2
NAME vxbMpApicDataShow( ) – show MP Configuration Data acquired by vxBus
RETURNS N/A
vxbMpApicDrvRegister( )
NAME vxbMpApicDrvRegister( ) – register mpApic driver
DESCRIPTION This routine registers the mpApic driver with the vxBus subsystem.
RETURNS N/A
ERRNO
vxbMpApicpDrvCtrlShow( )
NAME vxbMpApicpDrvCtrlShow( ) – show pDrvCtrl for template controller
599
VxWorks Drivers API Reference, 6.6
vxbMpBiosIoIntMapShow( )
(
VXB_DEVICE_ID pInst
)
DESCRIPTION none
vxbMpBiosIoIntMapShow( )
NAME vxbMpBiosIoIntMapShow( ) – show MP IO interrupt mapping
DESCRIPTION This routine shows MP configuration for BIOS I/O Interrupt Configuration Table.
RETURNS N/A
vxbMpBiosLocalIntMapShow( )
NAME vxbMpBiosLocalIntMapShow( ) – show MP local interrupt mapping
DESCRIPTION This routine shows MP configuration for BIOS Local Interrupt Configuration Table.
RETURNS N/A
600
2 Routines
vxbMsiConnect( )
vxbMpBiosShow( )
2
NAME vxbMpBiosShow( ) – show MP configuration table
RETURNS N/A
vxbMsDelay( )
NAME vxbMsDelay( ) – delay for delayTime milliseconds
RETURNS N/A.
vxbMsiConnect( )
NAME vxbMsiConnect( ) – calls vxbIntDynaConnect if available
601
VxWorks Drivers API Reference, 6.6
vxbNextUnitGet( )
DESCRIPTION none
vxbNextUnitGet( )
NAME vxbNextUnitGet( ) – get the next available unit number for a driver
DESCRIPTION This routine searches the instances associated with a given driver and finds the next
available free unit number for a new device. The search starts at unit zero and works up
until an unused unit number is found.
This is a convenience function for drivers where simply using a monitomically increasing
unit number would be unsuitable, such as for pluggable devices where instances are
constantly being created and destroyed.
RETURNS OK or ERROR
ERRNO
vxbPciAccessCopy( )
NAME vxbPciAccessCopy( ) – copy access function pointers
602
2 Routines
vxbPciAutoBusNumberSet( )
(
struct vxbAccessList *pAccess
)
2
DESCRIPTION This routine copies the access function pointers.
RETURNS N/A
ERRNO
vxbPciAutoAddrAlign( )
NAME vxbPciAutoAddrAlign( ) – align a PCI address and check boundary conditions
ERRNO
vxbPciAutoBusNumberSet( )
NAME vxbPciAutoBusNumberSet( ) – set the primary, secondary, and subordinate bus number
603
VxWorks Drivers API Reference, 6.6
vxbPciAutoCardBusConfig( )
DESCRIPTION This routine sets the primary, secondary, and subordinate bus numbers for a device that
implements the Type 1 PCI Configuration Space Header.
This routine has external visibility to enable it to be used by BSP Developers for initialization
of PCI Host Bridges that may implement registers similar to those found in the Type 1
Header.
ERRNO
vxbPciAutoCardBusConfig( )
NAME vxbPciAutoCardBusConfig( ) – set mem and I/O registers for a single PCI-Cardbus bridge
DESCRIPTION This routine sets up memory and I/O base/limit registers for an individual PCI-Cardbus
bridge.
Cardbus bridges have four windows - 2 memory windows and 2 IO windows. The 2
memory windows can be setup individually for either prefetchable or non-prefetchable
memory accesses.
Since PC Cards can be inserted at any time, and are not necessarily present when this code
is run, the code does not probe any further after encountering a Cardbus bridge. Instead, the
code allocates default window sizes for the Cardbus bridge. Three windows are used:
Warning: do not sort the include function list before this routine is called. This routine
requires each function in the list to be in the same order as the probe occurred.
RETURNS N/A
604
2 Routines
vxbPciAutoCfg( )
ERRNO
vxbPciAutoCfg( )
NAME vxbPciAutoCfg( ) – Automatically configure all nonexcluded PCI headers
CALLING SEQUENCE
pCookie = vxbPciAutoConfigLibInit(NULL);
vxbPciAutoCfgCtl(pCookie, COMMAND, VALUE);
...
vxbPciAutoCfgCtl(pCookie, COMMAND, VALUE);
vxbPciAutoCfg(pCookie);
For ease in converting from the old interface to the new one, a vxbPciAutoCfgCtl( )
command PCI_PSYSTEM_STRUCT_COPY has been implemented. This can be used just like
any other vxbPciAutoCfgCtl( ) command, and it initializes all the values in pSystem. If
used, it should be the first call to vxbPciAutoCfgCtl( ).
For a description of the COMMANDs and VALUEs to vxbPciAutoCfgCtl( ), see the
vxbPciAutoCfgCtl( ) documentation.
For all nonexcluded PCI functions on all PCI bridges, this routine automatically configures
the PCI configuration headers for PCI devices and subbridges. The fields that are
programmed are:
1. Status register.
2. Command Register.
3. Latency timer.
4. Cache Line size.
5. Memory and/or I/O base address and limit registers.
6. Primary, secondary, subordinate bus number (for PCI-PCI bridges).
7. Expansion ROM disable.
8. Interrupt Line.
605
VxWorks Drivers API Reference, 6.6
vxbPciAutoCfgCtl( )
ALGORITHM Probe PCI config space and create a list of available PCI functions. Call device exclusion
function, if registered, to exclude/include device. Disable all devices before we initialize
any. Allocate and assign PCI space to each device. Calculate and set interrupt line value.
Initialize and enable each device.
RETURNS N/A
ERRNO
vxbPciAutoCfgCtl( )
NAME vxbPciAutoCfgCtl( ) – set or get vxbPciAutoConfigLib options
DESCRIPTION vxbPciAutoCfgCtl( ) can be considered analogous to ioctl( ) calls: the call takes arguments
of (1) a pCookie, returned by vxbPciAutoConfigLibInit( ). (2) A command, macros for
which are defined in vxbPciAutoConfigLib.h. And, (3) an argument, the type of which
depends on the specific command, but will always fit in a pointer variable. Currently, only
globally effective commands are implemented.
The commands available are:
PCI_FBB_ENABLE - BOOL * pArg
PCI_FBB_DISABLE - void
PCI_FBB_UPDATE - BOOL * pArg
PCI_FBB_STATUS_GET - BOOL * pArg
Enable and disable the functions which check Fast Back To Back functionality.
PCI_FBB_UPDATE is for use with dynamic/HA applications. It first disables FBB on all
functions, then enables FBB on all functions, if appropriate. In HA applications, it
should be called any time a card is added or removed. The BOOL pointed to by pArg
for PCI_FBB_ENABLE and PCI_FBB_UPDATE is set to TRUE if all cards allow FBB
functionality and FALSE if either any card does not allow FBB functionality or if FBB is
disabled. The BOOL pointed to by pArg for PCI_FBB_STATUS_GET is set to TRUE if
PCI_FBB_ENABLE has been called and FBB is enabled, even if FBB is not activated on
any card. It is set to FALSE otherwise.
606
2 Routines
vxbPciAutoCfgCtl( )
NOTE: In the current implementation, FBB is enabled or disabled on the entire bus. If
any device anywhere on the bus cannot support FBB, then it is not enabled, even if
specific sub-busses could support it. 2
PCI_MAX_LATENCY_FUNC_SET - FUNCPTR * pArg
This routine is called for each function present on the bus when discovery takes place.
The routine must accept four arguments, specifying bus, device, function, and a
user-supplied argument of type void *. See PCI_MAX_LATENCY_ARG_SET. The
routine should return a UINT8 value, which will be put into the MAX_LAT field of the
header structure. The user supplied routine must return a valid value each time it is
called. There is no mechanism for any ERROR condition, but a default value can be
returned in such a case. Default = NULL.
PCI_MAX_LATENCY_ARG_SET - void * pArg
When the routine specified in PCI_MAX_LATENCY_FUNC_SET is called, this will be
passed to it as the fourth argument.
PCI_MAX_LAT_ALL_SET - int pArg
Specifies a constant max latency value for all cards, if no function has been specified
with PCI_MAX_LATENCY_FUNC_SET..
PCI_MAX_LAT_ALL_GET - UINT * pArg
Retrieves the value of max latency for all cards, if no function has been specified with
PCI_MAX_LATENCY_FUNC_SET. Otherwise, the integer pointed to by pArg is set to the
value 0xffffffff.
PCI_MSG_LOG_SET - FUNCPTR * pArg
The argument specifies a routine which is called to print warning or error messages
from vxbPciAutoConfigLib if logMsg( ) has not been initialized at the time
vxbPciAutoConfigLib is used. The specified routine must accept arguments in the
same format as logMsg( ), but it does not necessarily need to print the actual message.
An example of this routine is presented below, which saves the message into a safe
memory space and turns on an LED. This command is useful for BSPs which call
vxbPciAutoCfg( ) before message logging is enabled. Note that after logMsg( ) is
configured, output goes to logMsg( ) even if this command has been called. Default =
NULL.
/* sample PCI_MSG_LOG_SET function */
int pciLogMsg(char *fmt,int a1,int a2,int a3,int a4,int a5,int a6)
{
int charsPrinted;
sysLedOn(4);
charsPrinted = sprintf (sysExcMsg, fmt, a1, a2, a3, a4, a5, a6);
sysExcMsg += charsPrinted;
return (charsPrinted);
}
PCI_MAX_BUS_GET - int * pArg
During autoconfiguration, the library maintains a counter with the highest numbered
bus. This can be retrieved by
607
VxWorks Drivers API Reference, 6.6
vxbPciAutoCfgCtl( )
608
2 Routines
vxbPciAutoCfgCtl( )
609
VxWorks Drivers API Reference, 6.6
vxbPciAutoCfgCtl( )
specifies which of the four PCI Interrupt request lines available are connected. The
function prototype for this function is shown below:
UCHAR sysPciAutoconfigIntrAssign
(
PCI_AUTO_CONFIG_OPTS *pSys,
PCI_LOC *pLoc,
UCHAR pin
);
This routine may use any combination of these data to ascertain the interrupt level.
This value is returned from the function, and is programmed into the interrupt line
register of the function's PCI configuration header. In this manner, device drivers may
subsequently read this register in order to calculate the appropriate interrupt vector
which to attach an interrupt service routine.
PCI_BRIDGE_PRE_CONFIG_FUNC_SET - FUNCPTR * pArg
The bridge pre-configuration pass initialization routine is provided so that the BSP
Developer can initialize a bridge device prior to the configuration pass on the bus that
the bridge implements. This routine is specified by calling vxbPciAutoCfgCtl( ) with
the PCI_BRIDGE_PRE_CONFIG_FUNC_SET command:
vxbPciAutoCfgCtl(pCookie, PCI_BRIDGE_PRE_CONFIG_FUNC_SET,
sysPciAutoconfigPreEnumBridgeInit);
This optional user-specified routine takes as input both the bus-device-function tuple,
and a 32-bit quantity containing both the PCI deviceID and vendorID of the device. The
function prototype for this function is shown below:
STATUS sysPciAutoconfigPreEnumBridgeInit
(
PCI_AUTO_CONFIG_OPTS *pSys,
PCI_LOC *pLoc,
UINT devVend
);
This routine may use any combination of these input data to ascertain any special
initialization requirements of a particular type of bridge at a specified geographic
location.
PCI_BRIDGE_POST_CONFIG_FUNC_SET - FUNCPTR * pArg
The bridge post-configuration pass initialization routine is provided so that the BSP
Developer can initialize the bridge device after the bus that the bridge implements has
been enumerated. This routine is specified by calling vxbPciAutoCfgCtl( ) with the
PCI_BRIDGE_POST_CONFIG_FUNC_SET command
vxbPciAutoCfgCtl(pCookie, PCI_BRIDGE_POST_CONFIG_FUNC_SET,
sysPciAutoconfigPostEnumBridgeInit);
This optional user-specified routine takes as input both the bus-device-function tuple,
and a 32-bit quantity containing both the PCI deviceID and vendorID of the device. The
function prototype for this function is shown below:
STATUS sysPciAutoconfigPostEnumBridgeInit
610
2 Routines
vxbPciAutoCfgCtl( )
(
PCI_AUTO_CONFIG_OPTS *pSys,
PCI_LOC *pLoc,
UINT devVend 2
);
This routine may use any combination of these input data to ascertain any special
initialization requirements of a particular type of bridge at a specified geographic
location.
PCI_ROLLCALL_FUNC_SET - FUNCPTR * pArg
The specified routine will be configured as a roll call routine.
If a roll call routine has been configured, before any configuration is actually done, the
roll call routine is called repeatedly until it returns TRUE. A return value of TRUE
indicates that either (1) the specified number and type of devices named in the roll call
list have been found during PCI bus enumeration or (2) the timeout has expired
without finding all of the specified number and type of devices. In either case, it is
assumed that all of the PCI devices which are going to appear on the busses have
appeared and we can proceed with PCI bus configuration.
PCI_TEMP_SPACE_SET - char * pArg
This command is not currently implemented. It allows the user to set aside memory for
use during vxbPciAutoConfigLib execution, e.g. memory set aside using
USER_RESERVED_MEM. After PCI configuration has been completed, the memory can
be added to the system memory pool using memAddToPool( ).
PCI_MINIMIZE_RESOURCES
This command is not currently implemented. It specifies that vxbPciAutoConfigLib
minimize requirements for memory and I/O space.
PCI_PSYSTEM_STRUCT_COPY - PCI_AUTO_CONFIG_OPTS * pArg
This command has been added for ease of converting from the old interface to the new
one. This will set each value as specified in the pSystem structure. If the
PCI_AUTO_CONFIG_OPTS structure has already been filled, the
vxbPciAutoConfig(pSystem) call can be changed to:
void *pCookie;
pCookie = vxbPciAutoConfigLibInit(NULL);
vxbPciAutoCfgCtl(pCookie, PCI_PSYSTEM_STRUCT_COPY, (void *)pSystem);
vxbPciAutoCfgFunc(pCookie);
The fields of the PCI_AUTO_CONFIG_OPTS structure are defined below. For more
information about each one, see the paragraphs above and the documentation for
vxbPciAutoConfigLib.
pciMem32
Specifies the 32-bit prefetchable memory pool base address.
pciMem32Size
Specifies the 32-bit prefetchable memory pool size.
611
VxWorks Drivers API Reference, 6.6
vxbPciAutoConfig( )
pciMemIo32
Specifies the 32-bit non-prefetchable memory pool base address.
pciMemIo32Size
Specifies the 32-bit non-prefetchable memory pool size
pciIo32
Specifies the 32-bit I/O pool base address.
pciIo32Size
Specifies the 32-bit I/O pool size.
pciIo16
Specifies the 16-bit I/O pool base address.
pciIo16Size
Specifies the 16-bit I/O pool size.
includeRtn
Specifies the device inclusion routine.
intAssignRtn
Specifies the interrupt assignment routine.
autoIntRouting
Can be set to TRUE to configure vxbPciAutoConfig( ) only to call the BSP interrupt
routing routine for devices on bus number 0. Setting autoIntRoutine to FALSE will
configure vxbPciAutoConfig( ) to call the BSP interrupt routing routine for every
device regardless of the bus on which the device resides.
ERRNO EINVAL
if pCookie is not NULL or cmd is not recognized
vxbPciAutoConfig( )
NAME vxbPciAutoConfig( ) – set standard parameters & initialize PCI
612
2 Routines
vxbPciAutoConfigListShow( )
vxbPciAutoConfigLibInit( )
NAME vxbPciAutoConfigLibInit( ) – initialize PCI autoconfig library
ERRNO
vxbPciAutoConfigListShow( )
NAME vxbPciAutoConfigListShow( ) – show the devices in the list
DESCRIPTION This routine shows the devices which are available in the list.
613
VxWorks Drivers API Reference, 6.6
vxbPciAutoDevReset( )
ERRNO
vxbPciAutoDevReset( )
NAME vxbPciAutoDevReset( ) – quiesce a PCI device and reset all writeable status bits
DESCRIPTION This routine turns off a PCI device by disabling the Memory decoders, I/O decoders, and
Bus Master capability. The routine also resets all writeable status bits in the status word that
follows the command word sequentially in PCI config space by performing a longword
access.
ERRNO
vxbPciAutoFuncDisable( )
NAME vxbPciAutoFuncDisable( ) – disable a specific PCI function
DESCRIPTION This routine clears the I/O, mem, master, & ROM space enable bits for a single PCI function.
614
2 Routines
vxbPciAutoGetNextClass( )
The PCI spec says that devices should normally clear these by default after reset but in
actual practice, some PCI devices do not fully comply. This routine ensures that the devices
have all been disabled before configuration is started. 2
RETURNS N/A
ERRNO
vxbPciAutoFuncEnable( )
NAME vxbPciAutoFuncEnable( ) – perform final configuration and enable a function
DESCRIPTION Depending upon whether the device is included, this routine initializes a single PCI
function as follows:
Initialize the cache line size register Initialize the PCI-PCI bridge latency timers Enable the
master PCI bit for non-display devices Set the interrupt line value with the value from the
BSP.
RETURNS N/A
ERRNO
vxbPciAutoGetNextClass( )
NAME vxbPciAutoGetNextClass( ) – find the next device of specific type from probe list
615
VxWorks Drivers API Reference, 6.6
vxbPciAutoRegConfig( )
DESCRIPTION The function uses the probe list which was built during the probing process. Using
configuration accesses, it searches for the occurrence of the device subject to the class and
mask restrictions outlined below. Setting class to zero and mask to zero allows searching
the entire set of devices found regardless of class.
ERRNO
vxbPciAutoRegConfig( )
NAME vxbPciAutoRegConfig( ) – assign PCI space to a single PCI base address register
DESCRIPTION This routine allocates and assigns PCI space (either memory or I/O) to a single PCI base
address register.
RETURNS Returns (1) if BAR supports mapping anywhere in 64-bit address space. Returns (0)
otherwise.
ERRNO
616
2 Routines
vxbPciConfigCmdWordShow( )
vxbPciBusTypeInit( )
2
NAME vxbPciBusTypeInit( ) – initialize the PCI bus type
DESCRIPTION none
ERRNO
vxbPciConfigBdfPack( )
NAME vxbPciConfigBdfPack( ) – pack parameters for the Configuration Address Register
DESCRIPTION This routine packs three parameters into one integer for accessing the Configuration
Address Register
RETURNS packed integer encoded version of bus, device, and function numbers.
ERRNO
vxbPciConfigCmdWordShow( )
NAME vxbPciConfigCmdWordShow( ) – show the decoded value of the command word
617
VxWorks Drivers API Reference, 6.6
vxbPciConfigExtCapFind( )
DESCRIPTION This routine reads the value of the command word for the specified bus, device, function
and displays the information.
ERRNO
vxbPciConfigExtCapFind( )
NAME vxbPciConfigExtCapFind( ) – find extended capability in ECP linked list
DESCRIPTION This routine searches for an extended capability in the linked list of capabilities in config
space. If found, the offset of the first byte of the capability of interest in config space is
returned via pOffset.
ERRNO
618
2 Routines
vxbPciConfigFuncShow( )
vxbPciConfigForeachFunc( )
2
NAME vxbPciConfigForeachFunc( ) – check condition on specified bus
DESCRIPTION vxbPciConfigForeachFunc( ) discovers the PCI functions present on the bus and calls a
specified C-function for each one. If the function returns ERROR, further processing stops.
vxbPciConfigForeachFunc( ) does not affect any HOST-PCI bridge on the system.
vxbPciConfigFuncShow( )
NAME vxbPciConfigFuncShow( ) – show configuration details about a function
DESCRIPTION This routine reads various information from the specified bus, device, function, and
displays the information.
619
VxWorks Drivers API Reference, 6.6
vxbPciConfigInByte( )
ERRNO
vxbPciConfigInByte( )
NAME vxbPciConfigInByte( ) – read one byte from the PCI configuration space
DESCRIPTION This routine reads one byte from the PCI configuration space
ERRNO
vxbPciConfigInLong( )
NAME vxbPciConfigInLong( ) – read one longword from the PCI configuration space
DESCRIPTION This routine reads one longword from the PCI configuration space
620
2 Routines
vxbPciConfigModifyByte( )
ERRNO 2
SEE ALSO vxbPci
vxbPciConfigInWord( )
NAME vxbPciConfigInWord( ) – read one word from the PCI configuration space
DESCRIPTION This routine reads one word from the PCI configuration space
ERRNO
vxbPciConfigModifyByte( )
NAME vxbPciConfigModifyByte( ) – Perform a masked longword register update
621
VxWorks Drivers API Reference, 6.6
vxbPciConfigModifyLong( )
DESCRIPTION This function writes a field into a PCI configuration header without altering any bits not
present in the field. It does this by first doing a PCI configuration read (into a temporary
location) of the PCI configuration header word which contains the field to be altered. It then
alters the bits in the temporary location to match the desired value of the field. It then writes
back the temporary location with a configuration write. All configuration accesses are long
and the field to alter is specified by the "1" bits in the bitMask parameter.
Do not use this routine to modify any register that contains 'write 1 to clear' type of status
bits in the same longword. This specifically applies to the command register. Modify byte
operations could potentially be implemented as longword operations with bit shifting and
masking. This could have the effect of clearing status bits in registers that aren't being
updated. Use vxbPciConfigInLong and vxbPciConfigOutLong, or pciModifyLong, to read
and update the entire longword.
ERRNO
vxbPciConfigModifyLong( )
NAME vxbPciConfigModifyLong( ) – Perform a masked longword register update
DESCRIPTION This function writes a field into a PCI configuration header without altering any bits not
present in the field. It does this by first doing a PCI configuration read (into a temporary
location) of the PCI configuration header word which contains the field to be altered. It then
alters the bits in the temporary location to match the desired value of the field. It then writes
back the temporary location with a configuration write. All configuration accesses are long
and the field to alter is specified by the "1" bits in the bitMask parameter.
Be careful to using vxbPciConfigModifyLong for updating the Command and status
register. The status bits must be written back as zeroes, else they will be cleared. Proper use
622
2 Routines
vxbPciConfigModifyWord( )
involves including the status bits in the mask value, but setting their value to zero in the data
value.
The following example will set the PCI_CMD_IO_ENABLE bit without clearing any status 2
bits. The macro PCI_CMD_MASK includes all the status bits as part of the mask. The fact
that PCI_CMD_MASTER doesn't include these bits, causes them to be written back as zeroes,
therefore they aren't cleared.
vxbPciConfigModifyLong (b,d,f,PCI_CFG_COMMAND,
(PCI_CMD_MASK | PCI_CMD_IO_ENABLE), PCI_CMD_IO_ENABLE);
Use of explicit longword read and write operations for dealing with any register containing
"write 1 to clear" bits is sound policy.
ERRNO
vxbPciConfigModifyWord( )
NAME vxbPciConfigModifyWord( ) – Perform a masked longword register update
DESCRIPTION This function writes a field into a PCI configuration header without altering any bits not
present in the field. It does this by first doing a PCI configuration read (into a temporary
location) of the PCI configuration header word which contains the field to be altered. It then
alters the bits in the temporary location to match the desired value of the field. It then writes
back the temporary location with a configuration write. All configuration accesses are long
and the field to alter is specified by the "1" bits in the bitMask parameter.
Do not use this routine to modify any register that contains 'write 1 to clear' type of status
bits in the same longword. This specifically applies to the command register. Modify byte
operations could potentially be implemented as longword operations with bit shifting and
masking. This could have the effect of clearing status bits in registers that aren't being
623
VxWorks Drivers API Reference, 6.6
vxbPciConfigOutByte( )
ERRNO
vxbPciConfigOutByte( )
NAME vxbPciConfigOutByte( ) – write one byte to the PCI configuration space
DESCRIPTION This routine writes one byte to the PCI configuration space.
ERRNO
vxbPciConfigOutLong( )
NAME vxbPciConfigOutLong( ) – write one longword to the PCI configuration space
624
2 Routines
vxbPciConfigReset( )
ERRNO
vxbPciConfigOutWord( )
NAME vxbPciConfigOutWord( ) – write one 16-bit word to the PCI configuration space
DESCRIPTION This routine writes one 16-bit word to the PCI configuration space.
ERRNO
vxbPciConfigReset( )
NAME vxbPciConfigReset( ) – disable cards for warm boot
625
VxWorks Drivers API Reference, 6.6
vxbPciConfigStatusWordShow( )
DESCRIPTION vxbPciConfigReset( ) goes through the list of PCI functions at the top-level bus and disables
them, preventing them from writing to memory while the system is trying to reboot.
vxbPciConfigStatusWordShow( )
NAME vxbPciConfigStatusWordShow( ) – show the decoded value of the status word
DESCRIPTION This routine reads the value of the status word for the specified bus, device, function and
displays the information.
ERRNO
vxbPciConfigTopoShow( )
NAME vxbPciConfigTopoShow( ) – show PCI topology
626
2 Routines
vxbPciDevConfig( )
DESCRIPTION This routine traverses the PCI bus and prints assorted information about every device
found. The information is intended to present the topology of the PCI bus. In includes: (1)
the device type, (2) the command and status words, (3) for PCI to PCI bridges the memory 2
and I/O space configuration, and (4) the values of all implemented BARs.
RETURNS N/A
ERRNO
vxbPciDevConfig( )
NAME vxbPciDevConfig( ) – configure a device on a PCI bus
DESCRIPTION This routine configures a device that is on a Peripheral Component Interconnect (PCI) bus
by writing to the configuration header of the selected device.
It first disables the device by clearing the command register in the configuration header. It
then sets the I/O and/or memory space base address registers, the latency timer value and
the cache line size. Finally, it re-enables the device by loading the command register with
the specified command.
NOTE This routine is designed for Type 0 PCI Configuration Headers ONLY. It is NOT usable for
configuring, for example, a PCI-to-PCI bridge.
RETURNS OK always.
ERRNO
627
VxWorks Drivers API Reference, 6.6
vxbPciDeviceAnnounce( )
vxbPciDeviceAnnounce( )
NAME vxbPciDeviceAnnounce( ) – Update vxBus to PCI bus orphans
DESCRIPTION none
RETURNS OK
ERRNO
vxbPciDeviceShow( )
NAME vxbPciDeviceShow( ) – print information about PCI devices
DESCRIPTION This routine prints information about the PCI devices on a given PCI bus segment (specified
by busNo).
ERRNO
vxbPciFindClass( )
NAME vxbPciFindClass( ) – find the nth occurrence of a device by PCI class code.
628
2 Routines
vxbPciFindClassShow( )
DESCRIPTION This routine finds the nth device with the given 24-bit PCI class code (class subclass prog_if).
The classcode arg of must be carefully constructed from class and sub-class macros.
Example : To find an ethernet class device, construct the classcode arg as follows:
((PCI_CLASS_NETWORK_CTLR << 16 | PCI_SUBCLASS_NET_ETHERNET << 8))
ERRNO
vxbPciFindClassShow( )
NAME vxbPciFindClassShow( ) – find a device by 24-bit class code
DESCRIPTION This routine finds a device by its 24-bit PCI class code, then prints its information.
ERRNO
629
VxWorks Drivers API Reference, 6.6
vxbPciFindDevice( )
vxbPciFindDevice( )
NAME vxbPciFindDevice( ) – find the nth device with the given device & vendor ID
DESCRIPTION This routine finds the nth device with the given device & vendor ID.
ERRNO
vxbPciFindDeviceShow( )
NAME vxbPciFindDeviceShow( ) – find a PCI device and display the information
DESCRIPTION This routine finds a device by deviceId, then displays the information.
ERRNO
630
2 Routines
vxbPciInt( )
vxbPciHeaderShow( )
2
NAME vxbPciHeaderShow( ) – print a header of the specified PCI device
DESCRIPTION This routine prints a header of the PCI device specified by busNo, deviceNo, and funcNo.
ERRNO
vxbPciInt( )
NAME vxbPciInt( ) – interrupt handler for shared PCI interrupt.
DESCRIPTION This routine executes multiple interrupt handlers for a PCI interrupt. Each interrupt handler
must check the device dependent interrupt status bit to determine the source of the
interrupt, since it simply execute all interrupt handlers in the link list.
This is not a user callable routine
RETURNS N/A
ERRNO
631
VxWorks Drivers API Reference, 6.6
vxbPciIntConnect( )
vxbPciIntConnect( )
NAME vxbPciIntConnect( ) – connect the interrupt handler to the PCI interrupt.
DESCRIPTION This routine connects an interrupt handler to a shared PCI interrupt vector. A link list is
created for each shared interrupt used in the system. It is created when the first interrupt
handler is attached to the vector. Subsequent calls to vxbPciIntConnect just add their
routines to the linked list for that vector.
ERRNO
vxbPciIntDisconnect( )
NAME vxbPciIntDisconnect( ) – disconnect the interrupt handler (OBSOLETE)
DESCRIPTION This routine disconnects the interrupt handler from the PCI interrupt line.
In a system where one driver and one ISR services multiple devices, this routine removes all
instances of the ISR because it completely ignores the parameter argument used to install
the handler.
NOTE Use of this routine is discouraged and will be obsoleted in the future. New code should use
the vxbPciIntDisconnect2( ) routine instead.
632
2 Routines
vxbPciIntLibInit( )
ERRNO
vxbPciIntDisconnect2( )
NAME vxbPciIntDisconnect2( ) – disconnect an interrupt handler from the PCI interrupt.
DESCRIPTION This routine disconnects a single instance of an interrupt handler from the PCI interrupt
line.
NOTE This routine should be used in preference to the original pciIntDisconnect( ) routine. This
routine is compatible with drivers that are managing multiple device instances, using the
same basic ISR, but with different parameters.
ERRNO
vxbPciIntLibInit( )
NAME vxbPciIntLibInit( ) – initialize the vxbPciIntLib module
DESCRIPTION This routine initializes the linked lists used to chain together the PCI interrupt service
routines.
633
VxWorks Drivers API Reference, 6.6
vxbPlbAccessCopy( )
ERRNO
vxbPlbAccessCopy( )
NAME vxbPlbAccessCopy( ) – copy the access data structure
DESCRIPTION This routine is used to copy the contents of the PLB access array onto the parameter
RETURNS N/A
ERRNO
vxbPresStructShow( )
NAME vxbPresStructShow( ) – Show bus information
RETURNS N/A
ERRNO
634
2 Routines
vxbQeIntCtlrpDrvCtrlShow( )
vxbPrimeCellSioRegister( )
2
NAME vxbPrimeCellSioRegister( ) – register vxbAmbaSio driver
DESCRIPTION This routine registers the vxbAmbaSio driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
vxbQeIntCtlrRegister( )
NAME vxbQeIntCtlrRegister( ) – register qeIntCtlr driver
DESCRIPTION This routine registers the EPCI driver and device recognition data with the vxBus
subsystem.
vxbQeIntCtlrpDrvCtrlShow( )
NAME vxbQeIntCtlrpDrvCtrlShow( ) – show pDrvCtrl for template controller
635
VxWorks Drivers API Reference, 6.6
vxbQuiccIntCtlrRegister( )
(
VXB_DEVICE_ID pIntCtlr,
int verboseLevel
)
DESCRIPTION none
vxbQuiccIntCtlrRegister( )
NAME vxbQuiccIntCtlrRegister( ) – register quiccIntCtlr driver
DESCRIPTION This routine registers the EPCI driver and device recognition data with the vxBus
subsystem.
vxbQuiccIntCtlrpDrvCtrlShow( )
NAME vxbQuiccIntCtlrpDrvCtrlShow( ) – show pDrvCtrl for template controller
DESCRIPTION none
636
2 Routines
vxbRapidIOBusTypeInit( )
vxbR4KTimerDrvRegister( )
NAME vxbR4KTimerDrvRegister( ) – register mips R4K timer driver
DESCRIPTION This routine registers the mips R4k timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO none
vxbRapidIOBusTypeInit( )
NAME vxbRapidIOBusTypeInit( ) – initialize RapidIO bus type
DESCRIPTION none
RETURNS N/A
637
VxWorks Drivers API Reference, 6.6
vxbRapidIOCfg( )
vxbRapidIOCfg( )
NAME vxbRapidIOCfg( ) – RapidIO Table-based device enumeration
RETURNS: none
vxbRapidIOTableOverride( )
NAME vxbRapidIOTableOverride( ) – RapidIO Table-based override function
DESCRIPTION This routine extracts entries from the hcfResources table and puts
then in the device identification information. Drivers may override
this function, but if they do so, they must perform this action, which
they can do by calling this function.
638
2 Routines
vxbRegMap( )
RETURNS: none
vxbRegMap( )
NAME vxbRegMap( ) – obtain an access handle for a given register mapping
DESCRIPTION This function returns a handle suitable for accessing a given BAR with the
vxbReadXX( )/vxbWriteXX( ) register access API. The handle is opaque to the caller, but is
used by the API to determine if the BAR is I/O mapped, memory mapped, or some special
case so that it can choose which access method to use.
The vxbRegMap( ) routine will first try to query the parent bus controller of a given device
to see if it has a custom mapping routine. If not, an attempt is made to return a reasonable
default handle value.
ERRNO N/A
639
VxWorks Drivers API Reference, 6.6
vxbResourceFind( )
vxbResourceFind( )
NAME vxbResourceFind( ) – find and allocate a vxBus resource
DESCRIPTION This routine searches for a vxBus resource to allocate. Resources are identified by a driver
method. The driver method, when called, must allocate and initialize the specified resource,
fill in the appropriate fields in the structure pointed to by the pArg variable, and return OK.
The flags are currently ignored. The flags field is present for a future enhancement to allow
different behaviors:
1) Check only PLB 2) Check only bus on which device resides 3) Check all devices if none
found on direct path
ERRNO
vxbSb1DuartSioRegister( )
NAME vxbSb1DuartSioRegister( ) – register vxbSb1DuartSio driver
DESCRIPTION This routine registers the vxbSb1DuartSio driver and device recognition data with the
vxBus subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
640
2 Routines
vxbSmcFdc37xRegister( )
ERRNO
vxbSb1TimerDrvRegister( )
NAME vxbSb1TimerDrvRegister( ) – register sb1 timer driver
DESCRIPTION This routine registers the sb1 timer driver with the vxBus subsystem.
RETURNS N/A
ERRNO none
vxbSmcFdc37xRegister( )
NAME vxbSmcFdc37xRegister( ) – register smcFdc37x driver
DESCRIPTION This routine registers the smcFdc37x driver and device recognition data with the vxBus
subsystem.
NOTE This routine is called early during system initialization, and *MUST NOT* make calls to OS
facilities such as memory allocation and I/O.
RETURNS N/A
ERRNO
641
VxWorks Drivers API Reference, 6.6
vxbSubDevAction( )
vxbSubDevAction( )
NAME vxbSubDevAction( ) – perform an action on all devs on bus controller
DESCRIPTION This routine performs the specified action (that is, calls the specified function) for each
device directly connected to the bus downstream from the specified bus controller.
ERRNO
vxbSysClkLibInit( )
NAME vxbSysClkLibInit( ) – initialize the system clock library
DESCRIPTION This routine initializes the system clock library by selecting the timer which is best suited
for use as system clock from the timers available in the system.
RETURNS OK or ERROR.
vxbSysClkShow( )
NAME vxbSysClkShow( ) – show the system clock information
642
2 Routines
vxbSysQeIntEnable( )
RETURNS None.
vxbSysQeIntDisable( )
NAME vxbSysQeIntDisable( ) – Disable one of the Level or IRQ interrupts into the SIU
DESCRIPTION This routine will mask the bit in the SIMASK register corresponding to the requested
interrupt level.
RETURNS 0, always.
vxbSysQeIntEnable( )
NAME vxbSysQeIntEnable( ) – enable the indicated interrupt
DESCRIPTION This routine will enable the indicated interrupt by setting the appropriate bit in the SIU
Interrupt Mask Registers.
The design of the 8260 presents the following design requirements:
643
VxWorks Drivers API Reference, 6.6
vxbSysQuiccInit( )
1. the mapping from interrupt number to mask bit can not be represented by
a function. An array, indexed by interrupt number (QE_INUM), is used to map
the interrupt number to the appropriate mask.
2. There are two 32 bit mask registers (CIMR and CRIMR). The interrupt
number must be compared to 4 ranges to determine which register contains
its mask bit:
interrupt number
in vxbQeIntCtlr.h register
---------------- -------
0-15 CIMR
16-31 CRIMR
32-47 CIMR
48-63 CRIMR
RETURNS 0, always.
vxbSysQuiccInit( )
NAME vxbSysQuiccInit( ) – initialize the interrupt manager for the PowerPC 83XX
RETURNS OK always
ERRNO
644
2 Routines
vxbSysQuiccIntEnable( )
vxbSysQuiccIntDisable( )
2
NAME vxbSysQuiccIntDisable( ) – Disable one of the Level or IRQ interrupts into the SIU
DESCRIPTION This routine will mask the bit in the SIMASK register corresponding to the requested
interrupt level.
RETURNS 0, always.
ERRNO
vxbSysQuiccIntEnable( )
NAME vxbSysQuiccIntEnable( ) – enable the indicated interrupt
DESCRIPTION This routine will enable the indicated interrupt by setting the appropriate bit in the SIU
Interrupt Mask Registers.
The design of the 83XX presents the following design requirements:
1. the mapping from interrupt number to mask bit can not be represented by
a function. An array, indexed by interrupt number (INUM), is used to map
the interrupt number to the appropriate mask.
2. There are two 32 bit mask registers (SIMR_L and SIMR_H). The interrupt
number must be compared to 4 ranges to determine which register contains
its mask bit:
interrupt number
in quiccIntrCtl.h register
---------------- -------
645
VxWorks Drivers API Reference, 6.6
vxbTimerAlloc( )
0-15 SIMR_L
16-31 SIMR_H
32-47 SIMR_L
48-63 SIMR_H
RETURNS 0, always.
vxbTimerAlloc( )
NAME vxbTimerAlloc( ) – allocate timer for the requested characteristics
DESCRIPTION This routine is used to allocate a timer which has the frequency and the features specified.
If a timer of the requested frequency is not available, the timer which has the minimum
frequency which is greater than minFreq and maximum frequency which is lesser than
maxFreq will be selected.
vxbTimerFeaturesGet( )
NAME vxbTimerFeaturesGet( ) – get the timer features
646
2 Routines
vxbTimerRelease( )
DESCRIPTION This routine is used to determine the minimum frequency, maximum frequency, and
features flags of the specified timer. Any of the pointer parameters may be set to NULL if
the information is not required.
vxbTimerLibInit( )
NAME vxbTimerLibInit( ) – initialize the timer library
DESCRIPTION This rountine initializes the timer library. Currently, this routine does nothing.
RETURNS N/A.
vxbTimerRelease( )
NAME vxbTimerRelease( ) – release the allocated timer
647
VxWorks Drivers API Reference, 6.6
vxbTimerStubInit( )
DESCRIPTION This routine is used to release a timer which was allocated earlier using vxbTimerAlloc.
RETURNS None
vxbTimerStubInit( )
NAME vxbTimerStubInit( ) – initialization function for the timer stub
DESCRIPTION This routine updates the _Delay and _us_Delay function pointers with sysDelay and
sysUsDelay () functions respectively.
RETURNS N/A.
vxbTimestampCookieGet( )
NAME vxbTimestampCookieGet( ) – to get the cookie information
DESCRIPTION This routine returns the timestamp cookie information. This function is only for test
purpose.
RETURNS pTimestampCookie
648
2 Routines
vxbTopoShow( )
vxbTimestampLibInit( )
2
NAME vxbTimestampLibInit( ) – initialize the timestamp library
DESCRIPTION This routine initializes the timestamp library by selecting the timer which is best suited for
use as timestamp timer from the timers available in the system.
RETURNS OK or ERROR.
vxbTimestampShow( )
NAME vxbTimestampShow( ) – show the timestamp information
RETURNS None.
vxbTopoShow( )
NAME vxbTopoShow( ) – Show bus topology
649
VxWorks Drivers API Reference, 6.6
vxbUpdateDeviceInfo( )
First, it shows the bus type for the top-level bus controller, then it recursively goes through
the devices on each bus, and shows some information about each one.
RETURNS N/A
ERRNO
vxbUpdateDeviceInfo( )
NAME vxbUpdateDeviceInfo( ) – Update vxBus device Information
DESCRIPTION This routine updates the vxbus information on the device, specifically BARs and interrupt
info.
RETURNS OK
ERRNO
vxbUsDelay( )
NAME vxbUsDelay( ) – delay for delayTime microseconds
RETURNS N/A.
650
2 Routines
vxbVxSimIntCtlrRegister( )
vxbVolRegWrite( )
NAME vxbVolRegWrite( ) – volatile register writes
DESCRIPTION This routine performs volatile register writes of the size specified in transactionSize.
ERRNO
vxbVxSimIntCtlrRegister( )
NAME vxbVxSimIntCtlrRegister( ) – register vxbVxSimIntCtlr driver
DESCRIPTION This routine registers the vxbVxSimIntCtlr driver and device recognition data with the
vxBus subsystem.
RETURNS N/A
ERRNO
651
VxWorks Drivers API Reference, 6.6
wancomEndDbg( )
wancomEndDbg( )
NAME wancomEndDbg( ) – Print pDrvCtrl information regarding Tx ring and Rx queue desc.
DESCRIPTION none
RETURNS N/A
wancomEndLoad( )
NAME wancomEndLoad( ) – initialize the driver and device
DESCRIPTION This routine initializes both, driver and device to an operational state using device specific
parameters specified by initString.
The parameter string, initString, is an ordered list of parameters each separated by a colon.
The format of initString is, "memBase:memSize:nCFDs:nRFDs:flags"
The GT642xx shares a region of memory with the driver. The caller of this routine can
specify the address of this memory region, or can specify that the driver must obtain this
memory region from the system resources.
A default number of transmit/receive frames of 32 can be selected by passing zero in the
parameters nTfds and nRfds. In other cases, the number of frames selected should be greater
than two.
The memBase parameter is used to inform the driver about the shared memory region. If this
parameter is set to the constant "NONE," then this routine will attempt to allocate the shared
memory from the system. Any other value for this parameter is interpreted by this routine
as the address of the shared memory region to be used. The memSize parameter is used to
652
2 Routines
wdbEndPktDevInit( )
check that this region is large enough with respect to the provided values of both
transmit/receive descriptors.
If the caller provides the shared memory region, then the driver assumes that this region 2
does not require cache coherency operations, nor does it require conversions between
virtual and physical addresses.
If the caller indicates that this routine must allocate the shared memory region, then this
routine will use cacheDmaMalloc( ) to obtain some non-cacheable memory.
The flags parameter is used to select if packet is copied to one buffer when CFDs are short
of multiple fragmented data sent through multiple CFDs and at least one CFD is available
which can be used to transfer the packet with copying the fragmented data to the buffer.
Setting the bit 0 enables this capability and requires 1536 bytes (depends on
WANCOM_BUF_DEF_SIZE defined in wancomEnd.h and _CACHE_ALIGN_SIZE defined
in architecture specific header file) per CFD from system memory.
SEE ALSO wancomEnd, ifLib, Marvell GT64240 Data Sheet, Marvell GT64260 Data Sheet, Marvell
GT64260 Errata
wdbEndPktDevInit( )
NAME wdbEndPktDevInit( ) – initialize an END packet device
DESCRIPTION This routine initializes an END packet device. It is typically called from configlette
wdbEnd.c when the WDB agent's lightweight END communication path
(INCLUDE_WDB_COMM_END) is selected.
RETURNS OK or ERROR
653
VxWorks Drivers API Reference, 6.6
wdbNetromPktDevInit( )
wdbNetromPktDevInit( )
NAME wdbNetromPktDevInit( ) – initialize a NETROM packet device for the WDB agent
DESCRIPTION This routine initializes a NETROM packet device. It is typically called from usrWdb.c when
the WDB agents NETROM communication path is selected. The dpBase parameter is the
address of NetROM's dualport RAM. The width parameter is the width of a word in ROM
space, and can be 1, 2, or 4 to select 8-bit, 16-bit, or 32-bit width respectivly (use the macro
WDB_NETROM_WIDTH in configAll.h for this parameter). The index parameter refers to
which byte of the ROM contains pod zero. The numAccess parameter should be set to the
number of accesses to POD zero that are required to read a byte. It is typically one, but some
boards actually read a word at a time. This routine spawns a task which polls the NetROM
for incomming packets every pollDelay clock ticks.
RETURNS N/A
wdbPipePktDevInit( )
NAME wdbPipePktDevInit( ) – initialize a pipe packet device
654
2 Routines
wdbTsfsDrv( )
RETURNS OK or ERROR
wdbSlipPktDevInit( )
NAME wdbSlipPktDevInit( ) – initialize a SLIP packet device for a WDB agent
DESCRIPTION This routine initializes a SLIP packet device on one of the BSP's serial channels. It is
typically called from usrWdb.c when the WDB agent's lightweight SLIP communication
path is selected.
RETURNS N/A
wdbTsfsDrv( )
NAME wdbTsfsDrv( ) – initialize the TSFS device driver for a WDB agent
655
VxWorks Drivers API Reference, 6.6
wdbVioDrv( )
(
char * name /* root name in i/o system */
)
DESCRIPTION This routine initializes the VxWorks virtual I/O "2" driver and creates a TSFS device of the
specified name.
This routine should be called exactly once, before any reads, writes, or opens. Normally, it
is automatically called if the component INCLUDE_WDB_TSFS is added at configuration
time and the device name created is /tgtsvr.
After this routine has been called, individual virtual I/O channels can be opened by
appending the host file name to the virtual I/O device name. For example, to get a file
descriptor for the host file /etc/passwd, call open( ) as follows:
fd = open ("/tgtsvr/etc/passwd", O_RDWR, 0)
wdbVioDrv( )
NAME wdbVioDrv( ) – initialize the tty driver for a WDB agent
DESCRIPTION This routine initializes the VxWorks virtual I/O driver and creates a virtual I/O device of
the specified name.
This routine should be called exactly once, before any reads, writes, or opens. Normally, it
is automatically called when the component INCLUDE_WDB_VIO_DRV is included at
configuration time and the device name created is "/vio".
After this routine has been called, individual virtual I/O channels can be opened by
appending the channel number to the virtual I/O device name. For example, to get a file
descriptor for virtual I/O channel 0x1000017, call open( ) as follows:
fd = open ("/vio/0x1000017", O_RDWR, 0)
656
2 Routines
xbdBlockSize( )
xbdAttach( )
NAME xbdAttach( ) – attach an XBD device
DESCRIPTION none
xbdBlockSize( )
NAME xbdBlockSize( ) – retrieve the block size
DESCRIPTION none
657
VxWorks Drivers API Reference, 6.6
xbdDetach( )
xbdDetach( )
NAME xbdDetach( ) – detach an XBD device
DESCRIPTION none
RETURNS N/A
xbdDump( )
NAME xbdDump( ) – XBD dump routine
DESCRIPTION none
658
2 Routines
xbdNBlocks( )
xbdInit( )
2
NAME xbdInit( ) – initialize the XBD library
xbdIoctl( )
NAME xbdIoctl( ) – XBD device ioctl routine
DESCRIPTION none
RETURNS varies
xbdNBlocks( )
NAME xbdNBlocks( ) – retrieve the total number of blocks
659
VxWorks Drivers API Reference, 6.6
xbdSize( )
(
device_t d,
sector_t * result
)
DESCRIPTION none
xbdSize( )
NAME xbdSize( ) – retrieve the total number of bytes
DESCRIPTION This routine retrieves the total number of bytes on the backing media.
xbdStrategy( )
NAME xbdStrategy( ) – XBD strategy routine
660
2 Routines
z8530Int( )
DESCRIPTION none
z8530DevInit( )
NAME z8530DevInit( ) – intialize a Z8530_DUSART
DESCRIPTION The BSP must have already initialized all the device addresses, etc in Z8530_DUSART
structure. This routine initializes some SIO_CHAN function pointers and then resets the
chip to a quiescent state.
RETURNS N/A
z8530Int( )
NAME z8530Int( ) – handle all interrupts in one vector
DESCRIPTION On some boards, all SCC interrupts for both ports share a single interrupt vector. This is the
ISR for such boards. We determine from the parameter which SCC interrupted, then look at
the code to find out which channel and what kind of interrupt.
661
VxWorks Drivers API Reference, 6.6
z8530IntEx( )
RETURNS N/A
z8530IntEx( )
NAME z8530IntEx( ) – handle error interrupts
RETURNS N/A
z8530IntRd( )
NAME z8530IntRd( ) – handle a reciever interrupt
RETURNS N/A
662
2 Routines
z8530IntWr( )
z8530IntWr( )
2
NAME z8530IntWr( ) – handle a transmitter interrupt
RETURNS N/A
663