Age | Commit message (Collapse) | Author |
|
detecton of a 0 value.
CID 1488899
|
|
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@.
|
|
'minphys()'. Just use & check for NULL instead, since 'minphys()' is
always called on the code path ([cd|sd|st]minphys) that calls
physio().
|
|
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.
|
|
Will allow simplification of individual driver *minphys() functions.
ok jmatthew@ as part of larger diff
|
|
Comment fixes.
|
|
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.
|
|
when
constructing the pointer to the page data. Remove now unneeded DISK_PGCODE().
Usual misc whitespace/modernization tweaks to functions being modified.
|
|
do the same check before invoking it.
|
|
Sets up some simplifications.
|
|
Discovered by and ok tim@
|
|
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.
|
|
|
|
|
|
a complete set of validated (possibly fictitious) data.
Add SCSIDEBUG output showing mismatch between disksize and cyls *
heads * sectors.
|
|
Remove extraneous whitespace in SCSIDEBUG read capacity display.
|
|
|
|
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@
|
|
rename it sd_read_cap().
Reduces possible confusion with the unrelated sdsize().
|
|
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().
|
|
parameter to worry about.
|
|
|
|
|
|
|
|
|
|
|
|
of three line SCSIDEBUG chunks.
|
|
idiom for
the debug functions.
|
|
|
|
|
|
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.
|
|
|
|
now unneeded version_to_spc() mapping array, a duplicate #define
and a couple of magic numbers. Toss in some comments for future
generations of spelunkers.
Makes it possible to check for specific SPC versions when new
features or eliminated features require such a check.
No intentional functional change.
|
|
of SCSISPC() when checking the values of the INQUIRY version field.
|
|
Prodded by guenther@
|
|
forcibly set to a value. Make sure that in all those cases the B_ERROR
flag is cleared (if b_error is being set to 0) or set (if b_error is
being set to non-zero) appropriately.
ok dlg@ jmatthew@
|
|
ok deraadt@ krw@
|
|
|
|
Don't skip the cache flush until the last opening of the device is
closed. Otherwise, when umounting a writable partition while a different
partition is still mounted read-only, the necessary disk flush may be
delayed for a very long time.
ok krw@ deraadt@
|
|
Currently implemented for wd and sd.
Initially ported from netbsd by pedro@
ok deraadt@
|
|
history, nuke all mentions of XS_NO_CCB and the #define.
2006 - 2017. R.I.P.
ok kettenis@ inferred ok dlg@
|
|
the random subsystem as entropy. This value is pretty much unknown,
and anyways our entropy input ring does not saturate from knowns.
ok mikeb djm
|
|
special error handling in sdopen() as temporary hack.
OK krw@
|
|
is not dying.
OK krw@
|
|
device is already dying. Delete the sc_timeout when setting the
SDF_DYING flag as the timeout delete in sdclose() may not be reached.
OK krw@
|
|
use after free of the scsi link structure during detach.
OK krw@
|
|
'sc_link'. 'sc_link' is a field in the various device *_softc
structures, where the sc_ prefix was for 'softc'. Reduces potential
mental confusion. Newer code from down under was already using
'link'.
No functional change.
Prompted by bluhm@'s adventures in scsi. ok dlg@ jmatthew@
|
|
of a use after free. In sdopen() the scsi link pointer is taken
from the scsi disk struct. While the scsi disk memory is refcounted
by autoconf, the scsi link may be detached and freed during sleep.
The solution is to check wether the disk is dying after every sleep.
The SDF_DYING flag is set before scsi bus and scsi disk are detached,
so without this flag the link must be valid.
input and OK krw@
|
|
and sdminphys() if the scsi disk is dying. The memory of the link
may have been freed already.
OK krw@
|
|
everywhere. This is the first step to fix a use after free of the
sc_link when the disk detaches. If a function gets a scsi transfer,
the scsi link is always valid. Call this variable "link" consistently.
OK krw@
|