summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2020-02-06Try to reduce the lying, hyperbolic or obsolete commentary onKenneth R Westerback
the relationships between various scsi structs.
2020-02-05Ooops. Missed a file in nuke of scsi_minphys. mpath_minphys() needs toKenneth R Westerback
check dev_minphys for NULL before calling it.
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-27Make the commonalities of cdminphys, sdminphys and stminphys moreKenneth R Westerback
obvious by consistently using the variable names and idiom of sdminphys. No functional change.
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.
2020-01-25Ensure scsi_minphys() is always called on the physio() path.Kenneth R Westerback
Will allow simplification of individual driver *minphys() functions. ok jmatthew@ as part of larger diff
2020-01-24cleanup unused headers generated by configJonathan Gray
ok tedu@ krw@ deraadt@
2020-01-23Use a consistant idiom/format when declaring scsi_adapter structuresKenneth R Westerback
in drivers. Terse one liners, NULLs instead of 0's, explicitly specify all members, etc. Nuke #ifdef notyet blocks related to the scsi_adapter in aic. No intentional functional change. ok tedu@
2020-01-22scsi_delay(): sleep without lboltcheloha
If we want to sleep for a multiple of seconds we can do that without involving lbolt. This may cause some paths to sleep longer than they have on average, as sleeping on lbolt wakes you up within one second, not after one second. If this is a problem we will need to shorten the intervals given to scsi_delay(). With insight from deraadt@. ok krw@
2019-12-08Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-08Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-07Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-07Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-07Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-06Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-06Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-06Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-05Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,Kenneth R Westerback
Comment fixes.
2019-12-05Don't discard error from mode sense (6) if mode sense (10) isKenneth R Westerback
not attempted.
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-05No need for 'byte2' parameter to scsi_mode_sense[_big]() since weKenneth R Westerback
always pass 0. i.e. never disable block descriptors, never accept long LBA values.
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-04Convert infinite sleeps to {m,t}sleep_nsec(9).Martin Pieuchot
ok krw@, jca@
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-12-03Add display of mode sense data to SCSIDEBUG.Kenneth R Westerback
2019-12-02Have SCSIDEBUG show the number of bytes of VPD inquiry data received,Kenneth R Westerback
not the number of bytes that were available in the buffer.
2019-12-02Don't forget the scsi_vpd_header when calculating the number of bytesKenneth R Westerback
obtained by scsi_inquire_vpd().
2019-12-01Tweak variable names to be consistent with 'pg_code' and 'pg_length'Kenneth R Westerback
field names in sense mode structs.
2019-12-01Make prototype and implementation signatures the same by removingKenneth R Westerback
'const' from the only two 'const int' instances.
2019-12-01Don't overwrite original error returned by scsi_do_mode_sense().Kenneth R Westerback
2019-11-29DISK_PGCODE() #define includes a check for NULL, so no need toKenneth R Westerback
do the same check before invoking it.
2019-11-29Add defines for changer mode page codes. Move AUDIO_PAGE define toKenneth R Westerback
nestle amoung its friends.
2019-11-28Abstract mode sense block descriptor parsing into a separate function.Kenneth R Westerback
2019-11-28Align an annoying comment.Kenneth R Westerback
2019-11-28Always pass a pointer to 'big' to scsi_do_mode_sense().Kenneth R Westerback
Sets up some simplifications.
2019-11-26Reinitialize 'err' to ensure we are not checking a stale value.Kenneth R Westerback
Discovered by and ok tim@
2019-11-26Don't zero existing values for density, block_count and block_size inKenneth R Westerback
scsi_do_mode_sense(). Just update the values when valid data is available. Initialize the variables passed to scsi_do_mode_sense() in the one instance where they weren't already set. Fixes issue with softraid crypto volumes on 4K-sector disks. Found, fix tested, and ok tim@
2019-11-25Use scsi_read_cap[10|16] instead of re-rolling the code.Kenneth R Westerback
More careful initialization, better error/debug messages.
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-11-23Consistently use ISSET() to check for set flags.Kenneth R Westerback
2019-11-23Consistently use !ISSET() to check for unset flags.Kenneth R Westerback
2019-11-23Consistently use SET() to set bits.Kenneth R Westerback
2019-11-22Be consistent and always use CLR() to clear flags.Kenneth R Westerback
2019-11-21Be consistent and always use [!]ISSET() to test flags in xs->flags.Kenneth R Westerback
2019-11-21Be consistent and always use SET() to set flags in xs->flags.Kenneth R Westerback
2019-11-10Tedu scsi_scanner.h as krw@ intended to doPatrick Wildt
2019-11-09Make sure that SDEV_NOSYNC abd SDEV_NOWIDE quirks are notKenneth R Westerback
inadvertantly set on devices for which they are irrelevant or incorrect. Lets these device operate at full speed. ok sthen@ deraadt@
2019-11-09Shuffle sd_get_parms() logic to ensure we only update sc->params withKenneth R Westerback
a complete set of validated (possibly fictitious) data. Add SCSIDEBUG output showing mismatch between disksize and cyls * heads * sectors.
2019-11-09Fix SCSIDEBUG display of VPD inquiry data.Kenneth R Westerback
Remove extraneous whitespace in SCSIDEBUG read capacity display.
2019-11-09Fix SCSIDEBUG display of VPD inquiry data.Kenneth R Westerback
Remove extraneous whitespace in SCSIDEBUG read capacity display.