Age | Commit message (Collapse) | Author |
|
copy of the vendor/product/revision fields in sd_softc. Just use the
INQUIRY data to build the disklabel 'label' when required. No
functional change.
|
|
scsi_disk_pages union. From FreeBSD and SCSI spec.
|
|
scsi_link to determine device type, rather than keeping a copy in
sd_softc.type. Remove unused sd_softc.type field.
|
|
|
|
|
|
devices. Use READ CAPACITY like NetBSD, FreeBSD, Linux and OpenSolaris
do. Well, NetBSD keeps READ FORMAT CAPACITIES as a backup. Fixes
problems with devices (such as my IBM USB Memory Key) which return
block counts that are off by one for READ FORMAT CAPACITIES.
This eliminates the significant difference between sd_atapi.c and
sd_scsi.c so merge sd_scsi.c into sd.c and just be careful to mark
ATAPI removable devices as both SDEV_NOSYNCCACHE and unable to return
MODE SENSE page 4 info.
All geometry faking is now in one place. Where it can be 'improved'.
sd_scsi.c, sd_atapi.c and atapi_disk.h will be removed as a result.
|
|
functional change.
ok tdeval@
|
|
|
|
field, with reduced_geometry.sectors[0] not being sectors/track. Add
_5btol() to correctly parse entire field. From NetBSD.
|
|
the blocksize from scsi_size() at the same time as the capacity is
found. Use the fake geometry already present in
sd_scsibus_get_parms(), which is identical to the one _optparms used.
Eliminates another old mode sense usage and associated struct.
Only affects T_OPTICAL sd devices, which seem extremely rare. Similar
to what netbsd does, and freebsd as far as I can make out.
|
|
ask for it when needed. Eliminate the page_0_size quirk.
Tested on various tape drives by myself, hshoexer@ and henning@.
|
|
debugging statements. As a result remove an used variable.
|
|
command. Return it in a new parameter to scsi_size.
|
|
unreferenced variable. Fixes rpm value for FLEX GEOMETRY devices.
|
|
atapi_capacity_descriptor in favour of equivalent struct
scsi_direct_blk_desc. No code change. One verbiage adjustment.
|
|
scsi_mode_direct_blk_desc -> scsi_direct_blk_desc
scsi_mode_blk_desc_big -> scsi_blk_desc_big
|
|
least) before 10 byte MODE SENSE. Some older devices can't/won't
distinguish between the two and return 6 byte MODE SENSE data for 10
byte requests.
Check that at least a full header was returned.
Tested by miod@ hshoexer@ and Ed Wandasiewisz on troublesome devices.
|
|
using FLEX GEOMETRY mode sense page to use the existing heads *
sectors * cyls calculation if scsi_size() fails.
Fixes jolan@'s iPod Shuffle, and presumably other devices lying or
confused about their geometry and it's relation to the number of
blocks.
Also save any supplied rpm and blocksize when faking, as previous
code tried to do.
ok jolan@ fgsch@ tdeval@
|
|
|
|
so eliminate code dealing with 16 byte block descriptors. No one else
seems to use them anyway. Add define for appropriate permission bit in
case we ever need it.
Simplify and clean up scsi_do_mode_sense() code as a result.
Strengthen check to ensure block descriptor data is a valid by
checking if it is a multiple of 8 bytes rather than just > 8 bytes.
Moves code to closer to what it was before scsi_do_mode_sense().
|
|
|
|
|
|
okay pval, nits miod.
|
|
required number of bytes, rather than a full scsi_mode_sense_buf. Some
devices (e.g. my HP SureStore DAT/24) decline to accept such oversized
transfers. Instead, force callers to fill in the data_length field in
the header and use that information to set the size of the transfer.
|
|
revealed it is doing it's own weird stuff not reproduced in new
functions. e.g. it doesn't use mode sense headers. Rather than try to
fix it or figure it out at this time ...
|
|
general block descriptor and the 8 byte direct block descriptor, and
return the correct values for density, block_count and block_size
based on the type of the device. First cut has T_SEQUENTIAL (i.e.
tape devices) as the only device type using general block descriptors,
so the behaviour change is minimal.
|
|
|
|
cd.h. Remove include of cdvar.h from cd.c. cdvar.h becomes expendable.
No functional change.
|
|
Add 'big' parameter to report which mode sense header type is being
returned. Eliminate icky pointer arithmetic, since it won't work if
only block descriptors are returned by the device.
No functional change.
|
|
the scsi_link structure. This is a more general solution than the
current inconsistant copying of fields into _softc structures. The
redundant fields in _softc's will be cleaned up later. The device
field will be used immediately to finish up the new mode sense code.
ok marco@
|
|
block descriptors. Not that we actually use this information anywhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scsi_mode_blk_desc_big. Will be needed to move st to new mode sense
function.
Be a bit more careful with types of parameters to scsi_do_mode_sense,
using u_int32_t instead of int.
No functional change.
|
|
Fixes spurious error messages from cdparanoia when using ATAPI CDROM
in USB enclosure.
ok pascoe@.
|
|
going to change anything. From NetBSD.
Fixes playing music cd in ATAPI drive in USB enclosure pascoe@ is
using.
ok pascoe@.
|
|
|
|
cd_atapi into cd since code is now almost identical, and only affects
volume adjusting ioctl's. Minor side effect of allowing
cd_load_unload() attempts to scsi cd's as NetBSD does.
|
|
Lexar Jumpdrive and probably others. Use better structure declaration
idiom, as suggested by drahn@.
|
|
geometry is set even if (as for some USB devices) the MODE SENSE works
but zero values are returned for cylinders/heads/sectors. This fixes
my USB floppy which returns 0/0/0.
|
|
|
|
both 10 byte and 6 byte MODE SENSE commands and just return error
checked values.
Convert sd_scsi.c to use new mechanism for non-optical drives. USB
umass devices will now display actual mode sense info if it is
available via a 10 byte MODE SENSE. Which may mean 0 heads, etc. is
shown until cosmetics are finalized.
ok marco@ 'that is pretty cool' deraadt@
|
|
field to get the blocksize.
ok marco@
|
|
instead.
|
|
scsi_mode_sense[_big] bzero()'s it.
|
|
|