Commit Graph

373 Commits

Author SHA1 Message Date
itojun
aca4c091d3 sprintf -> snprintf 2004-04-22 00:17:10 +00:00
minoura
c5bd25260a Change the value of DRIVE_ATAPIST which was same as that of DRIVE_DMAERR.
Ok'd by bouyer.
2004-04-14 05:26:29 +00:00
bouyer
fca16a87e1 Make wdc_channel->ch_flags volatile, and cast it to (void *) when used
in tsleep()/wakeup() to appease gcc. Otherwise, the ch_flags value may
be cached in a register in atabus_thread(), and when it sets the WDCF_TH_RUN
bit after tsleep() it may loose loose the changes made by an interrupt handler
or another thread.
Problem analysed by Jukka Andberg on tech-kern.
2004-04-13 19:51:06 +00:00
wiz
4fdf521f76 It's extension, not extention. From Miod Vallat (miod at online fr). 2004-03-14 20:11:24 +00:00
fvdl
7e3d28789f During a control operation (like a reset), wait 10us after selecting
the drive. This fixes (or rather, works around) a timing problem
with WD Raptor drives attached to a Sil3114 SATA controller.

Should fix PR 23808, it fixes the same problem for me.
2004-03-02 13:13:57 +00:00
yamt
395e9958f2 change the way to handle NEW_BUFQ_STRATEGY option.
instead of putting #ifdefs into each drivers,
use a global variable to indicate default strategy.

