summaryrefslogtreecommitdiff
path: root/sys/scsi/scsi_all.h
AgeCommit message (Collapse)Author
2013-06-06Fix EOM handling. Makes Bacula much happier by allowing the use ofKenneth R Westerback
both 'Fast Forward Space File = yes' and 'Hardware End of Medium = yes'. Mostly taken from FreeBSD. Constant prodding by robert@, testing actual backup and restore by ajacoutot@.
2011-07-08describe the ata vpd pageDavid Gwynne
2010-12-24Have sd(4) devices check for and respect read-only information theKenneth R Westerback
way st(4) does. Have both decline to open read-only devices for anything but read-only access. Suggestion to fail opens rather than individual i/o's from deraadt@. Problem USB device found and donated by chefren, who also tested diffs. Thanks! ok dlg@ marco@
2010-09-02the page_length field in the vpd page header is 2 bytes, not 1.David Gwynne
ok krw@ marco@ matthew@
2010-09-01ata information vpd page idDavid Gwynne
2010-06-29Shrink struct scsi_sense_data and thus the sense member of scsi_xfer,Kenneth R Westerback
to 18 bytes by removing the extra_bytes field. sbic.c was the only consumer, and that was in a DEBUG message. 18 bytes is the minimum length mandated by the SCSI spec. Anything more is vendor/device specific information. This fixes a usb key that yuo@ had, and probably others. Any device that decides to pay attention to extra sense data must allocate its own space. ok marco@ matthew@ miod@ yuo@
2010-04-23the SAT spec from t10.org defines messages for tunnelling ATA commands overDavid Gwynne
SCSI when you're talking to a scsi to ata translation layer (satl). this implements the ata command ioctl handler in scsi_ioctl.c that wraps the ata command requests up in these scsi commands and then issues them against the hardware. this cuts atascsi over to interpreting these scsi commands rather than the ioctls directly. this should allow mpi users (with a relatively recent firmware) to use atactl against their SATA disks. i cant test cos my mpi(4) parts are too old to either support these scsi commands or too old to take recent firmwares. ok marco@ @krw tested by krw@ and me on ahci/atascsi
2009-10-12mask bits correctly in devid vpd for the PIDavid Gwynne
2008-06-02Shrink scsi_mode_sense_buf to 254 bytes so ahci doesn't get upset atKenneth R Westerback
trying to dma-map odd length data areas. No other alignment should be required according to miod@. Makes my new SATA tape drive work. ok deraadt@
2008-04-10fix the macros that are used to read the devid vpd page.David Gwynne
2007-12-28massage the way vpds are defined. rename the page used for the devicesDavid Gwynne
serial number and split the vpd header out for use in other places. while here define the device identification page bits too. ok krw@ marco@
2007-04-12The beginnings of support for 16-byte cdb's in the scsi code. This isTobias Weingartner
so we will be able to address devices larger than the 10-byte cdb's allow us to do. ok krw@, dlg@
2007-04-03define the vpd inquiry page code.David Gwynne
2007-04-03modernise scsi_inquiry. the length field has grown and now theres pages toDavid Gwynne
query. ok krw@
2006-11-27more magic removalBob Beck
ok miod@, deraadt@
2006-11-27get rid of the rest of the asc/ascq magic codes in scsiBob Beck
ok marco@, deraadt@
2006-11-27rework asc/ascq handling to get rid of "magic" 0x values in the code, changesBob Beck
asc/ascq handling to deal with the pair together rather than seperately, since modern scsi has long since polluted the "categories" of asc enough that you pretty much need to always look as ascq. ok krw@ deraadt@, dlg@
2006-07-29Zap a couple of unused defines - SID_ANSI_SCSI2 and SID_ANSI_SCSI3.Kenneth R Westerback
2006-07-23Use REPORT LUNS to get the list of LUNs to probe. If such a list isKenneth R Westerback
obtained probe the LUNs given without checking for duplicate INQUIRY data. For non-USB, non-ATAPI, devices claiming to be SCSI-3 compliant. And the target must have something attached at LUN 0. If REPORT LUNS can't be used or isn't supported, the old scan process is used. Fixes Fibre Channel and SCSI enclosure devices that provide identical INQUIRY data for all LUNs and were thus being misprobed as having only LUN 0. Tested by Bob Kitella, dlg@, beck@. Suggestions from deraadt@. ok dlg@ beck@
2006-05-11Zap trailing whitespace.Kenneth R Westerback
2005-09-11Simplify code by changing struct scsi_mode_sense_buf{ union {}Kenneth R Westerback
headers; } to just union scsi_mode_sense_buf {}. No functional change. ok marco@
2005-08-29Make sure certain architectures/compilers don't round up the size ofKenneth R Westerback
struct scsi_mode_sense_buf to 256, a value which doesn't fit in the 1 byte length field of a scsi command. Found by aoyama@ on luna88k. Suggested by miod@. ok deraadt@.
2005-08-17add a macro for the WRITE_BUFFER opcodeDavid Gwynne
ok marco@ krw@
2005-08-09Add Vital Product Data structure. Requested deraadt@ ok dlg@Marco Peereboom
2005-08-05a define for the scsi READ BUFFER opcodeDavid Gwynne
for and ok marco@
2005-08-04Add SCSI 3 define. ok dlg@Marco Peereboom
2005-07-25SID_ANSII_SCSI2 is a valid value of SID_ANSIIDavid Gwynne
ok marco@
2005-06-18Shorten a couple of structure names:Kenneth R Westerback
scsi_mode_direct_blk_desc -> scsi_direct_blk_desc scsi_mode_blk_desc_big -> scsi_blk_desc_big
2005-06-12It turns out you need to ask for 16 byte block descriptors. We don't,Kenneth R Westerback
so eliminate code dealing with 16 byte block descriptors. No one else seems to use them anyway. Add define for appropriate permission bit in case we ever need it. Simplify and clean up scsi_do_mode_sense() code as a result. Strengthen check to ensure block descriptor data is a valid by checking if it is a multiple of 8 bytes rather than just > 8 bytes. Moves code to closer to what it was before scsi_do_mode_sense().
2005-06-03Tweak scsi_do_mode_sense(). NetBSD was right and I was wrong. Sigh.Kenneth R Westerback
Add 'big' parameter to report which mode sense header type is being returned. Eliminate icky pointer arithmetic, since it won't work if only block descriptors are returned by the device. No functional change.
2005-05-27Reduce size of scsi_mode_sense_buf to 255 characters from 256. FixesKenneth R Westerback
Lexar Jumpdrive and probably others. Use better structure declaration idiom, as suggested by drahn@.
2005-05-25Introduce safer, more general mode sense capability. Transparently useKenneth R Westerback
both 10 byte and 6 byte MODE SENSE commands and just return error checked values. Convert sd_scsi.c to use new mechanism for non-optical drives. USB umass devices will now display actual mode sense info if it is available via a 10 byte MODE SENSE. Which may mean 0 heads, etc. is shown until cosmetics are finalized. ok marco@ 'that is pretty cool' deraadt@
2005-04-06Remove ses crud.Marco Peereboom
Requested and ok mickey@
2005-04-06Add status/receive ses structures and #defines.Marco Peereboom
2005-04-06Add control/send structures.Marco Peereboom
ok krw@
2005-04-06Add RECEIVE_DIAGNOSTIC & SEND_DIAGNOSTIC #defines for SES.Marco Peereboom
2004-12-18Add SPI status information unit structure and defines, along with someKenneth R Westerback
command information unit 'Task Management Flags' defines. From FreeBSD with a few tweaks. For ahd. ok tdeval@ marco@.
2004-07-31Remove scsi_change_def() and related command structure. Its only useKenneth R Westerback
in the tree is #ifdef'd out and is fundamentally wrong anyway - it tries to force *all* devices to SCSI-2. Also recent SCSI specs seem to have marked the command as obsolete. Bonus - eliminates another undocumented option (SCSI_2_DEF). Found in a list of unused kernel functions posted to tech-kern@netbsd by Krister Walfridsson in 2002. ok marco@ tdeval@
2004-02-21Eliminate the quirks SDEV_NOSTARTUNIT, UMASS_QUIRK_NO_START_STOP, andKenneth R Westerback
UMASS_QUIRK_FORCE_SHORT_INQUIRY. Fixes a bunch of USB devices. Based on work by Mycroft in NetBSD. ok tdeval@ deraadt@.
2004-01-04Rewrite scsi_decode_sense() to clean up code; eliminate many magicKenneth R Westerback
numbers; fix passing a NULL to %s under some circumstances; fix the bit index mask; etc. No change in output. ok deraadt@.
2002-12-15Fix/Cleanup some SCSI #defines.Kenneth R Westerback
1) Correctly define MODE_SENSE_BIG as 0x5a, not 0x54. 2) Delete duplicate #define's of some opcodes in scsi_disk.h. 3) Delete multiple #define's for same opcode in scsi_disk.h. 4) Replace uses of deleted opcodes in umass.c with remaining ones. ok millert@ tdeval@
2002-09-04Add support for RBC (simplified direct) devices.Thierry Deval
ok costa@, krw@
2001-11-11Add missing values for SCSI status byte. Add new name for 0x28 toKenneth R Westerback
reflect SCSI-3 editorial change from QUEUE FULL to TASK SET FULL. Use same names as NetBSD where possible. Some from NetBSD, some from Ashley M, some from SCSI-3 docs. Now to edit drivers to use new constants instead of their own.
2001-06-22KNFTheo de Raadt
2001-04-08Add one more 1 byte (reserved, as defined in spc-2) field to theKenneth R Westerback
scsi_inquiry_data structure. The last commit made the structure 57 bytes long, an odd number. This caused problems with at least two drivers, which were not prepared to handle the IGNORE WIDE RESIDUE message during probing. This message apparently being generated during probes of non-existant LUNs. Problem found on siop by Rev. Chris Cappuccio and on iha by Andreas Gunnarsson <andreas@zzlevo.net>.
2001-04-02Add padding and new field 'flags2' to struct scsi_inquiry_data,Kenneth R Westerback
bringing it in line with the spc-2 definition of standard inquiry data. scsi_inquiry_data grows from 50 to 57 bytes in size. The new 'flags2' field gives access to PPR related information, the IUS, QAS and DT bits, used in negotiating Ultra3 transfers. Also add PPR related extended message defines. ok deraadt@
2001-01-09Typo: dome -> someKenneth R Westerback
2000-02-21Add in Enclosure device type (0xd/13). Pad out inquiry data to 50 bytesmjacob
os that SAF-TE devices can be found.
1999-07-25Merge sd stuff from NetBSD-current. Helps with LS-120, ZIPConstantine Sapuntzakis
More SCSI logic from NetBSD-current Some tape fixes. ATAPI tapes do not work yet for most operations.
1997-04-14Merge in various pieces of current NetBSD scsi code, including but not limitedJason Downs
to: * New changer driver. * Better optical support. * Different `done' semantics. * New quirks for SCSI QIC tape driver, SCSI floppy drives. * Better support for SCSI-I devices. Everybody needs to test this.