View | Details | Raw Unified | Return to bug 170076
Collapse All | Expand All

(-)b/sys/dev/ppbus/lpt.c (-9 / +3 lines)
Lines 242-249 lpt_port_test(device_t ppbus, u_char data, u_char mask) Link Here
242
	do {
242
	do {
243
		DELAY(10);
243
		DELAY(10);
244
		temp = ppb_rdtr(ppbus) & mask;
244
		temp = ppb_rdtr(ppbus) & mask;
245
	}
245
	} while (temp != data && --timeout);
246
	while (temp != data && --timeout);
247
	lprintf(("out=%x\tin=%x\ttout=%d\n", data, temp, timeout));
246
	lprintf(("out=%x\tin=%x\ttout=%d\n", data, temp, timeout));
248
	return (temp == data);
247
	return (temp == data);
249
}
248
}
Lines 564-572 lptopen(struct cdev *dev, int flags, int fmt, struct thread *td) Link Here
564
		}
563
		}
565
564
566
		/* is printer online and ready for output */
565
		/* is printer online and ready for output */
567
	} while ((ppb_rstr(ppbus) &
566
	} while ((ppb_rstr(ppbus) & RDY_MASK) != LP_READY);
568
			(LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) !=
569
					(LPS_SEL|LPS_NBSY|LPS_NERR));
570
567
571
	sc->sc_control = LPC_SEL|LPC_NINIT;
568
	sc->sc_control = LPC_SEL|LPC_NINIT;
572
	if (sc->sc_flags & LP_AUTOLF)
569
	if (sc->sc_flags & LP_AUTOLF)
Lines 623-631 lptclose(struct cdev *dev, int flags, int fmt, struct thread *td) Link Here
623
620
624
	/* if the last write was interrupted, don't complete it */
621
	/* if the last write was interrupted, don't complete it */
625
	if ((!(sc->sc_state  & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ))
622
	if ((!(sc->sc_state  & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ))
626
		while ((ppb_rstr(ppbus) &
623
		while (((ppb_rstr(ppbus) & RDY_MASK) != LP_READY) || sc->sc_xfercnt)
627
			(LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) !=
628
			(LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt)
629
			/* wait 1 second, give up if we get a signal */
624
			/* wait 1 second, give up if we get a signal */
630
			if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lpclose",
625
			if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lpclose",
631
			    hz) != EWOULDBLOCK)
626
			    hz) != EWOULDBLOCK)
632
- 

Return to bug 170076