Appendix E. Compile options and System calls including ioctls

Table of Contents
E.1. Mid level
E.1.1. Mid level compile options
E.1.2. Mid level ioctls
E.2. sd driver
E.2.1. sd compile options
E.2.2. sd ioctls and user interface
E.3. sr driver
E.3.1. sr compile options
E.3.2. sr ioctls and user interface
E.4. st driver
E.4.1. st compile options
E.4.2. st ioctls and user interface
E.5. sg driver
E.5.1. sg compile options
E.5.2. sg ioctls and user interface

The compile options in this appendix are those which a system administrator might conceivably want to change. Naturally the defaults are chosen so the vast majority of users will not need to modify anything. In some cases setting kernel build time options, kernel boot time parameters or module load parameters has the same effect as changing a driver compile time option.

System calls act as the interface between application programs and the kernel and its drivers. In the case of the layered driver architecture that the SCSI subsystem uses, the upper layer drivers handle most of the system calls.

The SCSI subsystem has a "bubble down" ioctl structure. First the upper level driver associated with the open file descriptor attempts to decode the ioctl. If it doesn't recognize it then the ioctl is passed down to the mid level. If the mid level doesn't recognize it then the ioctl is passed down to the lower level driver associated with the file descriptor. If the lower level driver doesn't recognize it then a EINVAL error is generated.

Some ioctls are dispatched to related subsystems.