[sane-devel] Re: umax_pp works well with "port 0x378" bot not with "/dev/parport0"

stef svoltz@wanadoo.fr
Wed, 22 Oct 2003 21:48:44 +0000


On Wed, Oct 22, 2003 at 06:54:46PM +0200, Sven Hergenhahn wrote:
> Hi Stef,
> 
> sorry, some of the recent mails from this list didn't make it into my mailbox.
> 
> > Could apply the following patch to 
> >linux-2.4.21/drivers/parport/parport_pc.c, rebuild and install modules, then 
> >reboot.
> >I'd like to know what the message 'Parallel port printer control=xx' reports. 
> >You
> >should get it with 'dmesg | grep "Parallel"'.
> 
> Can you please give me a short introduction how to do this?
> I have compiled my Kernel, but so far didn't apply any patches, sorry.
> 
> Thanks,
> Sven
> 

	Hello,

	well, I don't think I can explain better than the man page of the
'patch' command. But here's how to patch the parport_pc.c file. This file
is in the drivers/parport subdirectory of the kernel sources. In a command
shell, cd to this directory. 
	There edit new file 'patch_file'. Cut and paste the folling lines
in it:

--- parport_pc.c-stock  2003-10-22 21:26:55.000000000 +0200
+++ parport_pc.c        2003-10-22 21:28:35.000000000 +0200
@@ -2577,7 +2577,9 @@

        /* 0xF0_5: EPP+ECP enable */
        outb (0xF0, 0x3F0);
-       have_eppecp = (inb (0x3F1) & (1 << 5));
+       tmp=inb (0x3F1);
+       printk (KERN_INFO "Parallel port printer control=%02X\n",tmp);
+       have_eppecp = (tmp & (1 << 5));

        /*
         * lock super i/o configuration, clear 0x85_1


	I know it exists a way to put patch in a file so they apply regardless
their context (in a middle of mail for instance...), but don't know to achieve
 this.
 	Now we have a 'patch_file'. Do 'patch <patch_file', this will modify 
parport_pc.c . Now, you only need to rebuild and install the modules (if parport
 is configured as a modules).

	The aim is to know what value the "Parallel port printer control
register" holds. There are 2 bits in it which could be related to the trouble
you get.

Regards,
	Stef