summaryrefslogtreecommitdiff
path: root/sys/scsi/scsiconf.h
AgeCommit message (Collapse)Author
2023-05-10Add flag SDEV_UFI so umass_scsi_attach() can provide informationKenneth R Westerback
sufficient to get sdgetdisklabel() to correctly set d_type to DTYPE_FLOPPY in the default disklabel. installboot(8) in particular likes to know it is dealing with a floppy. ok miod@
2022-04-16constify SCSI adapter entry pointsChristian Weisgerber
ok krw@
2020-10-14Introduce scsi_copy_internal_data() to copy 'faked' data from a driver to aKenneth R Westerback
scsi_xfer. Will replace various equivalent functions/hand-rolled chunks, none of which were setting xs->resid.
2020-09-22Since dlg@'s 2009 scsi midlayer refactoring the 'struct scsi_generic *cmd'Kenneth R Westerback
member of 'struct scsi_xfer' has always been pointed at the 'struct scsi_generic cmdstore' member of the same instance. So nuke 'cmdstore' and remove the '*' from cmd. Take the address of cmd as required by the various casts. No intentional functional change. luna88k test by aoyama@, sparc64 test by jmatthew@ Identification of 2009's last *cmd use and ok jmatthew@
2020-08-30Compactify SDEV_/ADEV_ flags & quirks to eliminate the gaps in bit use and thusKenneth R Westerback
allow shrinking the names arrays.
2020-08-28Nuke CDF_ANCIENT, SDF_ANCIENT SDEV_ONLYBIG and bogus check of SID_RelAdr inKenneth R Westerback
favour of simply using the device's claimed SCSI level of support. Except of course for ATAPI/USB devices which often don't claim anything. Keep assuming they are at least SCSI-2. Use consistant tests in sdminphys/cdminphys/sdstart/cdstart.
2020-08-26Remove needless uses of SDEV_ONLYBIG. It was always set when SDEV_UMASS was set,Kenneth R Westerback
and was always checked in concert with SDEV_ATAPI. Just rely on SDEV_ATAPI and SDEV_UMASS in all but the one place sd(4) where SDEV_ONLYBIG is set independently of SDEV_ATAPI/_UMASS. ok jmatthew@
2020-08-16Don't include scsi_debug.h via scsiconf.h. Nobody but scsi/* should be using theKenneth R Westerback
contents thereof. Compile tests by martjn@ (alpha), visa@ (sgi) jmatthew@ (sparc64) aoyama@ (luna88k)
2020-08-14Redistribute and tweak the scsi_[attach|probe|detach]_[bus|target|lun]() code toKenneth R Westerback
make the three variants more similar and easier to understand. Ensures consistent error checks and eliminates pointless adapter_buswidth checks when processing the list of scsi_links.
2020-07-20Move remaining scsi bus initialization info from "prototype scsi link"Kenneth R Westerback
fields to struct scsibus_attach_args. Nuke the struct scsi_link * (saa_sc_link) in scaibus_attach_args. Explicitly initialize each field in scsibus_attach_args variables.
2020-07-19Move the adapter related items (luns, adapter, adapter_target,Kenneth R Westerback
adapter_buswidth, adapter_softc) from struct scsi_link to struct scsibus_attach_args. Additional compile tests by jmatthew@ (sparc64) and aoyam@ (luna88k).
2020-07-16Beef up struct scsibus_softc to hold the information needed toKenneth R Westerback
initialize the scsi_link's on the bus. After sucking this information out of the "prototype" link provided by the scsibus_attach_arg, no need to keep a pointer to that prototype.
2020-07-05Nuke struct scsi_link's "scsibus" member. The two drivers using itKenneth R Westerback
(ahc(4) and qlw(4)) can just compare the values of the "bus" member directly. A slightly different path to the same result that matthew@ traversed in his work culminating in scsiconf.h r1.146.
2020-06-30Nuke unneeded 'sa_inqbuf' member of struct scsi_attach_args. It alwaysKenneth R Westerback
points to the inquiry data contained in the struct scsi_link pointed to by the other member, sa_sc_link.
2020-06-30Garbage collect SDEV_S_WAITING, last used in scsi_base.c r1.167 inKenneth R Westerback
2010. Part of matthew@'s reverted scsiconf.h r1.146.
2020-06-27Garbage collect SDEV_2NDBUS. Only used in isp(4) which was removed inKenneth R Westerback
2015 in favour of ql*(4).
2020-06-24Adapters that do not appear as a target on the SCSI bus must setKenneth R Westerback
'adapter_target' to a value greater than or equal to 'adapater_buswidth' to allow all possible targets to be probed. Add SDEV_NO_ADAPTER_TARGET (0xffff), a value guaranteed to be greater than or equal to the u_int16_t 'adapter_buswidth'. ok dlg@ as part of a larger diff.
2020-02-06Try to reduce the lying, hyperbolic or obsolete commentary onKenneth R Westerback
the relationships between various scsi structs.
2020-02-05Nuke unnecessary abstraction 'scsi_minphys()' which just callsKenneth R Westerback
'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
2020-01-26Shuffle some names around to make reading the code less headacheKenneth R Westerback
inducing. Rename scsi_adapter member 'scsi_minphys' to 'dev_minphys' to reflect what it is supposed to do. Use consistent naming convention (<dev>_minphys) for the actual device functions. No functional change.
2019-12-08Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-05Shrink scsi_mode_do_sense() parameter list by eliminating the threeKenneth R Westerback
pointers returning possible block descriptor values for block size, block count and density. Most calls were passing "NULL, NULL, NULL" since they did not care. Call scsi_parse_blkdesc() directly in those few cases where one or more of the values is of interest. No intentional functional change.
2019-12-05Move prototypes for scsi_mode_sense(), scsi_mode_sense_big(),Kenneth R Westerback
scsi_mode_sense_page() and scsi_mode_sense_big_page() into scsi_base.c. They are just internal helper functions for scsi_do_mode_sense().
2019-12-03Check for expected mode sense page code as well as expected mode page length ↵Kenneth R Westerback
when constructing the pointer to the page data. Remove now unneeded DISK_PGCODE(). Usual misc whitespace/modernization tweaks to functions being modified.
2019-11-28Abstract mode sense block descriptor parsing into a separate function.Kenneth R Westerback
2019-11-25Move struct scsi_read_cap_data and struct scsi_read_cap_data_16 toKenneth R Westerback
scsi_all.h. Add scsi_read_cap_10() and scsi_read_cap_16() functions to scsi_base.c, i.e. move logic to do actual READ_CAPACITY commands out of sd_read_cap() and sd_read_cap_16(). This will allow the READ_CAPACITY code to be reused by cd(4). Return -1 for errors where the error code is just discarded, reducing ENOMEM, ENXIO, EIO uses. No intentional functional change.
2019-09-27Use consistent idiom/naming convention for the the #includeKenneth R Westerback
guards. Spelunkers using grep are easily confused.
2019-09-27Shuffle and consolidate SCSIDEBUG declarations into fewer sections inKenneth R Westerback
more intuitive locations.
2019-09-23When printing the scsi_link info under SCSIDEBUG show state, luns,Kenneth R Westerback
openings, flags and quirks.
2019-09-19Introduce and use convenience SID_REPOONSE_FORMAT() define.Kenneth R Westerback
2019-09-01Adopt the SCSI versioning #define's from FreeBSD. Eliminate theKenneth R Westerback
now unneeded version_to_spc() mapping array, a duplicate #define and a couple of magic numbers. Toss in some comments for future generations of spelunkers. Makes it possible to check for specific SPC versions when new features or eliminated features require such a check. No intentional functional change.
2019-08-28Introduce SCSI0(), SCSI2() and SCSI3() defines to clarify (some) usesKenneth R Westerback
of SCSISPC() when checking the values of the INQUIRY version field.
2019-08-24Simply logic of detaching things. scsi_detach_bus() folded intoKenneth R Westerback
scsi_detach(), scsi_detach_target() and scsi_detach_lun() become simple wrappers of scsi_detach() invocations. No intentional functional change.
2019-08-20scsi_probe_bus() always returns 0. Nobody but scsi_probe() evenKenneth R Westerback
pretended to care. So just make in a void, and explicitly return 0 in the appropriate case in scsi_probe().
2019-08-18sc_buswidth field in struct scsi_link is redundant. Just useKenneth R Westerback
adapter_link->adapter_buswidth, which supplied the value for sc_buswidth and is never changed.
2019-08-14scsi_[add|remove]_link() are local functions so move theirKenneth R Westerback
declarations.
2017-05-29To prevent anyone else from stumbling on this (now) archaic bit ofKenneth R Westerback
history, nuke all mentions of XS_NO_CCB and the #define. 2006 - 2017. R.I.P. ok kettenis@ inferred ok dlg@
2017-05-19Add some comments about the assumptions of the scsi mid layerStefan Fritsch
ok krw@
2016-03-10Enforce some naming sanity. Stop using 'sc_link' to mean two differentKenneth R Westerback
things by renaming the field 'SLIST_HEAD(, scsi_link) sc_link' to 'sc_link_list' in struct scsibus_softc. Use 'sb' as the short name for scsibus_softc variables. Impetus from & ok bluhm@
2015-06-07More damned eye searing whitespace.Kenneth R Westerback
2014-09-09remove the scsi_task() wrapper around workq_add_task now that nothingDavid Gwynne
uses it. dont need to include workq.h anymore here either now.
2014-04-22factor out the code that figures out whether you're probing or detachingDavid Gwynne
a whole bus, a target, or a specific lun on a target from the bioctl and scsi_req paths. i want to reuse this factored code for something claudio wants.
2014-01-31if a device doesnt have device ids or serial numbers, try using node_wwn toDavid Gwynne
generate a devid. if its an fc device this is good enough.
2014-01-27poison the io "allocated" by the default pool allocator so any attempt toDavid Gwynne
use it should cause a fault. based on discussion with miod@
2014-01-18rename scsi_ioh_runqueue to scsi_iopool_run, and make it availableDavid Gwynne
outside scsi_base.c. this will allow adapters to restrict access to iopool resources based on some state, and then kick the pending requests on the pool when the state comes good again. ive been avoiding this for a long time, but it is the least worst way to deal with some uses of XS_NO_CCB. discussion with kettenis@ helped me decide this was right.
2013-09-27scsi_size() is now used only by cd(4). So move it from scsi_base.cKenneth R Westerback
to cd.c and call it cd_size(), like sd_size() lives in sd.c. Tweak some daddr_t variables to u_int64_t on the way, when they are for disk sector numbers, not 512-byte block numbers.
2013-08-29rename scsi_sem_{enter,leave} to scsi_pending_{start,finish}. these areDavid Gwynne
the wrappers around handling of pending work, theyre not semaphores. names from tedu@ ok krw@ guenther@
2013-08-26make scsi_{xsh,ioh}_{add,del} return whether they moved somethingDavid Gwynne
on or off the queues so things calling them can tell if something is or isnt going to happen.
2013-08-25move the prototypes of scsi_sem_{enter,leave} into a header so thingsDavid Gwynne
other than scsi_base.c can use them.
2013-06-11final removal of daddr64_t. daddr_t has been 64 bit for a long enoughTheo de Raadt
test period; i think 3 years ago the last bugs fell out. ok otto beck others