diff --git a/sys/pc98/pc98/lpt.c b/sys/pc98/pc98/lpt.c index f9f1c133beba..c1c9b60255e5 100644 --- a/sys/pc98/pc98/lpt.c +++ b/sys/pc98/pc98/lpt.c @@ -46,7 +46,7 @@ * SUCH DAMAGE. * * from: unknown origin, 386BSD 0.1 - * $Id: lpt.c,v 1.16 1998/01/08 23:42:13 eivind Exp $ + * $Id: lpt.c,v 1.17 1998/01/24 02:54:38 eivind Exp $ */ /* @@ -389,8 +389,14 @@ lptprobe(struct isa_device *dvp) int port; static short next_bios_lpt = 0; int status; - u_char data; - u_char mask; + static u_char testbyte[18] = { + 0x55, /* alternating zeros */ + 0xaa, /* alternating ones */ + 0xfe, 0xfd, 0xfb, 0xf7, + 0xef, 0xdf, 0xbf, 0x7f, /* walking zero */ + 0x01, 0x02, 0x04, 0x08, + 0x10, 0x20, 0x40, 0x80 /* walking one */ + }; int i; /* @@ -413,27 +419,12 @@ lptprobe(struct isa_device *dvp) /* Port was explicitly specified */ /* This allows probing of ports unknown to the BIOS */ - port = dvp->id_iobase + lpt_data; - mask = 0xff; - data = 0x55; /* Alternating zeros */ - if (!lpt_port_test(port, data, mask)) - { status = 0 ; goto end_probe ; } - - data = 0xaa; /* Alternating ones */ - if (!lpt_port_test(port, data, mask)) - { status = 0 ; goto end_probe ; } - - for (i = 0; i < 8; i++) { /* Walking zero */ - data = ~(1 << i); - if (!lpt_port_test(port, data, mask)) - { status = 0 ; goto end_probe ; } - } - - for (i = 0; i < 8; i++) { /* Walking one */ - data = (1 << i); - if (!lpt_port_test(port, data, mask)) - { status = 0 ; goto end_probe ; } + for (i = 0; i < 18; i++) { + if (!lpt_port_test(port, testbyte[i], 0xff)) { + status = 0; + goto end_probe; + } } end_probe: