[PATCH] parport_pc, kernel 2.2.13

Dominique LARCHEY-WENDLING (Dominique.LARCHEY-WENDLING@loria.fr)
Thu, 28 Oct 1999 14:49:36 +0200


This is an obvious patch against 2.2.13, file drivers/misc/parport_pc.c
to ensure the correct detection of EPP modes on my Dell Optiplex.
It greatly enhances my Zip drive performances.

The code is adapted from 2.3.x so I suppose it should work. The old
code looks very strange to me, particulary at the end of the function
parport_EPP_supported.

-- 
Dominique Larchey
LORIA, Nancy, France
Tel. (Work) +33 (0) 3 83 59 20 13

-----------------------------------------------------

--- linux-2.2.13-old/drivers/misc/parport_pc.c Mon Aug 9 21:05:05 1999 +++ linux-2.2.13-new/drivers/misc/parport_pc.c Thu Oct 28 14:08:05 1999 @@ -496,22 +496,22 @@ static int parport_EPP_supported(struct parport *pb) { /* If EPP timeout bit clear then EPP available */ + if (!parport_pc_epp_clear_timeout(pb)) return 0; /* No way to clear timeout */ - parport_pc_write_control(pb, parport_pc_read_control(pb) | 0x20); - parport_pc_write_control(pb, parport_pc_read_control(pb) | 0x10); - parport_pc_epp_clear_timeout(pb); - - parport_pc_read_epp(pb); - udelay(30); /* Wait for possible EPP timeout */ - - if (parport_pc_read_status(pb) & 0x01) { - parport_pc_epp_clear_timeout(pb); - return PARPORT_MODE_PCEPP; - } + /* Check for Intel bug. */ + if (pb->modes & PARPORT_MODE_PCECR) { + unsigned char i; + for (i = 0x00; i < 0x80; i += 0x20) { + parport_pc_write_econtrol(pb,i); + if (parport_pc_epp_clear_timeout(pb)) + /* Phony EPP in ECP. */ + return 0; + } + } - return 0; + return PARPORT_MODE_PCEPP; } static int parport_ECPEPP_supported(struct parport *pb)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/