summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>1997-09-21 21:41:49 +0000
committergibbs <gibbs@FreeBSD.org>1997-09-21 21:41:49 +0000
commite1b0aaaa7646122022e6179a0b6406809f2126b8 (patch)
tree453c2e0b2fbd7526c2bfa12a66b852f740856480 /sys/dev
parentdc043d9d0aa92d02293099dc6adcabe0e6c972cb (diff)
downloadFreeBSD-src-e1b0aaaa7646122022e6179a0b6406809f2126b8.zip
FreeBSD-src-e1b0aaaa7646122022e6179a0b6406809f2126b8.tar.gz
aha1542.c aic6360.c cy.c fd.c ft.c
if_ie.c if_wl.c if_zp.c isa.c isa_device.h labpc.c mcd.c ncr5380.c scd.c seagate.c si.c sio.c tw.c ultra14f.c wcd.c wd.c: Update for changes in the callout interface. apic_vector.s icu_vector.s ipl.s ipl_funcs.c: Add CAM software/hardware interrupt support.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/cy/cy.c14
-rw-r--r--sys/dev/cy/cy_isa.c14
-rw-r--r--sys/dev/fdc/fdc.c30
-rw-r--r--sys/dev/ie/if_ie.c8
-rw-r--r--sys/dev/mcd/mcd.c36
-rw-r--r--sys/dev/scd/scd.c55
-rw-r--r--sys/dev/si/si.c8
-rw-r--r--sys/dev/sio/sio.c13
-rw-r--r--sys/dev/wl/if_wl.c12
9 files changed, 107 insertions, 83 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index b56fc42..0ba554c 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.53 1997/09/03 01:50:24 bde Exp $
+ * $Id: cy.c,v 1.54 1997/09/14 03:19:08 peter Exp $
*/
#include "cy.h"
@@ -137,6 +137,7 @@
#define siowrite cywrite
#define sio_timeout cy_timeout
#define sio_timeouts_until_log cy_timeouts_until_log
+#define sio_timeout_handle cy_timeout_handle
#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@@ -390,6 +391,8 @@ static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
static int sio_timeout;
static int sio_timeouts_until_log;
+static struct callout_handle sio_timeout_handle
+ = CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle);
#if 0 /* XXX */
static struct tty *sio_tty[NSIO];
#else
@@ -2305,7 +2308,7 @@ siosettimeout()
* Otherwise set it to max(1/200, 1/hz).
* Enable timeouts iff some device is open.
*/
- untimeout(comwakeup, (void *)NULL);
+ untimeout(comwakeup, (void *)NULL, sio_timeout_handle);
sio_timeout = hz;
someopen = FALSE;
for (unit = 0; unit < NSIO; ++unit) {
@@ -2323,12 +2326,13 @@ siosettimeout()
}
if (someopen) {
sio_timeouts_until_log = hz / sio_timeout;
- timeout(comwakeup, (void *)NULL, sio_timeout);
+ sio_timeout_handle = timeout(comwakeup, (void *)NULL,
+ sio_timeout);
} else {
/* Flush error messages, if any. */
sio_timeouts_until_log = 1;
comwakeup((void *)NULL);
- untimeout(comwakeup, (void *)NULL);
+ untimeout(comwakeup, (void *)NULL, sio_timeout_handle);
}
}
@@ -2339,7 +2343,7 @@ comwakeup(chan)
struct com_s *com;
int unit;
- timeout(comwakeup, (void *)NULL, sio_timeout);
+ sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout);
#if 0
/*
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index b56fc42..0ba554c 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.53 1997/09/03 01:50:24 bde Exp $
+ * $Id: cy.c,v 1.54 1997/09/14 03:19:08 peter Exp $
*/
#include "cy.h"
@@ -137,6 +137,7 @@
#define siowrite cywrite
#define sio_timeout cy_timeout
#define sio_timeouts_until_log cy_timeouts_until_log
+#define sio_timeout_handle cy_timeout_handle
#define sio_tty cy_tty
#define CY_MAX_PORTS (CD1400_NO_OF_CHANNELS * CY_MAX_CD1400s)
@@ -390,6 +391,8 @@ static speed_t comdefaultrate = TTYDEF_SPEED;
static u_int com_events; /* input chars + weighted output completions */
static int sio_timeout;
static int sio_timeouts_until_log;
+static struct callout_handle sio_timeout_handle
+ = CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle);
#if 0 /* XXX */
static struct tty *sio_tty[NSIO];
#else
@@ -2305,7 +2308,7 @@ siosettimeout()
* Otherwise set it to max(1/200, 1/hz).
* Enable timeouts iff some device is open.
*/
- untimeout(comwakeup, (void *)NULL);
+ untimeout(comwakeup, (void *)NULL, sio_timeout_handle);
sio_timeout = hz;
someopen = FALSE;
for (unit = 0; unit < NSIO; ++unit) {
@@ -2323,12 +2326,13 @@ siosettimeout()
}
if (someopen) {
sio_timeouts_until_log = hz / sio_timeout;
- timeout(comwakeup, (void *)NULL, sio_timeout);
+ sio_timeout_handle = timeout(comwakeup, (void *)NULL,
+ sio_timeout);
} else {
/* Flush error messages, if any. */
sio_timeouts_until_log = 1;
comwakeup((void *)NULL);
- untimeout(comwakeup, (void *)NULL);
+ untimeout(comwakeup, (void *)NULL, sio_timeout_handle);
}
}
@@ -2339,7 +2343,7 @@ comwakeup(chan)
struct com_s *com;
int unit;
- timeout(comwakeup, (void *)NULL, sio_timeout);
+ sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout);
#if 0
/*
diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c
index 85305f4..a2aac72 100644
--- a/sys/dev/fdc/fdc.c
+++ b/sys/dev/fdc/fdc.c
@@ -43,7 +43,7 @@
* SUCH DAMAGE.
*
* from: @(#)fd.c 7.4 (Berkeley) 5/25/91
- * $Id: fd.c,v 1.101 1997/09/16 07:45:45 joerg Exp $
+ * $Id: fd.c,v 1.102 1997/09/17 20:16:14 tegge Exp $
*
*/
@@ -170,6 +170,8 @@ static struct fd_data {
#ifdef notyet
int dkunit; /* disk stats unit number */
#endif
+ struct callout_handle toffhandle;
+ struct callout_handle tohandle;
#ifdef DEVFS
void *bdevs[1 + NUMDENS + MAXPARTITIONS];
void *cdevs[1 + NUMDENS + MAXPARTITIONS];
@@ -534,7 +536,7 @@ fdattach(struct isa_device *dev)
fdc->state = DEVIDLE;
/* reset controller, turn motor off, clear fdout mirror reg */
outb(fdc->baseport + FDOUT, ((fdc->fdout = 0)));
- TAILQ_INIT(&fdc->head);
+ bufq_init(&fdc->head);
/* check for each floppy drive */
for (fdup = isa_biotab_fdc; fdup->id_driver != 0; fdup++) {
@@ -673,6 +675,8 @@ fdattach(struct isa_device *dev)
fd->fdc = fdc;
fd->fdsu = fdsu;
fd->options = 0;
+ callout_handle_init(&fd->toffhandle);
+ callout_handle_init(&fd->tohandle);
printf("fd%d: ", fdu);
switch (fdt) {
@@ -843,7 +847,7 @@ fd_turnoff(void *arg1)
* and nothing is queued on it.
*/
if (fd->fdc->state != DEVIDLE && fd->fdc->fdu == fdu) {
- timeout(fd_turnoff, arg1, 4 * hz);
+ fd->toffhandle = timeout(fd_turnoff, arg1, 4 * hz);
return;
}
@@ -1154,8 +1158,8 @@ fdstrategy(struct buf *bp)
}
bp->b_pblkno = bp->b_blkno;
s = splbio();
- tqdisksort(&fdc->head, bp);
- untimeout(fd_turnoff, (caddr_t)fdu); /* a good idea */
+ bufqdisksort(&fdc->head, bp);
+ untimeout(fd_turnoff, (caddr_t)fdu, fd->toffhandle); /* a good idea */
fdstart(fdcu);
splx(s);
return;
@@ -1195,7 +1199,7 @@ fd_timeout(void *arg1)
struct buf *bp;
int s;
- bp = TAILQ_FIRST(&fdc_data[fdcu].head);
+ bp = bufq_first(&fdc_data[fdcu].head);
/*
* Due to IBM's brain-dead design, the FDC has a faked ready
@@ -1282,7 +1286,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
struct fd_formb *finfo = NULL;
size_t fdblk;
- bp = TAILQ_FIRST(&fdc->head);
+ bp = bufq_first(&fdc->head);
if(!bp) {
/***********************************************\
* nothing left for this controller to do *
@@ -1321,7 +1325,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
TRACE1("fd%d", fdu);
TRACE1("[%s]", fdstates[fdc->state]);
TRACE1("(0x%x)", fd->flags);
- untimeout(fd_turnoff, (caddr_t)fdu);
+ untimeout(fd_turnoff, (caddr_t)fdu, fd->toffhandle);
timeout(fd_turnoff, (caddr_t)fdu, 4 * hz);
switch (fdc->state)
{
@@ -1526,10 +1530,10 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
}
}
fdc->state = IOCOMPLETE;
- timeout(fd_timeout, (caddr_t)fdcu, hz);
+ fd->tohandle = timeout(fd_timeout, (caddr_t)fdcu, hz);
return(0); /* will return later */
case IOCOMPLETE: /* IO DONE, post-analyze */
- untimeout(fd_timeout, (caddr_t)fdcu);
+ untimeout(fd_timeout, (caddr_t)fdcu, fd->tohandle);
if (fd_read_status(fdc, fd->fdsu))
{
@@ -1579,7 +1583,7 @@ fdstate(fdcu_t fdcu, fdc_p fdc)
{
/* ALL DONE */
fd->skip = 0;
- TAILQ_REMOVE(&fdc->head, bp, b_act);
+ bufq_remove(&fdc->head, bp);
biodone(bp);
fdc->fd = (fd_p) 0;
fdc->fdu = -1;
@@ -1689,7 +1693,7 @@ retrier(fdcu)
fdc_p fdc = fdc_data + fdcu;
register struct buf *bp;
- bp = TAILQ_FIRST(&fdc->head);
+ bp = bufq_first(&fdc->head);
if(fd_data[FDUNIT(minor(bp->b_dev))].options & FDOPT_NORETRY)
goto fail;
@@ -1733,7 +1737,7 @@ retrier(fdcu)
bp->b_flags |= B_ERROR;
bp->b_error = EIO;
bp->b_resid += bp->b_bcount - fdc->fd->skip;
- TAILQ_REMOVE(&fdc->head, bp, b_act);
+ bufq_remove(&fdc->head, bp);
fdc->fd->skip = 0;
biodone(bp);
fdc->state = FINDWORK;
diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c
index 24f8cf3..c1e4a5d 100644
--- a/sys/dev/ie/if_ie.c
+++ b/sys/dev/ie/if_ie.c
@@ -47,7 +47,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ie.c,v 1.44 1997/07/20 14:09:59 bde Exp $
+ * $Id: if_ie.c,v 1.45 1997/09/02 01:18:14 bde Exp $
*/
/*
@@ -1915,6 +1915,7 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
{
volatile struct ie_cmd_common *cc = pcmd;
volatile int timedout = 0;
+ struct callout_handle ch;
ie_softc[unit].scb->ie_command = (u_short) cmd;
@@ -1925,7 +1926,8 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
* According to the packet driver, the minimum timeout
* should be .369 seconds, which we round up to .37.
*/
- timeout(chan_attn_timeout, (caddr_t)&timedout, 37 * hz / 100);
+ ch = timeout(chan_attn_timeout, (caddr_t)&timedout,
+ 37 * hz / 100);
/* ignore cast-qual */
/*
@@ -1940,7 +1942,7 @@ command_and_wait(int unit, int cmd, volatile void *pcmd, int mask)
break;
}
- untimeout(chan_attn_timeout, (caddr_t)&timedout);
+ untimeout(chan_attn_timeout, (caddr_t)&timedout, ch);
/* ignore cast-qual */
return (timedout);
diff --git a/sys/dev/mcd/mcd.c b/sys/dev/mcd/mcd.c
index 72fa029..8f85db6 100644
--- a/sys/dev/mcd/mcd.c
+++ b/sys/dev/mcd/mcd.c
@@ -40,7 +40,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: mcd.c,v 1.92 1997/06/01 16:03:13 peter Exp $
+ * $Id: mcd.c,v 1.93 1997/07/20 14:10:06 bde Exp $
*/
static const char COPYRIGHT[] = "mcd-driver (C)1993 by H.Veit & B.Moore";
@@ -242,7 +242,7 @@ int mcd_attach(struct isa_device *dev)
cd->iobase = dev->id_iobase;
cd->flags |= MCDINIT;
mcd_soft_reset(unit);
- TAILQ_INIT(&cd->head);
+ bufq_init(&cd->head);
#ifdef NOTYET
/* wire controller for interrupts and dma */
@@ -440,7 +440,7 @@ MCD_TRACE("strategy: drive not valid\n");
/* queue it */
s = splbio();
- tqdisksort(&cd->head, bp);
+ bufqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@@ -467,11 +467,11 @@ static void mcd_start(int unit)
return;
}
- bp = TAILQ_FIRST(&cd->head);
+ bp = bufq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
/*MCD_TRACE("mcd_start: found block bp=0x%x\n",bp,0,0,0);*/
- TAILQ_REMOVE(&cd->head, bp, b_act);
+ bufq_remove(&cd->head, bp);
splx(s);
} else {
/* nothing to do */
@@ -975,6 +975,7 @@ mcdintr(unit)
* MCD_S_WAITREAD: wait for read ready, read data
*/
static struct mcd_mbx *mbxsave;
+static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohandle);
static void
mcd_timeout(void *arg)
@@ -1008,11 +1009,11 @@ retry_status:
/* get status */
outb(com_port, MCD_CMDGETSTAT);
mbx->count = RDELAY_WAITSTAT;
- timeout(mcd_timeout,
- (caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
+ tohandle = timeout(mcd_timeout,
+ (caddr_t)MCD_S_WAITSTAT,hz/100); /* XXX */
return;
case MCD_S_WAITSTAT:
- untimeout(mcd_timeout,(caddr_t)MCD_S_WAITSTAT);
+ untimeout(mcd_timeout,(caddr_t)MCD_S_WAITSTAT, tohandle);
if (mbx->count-- >= 0) {
if (inb(port+MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) {
timeout(mcd_timeout,
@@ -1052,8 +1053,8 @@ retry_mode:
mcd_put(com_port, MCD_CMDSETMODE);
mcd_put(com_port, rm);
- timeout(mcd_timeout,
- (caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
+ tohandle = timeout(mcd_timeout,
+ (caddr_t)MCD_S_WAITMODE,hz/100); /* XXX */
return;
} else {
printf("mcd%d: timeout getstatus\n",unit);
@@ -1061,13 +1062,14 @@ retry_mode:
}
case MCD_S_WAITMODE:
- untimeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE);
+ untimeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE, tohandle);
if (mbx->count-- < 0) {
printf("mcd%d: timeout set mode\n",unit);
goto readerr;
}
if (inb(port+MCD_FLAGS) & MFL_STATUS_NOT_AVAIL) {
- timeout(mcd_timeout,(caddr_t)MCD_S_WAITMODE,hz/100);
+ tohandle = timeout(mcd_timeout,
+ (caddr_t)MCD_S_WAITMODE,hz/100);
return;
}
cd->status = inb(port+mcd_status) & 0xFF;
@@ -1115,11 +1117,11 @@ retry_read:
}
mbx->count = RDELAY_WAITREAD;
- timeout(mcd_timeout,
- (caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
+ tohandle = timeout(mcd_timeout,
+ (caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
case MCD_S_WAITREAD:
- untimeout(mcd_timeout,(caddr_t)MCD_S_WAITREAD);
+ untimeout(mcd_timeout,(caddr_t)MCD_S_WAITREAD, tohandle);
if (mbx->count-- > 0) {
k = inb(port+MCD_FLAGS);
if (!(k & MFL_DATA_NOT_AVAIL)) { /* XXX */
@@ -1163,8 +1165,8 @@ retry_read:
if (mcd_setflags(unit,cd) < 0)
goto changed;
}
- timeout(mcd_timeout,
- (caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
+ tohandle = timeout(mcd_timeout,
+ (caddr_t)MCD_S_WAITREAD,hz/100); /* XXX */
return;
} else {
printf("mcd%d: timeout read data\n",unit);
diff --git a/sys/dev/scd/scd.c b/sys/dev/scd/scd.c
index e7fef41..72fd0ca 100644
--- a/sys/dev/scd/scd.c
+++ b/sys/dev/scd/scd.c
@@ -41,7 +41,7 @@
*/
-/* $Id: scd.c,v 1.31 1997/05/10 12:13:13 joerg Exp $ */
+/* $Id: scd.c,v 1.32 1997/07/20 14:10:10 bde Exp $ */
/* Please send any comments to micke@dynas.se */
@@ -181,6 +181,9 @@ static int scd_probe(struct isa_device *dev);
static int scd_attach(struct isa_device *dev);
struct isa_driver scddriver = { scd_probe, scd_attach, "scd" };
+/* For canceling our timeout */
+static struct callout_handle tohandle = CALLOUT_HANDLE_INITIALIZER(&tohanle);
+
static d_open_t scdopen;
static d_close_t scdclose;
static d_ioctl_t scdioctl;
@@ -207,7 +210,7 @@ int scd_attach(struct isa_device *dev)
cd->flags = SCDINIT;
cd->audio_status = CD_AS_AUDIO_INVALID;
- TAILQ_INIT(&cd->head);
+ bufq_init(&cd->head);
#ifdef DEVFS
cd->ra_devfs_token =
@@ -360,7 +363,7 @@ scdstrategy(struct buf *bp)
/* queue it */
s = splbio();
- tqdisksort(&cd->head, bp);
+ bufqdisksort(&cd->head, bp);
splx(s);
/* now check whether we can perform processing */
@@ -388,10 +391,10 @@ scd_start(int unit)
return;
}
- bp = TAILQ_FIRST(&cd->head);
+ bp = bufq_first(&cd->head);
if (bp != 0) {
/* block found to process, dequeue */
- TAILQ_REMOVE(&cd->head, bp, b_act);
+ bufq_remove(&cd->head, bp);
cd->flags |= SCDMBXBSY;
splx(s);
} else {
@@ -806,7 +809,7 @@ loop:
goto trystat;
case SCD_S_WAITSTAT:
- untimeout(scd_timeout,(caddr_t)SCD_S_WAITSTAT);
+ untimeout(scd_timeout,(caddr_t)SCD_S_WAITSTAT, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout. drive busy.\n",unit);
goto harderr;
@@ -814,8 +817,8 @@ loop:
trystat:
if (IS_BUSY(port)) {
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITSTAT,hz/100); /* XXX */
return;
}
@@ -853,19 +856,19 @@ nextblock:
goto writeparam;
mbx->count = 100;
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
return;
case SCD_S_WAITSPIN:
- untimeout(scd_timeout,(caddr_t)SCD_S_WAITSPIN);
+ untimeout(scd_timeout,(caddr_t)SCD_S_WAITSPIN, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout waiting for drive to spin up.\n", unit);
goto harderr;
}
if (!STATUS_BIT(port, SBIT_RESULT_READY)) {
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
return;
}
write_control(port, CBIT_RESULT_READY_CLEAR);
@@ -885,14 +888,14 @@ nextblock:
goto loop;
case SCD_S_WAITFIFO:
- untimeout(scd_timeout,(caddr_t)SCD_S_WAITFIFO);
+ untimeout(scd_timeout,(caddr_t)SCD_S_WAITFIFO, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout. write param not ready.\n",unit);
goto harderr;
}
if (!FSTATUS_BIT(port, FBIT_WPARAM_READY)) {
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITFIFO,hz/100); /* XXX */
return;
}
XDEBUG(1, ("scd%d: mbx->count (writeparamwait) = %d(%d)\n", unit, mbx->count, 100));
@@ -904,8 +907,8 @@ writeparam:
XDEBUG(1, ("scd%d: spinning up drive ...\n", unit));
outb(port+OREG_COMMAND, CMD_SPIN_UP);
mbx->count = 300;
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITSPIN,hz/100); /* XXX */
return;
}
@@ -928,12 +931,12 @@ writeparam:
DELAY(100);
}
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
return;
case SCD_S_WAITREAD:
- untimeout(scd_timeout,(caddr_t)SCD_S_WAITREAD);
+ untimeout(scd_timeout,(caddr_t)SCD_S_WAITREAD, tohandle);
if (mbx->count-- <= 0) {
if (STATUS_BIT(port, SBIT_RESULT_READY))
goto got_param;
@@ -944,8 +947,8 @@ writeparam:
process_attention(unit);
if (!(cd->flags & SCDVALID))
goto changed;
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITREAD,hz/100); /* XXX */
return;
}
XDEBUG(2, ("scd%d: mbx->count (after RDY_BIT) = %d(%d)\n", unit, mbx->count, RDELAY_WAITREAD));
@@ -965,7 +968,7 @@ got_data:
goto waitfor_param;
case SCD_S_WAITPARAM:
- untimeout(scd_timeout,(caddr_t)SCD_S_WAITPARAM);
+ untimeout(scd_timeout,(caddr_t)SCD_S_WAITPARAM, tohandle);
if (mbx->count-- <= 0) {
printf("scd%d: timeout waiting for params\n",unit);
goto readerr;
@@ -973,8 +976,8 @@ got_data:
waitfor_param:
if (!STATUS_BIT(port, SBIT_RESULT_READY)) {
- timeout(scd_timeout,
- (caddr_t)SCD_S_WAITPARAM,hz/100); /* XXX */
+ tohandle = timeout(scd_timeout,
+ (caddr_t)SCD_S_WAITPARAM,hz/100); /* XXX */
return;
}
#if SCD_DEBUG
diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c
index bd756a3..6c4f899 100644
--- a/sys/dev/si/si.c
+++ b/sys/dev/si/si.c
@@ -30,7 +30,7 @@
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHORS BE LIABLE.
*
- * $Id: si.c,v 1.59 1997/07/20 14:10:11 bde Exp $
+ * $Id: si.c,v 1.60 1997/09/14 03:19:18 peter Exp $
*/
#ifndef lint
@@ -910,7 +910,7 @@ siclose(dev, flag, mode, p)
/* ok. we are now still on the right track.. nuke the hardware */
if (pp->sp_state & SS_LSTART) {
- untimeout(si_lstart, (caddr_t)pp);
+ untimeout(si_lstart, (caddr_t)pp, pp->lstart_ch);
pp->sp_state &= ~SS_LSTART;
}
@@ -2114,12 +2114,12 @@ si_start(tp)
}
if ((pp->sp_state & (SS_LSTART|SS_INLSTART)) == SS_LSTART) {
- untimeout(si_lstart, (caddr_t)pp);
+ untimeout(si_lstart, (caddr_t)pp, pp->lstart_ch);
} else {
pp->sp_state |= SS_LSTART;
}
DPRINT((pp, DBG_START, "arming lstart, time=%d\n", time));
- timeout(si_lstart, (caddr_t)pp, time);
+ pp->lstart_ch = timeout(si_lstart, (caddr_t)pp, time);
}
out:
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 37d8ecd..21beb8c 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
- * $Id: sio.c,v 1.181 1997/09/14 03:19:23 peter Exp $
+ * $Id: sio.c,v 1.182 1997/09/19 15:25:49 jmg Exp $
*/
#include "opt_comconsole.h"
@@ -373,6 +373,8 @@ static u_int com_events; /* input chars + weighted output completions */
static Port_t siocniobase;
static int sio_timeout;
static int sio_timeouts_until_log;
+static struct callout_handle sio_timeout_handle
+ = CALLOUT_HANDLE_INITIALIZER(&sio_timeout_handle);
#if 0 /* XXX */
static struct tty *sio_tty[NSIOTOT];
#else
@@ -2410,7 +2412,7 @@ siosettimeout()
* Otherwise set it to max(1/200, 1/hz).
* Enable timeouts iff some device is open.
*/
- untimeout(comwakeup, (void *)NULL);
+ untimeout(comwakeup, (void *)NULL, sio_timeout_handle);
sio_timeout = hz;
someopen = FALSE;
for (unit = 0; unit < NSIOTOT; ++unit) {
@@ -2426,12 +2428,13 @@ siosettimeout()
}
if (someopen) {
sio_timeouts_until_log = hz / sio_timeout;
- timeout(comwakeup, (void *)NULL, sio_timeout);
+ sio_timeout_handle = timeout(comwakeup, (void *)NULL,
+ sio_timeout);
} else {
/* Flush error messages, if any. */
sio_timeouts_until_log = 1;
comwakeup((void *)NULL);
- untimeout(comwakeup, (void *)NULL);
+ untimeout(comwakeup, (void *)NULL, sio_timeout_handle);
}
}
@@ -2442,7 +2445,7 @@ comwakeup(chan)
struct com_s *com;
int unit;
- timeout(comwakeup, (void *)NULL, sio_timeout);
+ sio_timeout_handle = timeout(comwakeup, (void *)NULL, sio_timeout);
/*
* Recover from lost output interrupts.
diff --git a/sys/dev/wl/if_wl.c b/sys/dev/wl/if_wl.c
index d17de61..2073ef9 100644
--- a/sys/dev/wl/if_wl.c
+++ b/sys/dev/wl/if_wl.c
@@ -1,4 +1,4 @@
-/* $Id: if_wl.c,v 1.7 1997/08/02 05:19:32 msmith Exp $ */
+/* $Id: if_wl.c,v 1.8 1997/08/25 22:34:25 bde Exp $ */
/*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -247,6 +247,7 @@ struct wl_softc{
short mode;
u_char chan24; /* 2.4 Gz: channel number/EEPROM Area # */
u_short freq24; /* 2.4 Gz: resulting frequency */
+ struct callout_handle watchdog_ch;
#ifdef WLCACHE
int w_sigitems; /* number of cached entries */
/* array of cache entries */
@@ -447,6 +448,7 @@ wlattach(struct isa_device *id)
sc->flags = 0;
sc->mode = 0;
sc->hacr = HACR_RESET;
+ callout_handle_init(&sc->watchdog_ch);
CMD(unit); /* reset the board */
DELAY(DELAYCONST); /* >> 4 clocks at 6MHz */
@@ -696,7 +698,7 @@ wlinit(void *xsc)
sc->flags |= DSF_RUNNING;
sc->tbusy = 0;
- untimeout(wlwatchdog, sc);
+ untimeout(wlwatchdog, sc, sc->watchdog_ch);
wlstart(ifp);
} else {
@@ -867,7 +869,7 @@ wlstart(struct ifnet *ifp)
if((scb_status & 0x0700) == SCB_CUS_IDLE &&
(cu_status & AC_SW_B) == 0){
sc->tbusy = 0;
- untimeout(wlwatchdog, sc);
+ untimeout(wlwatchdog, sc, sc->watchdog_ch);
sc->wl_ac.ac_if.if_flags &= ~IFF_OACTIVE;
/*
* This is probably just a race. The xmt'r is just
@@ -906,7 +908,7 @@ wlstart(struct ifnet *ifp)
* fails to interrupt we will restart
*/
/* try 10 ticks, not very long */
- timeout(wlwatchdog, sc, 10);
+ sc->watchdog_ch = timeout(wlwatchdog, sc, 10);
sc->wl_ac.ac_if.if_flags |= IFF_OACTIVE;
sc->wl_if.if_opackets++;
wlxmt(unit, m);
@@ -1605,7 +1607,7 @@ int unit;
}
}
sc->tbusy = 0;
- untimeout(wlwatchdog, sc);
+ untimeout(wlwatchdog, sc, sc->watchdog_ch);
sc->wl_ac.ac_if.if_flags &= ~IFF_OACTIVE;
wlstart(&(sc->wl_if));
}
OpenPOWER on IntegriCloud