STREAMS-UX Programmer's Guide (February 2007)

Modules and Drivers
Data Structures
Chapter 4
66
SQLVL_DEFAULT Default level synchronization. It is the same as
SQLVL_QUEUEPAIR.
SQLVL_MODULE Module level synchronization. All the instances of
modules/drivers are synchronized.
SQLVL_ELSEWHERE Synchronize with respect to the group of co-operating
modules/drivers which access each others data. The
group name is specified in the inst_sync_info.
SQLVL_GLOBAL Provides Global synchronization. No more than one
thread of execution can access modules/drivers under
this level.
inst_sync_info
Used to provide the name of the driver/module/group in case of SQLVL_ELSEWHERE
synchronization. If not used, set NULL string.
The drv_info_t Structure
All STREAMS drivers must define drv_info_t structure and must be allocated statically. This structure is
not applicable for STREAMS modules. The structure is defined in <sys/conf.h>.
The drv_info_t has the following fields:
char *name; /* Name of driver */
char *class; /* Device class ("disk","tape", etc.) */
ubit32 flags; /* Device flags (see below) */
int b_major; /* Block device major number */
int c_major; /* Character device major number */
cdio_t *cdio; /* Pointer to cdio(CDIO4) structure */
void *gio_private; /* Additional GIO information */
void *cdio_private; /* Additional CDIO information */
name Points to a string containing name of the driver. This should match the name specified in
module metadata.
class Pointer to a string containing the name of the class that the driver is in. For interface
drivers, instances of a card are counted within each class when they are identified at kernel
boot time. Instance numbers are unique within a device class.
flags Contains the bitmask of flags that describe the module/driver.
DRV_CHAR Character device driver.
DRV_BLOCK Block device driver.
DRV_SCAN Driver supports bus scanning.
DRV_MP_SAFE MP aware driver and provides its own multi-processing
protection.
DRV_SAVE_CONF Save configuration information to /etc/ioconfig. This
file retains potentially volatile information such as
dynamic major numbers and card instance numbers
across reboots.
b_major Set this field to -1. STREAMS drivers or modules are not block device drivers.