Index Index for
Section 9
Index Alphabetical
listing for D
Bottom of page Bottom of
page

driver(9s)

NAME

driver - General: Defines driver entry points and other driver-specific information

SYNOPSIS

struct driver { int (*probe)(); int (*slave)(); int (*cattach)(); int (*dattach)(); int (*go)(); caddr_t *addr_list; char *dev_name; struct device **dev_list; char *ctlr_name; struct controller **ctlr_list; short xclu; int addr1_size; int addr1_atype; int addr2_size; int addr2_atype; int (*ctlr_unattach)(); int (*dev_unattach)(); };

MEMBERS

probe Specifies a pointer to the driver's probe() routine, which is called to verify that the controller exists. slave Specifies a pointer to the driver's slave() routine, which is called once for each device connected to the controller. cattach Specifies a pointer to the driver's controller attach() routine, which is called to allow controller-specific initialization. You can set this pointer to NULL. dattach Specifies a pointer to the driver's device attach() routine, which is called once for each slave() call that returns success. You use the device attach() routine for device-specific initialization. You can set this pointer to NULL. go Specifies a pointer to the driver's go() routine, which is not currently used. addr_list Specifies a list of optional CSR addresses. dev_name Specifies the name of the device connected to this controller. dev_list Specifies an array of pointers to device data structures currently connected to this controller. This member is indexed through the logunit member of the device data structure associated with this device. ctlr_name Specifies the controller name. ctlr_list Specifies an array of pointers to controller data structures. The system uses this member when multiple controllers are controlled by a single device driver. This member is indexed through the ctlr_num member of the controller data structure associated with this device. xclu Specifies a field that is not currently used. addr1_size Specifies the size (in bytes) of the first control and status register (CSR) area. This area is usually the CSR of the device. Only drivers operating on the VMEbus use this member. addr1_atype Specifies the address space, access mode, transfer size, and swap mode for mapping the first CSR area. Only drivers operating on the VMEbus use this member. addr2_size Specifies the size (in bytes) of the second CSR area. This area is usually the data area that the system uses with devices that have two separate CSR areas. Only drivers operating on the VMEbus use this member. addr2_atype Specifies the address space, access mode, transfer size, and swap mode for mapping the second CSR area. Only drivers operating on the VMEbus use this member. ctlr_unattach Specifies a pointer to the controller's unattach() routine. Dynamically configured drivers use the controller unattach() routine. dev_unattach Specifies a pointer to the device's unattach() routine. Dynamically configured drivers use the device unattach() routine.

DESCRIPTION

The driver data structure defines driver entry points and other driver- specific information. You declare and initialize an instance of this data structure in the declarations section of the device driver. The bus configuration code uses the entry points defined in this data structure during device autoconfiguration. The bus configuration code fills in the dev_list and ctlr_list arrays. The driver routines use these arrays (members of the device and controller data structures) to obtain the data structures for specific devices or controllers. For VMEbus device drivers, you can set the addr1_atype and addr2_atype members to the bitwise inclusive OR of the valid bits described in the following table: _______________________________________________________________________ Bit Category Value Meaning _______________________________________________________________________ Swap mode bits VME_BS_NOSWAP Specifies no byte swapping. VME_BS_BYTE Specifies byte swapping in bytes. VME_BS_WORD Specifies byte swapping in words. VME_BS_LWORD Specifies byte swapping in longwords. VME_BS_QUAD Specifies byte swapping in quadwords. Address space bits VME_A16 Specifies a request for the 16-bit address space. VME_A24 Specifies a request for the 24-bit address space. VME_A32 Specifies a request for the 32-bit address space. Transfer size bits VME_D08 Specifies a request for the 8-bit data size. VME_D16 Specifies a request for the 16-bit data size. VME_D32 Specifies a request for the 32-bit data size. Access mode bits VME_UDATA Specifies user data. VME_UPROG Specifies a user program. VME_SDATA Specifies supervisory data. VME_SPROG Specifies a supervisory program. CPU allocation space bit VME_DENSE Specifies dense space mapping on a platform for which the default CPU allocation space is sparse. _______________________________________________________________________ Table Notes · Not all bus adapters support hardware byte swapping. · Not all bus adapters use the transfer size. · Depending on bus adapter implementation, the CPU allocation space bit may not be applicable.

FILES

<io/common/devdriver.h>

SEE ALSO

Data Structures: bus(9s), controller(9s), device(9s)

Index Index for
Section 9
Index Alphabetical
listing for D
Top of page Top of
page