--- parport_pc.c.old 2010-04-11 07:34:24.000000000 +0200 +++ parport_pc.c 2010-04-11 10:51:50.000000000 +0200 @@ -1999,8 +1999,6 @@ static int parport_EPP_supported(struct parport *pb) { - const struct parport_pc_private *priv = pb->private_data; - /* * Theory: * Bit 0 of STR is the EPP timeout bit, this bit is 0 @@ -2011,25 +2009,16 @@ * * This bit is cleared by either reading it (National Semi) * or writing a 1 to the bit (SMC, UMC, WinBond), others ??? - * This bit is always high in non EPP modes. + * This bit is usually high in non EPP modes, however, this + * is no reliable detection method. When the timeout bit is + * premanently high, then we are definitely not in EPP mode, + * while in the other case this remains unclear. */ - /* If EPP timeout bit clear then EPP available */ + /* If EPP timeout bit clear then assume EPP available */ if (!clear_epp_timeout(pb)) return 0; /* No way to clear timeout */ - /* Check for Intel bug. */ - if (priv->ecr) { - unsigned char i; - for (i = 0x00; i < 0x80; i += 0x20) { - ECR_WRITE(pb, i); - if (clear_epp_timeout(pb)) { - /* Phony EPP in ECP. */ - return 0; - } - } - } - pb->modes |= PARPORT_MODE_EPP; /* Set up access functions to use EPP hardware. */ @@ -2856,6 +2845,21 @@ { sio_ite_8872_probe, NULL, }, }; +void netmos_pci_postinit (struct pci_dev *pdev, int failed) +{ + /* The NetMos MCS9901 chips are forced to use ECR */ + /* when operating in EPP mode. */ + struct parport *pb = parport_find_base(pci_resource_start(pdev, 0)); + if (!failed && pb) { + printk(KERN_INFO "%s: Forcing use of ECR for EPP trasfers\n", pb->name); + pb->modes |= PARPORT_MODE_EPP; + pb->ops->epp_read_data = parport_pc_ecpepp_read_data; + pb->ops->epp_write_data = parport_pc_ecpepp_write_data; + pb->ops->epp_read_addr = parport_pc_ecpepp_read_addr; + pb->ops->epp_write_addr = parport_pc_ecpepp_write_addr; + } +} + enum parport_pc_pci_cards { siig_1p_10x = last_sio, siig_2p_10x, @@ -2988,7 +2992,7 @@ /* netmos_9755 */ { 2, { { 0, 1 }, { 2, 3 },} }, /* netmos_9805 */ { 1, { { 0, -1 }, } }, /* netmos_9815 */ { 2, { { 0, -1 }, { 2, -1 }, } }, - /* netmos_9901 */ { 1, { { 0, -1 }, } }, + /* netmos_9901 */ { 1, { { 0, 1 }, }, NULL, netmos_pci_postinit }, /* quatech_sppxp100 */ { 1, { { 0, 1 }, } }, };