From phdm at macqel.be  Thu Mar 19 14:11:20 2009
From: phdm at macqel.be (Philippe De Muyter)
Date: Thu, 19 Mar 2009 19:11:20 +0100
Subject: [Linux-parport] [PATCH] parport netmos 9845 & 9855 1P4S fixes
Message-ID: <20090319181120.GA18034@frolo.macqel>

Hello list,

--

netmos serial/parallel adapters come in different flavour differing only
by the number of parallel and serial ports, which are encoded in the
subdevice ID.

Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S,
and works only by side-effect for the first parallel port of a 2P2S,
as it is found by reading the second addr entry of
(struct parport_pc_pci) cards[netmos_9855], which is not initialized.

netmos_9xx5_combo entry in (struct parport_pc_pci) cards[], which is used
for a 9845 1P4S should also be fixed when there are 4 serial ports
because it currently gives 2 as BAR index for the parallel port,
while, in this case, BAR 2 is the 3rd serial port and the parallel port
is at BAR 4.

I fixed 9845 1P4S and 9855 1P4S support, while preserving 9855 2P2S support,
by creating and using a netmos_9855_2p entry for 9855 boards with 2 parallel
ports for 9855 2P2S and 9855 2P0S boards,
and by allowing netmos_parallel_init to change not only the number of
parallel ports (0 or 1), but also the BAR index of the parallel port
when the serial ports are before the parallel port.

PS: the netmos_9855_2p entry in
(struct pciserial_board) pci_parport_serial_boards[] is needed because
netmos_parallel_init has no clean way to replace FL_BASE2 by FL_BASE4
based on the number of parallel ports in the card.

Tested with a 9845 1P4S and a 9855 1P4S board.

Signed-off-by: Philippe De Muyter <phdm at macqel.be>

diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -30,6 +30,7 @@ enum parport_pc_pci_cards {
 	titan_210l,
 	netmos_9xx5_combo,
 	netmos_9855,
+	netmos_9855_2p,
 	avlab_1s1p,
 	avlab_1s2p,
 	avlab_2s1p,
@@ -62,7 +63,7 @@ struct parport_pc_pci {
 				struct parport_pc_pci *card, int failed);
 };
 
-static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
+static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma)
 {
 	/* the rule described below doesn't hold for this device */
 	if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
@@ -74,9 +75,17 @@ static int __devinit netmos_parallel_ini
 	 * and serial ports.  The form is 0x00PS, where <P> is the number of
 	 * parallel ports and <S> is the number of serial ports.
 	 */
-	card->numports = (dev->subsystem_device & 0xf0) >> 4;
-	if (card->numports > ARRAY_SIZE(card->addr))
-		card->numports = ARRAY_SIZE(card->addr);
+	par->numports = (dev->subsystem_device & 0xf0) >> 4;
+	if (par->numports > ARRAY_SIZE(par->addr))
+		par->numports = ARRAY_SIZE(par->addr);
+	/*
+	 * This function is currently only called for cards with up to
+	 * one parallel port.
+	 * Parallel port BAR is either before or after serial ports BARS;
+	 * hence, lo should be either 0 or equal to the number of serial ports.
+	 */
+	if (par->addr[0].lo != 0)
+		par->addr[0].lo = dev->subsystem_device & 0xf;
 	return 0;
 }
 
@@ -84,7 +93,8 @@ static struct parport_pc_pci cards[] __d
 	/* titan_110l */		{ 1, { { 3, -1 }, } },
 	/* titan_210l */		{ 1, { { 3, -1 }, } },
 	/* netmos_9xx5_combo */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
-	/* netmos_9855 */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
+	/* netmos_9855 */		{ 1, { { 0, -1 }, }, netmos_parallel_init },
+	/* netmos_9855_2p */		{ 2, { { 0, -1 }, { 2, -1 }, } },
 	/* avlab_1s1p     */		{ 1, { { 1, 2}, } },
 	/* avlab_1s2p     */		{ 2, { { 1, 2}, { 3, 4 },} },
 	/* avlab_2s1p     */		{ 1, { { 2, 3}, } },
