[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


A    EISA/ISA Bus-Specific Reference Information

This appendix contains reference pages for the following:


[Return to Library] [Contents] [Previous Chapter] [Next Section] [Next Chapter] [Index] [Help]


A.1    Include File

The include file reference pages can include the following sections:


Name

Lists the name of the include file along with a summary description of its contents.


Location

Presents the pathname for the include file. The pathname makes it easier for you to locate specific include files.


Description

Briefly describes the contents of the include file.


When to Include

Explains when to include an include file for block and character drivers.


Of Special Interest

Lists specific structures, macros, constant values, and so forth that are of interest to device driver writers.


Related Information

Lists related kernel interfaces, structures, system calls, and so forth.

Table A-1 lists the include file related to EISA/ISA bus device drivers, along with a short description of its contents. Device drivers should include include files that use the relative pathname instead of the explicit pathname. For example, although buf.h resides in /usr/sys/include/sys/buf.h, device drivers should include it as:

<sys/buf.h>


Table A-1: Include File for EISA/ISA Bus Device Drivers

Include File Contents
eisa.h Contains definitions for EISA/ISA bus support.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


eisa.h

Contains definitions for EISA/ISA bus support


Location

/usr/sys/include/io/dec/eisa/eisa.h


Description

The eisa.h file contains definitions specific to the EISA/ISA bus.


When to Include

You include this file in block and character device drivers that connect to EISA/ISA buses.


Of Special Interest

This file defines data structures referenced by EISA/ISA bus device drivers and by the bus configuration code.


Related Information

bus_mem, dma, eisa_option, e_port, irq


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


A.2    Kernel Interfaces

The kernel interface reference pages can include the following sections:


Name

Lists the name of the kernel interface, along with a summary description of its purpose. In general, there is one interface described for each reference page. However, in some cases it makes sense to describe more than one interface on the same page if the interfaces are related. When this occurs, this section lists the names of all the interfaces it describes.


Synopsis

Shows the kernel interface function definition. The style used is that of the function definition, not the function call. This book assumes that you understand how to interpret the function definition and how to write an appropriate call for a specific interface. The following example shows these conventions:

int copyin (user_src, kernel_dest, bcount)
caddr_t user_src;
caddr_t kernel_dest;
u_int bcount;

The kernel interface function definition gives you the following information:

This book uses the word kernel ``interface'' instead of kernel ``routine'' or kernel ``macro'' because, from the driver writer's point of view, it does not matter whether the interface is a routine or a macro.


Arguments

Describes the arguments associated with a given kernel interface. In most cases, argument descriptions begin with the word specifies to indicate that you pass the argument (with some specified value) to the kernel interface. If the type of the argument appears as a void *, the argument description states that you must define the type.


Description

Explains the tasks performed by the kernel interface.


Notes

Discusses information that falls into the following categories:


Cautions

Provides information of particular importance when you use the kernel interface. In many cases, the text in this section alerts you to anything that might cause a panic.


Errors

Provides the possible error constants a given kernel interface can return, along with a short description of the error.


Side Effects

Describes special processing performed by the kernel interface. For example, the Side Effects section for the uiomove kernel interface describes the members of the uio structure that it can update.


Return Values

Describes the return values that a given kernel interface can return. In most cases, if the kernel interface returns an error value, this value is described in the Return Values section.


Related Information

Lists related kernel interfaces, structures, system calls, and so forth.

Table A-2 lists the kernel interface specific to EISA/ISA bus device drivers, along with a short description of its purpose.

Note

Device drivers use the following include files most frequently:

<sys/types.h>
<sys/errno.h>
<io/common/devdriver.h>
<sys/uio.h>
<machine/cpu.h>

Table A-2: Kernel Interfaces for EISA/ISA Bus Device Drivers

Kernel Interface Summary Description
isa_slot_to_name Gets the isa_option table function entry.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


isa_slot_to_name

Gets the isa_option table function entry


Synopsis

char * isa_slot_to_name (slot)
uint_t slot;


Arguments

slot
Specifies the slot member of the controller structure.


Description

The isa_slot_to_name interface returns a pointer to the isacfg handle for the device in the specified ISA slot. The isacfg handle is the string that the ISA bus code uses to match with the function field of the isa_option data table. Appendages to the isacfg handle can communicate various information to the driver through this interface.


Notes

You should call the isa_slot_to_name interface only when you are certain that the driver's associated device is operating on the ISA bus. You can check which bus the device is operating on as follows:


.
.
.
struct controller *ctlr;
.
.
.
if ctlr->bus_hd->bus_type == BUS_ISA
.
.
.

The BUS_ISA constant is defined in /usr/sys/include/io/common/devdriver.h.


Return Values

Upon successful completion, isa_slot_to_name returns a pointer to the isacfg handle. Otherwise, isa_slot_to_name returns the value -1.


Related Information

eisa.h


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


A.3    Data Structures

The data structure reference pages can include the following sections:


Name

Lists the name of the structure along with a summary description of its purpose.


Include File

Lists the include file, including the path, where the structure is defined.


Synopsis

Describes the format of the structure, as follows:


Members

Provides a short description of each member of the structure.


Description

Gives more details about the purpose of the structure.


Related Information

Lists related kernel interfaces, structures, system calls, and so forth.

Table A-3 lists the data structures specific to EISA bus device drivers, along with short descriptions of their contents.

Table A-3: Data Structures for EISA/ISA Bus Device Drivers

Data Structure Contents
bus_mem Describes EISA/ISA bus memory characteristics.
controller Represents an instance of a controller entity.
dma Contains DMA channel information.
eisa_option Contains EISA bus options.
e_port Contains I/O port information.
irq Contains EISA/ISA bus interrupt channel characteristics.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


bus_mem

Describes EISA/ISA bus memory characteristics


Include File

/usr/sys/include/io/dec/eisa/eisa.h


Synopsis

Member Name Data Type
isram int
decode int
unit_size int
size long
start_addr io_handle_t


Members

isram
Specifies whether the memory associated with the EISA/ISA bus expansion board is read-only memory (ROM) or random-access memory (RAM). This member is initialized by the bus configuration code during device autoconfiguration. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 The memory associated with the EISA bus expansion board is ROM (that is, read only).
1 The memory associated with the EISA bus expansion board is RAM (that is, read/write).


decode
Specifies the number of address lines decoded by an EISA bus expansion board. The ISA bus support code does not use this member and thus it sets this member to the value zero (0). The EISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 The number of address lines decoded by an EISA bus expansion board equals 20.
1 The number of address lines decoded by an EISA bus expansion board equals 24.
2 The number of address lines decoded by an EISA bus expansion board equals 32.

unit_size
Specifies the number of bits in the I/O port associated with this EISA/ISA bus expansion board. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 There is one byte (8 bits) in the I/O port associated with this EISA/ISA bus expansion board.
1 There is one word (16 bits) in the I/O port associated with this EISA/ISA bus expansion board.
2 There is one longword (32 bits) in the I/O port associated with this EISA bus expansion board.

size
Specifies the size of the memory block for this EISA/ISA bus expansion board. The EISA/ISA bus configuration code sets the size of the memory block up to a maximum of 64 megabytes during device autoconfiguration.

start_addr
Specifies an I/O handle that indicates where the bus configuration code maps the memory block. The EISA/ISA bus configuration code sets the I/O handle during device autoconfiguration.


Description

The bus_mem structure describes memory characteristics for an EISA bus expansion board. The bus configuration code initializes the members of the bus_mem structure during device autoconfiguration. Device drivers call the get_config interface to obtain information stored in the members of the bus_mem data structure.


Related Information

eisa.h


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


controller

Represents an instance of a controller entity


Include File

/usr/sys/include/io/common/devdriver.h


Synopsis

Member Name Data Type
slot int
physaddr caddr_t


Members

slot
Specifies the slot number that the EISA/ISA bus board is plugged into. The slot number ranges from 1- n, where n represents the maximum number of slots. This value corresponds to the one that you (the device driver writer) specify in the system configuration file or the stanza.static file fragment. In the system configuration file, you precede the slot number for the slot that the EISA/ISA bus board is plugged into with the slot keyword, as follows:

slot 1

The autoconfiguration software uses the syntax following the slot keyword in the system configuration file or the stanza.static file fragment to obtain this value. The bus configuration code obtains this value from the autoconfiguration software and uses it to initialize the slot member of the controller structure associated with this EISA/ISA bus device.

physaddr
Specifies the base physical address of the controller's I/O space.


Description

The controller structure represents an instance of a controller entity, one that connects logically to a bus. A controller can control devices that are directly connected or can perform some other controlling operation, such as a network interface or terminal controller operation.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


dma

Contains DMA channel information


Include File

/usr/sys/include/io/dec/eisa/eisa.h


Synopsis

Member Name Data Type
channel uint_t
is_shared uint_t
xfer_size uint_t
timing uint_t
mode uint_t


Members

channel
Specifies the DMA channel number or numbers that this EISA/ISA bus device can use. The EISA/ISA bus configuration code sets the channel number to a number in the range of 0-7.

is_shared
Specifies whether two devices can share the same DMA channel number. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 The devices cannot share the DMA channel number.
1 The devices can share the DMA channel number.


xfer_size
Specifies the DMA device data transfer width. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
00 The DMA device data transfer size is 8 bits (byte).
01 The DMA device data transfer size is 16 bits (word).
10 The DMA device data transfer size is 32 bits (longword).

timing
Specifies the bus cycle type executed by the DMA controller during the data transfer. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
00 The bus cycle type is Default. This bus cycle type is compatible with ISA DMA devices.
01 The bus cycle type is Type A. This bus cycle type is used with higher-performance ISA DMA devices to achieve faster data transfers.
10 The bus cycle type is Type B. Like bus cycle Type A, this type is used with higher-performance ISA DMA devices to achieve faster data transfers.
11 The bus cycle type is Type C (burst). This bus cycle type is used with DMA devices that support EISA/ISA bus cycles to achieve the fastest data transfers.

mode
Specifies the transfer mode.


Description

The dma structure describes information related to the DMA channel. The bus configuration code initializes the members of the dma structure during device autoconfiguration. Device drivers call the get_config interface to obtain information stored in the members of the dma data structure.


Related Information

eisa.h


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


eisa_option

Contains EISA bus options


Include File

/usr/sys/include/io/dec/eisa/eisa.h


Synopsis

Member Name Data Type
board_id char [EISA_IDNAMELEN + 1]
function char [EISA_FUNCLEN + 1]
driver_name char [EISA_NAMELEN + 1]
intr_b4_probe int
intr_aft_attach int
type char
adpt_config int (*adpt_config) ()


Members

board_id
Specifies the EISA bus option expansion board's product ID name. The EISA bus support code compares the value stored in this member with an EISA ID register to identify an option module and connect it to its associated device driver. You set board_id to the character string that represents the option board's product ID name. The ID name consists of a 3-character manufacturer code, a 3-character product identifier, and a 1-character revision number. For example, the string ADP0002 identifies this as a second revision of an Adaptec ADP1742A SCSI option board.

ISA bus device drivers do not use this member. The ISA bus does not require such an ID register. Typically, ISA device driver writers set this member to the null string () in the eisa_option structure defined in /usr/sys/data/isa_option_data.c.

function
Specifies up to 79 characters of text that identify the product. This text can include part numbers. The default is the null string (). You set function to the character string that represents the product. For example, the string AHA1740 identifies this as the product name for a Digital ADP1742A SCSI option board.

For the ISA bus, this member specifies a string that matches the ISA configuration (ISACFG) handle.

driver_name
Specifies up to 8 characters of text that identify the name of the controlling device driver. You set driver_name to the character string that represents the name of the controlling device driver. This same character string also specifies the name of the controlling device driver in the system configuration file. For example, the string aha identifies this as the controlling device driver for the device connected to an ADP1742A SCSI option board.

intr_b4_probe
Specifies whether the device needs interrupts enabled before the bus configuration code calls the driver's xxprobe interface. You can set intr_b4_probe to the value zero (0) or the value 1. A zero (0) value indicates that the device does not need interrupts enabled; this is the default value. A value of 1 indicates that the device needs interrupts enabled.

intr_aft_attach
Specifies whether the device needs interrupts enabled after the driver's xxprobe and xxcattach or xxdattach interfaces complete execution. You can set intr_aft_attach to the value zero (0) or the value 1. A zero (0) value indicates that the device does not need interrupts enabled; this is the default value. A value of 1 indicates that the device needs interrupts enabled.

type
Specifies the type of device. You can set type to the string C (the device is a controller) or A (the device is a bus or an adapter). The default value is C.

adpt_config
Specifies the name of the bus (or adapter) configuration interface to call. You set adpt_config to the string that identifies the bus configuration interface, if type was set to A (the device is a bus or an adapter). Otherwise, do not set adpt_config to any value.


Description

The eisa_option structure contains EISA/ISA bus option information such as the name of the controlling device driver. An array of eisa_option structures is declared in the file /usr/sys/data/eisa_option_data.c for EISA device drivers and /usr/sys/data/isa_option_data.c for ISA device drivers.


Related Information

eisa.h


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


e_port

Contains I/O port information


Include File

/usr/sys/include/io/dec/eisa/eisa.h


Synopsis

Member Name Data Type
base_address vm_offset_t
numb_of_ports uint_t
is_shared uint_t


Members

base_address
Specifies the base address of the I/O ports.

numb_of_ports
Specifies the number of ports in the range identified by the I/O handle. This member is not used on the ISA bus. The value of this member for the ISA bus is always zero (0).

is_shared
Specifies whether the device can share this device's I/O port. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 The device cannot share the I/O port.
1 The device can share the I/O port.



Description

The e_port structure describes bus I/O port information. The bus configuration code initializes the members of the e_port structure during device autoconfiguration. Device drivers call the get_config interface to obtain information stored in the members of the e_port data structure.


Related Information

eisa.h


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


irq

Contains EISA/ISA bus interrupt channel characteristics


Include File

/usr/sys/include/io/dec/eisa/eisa.h


Synopsis

Member Name Data Type
channel uint_t
trigger uint_t
is_shared uint_t


Members

channel
Specifies the interrupt channel number. The bus configuration code sets the interrupt channel number to a number in the range zero (0) to F.

trigger
Specifies whether the read-only memory (ROM) of the EISA bus expansion board initializes the interrupt controller to edge- or level-triggered. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 The EISA bus expansion board initializes the interrupt controller to edge-triggered.
1 The EISA bus expansion board initializes the interrupt controller to level-triggered.

The ISA bus does not use this member.

is_shared
Specifies whether the EISA bus expansion board can share this interrupt with other EISA bus expansion boards. The EISA/ISA bus configuration code sets this member to one of the following values during device autoconfiguration:

Value Meaning
0 The EISA bus expansion board cannot share this interrupt.
1 The EISA bus expansion board can share this interrupt.

The ISA bus does not use this member.


Description

The irq data structure specifies EISA bus interrupt channel characteristics assigned to a device. The bus configuration code initializes the members of the irq structure during device autoconfiguration. Device drivers call the get_config interface to obtain information stored in the members of the irq data structure.


Related Information

eisa.h


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


A.4    Device Driver Interfaces

The device driver interface reference pages can include the following sections:


Name

Lists the name of the driver interface along with a summary description of its purpose. In general, there is one interface described for each reference page. However, in some cases it makes sense to describe more than one interface on the same page if the interfaces are related. When this occurs, this section lists the names of all the interfaces it describes.


Entry Point

Lists the structure or file where you specify the entry for the device driver interface.


Synopsis

Shows the device driver interface function definition. The style used is that of the function definition, not the function call. This book assumes that you understand how to interpret the function definition and how to write an appropriate call for a specific interface. The presentation shown in the following example is of the function definition: int xxprobe (ctlr)
struct controller *ctlr;
The previous interface function definition gives you the following information:


Arguments

Describes the arguments associated with a given driver interface. In most cases, argument descriptions begin with the word specifies to indicate that the driver writer passes the argument (with some specified value) to the driver interface.


Description

Explains the tasks performed by the driver interface.


Notes

Contains information about the driver interface pertinent to the device driver writer.


Return Values

Describes the values that a given driver interface can return.


Related Information

Lists related kernel interfaces, structures, system calls, and so forth.

Table A-4 lists the device driver interfaces specific to EISA/ISA bus device drivers, along with short descriptions of their contents.

Table A-4: Driver Interfaces for EISA/ISA Bus Device Drivers

Driver Interface Contents
xxprobe Determines whether the device exists.
xxslave Checks that the device is valid for this controller.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Section] [Next Chapter] [Index] [Help]


