diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2012-09-06 18:53:33 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2012-09-06 18:53:33 +0000 |
| commit | b9b256e49a1595b83c37af4e2bcdf2059934e5a3 (patch) | |
| tree | 3e2de6663190f36cb5077901703212f5c7d3e8bb /sys/dev/ct | |
| parent | 2a6ce61ae1ec1618376df8246b1688e8bb7c660d (diff) | |
Notes
Diffstat (limited to 'sys/dev/ct')
| -rw-r--r-- | sys/dev/ct/bshw_machdep.c | 40 | ||||
| -rw-r--r-- | sys/dev/ct/ct.c | 43 | ||||
| -rw-r--r-- | sys/dev/ct/ct_isa.c | 29 | ||||
| -rw-r--r-- | sys/dev/ct/ctvar.h | 8 |
4 files changed, 15 insertions, 105 deletions
diff --git a/sys/dev/ct/bshw_machdep.c b/sys/dev/ct/bshw_machdep.c index 128b6d067c8c..dacc1e02f738 100644 --- a/sys/dev/ct/bshw_machdep.c +++ b/sys/dev/ct/bshw_machdep.c @@ -41,9 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> -#if defined(__FreeBSD__) && __FreeBSD_version > 500001 #include <sys/bio.h> -#endif /* __ FreeBSD__ */ #include <sys/buf.h> #include <sys/queue.h> #include <sys/malloc.h> @@ -51,35 +49,13 @@ __FBSDID("$FreeBSD$"); #include <vm/vm.h> -#ifdef __NetBSD__ -#include <sys/device.h> - -#include <machine/bus.h> -#include <machine/intr.h> - -#include <dev/scsipi/scsi_all.h> -#include <dev/scsipi/scsipi_all.h> -#include <dev/scsipi/scsiconf.h> -#include <dev/scsipi/scsi_disk.h> - -#include <machine/dvcfg.h> -#include <machine/physio_proc.h> - -#include <i386/Cbus/dev/scsi_low.h> - -#include <dev/ic/wd33c93reg.h> -#include <i386/Cbus/dev/ct/ctvar.h> -#include <i386/Cbus/dev/ct/ct_machdep.h> -#include <i386/Cbus/dev/ct/bshwvar.h> -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ #include <machine/bus.h> #include <machine/md_var.h> #include <compat/netbsd/dvcfg.h> #include <compat/netbsd/physio_proc.h> +#include <sys/module.h> /* XXX: Hack */ #include <cam/scsi/scsi_low.h> #include <dev/ic/wd33c93reg.h> @@ -88,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ct/bshwvar.h> #include <vm/pmap.h> -#endif /* __FreeBSD__ */ #define BSHW_IO_CONTROL_FLAGS 0 @@ -99,14 +74,7 @@ int bshw_data_write_bytes = 4096; /********************************************************* * OS dep part *********************************************************/ -#ifdef __NetBSD__ -#define BSHW_PAGE_SIZE NBPG -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ -#define BSHW_PAGE_SIZE PAGE_SIZE typedef unsigned long vaddr_t; -#endif /* __FreeBSD__ */ /********************************************************* * GENERIC MACHDEP FUNCTIONS @@ -169,7 +137,7 @@ bshw_bus_reset(ct) regv &= ~MBR_IEN; ct_cr_write_1(chp, wd3s_mbank, regv); - SCSI_LOW_DELAY(500000); + DELAY(500000); /* reset signal off */ regv &= ~MBR_RST; @@ -465,14 +433,14 @@ bshw_dma_xfer_start(ct) endva = (vaddr_t) round_page((vaddr_t) sp->scp_data + sp->scp_datalen); for (va = (vaddr_t) sp->scp_data; ; phys = nphys) { - if ((va += BSHW_PAGE_SIZE) >= endva) + if ((va += PAGE_SIZE) >= endva) { bs->sc_seglen = sp->scp_datalen; break; } nphys = vtophys(va); - if (phys + BSHW_PAGE_SIZE != nphys || nphys >= bs->sc_minphys) + if (phys + PAGE_SIZE != nphys || nphys >= bs->sc_minphys) { bs->sc_seglen = (u_int8_t *) trunc_page(va) - sp->scp_data; diff --git a/sys/dev/ct/ct.c b/sys/dev/ct/ct.c index 602e094509ca..c990dfb0e7e9 100644 --- a/sys/dev/ct/ct.c +++ b/sys/dev/ct/ct.c @@ -42,36 +42,12 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> -#if defined(__FreeBSD__) && __FreeBSD_version > 500001 #include <sys/bio.h> -#endif /* __ FreeBSD__ */ #include <sys/buf.h> #include <sys/queue.h> #include <sys/malloc.h> #include <sys/errno.h> -#ifdef __NetBSD__ -#include <sys/device.h> - -#include <machine/bus.h> -#include <machine/intr.h> - -#include <dev/scsipi/scsi_all.h> -#include <dev/scsipi/scsipi_all.h> -#include <dev/scsipi/scsiconf.h> -#include <dev/scsipi/scsi_disk.h> - -#include <machine/dvcfg.h> -#include <machine/physio_proc.h> - -#include <i386/Cbus/dev/scsi_low.h> - -#include <dev/ic/wd33c93reg.h> -#include <i386/Cbus/dev/ct/ctvar.h> -#include <i386/Cbus/dev/ct/ct_machdep.h> -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ #include <machine/bus.h> #include <compat/netbsd/dvcfg.h> @@ -82,7 +58,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ic/wd33c93reg.h> #include <dev/ct/ctvar.h> #include <dev/ct/ct_machdep.h> -#endif /* __FreeBSD__ */ #define CT_NTARGETS 8 #define CT_NLUNS 8 @@ -227,7 +202,7 @@ cthw_chip_reset(chp, chiprevp, chipclk, hostid) /* issue abort cmd */ ct_cr_write_1(chp, wd3s_cmd, WD3S_ABORT); - SCSI_LOW_DELAY(1000); /* 1ms wait */ + DELAY(1000); /* 1ms wait */ (void) ct_stat_read_1(chp); (void) ct_cr_read_1(chp, wd3s_stat); @@ -274,7 +249,7 @@ cthw_chip_reset(chp, chiprevp, chipclk, hostid) ct_cr_write_1(chp, wd3s_cmd, WD3S_RESET); } - SCSI_LOW_DELAY(1); + DELAY(1); } if (wc == 0) return ENXIO; @@ -381,7 +356,7 @@ ctprint(aux, name) if (name != NULL) printf("%s: scsibus ", name); - return UNCONF; + return 1; } void @@ -411,7 +386,7 @@ cthw_attention(ct) return; ct_cr_write_1(chp, wd3s_cmd, WD3S_ASSERT_ATN); - SCSI_LOW_DELAY(10); + DELAY(10); if ((ct_stat_read_1(chp) & STR_LCI) == 0) ct->sc_atten = 0; ct_unbusy(ct); @@ -689,7 +664,7 @@ ct_xfer(ct, data, len, direction, statp) } else { - SCSI_LOW_DELAY(1); + DELAY(1); } /* check phase miss */ @@ -721,7 +696,7 @@ ct_io_xfer(ct) slp->sl_error |= PDMAERR; if (slp->sl_scp.scp_direction == SCSI_LOW_WRITE) - SCSI_LOW_BZERO(pbuf, CT_PADDING_BUF_SIZE); + bzero(pbuf, CT_PADDING_BUF_SIZE); ct_xfer(ct, pbuf, CT_PADDING_BUF_SIZE, sp->scp_direction, &stat); } @@ -926,7 +901,7 @@ ct_unbusy(ct) if (regv == (u_int8_t) -1) return EIO; - SCSI_LOW_DELAY(CT_DELAY_INTERVAL); + DELAY(CT_DELAY_INTERVAL); } printf("%s: unbusy timeout\n", slp->sl_xname); @@ -947,7 +922,7 @@ ct_catch_intr(ct) if ((regv & (STR_INT | STR_BSY | STR_CIP)) == STR_INT) return 0; - SCSI_LOW_DELAY(CT_DELAY_INTERVAL); + DELAY(CT_DELAY_INTERVAL); } return EJUSTRETURN; } @@ -1003,7 +978,7 @@ again: (u_int) scsi_status); #ifdef KDB if (ct_debug > 1) - SCSI_LOW_DEBUGGER("ct"); + kdb_enter(KDB_WHY_CAM, "ct"); #endif /* KDB */ } #endif /* CT_DEBUG */ diff --git a/sys/dev/ct/ct_isa.c b/sys/dev/ct/ct_isa.c index 693572fe1c69..12d4f52f89c1 100644 --- a/sys/dev/ct/ct_isa.c +++ b/sys/dev/ct/ct_isa.c @@ -42,36 +42,12 @@ __FBSDID("$FreeBSD$"); #include <sys/buf.h> #include <sys/queue.h> #include <sys/malloc.h> -#include <sys/device_port.h> +#include <sys/bus.h> +#include <sys/module.h> #include <sys/errno.h> #include <vm/vm.h> -#ifdef __NetBSD__ -#include <machine/bus.h> -#include <machine/intr.h> - -#include <dev/scsipi/scsi_all.h> -#include <dev/scsipi/scsipi_all.h> -#include <dev/scsipi/scsiconf.h> -#include <dev/scsipi/scsi_disk.h> - -#include <dev/isa/isareg.h> -#include <dev/isa/isavar.h> -#include <dev/isa/isadmavar.h> - -#include <machine/dvcfg.h> -#include <machine/physio_proc.h> -#include <machine/syspmgr.h> - -#include <i386/Cbus/dev/scsi_low.h> - -#include <dev/ic/wd33c93reg.h> -#include <i386/Cbus/dev/ct/ctvar.h> -#include <i386/Cbus/dev/ct/bshwvar.h> -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ #include <machine/bus.h> #include <machine/resource.h> #include <sys/bus.h> @@ -89,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include <dev/ic/wd33c93reg.h> #include <dev/ct/ctvar.h> #include <dev/ct/bshwvar.h> -#endif /* __FreeBSD__ */ #define BSHW_IOSZ 0x08 #define BSHW_IOBASE 0xcc0 diff --git a/sys/dev/ct/ctvar.h b/sys/dev/ct/ctvar.h index 8c63445e0200..35f02e35ce34 100644 --- a/sys/dev/ct/ctvar.h +++ b/sys/dev/ct/ctvar.h @@ -66,13 +66,6 @@ struct ct_softc { struct ct_bus_access_handle sc_ch; /* bus access handle */ -#ifdef __NetBSD__ - bus_dma_tag_t sc_dmat; /* data DMA tag */ - - void *sc_ih; -#endif /* __NetBSD__ */ - -#ifdef __FreeBSD__ struct resource *port_res; struct resource *mem_res; struct resource *irq_res; @@ -82,7 +75,6 @@ struct ct_softc { bus_dmamap_t sc_dmamapt; /* data DMAMAP tag */ void *sc_ih; -#endif /* __FreeBSD__ */ int sc_chiprev; /* chip version */ #define CT_WD33C93 0x00000 |
