+ register int dh, s;
+ static int timercalls;
+
+ if (dhsilos) {
+ dhfasttimers++; /*DEBUG*/
+ timercalls++;
+ s = spl5();
+ for (dh = 0; dh < NDH; dh++)
+ if (dhsilos & (1 << dh))
+ dhrint(dh);
+ splx(s);
+ }
+ if ((dhsilos == 0) || ((timercalls += FASTTIMER) >= hz)) {
+ dhslowtimers++; /*DEBUG*/
+ timercalls = 0;
+ for (dh = 0; dh < NDH; dh++) {
+ ave(dhrate[dh], dhchars[dh], 8);
+ if ((dhchars[dh] > dhhighrate) &&
+ ((dhsilos & (1 << dh)) == 0)) {
+ ((struct dhdevice *)(dhinfo[dh]->ui_addr))->dhsilo =
+ (dhchars[dh] > 500? 32 : 16);
+ dhsilos |= (1 << dh);
+ dhtransitions++; /*DEBUG*/
+ } else if ((dhsilos & (1 << dh)) &&
+ (dhrate[dh] < dhlowrate)) {
+ ((struct dhdevice *)(dhinfo[dh]->ui_addr))->dhsilo = 0;
+ dhsilos &= ~(1 << dh);
+ }
+ dhchars[dh] = 0;
+ }
+ }
+ timeout(dhtimer, (caddr_t) 0, dhsilos? FASTTIMER: hz);