summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2005-05-27No longer used after merge of atapi/scsi cd code.Kenneth R Westerback
2005-05-27Convert cd code to new mode sense framework. Merge cd_scsi andKenneth R Westerback
cd_atapi into cd since code is now almost identical, and only affects volume adjusting ioctl's. Minor side effect of allowing cd_load_unload() attempts to scsi cd's as NetBSD does.
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-26Use new mode sense mechanism for atapi disks. Make sure that fakeKenneth R Westerback
geometry is set even if (as for some USB devices) the MODE SENSE works but zero values are returned for cylinders/heads/sectors. This fixes my USB floppy which returns 0/0/0.
2005-05-25With PQUIK_NOMODESENSE gone, SDEV_NOMODESENSE can go too.Kenneth R Westerback
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-05-24When processing the flex_geometry page, don't use a reduced_geometryKenneth R Westerback
field to get the blocksize. ok marco@
2005-05-23Remove superfluous and confusing define and use correct field namesKenneth R Westerback
instead.
2005-05-23Don't bzero() data before calling scsi_mode_sense[_big]() sinceKenneth R Westerback
scsi_mode_sense[_big] bzero()'s it.
2005-05-23Remove more superfluous structures, etc. No functional change.Kenneth R Westerback
2005-05-22Remove some superfluous structures, etc. No functional change.Kenneth R Westerback
2005-05-22Check if the scsi_request has been released in the COMPLETE case asKenneth R Westerback
was already done in the SUCCESSFULLY_QUEUED case. Shouldn't happen, but better safe than sorry if some driver completes it's io immediately. Also don't recompute saved flags if the request is retried. ok marco@
2005-05-14Unused after last scsi commit.Kenneth R Westerback
2005-05-14Add scsi_mode_[sense|select]_big() and use it instead ofKenneth R Westerback
atapi_mode_[sense|select](). This will allow the removal of atapi_base.c and atapi_all.h files, and sets the stage for better usb mode sense handling amoung other things. Remove cd_scsibus_[get|set]_mode() and sd_scsibus_mode_sense() shims in favour of scsi_mode_[sense|select](). Add zero'ing of reserved length field in scsi_mode_select(). Change some uchar * type parameters to scsi_mode_header *. No functional changes. Mostly from NetBSD. ok dlg@.
2005-05-07Eliminate 'mode sense (n) returned nonsense' and 'could not mode senseKenneth R Westerback
(4/5)' messages in favour of a single SC_DEBUG() message about the mode sense error. Less useless verbiage. As this eliminates the only SDEV_NOMODESENSE use in scsi/*, eliminate all quirks table entries that used only SDEV_NOMODESENSE. Iomega Zip tested by miod@ to ensure this did not break something. Finally, only fake a geometry if scsi_size() can determine a disk size to fake from.
2005-05-03sdstrategy() shouldn't use values in disklabel until SDEV_MEDIA_LOADEDKenneth R Westerback
is checked. Fixes crash during boot when a device has no media loaded. e.g. a usb card reader with empty slots. From NetBSD. Problem was introduced by last commit to allow RAW_PART+S_IFCHAR opens to always succeed. ok millert@ marco@
2005-05-01Allow RAW_PART+S_IFCHR device opens to succeed even if media notKenneth R Westerback
present. A successful open is required for ioctl's to work. Mostly from NetBSD, partly correcting previous code cleanup error. From deraadt@, treat MTIOCTOP+MTRETEN as CDIOCCLOSE for cd devices (i.e. close the cd drawer). ok deraadt@.
2005-04-28more snprintf error checking. ok krw@Moritz Jodeit
2005-04-28Some really braindead usb devices such as x-in-1 card reader/writersKenneth R Westerback
try to help equally braindead os's by presenting any inserted media as LUN 0 until another LUN is used in a command. Trick them by issuing a gratuitous/harmless INQUIRY to LUN 1 after issuing the LUN 0 INQUIRY but before any other command. Only umass scsi devices with >1 lun are affected. Fixes dlg's reader/writer for one. Lots of diagnosis and testing by dlg@, ok dlg@, ok marco@.
2005-04-27Add SDEV_UMASS flag, analogous to SDEV_ATAPI, and use it to force aKenneth R Westerback
full LUN scan on UMASS SCSI targets. UMASS provides reliable max lun information so we shouldn't waste time. Fixes many x-in-1 card reader/writers that report identical INQUIRY information for every slot they provide. Lots of diagnosis and testing by dlg@, ok dlg@, 'I can live with this' marco@.
2005-04-17Fix typoTom Cosgrove
ok krw@
2005-04-16Nuke another unused structure.Kenneth R Westerback
2005-04-16Nuke unused/duplicate structures and defines in favour of scsi ones.Kenneth R Westerback
ok miod@
2005-04-12Add last pieces of ses crud to enable blink functionality.Marco Peereboom
This file is still a work in progress.
2005-04-09Add page 1 (configuration page) definitions. This is required to interpretMarco Peereboom
page 2 (enclosure control page).
2005-04-06Remove ses crud.Marco Peereboom
Requested and ok mickey@
2005-04-06Move ses crud into its own file.Marco Peereboom
Requested mickey@
2005-04-06Add status/receive ses structures and #defines.Marco Peereboom
2005-04-06De-register scsi.Kenneth R Westerback
2005-04-06Add control/send structures.Marco Peereboom
ok krw@
2005-04-06Remove obsolete file.Kenneth R Westerback
ok deraadt@ tdeval@ henning@ marco@
2005-04-06Add RECEIVE_DIAGNOSTIC & SEND_DIAGNOSTIC #defines for SES.Marco Peereboom
2005-04-05Factor out scsi_mode_sense() and scsi_mode_select() like NetBSD does.Kenneth R Westerback
Eliminate some duplicate structures and defines along the way. SCSI CD drives will now pay attention to the 'flags' parameter for MODE SENSE and MODE SELECT commands. No other functional change. ok tdeval@
2005-04-05Clean up some logic. Use better error handling for sd devices. BeKenneth R Westerback
quiet if raw partition access tried. Be more careful with SDEV_MEDIA_LOADED. Inspired by some NetBSD changes. ok marco@
2005-04-01Cleanup SKEY_NOT_READY logic. Only retry command if it's likely theKenneth R Westerback
condition is going to clear up, which speeds up boot by avoiding delays in disk matching. Return ENODEV if media is not present, which avoids trying to spin up disks that are not present. Use ENODEV in amd64/i386 dkcsum.c to filter failure reports. Mostly from NetBSD. ok marco@
2005-03-30Comment typo, minor knf. No code change.Kenneth R Westerback
2005-03-25Since START_STOP is an optional command that a device need notKenneth R Westerback
support, don't penalize devices that don't support it. May help some usb devices. ok marco@
2005-03-24If READ CAPACITY(10) says there are more than 0xffffffff sectors,Kenneth R Westerback
report 0xffffffff and print a message. READ CAPACITY(16) is needed to get the actual size in this case. ok tdeval@ (a while ago) marco@
2005-03-08Cosmetics...Thierry Deval
Mainly remove space between locators parens, replace spaces with tabs where appropriate and consistently align dependencies.
2005-02-27If test_unit_ready() in sdattach() returns EIO, try to spin up unitKenneth R Westerback
exactly as is done in sdopen(). This improves the chances of getting valid geometry/size and avoiding 'drive offline' errors, without subjecting the device to anything it won't see anyway. No impact on devices that already work. Fixes problem with Jim Rees' Hitachi DK23DA in an Archos Multimedia Jukebox. Without adding quirks! Tested by Jim Rees. ok marco@.
2004-12-28correct snprintf return val mishandling; ok krw marcoTheo de Raadt
2004-12-26Use list and queue macros where applicable to make the code easier to read;Miod Vallat
no change in compiler assembly output.
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-11-30No longer require write permission for read-only SCSI commandsKenneth R Westerback
submitted via ioctl. Eliminate scsi_do_safeioctl(), thus permitting ch, ss and st devices to submit SCSI commands. Return EPERM rather than EBADF when permissions are inadequate. Allows more programs to run with fewer permissions. Problem diagnosed by Nikolay Sturm in mplayer port. Tested by Nikolay, ok deraadt@.
2004-10-17Add some FreeBSD MSG_EXT_PPR_* defines. Will be used in (at least) ahdKenneth R Westerback
to eliminate some magic numbers. ok marco@
2004-10-16Fix 'Tape block size (32754) not a multiple of dump block sizeKenneth R Westerback
(1024).' errors in restore(1). Check for SDEV_OPEN in sc_link->flags (where it lives) rather than sense->flags (where it doesn't). Problem noted by John Danks on misc@ and reinforced by Otto & Hugh. ok marco@ hugh@.
2004-09-15target/lun attributes are optionalMichael Shalayeff
2004-08-01Remove openings = 1 and inherit the value from the HBA instead. This keeps ↵Marco Peereboom
the tape device stuffed with data and therefore it rewinds less often to reposition. ok krw@
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-06-22Add additional retries in TUR to allow for tape devices to settle after a reset.Marco Peereboom
More informative failure message and silence "already open" message. ok krw@