Here's a patch for SCSI REPORT LUN scanning, including Douglas Gilbert's
recent changes to support a short INQUIRY followed by a longer INQUIRY.
Please apply, or let me know if you think it needs any modifications.
It's against linux-2.5.4. It does _not_ change the size of the linux lun.
A description of the 8 byte LUN layout can be found on page 35 of:
ftp://ftp.t10.org/t10/drafts/scc2/scc2r04.pdf
The above is a draft, but matches the layout seen on most disk arrays
(including EMC, IBM, LSI, and Hitachi). Later drafts (post SCSI-3) have
this information in the SCSI Architectural Model.
Patch description:
Adds REPORT LUN scanning.
Adds Douglas Gilbert's INQUIRY modification so broken devices that cannot handlean INQUIRY
of more than 36 bytes can be black-listed, plus saving the INQUIRY
result in Scsi_Device.
Adds scan_scsis_target function, replacing code in scan_scsis and parts
of scan_scsis_single. This cleans up the scanning code, and removes a
really ugly for loop. It would be difficult to add REPORT LUN scanning
without this change.
Adds missing scsi_release_commandblocks().
No longer sets max_dev_lun out of bounds for BLIST_FORCELUN devices.
Fixes scanning past LUN 7 for SCSI-3 devices (the patch in 2.4.17
for that fix will not cleanly apply against this code).