summaryrefslogtreecommitdiff
path: root/sys/scsi
AgeCommit message (Collapse)Author
2019-11-09Fix SCSIDEBUG compile. Missed a %lx -> %x.Kenneth R Westerback
2019-11-08The u_long fields in struct disk_parms (secsize, heads, cyls, sectors)Kenneth R Westerback
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@
2019-11-07sd_size() is a wrapper around sd_read_cap_10() and sd_read_cap_16() soKenneth R Westerback
rename it sd_read_cap(). Reduces possible confusion with the unrelated sdsize().
2019-10-23There used to be three possible return values from sd_get_parms(), butKenneth R Westerback
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().
2019-10-22No need to always pass the same thing to sd_get_parms(). One lessKenneth R Westerback
parameter to worry about.
2019-10-19Use !ISSET() for unset flag checks.Kenneth R Westerback
2019-10-19Use ISSET() for the easier flag checks.Kenneth R Westerback
2019-10-19Fix typo in previous, link->flag is link->flags.Kenneth R Westerback
2019-10-19Resolve mix of '&=' and CLR() usage in favour of CLR().Kenneth R Westerback
2019-10-19Resolve mix of '|=' and SET() usage in favour of SET().Kenneth R Westerback
2019-09-30SC_DEBUGN is not spelled SCSI_DEBUGN.Kenneth R Westerback
2019-09-29Restore SC_DEBUGN() as it was used outside sys/scsi. Some things areKenneth R Westerback
not compiled on amd64!
2019-09-29Introduce SC_DEBUG_SENSE() and simplify code by eliminating a bunchKenneth R Westerback
of three line SCSIDEBUG chunks.
2019-09-29Continue SCSIDEBUG cleanup by nuking pointles SC_DEBUGN() #define.Kenneth R Westerback
2019-09-29Move some logic inside scsi_show_xs() instead of surrounding theKenneth R Westerback
single invocation of the same. Clearer.
2019-09-29Tweak some whitespace to make autoindenter happy. Use consistent naming ↵Kenneth R Westerback
idiom for the debug functions.
2019-09-27Use consistent idiom/naming convention for the the #includeKenneth R Westerback
guards. Spelunkers using grep are easily confused.
2019-09-27Add/tweak #endif comments to make spelunking via grep more rewarding.Kenneth R Westerback
2019-09-27Shuffle and consolidate SCSIDEBUG declarations into fewer sections inKenneth R Westerback
more intuitive locations.
2019-09-24Use consistent names for unused flags/quirks when printing same underKenneth R Westerback
SCSIDEBUG.
2019-09-23When printing the scsi_link info under SCSIDEBUG show state, luns,Kenneth R Westerback
openings, flags and quirks.
2019-09-21Expand scsi_inquiry_data to 96 bytes to include new fields. If theKenneth R Westerback
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.
2019-09-20Print inquiry and read capacity (10 and 16) data under SCSIDEBUG.Kenneth R Westerback
2019-09-19Introduce and use convenience SID_REPOONSE_FORMAT() define.Kenneth R Westerback
2019-09-19Add new (a.k.a SBC-4) flags/fields to struct scsi_read_cap_16. AdoptKenneth R Westerback
more concise nameing convention roughly adopted from FreeBSD as tweaked by SBC-4. Keep older names when they are currently in use elsewhere.
2019-09-18Update struct inquiry_data with latest flags and remove flags that we didn't ↵Kenneth R Westerback
use and are now (SPC-4+) marked as "reserved" instead of just "obsolete". Whitespace tweaks to line stuff up. Mostly following FreeBSD.
2019-09-16Update list of device types with combination of FreeBSD andKenneth R Westerback
SPC-5. Add/Fix comments.
2019-09-15With the recent fixes to SCSI version detection we reproduced aKenneth R Westerback
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.
2019-09-14Typo in comment. scsi_size() is actually sd_size().Kenneth R Westerback
2019-09-10Shuffle a couple of lines to make the device -> st_softc dances lookKenneth R Westerback
the same.
2019-09-10No need to check for ST_MOUNTED before calling st_mount_tape() AND inKenneth R Westerback
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.
2019-09-10return is not a funciton call. Avoid pointless parenthesis.Kenneth R Westerback
2019-09-10Explicitly check error results against 0.Kenneth R Westerback
2019-09-10Some stray bit twiddles that were using yet another idiom.Kenneth R Westerback
2019-09-10check pointer against NULL and error values against 0.Kenneth R Westerback
2019-09-10Last (?) small bit twiddling modernization.Kenneth R Westerback
2019-09-10!ISSET() for various flags.Kenneth R Westerback
2019-09-10SET/CLR/ISSET all at once for st->quirks, and a few other rare flags.Kenneth R Westerback
2019-09-09SET/CLR/ISSET all at once for the far less numerous link->flags.Kenneth R Westerback
2019-09-09Continue bit twiddling tweaks. Use SET() with st->flags.Kenneth R Westerback
2019-09-09Lots of st->flags bit clearing in a mix of old school and CLR() makesKenneth R Westerback
code harder to read. Switch to CLR(). No change to executable.
2019-09-09Lots of st->flags checking in a mix of old school and ISSET() makesKenneth R Westerback
code harder to read. Switch to ISSET() where obvious. No change to executable.
2019-09-09Tweak some comments to be useful. Sort switch cases intoKenneth R Westerback
numerical order. Move bit of logic before calling st_unmount() into st_unmount().
2019-09-07Fold st_identify_drive() into stattach().Kenneth R Westerback
2019-09-07Tweak some comments and code layout to make MTSETBSIZE and MTSETDENSITYKenneth R Westerback
cases look the same.
2019-09-07ST_USER_BLKSIZE and ST_QUIRK_BLKSIZE are only tested as an or'd pair.Kenneth R Westerback
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.
2019-09-07ST_Q_FORCE_BLKSIZE is superfluous since it is only used in combination withKenneth R Westerback
a non-zero value of blksize in the quirkdata. So just check for non-zero value of blksize, as is already done for density.
2019-09-07Nuke unused flag ST_BLOCK_SET.Kenneth R Westerback
2019-09-07Various struct/variables "modes" -> "mode" since there is only one.Kenneth R Westerback
2019-09-05Nuke some 25+year old comments that the oracles at delphi would haveKenneth R Westerback
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.