the mode sense request. So fall back on mode sense data including a block
descriptor section.
XXX this applies to the `page 4' case. The `page 5' didn't consider the
possible presence of a block descriptor at all, though it did allow the
device to return one. While that's fixed now, the `page 5' mode sense
does not use the `disable block descriptors' bit.
I'm not sure we should bother with this at all..
in a different fashion. Individually, they have the same functionality,
but their layout is different. An example of such a chipset is
the Promise 203xx.
To be able to deal with this, transform the cmd and dma bus_space handles
into an array of handles, each seperately created with bus_space_subregion.
The code generated by using the extra indirection shouldn't change much,
since the extra indirection is negated by having the offset calculation
already done in bus_space_subregion. E.g.
bus_space_write_4(tag, handle, offset, value)
becomes
bus_space_write_4(tag, handles[offset], 0, value)
Reviewed by Manuel Bouyer. Tested on wdc_isa, wdc_pcmcia, viaide, piixide (i386)
and on cmdide (sparc64).
http://mail-index.netbsd.org/tech-kern/2003/09/25/0006.html
This adds a device (atabus) between IDE controllers and wd or atapibus, to
have each ATA channel show up in the device tree. Later there will be atabus
devices in /dev, so that we can do IOCTL on them.
Each atabus has its own kernel thread, to handle operations that needs polling,
e.g. reset and others.
Device probing on each bus it defered to the atabus thread creation.
This allows to do the reset and basic device probes in parallel, which reduce
boot time on systems with several pciide controllers.
most polling.
2) Clean up some goofiness in pciide -- get rid of the whole "candisable" path
(it's gratuitous) and simplify the code by calling pciide_map_compat_intr(),
*_set_modes() and wdc_print_modes() from central locations.
3) Add a register writability and register ghost test to eliminate phantom
drives more quickly.
another function, always doing a page 0 MODE SENSE to get the block
descriptor if we use READ CAPACITY, and use SMS_DBD on the page 4/5 MODE
SENSE. This does one extra command in some cases, but it separates and
simplifies the code a little.
Why do we prefer READ CAPACITY over READ FORMAT CAPACITIES? Two reasons:
1) It's much older and is much less likely to have had its command code
abused, and is thus "safer" to try first. 2) ALL of my USB flash readers
and pen drives screw up their capacity descriptors -- mostly off-by-one
errors in the size (they return the maximum LBA number instead, a la READ
CAPACITY, which has *never* been how READ FORMAT CAPACITIES was documented
in the MMC spec), and one returns the "no media" code on slots that have
media inserted (despite returning almost-correct data otherwise)!
F*** me with a chainsaw.
ready. This avoids gratuitously starting the motor on floppy and CD-ROM
drives, and eliminates the need for the audio playing test in cdopen().
Therefore, also remove PQUIRK_NOSTARTUNIT.
allocation length a little more precisely -- add the space for the header in
cd_mode_sense(). Also delete the XS_CTL_SILENT, since we really do want to
see errors.
Lastly, add a similar wrapper for mode select, simplifying the callers
slightly.
if our other MODE SENSEs fail. Use this code for the optical device case,
at least for now. (We could query the optical media type and do a table
lookup for the geometry, but why bother? Actually, why bother with geometry
at all, but I digress...)