plustek@linuxhacker.org

plustek@linuxhacker.org


Subject: Re: pt_drv doesn't load with kernel 2.4
From: Jaeger, Gerhard
Date: Fri, 10 Nov 2000 09:04:16 +0100

On Die, 07 Nov 2000, Luc Stepniewski wrote:
> "Jaeger, Gerhard" wrote:
> 
> > Anyway, add the code below to the file sysdep-2.1.h, recompile it and the
> > driver should load:
> 
> Thanks ! It now compiles, and it get nearly loaded :-)
> I don't know why but it seems the loading fails as when I do an
> lsmod, pt_drv isn't there. I've well loaded parport and parport_pc:
> 
> 0x378: FIFO is 16 bytes
> 0x378: writeIntrThreshold is 16
> 0x378: readIntrThreshold is 16
> 0x378: PWord is 8 bits
> 0x378: Interrupts are ISA-Pulses
> 0x378: ECP port cfgA=0x10 cfgB=0x48
> 0x378: ECP settings irq=7 dma=<none or set by other means>
> parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE,COMPAT,EPP,ECP]
> parport0: irq 7 detected
> parport0: cpp_daisy: aa5500ff(28)
> parport0: assign_addrs: aa5500ff(28)
> parport0: cpp_daisy: aa5500ff(28)
> parport0: assign_addrs: aa5500ff(28)
> 
> And when I insmod pt_drv, I get the following in dmesg:
> 
> pt_drv : driver version = 0.36-36
> 
> And in stderr:
> 
> root@eurythro:enlight# insmod pt_drv
> Using /lib/modules/2.4.0-test9/misc/pt_drv.o
> /lib/modules/2.4.0-test9/misc/pt_drv.o: init_module: Success
> Hint: insmod errors can be caused by incorrect module parameters,
> including invalid IO or IRQ parameters
> 
> I've followed the INSTALL file (added the lines in the modules.conf)
> and I tried to add the port=0x378 with insmod, it gives the
> same thing :-(
> 
> With the debug option enabled, I get the following:
> 
> *********************************************
> pt_drv: init_module()
> pt_drv : driver version = 0.36-36
> ptdrvInit(0)
> Init settings done
> ScanData = 0xc6650000
> Requested port at 0x378
> Requested port (0x378) found
> Port mode reported: (0x005f)
> Port for device 0 registered
> ptdrvOpen(port=0x378)
> Try to claim the parport
> Using EPP-mode
> Starting Scanner-Autodetection
> ************ DETECTP48xx ************
> ModelSet4800()
> modelInitPageSettings()
> A4 set
> ModelSet4800() done.
> P48xxInitAsic()
> DacInitialize()
> ImageInitialize()
> IOInitialize()
> MotorInitialize()
> Dataport = 0x0378
> Ctrlport = 0x037a
> Test 0x55
> Test 0xAA
> Compare data=0x6f and status=0xf, port=0x378
> p48xxReadWriteTest()
> Found a 96003 ASIC at Reg 0x13
> ModelSet4830()
> modelInitPageSettings()
> A4 set
> ModelSet4830() done.
> p48xxDoTest()
> Bank 0 overwritten
> found 0 bytes of memory
> No memory ! No scanner...
> detectScannerConnection() returns -9020.
> ************ DETECTP9636 ************
> ModelSet9636()
> ModelSet9360()
> modelInitPageSettings()
> A4 set
> ModelSet9630() done.
> modelInitPageSettings()
> A4 set
> ModelSet9636() done.
> P9636InitAsic()
> DacInitialize()
> ImageInitialize()
> IOInitialize()
> MotorInitialize()
> AsicID = 0xf0
> ptdrvClose()
> MiscRestorePort()
> - no need to restore portmode !
> Releasing parport
> ptdrvShutdown()
> cleanup device 0
> Lamp-Timer stopped !
> Try to claim the parport
> Releasing parport
> Port unregistered
> pt_drv: init failed - ret = -9020
> ---------------------------------------------
> 
> 
> I tried with mov=0 1 2 3 and 4, giving the same error.
> BTW, my scanner is a 9630P. Maybe I should have told you before !
> Maybe I'm stupid and should have read the source, this scanner 
> may not be supported ?
> 
> Thanks a lot,
> Luc
> -- 
> Luc Stepniewski <lstep@adequat.net> <http://lstep.free.fr/>
> Adequat - Securite, Linux     Public key: <http://lstep.free.fr/pubkey.txt>
> Key D93B2D2D fingerprint = 49 00 CC D1 69 03 E2 94  C8 78 ED 3C 75 89 A8 DE

Hi Luc,

well first of all you're not stupid! The OP9630P is supported, as I have 
this device at home. Well the problem is, that the communication seems
to be disturbed (the driver says "0 bytes of memory" !!!).

Try this:
Please search for the file backend/plustek_driver/h/plustek_scan.h
there you'll find the following lines (starting at line 79 or so):

/*.............................................................................
 * for port operations
 */
#if 0

Replace the #if 0 by #if 1, then recompile the driver, reinstall
and try to reload.
It seems, that I have activated the alternative functions to access
the parport by mistake and so the driver uses the parport functions
rather than the in/out functions. It seems, that this leads into
trouble with kernel 2.4

Gerhard

BTW: Please send your requests and answers to the mailing list, so I'm
able to reply even from home and others have the chance to contribute.

plustek@linuxhacker.org