Add support for passing device quirks from the attachment routine,

and add support for a NO_EXTRA_RESETS quirk (required by the TEAC
IDE Card/II, which the Vaio uses).
This commit is contained in:
kenh 1998-09-10 19:24:45 +00:00
parent 9dba6f18e8
commit 9539399333
2 changed files with 10 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdc.c,v 1.27 1998/08/15 10:10:50 mycroft Exp $ */
/* $NetBSD: wdc.c,v 1.28 1998/09/10 19:24:45 kenh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -350,7 +350,8 @@ wdcattach(wdc, adp)
* devices keep it in a mostly working, but strange state (with busy
* led on)
*/
wdcreset(wdc, VERBOSE);
if (!(wdc->sc_adp->flags & WDC_NO_EXTRA_RESETS))
wdcreset(wdc, VERBOSE);
}
/*
@ -1532,7 +1533,8 @@ wdc_atapi_get_params(ab_link, drive, id)
wdc->sc_flags |= WDCF_ACTIVE;
error = 1;
(void)wdcreset(wdc, VERBOSE);
if (!(wdc->sc_adp->flags & WDC_NO_EXTRA_RESETS))
(void)wdcreset(wdc, VERBOSE);
if ((status = wdccommand(wdc, (struct wd_link*)(&(ab_link->scsipi_atapi)),
ATAPI_SOFT_RESET, drive, 0, 0, 0, 0)) != 0) {
#ifdef ATAPI_DEBUG

View File

@ -1,4 +1,4 @@
/* $NetBSD: wdcvar.h,v 1.3 1998/08/15 10:10:50 mycroft Exp $ */
/* $NetBSD: wdcvar.h,v 1.4 1998/09/10 19:24:45 kenh Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -39,6 +39,7 @@
struct wdc_attachment_data {
/* manadatory fields */
int cap;
int flags;
bus_space_tag_t iot;
bus_space_handle_t ioh;
bus_space_tag_t auxiot;
@ -67,6 +68,9 @@ struct wdc_attachment_data {
#define WDC_CAPABILITY_DMA 0x02 /* DMA */
#define WDC_CAPABILITY_HWLOCK 0x04 /* Needs to lock HW */
/* Flags passed from the attach routine to the wdc driver */
#define WDC_NO_EXTRA_RESETS 0x01 /* Only reset once at attach */
struct wdc_softc {
struct device sc_dev;
const struct wdc_attachment_data *sc_adp;