From 9167731c79f9ff73ae663c097f7cd28e6f9b06a6 Mon Sep 17 00:00:00 2001 From: thorpej Date: Thu, 12 Aug 2004 05:02:50 +0000 Subject: [PATCH] Rename some constants: WDC_COMPLETE -> ATACMD_COMPLETE WDC_QUEUED -> ATACMD_QUEUED WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN --- sys/dev/ata/ata.c | 8 ++++---- sys/dev/ata/ata_wdc.c | 12 ++++++------ sys/dev/ata/atavar.h | 8 ++++---- sys/dev/ata/wd.c | 24 ++++++++++++------------ sys/dev/ic/wdc.c | 12 ++++++------ sys/dev/ic/wdcvar.h | 5 +---- sys/dev/scsipi/atapi_wdc.c | 6 +++--- sys/dev/usb/umass_isdata.c | 16 ++++++++-------- 8 files changed, 44 insertions(+), 47 deletions(-) diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c index 37e30bcd5aab..4f143652f968 100644 --- a/sys/dev/ata/ata.c +++ b/sys/dev/ata/ata.c @@ -1,4 +1,4 @@ -/* $NetBSD: ata.c,v 1.36 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: ata.c,v 1.37 2004/08/12 05:02:50 thorpej Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.36 2004/08/12 04:57:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata.c,v 1.37 2004/08/12 05:02:50 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -407,7 +407,7 @@ ata_get_params(struct ata_drive_datas *drvp, u_int8_t flags, ata_c.flags = AT_READ | flags; ata_c.data = tb; ata_c.bcount = DEV_BSIZE; - if (wdc_exec_command(drvp, &ata_c) != WDC_COMPLETE) { + if (wdc_exec_command(drvp, &ata_c) != ATACMD_COMPLETE) { WDCDEBUG_PRINT(("ata_get_parms: wdc_exec_command failed\n"), DEBUG_FUNCS|DEBUG_PROBE); return CMD_AGAIN; @@ -466,7 +466,7 @@ ata_set_mode(struct ata_drive_datas *drvp, u_int8_t mode, u_int8_t flags) ata_c.r_count = mode; ata_c.flags = flags; ata_c.timeout = 1000; /* 1s */ - if (wdc_exec_command(drvp, &ata_c) != WDC_COMPLETE) + if (wdc_exec_command(drvp, &ata_c) != ATACMD_COMPLETE) return CMD_AGAIN; if (ata_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) { return CMD_ERR; diff --git a/sys/dev/ata/ata_wdc.c b/sys/dev/ata/ata_wdc.c index c788d132a898..17fe59cce85c 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.63 2004/08/11 18:41:46 mycroft Exp $ */ +/* $NetBSD: ata_wdc.c,v 1.64 2004/08/12 05:02:50 thorpej Exp $ */ /* * Copyright (c) 1998, 2001, 2003 Manuel Bouyer. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.63 2004/08/11 18:41:46 mycroft Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ata_wdc.c,v 1.64 2004/08/12 05:02:50 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -166,8 +166,8 @@ int to48(int cmd32) } /* - * Handle block I/O operation. Return WDC_COMPLETE, WDC_QUEUED, or - * WDC_TRY_AGAIN. Must be called at splbio(). + * Handle block I/O operation. Return ATACMD_COMPLETE, ATACMD_QUEUED, or + * ATACMD_TRY_AGAIN. Must be called at splbio(). */ static int wdc_ata_bio(struct ata_drive_datas *drvp, struct ata_bio *ata_bio) @@ -178,7 +178,7 @@ wdc_ata_bio(struct ata_drive_datas *drvp, struct ata_bio *ata_bio) xfer = wdc_get_xfer(WDC_NOSLEEP); if (xfer == NULL) - return WDC_TRY_AGAIN; + return ATACMD_TRY_AGAIN; if (wdc->cap & WDC_CAPABILITY_NOIRQ) ata_bio->flags |= ATA_POLL; if (ata_bio->flags & ATA_POLL) @@ -194,7 +194,7 @@ wdc_ata_bio(struct ata_drive_datas *drvp, struct ata_bio *ata_bio) xfer->c_intr = wdc_ata_bio_intr; xfer->c_kill_xfer = wdc_ata_bio_kill_xfer; wdc_exec_xfer(chp, xfer); - return (ata_bio->flags & ATA_ITSDONE) ? WDC_COMPLETE : WDC_QUEUED; + return (ata_bio->flags & ATA_ITSDONE) ? ATACMD_COMPLETE : ATACMD_QUEUED; } static void diff --git a/sys/dev/ata/atavar.h b/sys/dev/ata/atavar.h index 74854ef4f078..4666f48a35b1 100644 --- a/sys/dev/ata/atavar.h +++ b/sys/dev/ata/atavar.h @@ -1,4 +1,4 @@ -/* $NetBSD: atavar.h,v 1.49 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: atavar.h,v 1.50 2004/08/12 05:02:50 thorpej Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. @@ -269,9 +269,9 @@ struct ata_bustype { int (*ata_exec_command)(struct ata_drive_datas *, struct ata_command *); -#define WDC_COMPLETE 0x01 -#define WDC_QUEUED 0x02 -#define WDC_TRY_AGAIN 0x03 +#define ATACMD_COMPLETE 0x01 +#define ATACMD_QUEUED 0x02 +#define ATACMD_TRY_AGAIN 0x03 int (*ata_get_params)(struct ata_drive_datas *, u_int8_t, struct ataparams *); diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c index de2beaab5dc6..dc8453b21fb4 100644 --- a/sys/dev/ata/wd.c +++ b/sys/dev/ata/wd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wd.c,v 1.287 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: wd.c,v 1.288 2004/08/12 05:02:50 thorpej Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. All rights reserved. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.287 2004/08/12 04:57:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.288 2004/08/12 05:02:50 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -711,11 +711,11 @@ __wdstart(struct wd_softc *wd, struct buf *bp) /* Instrumentation. */ disk_busy(&wd->sc_dk); switch (wd->atabus->ata_bio(wd->drvp, &wd->sc_wdc_bio)) { - case WDC_TRY_AGAIN: + case ATACMD_TRY_AGAIN: callout_reset(&wd->sc_restart_ch, hz, wdrestart, wd); break; - case WDC_QUEUED: - case WDC_COMPLETE: + case ATACMD_QUEUED: + case ATACMD_COMPLETE: break; default: panic("__wdstart: bad return code from ata_bio()"); @@ -1475,13 +1475,13 @@ wddump(dev_t dev, daddr_t blkno, caddr_t va, size_t size) wd->sc_wdc_bio.databuf = va; #ifndef WD_DUMP_NOT_TRUSTED switch (wd->atabus->ata_bio(wd->drvp, &wd->sc_wdc_bio)) { - case WDC_TRY_AGAIN: + case ATACMD_TRY_AGAIN: panic("wddump: try again"); break; - case WDC_QUEUED: + case ATACMD_QUEUED: panic("wddump: polled command has been queued"); break; - case WDC_COMPLETE: + case ATACMD_COMPLETE: break; } switch(wd->sc_wdc_bio.error) { @@ -1635,7 +1635,7 @@ wd_setcache(struct wd_softc *wd, int bits) ata_c.r_features = WDSF_WRITE_CACHE_EN; else ata_c.r_features = WDSF_WRITE_CACHE_DS; - if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != WDC_COMPLETE) { + if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != ATACMD_COMPLETE) { printf("%s: wd_setcache command not complete\n", wd->sc_dev.dv_xname); return EIO; @@ -1661,7 +1661,7 @@ wd_standby(struct wd_softc *wd, int flags) ata_c.r_st_pmask = WDCS_DRDY; ata_c.flags = flags; ata_c.timeout = 30000; /* 30s timeout */ - if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != WDC_COMPLETE) { + if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != ATACMD_COMPLETE) { printf("%s: standby immediate command didn't complete\n", wd->sc_dev.dv_xname); return EIO; @@ -1697,7 +1697,7 @@ wd_flushcache(struct wd_softc *wd, int flags) ata_c.r_st_pmask = WDCS_DRDY; ata_c.flags = flags; ata_c.timeout = 30000; /* 30s timeout */ - if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != WDC_COMPLETE) { + if (wd->atabus->ata_exec_command(wd->drvp, &ata_c) != ATACMD_COMPLETE) { printf("%s: flush cache command didn't complete\n", wd->sc_dev.dv_xname); return EIO; @@ -1866,7 +1866,7 @@ wdioctlstrategy(struct buf *bp) ata_c.bcount = wi->wi_bp.b_bcount; if (wi->wi_softc->atabus->ata_exec_command(wi->wi_softc->drvp, &ata_c) - != WDC_COMPLETE) { + != ATACMD_COMPLETE) { wi->wi_atareq.retsts = ATACMD_ERROR; goto bad; } diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c index 1302f4273f6e..929e1ba01b01 100644 --- a/sys/dev/ic/wdc.c +++ b/sys/dev/ic/wdc.c @@ -1,4 +1,4 @@ -/* $NetBSD: wdc.c,v 1.192 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: wdc.c,v 1.193 2004/08/12 05:02:50 thorpej Exp $ */ /* * Copyright (c) 1998, 2001, 2003 Manuel Bouyer. All rights reserved. @@ -70,7 +70,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.192 2004/08/12 04:57:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wdc.c,v 1.193 2004/08/12 05:02:50 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -1718,7 +1718,7 @@ wdc_exec_command(struct ata_drive_datas *drvp, struct ata_command *ata_c) xfer = wdc_get_xfer(ata_c->flags & AT_WAIT ? WDC_CANSLEEP : WDC_NOSLEEP); if (xfer == NULL) { - return WDC_TRY_AGAIN; + return ATACMD_TRY_AGAIN; } if (wdc->cap & WDC_CAPABILITY_NOIRQ) @@ -1741,15 +1741,15 @@ wdc_exec_command(struct ata_drive_datas *drvp, struct ata_command *ata_c) panic("wdc_exec_command: polled command not done"); #endif if (ata_c->flags & AT_DONE) { - ret = WDC_COMPLETE; + ret = ATACMD_COMPLETE; } else { if (ata_c->flags & AT_WAIT) { while ((ata_c->flags & AT_DONE) == 0) { tsleep(ata_c, PRIBIO, "wdccmd", 0); } - ret = WDC_COMPLETE; + ret = ATACMD_COMPLETE; } else { - ret = WDC_QUEUED; + ret = ATACMD_QUEUED; } } splx(s); diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h index 126f306a5ae3..b466137f1a8c 100644 --- a/sys/dev/ic/wdcvar.h +++ b/sys/dev/ic/wdcvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: wdcvar.h,v 1.65 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: wdcvar.h,v 1.66 2004/08/12 05:02:50 thorpej Exp $ */ /*- * Copyright (c) 1998, 2003 The NetBSD Foundation, Inc. @@ -225,9 +225,6 @@ void wdc_reset_drive(struct ata_drive_datas *, int); void wdc_reset_channel(struct wdc_channel *, int); int wdc_exec_command(struct ata_drive_datas *, struct ata_command*); -#define WDC_COMPLETE 0x01 -#define WDC_QUEUED 0x02 -#define WDC_TRY_AGAIN 0x03 int wdc_addref(struct wdc_channel *); void wdc_delref(struct wdc_channel *); diff --git a/sys/dev/scsipi/atapi_wdc.c b/sys/dev/scsipi/atapi_wdc.c index 08bbfced2dca..bde7fa9c90b2 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.78 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: atapi_wdc.c,v 1.79 2004/08/12 05:02:50 thorpej Exp $ */ /* * Copyright (c) 1998, 2001 Manuel Bouyer. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.78 2004/08/12 04:57:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atapi_wdc.c,v 1.79 2004/08/12 05:02:50 thorpej Exp $"); #ifndef WDCDEBUG #define WDCDEBUG @@ -211,7 +211,7 @@ wdc_atapi_get_params(struct scsipi_channel *chan, int drive, ata_c.r_st_pmask = 0; ata_c.flags = AT_WAIT | AT_POLL; ata_c.timeout = WDC_RESET_WAIT; - if (wdc_exec_command(&chp->ch_drive[drive], &ata_c) != WDC_COMPLETE) { + if (wdc_exec_command(&chp->ch_drive[drive], &ata_c) != ATACMD_COMPLETE) { printf("wdc_atapi_get_params: ATAPI_SOFT_RESET failed for" " drive %s:%d:%d: driver failed\n", wdc->sc_dev.dv_xname, chp->ch_channel, drive); diff --git a/sys/dev/usb/umass_isdata.c b/sys/dev/usb/umass_isdata.c index 60c501718c17..d7968fcf0db4 100644 --- a/sys/dev/usb/umass_isdata.c +++ b/sys/dev/usb/umass_isdata.c @@ -1,4 +1,4 @@ -/* $NetBSD: umass_isdata.c,v 1.10 2004/08/12 04:57:19 thorpej Exp $ */ +/* $NetBSD: umass_isdata.c,v 1.11 2004/08/12 05:02:50 thorpej Exp $ */ /* * TODO: @@ -44,7 +44,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.10 2004/08/12 04:57:19 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umass_isdata.c,v 1.11 2004/08/12 05:02:50 thorpej Exp $"); #include #include @@ -293,12 +293,12 @@ uisdata_bio1(struct ata_drive_datas *drv, struct ata_bio *ata_bio) printf("%s: ATA_NOSLEEP not supported\n", __func__); ata_bio->error = TIMEOUT; ata_bio->flags |= ATA_ITSDONE; - return (WDC_COMPLETE); + return (ATACMD_COMPLETE); } if (scbus->sc_ata_bio != NULL) { printf("%s: multiple uisdata_bio\n", __func__); - return (WDC_TRY_AGAIN); + return (ATACMD_TRY_AGAIN); } else scbus->sc_ata_bio = ata_bio; @@ -369,11 +369,11 @@ uisdata_bio1(struct ata_drive_datas *drv, struct ata_bio *ata_bio) if (tsleep(ata_bio, PZERO, "uisdatabl", 0)) { ata_bio->error = TIMEOUT; ata_bio->flags |= ATA_ITSDONE; - return (WDC_COMPLETE); + return (ATACMD_COMPLETE); } } - return (ata_bio->flags & ATA_ITSDONE) ? WDC_COMPLETE : WDC_QUEUED; + return (ata_bio->flags & ATA_ITSDONE) ? ATACMD_COMPLETE : ATACMD_QUEUED; } void @@ -460,7 +460,7 @@ uisdata_exec_command(struct ata_drive_datas *drv, struct ata_command *cmd) } done: - return (WDC_COMPLETE); + return (ATACMD_COMPLETE); } int @@ -519,7 +519,7 @@ uisdata_get_params(struct ata_drive_datas *drvp, u_int8_t flags, ata_c.flags = AT_READ | flags; ata_c.data = tb; ata_c.bcount = DEV_BSIZE; - if (uisdata_exec_command(drvp, &ata_c) != WDC_COMPLETE) { + if (uisdata_exec_command(drvp, &ata_c) != ATACMD_COMPLETE) { DPRINTF(("uisdata_get_parms: wdc_exec_command failed\n")); return (CMD_AGAIN); }