Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!botter!ark!smagt From: smagt@ark.cs.vu.nl (Smagt v der PPP) Newsgroups: comp.os.minix Subject: minix printer driver Message-ID: <922@ark.cs.vu.nl> Date: Fri, 6-Mar-87 07:23:48 EST Article-I.D.: ark.922 Posted: Fri Mar 6 07:23:48 1987 Date-Received: Sun, 8-Mar-87 06:52:26 EST Organization: V.U. Informatica, Amsterdam, the Netherlands Lines: 36 Keywords: bugs (?) in printer.c The MINIX printer driver may not work for all printers. The trouble is this. Printer.c expects a printer status of 0xDF when the printer is ready, or 0x5F when the printer is busy. I discovered, however, that some printers (e.g. mine) return some other values as well: 0xDC and 0xD8 when ready, or 0x58 or 0x5C when busy. So I adapted printer.c to be less choosy, i.e. to accept all 0xD? as "ready" and 0x5? as "busy" status. The patches are these: on line 121, change if (value == NORMAL_STATUS) { to if ((value | LOW_FOUR) == NORMAL_STATUS) { on line 127, change if (value == BUSY_STATUS) { to if ((value | LOW_FOUR) == BUSY_STATUS) { on line 139, change if (value == BUSY_STATUS) r = EAGAIN; to if ((value | LOW_FOUR) == BUSY_STATUS) r = EAGAIN; on line 253, change if (value == NORMAL_STATUS) { to if ((value | LOW_FOUR) == NORMAL_STATUS) { and on line 264, change } else if (value == BUSY_STATUS) { to } else if ((value | LOW_FOUR) == BUSY_STATUS) { I deliberately didn't change the 'value' itself, because other programs (e.g. lpr) use its value to print an error message (if anything is wrong). Prof. Tanenbaum accepted my patched readily. P.P.Patrick van der Smagt.