@@ -109,6 +119,10 @@ static struct pci_device_id parport_seri
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
 	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  0x1000, 0x0020, 0, 0, netmos_9855_2p },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  0x1000, 0x0022, 0, 0, netmos_9855_2p },
 	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
 	/* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
@@ -192,6 +206,12 @@ static struct pciserial_board pci_parpor
 		.uart_offset	= 8,
 	},
 	[netmos_9855] = {
+		.flags		= FL_BASE2 | FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[netmos_9855_2p] = {
 		.flags		= FL_BASE4 | FL_BASE_BARS,
 		.num_ports	= 1,
 		.base_baud	= 115200,


From phdm at macqel.be  Mon Mar 23 04:50:24 2009
From: phdm at macqel.be (Philippe De Muyter)
Date: Mon, 23 Mar 2009 09:50:24 +0100
Subject: [Linux-parport] [PATCH] parport netmos 9845 & 9855 1P4S fixes
In-Reply-To: <20090319181120.GA18034@frolo.macqel>
References: <20090319181120.GA18034@frolo.macqel>
Message-ID: <20090323085024.GA8897@frolo.macqel>

Hello list,

Sorry for the resend.  I had forgotten to cc Christian Pellegrin,
and have rephrased somewhat the comment.

Christian, can you verify that the patch below works for your
netmos 9855 2P2S board ?

Philippe

--

netmos serial/parallel adapters come in different flavour differing only
by the number of parallel and serial ports, which are encoded in the
subdevice ID.

Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S,
and works only by side-effect for the first parallel port of a 2P2S,
as this first parallel port is found by reading the second addr entry of
(struct parport_pc_pci) cards[netmos_9855], which is not initialized, and
hence has value 0, which happens to be the BAR of the first parallel port.

netmos_9xx5_combo entry in (struct parport_pc_pci) cards[], which is used
for a 9845 1P4S must also be fixed for the parallel port support when there
are 4 serial ports because this entry currently gives 2 as BAR index for
the parallel port.  Actually, in this case, BAR 2 is the 3rd serial port
while the parallel port is at BAR 4.

I fixed 9845 1P4S and 9855 1P4S support, while preserving 9855 2P2S support,
- by creating a netmos_9855_2p entry and using it for 9855 boards with
2 parallel ports : 9855 2P2S and 9855 2P0S boards,
- and by allowing netmos_parallel_init to change not only the number of
parallel ports (0 or 1), but making it also change the BAR index of the
parallel port when the serial ports are before the parallel port.

PS: the netmos_9855_2p entry in
(struct pciserial_board) pci_parport_serial_boards[] is needed because
netmos_parallel_init has no clean way to replace FL_BASE2 by FL_BASE4
in the description of the serial ports in function of the number of
parallel ports on the card.

Tested with a 9845 1P4S and a 9855 1P4S board.

Signed-off-by: Philippe De Muyter <phdm at macqel.be>

diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -30,6 +30,7 @@ enum parport_pc_pci_cards {
 	titan_210l,
 	netmos_9xx5_combo,
 	netmos_9855,
+	netmos_9855_2p,
 	avlab_1s1p,
 	avlab_1s2p,
 	avlab_2s1p,
@@ -62,7 +63,7 @@ struct parport_pc_pci {
 				struct parport_pc_pci *card, int failed);
 };
 
-static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
+static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma)
 {
 	/* the rule described below doesn't hold for this device */
 	if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
@@ -74,9 +75,17 @@ static int __devinit netmos_parallel_ini
 	 * and serial ports.  The form is 0x00PS, where <P> is the number of
 	 * parallel ports and <S> is the number of serial ports.
 	 */
-	card->numports = (dev->subsystem_device & 0xf0) >> 4;
-	if (card->numports > ARRAY_SIZE(card->addr))
-		card->numports = ARRAY_SIZE(card->addr);
+	par->numports = (dev->subsystem_device & 0xf0) >> 4;
+	if (par->numports > ARRAY_SIZE(par->addr))
+		par->numports = ARRAY_SIZE(par->addr);
+	/*
+	 * This function is currently only called for cards with up to
+	 * one parallel port.
+	 * Parallel port BAR is either before or after serial ports BARS;
+	 * hence, lo should be either 0 or equal to the number of serial ports.
+	 */
+	if (par->addr[0].lo != 0)
+		par->addr[0].lo = dev->subsystem_device & 0xf;
 	return 0;
 }
 
