Chapter 3. Identifying the version of the SG driver

Earlier versions of the sg device driver either have no version number (e.g. the original driver) or a version number starting with "2". The drivers that support this new interface have a major version number of "3". The sg version numbers are of the form "x.y.z" and the single number given by the SG_GET_VERSION_NUM ioctl() is calculated by (x * 10000 + y * 100 + z). The sg driver discussed here will yield a number greater than or equal to 30000 from SG_GET_VERSION_NUM. The version number can also be seen using cat /proc/scsi/sg/version in the new driver. This document describes sg version 3.1.22 for the lk 2.4 series. Where some facility has been added during the lk 2.4 series (e.g. mmap-ed IO) and hence is not available in all versions of the lk 2.4 series, this is noted. [1]

Here is a list of sg versions that have appeared to date during the lk 2.4 series.

Notes

[1]

There is an sg version 3.0.19 which is an optional driver for the lk 2.2 series. It has the following limitations:

  • maximum size of SCSI commands is 12 bytes

  • sense buffer limited to 16 bytes

  • resid (residual data transfer count) is always 0

  • direct and mmap-ed IO not supported (defaults to indirect IO)