The Linux SCSI Generic (sg) HOWTO
Prev | Chapter 6. The sg_io_hdr_t structure in detail | Next

# 6.3. cmd_len

This is the length in bytes of the SCSI command that 'cmdp' points to. As a SCSI command is expected an EMSGSIZE error number is produced if the value is less than 6 or greater than 16. Further, if the SCSI mid level has a further limit then EMSGSIZE is produced in this case as well. [1] The type of cmd_len is unsigned char.

### Notes

[1] | Linux kernel prior to 2.4.15 limited SCSI commands to a length of 12 bytes. In lk 2.4.15 this was raised to 16 bytes. However unless lower level drivers (e.g. aic7xxx) indicate that they can handle 16 byte commands (and few currently do) then the command is aborted with a DID_ABORT host status.

Prev | Home | Next
dxfer_direction | Up | mx_sb_len