--- researchv9/sys/sundev/ie.c 2018/04/24 17:21:59 1.1 +++ researchv9/sys/sundev/ie.c 2018/04/24 17:30:49 1.1.1.2 @@ -44,7 +44,6 @@ struct mb_driver iedriver = { sizeof (struct mie_device), "ie", ieinfo, }; -int iebark(), iedog(); caddr_t from_ieaddr(); ieoff_t to_ieoff(); caddr_t from_ieoff(); @@ -93,13 +92,11 @@ struct ie_softc { struct ierbd *es_rbdhead; /* head of RBD list */ struct ierbd *es_rbdtail; /* tail of RBD list */ struct ieipack *es_iepavail; /* standby input packets */ - time_t es_latest; /* latest packet arrival time */ int es_obmem; /* total IE_OB main memory */ char es_type; /* type of controller */ char es_simple; /* doing simple flag */ u_int es_runotready; /* RU was not ready counter */ u_int es_xmiturun; /* xmit DMA underrun counter */ - u_int es_dogreset; /* iedog reset counter */ u_int es_ieheart; /* heartbeat counter */ u_int es_iedefer; /* deferred transmission counter */ struct ieierr { @@ -352,68 +349,6 @@ register struct block *bp; } /* - * Unresponsive chip alarm. Scheduled by iedog; chip has some number - * of seconds to execute a nop, else alarm goes off. - */ -iebark(es) - struct ie_softc *es; -{ - int unit = es - ie_softc; - - printf("ie%d: iebark reset\n", unit); - ieinit(unit); -} - -/* - * Watchdog (deadman) timer routine, invoked every 10 seconds. - */ -iedog(es) - struct ie_softc *es; -{ - int unit = es - ie_softc; - int s = splie(); - struct iecb *cb; - int fatal = 0; - - /* poll for bus error on obie */ - if (es->es_type == IE_OB) - if (es->es_obie->obie_buserr) { - printf("ie%d: obie buserr reset\n", unit); - fatal = 1; - goto reset; - } - - /* ensure cu ok with a nop */ - cb = escballoc(es, struct iecb, 1); - if (cb == NULL) - goto reset; - bzero((caddr_t)cb, sizeof (struct iecb)); - cb->ie_cmd = IE_NOP; - iedocb(es, cb); - iecustart(es); - /* some number of seconds delay before iebark */ - timeout(iebark, (caddr_t)es, hz<<2); - - /* ensure ru ok with recent reception */ - if (es->es_latest + 90 < time) { - /* restart timeout period */ - es->es_latest = time; - goto reset; - } - - timeout(iedog, (caddr_t)es, 10*hz); - goto exit; -reset: - es->es_dogreset++; - ieinit(unit); - if (fatal) - panic("iedog"); - /* FALL THRU */ -exit: - (void) splx(s); -} - -/* * Unconditionally restart the interface from ground zero. */ ieinit(unit) @@ -423,8 +358,6 @@ ieinit(unit) int s = splie(); iechipreset(es); - untimeout(iebark, (caddr_t)es); - untimeout(iedog, (caddr_t)es); iedomaps(es); if (!iechipinit(es)) @@ -436,8 +369,6 @@ ieinit(unit) ierustart(es); iesplice(es); iestartout(unit); - timeout(iedog, (caddr_t)es, 10*hz); - es->es_latest = time; exit: (void) splx(s); } @@ -665,8 +596,6 @@ ierecv(es) register struct iescb *scb = es->es_scb; int eof, e; - es->es_latest = time; /* latch arrival time */ - rfd = es->es_rfdhead; if (rfd == NULL) /* not initialized */ return; @@ -834,7 +763,9 @@ iestartout(unit) goto out; } - bufnum = ffs(es->es_tfree); + for (bufnum = 0; ; bufnum++) + if (es->es_tfree & (1 << bufnum)) + break; es->es_tfree &= ~(1 << bufnum); td = es->es_tfd[bufnum]; tbd = es->es_tbd[bufnum]; @@ -1393,10 +1324,6 @@ iecuclean(es) case IE_TRANSMIT: iexmitdone(es, (struct ietfd *)cb); break; - case IE_NOP: - untimeout(iebark, (caddr_t)es); - escbfree(es, cb); - break; default: if (!es->es_simple) printf("ie%d: unknown cmd %x done\n", @@ -1862,7 +1789,7 @@ to_ieoff(es, addr) register struct ie_softc *es; caddr_t addr; { - union { + union xxx { ieoff_t s; char c[2]; } a, b;