Branch :
| Author | Commit | Date | CI | Message |
|---|---|---|---|---|
| 4674773e | 2020-02-06 21:06:15 | Try to reduce the lying, hyperbolic or obsolete commentary on the relationships between various scsi structs. | ||
| ca82ddf5 | 2020-02-05 21:50:41 | Ooops. Missed a file in nuke of scsi_minphys. mpath_minphys() needs to check dev_minphys for NULL before calling it. | ||
| 21ceeee0 | 2020-02-05 16:29:29 | Nuke unnecessary abstraction 'scsi_minphys()' which just calls 'minphys()'. Just use & check for NULL instead, since 'minphys()' is always called on the code path ([cd|sd|st]minphys) that calls physio(). | ||
| 0d9c2585 | 2020-01-27 07:41:02 | Make the commonalities of cdminphys, sdminphys and stminphys more obvious by consistently using the variable names and idiom of sdminphys. No functional change. | ||
| 9f36bc94 | 2020-01-26 00:53:31 | Shuffle some names around to make reading the code less headache 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. | ||
| f5f2a2d0 | 2020-01-25 21:40:34 | Ensure scsi_minphys() is always called on the physio() path. Will allow simplification of individual driver *minphys() functions. ok jmatthew@ as part of larger diff | ||
| 854a1b2d | 2020-01-24 05:14:51 | cleanup unused headers generated by config ok tedu@ krw@ deraadt@ | ||
| a867c811 | 2020-01-23 07:52:59 | Use a consistant idiom/format when declaring scsi_adapter structures 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@ | ||
| 911b201f | 2020-01-22 00:17:46 | scsi_delay(): sleep without lbolt 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@ | ||
| 89ea875e | 2019-12-08 16:38:45 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| ce9fc84e | 2019-12-08 13:05:12 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| b088678d | 2019-12-07 15:16:24 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 57343048 | 2019-12-07 14:13:49 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 43b5650c | 2019-12-07 13:03:57 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 0af55edb | 2019-12-06 16:57:24 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 5b140de7 | 2019-12-06 15:13:07 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 3d8812d3 | 2019-12-06 13:53:26 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 9c0f6582 | 2019-12-05 21:32:13 | Various cleanup tweaks. 'return' is not a function. KNF. Whitespace, Comment fixes. | ||
| 906b410b | 2019-12-05 19:53:05 | Don't discard error from mode sense (6) if mode sense (10) is not attempted. | ||
| 85f9847c | 2019-12-05 18:42:13 | Shrink scsi_mode_do_sense() parameter list by eliminating the three 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. | ||
| 054c2353 | 2019-12-05 16:33:53 | No need for 'byte2' parameter to scsi_mode_sense[_big]() since we always pass 0. i.e. never disable block descriptors, never accept long LBA values. | ||
| 5c0ba001 | 2019-12-05 16:16:01 | Move prototypes for scsi_mode_sense(), scsi_mode_sense_big(), 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(). | ||
| 43389b15 | 2019-12-04 10:22:05 | Convert infinite sleeps to {m,t}sleep_nsec(9). ok krw@, jca@ | ||
| 724ba685 | 2019-12-03 15:58:28 | Check for expected mode sense page code as well as expected mode page length when constructing the pointer to the page data. Remove now unneeded DISK_PGCODE(). Usual misc whitespace/modernization tweaks to functions being modified. | ||
| c24e0dbc | 2019-12-03 13:25:57 | Add display of mode sense data to SCSIDEBUG. | ||
| c340ff09 | 2019-12-02 17:53:05 | Have SCSIDEBUG show the number of bytes of VPD inquiry data received, not the number of bytes that were available in the buffer. | ||
| 4213291d | 2019-12-02 15:10:27 | Don't forget the scsi_vpd_header when calculating the number of bytes obtained by scsi_inquire_vpd(). | ||
| d3956194 | 2019-12-01 16:56:26 | Tweak variable names to be consistent with 'pg_code' and 'pg_length' field names in sense mode structs. | ||
| e41f21f1 | 2019-12-01 16:26:10 | Make prototype and implementation signatures the same by removing 'const' from the only two 'const int' instances. | ||
| 050be8af | 2019-12-01 15:41:43 | Don't overwrite original error returned by scsi_do_mode_sense(). | ||
| 35e05388 | 2019-11-29 15:17:28 | DISK_PGCODE() #define includes a check for NULL, so no need to do the same check before invoking it. | ||
| f82a5783 | 2019-11-29 14:06:21 | Add defines for changer mode page codes. Move AUDIO_PAGE define to nestle amoung its friends. | ||
| 577d7b69 | 2019-11-28 17:25:59 | Abstract mode sense block descriptor parsing into a separate function. | ||
| 7733df1a | 2019-11-28 16:41:07 | Align an annoying comment. | ||
| 944c98ad | 2019-11-28 16:27:35 | Always pass a pointer to 'big' to scsi_do_mode_sense(). Sets up some simplifications. | ||
| 56ce827e | 2019-11-26 20:51:20 | Reinitialize 'err' to ensure we are not checking a stale value. Discovered by and ok tim@ | ||
| ac47be6b | 2019-11-26 20:48:03 | Don't zero existing values for density, block_count and block_size in 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@ | ||
| b1c28262 | 2019-11-25 17:48:31 | Use scsi_read_cap[10|16] instead of re-rolling the code. More careful initialization, better error/debug messages. | ||
| 85680492 | 2019-11-25 17:02:56 | Move struct scsi_read_cap_data and struct scsi_read_cap_data_16 to 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. | ||
| c3094a8a | 2019-11-23 17:10:13 | Consistently use ISSET() to check for set flags. | ||
| 1b9e05ce | 2019-11-23 12:27:32 | Consistently use !ISSET() to check for unset flags. | ||
| dacf4336 | 2019-11-23 01:16:05 | Consistently use SET() to set bits. | ||
| 64e2b1d6 | 2019-11-22 15:34:29 | Be consistent and always use CLR() to clear flags. | ||
| 0e3cac37 | 2019-11-21 23:22:14 | Be consistent and always use [!]ISSET() to test flags in xs->flags. | ||
| 36e286aa | 2019-11-21 22:31:26 | Be consistent and always use SET() to set flags in xs->flags. | ||
| 33dc79de | 2019-11-10 17:55:57 | Tedu scsi_scanner.h as krw@ intended to do | ||
| b3df7069 | 2019-11-09 23:41:22 | Make sure that SDEV_NOSYNC abd SDEV_NOWIDE quirks are not inadvertantly set on devices for which they are irrelevant or incorrect. Lets these device operate at full speed. ok sthen@ deraadt@ | ||
| 8ed651c0 | 2019-11-09 14:36:30 | Shuffle sd_get_parms() logic to ensure we only update sc->params with a complete set of validated (possibly fictitious) data. Add SCSIDEBUG output showing mismatch between disksize and cyls * heads * sectors. | ||
| d3a3b1fa | 2019-11-09 12:15:50 | Fix SCSIDEBUG display of VPD inquiry data. Remove extraneous whitespace in SCSIDEBUG read capacity display. | ||
| 1a1ff339 | 2019-11-09 12:14:16 | Fix SCSIDEBUG display of VPD inquiry data. Remove extraneous whitespace in SCSIDEBUG read capacity display. | ||
| 594013d4 | 2019-11-09 10:21:52 | Fix SCSIDEBUG compile. Missed a %lx -> %x. | ||
| 6e49e787 | 2019-11-08 16:13:28 | The u_long fields in struct disk_parms (secsize, heads, cyls, sectors) are always initializd to u_int32_t values. And are then copied into u_int32_t fields in the disklabel. Switch them to u_int32_t. Cluebats and ok deraadt@ jca@ | ||
| 75679190 | 2019-11-07 17:45:22 | sd_size() is a wrapper around sd_read_cap_10() and sd_read_cap_16() so rename it sd_read_cap(). Reduces possible confusion with the unrelated sdsize(). | ||
| 340f3a7e | 2019-10-23 13:50:49 | There used to be three possible return values from sd_get_parms(), but for some years it's been a succeed/fail function. So switch to using 0/-1 as return values and nuke SDGP_RESULT_OFFLINE and SDGP_RESULT_OK #defines. Shake out logic inside sd_get_parms() to take account of the change, making it clearer. Removes a possible panic(). | ||
| 442ab2ac | 2019-10-22 15:46:40 | No need to always pass the same thing to sd_get_parms(). One less parameter to worry about. | ||
| 71ed4a82 | 2019-10-19 17:30:43 | Use !ISSET() for unset flag checks. | ||
| 9dbfff47 | 2019-10-19 16:01:41 | Use ISSET() for the easier flag checks. | ||
| 3cc799f1 | 2019-10-19 14:13:18 | Fix typo in previous, link->flag is link->flags. | ||
| 5b102313 | 2019-10-19 14:01:31 | Resolve mix of '&=' and CLR() usage in favour of CLR(). | ||
| 38a5deec | 2019-10-19 13:49:17 | Resolve mix of '|=' and SET() usage in favour of SET(). | ||
| 65874fe2 | 2019-09-30 11:27:37 | SC_DEBUGN is not spelled SCSI_DEBUGN. | ||
| fbc75f41 | 2019-09-29 23:08:57 | Restore SC_DEBUGN() as it was used outside sys/scsi. Some things are not compiled on amd64! | ||
| f6e3733c | 2019-09-29 17:57:36 | Introduce SC_DEBUG_SENSE() and simplify code by eliminating a bunch of three line SCSIDEBUG chunks. | ||
| 80d3d52d | 2019-09-29 17:23:24 | Continue SCSIDEBUG cleanup by nuking pointles SC_DEBUGN() #define. | ||
| c3a5f1cf | 2019-09-29 16:10:30 | Move some logic inside scsi_show_xs() instead of surrounding the single invocation of the same. Clearer. | ||
| af699d57 | 2019-09-29 15:47:29 | Tweak some whitespace to make autoindenter happy. Use consistent naming idiom for the debug functions. | ||
| dd0887e4 | 2019-09-27 23:07:42 | Use consistent idiom/naming convention for the the #include guards. Spelunkers using grep are easily confused. | ||
| 364ebb70 | 2019-09-27 17:22:31 | Add/tweak #endif comments to make spelunking via grep more rewarding. | ||
| 2a40f7e1 | 2019-09-27 16:03:45 | Shuffle and consolidate SCSIDEBUG declarations into fewer sections in more intuitive locations. | ||
| 5fb9eef9 | 2019-09-24 12:30:00 | Use consistent names for unused flags/quirks when printing same under SCSIDEBUG. | ||
| 97fa0b66 | 2019-09-23 15:21:17 | When printing the scsi_link info under SCSIDEBUG show state, luns, openings, flags and quirks. | ||
| f2840357 | 2019-09-21 00:12:15 | Expand scsi_inquiry_data to 96 bytes to include new fields. If the device claims to have more than the 36 bytes of SCSI2 data, issue a 2nd INQUIRY (under SCSIDEBUG!) to get up to 96 bytes of data. Add some length sanity checks to debug output. Print VPD data under SCSIDEBUG. | ||
| 7330cb3a | 2019-09-20 15:35:42 | Print inquiry and read capacity (10 and 16) data under SCSIDEBUG. | ||
| b529be3d | 2019-09-19 17:48:21 | Introduce and use convenience SID_REPOONSE_FORMAT() define. | ||
| 9149808d | 2019-09-19 16:07:33 | Add new (a.k.a SBC-4) flags/fields to struct scsi_read_cap_16. Adopt more concise nameing convention roughly adopted from FreeBSD as tweaked by SBC-4. Keep older names when they are currently in use elsewhere. | ||
| 2acb7c00 | 2019-09-18 11:45:49 | Update struct inquiry_data with latest flags and remove flags that we didn't use and are now (SPC-4+) marked as "reserved" instead of just "obsolete". Whitespace tweaks to line stuff up. Mostly following FreeBSD. | ||
| 173a6623 | 2019-09-16 16:34:14 | Update list of device types with combination of FreeBSD and SPC-5. Add/Fix comments. | ||
| 4ab68d81 | 2019-09-15 15:00:30 | With the recent fixes to SCSI version detection we reproduced a problem encountered by FreeBSD and Linux when they started to try issuing READ CAPACITY 16 commands to 'newer' devices. i.e. some USB devices return bad data instead of an error when they can't handle the command. Reproduce the FreeBSD solution (r233746 by mav@) by issuing READ CAPACITY 16 commands only to devices that claim to be REALLY new (a.k.a. newer than SPC-2, a.k.a. newer than SCSI-3), or which indicate they really are bigger than can be reported via READ CAPACITY 10. Should fix some USB devices claiming to have 71,776,119,061,217,281 or 33,601,071,049,867,265 sectors. | ||
| 46355ee8 | 2019-09-14 13:30:48 | Typo in comment. scsi_size() is actually sd_size(). | ||
| 195c9f00 | 2019-09-10 23:07:46 | Shuffle a couple of lines to make the device -> st_softc dances look the same. | ||
| a1cd01ed | 2019-09-10 22:39:13 | No need to check for ST_MOUNTED before calling st_mount_tape() AND in st_mount_tape(). Just keep the latter. st_mount_tape() is called from inside stopen() which has already found the relevant st_softc(), incremented the device reference count, and checked if it is dying. No need to repeast that in st_mount_tape(). Just pass the st_softc. | ||
| ad282524 | 2019-09-10 19:04:36 | return is not a funciton call. Avoid pointless parenthesis. | ||
| c7dc3806 | 2019-09-10 18:45:45 | Explicitly check error results against 0. | ||
| b9e4b8c9 | 2019-09-10 16:55:42 | Some stray bit twiddles that were using yet another idiom. | ||
| 674f5122 | 2019-09-10 16:08:43 | check pointer against NULL and error values against 0. | ||
| 1afc5e67 | 2019-09-10 15:44:43 | Last (?) small bit twiddling modernization. | ||
| e011e966 | 2019-09-10 14:16:36 | !ISSET() for various flags. | ||
| 077a3a9b | 2019-09-10 12:58:55 | SET/CLR/ISSET all at once for st->quirks, and a few other rare flags. | ||
| 5df391bb | 2019-09-09 23:28:41 | SET/CLR/ISSET all at once for the far less numerous link->flags. | ||
| 62d8f86c | 2019-09-09 18:59:20 | Continue bit twiddling tweaks. Use SET() with st->flags. | ||
| 8f5aa9e6 | 2019-09-09 18:25:47 | Lots of st->flags bit clearing in a mix of old school and CLR() makes code harder to read. Switch to CLR(). No change to executable. | ||
| 4e75385c | 2019-09-09 18:02:12 | Lots of st->flags checking in a mix of old school and ISSET() makes code harder to read. Switch to ISSET() where obvious. No change to executable. | ||
| 07dedaf8 | 2019-09-09 01:37:27 | Tweak some comments to be useful. Sort switch cases into numerical order. Move bit of logic before calling st_unmount() into st_unmount(). | ||
| aed27177 | 2019-09-07 15:26:07 | Fold st_identify_drive() into stattach(). | ||
| 7e9f6b22 | 2019-09-07 02:30:40 | Tweak some comments and code layout to make MTSETBSIZE and MTSETDENSITY cases look the same. | ||
| acf9bd5c | 2019-09-07 02:07:08 | ST_USER_BLKSIZE and ST_QUIRK_BLKSIZE are only tested as an or'd pair. Ditto for ST_USER_DENSITY and ST_QUIRK_DENSITY. Thus the origin of the value stored in the mode is irrelevant. Just use two flags (ST_MODE_BLKSIZE and ST_MODE_DENSITY) instead of the existing four. | ||
| 9d9f3ffe | 2019-09-07 01:47:48 | ST_Q_FORCE_BLKSIZE is superfluous since it is only used in combination with a non-zero value of blksize in the quirkdata. So just check for non-zero value of blksize, as is already done for density. | ||
| 8bef3911 | 2019-09-07 01:27:02 | Nuke unused flag ST_BLOCK_SET. | ||
| 0998a6b7 | 2019-09-07 01:15:41 | Various struct/variables "modes" -> "mode" since there is only one. | ||
| 449b9182 | 2019-09-05 18:49:03 | Nuke some 25+year old comments that the oracles at delphi would have found obscure. Repair a broken WangTEK 5150ES quirks entry that apparently suffered some damage when imported in 1995. It never made NetBSD/FreeBSD quirk lists at all. Some whitespace tweaking to make everything line up. |