DRIVE_OLD, DRIVE_ATA or DRIVE_ATAPI based on register signatures.
The attach routine will issue a IDENTIFY command for ATA/ATAPI disk,
to detect flase matches by the probe routine.
probe/attach should now be fully compliant with ata-4/ata-5. As a side
effect, ATAPI drives which improperly use ATA register signatures should now
be attached as ATAPI.
need to downgrade, downgrade to PIO, as it has been shown if we got CRC errors
in Ultra-DMA mode, we will have silent data corruption in multiword DMA mode
(isn't IDE wonderfull ? :).
Set timeout to 1s for "normal" ata I/O, to minimise the effects of missed
interrupts.
the disk is ready to transfer data, and in ATA-5 the DSC has been obsoleted.
So only wait for DRQ to transfer data. This can be made conditional on the
ATA version if it's proven to break with some drives (worked with all the
drives I have access to).
While I'm there correct a few typos.
In wdc_probe_caps() add code to guess the ATA revision supported (if
ATA4 if Ultra-DMA, ATA2 if PIO mode > 2). We can't rely on param.atap_ata_major
here, at last one Ultra-DMA drive claims to support only ATA-3.
Use the ATA version in ata_perror(), and to try a flush cache command
in a shutdown hook for IDE drives.
- keep the modes supported by the drive in struct ata_drive_datas (will be
later used for downgrading the DMA/PIO mode on error)
- use config flags to force/disable PIO/DMA/UDMA modes
- For the CMD PCI0643/6 setup DMA mode to DMA Read multiple.
an array of fixed-sized channel_softc elements. This way IDE controllers
which more than 1 channel (pciide) can extend the channel data easily
for private needs.
To avoid the double dereference at runtime, change the argument of
wdcstart() to the channel data pointer instead of the array index.
in the printing of DMA mode (piix3/4 only)
others: set the debug_mask to 0, so that debug messages are turned off by
default but can be easily turned on.
Reset drive_flags to 0 for unconfigured devices, so that they are ignored
later. For configured devices, reset state to 0 after probe/attach.
struct scsipi_adapter; they were not used.
Add a scsipi_ioctl entry point to struct scsipi_adapter. This will be
used to issue ioctl commands to the host adapters.
Inspired by PR #6090, from Matt Jacob.
the capacity based on the c/h/s numbers. In fact, don't use the c/h/s
numbers for much of anything.
For ATA-4 drives or later, always use LBA mode, since it's now required.
Collectively, this allows >8GB disks (like the 12GB Bigfoot) to work.
Compute the disk block addr at command queing time rather than exec time.
This fix a bug which could lead to data corruption on disk: when a command
was reexecuted after an error condition (from wdcunwedge), the partition
offset was re-added to the block addr, leading to a transfert at the wrong
disk block.
This should fix the problem reported by some laptop's users, where the
first disk read after a suspend/resume returned garbage.
the "stream" busification functions.
In the architecture as the BeBox(CPU is big endian, have ISA bus),
These methods would be used where "raw" data needs to {read,write,set}
unchanged.
Add #ifndef __BUS_SPACE_NEED_STREAM_METHODS (define that on NetBSD/bebox),
if not define __BUS_SPACE_NEED_STREAM_METHODS,
define "stream" busification functions to normal busification functions.
* Fix bug in wdc that would overflow ATAPI transfer length.
* Improve wdc probe code so that 'wdc' is probed in if present
even if there are no drives attached, and so that it works
properly even if the only device is an ATAPI slave.
* bus_space-ify.
* split the ISA attachment from the wdc driver, and remove
ISA dependencies from non-ISA files.
* claim that wd and wdc are now machine-independent (probably not
completely true, but mostly so; they at least work on arm32 and
i386).
* Various other minor fixups and cleanups, some of which were pointed
out by Kazuki Sakamoto.
- clean up debug code
- Don't check ATAPI signature when probing ATA drives, ATAPI devices were
detected before
- Reset controller after disks probes. The probe, with some combinations of
ATA/ATAPI device keep it in a mostly working, but strange state (with busy
led on)
- The WDCF_IRQ_WAIT flag is now cleared by wdc_ata_intr and wdc_atapi_intr
when appropriate (helps recover from failure conditions)
- In wdcunwedge, send ATAPI_SOFT_RESET to non-ata drives
(helps recover from failure conditions)
- in wdctimeout be a bit more verbose when we missed an interrupt
- Always Increment xfer->c_skip where it should be
- Set the ITSDONE flag when a polled command completed.
- at end of attach, explicitely select an existing drive. This fixes hangs
some users reported (such as the one reported in port-i386/4247).
- Some atapi cdrom drives (e.g. Nec 24x) don't enables their registers before
a controller reset is issued. The controller probe routine is changed as
follow: issue a controller reset. If fail, test atapi signature on slave.
If fail, wait 5s and retry a reset. If the second reset fail, return(0).
If the first reset succeed, test presence of a master drive:
atapi signature, and if this fail RO/RW registers test. If no master, test
atapi signature on slave. If no slave, return 0.
be probed several times. This fixes the "ATAPI CD probed as wd drive" problem.
Thanks to Geoff Wing <mason@primenet.com.au> for testing this on his hardware.
looking what's the autoconfig do on strange harware, and ATAPI_DEBUG2 is
for debuging data transfers (and is really verbose once the machine has booted
from an IDE disk).
(currently only CD-ROM drives on i386). The sys/dev/scsipi system provides 2
busses to which devices can attach (scsibus and atapibus). This needed to
change some include files and structure names in the low level scsi drivers.