The generic SCSI interface has been implemented to provide general
SCSI access to (possibly exotic) pieces of SCSI hardware. It was
developed by Lawrence Foard ( entropy@world.std.com
) and
sponsored by Killy Corporation (see the comments in scsi/sg.h
).
The interface makes special device handling possible from user level applications (i.e. outside the kernel). Thus, kernel driver development, which is more risky and difficult to debug, is not necessary.
However, if you don't program the driver properly it is possible to
hang the SCSI bus, the driver, or the kernel. Therefore, it is
important to properly program the generic driver and to first back up
all files to avoid losing data. Another useful thing to do before
running your programs is to issue a sync
command to ensure that
any buffers are flushed to disk, minimizing data loss if the system
hangs.
Another advantage of the generic driver is that as long as the interface itself does not change, all applications are independent of new kernel development. In comparison, other low-level kernel drivers have to be synchronized with other internal kernel changes.
Typically, the generic driver is used to communicate with new SCSI hardware devices that require special user applications to be written to take advantage of their features (e.g. scanners, printers, CD-ROM jukeboxes). The generic interface allows these to be written quickly.