xxprobe

Determines whether the device exists


Entry Point

The driver structure


Synopsis

int xxprobe (bus_io_handle, ctlr)
io_handle_t bus_io_handle;
struct controller *ctlr;


Arguments

bus_io_handle
Specifies an I/O handle that you can use to reference a device register located in the EISA/ISA bus address space. This I/O handle is for the base of the device's slot-specific I/O address space. The EISA bus configuration code passes this I/O handle to the driver's xxprobe interface during device autoconfiguration. You can perform standard C mathematical operations on the I/O handle. For example, you can add an offset to or subtract an offset from the I/O handle.

ctlr
Specifies a pointer to the controller structure associated with this device. The bus configuration code passes this pointer to the driver's xxprobe interface. The device driver can reference hardware resources and other information contained in the controller structure pointer.


Description

An EISA/ISA bus device driver's xxprobe interface performs the tasks necessary to determine if the device exists and is functional on a given system. At system startup time, the EISA bus configuration code reads the configuration information saved by the EISA Configuration Utility (ECU) and performs checks to determine if the device is present before calling xxprobe for statically configured drivers. The EISA bus configuration code calls the xxprobe interface for each device that is defined according to specific rules discussed in Chapter 6.

The ISA bus configuration code reads the data saved by the console firmware's isacfg utility and attempts to match the data to a configured device driver. The matching occurs by using the ISACFG handle and the strings stored in the function member of the isa_option data table that resides in /usr/sys/data/isa_option_data.c.