XXX should have a way to specify other strategies.
2004-02-28 06:28:47 +00:00
hannken
3db4e2acd8 Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.
VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp)  Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp)      Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.
2004-01-25 18:06:48 +00:00
yamt
7266a95907 store a i/o priority hint in struct buf for buffer queue discipline. 2004-01-10 14:39:50 +00:00
thorpej
197f2f50da More structure member namespace cleanup: thread -> ch_thread 2004-01-03 23:59:58 +00:00
thorpej
a963286f8d More wdc_channel structure member namespace cleanup:
- channel -> ch_channel
- wdc -> ch_wdc
2004-01-03 22:56:52 +00:00
thorpej
5bd80d8373 Rename "struct channel_softc" to "struct wdc_channel". 2004-01-03 01:50:52 +00:00
thorpej
9bc0bf3f15 Prepend "wdc_" to wait_for_drq, wait_for_unbusy, and wait_for_ready. 2004-01-01 20:25:22 +00:00
thorpej
527c829fa0 Rename:
- wdc_xfer to ata_xfer
- channel_queue to ata_queue
and move them to <dev/ata/atavar.h> so they can be used by non-wdc ATA
controllers.  Clean up the member names of these structures while at it.
2004-01-01 17:18:53 +00:00
thorpej
3787a92812 Move the register definitions for ATA Task File registers to atareg.h;
they are also used by controllers that do not map the registers into the
system address space, and are thus distinct from the "controller" registers.
2003-12-30 19:30:13 +00:00
thorpej
3695c4271b SMART info is logically part of the register set; move it from atavar.h
to atareg.h
2003-12-30 19:12:24 +00:00
thorpej
0ad3db4759 Move most of the atabus layer into ata.c. 2003-12-30 16:28:37 +00:00
thorpej
962cc4da4a Tweak function names in debug messages. 2003-12-30 00:43:31 +00:00
lha
56a919527c add more fields to ata_smart_attr, add structures for selftest log 2003-12-20 19:53:54 +00:00
thorpej
d6d47a7224 Some additional SATA-II registers. 2003-12-17 16:16:36 +00:00
thorpej
5af2747f1e Serial ATA register definitions. 2003-12-14 17:14:47 +00:00
thorpej
b9ee1b0117 Move the wddone() prototype to wd.c 2003-12-14 05:38:20 +00:00
thorpej
777270ce9b Garbage-collect __ATA_DISK_PRIVATE; it is no longer needed. 2003-12-14 05:37:25 +00:00
thorpej
d8f4e7306d No need to include wdvar.h anymore. 2003-12-14 05:34:29 +00:00
thorpej
a58ada4aad Instead of calling wddone() directly, set a (*drv_done)() callback in
the ata_drive_datas structure and invoke that.
2003-12-14 05:33:29 +00:00
thorpej
3dd2f16d75 Move struct ata_device from wdvar.h to atavar.h. 2003-12-14 05:14:39 +00:00
thorpej
09bbcae770 Move struct ata_bustype from wdvar.h to atavar.h. 2003-12-14 05:10:19 +00:00
thorpej
be3146e7b3 Move struct ata_bio from wdvar.h to atavar.h. 2003-12-14 05:03:28 +00:00
thorpej
86046f9e1b Tidy up the whitespace. 2003-12-14 04:59:40 +00:00
thorpej
a644de6271 Liberally apply static. 2003-12-14 02:48:36 +00:00
thorpej
0848b66944 Cosmetic changes in some autoconfiguration messages. 2003-12-14 02:46:34 +00:00
thorpej
51132ab100 De-__P and use ANSI-style function decls. 2003-12-14 02:45:48 +00:00
keihan
b8702f530b netbsd.org -> NetBSD.org
This was the last commit of this kind to src/sys, which is now totally
"NetBSD.org clean".  Thanks for the patiance, and sorry for all the commits.
2003-12-04 13:57:30 +00:00
yamt
c64b77bad6 add definitions of new feature bits. 2003-11-30 14:05:47 +00:00
yamt
b9bb4e3f05 - rename WDC_CAP_LBA48 to ATA_CMD2_LBA48.
- remove WDC_CAP_QUEUE. (there's already ATA_CMD2_RWQ.)

as discussed on tech-kern@.
2003-11-30 13:57:12 +00:00
fvdl
6242a54566 There are some cards that map the ATA control and IDE DMA registers
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).
2003-11-27 23:02:40 +00:00
yamt
d1e85f1677 remove ATA_CMD2_SMART, which seems wrong and isn't used. 2003-11-26 15:03:14 +00:00
mycroft
552d27479a Replace home-grown locks with lockmgr(). 2003-11-07 04:10:56 +00:00
wiz
c0177219fe Fix some typos. From Tom Cosgrove via jmc@openbsd. 2003-11-02 09:52:33 +00:00
wiz
0aca09fbc0 Fix two typos. From Tom Cosgrove via jmc@openbsd. 2003-11-02 09:49:20 +00:00
bouyer
14cd9d8cff freese->freeze, as pointed out by Frederick Bruck. 2003-10-29 22:05:15 +00:00
mycroft
3fbc866a6e Back out the bogus initializer -- the compiler bug is fixed. 2003-10-29 21:26:43 +00:00
cl
b8d68ee313 note 'm68k {u,}int64_t used uninitialized' bug.
add reference to gcc bug report.
mark all (known) occurrences.
2003-10-28 02:01:46 +00:00
fredb
fc4e07a00b Appease gcc3 "-Wno-uninitialized". 2003-10-27 23:06:15 +00:00
bouyer
7719e83c8b Following Matt Thomas's request, rename ata attribute to ata_hl, and
wdc_base to ata. We can now have
atabus* at ata?
in kernel config files.
2003-10-08 20:57:59 +00:00
bouyer
99d6009c2a Make the ATA mid-layer appears as atabus, as proposed in
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.
2003-10-08 10:58:12 +00:00
bouyer
7b066791c8 Remove references to University of California from my copyright notices. 2003-10-05 17:48:49 +00:00
grant
d2b2b89242 typo in comment 2003-09-29 23:31:04 +00:00
mycroft
f9d629fb93 Fix more probe delay and/or failure problems:
1) Don't wait for DRQ on an IDENTIFY command -- if it's not set when we see
   BSY clear, abort the command and ignore the drive.  (Do this by testing
   for DRQ in the read/write cases in __wdccommand_intr().)
2) Don't wait for DRQ to deassert when we finish an IDENTIFY (or any other
   non-block command that reads data) -- we don't do this for block I/O, and
   empirically it doesn't clear on my CF cards at all, causing a pointless 1s
   delay.
3) Add comments to some of the delay()s, and add missing ones in wdcreset()
   and the WDCC_RECAL in the so-called "pre-ATA" probe.
4) Slightly simplify the reset sequence -- we were doing an extra I/O.
5) Modify the register writability test to make sure that registers are not
   overlapped -- this can happen in some weird cases with a missing device 1.
6) Check the error register value after the reset -- if it's not 01h or 81h,
   as appropriate (see ATA spec), punt.
Tested with a number of ATA-only, ATAPI-only, mixed ATA-ATAPI, CF, and IDE
disk configurations.

Also remove the SINGLE_DRIVE nonsense again.
2003-09-23 09:19:22 +00:00
skd
f3de6832d9 Additional definitions as per SATA specifications.
Approved by Manuel Bouyer.
2003-09-23 03:55:59 +00:00
mycroft
d40837608f 1) Use config_interrupts() to attach IDE and ATAPI drives. This eliminates
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.
2003-09-19 21:35:56 +00:00