summaryrefslogtreecommitdiff
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2004-08-13 02:10:43 +0000
committerthorpej <thorpej@NetBSD.org>2004-08-13 02:10:43 +0000
commit996c3ca90e2571624bdff8efdc29503573abb3eb (patch)
treea57ab250dcb589c88534b01510bebadae9299a05 /sys/dev/ata
parentd949dd984b93a210fa4775c135bb72a07e870970 (diff)
Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer().
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata.c25
-rw-r--r--sys/dev/ata/ata_wdc.c6
-rw-r--r--sys/dev/ata/atavar.h3
3 files changed, 28 insertions, 6 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c
index ffe5a265144..d480f654c15 100644
--- a/sys/dev/ata/ata.c
+++ b/sys/dev/ata/ata.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata.c,v 1.43 2004/08/12 22:39:40 thorpej Exp $ */
+/* $NetBSD: ata.c,v 1.44 2004/08/13 02:10:43 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.43 2004/08/12 22:39:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.44 2004/08/13 02:10:43 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@@ -62,6 +62,7 @@ __KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.43 2004/08/12 22:39:40 thorpej Exp $");
#define DEBUG_FUNCS 0x08
#define DEBUG_PROBE 0x10
#define DEBUG_DETACH 0x20
+#define DEBUG_XFERS 0x40
#ifdef WDCDEBUG
extern int wdcdebug_mask; /* init'ed in wdc.c */
#define WDCDEBUG_PRINT(args, level) \
@@ -500,6 +501,26 @@ ata_dmaerr(struct ata_drive_datas *drvp, int flags)
}
}
+/*
+ * Add a command to the queue and start controller. Must be called at splbio
+ */
+void
+ata_exec_xfer(struct wdc_channel *chp, struct ata_xfer *xfer)
+{
+
+ WDCDEBUG_PRINT(("ata_exec_xfer %p channel %d drive %d\n", xfer,
+ chp->ch_channel, xfer->c_drive), DEBUG_XFERS);
+
+ /* complete xfer setup */
+ xfer->c_chp = chp;
+
+ /* insert at the end of command list */
+ TAILQ_INSERT_TAIL(&chp->ch_queue->queue_xfer, xfer, c_xferchain);
+ WDCDEBUG_PRINT(("wdcstart from ata_exec_xfer, flags 0x%x\n",
+ chp->ch_flags), DEBUG_XFERS);
+ wdcstart(chp);
+}
+
struct ata_xfer *
ata_get_xfer(int flags)
{
diff --git a/sys/dev/ata/ata_wdc.c b/sys/dev/ata/ata_wdc.c
index e479ad52636..53f08e9b9a3 100644
--- a/sys/dev/ata/ata_wdc.c
+++ b/sys/dev/ata/ata_wdc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ata_wdc.c,v 1.67 2004/08/12 22:39:40 thorpej Exp $ */
+/* $NetBSD: ata_wdc.c,v 1.68 2004/08/13 02:10:43 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001, 2003 Manuel Bouyer.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.67 2004/08/12 22:39:40 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.68 2004/08/13 02:10:43 thorpej Exp $");
#ifndef WDCDEBUG
#define WDCDEBUG
@@ -193,7 +193,7 @@ wdc_ata_bio(struct ata_drive_datas *drvp, struct ata_bio *ata_bio)
xfer->c_start = wdc_ata_bio_start;
xfer->c_intr = wdc_ata_bio_intr;
xfer->c_kill_xfer = wdc_ata_bio_kill_xfer;
- wdc_exec_xfer(chp, xfer);
+ ata_exec_xfer(chp, xfer);
return (ata_bio->flags & ATA_ITSDONE) ? ATACMD_COMPLETE : ATACMD_QUEUED;
}
diff --git a/sys/dev/ata/atavar.h b/sys/dev/ata/atavar.h
index 371360297d0..e7e3abec39d 100644
--- a/sys/dev/ata/atavar.h
+++ b/sys/dev/ata/atavar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: atavar.h,v 1.56 2004/08/12 22:39:41 thorpej Exp $ */
+/* $NetBSD: atavar.h,v 1.57 2004/08/13 02:10:43 thorpej Exp $ */
/*
* Copyright (c) 1998, 2001 Manuel Bouyer.
@@ -313,6 +313,7 @@ void ata_free_xfer(struct wdc_channel *, struct ata_xfer *);
#define ATAXF_CANSLEEP 0x00
#define ATAXF_NOSLEEP 0x01
+void ata_exec_xfer(struct wdc_channel *, struct ata_xfer *);
void ata_kill_pending(struct ata_drive_datas *);
int ata_addref(struct wdc_channel *);