Rename some constants:
WDC_COMPLETE -> ATACMD_COMPLETE WDC_QUEUED -> ATACMD_QUEUED WDC_TRY_AGAIN -> ATACMD_TRY_AGAIN
This commit is contained in:
parent
3ddac9b2da
commit
9167731c79
@ -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 <sys/cdefs.h>
|
||||
__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;
|
||||
|
@ -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 <sys/cdefs.h>
|
||||
__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
|
||||
|
@ -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 *);
|
||||
|
@ -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 <sys/cdefs.h>
|
||||
__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;
|
||||
}
|
||||
|
@ -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 <sys/cdefs.h>
|
||||
__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);
|
||||
|
@ -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 *);
|
||||
|
@ -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 <sys/cdefs.h>
|
||||
__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);
|
||||
|
@ -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 <sys/cdefs.h>
|
||||
__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 <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user