int wdc_nxfer = 0; #define WDCDEBUG_PRINT(args, level)  if (wdcdebug_mask & (level)) printf args #else #define WDCDEBUG_PRINT(args, level) #endif
LIST_HEAD(xfer_free_list, wdc_xfer) xfer_free_list;static void  __wdcerror	  __P((struct channel_softc*, char *));static int   __wdcwait_reset  __P((struct channel_softc *, int));void  __wdccommand_done __P((struct channel_softc *, struct wdc_xfer *));void  __wdccommand_start __P((struct channel_softc *, struct wdc_xfer *));	int   __wdccommand_intr __P((struct channel_softc *, struct wdc_xfer *, int));int   wdprint __P((void *, const char *));void  wdc_kill_pending __P((struct channel_softc *));#define DEBUG_INTR   0x01#define DEBUG_XFERS  0x02#define DEBUG_STATUS 0x04#define DEBUG_FUNCS  0x08#define DEBUG_PROBE  0x10#define DEBUG_STATUSX 0x20#define DEBUG_SDRIVE 0x40#define DEBUG_DETACH 0x80#ifdef WDCDEBUGint wdcdebug_mask = 0;int wdc_nxfer = 0;#define WDCDEBUG_PRINT(args, level)  if (wdcdebug_mask & (level)) printf args#else#define WDCDEBUG_PRINT(args, level)#endifint at_poll = AT_POLL;u_int8_t wdc_default_read_reg __P((struct channel_softc *, enum wdc_regs));void wdc_default_write_reg __P((struct channel_softc *, enum wdc_regs, u_int8_t));void wdc_default_read_raw_multi_2 __P((struct channel_softc *,     void *, unsigned int));void wdc_default_write_raw_multi_2 __P((struct channel_softc *,     void *, unsigned int));void wdc_default_read_raw_multi_4 __P((struct channel_softc *,     void *, unsigned int));void wdc_default_write_raw_multi_4 __P((struct channel_softc *,     void *, unsigned int));int wdc_floating_bus __P((struct channel_softc *, int));int wdc_preata_drive __P((struct channel_softc *, int));int wdc_ata_present __P((struct channel_softc *, int));struct channel_softc_vtbl wdc_default_vtbl = {	wdc_default_read_reg,	wdc_default_write_reg,	wdc_default_read_raw_multi_2,	wdc_default_write_raw_multi_2,	wdc_default_read_raw_multi_4,	wdc_default_write_raw_multi_4};u_int8_twdc_default_read_reg(chp, reg)	struct channel_softc *chp;	enum wdc_regs reg;{#ifdef DIAGNOSTIC		if (reg & _WDC_WRONLY) {		printf ("wdc_default_read_reg: reading from a write-only register %d\n", reg);	}#endif	if (reg & _WDC_AUX) 		return (bus_space_read_1(chp->ctl_iot, chp->ctl_ioh,		    reg & _WDC_REGMASK));	else		return (bus_space_read_1(chp->cmd_iot, chp->cmd_ioh,		    reg & _WDC_REGMASK));}