summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2008-05-12Fix device reference counting. Now that we try to support detachableKenneth R Westerback
tape drives it is nice not to crash if one is detached. Basically use a consistant mechanism modelled on sd to lookup devices and do the device reference increments and decrements. Problem reported (PR#5811) and fix tested by Jozef Hatala. Still some corner cases Jozef is looking for but we'll fix those as discovered.
2008-05-09Lock in removable media while trying to determine the disk parameters. ThisKenneth R Westerback
should fix a number of 'drive offline' situations where the device claims it has no media loaded until the lock in occurs. Like a Blackberry Pearl Todd Fries found and probably other USB devices. Move the lock in during device open to before the test unit ready to eliminate similar spurious rejections of the device. Feedback from marco@, tests by todd@ and miod@. ok deraadt@ beck@ dlg@ miod@
2008-05-09Oops. When detaching tape drives look for devices using 'stopen' notKenneth R Westerback
devices using 'sdopen'. PR#5810 from Jozef Hatala. ok beck@
2008-04-24Say 'ATAPI' rather than 'SCSIn' for ATAPI devices found on (pseudo)Kenneth R Westerback
SCSI buses like atapiscsi. This more accurately describes the commands that will be used on the device. ok dlg@
2008-04-10fix the macros that are used to read the devid vpd page.David Gwynne
2008-03-21USB Floppies are umass devices so we always use the default 63/255Kenneth R Westerback
geometry. But 63 * 255 > 2880 and the cylinder count becomes 0. So if we end up with a valid disksize but 0 cylinders, set heads = cylinders = 1 and sectors-per-track = disksize.
2007-12-29the scsi layer always had function pointers for asking the hba about aDavid Gwynne
device before issuing scsi commands to it, but it was never implemented, never used, and no hba actually filled them in. i came along and added another two function pointers for the same thing. this cleans up the extra pointers. ok krw@ marco@ miod@ deraadt@
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-11-27typos; ok jmc@Martynas Venckus
sys/dev/pci/pciide.c from naddy@
2007-11-26let scsibus ask the adapter about a device before probing it. also allowDavid Gwynne
the adapter to be notified when a device goes away so it can free any state it maintains about that device. ok deraadt@ marco@
2007-11-25dont use the adapter_softc member of scsi_link as a softc anymore. theDavid Gwynne
"adapter_softc" is simply a way for the adapter to determine what scsibus it is now dealing with, not a pointer back to the adapters device struct. ok deraadt@ marco@
2007-11-23if we cant fetch the serial then fill it with "(unknown)".David Gwynne
2007-11-22Ansi-fy.Kenneth R Westerback
2007-11-22Ooops. Don't de-reference st until after it has been pointed at theKenneth R Westerback
correct st_softc. Fixes 'mt rewoffl' panics, as reported on misc@ by Jeff Ross and reproduced on my tape machine.
2007-11-16convert code over from sd.c, to let tapes discollect. Lucas StefanuttiTheo de Raadt
of pr 5635 confirms this works for him. similar diff authored by krw who was unaware i wrote this and mailed it to Lucas...
2007-11-11Revert useless textual optimization that resulted in 16 bytes beingKenneth R Westerback
sent to the adapter instead of the 10 bytes the scsi_sychronize_cache command actually occupies. This freaked out the ahc on jsing@'s SGI and probably others. Found, isolated, fix tested, and ok jsing@
2007-11-06Fix SDF_DIRTY handling, eliminate useless SDF_FLUSHING. The sd_flush()Kenneth R Westerback
called from the last sdclose() on a device will now reset SDF_DIRTY after submitting the SYNCHRONIZE CACHE command. sddone() need not worry about SDF_DIRTY since it was never called for the SYNCHRONIZE CACHE command anyway. This eliminates a spurious SYNCHRONIZE CACHE command being issued for every sd device from sd_shutdown(). ok dlg@
2007-09-16A couple of obvious bzero() -> M_ZERO changes I missed.Kenneth R Westerback
2007-09-16MALLOC/FREE -> malloc/free, M_ZERO, extraneous casts,Kenneth R Westerback
extraneous #include <malloc.h>
2007-09-15Allow to pull out an usb stick with ffs filesystem while mountedAlexander Bluhm
and a file is written onto the stick. Without these fixes the machine panics or hangs. The usb fix calls the callback when the stick is pulled out to free the associated buffers. Otherwise we have busy buffers for ever and the automatic unmount will panic. The change in the scsi layer prevents passing down further dirty buffers to usb after the stick has been deactivated. In vfs the automatic unmount has moved from the function vgonel() to vop_generic_revoke(). Both are called when the sd device's vnode is removed. In vgonel() the VXLOCK is already held which can cause a deadlock. So call dounmount() earlier. ok krw@, I like this marco@, tested by ian@
2007-09-07The obvious bzero/memset -> M_ZERO changes.Kenneth R Westerback
2007-06-24rework sensor tasks to use the kernels generic workq rather than a specialDavid Gwynne
kernel thread of its own. the api has changed (which will be fixed in the manpage shortly) so all the users of sensor tasks that i can find have been fixed too. noone tested, so its going in to force people to run with it. "put it in" deraadt@
2007-06-23Implement disk sizes > 2^32-1. Code modelled on NetBSD.Kenneth R Westerback
Tested, tweaked and ok otto@
2007-06-20b_cylinder does not need to be set on the callpath down into drivers.Theo de Raadt
cpu_disklabel can go away, since nothing anymore needs to use it; ok miod
2007-06-18avoid modification race in DIOCRLDINFO; ok krw miodTheo de Raadt
2007-06-08all drivers should spoof version 1 labelsTheo de Raadt
2007-06-07in OpenBSD as all old BSD unix, RAW_PART always starts at 0, so noTheo de Raadt
need for special case code; ok krw
2007-06-06now that all partition size/offsets are potentially 64-bit, change theTheo de Raadt
type of all variables to daddr64_t. this includes the APIs for XXsize() and XXdump(), all range checks inside bio drivers, internal variables for disklabel handling, and even uvm's swap offsets. re-read numerous times by otto, miod, krw, thib to look for errors
2007-06-05use six new macros to access & store the 48-bit disklabel fields relatedTheo de Raadt
to size. tested on almost all machines, double checked by miod and krw next comes the type handling surrounding these values
2007-06-01backout r1.33: temperature sensor description was removed on purpose,Constantine A. Murenin
because it started to be part of the sysctl variable name ok deanna@, dlg@
2007-06-01Fix snprintf(9) truncation check and skip the check for -1 becauseMoritz Jodeit
only the libc snprintf(3) could return this. ok krw@
2007-06-01No need for tape fields to be daddr_t. int will do.Kenneth R Westerback
ok beck@ deraadt@
2007-06-01Don't initialize d_partitions[RAW_DISK] just before callingKenneth R Westerback
readdisklabel(), since all readdisklabel()'s do that already. ok deraadt@
2007-05-31ckuethe found i missed a file in the workq update. my badTed Unangst
2007-05-31remove the scsi task thread, and replace it with the system workq.David Gwynne
"just :wq and do it" tedu@
2007-05-31Use 12 and 16 byte read/write commands as required by the size/lengthKenneth R Westerback
of the I/O being attempted. Throw in a comment typo fix to properly refer to sectors and not blocks. ok marco@
2007-05-27add more struct/define stuff for use in cdioMichael Coulter
ok krw@
2007-05-25ANSI-fication, minor KNF. No code change. My plane had power outletsKenneth R Westerback
this time!
2007-05-08all scsidebug_*-using code is under #ifdef, so the variables themselves ↵Theo de Raadt
should be too
2007-05-04lockmgr -> rwlock.Kenneth R Westerback
"reads good" art@ ok marco@
2007-04-28Fix comments above DISKMINOR uses. DISKMINOR provides minor not majorKenneth R Westerback
number (wd.c), and the uses are to find the minimum minor to be detached.
2007-04-26Use the standard DISKPART/DISKUNIT/etc. defines rather than identicalKenneth R Westerback
but differently named SD/CD ones. No change to .o files. ok deraadt@ dlg@
2007-04-14For devices unwilling or unable to report geometry, change the 'fake'Kenneth R Westerback
geometry used to 255 heads and 63 sectors/track from 64 heads and 32 sectors. 255/63 makes the cylinders as large as PC/BIOS compatibility allows, increasing the size of devices that can be supported. ok pedro@ (long ago) marco@ millert@ weingart@
2007-04-13If a removable device refuses to process PREVENT_ALLOW to lock theKenneth R Westerback
media in while the device is open, allow the open anyway. Fixes some USB devices which do odd things when presented by PREVENT_ALLOW. Suggestion from mickey@. ok millert@ 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-12Add cd_kill_buffers() as a separate function, like sd_kill_buffers()Kenneth R Westerback
and for the same reason of preparing for safer handling of users yanking usb devices out. No functional change. Copied from bluhm@'s change to sd.c.
2007-04-11Use a separate function to remove the buffers in sddetach.Alexander Bluhm
No functional change. ok krw
2007-04-10``it's'' -> ``its'' when the grammar gods require this change.Miod Vallat
2007-04-10Name and cast all struct sd_softc *sd the same way. No binary change.Alexander Bluhm
ok krw
2007-04-10Always use idiom 'struct cd_softc *cd = (struct cd_softc *)self'. SpottedKenneth R Westerback
by bluhm@ for sd. No change to cd.o.