EISA bus devices must have an ID register that the EISA bus configuration code uses to ensure that the device is present on the system before calling the driver's probe interface. ISA bus devices have no such requirement. Thus drivers for ISA bus devices, whether on either the EISA or ISA bus, should attempt to determine the actual presence of the device in the probe interface probe routine. The methodology to accomplish this is unique to each device. Some predictable device register manipulation is one such method.

The xxprobe interface typically checks some device control status register (CSR) to determine whether the physical device is present. If the device is not present, the device is not initialized and 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 the stanza.static file fragment. At system configuration time, the config program registered the defined device interrupt handlers. For this version of Digital UNIX, Digital recommends that you 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 interfaces.

The Synopsis section shows the arguments associated with a probe interface for device drivers that operate on the EISA bus.


Notes

Device drivers pass the I/O handle to the following categories of interfaces, which are discussed in Writing Device Drivers: Tutorial. These interfaces can process the I/O handle to access bus address space.


Return Values

The xxprobe interface returns a nonzero value if the probe operation is successful. It returns the value zero (0) to indicate that the driver did not complete the probe operation.


Related Information

xxslave


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Next Chapter] [Index] [Help]


xxslave

Checks that the device is valid for this controller


Entry Point

The driver structure


Synopsis

int xxslave (device, bus_io_handle)
struct device *device;
io_handle_t bus_io_handle;


Arguments

device
Specifies a pointer to a device structure for this device. The bus configuration code passes this pointer to the driver's xxslave interface. The device driver can reference such information as the logical unit number of the device, whether the device is functional, and the bus number the device resides on.

bus_io_handle
Specifies an I/O handle that you can use to reference a device register located in the EISA/ISA bus address space. This I/O handle is for the base of the device's slot-specific I/O address space. The EISA/ISA bus configuration code passes this I/O handle to the driver's xxslave interface during device autoconfiguration. You can perform standard C mathematical operations on the I/O handle. For example, you can add an offset to or subtract an offset from the I/O handle.


Description

A device driver's xxslave interface is called only for a controller that has slave devices connected to it. This interface is called once for each slave attached to the controller. You (or the system manager) specify the attachments of these slave devices for static device drivers in the system configuration file or stanza.static file fragment.

The arguments you pass to the slave interface differ according to the bus on which the driver operates. The Synopsis section shows the arguments associated with a slave interface for an EISA bus.


Notes

Device drivers pass the I/O handle to the following categories of interfaces, which are discussed in Writing Device Drivers: Tutorial. These interfaces can process the I/O handle to access bus address space.


Return Values

The xxslave interface returns a nonzero value if the device is present.


Related Information

xxprobe