diff options
| author | thorpej <thorpej@NetBSD.org> | 2004-08-13 02:10:43 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 2004-08-13 02:10:43 +0000 |
| commit | 996c3ca90e2571624bdff8efdc29503573abb3eb (patch) | |
| tree | a57ab250dcb589c88534b01510bebadae9299a05 /sys/dev | |
| parent | d949dd984b93a210fa4775c135bb72a07e870970 (diff) | |
Move wdc_exec_xfer() to ata.c and rename it ata_exec_xfer().
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ata/ata.c | 25 | ||||
| -rw-r--r-- | sys/dev/ata/ata_wdc.c | 6 | ||||
| -rw-r--r-- | sys/dev/ata/atavar.h | 3 | ||||
| -rw-r--r-- | sys/dev/ic/wdc.c | 24 | ||||
| -rw-r--r-- | sys/dev/ic/wdcvar.h | 3 | ||||
| -rw-r--r-- | sys/dev/scsipi/atapi_wdc.c | 6 |
6 files changed, 35 insertions, 32 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 *); diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index fc4ea1c8406..ec03a69e4f4 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.200 2004/08/12 22:39:41 thorpej Exp $ */ +/* $NetBSD: wdc.c,v 1.201 2004/08/13 02:10:43 thorpej Exp $ */ /* * Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.200 2004/08/12 22:39:41 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.201 2004/08/13 02:10:43 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -1449,7 +1449,7 @@ wdc_exec_command(struct ata_drive_datas *drvp, struct ata_command *ata_c) xfer->c_kill_xfer = __wdccommand_kill_xfer; s = splbio(); - wdc_exec_xfer(chp, xfer); + ata_exec_xfer(chp, xfer); #ifdef DIAGNOSTIC if ((ata_c->flags & AT_POLL) != 0 && (ata_c->flags & AT_DONE) == 0) @@ -1807,24 +1807,6 @@ wdccommandshort(struct wdc_channel *chp, int drive, int command) bus_space_write_1(chp->cmd_iot, chp->cmd_iohs[wd_command], 0, command); } -/* Add a command to the queue and start controller. Must be called at splbio */ -void -wdc_exec_xfer(struct wdc_channel *chp, struct ata_xfer *xfer) -{ - - WDCDEBUG_PRINT(("wdc_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 wdc_exec_xfer, flags 0x%x\n", - chp->ch_flags), DEBUG_XFERS); - wdcstart(chp); -} - static void __wdcerror(struct wdc_channel *chp, char *msg) { diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h index ea3b966d612..a108a678f27 100644 --- a/sys/dev/ic/wdcvar.h +++ b/sys/dev/ic/wdcvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: wdcvar.h,v 1.71 2004/08/12 22:39:41 thorpej Exp $ */ +/* $NetBSD: wdcvar.h,v 1.72 2004/08/13 02:10:43 thorpej Exp $ */ /*- * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. @@ -191,7 +191,6 @@ void wdcattach(struct wdc_channel *); int wdcdetach(struct device *, int); int wdcactivate(struct device *, enum devact); int wdcintr(void *); -void wdc_exec_xfer(struct wdc_channel *, struct ata_xfer *); void wdcstart(struct wdc_channel *); void wdcrestart(void*); diff --git a/sys/dev/scsipi/atapi_wdc.c b/sys/dev/scsipi/atapi_wdc.c index 090109f636e..ce750e9ced0 100644 --- a/sys/dev/scsipi/atapi_wdc.c +++ b/sys/dev/scsipi/atapi_wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: atapi_wdc.c,v 1.82 2004/08/12 22:39:41 thorpej Exp $ */ +/* $NetBSD: atapi_wdc.c,v 1.83 2004/08/13 02:10:43 thorpej Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.82 2004/08/12 22:39:41 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.83 2004/08/13 02:10:43 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -386,7 +386,7 @@ wdc_atapi_scsipi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req, xfer->c_kill_xfer = wdc_atapi_kill_xfer; xfer->c_dscpoll = 0; s = splbio(); - wdc_exec_xfer(wdc->channels[channel], xfer); + ata_exec_xfer(wdc->channels[channel], xfer); #ifdef DIAGNOSTIC if ((sc_xfer->xs_control & XS_CTL_POLL) != 0 && (sc_xfer->xs_status & XS_STS_DONE) == 0) |
