9 REFERENCE
Man-pages of all public driver functions in alphabetical order.
9.1 rmnClose(3)
This routine is called when a channel of a RMN
device shall be closed.
It represents an interface routine between the special
RMN driver routines and the general lcudrv driver routines.
lcudrvOK : successful completion
lcudrvERROR_INVALID_ARGUMENT : invalid channel number
lcudrvERROR_NO_CHANNEL : channel was not open
9.2 rmnDevCreate(3)
#include "rmn.h"
int rmnDevCreate
(
char *devName, => <IN> device name
int addrSpace, => <IN> address space selection
void *baseAddr, => <IN> VMEbus base address of the board
int memOption, => <IN> board's memory option (rmnMEM_256KB or
rmnMEM_512KB or rmnMEM_1MB)
int intrNumber, => <IN> interrupt-vector-number of the
first device interrupt source
int intrLevel => <IN> level of the device interrupt
)
This function is called at startup once for each
device to be installed. It adds a device to the driver,
making it available for subsequent open operations.
The successful completion of the function is shown by the
switching off of the led on the board's front panel.
devName: <IN> is the device name, consisting of the prefix "rmn"
and a number: must be "/rmnX" X>=0, e.g. "/rmn0".
addrSpace: <IN> selects the board's address space, rmnVME_ADD_A24
| rmnVME_ADD_A32, according to the setting of the jumper 10.
baseAddr: <IN> is the VMEbus base address of the board in the A24 or
A32 standard address space. If the board is configured in the A24
address space, the upper 8 address-bits are ignored. The special
address 0xffffffff means that the board register space is mapped
into main memory for simulation.
memOption: <IN> selects the amount of memory actually installed
on the board: rmnMEM_256KB | rmnMEM_512KB | rmnMEM_1MB.
intrNumber: <IN> is interrupt-vector-number of the first device
interrupt source. The RMN device has 4 possible interrupt
sources, then this function will reserve 4 interrupt vectors
in the CPU vector table, from <intrNumber> to <intrNumber>+3.
<intrNumber> will be connected to an internal handler, which
serves the local interrupt source INT0 (see board's
documentation and rmn.doc). The other three vectors
<intrNumber>+1 .. <intrNumber>+3 can be attached to user
provided interrupt handler serving the remote interrupt
sources (INT1-INT3).
intrLevel: <IN> is the level of the device interrupt. It is
the same for all the 4 interrupt sources.
lcudrvOK : successful completion
lcudrvERROR_INVALID_ARGUMENT : one of the arguments is not valid
lcudrvERROR_NO_DRIVER : RMN driver not installed
lcudrvERROR_INVALID_DEVICE : invalid device name or device number
lcudrvERROR_DEVICE_EXISTS : device already installed
rmnERROR_INVALID_BOARD_ID : no RMN board found at the specified
VME address
rmnERROR_INVALID_VME_ADDR : no HW found at the specified
VME address
rmnERROR_BAD_DATA : test of the board's user memory failed
rmnERROR_LINK_BROKEN : test of the link integrity failed
lcudrvERROR_NO_SEMAPHORE : failed to create semaphore
lcudrvERROR_NO_MEMORY : failed to create object in memory
lcudrvERROR_TIMEOUT : failed to take semaphore before timeout
This function must be called by at CPU startup time, normally
by a single task configuring sequentially all the supported
RMN devices. No protection is implemented on the driver global
variables. Any call to the open, close and ioctl functions
must be done only after having succesfully completed
the installation of all the RMN devices supported
by the CPU.
rmnDrv(3), rmnOpen(3), rmnClose(3), rmnIoctl(3),
iosLib(1), iosDevAdd(2), open(2), close(2), ioctl(2)
rmnBoard(4)
9.3 rmnDrv(3)
#include "rmn.h"
int rmnDrv
(
int devices, => <IN> maximum number of supported devices
by the driver (> 0)
int channels, => <IN> maximum number of channels that can be
simultaneously opened (> 0)
int timeout => <IN> access timeout value in ticks (> 0) or
NO_WAIT or WAIT_FOREVER
)
This function installs the RMN device driver.
It is called only once at startup. It hooks up the various
I/O service calls to the driver's functions, assigns the driver
number, and adds the driver to the driver table.
The timeout parameter is valid for all the devices configured
for this driver and determines the maximum waiting time when
accessing a RMN device (time to wait when taking the device
access semaphore).
lcudrvOK : driver successfully installed
lcudrvERROR_DRIVER_EXISTS : the driver is already installed
lcudrvERROR_NO_MEMORY : there is not enough memory for dynamic
data structures
lcudrvERROR_INVALID_ARGUMENT : the value of one of the
parameters is out of range
This function must be called only once, at CPU startup
time, before any call to rmnDevCreate(). No protection
is implemented on the driver global variables.
rmnDevCreate(3), rmnOpen(3), rmnClose(3), rmnIoctl(3),
lcudrvInitDCT(3),
iosLib(1), iosDrvInstall(2), open(2), close(2), ioctl(2)
9.4 rmnIoctl(3)
#include "rmnPrivate.h"
int rmnIoctl
(
int channel, => <IN> channel number
int command, => <IN> number identifying the operation
to be performed by the driver
(as defined in 'rmnCommands.h')
void *argument => <IN> address of the command argument or
NULL if no argument is used.
)
This routine is called when a control command is
sent to a RMN device via ioctl(). It validates the command
request, performs a semaphore protection, if required,
and calls the command procedure to be executed.
lcudrvOK : successful completion
lcudrvERROR_INVALID_ARGUMENT : invalid channel number
lcudrvERROR_CHANNEL_NOT_OPEN : channel was not open
lcudrvERROR_INVALID_COMMAND : command code invalid
lcudrvERROR_ACCESS_CONFLICT : insufficient access rights
lcudrvERROR_TIMEOUT : failed to take semaphore before timeout
9.5 rmnOpen(3)
#include "rmnPrivate.h"
int rmnOpen
(
void *device, => <IN> pointer to the device descriptor
char *remainder, => <IN> remainder of the device name
int mode, => <IN> open mode
int *status => <OUT> pointer to the returned status value
(NULL: not returned)
)
This function is installed in the I/O-system of
VxWorks and is called via open() when a channel to a RMN
device shall be opened.
It represents an interface routine between the RMN driver
routines and the general lcudrv driver routines.
channel number (>= 0) : successful completion
lcudrvERROR : error (detailed in <*status>)
In <*status>:
lcudrvERROR_INVALID_DEVICE - remainder not blank/invalid name
lcudrvERROR_ACCESS_CONFLICT - open mode not consistent
lcudrvERROR_NO_CHANNEL - no more channel available
lcudrvERROR_INVALID_OPEN_MODE - unknown open mode
9.6 rmnTools(1)
rmnVersion,
rmnDevShow,
rmnDevDump,
rmnMemDump,
rmnDevDescrDump,
rmnTestBoard,
rmnDevDelete,
rmnDevDeleteAll,
rmnDrvRemove,
rmnPrintError,
rmnPrintCommand - Support functions of the RMN driver
#include "rmn.h"
void rmnVersion(void)
int rmnDevShow(void)
int rmnDevDump
(
char *name => <IN> device name ("/rmnX")
)
int rmnMemDump
(
char *name => <IN> device name ("/rmnX")
)
int rmnDevDescrDump
(
char *name => <IN> device name ("/rmnX")
)
int rmnTestBoard
(
char *name => <IN> device name ("/rmnX")
)
int rmnDevDelete
(
char *name => <IN> device name ("/rmnX")
)
int rmnDevDeleteAll(void)
int rmnDrvRemove(void)
int rmnPrintError(int errorCode)
int rmnPrintCommand(int cmdCode)
rmnVersion - Prints the version of the RMN driver to the
LCU console
rmnDevShow - Prints a list of installed RMN devices to the
LCU console
rmnDevDump - Prints the device registers in a formatted way
rmnMemDump - Prints the device registers in hexadecimal
rmnDevDescrDump - Prints information on the device descriptor
rmnTestBoard - Test the board and prints the link loopback time
rmnDevDelete - Deletes the device from the I/O system
rmnDevDeleteAll - Deletes all the RMN devices from the I/O system
rmnDrvRemove - Removes the RMN driver from the driver table,
forcing the closure of all the open channels.
It deletes also all the RMN devices, if not
already done.
rmnPrintError - Prints an error string corresponding to the
given error code
rmnPrintCommand - Prints a command string corresponding to the
given command number
rmnVersion
N/A
rmnDevShow
OK : successful completion
lcudrvERROR_NO_DRIVER : the driver is not installed.
rmnDevDump
OK : successful completion
lcudrvERROR_NO_DRIVER : the driver is not installed.
lcudrvERROR_INVALID_DEVICE : the device name was not found in the RMN
device table.
rmnMemDump
OK : successful completion
lcudrvERROR_NO_DRIVER : the driver is not installed.
lcudrvERROR_INVALID_DEVICE : the device name was not found in the RMN
device table.
rmnDevDescrDump
OK : successful completion
lcudrvERROR_NO_DRIVER : the driver is not installed.
lcudrvERROR_INVALID_DEVICE : the device name was not found in the RMN
device table.
rmnTestBoard
OK : successful completion
Error codes from rmnOpen and rmnCmdTestBoard functions.
rmnDevDelete
OK : successful completion
lcudrvERROR_NO_DRIVER : the driver is not installed.
lcudrvERROR_INVALID_DEVICE : the device name was not found in the RMN
device table.
lcudrvERROR_TIMEOUT : timeout while accessing the device (waiting time
was longer than the driver timeout parameter)
rmnERROR_INVALID_SEMAPHORE_ID : semaphore deletion failed
rmnERROR_OPEN_CHANNELS : open channels found
rmnDevDeleteAll
Same return values as from rmnDevDelete.
rmnDrvRemove
OK : successful completion
lcudrvERROR_NO_DRIVER : the driver is not installed.
Error codes from rmnDevDelete
rmnPrintError
lcudrvOK : successful completion
lcudrvERROR: invalid error code
rmnPrintCommand
lcudrvOK : successful completion
lcudrvERROR: invalid command number
Quadralay Corporation http://www.webworks.com Voice: (512) 719-3399 Fax: (512) 719-3606 sales@webworks.com |