@@ -84,7 +93,8 @@ static struct parport_pc_pci cards[] __d
 	/* titan_110l */		{ 1, { { 3, -1 }, } },
 	/* titan_210l */		{ 1, { { 3, -1 }, } },
 	/* netmos_9xx5_combo */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
-	/* netmos_9855 */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
+	/* netmos_9855 */		{ 1, { { 0, -1 }, }, netmos_parallel_init },
+	/* netmos_9855_2p */		{ 2, { { 0, -1 }, { 2, -1 }, } },
 	/* avlab_1s1p     */		{ 1, { { 1, 2}, } },
 	/* avlab_1s2p     */		{ 2, { { 1, 2}, { 3, 4 },} },
 	/* avlab_2s1p     */		{ 1, { { 2, 3}, } },
@@ -109,6 +119,10 @@ static struct pci_device_id parport_seri
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
 	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  0x1000, 0x0020, 0, 0, netmos_9855_2p },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  0x1000, 0x0022, 0, 0, netmos_9855_2p },
 	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
 	/* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
@@ -192,6 +206,12 @@ static struct pciserial_board pci_parpor
 		.uart_offset	= 8,
 	},
 	[netmos_9855] = {
+		.flags		= FL_BASE2 | FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[netmos_9855_2p] = {
 		.flags		= FL_BASE4 | FL_BASE_BARS,
 		.num_ports	= 1,
 		.base_baud	= 115200,


From abhaytayar at gmail.com  Mon Mar 23 06:35:09 2009
From: abhaytayar at gmail.com (Abhay Tayar)
Date: Mon, 23 Mar 2009 16:05:09 +0530
Subject: [Linux-parport] parport driver unable to detect hardware EPP
Message-ID: <82e00dcf0903230335t37135db5hddda3ec147c4dd0b@mail.gmail.com>

Hi,

I have written an application that communicates over EPP. It is well tested.
It fails on certain system and my investigation revealed that although EPP
is supported by the hardware, it is not showing up as one of the supported
modes of the parport driver.

I have 3 linux systems.
System A is 32 bit IBM machine with RHEL5 (kernel: 2.6.18-8.el5).
System B is 32 bit Dell machine with RHEL5 (kernel: 2.6.18-8.el5xen)
System C is 64 bit Dell machine with RHEL5 (kernel: 2.6.27.19-5-default)

All above systems has EPP selected in BIOS.
When I execute the code it runs fine on System A but does not run as
expected on System B and System C.

cat/proc/sys/dev/parport/parport0/modes on System A shows EPP,SPP,TRISTATE.
On system B and System C, EPP is not shown in the list.

How to figure out the parport driver version? I am not much of a linux guy.
I do not know what command to use for the same.
Does the parport driver have a installer? I tried looking up over the
internet but did not find any.
What should I do, so that the EPP is supported on System B and System C too?

Thanks,
Abhay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-parport/attachments/20090323/d420395d/attachment.html>

From leo at alaxarxa.net  Mon Mar 23 09:44:59 2009
From: leo at alaxarxa.net (Leopold Palomo-Avellaneda)
Date: Mon, 23 Mar 2009 14:44:59 +0100
Subject: [Linux-parport] parport driver unable to detect hardware EPP
In-Reply-To: <82e00dcf0903230335t37135db5hddda3ec147c4dd0b@mail.gmail.com>
References: <82e00dcf0903230335t37135db5hddda3ec147c4dd0b@mail.gmail.com>
Message-ID: <200903231444.59427.leo@alaxarxa.net>

A Dilluns 23 Mar? 2009, Abhay Tayar va escriure:
> Hi,
>
> I have written an application that communicates over EPP. It is well
> tested. It fails on certain system and my investigation revealed that
> although EPP is supported by the hardware, it is not showing up as one of
> the supported modes of the parport driver.
>
> I have 3 linux systems.
> System A is 32 bit IBM machine with RHEL5 (kernel: 2.6.18-8.el5).
> System B is 32 bit Dell machine with RHEL5 (kernel: 2.6.18-8.el5xen)
> System C is 64 bit Dell machine with RHEL5 (kernel: 2.6.27.19-5-default)
>
> All above systems has EPP selected in BIOS.
> When I execute the code it runs fine on System A but does not run as
> expected on System B and System C.
>
> cat/proc/sys/dev/parport/parport0/modes on System A shows EPP,SPP,TRISTATE.
> On system B and System C, EPP is not shown in the list.
>
> How to figure out the parport driver version? I am not much of a linux guy.
> I do not know what command to use for the same.
> Does the parport driver have a installer? I tried looking up over the
> internet but did not find any.
> What should I do, so that the EPP is supported on System B and System C
> too?

Hi,

probably you are doing the correct. The problem is that the parport driver is 
broken in the Dell boxes. I have not been able to use EPP mode in any of the 
Dell boxes that I have in the lab, and I can say you that we have several.

What to do? i don't know. If you have contact with the dell provider, press 
them to help to the linux kernel gurus to solve it. Also, you can look on 
this mail archive, and look for a mail that someones send me about it. It 
show me a method to solve this issue, but I tested it and it didn't work.

Regards,

Leo


From chripell at fsfe.org  Mon Mar 23 09:21:59 2009
From: chripell at fsfe.org (christian pellegrin)
Date: Mon, 23 Mar 2009 14:21:59 +0100
Subject: [Linux-parport] [PATCH] parport netmos 9845 & 9855 1P4S fixes
In-Reply-To: <20090323085024.GA8897@frolo.macqel>
References: <20090319181120.GA18034@frolo.macqel>
	<20090323085024.GA8897@frolo.macqel>
Message-ID: <cabda6420903230621k6ba147cqb055c724777dde6b@mail.gmail.com>

On Mon, Mar 23, 2009 at 9:50 AM, Philippe De Muyter <phdm at macqel.be> wrote:
> Hello list,
>

Hi,

> Christian, can you verify that the patch below works for your
> netmos 9855 2P2S board ?

I compiled a kernel with this patch and I see both serial and both
parallel ports in dmesg. I tested the serial ports and they work.
Unfortunately I don't have any device around to test the parallel
ports. You know, USB killed the pport stars.

> Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S,
> and works only by side-effect for the first parallel port of a 2P2S,

sorry for that, I didn't know about the 1P4S version. This is the
reason why I changed netmos9855 entry directyl.

-- 
Christian Pellegrin, see http://www.evolware.org/chri/
"Real Programmers don't play tennis, or any other sport which requires
you to change clothes. Mountain climbing is OK, and Real Programmers
wear their climbing boots to work in case a mountain should suddenly
spring up in the middle of the computer room."


From phdm at macqel.be  Mon Mar 23 09:52:58 2009
From: phdm at macqel.be (Philippe De Muyter)
Date: Mon, 23 Mar 2009 14:52:58 +0100
Subject: [Linux-parport] [PATCH] parport netmos 9845 & 9855 1P4S fixes
In-Reply-To: <cabda6420903230621k6ba147cqb055c724777dde6b@mail.gmail.com>
References: <20090319181120.GA18034@frolo.macqel>
	<20090323085024.GA8897@frolo.macqel>
	<cabda6420903230621k6ba147cqb055c724777dde6b@mail.gmail.com>
Message-ID: <20090323135258.GA25840@frolo.macqel>

On Mon, Mar 23, 2009 at 02:21:59PM +0100, christian pellegrin wrote:
> On Mon, Mar 23, 2009 at 9:50 AM, Philippe De Muyter <phdm at macqel.be> wrote:
> > Hello list,
> >
> 
> Hi,
> 
> > Christian, can you verify that the patch below works for your
> > netmos 9855 2P2S board ?
> 
> I compiled a kernel with this patch and I see both serial and both
> parallel ports in dmesg. I tested the serial ports and they work.

Thanks for your quick feedback.

> Unfortunately I don't have any device around to test the parallel
> ports. You know, USB killed the pport stars.

I only use parallel ports for hardware debuggers.

> 
> > Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S,
> > and works only by side-effect for the first parallel port of a 2P2S,
> 
> sorry for that, I didn't know about the 1P4S version. This is the
> reason why I changed netmos9855 entry directyl.

No problem.  I have not been affected.  I needed to fix the 9845 1P4S
support, but as I have also a computer with a 9855 1P4S, I did some
code inspection there also and found your change.

Have a nice day

Philippe


From phdm at macqel.be  Mon Mar 23 10:00:05 2009
From: phdm at macqel.be (Philippe De Muyter)
Date: Mon, 23 Mar 2009 15:00:05 +0100
Subject: [Linux-parport] [PATCH] parport netmos 9845 & 9855 1P4S fixes
In-Reply-To: <20090323085024.GA8897@frolo.macqel>
References: <20090319181120.GA18034@frolo.macqel>
	<20090323085024.GA8897@frolo.macqel>
Message-ID: <20090323140005.GB25840@frolo.macqel>

Hello list,

The same patch, with an additional Tested-by, after the positive feedback
of Christian Pellegrin.

Philippe

--

netmos serial/parallel adapters come in different flavour differing only
by the number of parallel and serial ports, which are encoded in the
subdevice ID.

Last fix of Christian Pellegrin for 9855 2P2S broke support for 9855 1P4S,
and works only by side-effect for the first parallel port of a 2P2S,
as this first parallel port is found by reading the second addr entry of
(struct parport_pc_pci) cards[netmos_9855], which is not initialized, and
hence has value 0, which happens to be the BAR of the first parallel port.

netmos_9xx5_combo entry in (struct parport_pc_pci) cards[], which is used
for a 9845 1P4S must also be fixed for the parallel port support when there
are 4 serial ports because this entry currently gives 2 as BAR index for
the parallel port.  Actually, in this case, BAR 2 is the 3rd serial port
while the parallel port is at BAR 4.

I fixed 9845 1P4S and 9855 1P4S support, while preserving 9855 2P2S support,
- by creating a netmos_9855_2p entry and using it for 9855 boards with
2 parallel ports : 9855 2P2S and 9855 2P0S boards,
- and by allowing netmos_parallel_init to change not only the number of
parallel ports (0 or 1), but making it also change the BAR index of the
parallel port when the serial ports are before the parallel port.

PS: the netmos_9855_2p entry in
(struct pciserial_board) pci_parport_serial_boards[] is needed because
netmos_parallel_init has no clean way to replace FL_BASE2 by FL_BASE4
in the description of the serial ports in function of the number of
parallel ports on the card.

Tested with 9845 1P4S, 9855 1P4S and 9855 2P2S boards.

Signed-off-by: Philippe De Muyter <phdm at macqel.be>
Tested-by: Christian Pellegrin <chripell at fsfe.org>

diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c
--- a/drivers/parport/parport_serial.c
+++ b/drivers/parport/parport_serial.c
@@ -30,6 +30,7 @@ enum parport_pc_pci_cards {
 	titan_210l,
 	netmos_9xx5_combo,
 	netmos_9855,
+	netmos_9855_2p,
 	avlab_1s1p,
 	avlab_1s2p,
 	avlab_2s1p,
@@ -62,7 +63,7 @@ struct parport_pc_pci {
 				struct parport_pc_pci *card, int failed);
 };
 
-static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *card, int autoirq, int autodma)
+static int __devinit netmos_parallel_init(struct pci_dev *dev, struct parport_pc_pci *par, int autoirq, int autodma)
 {
 	/* the rule described below doesn't hold for this device */
 	if (dev->device == PCI_DEVICE_ID_NETMOS_9835 &&
@@ -74,9 +75,17 @@ static int __devinit netmos_parallel_ini
 	 * and serial ports.  The form is 0x00PS, where <P> is the number of
 	 * parallel ports and <S> is the number of serial ports.
 	 */
-	card->numports = (dev->subsystem_device & 0xf0) >> 4;
-	if (card->numports > ARRAY_SIZE(card->addr))
-		card->numports = ARRAY_SIZE(card->addr);
+	par->numports = (dev->subsystem_device & 0xf0) >> 4;
+	if (par->numports > ARRAY_SIZE(par->addr))
+		par->numports = ARRAY_SIZE(par->addr);
+	/*
+	 * This function is currently only called for cards with up to
+	 * one parallel port.
+	 * Parallel port BAR is either before or after serial ports BARS;
+	 * hence, lo should be either 0 or equal to the number of serial ports.
+	 */
+	if (par->addr[0].lo != 0)
+		par->addr[0].lo = dev->subsystem_device & 0xf;
 	return 0;
 }
 
