summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ata/atavar.h9
-rw-r--r--sys/dev/ata/wd.c5
-rw-r--r--sys/dev/atapiscsi/atapiscsi.c112
-rw-r--r--sys/dev/ic/wdc.c148
-rw-r--r--sys/dev/ic/wdcvar.h10
-rw-r--r--sys/dev/isa/wdc_isa.c3
-rw-r--r--sys/dev/isa/wdc_isapnp.c1
-rw-r--r--sys/dev/pci/pciide.c12
-rw-r--r--sys/dev/pcmcia/wdc_pcmcia.c3
9 files changed, 162 insertions, 141 deletions
diff --git a/sys/dev/ata/atavar.h b/sys/dev/ata/atavar.h
index 15c521093ad..859f76aa311 100644
--- a/sys/dev/ata/atavar.h
+++ b/sys/dev/ata/atavar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: atavar.h,v 1.3 1999/09/05 21:45:22 niklas Exp $ */
+/* $OpenBSD: atavar.h,v 1.4 1999/10/09 03:42:03 csapuntz Exp $ */
/* $NetBSD: atavar.h,v 1.13 1999/03/10 13:11:43 bouyer Exp $ */
/*
@@ -36,6 +36,8 @@
/* Hight-level functions and structures used by both ATA and ATAPI devices */
+struct ataparams;
+
/* Datas common to drives and controller drivers */
struct ata_drive_datas {
u_int8_t drive; /* drive number */
@@ -81,7 +83,7 @@ struct ata_drive_datas {
/* downgrade mode after this many successive errors */
#define NERRS_MAX 2
- struct device *drv_softc; /* ATA drives softc, if any */
+ struct device *drv_softc; /* ATA/PI drive's softc, can be NULL */
void *chnl_softc; /* channel softc */
};
@@ -154,7 +156,8 @@ int wdc_exec_command __P((struct ata_drive_datas *, struct wdc_command*));
#define WDC_QUEUED 0x02
#define WDC_TRY_AGAIN 0x03
-void wdc_probe_caps __P((struct ata_drive_datas*));
+void wdc_probe_caps __P((struct ata_drive_datas*, struct ataparams *));
+void wdc_print_caps __P((struct ata_drive_datas*));
int wdc_downgrade_mode __P((struct ata_drive_datas*));
void wdc_reset_channel __P((struct ata_drive_datas *));
diff --git a/sys/dev/ata/wd.c b/sys/dev/ata/wd.c
index f246b369dbf..e79a0997065 100644
--- a/sys/dev/ata/wd.c
+++ b/sys/dev/ata/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.7 1999/08/15 09:47:18 millert Exp $ */
+/* $OpenBSD: wd.c,v 1.8 1999/10/09 03:42:03 csapuntz Exp $ */
/* $NetBSD: wd.c,v 1.193 1999/02/28 17:15:27 explorer Exp $ */
/*
@@ -297,6 +297,9 @@ wdattach(parent, self, aux)
return;
}
+ wdc_probe_caps(wd->drvp, &wd->sc_params);
+ wdc_print_caps(wd->drvp);
+
for (blank = 0, p = wd->sc_params.atap_model, q = buf, i = 0;
i < sizeof(wd->sc_params.atap_model); i++) {
c = *p++;
diff --git a/sys/dev/atapiscsi/atapiscsi.c b/sys/dev/atapiscsi/atapiscsi.c
index 9e36f70a3a9..52de17b4ead 100644
--- a/sys/dev/atapiscsi/atapiscsi.c
+++ b/sys/dev/atapiscsi/atapiscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atapiscsi.c,v 1.13 1999/10/06 04:57:32 csapuntz Exp $ */
+/* $OpenBSD: atapiscsi.c,v 1.14 1999/10/09 03:42:03 csapuntz Exp $ */
/*
* This code is derived from code with the copyright below.
@@ -117,7 +117,7 @@ struct atapiscsi_xfer;
int atapiscsi_match __P((struct device *, void *, void *));
void atapiscsi_attach __P((struct device *, struct device *, void *));
-int wdc_atapi_get_params __P((struct atapiscsi_softc *, u_int8_t, int,
+int wdc_atapi_get_params __P((struct channel_softc *, u_int8_t, int,
struct ataparams *));
int atapi_dsc_wait __P((struct ata_drive_datas *, int));
@@ -129,10 +129,7 @@ void atapi_to_scsi_sense __P((struct scsi_xfer *, u_int8_t));
struct atapiscsi_softc {
struct device sc_dev;
struct scsi_link sc_adapterlink;
- struct wdc_softc *sc_wdc;
- u_int8_t sc_channel;
- int valid[2];
- struct ata_drive_datas *sc_drvs;
+ struct channel_softc *chp;
};
static struct scsi_adapter atapiscsi_switch =
@@ -173,6 +170,7 @@ int atapiscsi_match(parent, match, aux)
if (aa_link == NULL)
return (0);
+
if (aa_link->aa_type != T_ATAPI)
return (0);
@@ -191,18 +189,14 @@ atapiscsi_attach(parent, self, aux)
{
struct atapiscsi_softc *as = (struct atapiscsi_softc *)self;
struct ata_atapi_attach *aa_link = aux;
+ struct channel_softc *chp = aa_link->aa_bus_private;
struct ataparams ids;
struct ataparams *id = &ids;
int drive;
printf("\n");
- /* Ouch */
- as->valid[0] = as->valid[1] = 0;
-
- as->sc_wdc = (struct wdc_softc *)parent;
- as->sc_drvs = aa_link->aa_drv_data;
- as->sc_channel = aa_link->aa_channel;
+ as->chp = chp;
as->sc_adapterlink.adapter_softc = as;
as->sc_adapterlink.adapter_target = 7;
as->sc_adapterlink.adapter_buswidth = 2;
@@ -211,22 +205,17 @@ atapiscsi_attach(parent, self, aux)
as->sc_adapterlink.openings = 1;
as->sc_adapterlink.flags = SDEV_ATAPI;
as->sc_adapterlink.quirks = SDEV_NOLUNS;
- as->sc_wdc->channels[as->sc_channel]->ch_as = as;
for (drive = 0; drive < 2 ; drive++ ) {
- struct ata_drive_datas *drvp = &as->sc_drvs[drive];
+ struct ata_drive_datas *drvp = &chp->ch_drive[drive];
if ((drvp->drive_flags & DRIVE_ATAPI) &&
- (wdc_atapi_get_params(as, drive,
+ (wdc_atapi_get_params(chp, drive,
SCSI_POLL|SCSI_NOSLEEP, id) == COMPLETE)) {
-
- as->valid[drive] = 1;
-
- /* This is wrong. All the devices on the ATAPI bus
- will be called atapibus by the IDE side of the
- driver. */
- drvp->drv_softc = (struct device *)as;
- wdc_probe_caps(drvp);
+ /* Temporarily, the device will be called
+ atapiscsi. */
+ drvp->drv_softc = (struct device*)as;
+ wdc_probe_caps(drvp, id);
WDCDEBUG_PRINT(
("general config %04x capabilities %04x ",
@@ -247,20 +236,31 @@ atapiscsi_attach(parent, self, aux)
WDCDEBUG_PRINT(("driver caps %04x\n", drvp->atapi_cap),
DEBUG_PROBE);
- }
+ } else
+ drvp->drive_flags &= ~DRIVE_ATAPI;
}
+ as->sc_adapterlink.scsibus = (u_int8_t)-1;
+
config_found((struct device *)as,
&as->sc_adapterlink, scsiprint);
-}
+ if (as->sc_adapterlink.scsibus != (u_int8_t)-1) {
+ int bus = as->sc_adapterlink.scsibus;
+ for (drive = 0; drive < 2; drive++) {
+ extern struct cfdriver scsibus_cd;
-void
-wdc_atapibus_final_attach(chp)
- struct channel_softc *chp;
-{
- /* Get rid of this eventually */
+ struct scsibus_softc *scsi = scsibus_cd.cd_devs[bus];
+ struct scsi_link *link = scsi->sc_link[drive][0];
+ struct ata_drive_datas *drvp = &chp->ch_drive[drive];
+
+ if (drvp->drv_softc == (struct device *)as && link) {
+ drvp->drv_softc = link->device_softc;
+ wdc_print_caps(drvp);
+ }
+ }
+ }
}
void
@@ -278,10 +278,9 @@ wdc_atapibus_attach(chp)
aa_link.aa_type = T_ATAPI;
aa_link.aa_channel = channel;
aa_link.aa_openings = 1;
- aa_link.aa_drv_data = chp->ch_drive; /* pass the whole array */
-#if 0
- aa_link.aa_bus_private = &wdc->sc_atapi_adapter;
-#endif
+ aa_link.aa_drv_data = NULL;
+ aa_link.aa_bus_private = chp;
+
(void)config_found(&wdc->sc_dev, (void *)&aa_link, atapi_print);
}
@@ -300,15 +299,12 @@ wdc_atapi_minphys (struct buf *bp)
*/
int
-wdc_atapi_get_params(as, drive, flags, id)
- struct atapiscsi_softc *as;
+wdc_atapi_get_params(chp, drive, flags, id)
+ struct channel_softc *chp;
u_int8_t drive;
int flags;
struct ataparams *id;
{
- struct wdc_softc *wdc = as->sc_wdc;
- struct channel_softc *chp =
- wdc->channels[as->sc_channel];
struct wdc_command wdc_c;
/* if no ATAPI device detected at wdc attach time, skip */
@@ -361,12 +357,12 @@ wdc_atapi_send_cmd(sc_xfer)
struct scsi_xfer *sc_xfer;
{
struct atapiscsi_softc *as = sc_xfer->sc_link->adapter_softc;
- struct wdc_softc *wdc = as->sc_wdc;
+ int drive = sc_xfer->sc_link->target;
+ struct channel_softc *chp = as->chp;
+ struct ata_drive_datas *drvp = &chp->ch_drive[drive];
+ struct wdc_softc *wdc = chp->wdc;
struct wdc_xfer *xfer;
int flags = sc_xfer->flags;
- int channel = as->sc_channel;
- int drive = sc_xfer->sc_link->target;
- struct ata_drive_datas *drvp = &as->sc_drvs[drive];
int s, ret, saved_datalen;
char saved_len_bytes[3];
@@ -374,9 +370,9 @@ restart:
saved_datalen = 0;
WDCDEBUG_PRINT(("wdc_atapi_send_cmd %s:%d:%d\n",
- wdc->sc_dev.dv_xname, channel, drive), DEBUG_XFERS);
+ wdc->sc_dev.dv_xname, chp->channel, drive), DEBUG_XFERS);
- if (drive > 1 || !as->valid[drive]) {
+ if (drive > 1 || !(drvp->drive_flags & DRIVE_ATAPI)) {
sc_xfer->error = XS_DRIVER_STUFFUP;
return (COMPLETE);
}
@@ -451,7 +447,7 @@ restart:
}
}
- wdc_exec_xfer(wdc->channels[channel], xfer);
+ wdc_exec_xfer(chp, xfer);
#ifdef DIAGNOSTIC
if (((sc_xfer->flags & SCSI_POLL) != 0 ||
(drvp->atapi_cap & ACAP_DSC) != 0) &&
@@ -1099,22 +1095,18 @@ again:
if (wdcwait(chp, 0, 0, (irq == 0) ? 10000 : 0))
goto timeout;
- if (!(chp->ch_status & WDCS_DRQ) &&
- chp->ch_status & WDCS_ERR) {
- chp->ch_error = bus_space_read_1(chp->cmd_iot,
- chp->cmd_ioh,
- wd_error);
- goto error;
+ /* We don't really care if this operation failed.
+ It's just there to wake the drive from its stupor. */
+ if (!(chp->ch_status & WDCS_ERR)) {
+ wdcbit_bucket(chp, 512);
+
+ errstring = "Post IDENTIFY";
+ /* Wait for the drive to become unbusy before shoving
+ the PIOMODE command down its throat */
+ if (wdcwait(chp, 0, 0, 10000))
+ goto timeout;
}
- wdcbit_bucket(chp, 512);
-
- errstring = "Post IDENTIFY";
- /* Wait for the drive to become unbusy before shoving
- the PIOMODE command down its throat */
- if (wdcwait(chp, 0, 0, 10000))
- goto timeout;
-
drvp->state = PIOMODE;
goto again;
diff --git a/sys/dev/ic/wdc.c b/sys/dev/ic/wdc.c
index de16826fa3c..270ebaff974 100644
--- a/sys/dev/ic/wdc.c
+++ b/sys/dev/ic/wdc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc.c,v 1.9 1999/09/05 21:43:30 niklas Exp $ */
+/* $OpenBSD: wdc.c,v 1.10 1999/10/09 03:42:04 csapuntz Exp $ */
/* $NetBSD: wdc.c,v 1.68 1999/06/23 19:00:17 bouyer Exp $ */
@@ -127,6 +127,8 @@ int wdprint __P((void *, const char *));
#define DEBUG_STATUS 0x04
#define DEBUG_FUNCS 0x08
#define DEBUG_PROBE 0x10
+#define DEBUG_STATUSX 0x20
+
#ifdef WDCDEBUG
int wdcdebug_mask = 0;
int wdc_nxfer = 0;
@@ -290,11 +292,11 @@ wdcprobe(chp)
chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe",
chp->channel, drive, sc, sn, cl, ch), DEBUG_PROBE);
/*
- * sc is supposted to be 0x1 for ATAPI but at last one drive
- * set it to 0x0 - or maybe it's the controller.
+ * This is a simplification of the test in the ATAPI
+ * spec since not all drives seem to set the other regs
+ * correctly.
*/
- if ((sc == 0x00 || sc == 0x01) && sn == 0x01 &&
- cl == 0x14 && ch == 0xeb) {
+ if (cl == 0x14 && ch == 0xeb) {
chp->ch_drive[drive].drive_flags |= DRIVE_ATAPI;
} else {
chp->ch_drive[drive].drive_flags |= DRIVE_ATA;
@@ -352,6 +354,9 @@ wdcattach(chp)
if ((chp->ch_drive[i].drive_flags & DRIVE) == 0)
continue;
+ if (i == 1 && ((chp->ch_drive[0].drive_flags & DRIVE) == 0))
+ chp->ch_flags |= WDCF_ONESLAVE;
+
/* Issue a IDENTIFY command, to try to detect slave ghost */
if (ata_get_params(&chp->ch_drive[i], AT_POLL, &params) ==
CMD_OK) {
@@ -454,8 +459,7 @@ wdcattach(chp)
aa_link.aa_channel = chp->channel;
aa_link.aa_openings = 1;
aa_link.aa_drv_data = &chp->ch_drive[i];
- if (config_found(&chp->wdc->sc_dev, (void *)&aa_link, wdprint))
- wdc_probe_caps(&chp->ch_drive[i]);
+ config_found(&chp->wdc->sc_dev, (void *)&aa_link, wdprint);
}
/*
@@ -495,15 +499,6 @@ wdcattach(chp)
#endif
}
-void
-wdc_final_attach(chp)
- struct channel_softc *chp;
-{
-#if NATAPISCSI > 0
- wdc_atapibus_final_attach(chp);
-#endif
-}
-
/*
* Start I/O on a controller, for the given channel.
* The first xfer may be not for our channel if the channel queues
@@ -723,8 +718,28 @@ wdcwait(chp, mask, bits, timeout)
timeout = timeout * 1000 / WDCDELAY; /* delay uses microseconds */
for (;;) {
+#ifdef TEST_ALTSTS
+ chp->ch_status = status =
+ bus_space_read_1(chp->ctl_iot, chp->ctl_ioh,
+ wd_aux_altsts);
+#else
chp->ch_status = status =
- bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);
+ bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
+ wd_status);
+#endif
+ if (status == 0xff && (chp->ch_flags & WDCF_ONESLAVE)) {
+ bus_space_write_1(chp->cmd_iot, chp->cmd_ioh, wd_sdh,
+ WDSD_IBM | 0x10);
+#ifdef TEST_ALTSTS
+ chp->ch_status = status =
+ bus_space_read_1(chp->ctl_iot, chp->ctl_ioh,
+ wd_aux_altsts);
+#else
+ chp->ch_status = status =
+ bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
+ wd_status);
+#endif
+ }
if ((status & WDCS_BSY) == 0 && (status & mask) == bits)
break;
if (++time > timeout) {
@@ -732,14 +747,22 @@ wdcwait(chp, mask, bits, timeout)
"error %x\n", status,
bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
wd_error)),
- DEBUG_STATUS);
+ DEBUG_STATUSX | DEBUG_STATUS);
return -1;
}
delay(WDCDELAY);
}
- if (status & WDCS_ERR)
+#ifdef TEST_ALTSTS
+ /* Acknowledge any pending interrupts */
+ bus_space_read_1(chp->cmd_iot, chp->cmd_ioh, wd_status);
+#endif
+ if (status & WDCS_ERR) {
chp->ch_error = bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,
wd_error);
+ WDCDEBUG_PRINT(("wdcwait: error %x\n", chp->ch_error),
+ DEBUG_STATUSX | DEBUG_STATUS);
+ }
+
#ifdef WDCNDELAY_DEBUG
/* After autoconfig, there should be no long delays. */
if (!cold && time > WDCNDELAY_DEBUG) {
@@ -794,24 +817,20 @@ wdctimeout(arg)
* XXX this should be a controller-indep function
*/
void
-wdc_probe_caps(drvp)
+wdc_probe_caps(drvp, params)
struct ata_drive_datas *drvp;
+ struct ataparams *params;
{
- struct ataparams params, params2;
struct channel_softc *chp = drvp->chnl_softc;
struct device *drv_dev = drvp->drv_softc;
struct wdc_softc *wdc = chp->wdc;
int i, printed;
- char *sep = "";
int cf_flags;
- if (ata_get_params(drvp, AT_POLL, &params) != CMD_OK) {
- /* IDENTIFY failed. Can't tell more about the device */
- return;
- }
- printf("%s: ", drv_dev->dv_xname);
if ((wdc->cap & (WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32)) ==
(WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_DATA32)) {
+ struct ataparams params2;
+
/*
* Controller claims 16 and 32 bit transfers.
* Re-do an IDENTIFY with 32-bit transfers,
@@ -819,19 +838,16 @@ wdc_probe_caps(drvp)
*/
drvp->drive_flags |= DRIVE_CAP32;
ata_get_params(drvp, AT_POLL, &params2);
- if (bcmp(&params, &params2, sizeof(struct ataparams)) != 0) {
+ if (bcmp(params, &params2, sizeof(struct ataparams)) != 0) {
/* Not good. fall back to 16bits */
drvp->drive_flags &= ~DRIVE_CAP32;
- printf("16-bit");
- } else
- printf("32-bit");
- sep = ", ";
+ }
}
#if 0 /* Some ultra-DMA drives claims to only support ATA-3. sigh */
- if (params.atap_ata_major > 0x01 &&
- params.atap_ata_major != 0xffff) {
+ if (params->atap_ata_major > 0x01 &&
+ params->atap_ata_major != 0xffff) {
for (i = 14; i > 0; i--) {
- if (params.atap_ata_major & (1 << i)) {
+ if (params->atap_ata_major & (1 << i)) {
printf("%sATA version %d\n", sep, i);
drvp->ata_vers = i;
break;
@@ -847,8 +863,8 @@ wdc_probe_caps(drvp)
* It's not in the specs, but it seems that some drive
* returns 0xffff in atap_extensions when this field is invalid
*/
- if (params.atap_extensions != 0xffff &&
- (params.atap_extensions & WDC_EXT_MODES)) {
+ if (params->atap_extensions != 0xffff &&
+ (params->atap_extensions & WDC_EXT_MODES)) {
printed = 0;
/*
* XXX some drives report something wrong here (they claim to
@@ -857,10 +873,9 @@ wdc_probe_caps(drvp)
* If higther mode than 7 is found, abort.
*/
for (i = 7; i >= 0; i--) {
- if ((params.atap_piomode_supp & (1 << i)) == 0)
+ if ((params->atap_piomode_supp & (1 << i)) == 0)
continue;
if (i > 4) {
- printf("\n");
return;
}
@@ -875,8 +890,6 @@ wdc_probe_caps(drvp)
AT_POLL) != CMD_OK)
continue;
if (!printed) {
- printf("%ssupports PIO mode %d", sep, i + 3);
- sep = ", ";
printed = 1;
}
/*
@@ -895,13 +908,12 @@ wdc_probe_caps(drvp)
* We didn't find a valid PIO mode.
* Assume the values returned for DMA are buggy too
*/
- printf("\n");
return;
}
drvp->drive_flags |= DRIVE_MODE;
printed = 0;
for (i = 7; i >= 0; i--) {
- if ((params.atap_dmamode_supp & (1 << i)) == 0)
+ if ((params->atap_dmamode_supp & (1 << i)) == 0)
continue;
if ((wdc->cap & WDC_CAPABILITY_DMA) &&
(wdc->cap & WDC_CAPABILITY_MODE))
@@ -909,8 +921,6 @@ wdc_probe_caps(drvp)
!= CMD_OK)
continue;
if (!printed) {
- printf("%sDMA mode %d", sep, i);
- sep = ", ";
printed = 1;
}
if (wdc->cap & WDC_CAPABILITY_DMA) {
@@ -923,9 +933,9 @@ wdc_probe_caps(drvp)
}
break;
}
- if (params.atap_extensions & WDC_EXT_UDMA_MODES) {
+ if (params->atap_extensions & WDC_EXT_UDMA_MODES) {
for (i = 7; i >= 0; i--) {
- if ((params.atap_udmamode_supp & (1 << i))
+ if ((params->atap_udmamode_supp & (1 << i))
== 0)
continue;
if ((wdc->cap & WDC_CAPABILITY_MODE) &&
@@ -933,8 +943,6 @@ wdc_probe_caps(drvp)
if (ata_set_mode(drvp, 0x40 | i,
AT_POLL) != CMD_OK)
continue;
- printf("%sUltra-DMA mode %d", sep, i);
- sep = ", ";
if (wdc->cap & WDC_CAPABILITY_UDMA) {
if ((wdc->cap & WDC_CAPABILITY_MODE) &&
wdc->UDMA_cap < i)
@@ -947,7 +955,6 @@ wdc_probe_caps(drvp)
}
}
}
- printf("\n");
/* Try to guess ATA version here, if it didn't get reported */
if (drvp->ata_vers == 0) {
@@ -988,6 +995,32 @@ wdc_probe_caps(drvp)
}
}
+void
+wdc_print_caps(drvp)
+ struct ata_drive_datas *drvp;
+{
+ struct device *drv_dev = drvp->drv_softc;
+
+ printf("%s: can use ", drv_dev->dv_xname);
+
+ if (drvp->drive_flags & DRIVE_CAP32) {
+ printf("32-bit");
+ } else
+ printf("16-bit");
+
+ printf(", PIO mode %d", drvp->PIO_cap);
+
+ if (drvp->drive_flags & DRIVE_DMA) {
+ printf(", DMA mode %d", drvp->DMA_cap);
+ }
+
+ if (drvp->drive_flags & DRIVE_UDMA) {
+ printf(", Ultra-DMA mode %d", drvp->UDMA_cap);
+ }
+
+ printf("\n");
+}
+
/*
* downgrade the transfer mode of a drive after an error. return 1 if
* downgrade was possible, 0 otherwise.
@@ -1395,9 +1428,18 @@ __wdcerror(chp, msg)
if (xfer == NULL)
printf("%s:%d: %s\n", chp->wdc->sc_dev.dv_xname, chp->channel,
msg);
- else
- printf("%s:%d:%d: %s\n", chp->wdc->sc_dev.dv_xname,
- chp->channel, xfer->drive, msg);
+ else {
+ struct device *drv_dev = chp->ch_drive[xfer->drive].drv_softc;
+
+ if (drv_dev) {
+ printf("%s(%s:%d:%d): %s\n", drv_dev->dv_xname,
+ chp->wdc->sc_dev.dv_xname,
+ chp->channel, xfer->drive, msg);
+ } else {
+ printf("%s:%d:%d: %s\n", chp->wdc->sc_dev.dv_xname,
+ chp->channel, xfer->drive, msg);
+ }
+ }
}
/*
diff --git a/sys/dev/ic/wdcvar.h b/sys/dev/ic/wdcvar.h
index 9319311eb0b..46d60d93874 100644
--- a/sys/dev/ic/wdcvar.h
+++ b/sys/dev/ic/wdcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdcvar.h,v 1.2 1999/07/22 02:54:06 csapuntz Exp $ */
+/* $OpenBSD: wdcvar.h,v 1.3 1999/10/09 03:42:04 csapuntz Exp $ */
/* $NetBSD: wdcvar.h,v 1.17 1999/04/11 20:50:29 bouyer Exp $ */
/*-
@@ -37,8 +37,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-struct atapiscsi_softc;
-
#define WAITTIME (10 * hz) /* time to wait for a completion */
/* this is a lot for hard drives, but not for cdroms */
@@ -63,13 +61,12 @@ struct channel_softc { /* Per channel data */
int ch_flags;
#define WDCF_ACTIVE 0x01 /* channel is active */
#define WDCF_IRQ_WAIT 0x10 /* controller is waiting for irq */
+#define WDCF_ONESLAVE 0x20 /* slave-only channel */
u_int8_t ch_status; /* copy of status register */
u_int8_t ch_error; /* copy of error register */
/* per-drive infos */
struct ata_drive_datas ch_drive[2];
- struct atapiscsi_softc *ch_as;
-
/*
* channel queues. May be the same for all channels, if hw channels
* are not independants
@@ -159,7 +156,6 @@ struct wdc_xfer {
int wdcprobe __P((struct channel_softc *));
void wdcattach __P((struct channel_softc *));
-void wdc_final_attach __P((struct channel_softc *));
int wdcintr __P((void *));
void wdc_exec_xfer __P((struct channel_softc *, struct wdc_xfer *));
struct wdc_xfer *wdc_get_xfer __P((int)); /* int = WDC_NOSLEEP/CANSLEEP */
@@ -193,8 +189,6 @@ void wdc_delref __P((struct channel_softc *));
#define WDC_RESET_WAIT 31000
void wdc_atapibus_attach __P((struct channel_softc *));
-void wdc_atapibus_final_attach __P((struct channel_softc *));
-
int atapi_print __P((void *, const char *));
void wdc_disable_intr __P((struct channel_softc *));
diff --git a/sys/dev/isa/wdc_isa.c b/sys/dev/isa/wdc_isa.c
index f69d86e96a5..e5b1d7ac83d 100644
--- a/sys/dev/isa/wdc_isa.c
+++ b/sys/dev/isa/wdc_isa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc_isa.c,v 1.3 1999/08/05 00:12:09 niklas Exp $ */
+/* $OpenBSD: wdc_isa.c,v 1.4 1999/10/09 03:42:04 csapuntz Exp $ */
/* $NetBSD: wdc_isa.c,v 1.15 1999/05/19 14:41:25 bouyer Exp $ */
/*-
@@ -197,7 +197,6 @@ wdc_isa_attach(parent, self, aux)
return;
}
wdcattach(&sc->wdc_channel);
- wdc_final_attach(&sc->wdc_channel);
}
#if NISADMA > 0
diff --git a/sys/dev/isa/wdc_isapnp.c b/sys/dev/isa/wdc_isapnp.c
index 9793b8e2935..251d5bfd1e3 100644
--- a/sys/dev/isa/wdc_isapnp.c
+++ b/sys/dev/isa/wdc_isapnp.c
@@ -150,7 +150,6 @@ wdc_isapnp_attach(parent, self, aux)
printf("\n");
wdcattach(&sc->wdc_channel);
- wdc_final_attach(&sc->wdc_channel);
}
#ifdef notyet
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index db517e42da0..490aed573ff 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.10 1999/10/04 22:54:18 deraadt Exp $ */
+/* $OpenBSD: pciide.c,v 1.11 1999/10/09 03:42:04 csapuntz Exp $ */
/* $NetBSD: pciide.c,v 1.40 1999/07/12 13:49:38 bouyer Exp $ */
/*
@@ -436,10 +436,8 @@ pciide_attach(parent, self, aux)
pci_chipset_tag_t pc = pa->pa_pc;
pcitag_t tag = pa->pa_tag;
struct pciide_softc *sc = (struct pciide_softc *)self;
- struct pciide_channel *cp;
pcireg_t csr;
char devinfo[256];
- int i;
sc->sc_pp = pciide_lookup_product(pa->pa_id);
if (sc->sc_pp == NULL) {
@@ -464,14 +462,6 @@ pciide_attach(parent, self, aux)
pci_conf_write(pc, tag, PCI_COMMAND_STATUS_REG, csr);
}
- /* This is a hook so that the ATAPI-SCSI stuff can
- attach the SCSI BUS now and do the probes */
- for (i = 0; i < sc->sc_wdcdev.nchannels; i++) {
- cp = &sc->pciide_channels[i];
-
- wdc_final_attach(&cp->wdc_channel);
- }
-
WDCDEBUG_PRINT(("pciide: command/status register=%x\n",
pci_conf_read(pc, tag, PCI_COMMAND_STATUS_REG)), DEBUG_PROBE);
}
diff --git a/sys/dev/pcmcia/wdc_pcmcia.c b/sys/dev/pcmcia/wdc_pcmcia.c
index 80a870e056c..f5556f31366 100644
--- a/sys/dev/pcmcia/wdc_pcmcia.c
+++ b/sys/dev/pcmcia/wdc_pcmcia.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc_pcmcia.c,v 1.5 1999/08/16 16:51:20 deraadt Exp $ */
+/* $OpenBSD: wdc_pcmcia.c,v 1.6 1999/10/09 03:42:05 csapuntz Exp $ */
/* $NetBSD: wdc_pcmcia.c,v 1.19 1999/02/19 21:49:43 abs Exp $ */
/*-
@@ -371,7 +371,6 @@ wdc_pcmcia_attach(parent, self, aux)
printf("\n");
wdcattach(&sc->wdc_channel);
- wdc_final_attach(&sc->wdc_channel);
}
int