Next | Prev | Up | Top | Contents | Index

SCSI Open and Close Driver Routines


dsopen - Allocate a dsreq Type Structure and Open a Device

The dsopen() routine is used to allocate a dsreq type structure for a device on the SCSI bus and to "open" that device.

Synopsis

struct dsreq* dsopen(char *opath, int oflags);

Arguments

opath

Expects the name of the special file for the device on the SCSI bus you want to open. The system comes with up to 15 device special files per adapter in the directory /dev/scsi. These special files all assume that the logical unit for your device is 0. If the logical unit number for your device is not 0, you must create a device-special file for it. See "Creating Device-special Files for User-level SCSI Drivers."

oflags

Expects the oflag value you would normally give to the standard open() system call when opening a device.
Returns

The returned value of this function is a pointer to a dsreq type structure.

Notes

This structure is the medium of communication between your user-level SCSI driver and the device on the SCSI bus, and almost every library routine expects the pointer this function returns as its first argument.


dsclose - Free the dsreq Structure and Close the Device

The dsclose() routine is used to free the dsreq structure for the SCSI device and close the device, when your driver is done with the device.

Synopsis

dsclose(struct dsreq *dsp);

Arguments

dsp

A pointer to the dsreq type structure that you allocated for the SCSI device through a call to dsopen(). Upon successful completion, dsopen() returns a pointer to a dsreq type structure as its function value.

Next | Prev | Up | Top | Contents | Index