@@ -84,7 +93,8 @@ static struct parport_pc_pci cards[] __d
 	/* titan_110l */		{ 1, { { 3, -1 }, } },
 	/* titan_210l */		{ 1, { { 3, -1 }, } },
 	/* netmos_9xx5_combo */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
-	/* netmos_9855 */		{ 1, { { 2, -1 }, }, netmos_parallel_init },
+	/* netmos_9855 */		{ 1, { { 0, -1 }, }, netmos_parallel_init },
+	/* netmos_9855_2p */		{ 2, { { 0, -1 }, { 2, -1 }, } },
 	/* avlab_1s1p     */		{ 1, { { 1, 2}, } },
 	/* avlab_1s2p     */		{ 2, { { 1, 2}, { 3, 4 },} },
 	/* avlab_2s1p     */		{ 1, { { 2, 3}, } },
@@ -109,6 +119,10 @@ static struct pci_device_id parport_seri
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
 	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9845,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9xx5_combo },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  0x1000, 0x0020, 0, 0, netmos_9855_2p },
+	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
+	  0x1000, 0x0022, 0, 0, netmos_9855_2p },
 	{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9855,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, netmos_9855 },
 	/* PCI_VENDOR_ID_AVLAB/Intek21 has another bunch of cards ...*/
@@ -192,6 +206,12 @@ static struct pciserial_board pci_parpor
 		.uart_offset	= 8,
 	},
 	[netmos_9855] = {
+		.flags		= FL_BASE2 | FL_BASE_BARS,
+		.num_ports	= 1,
+		.base_baud	= 115200,
+		.uart_offset	= 8,
+	},
+	[netmos_9855_2p] = {
 		.flags		= FL_BASE4 | FL_BASE_BARS,
 		.num_ports	= 1,
 		.base_baud	= 115200,

-- 
Philippe De Muyter  phdm at macqel dot be  Tel +32 27029044
Macq Electronique SA  rue de l'Aeronef 2  B-1140 Bruxelles  Fax +32 27029077


From parport at baker-net.org.uk  Mon Mar 23 16:22:14 2009
From: parport at baker-net.org.uk (Adam Baker)
Date: Mon, 23 Mar 2009 20:22:14 +0000
Subject: [Linux-parport] parport driver unable to detect hardware EPP
In-Reply-To: <200903231444.59427.leo@alaxarxa.net>
References: <82e00dcf0903230335t37135db5hddda3ec147c4dd0b@mail.gmail.com>
	<200903231444.59427.leo@alaxarxa.net>
Message-ID: <200903232022.14543.parport@baker-net.org.uk>

On Monday 23 March 2009, Leopold Palomo-Avellaneda wrote:

> Hi,
>
> probably you are doing the correct. The problem is that the parport driver
> is broken in the Dell boxes. I have not been able to use EPP mode in any of
> the Dell boxes that I have in the lab, and I can say you that we have
> several.

I've seen the same issue here on an non Dell machine (Asus A7V333 
motherboard).

>
> What to do? i don't know. If you have contact with the dell provider, press
> them to help to the linux kernel gurus to solve it. Also, you can look on
> this mail archive, and look for a mail that someones send me about it. It
> show me a method to solve this issue, but I tested it and it didn't work.
>
In my case the problem is caused by the code chunk


        /* 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;
                        }
                }
        }

in the file drivers/parport/parport_pc.c. If you comment out that chunk of 
code it is detected correctly.

This code exists to check for a fault in a very old Intel chipset but I 
haven't been able to track down exactly what hardware it affects. Given 
enough users who report that the test is broken on modern hardware it could 
likely be removed but there don't seem to be enough people using EPP mode to 
care any more.

Adam Baker


