summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2005-12-02Remove one tab that cause a line to overflow. No functional change.Marco Peereboom
2005-12-02Missing 'break;'. Spotted by lint.Kenneth R Westerback
ok dlg@
2005-11-28fix month-old breakage found by genududes (after henning's breakage)Michael Shalayeff
2005-11-19Remove unnecessary lockmgr() archaism that was costing too much in termsPedro Martelletto
of panics and bugfixes. Access curproc directly, do not expect a process pointer as an argument. Should fix many "process context required" bugs. Incentive and okay millert@, okay marc@. Various testing, thanks.
2005-11-17Don't forget to device_unref() in sdclose() if sdlock() fails; ok krw@Miod Vallat
2005-11-17Use sectors as the size units for the RAW_PART (i.e. 'c') partition inKenneth R Westerback
spoofed sd disklabels. Sectors are the partition size units used and documented everywhere else in the tree. sd ensures a sector will always be a multiple of 512. Fixes disklabel(8) error messages and partition size display for sd devices that have no OpenBSD disklabel and a sectorsize > 512. Noted by Robert Szasz on his Sony Hi-MD device. ok pedro@ marco@
2005-11-13Allow removable disks to be spun up if they ask for initializationKenneth R Westerback
after being opened. Use SC_DEBUG() to suppress some verbiage during spin up. Return actual errors encountered during attempt to spin up, rather than always returning EIO. ok dlg@
2005-11-13ATAPI Tape drives need 6 byte MODE SENSE commands according to atKenneth R Westerback
least one spec. Unlike other ATAPI devices. Fixes PR #4611.
2005-11-13Use SCSI_DELAY only once. Document it. Default to no delay.Kenneth R Westerback
Fixes two second system 'freeze' when umass device plugged in. Speeds up boot by not waiting for a minimum of 2 seconds at each scsi bus. ok jmc@ pedro@ deraadt@
2005-11-13Use scsi_delay() instead of delay() when waiting for scsi disk toKenneth R Westerback
become ready. Make verbiage SC_DEBUG(). ok dlg@
2005-11-13lock accesses to the buffer so that it wont get confused between theDavid Gwynne
multiple processes using it
2005-11-13lock updates to the buffer with the enclosure status in it so that oneDavid Gwynne
process cant read from it while another one is fetching it from the scsi device. looks ok krw@
2005-11-13if the particular ses device has no slots or sensors to handle, then freeDavid Gwynne
all the resources.
2005-11-12there are two things that safte does: update sensors and blink lights. ifDavid Gwynne
attach figures out that we cant do either of them, then free up all the resources.
2005-11-12clean up unused includesDavid Gwynne
2005-11-12remove the ses kthread goop and use the sensor kthread for updates insteadDavid Gwynne
tested by deraadt@
2005-11-11include sys/device.h. builds on sparc. dlg@ ok.Federico G. Schwindt
2005-11-10remove half the includes since they seem to be unnecessary.David Gwynne
2005-11-10i am a stupid head. unbreak kernels that done have the bio(4) device.David Gwynne
reported and fixed by Michael Knudsen.
2005-11-10cut safte over to using the generic sensors kthread.David Gwynne
2005-11-07Death to superfluous verbiage. Suppress errors when getting the parametersKenneth R Westerback
for a raw partition like we suppress errors for the other operations on raw partitions. Replace 'could not get size' with more specific and informative SC_DEBUG() output. Silences a usb card reader that fgsch@ found. Now attach message is only 'sdX: drive offline'. Tested & ok fgsch@
2005-11-02Abstract delay code out and call it directly from XX_interpret_sense.Kenneth R Westerback
Makes the logic simpler by eliminating the XS_BUSY dance in xs->error, and will allow individual device types to delay different lengths on certain conditions. Allow SCSI_NOSLEEP commands to be retried without waiting. Who knows, they may work even without a delay. ok marco@
2005-10-22When a scsi command is waiting for an opening or is waiting to be retried,Kenneth R Westerback
abort it when a signal interrupts the tsleep(). Suggested by deraadt@. "I really like this" deraadt@ "I like this" marco@
2005-10-16Don't pound UNIT ATTENTION retries in as fast as possible. If we areKenneth R Westerback
going to retry the command, pause for a second to let the condition clear. Just as we do for certain NOT READY conditions. Found with the help of, and fixes Ed Wandasiewicz's IBM USB Memory key. ok deraadt@
2005-10-15Eliminate unnecessary bzero() by only writing valid information.Kenneth R Westerback
Eliminate separate check/break from for() loop. No functional change. ok deraadt@
2005-10-14Eliminate uneeded variable 'i' and use under utilized 'data_track'Kenneth R Westerback
instead. ok deraadt@
2005-10-11use [bl]etohXX instead of ntoh[sl], makes the code more consistent andHans-Joerg Hoexer
better readable. actually no binary change. ok krw@
2005-10-11Change some byte shifting to _4btol() and swap32() calls.Kenneth R Westerback
ok hshoexer@
2005-10-10Some KNF. malloc/free instead of MALLOC/FREE since it's a variableKenneth R Westerback
sized allocation. Remove some dead code.
2005-10-10Make some panic messages more useful.Kenneth R Westerback
2005-10-04shorter name for wait channelTheo de Raadt
2005-09-29fix the check for the type of enclosureDavid Gwynne
2005-09-29Clear SDEV_MEDIA_LOADED for cd media on the last close of a device, asKenneth R Westerback
sd does. Prevents spurious label information from being seen on devices that return NOT READY/UNABLE TO RECOVER TABLE-OF-CONTENTS error (or other sense errors) for blank media. Burning cd's still works. ok marco@ dlg@ fgsch@ deraadt@
2005-09-26Use SCSI_IGNORE_ILLEGAL_REQUEST when reading a cd's table of contents.Kenneth R Westerback
ILLEGAL REQUEST is correctly reported for blank media, as an informative FreeBSD comment pointed out. Ensure the returned table of contents is always initialized to zero. Call readdisklabel with spoofonly = 1 when no data tracks are found. Don't try to read the DOS label from the device if spoofonly is 1. Only done for amd64 here. More archs to follow. Eliminates scsi error messages when attempting to open a cd containing blank media, as pointed out by Michael Coulter. ok deraadt@
2005-09-21Improve readability by using a variable instead of repeatedKenneth R Westerback
calculations. Same as sd.c r1.94.
2005-09-21Missing parenthesis. Same problem was addressed in sd.c r1.90. CouldKenneth R Westerback
fix devices not supporting TEST UNIT READY.
2005-09-19Use variable to eliminate repeated calculation. More readable. NoKenneth R Westerback
functional change. ok dlg@
2005-09-15Don't fake MODE SENSE page 4 info inside raid drivers, just let sdKenneth R Westerback
fake a geometry. Page 4 info does not get used for size information. Eliminate now unused union scsi_disk_pages. ok marco@ mickey@ pre-lock.
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-09-11Some UMASS devices blow up if MODE SENSE buffer length is 0 (aka 256).Kenneth R Westerback
Some blow up if buffer length is not 0. Just fake geometry for all UMASS devices since it's almost always fictitious anyway. One step on the road to eliminate geometry entirely. Fixes Ed Wandasiewicz's 2nd gen iPod mini and Sebastiaan Indesteege's UBest Technology device. ok marco@
2005-09-08free(NULL, ...) is not safe in the kernel. So check for NULL'nessKenneth R Westerback
before free()'ing buf in sd_get_parms(). Tweak code so there is only one free(buf, ...) to worry about. ok deraadt@.
2005-08-29If a buffer larger than the max allowed is offered to scsi_mode_sense()Kenneth R Westerback
or scsi_mode_sense_big(), use as much of it as is allowed. Don't justi mask off the higher bits and possibly leave yourself with 0 space. Fixes problem aoyama@ found on luna88k tape drive. ok deraadt@.
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-27Put in missing parenthesis and thus always passKenneth R Westerback
SCSI_IGNORE_ILLEGAL_REQUEST and SCSI_IGNORE_MEDIA_CHANGE flags to scsi_test_unit_ready() and scsi_start() during sdopen(). Re-enables use of devices that don't support START_STOP or TEST_UNIT_READY commands. Noted by and fix tested by Jason Crawford on VMWare disks. ok dlg@ henning@, supportive comments from miod@.
2005-08-24dont reject safte devices that have more inquiry information than theDavid Gwynne
space we want to store it in. thanks to mtu for providing access to hardware for this. ok deraadt@
2005-08-24Test xs->bp before de-referencing it. Initialize it to NULL, not 0.Kenneth R Westerback
ok deraadt@
2005-08-23setting the FAULT flag on a device so the alarm led blinks may haveDavid Gwynne
unwanted side effects, eg, disabling both fc ports and powering the disk down. so remove this knob for now. ok deraadt@
2005-08-23Move uses of struct scsi_mode_sense_buf (255 bytes each) from theKenneth R Westerback
stack into malloc'd memory. ok deraadt@
2005-08-23Spin up sd units even if TEST_UNIT_READY says they're ready.Kenneth R Westerback
Use consistant scsi_autoconf and SCSI_SILENT flags in scsi_test_unit()/scsi_start() pairs. Fixes some hppa, vax, sparc systems that do not spin up disks automatically. Keeps USB card readers and such reasonably quiet. Noted by millert@ (hppa), henning@ (sparc) and hshoexer@ (vax). ok deraadt@
2005-08-23Test for cold and apply relevant flags for all scsi commands.Marco Peereboom
ok dlg@ krw@ deraadt@