summaryrefslogtreecommitdiffstats
path: root/sys/scsi (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Be consistent and always use [!]ISSET() to test flags in xs->flags.krw2019-11-213-12/+12
|
* Be consistent and always use SET() to set flags in xs->flags.krw2019-11-213-19/+19
|
* Tedu scsi_scanner.h as krw@ intended to dopatrick2019-11-101-135/+0
|
* Make sure that SDEV_NOSYNC abd SDEV_NOWIDE quirks are notkrw2019-11-091-20/+32
| | | | | | | inadvertantly set on devices for which they are irrelevant or incorrect. Lets these device operate at full speed. ok sthen@ deraadt@
* Shuffle sd_get_parms() logic to ensure we only update sc->params withkrw2019-11-091-46/+67
| | | | | | | a complete set of validated (possibly fictitious) data. Add SCSIDEBUG output showing mismatch between disksize and cyls * heads * sectors.
* Fix SCSIDEBUG display of VPD inquiry data.krw2019-11-091-5/+9
| | | | Remove extraneous whitespace in SCSIDEBUG read capacity display.
* Fix SCSIDEBUG display of VPD inquiry data.krw2019-11-091-3/+3
| | | | Remove extraneous whitespace in SCSIDEBUG read capacity display.
* Fix SCSIDEBUG compile. Missed a %lx -> %x.krw2019-11-091-2/+2
|
* The u_long fields in struct disk_parms (secsize, heads, cyls, sectors)krw2019-11-082-7/+7
| | | | | | | 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@
* sd_size() is a wrapper around sd_read_cap_10() and sd_read_cap_16() sokrw2019-11-071-5/+5
| | | | | | rename it sd_read_cap(). Reduces possible confusion with the unrelated sdsize().
* There used to be three possible return values from sd_get_parms(), butkrw2019-10-232-37/+18
| | | | | | | 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().
* No need to always pass the same thing to sd_get_parms(). One lesskrw2019-10-221-8/+8
| | | | parameter to worry about.
* Use !ISSET() for unset flag checks.krw2019-10-191-17/+17
|
* Use ISSET() for the easier flag checks.krw2019-10-191-54/+54
|
* Fix typo in previous, link->flag is link->flags.krw2019-10-191-2/+2
|
* Resolve mix of '&=' and CLR() usage in favour of CLR().krw2019-10-191-6/+6
|
* Resolve mix of '|=' and SET() usage in favour of SET().krw2019-10-191-12/+12
|
* SC_DEBUGN is not spelled SCSI_DEBUGN.krw2019-09-301-2/+2
|
* Restore SC_DEBUGN() as it was used outside sys/scsi. Some things arekrw2019-09-291-1/+7
| | | | not compiled on amd64!
* Introduce SC_DEBUG_SENSE() and simplify code by eliminating a bunchkrw2019-09-296-28/+18
| | | | of three line SCSIDEBUG chunks.
* Continue SCSIDEBUG cleanup by nuking pointles SC_DEBUGN() #define.krw2019-09-292-13/+6
|
* Move some logic inside scsi_show_xs() instead of surrounding thekrw2019-09-291-6/+8
| | | | single invocation of the same. Clearer.
* Tweak some whitespace to make autoindenter happy. Use consistent naming idiom forkrw2019-09-296-24/+24
| | | | the debug functions.
* Use consistent idiom/naming convention for the the #includekrw2019-09-2713-36/+45
| | | | guards. Spelunkers using grep are easily confused.
* Add/tweak #endif comments to make spelunking via grep more rewarding.krw2019-09-2714-88/+88
|
* Shuffle and consolidate SCSIDEBUG declarations into fewer sections inkrw2019-09-274-165/+159
| | | | more intuitive locations.
* Use consistent names for unused flags/quirks when printing same underkrw2019-09-241-6/+6
| | | | SCSIDEBUG.
* When printing the scsi_link info under SCSIDEBUG show state, luns,krw2019-09-233-41/+117
| | | | openings, flags and quirks.
* Expand scsi_inquiry_data to 96 bytes to include new fields. If thekrw2019-09-212-12/+44
| | | | | | | | 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.
* Print inquiry and read capacity (10 and 16) data under SCSIDEBUG.krw2019-09-202-2/+19
|
* Introduce and use convenience SID_REPOONSE_FORMAT() define.krw2019-09-192-3/+4
|
* Add new (a.k.a SBC-4) flags/fields to struct scsi_read_cap_16. Adoptkrw2019-09-191-4/+17
| | | | | | more concise nameing convention roughly adopted from FreeBSD as tweaked by SBC-4. Keep older names when they are currently in use elsewhere.
* Update struct inquiry_data with latest flags and remove flags that we didn't use andkrw2019-09-181-25/+41
| | | | | | | are now (SPC-4+) marked as "reserved" instead of just "obsolete". Whitespace tweaks to line stuff up. Mostly following FreeBSD.
* Update list of device types with combination of FreeBSD andkrw2019-09-162-63/+64
| | | | SPC-5. Add/Fix comments.
* With the recent fixes to SCSI version detection we reproduced akrw2019-09-151-4/+4
| | | | | | | | | | | | | | | 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.
* Typo in comment. scsi_size() is actually sd_size().krw2019-09-141-2/+2
|
* Shuffle a couple of lines to make the device -> st_softc dances lookkrw2019-09-101-4/+3
| | | | the same.
* No need to check for ST_MOUNTED before calling st_mount_tape() AND inkrw2019-09-101-28/+13
| | | | | | | | | 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.
* return is not a funciton call. Avoid pointless parenthesis.krw2019-09-101-51/+51
|
* Explicitly check error results against 0.krw2019-09-101-7/+7
|
* Some stray bit twiddles that were using yet another idiom.krw2019-09-101-15/+15
|
* check pointer against NULL and error values against 0.krw2019-09-101-7/+7
|
* Last (?) small bit twiddling modernization.krw2019-09-101-2/+2
|
* !ISSET() for various flags.krw2019-09-101-8/+8
|
* SET/CLR/ISSET all at once for st->quirks, and a few other rare flags.krw2019-09-101-14/+14
|
* SET/CLR/ISSET all at once for the far less numerous link->flags.krw2019-09-091-16/+16
|
* Continue bit twiddling tweaks. Use SET() with st->flags.krw2019-09-091-27/+27
|
* Lots of st->flags bit clearing in a mix of old school and CLR() makeskrw2019-09-091-29/+29
| | | | | | code harder to read. Switch to CLR(). No change to executable.
* Lots of st->flags checking in a mix of old school and ISSET() makeskrw2019-09-091-36/+36
| | | | | | code harder to read. Switch to ISSET() where obvious. No change to executable.
* Tweak some comments to be useful. Sort switch cases intokrw2019-09-091-13/+16
| | | | | numerical order. Move bit of logic before calling st_unmount() into st_unmount().