Age | Commit message (Collapse) | Author |
|
zeroref() - just to be on the safe side, should we mess up our ref count.
|
|
|
|
spoofed sd disklabels. Sectors are the partition size units used and
documented everywhere else in the tree. sd ensures a sector will
always be a multiple of 512.
Fixes disklabel(8) error messages and partition size display for sd
devices that have no OpenBSD disklabel and a sectorsize > 512. Noted
by Robert Szasz on his Sony Hi-MD device.
ok pedro@ marco@
|
|
after being opened. Use SC_DEBUG() to suppress some verbiage during
spin up. Return actual errors encountered during attempt to spin up,
rather than always returning EIO.
ok dlg@
|
|
become ready. Make verbiage SC_DEBUG().
ok dlg@
|
|
for a raw partition like we suppress errors for the other operations on raw
partitions. Replace 'could not get size' with more specific and informative
SC_DEBUG() output. Silences a usb card reader that fgsch@ found. Now attach
message is only 'sdX: drive offline'.
Tested & ok fgsch@
|
|
|
|
functional change.
ok dlg@
|
|
headers; } to just union scsi_mode_sense_buf {}. No functional change.
ok marco@
|
|
Some blow up if buffer length is not 0. Just fake geometry for all
UMASS devices since it's almost always fictitious anyway. One step on
the road to eliminate geometry entirely.
Fixes Ed Wandasiewicz's 2nd gen iPod mini and Sebastiaan Indesteege's
UBest Technology device.
ok marco@
|
|
before free()'ing buf in sd_get_parms(). Tweak code so there is only
one free(buf, ...) to worry about.
ok deraadt@.
|
|
SCSI_IGNORE_ILLEGAL_REQUEST and SCSI_IGNORE_MEDIA_CHANGE flags to
scsi_test_unit_ready() and scsi_start() during sdopen(). Re-enables
use of devices that don't support START_STOP or TEST_UNIT_READY
commands.
Noted by and fix tested by Jason Crawford on VMWare disks.
ok dlg@ henning@, supportive comments from miod@.
|
|
ok deraadt@
|
|
stack into malloc'd memory.
ok deraadt@
|
|
Use consistant scsi_autoconf and SCSI_SILENT flags in
scsi_test_unit()/scsi_start() pairs.
Fixes some hppa, vax, sparc systems that do not spin up disks
automatically. Keeps USB card readers and such reasonably quiet.
Noted by millert@ (hppa), henning@ (sparc) and hshoexer@ (vax).
ok deraadt@
|
|
have. Some devices return four bytes less information than requested
for the PAGE_RIGID_GEOMETRY page. Put the two together and older
Conner drives don't work because we rejected the short page and asked
for the PAGE_FLEX_GEOMETY page. Noted by hshoexer@ and kettenis@.
Also should fix the problems with a device miod@ reported that did a
similar short PAGE_FLEX_GEOMETRY.
ok deraadt@
|
|
device that returns any other value via READ CAPACITY or MODE SENSE
will be marked 'drive offline'. Prevents divide by zero when
calculating disk size in MB, amoung other interesting possibilities.
ok mickey@ dlg@ deraadt@ millert@ marco@
|
|
ensure they are the ones requested. No functional change unless
garbage was being returned.
ok marco@
|
|
union declaration to allow pointers to individual page types. Simplify
sd.c code by using individual page type pointers. No functional
change.
ok tdeval@
|
|
other values as was intended. As opposed to overwriting it with
scsi_do_mode_sense() calls.
May help PR4313.
ok tdeval@
|
|
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_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.
|
|
is checked. Fixes crash during boot when a device has no media
loaded. e.g. a usb card reader with empty slots. From NetBSD. Problem
was introduced by last commit to allow RAW_PART+S_IFCHAR opens to
always succeed.
ok millert@ marco@
|
|
present. A successful open is required for ioctl's to work. Mostly
from NetBSD, partly correcting previous code cleanup error.
From deraadt@, treat MTIOCTOP+MTRETEN as CDIOCCLOSE for cd devices
(i.e. close the cd drawer).
ok deraadt@.
|
|
|
|
quiet if raw partition access tried. Be more careful with
SDEV_MEDIA_LOADED. Inspired by some NetBSD changes.
ok marco@
|
|
|
|
support, don't penalize devices that don't support it. May help some
usb devices.
ok marco@
|
|
exactly as is done in sdopen(). This improves the chances of getting
valid geometry/size and avoiding 'drive offline' errors, without
subjecting the device to anything it won't see anyway.
No impact on devices that already work. Fixes problem with Jim Rees'
Hitachi DK23DA in an Archos Multimedia Jukebox. Without adding quirks!
Tested by Jim Rees. ok marco@.
|
|
NetBSD. Try to limit special handling of sense errors in sd and st to
a minimum.
ok marco@
|
|
EJUSTRETURN and ERESTART instead. Delete unused SCSIRET_RETRY define.
From NetBSD.
ok marco@
|
|
SC_DEBUG() spacing tweaks.
ok deraadt@
|
|
UMASS_QUIRK_FORCE_SHORT_INQUIRY. Fixes a bunch of USB devices. Based
on work by Mycroft in NetBSD.
ok tdeval@ deraadt@.
|
|
looked at by various, testing henning@ mcbride@ dan weeks
mostly from netbsd via Pedro Martelletto <pbastos@rdc.puc-rio.br>
|
|
sense information when attempting to discover the disk size.
USB 6-in-1 readers have a bunch of LUNs and otherwise produce many
'Medium Not Present' details everytime they are plugged in. Noticed
by grange@.
Requested by and ok deraadt@.
|
|
negative number of sectors for very large (i.e. RAID) disks. Noticed
by Marco Peereboom.
ok deraadt@.
|
|
sdclose() unless they identified themselves as removable.
ok deraadt@.
|
|
derived from pr2815 from Marco Peereboom
krw@ deraadt@ ok
|
|
sdattach() has the flag SCSI_IGNORE_MEDIA_CHANGE set. This was not
true for devices with the quirk SDEV_NOSTARTUNIT, such as some umass
devices.
This fixes the display of the disk parameters for any loaded media.
Previously the displayed parameters would show 0 size, 0 sectors and a
faked number of cylinders, etc. By ignoring the error generated by
devices trying to tell us the media may have changed since the last
command the SCSI command completes correctly and valid values are
obtained/displayed. We are interested in the current values and
unconcerned about any previous ones.
Tested by drahn@.
|
|
krw@ ok
|
|
is trying to bring in.
1) Change name of SDEV_NOCDB6 to SDEV_ONLYBIG to align it with the
same quirk in NetBSD, and make it more clear what it is trying to do.
i.e. force the use of READ_BIG/WRITE_BIG commands, not suppress all
use of 6 byte CDB's.
2) Check SDEV_ONLYBIG in cd.c as well as sd.c. i.e. both places where
a choice is made to use the 6 or 10 byte versions of READ/WRITE.
3) Actually make use of the ADEV_NOTUR (No TEST UNIT READY) quirk to
suppress the emission of TEST UNIT READY commands.
4) Add some explanatory comments from NetBSD to scsiconf.h so that the
use of the quirks is made clear.
ok miod@ tdeval@ nate@
|
|
string.
Ensure that all of d_packname is used by not null-terminating string
that is put in it.
Suggestions and motivation to remove strncpy() from deraadt@.
ok deraadt@ tedu@.
|
|
and should not be created or used as such.
This fixes some instances of both behaviours, and sets the stage for some
strcpy -> strncpy fixup.
ok tdeval@ millert@ deraadt@
|
|
Use increased retries number and don't ignore SCSI_IGNORE_NOT_READY
when call scsi_test_unit_ready() for cd-rom, this makes system wait
if drive is loading media.
Tested by millert@ and fgsch@; some input and ok from krw@.
Problem reported by The lord of the CD-writers
Igor Grabin <violent@death.kiev.ua>.
|
|
ok costa@, krw@
|
|
|
|
|
|
|