summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2006-05-31fix treeTheo de Raadt
2006-05-31 Add support for primary and alternate volume tags to ch(4) - borrowedBob Beck
and adapted from FreeBSD. This adds the ability for status requests to ask for the volume tags (usually bar codes, on changers with a bar code reader) on media inthe library. ok deraadt@, krw@
2006-05-28Miscellaneous fixes.Kenneth R Westerback
1) Check the return value from st_mount_tape(). 2) Always call st_unmount() if the media goes missing. 3) Use the special handling for 'Unit in the process of becoming ready' for the TEST UNIT READY command in stopen(). 4) Don't unmount a tape during stopen() just because it doesn't have the current default density. Eliminate now unused last_dsty member of st_softc. tested & ok beck@
2006-05-28This commit changes the interpret_sense routine for st to catch theBob Beck
"Unit Becoming Ready" case, and just like ch, allow the driver to continue waiting, as long as the unit continues to promise us that the unit is becoming ready. This avoids the case of slow tape drives taking forever to bring media online requiring a huge retry count being set for all commands, and like ch, will wait indefinately only in this case. All other cases are handled as before. ok krw@
2006-05-28In the absence of a coherent concept of 'RAW' tape devices, pass allKenneth R Westerback
unhandled ioctl requests to scsi_do_ioctl() like ch.c does. Previously only the mythical 'control devices' with certain minor numbers would pass the requests along. ok beck@
2006-05-28Whack a 'control device' leftover. Actually save the new density, etc.Kenneth R Westerback
that was just accepted by the device, no matter what the minor is. ok beck@
2006-05-28We don't have 'control devices' for st. Nor are we likely to get anyKenneth R Westerback
in the foreseeable future. Eliminate half-baked, semi-operational code that tried to handle such devices. People who had stumbled across the previous control-like behaviour of erstX devices should not be relying on these semantics. Suggested by deraadt@. ok beck@
2006-05-28ST_NEW_MOUNT was set/reset in a number of places but only examined insideKenneth R Westerback
a #if notyet/#endif block. It's been 'notyet' since 1995. Eliminate it. 'flense!' beck@
2006-05-28Fix open(2) semantics for ch(4) to not be completely on fresh minty crack:Bob Beck
1) Don't use SCSI_IGNORE_NOT_READY when doing test_unit ready to wait for the device to come up. 2) use SCSI_IGNORE_ILLEGAL_REQUEST when doing test_unit_ready to wait for the device to come up (just as is done in st(4)) 3) add a ch_interpret_sense routing to perform special handling of the case where the unit is in the process of becoming ready. Hope springs eternal, that if the device tells us it is trying to become ready, then we should wait for it to do so, however long it takes (and on tape library scans this can take a while - i.e. a few minutes for large libraries). The custom handler ensures that the retry count is not decremented in this case and this case only. ok krw@
2006-05-28Add PCATCH to tsleep flags when a scsi command is waiting for an openingBob Beck
or is waiting to be retried, abort it when a signal interrupts the tsleep(). This fixes what was commited in version 1.92 to work properly. ok krw@
2006-05-28Use TEST_READY_RETRIES_TAPE instead of TEST_READY_RETRIES_DEFAULT,Kenneth R Westerback
thus allowing tape drives more time to become ready. ok beck@
2006-05-28Use bit 23 of the device minor to indicate a control mode device. AKenneth R Westerback
control mode device can be opened but does not permit any i/o. Currently no such devices are created by MAKEDEV. However the previous code used bits 0 and 1 of the minor being set to indicate a control device. This conflicted with other uses of device minors to indicate things like rewind and eject. This behaviour would result in an open of a newly loaded tape drive failing until the tape was successfully mounted as a side effect of another command like 'mt status'. ok beck@
2006-05-28Always allow ioctl's to work, even if there is no media loaded.Kenneth R Westerback
Analogous to what sd does for the raw partition. Eliminates useless error messages and premature command completion. e.g. 'mt status' will wait for media to to finish loading. ok beck@
2006-05-28Don't print tape media information during probe. This is transitoryKenneth R Westerback
information that doesn't have anything to do with the device. We don't say 'cd drive empty or not ready." ok beck@
2006-05-21replace lockmgr with rwlock.David Gwynne
2006-05-18paramter -> parameterMiod Vallat
2006-05-18Test the state of a disk *after* spinning it up and not before. ThisKenneth R Westerback
prevents the issuing of sizing inquiries to non-existant or non-responsive devices like empty slots on a USB card reader. Also try to avoid *extremely* unlikely loop of scsi_start() commands, by not using sd_interpret_sense() until after the disk is spinning. ok dlg@
2006-05-13And the fallout from Manuel Pata's USB reader rumbles on ...Kenneth R Westerback
Fix the display of the device info for umass devices at lun 0 by passing the correct inquiry data to config_attach. i.e. not the inquiry data for lun 1, which we gratuitously probe to prevent USB card readers from 'helpfully' lying about who is where, but the inquiry data for lun 0 we have saved in sc_link->inqdata.
2006-05-13When SCSIDEBUG'ing, display the return value of scsi_interpret_sense()Kenneth R Westerback
in hex. This makes it consistant with the display of the same value in other messages.
2006-05-11Zap trailing whitespace.Kenneth R Westerback
2006-05-09make sensor names look more normal; ok dlgTheo de Raadt
2006-05-07If a device says a MODE SENSE command worked fine, do *not* try a MODEKenneth R Westerback
SENSE BIG command even if no page data was returned. Just accept the fact that the device does not have any such page data. This is more in line with the spec, and unbreaks devices (like the Neodio 8-in-1 USB Card Reader donated by Manuel Pata) which freak out when getting a MODE SENSE BIG. Should not break any 'working' device. ok pedro@ dlg@ marco@ 'Looks correct.' miod@
2006-05-07Zap a bunch of trailing whitespace.Kenneth R Westerback
2006-04-20Fix various printf() issues: too many arguments, not enough arguments, argumentMiod Vallat
order reversed, wrong modifiers. ok deraadt@ marco@ mickey@
2006-03-15Nuke dk_establish(), no longer used.Miod Vallat
2006-03-05Remove NetBSDism NRND. Pointed out by Mickey.Kenneth R Westerback
ok miod@ marco@
2006-03-04Typos grab bag of the month, eyeballed by jmc@Miod Vallat
2006-02-06typos from alexey dobriyan;Jason McIntyre
2006-01-21Invoke disk_detach() and related cleanup work in detach(), rather thanMiod Vallat
zeroref() - just to be on the safe side, should we mess up our ref count.
2006-01-19Replace SENSOR_ADD() macro with a pair of functionsAlexander Yurchenko
sensor_add()/sensor_del() so that sensors can be attached and detached dynamicaly. ok kettenis@ deraadt@ dlg@
2006-01-18Don't index before the start of the sc_link array if scsi_probe_bus()Kenneth R Westerback
is called with a target of -1 and a valid lun. Spotted by Miod. ok miod@
2006-01-17Use strchr() from libkern instead of rolling our own.Miod Vallat
2006-01-17Need to device_unreg() the implicit device_ref() done by cdlookup() inMiod Vallat
cdminphys().
2006-01-12Don't populate the fabricated disklabel's partition info from trackKenneth R Westerback
information in the TOC. The partition info is just overwritten or rendered incomplete by readdisklabel(). Just examine the TOC to determine if the cd is audio only, i.e. it has a valid TOC but no data tracks. In this case don't call readdisklabel(). Much simpler code. No functional change for single data track CD's like the install media. ok pedro@.
2006-01-11dont print anything if we're unable to read the status pageDavid Gwynne
requested by deraadt@
2006-01-08i cant spell my own name.David Gwynne
noticed by miod@
2005-12-25Cleanup/fix cdgetdisklabel() byKenneth R Westerback
1) Using cd_load_toc() instead of replicating code. 2) Using struct cd_toc and betoh32() like other parts of cd.c. 3) Restoring pre-Sept. 26 behaviour of trying to read usable disklabel info if there is no TOC. i.e. avoid readdisklabel() only when it is an audio-only CD. Stop abusing spoofonly. Tested by mjc@
2005-12-23Make cd_load_toc() take an address mode parameter, clean up a bit.Kenneth R Westerback
Add a check for ending_track < starting_track before calculating size of TOC to read. Tested by mjc@
2005-12-22Move a struct cd_toc (800 bytes) from the stack to malloc'ed memory.Kenneth R Westerback
bzero() all malloc'ed cd_toc structs because cd_read_toc() will only zero as much as it is trying to read. malloc M_TEMP memory instead of M_DEVBUF memory for the cd_toc structs. ok deraadt@
2005-12-22Initialize data_track before a 'goto done;' could lead to it beingKenneth R Westerback
used.
2005-12-17Kill unreachable code. Found by lint.Kenneth R Westerback
ok kettenis@ deraadt@ pedro@ miod@
2005-12-15A sanity check for an unsigned variable being < 0 after a subtractionKenneth R Westerback
is not useful. Check the value about to be subtracted. Spotted by lint.
2005-12-10in ansi c, bitfields must be done against int, unsigned int, or _Bool.Theo de Raadt
so we must start to use u_int; ok cloder
2005-12-10in ansi c, bitfields must be done against int, unsigned int, or _Bool.Theo de Raadt
so we must start to use u_int; ok cloder
2005-12-08Don't panic for pathological i/o sizes unless minphys() really isKenneth R Westerback
broken. Eliminate an unneeded variable and potential conversion issues in SCIOCCOMMAND code before calling physio. Similar to what NetBSD does. Fixes cdda2wav vs "Billie Holiday - Songs for Distingue Lovers" problem noted by Alexandre Ratchov. Tested by Alexandre. ok marco@ pedro@ deraadt@ mickey@
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