summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2009-08-14Another change to make my life easier when parsing pdus.Claudio Jeker
2009-08-13make scsi_done set ITSDONE on the xs. this means hba drivers dont have toDavid Gwynne
do it (but doesnt preclude them using it internally). discussed with krw@ miod@ and deraadt@
2009-08-13More changes to make the parsing of those evil messages a bit easier.Claudio Jeker
2009-08-13Add more stuff change some fields to make the handling a bit easier.Claudio Jeker
OK dlg@
2009-08-13provide an api for an interrupt (or something like it) to notify theDavid Gwynne
midlayer that a scsi device has appeared or dissapeared. the midlayer will queue an event and run it in the system workq (which has process context) to handle the attach or detach.
2009-08-13Replace the error strings that were being passed around with much simplerTheo de Raadt
errnos. Note that the error strings are being ignored, since we long ago decided to not spam the console, and there is no other nice way to use the errors (without changing the ioctls to pass it back) The errno is now useful, since we can pass b_error from failing IO up, and the drive can decide how to use that ok miod
2009-08-10if mpath steals a link, print out where the link was stolen so dmesg stillDavid Gwynne
shows the physical topology of your system.
2009-08-10pull the printing out of scsibusprint so it can be used against scsi_linkDavid Gwynne
structures by things other than autoconf.
2009-08-09shove a minphys request against mpath down all to the minphys on each pathDavid Gwynne
so we can guarantee that any of the paths we push the io down later will work. with help from a discussion from beck and krw
2009-08-09if a physical path to a device behind mpath goes away, remove the path. itDavid Gwynne
is worth noting that the device on mpath will persist even if all the paths behind it have gone away. returning the paths will allow operations to work against the device again.
2009-08-09add mpath(4), a driver that steals paths to scsi devices if itDavid Gwynne
thinks they could be available via multiple paths. those stolen devices are then made available via mpath(4). this is the minimum amount of code to implement the stealing. it is generally broken and very brittle, so it is currently disabled. it is going in so i can work on it in the tree.
2009-08-08if the adapters wwn fields are set, print them out when attaching scsibus.David Gwynne
we need this to get some clue as to which ports are which on an fc fabric. requested by and ok deraadt@
2009-06-17Revert bufq's. this is inline with the major midlayer reverts thatThordur I. Bjornsson
have been going on. this appears to bring us back to stable state. lots of testing by oga and ariane and my self.
2009-06-06We only really need to #define SYNCHRONIZE_CACHE 0x35 once.Kenneth R Westerback
2009-06-03add a flexible buffer queue (bufq) api, based on the never usedThordur I. Bjornsson
one by tedu@. It doesn't do anything smart yet, it just uses plain old disksort. we also keep the old method of queueing bufs since some miods have crazy MD drivers that need some love. ok beck@, art@ tested by many on many archs.
2009-06-02did not issue scsi_inquire with EVPD flag for USB mass strage classYojiro Uo
device, as some devices will be stalled by the request. ok krw@
2009-03-23actually follow rfc 3720, from Remco.David Gwynne
2009-02-16Extend the scsi_adapter minphys() callback to take a struct scsi_link *Miod Vallat
as additional argument. This will allow intermediate layers between scsi devices such as sd and scsi host adapters to take appropriate action if necessary.
2009-02-16Don't try to SCSIDEBUG targets or luns >31 since we only have 32 bits toKenneth R Westerback
use to identify devices of interest. ok deraadt@
2009-02-16on some buses (eg sas and fc fabrics) the initiator id doesnt meanDavid Gwynne
anything. we represent that in the midlayre by moving the initiator id out of the buswidth. let's not print it in that case. ok deraadt@ kettenis@ krw@ marco@
2009-01-20Prevent unaligned access.Mark Kettenis
ok miod@, dlg@
2009-01-10Get rid of eye-bleeding horror of casting pointers to u_long to addBob Beck
a size to them, because the original author of this stuff obviously didn't grok pointer arithmatic. ok krw@, tedu@, marco@, kettenis@
2009-01-10Add support for the volume buttons and for the eject button foundRobert Nagy
on apple laptops. The eject button will only eject the disc when it's not used by anything. ok miod@
2009-01-10Don't try to cast an lvalue which is forbidden and something pcc, lint,Jonathan Gray
and newer versions of gcc all object to. ok miod@ krw@ beck@
2008-11-26definition of the iscsi wire protocol stuff.David Gwynne
ok deraadt@
2008-11-10clean namespace a fair bit; wrap kernel-use-only structures and gunk inTheo de Raadt
#ifdef _KERNEL
2008-11-09workaround lack of struct proc. this whole mess must be cleaned out.Theo de Raadt
userland processes should not see all the kernel components.
2008-09-22Do not return an uninitialized value on success in stclose().Miod Vallat
ok krw@
2008-09-12SCSI_DATA_UIO is never used. Code which checks for it is either dead orMiod Vallat
commented out, remove it. Unifdef TFS while there. ok marco@ krw@
2008-09-06Return EIO when the residual is > xs->datalen, even if SCSI_SILENT isKenneth R Westerback
set. SCSI_SILENT mediates printing error messages only.
2008-08-24dont display disk geometry (cyls/heads/sectors) since it mostly lies theseDavid Gwynne
days. if you really want it still you can fetch it via disklabel(8). ok krw@ deraadt@
2008-08-01silence failures to run scsi_prevent. dmesg spam sucks.David Gwynne
ok krw@ marco@ miod@ deraadt@
2008-07-28zap some extra spaces and tabs.Federico G. Schwindt
2008-07-26Silence scsi_inquire_vpd() so devices that don't understand the necessaryKenneth R Westerback
INQUIRY options don't spam dmesg during probe. Seen by miod@ and kettenis@ for SCSI CD's. ok miod@
2008-07-26deivce -> device typo fix in comment.Kenneth R Westerback
2008-07-22implement the fetching of a scsi devices "devid". recent hardware providesDavid Gwynne
a vpd page that uniquely identifies a device no matter what bus topology or addressing was used to find it. we have a workaround for old school scsi devices that do not differentiate between luns. if the inq data for high luns is the same as the inq data for lun 0, we assume it is one of these buggy devices. the problem with this is that things like SANs present multiple volumes as luns and they all have the same inq data. if you wanted to present more than one volume to openbsd you would only ever see the first one. devices give us a mechanism to differentiate between luns, so now i do get all my volumes attached in openbsde. review and feedback by krw@ marco@ testing by todd@
2008-07-22tweak comment to reflect the new reality after my last change.David Gwynne
2008-07-21when probing a device the midlayer queries its inquiry data andDavid Gwynne
keeps it on the stack till we attach a driver to it. then it copies the inquiry data int the scsi_link struct. this diff uses the scsi_link struct instead of the stack for that data, which makes the inq data for users of the scsi_link struct available much earlier during device probe. review and feedback from both krw@ and marco@
2008-07-08this makes the code in sdattach less dense by collapsing the flags we passDavid Gwynne
to all the scsi midlayer code into a local variable. ok krw@ marco@
2008-07-05When SCSIDEBUG'ing, print data about to be written (for commandsKenneth R Westerback
flagged SCSI_DATA_OUT) and data that has been returned (for commands flagged SCSI_DATA_IN). This is better than just printing the data buffer before the command is issued since that does not include any data that has been read. e.g. INQUIRY data, as thib@ and I discovered. ok marco@
2008-06-26First pass at removing clauses 3 and 4 from NetBSD licenses.Ray Lai
Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
2008-06-22Replace MUSTEK_RETRIES, SCANJET_RETRIES and ST_RETRIES with SCSI_RETRIES,Kenneth R Westerback
all defined to 4. Replace some magic number 4's with SCSI_RETRIES. Fix a few lines that were now too long.
2008-06-21Oops. Forgot to actually change the retries in scsi_size() to SCSI_RETRIES.Kenneth R Westerback
2008-06-21fgsch@ points out my last commit changed the retry limit for CD capacityKenneth R Westerback
commands. Bump limit back to the standard 4, and at the same time eliminate SDRETRIES and CDRETRIES (both defined to 4) in favour of a new define, SCSI_RETRIES, also defined to 4.
2008-06-21Eliminate cd_size() and use scsi_size() + tweaked cd_get_params()Kenneth R Westerback
instead. We do not make use of the PMI and RELADDR bits in the READ CAPACITY command, and thus there is no difference between cd and sd capacity handling. Brings cd and sd more into line, shrinks code and makes things easier to understand. Make types for blocksize and disksize consistant and MI. Make cdopen() as silent as sdopen(). ok marco@
2008-06-17Nuke unnecessary re-definition of READ_CAPACITY, scsi_read_capacity, andKenneth R Westerback
scsi_read_cap_data as READ_CD_CAPACITY, scsi_read_cd_capacity and scsi_read_cd_cap_data respectively. No functional change as all were identical to their counterparts.
2008-06-15Treat SENSE_NOT_READY_INIT_REQUIRED sense errors the same asKenneth R Westerback
SENSE_NOT_READY_BECOMING_READY sense errors. Some devices such as USB Zip250 drives return the former when they mean the latter. Give the first TEST UNIT READY command three times the usual retries so more devices have time to get ready. This allows more removable devices to detect media details and avoid issuing 'drive offline' messages. ok marco@
2008-06-15Don't bypass partition bounds check for RAW_PART. We now guarantee thatKenneth R Westerback
RAW_PART will always be 0 -> disksize, so the bounds check will always pass for i/o's to valid addresses. Now the i/o will be properly truncated if it goes past the end of the device. This prevents various adverse impacts of issuing i/o's for data past the end of the device. Repeatedly requested by todd@. ok weingart@ deraadt@
2008-06-14Nuke ADEV_NOTUR, always issue TEST UNIT READY to clear out power-upKenneth R Westerback
errors before issuing INQUIRY. Fixes Sony YE-Data floppy drive and probably other devices at the cost of possibly breaking some 10 year old CD-ROM drives. Un-special cases mvme68k which was forcing these initial TURs. Now wait for the inevitable weird USB device that breaks to surface. ok marco@ deraadt@
2008-06-13Merge show_scsi_xs() and show_scsi_cmd() and move invocation so theKenneth R Westerback
debug output shows the xs/command before it's issued rather than displaying it on command completion. Some commands don't come back and it would be nice to see their details. While here nuke invocations of scsi_show* in umass. If you want SCSI debug output use SCSI debug options. Only affects SCSI debug output. ok marco@