 |
Index for Section 9 |
|
 |
Alphabetical listing for P |
|
 |
Bottom of page |
|
probe(9r)
NAME
probe - VMEbus: Determines whether the device exists
SYNOPSIS
int probe(
io_handle_t addr1,
struct controller *ctlr );
ARGUMENTS
addr1
Specifies an I/O handle that you can use to reference a device register
located in the VMEbus address space. The VMEbus configuration code
passes this I/O handle to the driver's probe() routine during device
autoconfiguration. You can perform standard C mathematical operations
(addition and subtraction only) on the I/O handle. For example, you can
add an offset to or subtract an offset from the I/O handle.
This I/O handle corresponds to the first control and status register
(CSR) address that you specified in a VBA_Option entry in the
/etc/sysconfigtab file. (The data structures chapter of Writing VMEbus
Device Drivers describes the VBA_Option entry.) You use the Csr1 field
of the VBA_Option entry to specify the CSR address for the VMEbus
device, as follows:
VBA_Option = ..., Csr1 - 0x8020, ...
The bus configuration code converts the Csr1 address, combined with
information in driver data structure members addr1_size and
addr1_atype, into an appropriate I/O handle and passes it to the
driver's probe() routine.
ctlr
Specifies a pointer to the VMEbus device's controller data structure.
The bus configuration code passes this pointer to the driver's probe()
routine. The device driver can reference hardware resources and other
information contained in the controller data structure pointer.
If a second CSR was specified in a VBA_Option entry in the
/etc/sysconfigtab file, the VMEbus configuration code passes
information in the addr2 member of the controller data structure
pointer. This member contains an I/O handle that you can use to
reference a device register located in the VMEbus onboard memory. You
can perform standard C mathematical operations (addition and
subtraction only) on the I/O handle. For example, you can add an offset
to or subtract an offset from the I/O handle.
You can use the Csr2 field of the VBA_Option entry to specify an
optional second VMEbus device register or memory address to map into
CPU I/O space, as follows:
VBA_Option = ..., Csr2 - 0x8040, ...
The bus configuration code converts the Csr2 address, combined with
information in driver data structure members addr2_size and
addr2_atype, into an appropriate I/O handle. It is not passed to the
driver's probe() routine, but is available in the driver's controller
data structure.
ENTRY POINT
The driver data structure
DESCRIPTION
A device driver's probe() routine performs tasks necessary to determine if
the device exists and is functional on a given system. At boot time, the
kernel performs checks to determine if the device is present before calling
the probe() routine for statically configured drivers. For dynamically
configured drivers, the probe() routine is called indirectly during the
driver loading process.
The driver's configure() routine calls the configure_driver() routine to
merge the driver's connectivity information into the system (hardware)
configuration tree, which consists of bus, controller, and device data
structures. The call to configure_driver() results in the system calling
probe() for each instance of the controller present on the VMEbus.
The probe() routine typically checks some device control and status
register (CSR) to determine whether the physical device is present. If the
device is not present, the device is not initialized and is not available
for use.
In previous versions of the operating system, you defined the device
interrupt handlers for static device drivers in the system configuration
file or in a stanza.static file fragment. At system configuration time, the
config program registered the defined device interrupt handlers. Beginning
with Version 4.0 of the operating system, you are required to register the
device interrupt handlers for static device drivers in the same way that
you register them for loadable device drivers: by calling the handler_add()
and handler_enable() routines.
The arguments you pass to the probe() routine differ according to the bus
on which the driver operates. The SYNOPSIS section shows the arguments
associated with a probe() routine for a VMEbus.
NOTES
Device drivers pass the I/O handle to the following categories of routines,
which are discussed in Writing Device Drivers. These routines can process
the I/O handle to access the desired bus address space.
· CSR I/O access routines
The CSR I/O access routines are read_io_port() and write_io_port().
These are generic routines that allow device drivers to read from and
write to device registers. Using these routines to read data from and
write data to a device register makes the device driver more portable
across different bus architectures, different CPU architectures, and
different CPU types within the same CPU architecture.
· I/O copy routines
The I/O copy routines are io_copyin(), io_copyio(), io_copyout(), and
io_zero(). These are generic routines that allow device drivers to
perform I/O copy operations. Using these routines to perform the copy
operation makes the device driver more portable across different CPU
architectures and different CPU types within the same architecture.
RETURN VALUES
The probe() routine returns a nonzero value if the probe operation is
successful. It returns the value 0 (zero) to indicate that the driver did
not complete the probe operation.
SEE ALSO
Kernel Routines: slave(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for P |
|
 |
Top of page |
|