Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips/hpc sbic -> wd33c93, in preparation for the...
details: https://anonhg.NetBSD.org/src/rev/d6f871b3788d
branches: trunk
changeset: 517953:d6f871b3788d
user: thorpej <thorpej%NetBSD.org@localhost>
date: Wed Nov 21 23:22:25 2001 +0000
description:
sbic -> wd33c93, in preparation for the core driver going into
sys/dev/ic.
diffstat:
sys/arch/sgimips/hpc/sbic.c | 528 ++++++++++++++++++++--------------------
sys/arch/sgimips/hpc/sbicreg.h | 138 +++++-----
sys/arch/sgimips/hpc/sbicvar.h | 46 +-
sys/arch/sgimips/hpc/wdsc.c | 30 +-
4 files changed, 371 insertions(+), 371 deletions(-)
diffs (truncated from 1844 to 300 lines):
diff -r 8af23e9e9b72 -r d6f871b3788d sys/arch/sgimips/hpc/sbic.c
--- a/sys/arch/sgimips/hpc/sbic.c Wed Nov 21 22:40:59 2001 +0000
+++ b/sys/arch/sgimips/hpc/sbic.c Wed Nov 21 23:22:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sbic.c,v 1.4 2001/11/18 05:14:38 thorpej Exp $ */
+/* $NetBSD: sbic.c,v 1.5 2001/11/21 23:22:25 thorpej Exp $ */
/*
* Changes Copyright (c) 2001 Wayne Knowles
@@ -78,57 +78,57 @@
#define STATUS_UNKNOWN 0xff /* uninitialized status */
/*
- * Convenience macro for waiting for a particular sbic event
+ * Convenience macro for waiting for a particular wd33c93 event
*/
-#define SBIC_WAIT(regs, until, timeo) sbic_wait(regs, until, timeo, __LINE__)
+#define SBIC_WAIT(regs, until, timeo) wd33c93_wait(regs, until, timeo, __LINE__)
/* Convert SCSI timeout from millisecs to hz avoiding overflow */
#define SCSI_TIMEOUT(t) ((t)>1000000 ? ((t)/1000)*hz : ((t)*hz)/1000)
-void sbic_init __P((struct sbic_softc *));
-void sbic_reset __P((struct sbic_softc *));
-int sbic_go __P((struct sbic_softc *, struct sbic_acb *));
-int sbic_dmaok __P((struct sbic_softc *, struct scsipi_xfer *));
-int sbic_wait __P((struct sbic_softc *, u_char, int , int));
-u_char sbic_selectbus __P((struct sbic_softc *, struct sbic_acb *));
-int sbic_xfout __P((struct sbic_softc *, int, void *));
-int sbic_xfin __P((struct sbic_softc *, int, void *));
-int sbic_poll __P((struct sbic_softc *, struct sbic_acb *));
-int sbic_nextstate __P((struct sbic_softc *, struct sbic_acb *,
+void wd33c93_init __P((struct wd33c93_softc *));
+void wd33c93_reset __P((struct wd33c93_softc *));
+int wd33c93_go __P((struct wd33c93_softc *, struct wd33c93_acb *));
+int wd33c93_dmaok __P((struct wd33c93_softc *, struct scsipi_xfer *));
+int wd33c93_wait __P((struct wd33c93_softc *, u_char, int , int));
+u_char wd33c93_selectbus __P((struct wd33c93_softc *, struct wd33c93_acb *));
+int wd33c93_xfout __P((struct wd33c93_softc *, int, void *));
+int wd33c93_xfin __P((struct wd33c93_softc *, int, void *));
+int wd33c93_poll __P((struct wd33c93_softc *, struct wd33c93_acb *));
+int wd33c93_nextstate __P((struct wd33c93_softc *, struct wd33c93_acb *,
u_char, u_char));
-int sbic_abort __P((struct sbic_softc *, struct sbic_acb *, char *));
-void sbic_xferdone __P((struct sbic_softc *));
-void sbic_error __P((struct sbic_softc *, struct sbic_acb *));
-void sbic_scsidone __P((struct sbic_softc *, struct sbic_acb *, int));
-void sbic_sched __P((struct sbic_softc *));
-void sbic_dequeue __P((struct sbic_softc *, struct sbic_acb *));
-void sbic_dma_stop __P((struct sbic_softc *));
-void sbic_dma_setup __P((struct sbic_softc *, int));
-int sbic_msgin_phase __P((struct sbic_softc *, int));
-void sbic_msgin __P((struct sbic_softc *, u_char *, int));
-void sbic_reselect __P((struct sbic_softc *, int, int, int, int));
-void sbic_sched_msgout __P((struct sbic_softc *, u_short));
-void sbic_msgout __P((struct sbic_softc *));
-void sbic_timeout __P((void *arg));
-void sbic_watchdog __P((void *arg));
-int sbic_div2stp __P((struct sbic_softc *, int));
-int sbic_stp2div __P((struct sbic_softc *, int));
-void sbic_setsync __P((struct sbic_softc *, struct sbic_tinfo *ti));
-void sbic_update_xfer_mode __P((struct sbic_softc *, int));
+int wd33c93_abort __P((struct wd33c93_softc *, struct wd33c93_acb *, char *));
+void wd33c93_xferdone __P((struct wd33c93_softc *));
+void wd33c93_error __P((struct wd33c93_softc *, struct wd33c93_acb *));
+void wd33c93_scsidone __P((struct wd33c93_softc *, struct wd33c93_acb *, int));
+void wd33c93_sched __P((struct wd33c93_softc *));
+void wd33c93_dequeue __P((struct wd33c93_softc *, struct wd33c93_acb *));
+void wd33c93_dma_stop __P((struct wd33c93_softc *));
+void wd33c93_dma_setup __P((struct wd33c93_softc *, int));
+int wd33c93_msgin_phase __P((struct wd33c93_softc *, int));
+void wd33c93_msgin __P((struct wd33c93_softc *, u_char *, int));
+void wd33c93_reselect __P((struct wd33c93_softc *, int, int, int, int));
+void wd33c93_sched_msgout __P((struct wd33c93_softc *, u_short));
+void wd33c93_msgout __P((struct wd33c93_softc *));
+void wd33c93_timeout __P((void *arg));
+void wd33c93_watchdog __P((void *arg));
+int wd33c93_div2stp __P((struct wd33c93_softc *, int));
+int wd33c93_stp2div __P((struct wd33c93_softc *, int));
+void wd33c93_setsync __P((struct wd33c93_softc *, struct wd33c93_tinfo *ti));
+void wd33c93_update_xfer_mode __P((struct wd33c93_softc *, int));
-static struct pool sbic_pool; /* Adapter Control Blocks */
-static int sbic_pool_initialized = 0;
+static struct pool wd33c93_pool; /* Adapter Control Blocks */
+static int wd33c93_pool_initialized = 0;
/*
* Timeouts
*/
-int sbic_cmd_wait = SBIC_CMD_WAIT;
-int sbic_data_wait = SBIC_DATA_WAIT;
-int sbic_init_wait = SBIC_INIT_WAIT;
+int wd33c93_cmd_wait = SBIC_CMD_WAIT;
+int wd33c93_data_wait = SBIC_DATA_WAIT;
+int wd33c93_init_wait = SBIC_INIT_WAIT;
-int sbic_nodma = 0; /* Use polled IO transfers */
-int sbic_nodisc = 0; /* Allow command queues */
-int sbic_notags = 0; /* No Tags */
+int wd33c93_nodma = 0; /* Use polled IO transfers */
+int wd33c93_nodisc = 0; /* Allow command queues */
+int wd33c93_notags = 0; /* No Tags */
/*
* Some useful stuff for debugging purposes
@@ -137,23 +137,23 @@
#define QPRINTF(a) SBIC_DEBUG(MISC, a)
-int sbic_debug = 0; /* Debug flags */
+int wd33c93_debug = 0; /* Debug flags */
-void sbic_print_csr __P((u_char));
-void sbic_hexdump __P((u_char *, int));
+void wd33c93_print_csr __P((u_char));
+void wd33c93_hexdump __P((u_char *, int));
#else
#define QPRINTF(a) /* */
#endif
-static const char *sbic_chip_names[] = SBIC_CHIP_LIST;
+static const char *wd33c93_chip_names[] = SBIC_CHIP_LIST;
/*
* Attach instance of driver and probe for sub devices
*/
void
-sbic_attach(dev)
- struct sbic_softc *dev;
+wd33c93_attach(dev)
+ struct wd33c93_softc *dev;
{
struct scsipi_adapter *adapt = &dev->sc_adapter;
struct scsipi_channel *chan = &dev->sc_channel;
@@ -190,7 +190,7 @@
}
dev->sc_cfflags = dev->sc_dev.dv_cfdata->cf_flags;
- sbic_init(dev);
+ wd33c93_init(dev);
dev->sc_child = config_found(&dev->sc_dev, &dev->sc_channel,
scsiprint);
@@ -201,16 +201,16 @@
* Initialize driver-private structures
*/
void
-sbic_init(dev)
- struct sbic_softc *dev;
+wd33c93_init(dev)
+ struct wd33c93_softc *dev;
{
u_int i;
- if (!sbic_pool_initialized) {
+ if (!wd33c93_pool_initialized) {
/* All instances share the same pool */
- pool_init(&sbic_pool, sizeof(struct sbic_acb), 0, 0, 0,
- "sbic_acb", 0, NULL, NULL, 0);
- ++sbic_pool_initialized;
+ pool_init(&wd33c93_pool, sizeof(struct wd33c93_acb), 0, 0, 0,
+ "wd33c93_acb", 0, NULL, NULL, 0);
+ ++wd33c93_pool_initialized;
}
if (dev->sc_state == 0) {
@@ -220,16 +220,16 @@
dev->sc_disc = 0;
memset(dev->sc_tinfo, 0, sizeof(dev->sc_tinfo));
- callout_reset(&dev->sc_watchdog, 60 * hz, sbic_watchdog, dev);
+ callout_reset(&dev->sc_watchdog, 60 * hz, wd33c93_watchdog, dev);
} else
- panic("sbic: reinitializing driver!");
+ panic("wd33c93: reinitializing driver!");
dev->sc_flags = 0;
dev->sc_state = SBIC_IDLE;
- sbic_reset(dev);
+ wd33c93_reset(dev);
for (i = 0; i < 8; i++) {
- struct sbic_tinfo *ti = &dev->sc_tinfo[i];
+ struct wd33c93_tinfo *ti = &dev->sc_tinfo[i];
/*
* sc_flags = 0xTTRRSS
*
@@ -240,7 +240,7 @@
ti->flags = T_NEED_RESET;
if (dev->sc_minsync == 0 || (dev->sc_cfflags & (1<<(i+8))))
ti->flags |= T_NOSYNC;
- if (dev->sc_cfflags & (1<<i) || sbic_nodisc)
+ if (dev->sc_cfflags & (1<<i) || wd33c93_nodisc)
ti->flags |= T_NODISC;
ti->period = dev->sc_minsync;
ti->offset = 0;
@@ -248,8 +248,8 @@
}
void
-sbic_reset(dev)
- struct sbic_softc *dev;
+wd33c93_reset(dev)
+ struct wd33c93_softc *dev;
{
u_int my_id, s;
u_char csr, reg;
@@ -318,14 +318,14 @@
splx(s);
printf(": %s SCSI, rev=%d, target %d\n",
- sbic_chip_names[dev->sc_chip], dev->sc_rev,
+ wd33c93_chip_names[dev->sc_chip], dev->sc_rev,
dev->sc_channel.chan_id);
}
void
-sbic_error(dev, acb)
- struct sbic_softc *dev;
- struct sbic_acb *acb;
+wd33c93_error(dev, acb)
+ struct wd33c93_softc *dev;
+ struct wd33c93_acb *acb;
{
struct scsipi_xfer *xs = acb->xs;
@@ -342,21 +342,21 @@
* Setup sync mode for given target
*/
void
-sbic_setsync(dev, ti)
- struct sbic_softc *dev;
- struct sbic_tinfo *ti;
+wd33c93_setsync(dev, ti)
+ struct wd33c93_softc *dev;
+ struct wd33c93_tinfo *ti;
{
u_char offset, period;
if (ti->flags & T_SYNCMODE) {
offset = ti->offset;
- period = sbic_stp2div(dev, ti->period);
+ period = wd33c93_stp2div(dev, ti->period);
} else {
offset = 0;
period = 0;
}
- SBIC_DEBUG(SYNC, ("sbic_setsync: sync reg = 0x%02x\n",
+ SBIC_DEBUG(SYNC, ("wd33c93_setsync: sync reg = 0x%02x\n",
SBIC_SYN(offset, period)));
SET_SBIC_syn(dev, SBIC_SYN(offset, period));
}
@@ -367,11 +367,11 @@
* returns 1 if DMA OK, 0 for polled I/O transfer
*/
int
-sbic_dmaok(dev, xs)
- struct sbic_softc *dev;
+wd33c93_dmaok(dev, xs)
+ struct wd33c93_softc *dev;
struct scsipi_xfer *xs;
{
- if (sbic_nodma || (xs->xs_control & XS_CTL_POLL) || xs->datalen == 0)
+ if (wd33c93_nodma || (xs->xs_control & XS_CTL_POLL) || xs->datalen == 0)
return (0);
return(1);
}
@@ -380,11 +380,11 @@
* Setup for dma transfer
*/
void
-sbic_dma_setup(dev, datain)
- struct sbic_softc *dev;
+wd33c93_dma_setup(dev, datain)
+ struct wd33c93_softc *dev;
int datain;
{
- struct sbic_acb *acb = dev->sc_nexus;
+ struct wd33c93_acb *acb = dev->sc_nexus;
int s;
dev->sc_daddr = acb->daddr;
@@ -405,8 +405,8 @@
* Save DMA pointers. Take into account partial transfer. Shut down DMA.
*/
void
-sbic_dma_stop(dev)
- struct sbic_softc *dev;
+wd33c93_dma_stop(dev)
+ struct wd33c93_softc *dev;
{
int count, asr;
@@ -414,7 +414,7 @@
do {
GET_SBIC_asr(dev, asr); /* XXX */
if (asr & SBIC_ASR_DBR) {
Home |
Main Index |
Thread Index |
Old Index