Continuing the expansion of linux SCSI sense handling to decode descriptor format, attached is a major rework of constants.c. It addresses various other issues. This gzipped patch is against 2.6.10-rc1 which includes "struct scsi_sense_hdr" introduced in James's "[BK PATCH] SCSI updates for 2.6.9" patch. Output from this patch can be seen with a sequence like the following. It assumes that the mounted file system storing the log is _not_ using the SCSI subsystem (as the high logging level will cause a logging loop). The logging level can be reduced from 0xffff to 0x1200 . $ sysctl -w dev.scsi.logging_level=0xffff $ modprobe scsi_debug num_parts=2 opts=1 dsense=1 $ sg_readcap -16 /dev/sda Lots of output goes to the console but not from constants.c which uses KERN_INFO on its printk()s. The "dsense=1" option to (recent) scsi_debug drivers instructs them to return descriptor sense format. There should be at least one Unit Attention/power on reset warning in the log after the modprobe. The "sg_readcap -16" sends a READ CAPACITY(16) to /dev/sda (assumed to be a scsi_debug pseudo disk). This causes an error as that command is not supported. Changelog: - bring opcode names, asc/ascq strings and sense format into line with SPC-3 rev 21 (22 September 2004) - drop SCSI-1 sense buffer decoding [still output it in hex] - opcode names include those that depend on service actions including variable length commands ** - decodes both fixed and descriptor sense data formats - use KERN_INFO on printk()s that start on new lines - flag vendor specific asc and acsq codes - print all bytes of a cdb after the name (previously skipped the first byte) - cleanup file, tab to 8 spaces On my i386 machine constants.c compiles to a size of around 33 KBytes when CONFIG_SCSI_CONSTANTS is set and 3 KBytes when it is not. That is considerable more than the +12 KBytes suggested drivers/scsi/Kconfig . ** Strictly speaking opcode names also depend on the peripheral device type of the target device. Currently the external interface to constants.c does not provide the peripheral device type. This should not be a major problem in practice. Doug Gilbert