summaryrefslogtreecommitdiffstats
path: root/sys/scsi (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Adapters that do not appear as a target on the SCSI bus must setkrw2020-06-241-3/+4
| | | | | | | | | | '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.
* Pass scsi_mode_sense_buf pointers to scsi_mode_sense[_buf]() ratherkrw2020-03-121-12/+13
| | | | | | | | | than scsi_mode_header[_big] pointers to the same data. Continues the umtamgling and simplification of the mode sense code. CID 1491299 CID 1491297
* Check for short mode sense error inside scsi_mode_sense_big()krw2020-03-121-3/+4
| | | | | | rather than after the only invocation. No functional change.
* Eliminate 'len' parameter from scsi_mode_sense[_big](). It'skrw2020-03-121-9/+13
| | | | | | always sizeof(struct scsi_mode_sense_buf). No functional change.
* No need to pass 20000 to scsi_mode_sense[_big]() as the desiredkrw2020-03-111-9/+9
| | | | | | | | xs->timeout. Just set xs->timeout to 20000 and drop the parameter. No functional change.
* Access 4-byte address field with _4btol() not _8btol(), fixingkrw2020-03-101-2/+2
| | | | | | detecton of a 0 value. CID 1488899
* Relax the grip the dead hand of QBUS (a.k.a. MAXPHYS) has on thekrw2020-02-203-9/+9
| | | | | | | | | | | throat of physio(). Allows individual devices to eventually be modified to support larger physio() (a.k.a. 'raw') i/o's if they prove capable of them. No immediate functional change. Tested for many weeks by and ok robert@.
* Try to reduce the lying, hyperbolic or obsolete commentary onkrw2020-02-061-26/+12
| | | | the relationships between various scsi structs.
* Ooops. Missed a file in nuke of scsi_minphys. mpath_minphys() needs tokrw2020-02-051-2/+3
| | | | check dev_minphys for NULL before calling it.
* Nuke unnecessary abstraction 'scsi_minphys()' which just callskrw2020-02-057-30/+22
| | | | | | 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio().
* Make the commonalities of cdminphys, sdminphys and stminphys morekrw2020-01-272-12/+16
| | | | | | | obvious by consistently using the variable names and idiom of sdminphys. No functional change.
* Shuffle some names around to make reading the code less headachekrw2020-01-265-13/+13
| | | | | | | | 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.
* Ensure scsi_minphys() is always called on the physio() path.krw2020-01-253-3/+9
| | | | | | Will allow simplification of individual driver *minphys() functions. ok jmatthew@ as part of larger diff
* cleanup unused headers generated by configjsg2020-01-241-3/+3
| | | | ok tedu@ krw@ deraadt@
* Use a consistant idiom/format when declaring scsi_adapter structureskrw2020-01-231-4/+2
| | | | | | | | | | | 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@
* scsi_delay(): sleep without lboltcheloha2020-01-221-7/+8
| | | | | | | | | | | | | | 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@
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-081-168/+173
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-082-95/+97
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-072-24/+23
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-071-60/+60
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-071-64/+64
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-061-103/+108
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-061-192/+190
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-061-155/+155
| | | | Comment fixes.
* Various cleanup tweaks. 'return' is not a function. KNF. Whitespace,krw2019-12-051-17/+17
| | | | Comment fixes.
* Don't discard error from mode sense (6) if mode sense (10) iskrw2019-12-051-4/+5
| | | | not attempted.
* Shrink scsi_mode_do_sense() parameter list by eliminating the threekrw2019-12-056-70/+74
| | | | | | | | | | | 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.
* No need for 'byte2' parameter to scsi_mode_sense[_big]() since wekrw2019-12-051-9/+7
| | | | | always pass 0. i.e. never disable block descriptors, never accept long LBA values.
* Move prototypes for scsi_mode_sense(), scsi_mode_sense_big(),krw2019-12-052-8/+10
| | | | | | | 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().
* Convert infinite sleeps to {m,t}sleep_nsec(9).mpi2019-12-041-5/+6
| | | | ok krw@, jca@
* Check for expected mode sense page code as well as expected mode page length whenkrw2019-12-034-25/+34
| | | | | | constructing the pointer to the page data. Remove now unneeded DISK_PGCODE(). Usual misc whitespace/modernization tweaks to functions being modified.
* Add display of mode sense data to SCSIDEBUG.krw2019-12-031-20/+46
|
* Have SCSIDEBUG show the number of bytes of VPD inquiry data received,krw2019-12-021-1/+3
| | | | not the number of bytes that were available in the buffer.
* Don't forget the scsi_vpd_header when calculating the number of byteskrw2019-12-021-2/+3
| | | | obtained by scsi_inquire_vpd().
* Tweak variable names to be consistent with 'pg_code' and 'pg_length'krw2019-12-011-14/+14
| | | | field names in sense mode structs.
* Make prototype and implementation signatures the same by removingkrw2019-12-011-3/+3
| | | | 'const' from the only two 'const int' instances.
* Don't overwrite original error returned by scsi_do_mode_sense().krw2019-12-011-2/+2
|
* DISK_PGCODE() #define includes a check for NULL, so no need tokrw2019-11-291-7/+5
| | | | do the same check before invoking it.
* Add defines for changer mode page codes. Move AUDIO_PAGE define tokrw2019-11-293-6/+9
| | | | nestle amoung its friends.
* Abstract mode sense block descriptor parsing into a separate function.krw2019-11-282-37/+53
|
* Align an annoying comment.krw2019-11-281-2/+2
|
* Always pass a pointer to 'big' to scsi_do_mode_sense().krw2019-11-284-18/+15
| | | | Sets up some simplifications.
* Reinitialize 'err' to ensure we are not checking a stale value.krw2019-11-261-1/+2
| | | | Discovered by and ok tim@
* Don't zero existing values for density, block_count and block_size inkrw2019-11-262-8/+5
| | | | | | | | | | 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@
* Use scsi_read_cap[10|16] instead of re-rolling the code.krw2019-11-251-48/+10
| | | | More careful initialization, better error/debug messages.
* Move struct scsi_read_cap_data and struct scsi_read_cap_data_16 tokrw2019-11-255-100/+129
| | | | | | | | | | | | | | | 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.
* Consistently use ISSET() to check for set flags.krw2019-11-238-61/+61
|
* Consistently use !ISSET() to check for unset flags.krw2019-11-236-25/+25
|
* Consistently use SET() to set bits.krw2019-11-237-52/+52
|
* Be consistent and always use CLR() to clear flags.krw2019-11-226-22/+22
|