From 08424dfaa3c5979fc8a3a2969540de3c35524cf1 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Mon, 12 Aug 1996 17:12:07 +0000 Subject: [PATCH] Extend the poll code so that it can periodically scan the host cards for work regardless of whether there was an interrupt. This needs more work, it should be able to run better when there are more than 3 host cards present, ie: all cards in polling-only mode with no IRQ. (The host cards have a choice of 3 irq's, 11, 12, or 15, or just polling) --- sys/dev/si/si.c | 15 +++++++++++---- sys/i386/isa/si.c | 15 +++++++++++---- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/sys/dev/si/si.c b/sys/dev/si/si.c index a92ab4a2d63..bcb301da449 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.49 1996/07/26 16:55:37 peter Exp $ + * $Id: si.c,v 1.50 1996/08/03 00:21:44 peter Exp $ */ #ifndef lint @@ -82,7 +82,9 @@ static const char si_copyright1[] = "@(#) (C) Specialix International, 1990,199 * and a (programmable - SIHOST2) interrupt at IRQ 11,12 or 15. */ -#define POLL /* turn on poller to generate buffer empty interrupt */ +#define POLL /* turn on poller to scan for lost interrupts */ +#define REALPOLL /* on each poll, scan for work regardless */ +#define POLLHZ (hz/10) /* 10 times per second */ #define SI_DEF_HWFLOW /* turn on default CRTSCTS flow control */ #define SI_I_HIGH_WATER (TTYHOG - 2 * SI_BUFFERSIZE) #define INT_COUNT 25000 /* max of 125 ints per second */ @@ -230,8 +232,10 @@ static int si_default_cflag = TTYDEF_CFLAG; #ifdef POLL static int si_pollrate; /* in addition to irq */ +static int si_realpoll; /* poll HW on timer */ SYSCTL_INT(_machdep, OID_AUTO, si_pollrate, CTLFLAG_RW, &si_pollrate, 0, ""); +SYSCTL_INT(_machdep, OID_AUTO, si_realpoll, CTLFLAG_RW, &si_realpoll, 0, ""); static int init_finished = 0; static void si_poll __P((void *)); @@ -288,7 +292,10 @@ siprobe(id) si_registerdev(id); - si_pollrate = (hz / 10); /* 10 per second */ + si_pollrate = POLLHZ; /* default 10 per second */ +#ifdef REALPOLL + si_realpoll = 1; /* scan always */ +#endif maddr = id->id_maddr; /* virtual address... */ paddr = (caddr_t)vtophys(id->id_maddr); /* physical address... */ @@ -1737,7 +1744,7 @@ si_poll(void *nothing) } } } - if (lost) + if (lost || si_realpoll) siintr(-1); /* call intr with fake vector */ out: splx(oldspl); diff --git a/sys/i386/isa/si.c b/sys/i386/isa/si.c index a92ab4a2d63..bcb301da449 100644 --- a/sys/i386/isa/si.c +++ b/sys/i386/isa/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.49 1996/07/26 16:55:37 peter Exp $ + * $Id: si.c,v 1.50 1996/08/03 00:21:44 peter Exp $ */ #ifndef lint @@ -82,7 +82,9 @@ static const char si_copyright1[] = "@(#) (C) Specialix International, 1990,199 * and a (programmable - SIHOST2) interrupt at IRQ 11,12 or 15. */ -#define POLL /* turn on poller to generate buffer empty interrupt */ +#define POLL /* turn on poller to scan for lost interrupts */ +#define REALPOLL /* on each poll, scan for work regardless */ +#define POLLHZ (hz/10) /* 10 times per second */ #define SI_DEF_HWFLOW /* turn on default CRTSCTS flow control */ #define SI_I_HIGH_WATER (TTYHOG - 2 * SI_BUFFERSIZE) #define INT_COUNT 25000 /* max of 125 ints per second */ @@ -230,8 +232,10 @@ static int si_default_cflag = TTYDEF_CFLAG; #ifdef POLL static int si_pollrate; /* in addition to irq */ +static int si_realpoll; /* poll HW on timer */ SYSCTL_INT(_machdep, OID_AUTO, si_pollrate, CTLFLAG_RW, &si_pollrate, 0, ""); +SYSCTL_INT(_machdep, OID_AUTO, si_realpoll, CTLFLAG_RW, &si_realpoll, 0, ""); static int init_finished = 0; static void si_poll __P((void *)); @@ -288,7 +292,10 @@ siprobe(id) si_registerdev(id); - si_pollrate = (hz / 10); /* 10 per second */ + si_pollrate = POLLHZ; /* default 10 per second */ +#ifdef REALPOLL + si_realpoll = 1; /* scan always */ +#endif maddr = id->id_maddr; /* virtual address... */ paddr = (caddr_t)vtophys(id->id_maddr); /* physical address... */ @@ -1737,7 +1744,7 @@ si_poll(void *nothing) } } } - if (lost) + if (lost || si_realpoll) siintr(-1); /* call intr with fake vector */ out: splx(oldspl);