LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices



Reply
 
Search this Thread
Old 05-22-2007, 03:37 PM   #1
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Debian Squeeze AMD64
Posts: 94

Rep: Reputation: 16
Scanjet 5100c in Kubuntu Feisty


I had my HP Scanjet 5100c scanner working in Kubuntu Dapper (2.6.17) by compiling the ppscsi modules. Now, I recently upgraded to Feisty (2.6.20) and now I'm having problems to get my scanner to work again. I tried using the same modules I compiled for Dapper (ppscsi and epst), but that won't work. So I tried to compile new ones, but that doesn't work either. Apperently since kernel 2.6.19 linux/config.h does no longer exist in the linux headers and I do need that to compile the modules. I tried to workaround this bij doing a "ln -s autoconf.h config.h" in the /usr/src/linux-headers-'uname -r'/include/linux/ folder. That is a solution for one error I get during building, but I also get another error of which I don't know how to solve it.
The output is as follows:
Code:
make -C /lib/modules/`uname -r`/build M=`pwd` modules
make[1]: Map '/usr/src/linux-headers-2.6.20-15-generic' wordt binnengegaan
  CC [M]  /usr/src/ppscsi-beta2/ppscsi.o
/usr/src/ppscsi-beta2/ppscsi.c:1148:39: fout: macro "INIT_WORK" kreeg 3 argumenten, maar heeft er slechts 2 nodig
/usr/src/ppscsi-beta2/ppscsi.c: In functie ‘ppsc_detect’:
/usr/src/ppscsi-beta2/ppscsi.c:1148: fout: ‘INIT_WORK’ undeclared (first use in this function)
/usr/src/ppscsi-beta2/ppscsi.c:1148: fout: (Each undeclared identifier is reported only once
/usr/src/ppscsi-beta2/ppscsi.c:1148: fout: for each function it appears in.)
make[2]: *** [/usr/src/ppscsi-beta2/ppscsi.o] Fout 1
make[1]: *** [_module_/usr/src/ppscsi-beta2] Fout 2
make[1]: Map '/usr/src/linux-headers-2.6.20-15-generic' wordt verlaten
make: *** [all] Fout 2
For the none Dutch folks: It complaints about INIT_WORK that gets 3 arguments, although it needs only two. Does someone know how to fix this? I read that the ppscsi modules are no longer maintained, so waiting for a new version doesn't seem to be an option.
 
Old 06-02-2007, 01:52 AM   #2
haydnc
LQ Newbie
 
Registered: Jun 2007
Posts: 12

Rep: Reputation: 0
I just put these instructions together today after struggling through this exact problem on my Ubuntu Feisty setup. I think they should work equally well for Kubuntu.

I have managed to get ppscsi to work properly in feisty. I'm posting the full instructions I've typed up here for anyone else who stumbles across them. The individual parts of this all exist out there on the net, but I've not found anywhere that puts the whole lot together, so here goes:

How to make a HP ScanJet 5100/5200C work with (K)Ubuntu? Feisty (Kernel 2.6.20)

1. Make sure that you have the kernel headers installed:

Code:
sudo apt-get install linux-headers-`uname -r`
2. Download the latest(?) version of ppscsi from http://penguin-breeder.org/kernel/download/ : ppscsi-beta2-20060424.tar.gz

3. Once downloaded extract the file:
tar zxvf ppscsi-beta2-20060424.tar.gz

This next bit is from translated instructions on the spanish Ubuntu website:

Quote:
When extracted and running make we get two significant errors as per the above website:

… /ppscsi-beta2/ppscsi.h: 16: 26: error: linux/config.h: The directory file does not exist or

… /ppscsi-beta2/ppscsi.c: 1148: 39: error: macro “INIT_WORK” received 3 arguments, but it only took 2

Analysis:

The file linux/config.h this obsolete and macro “INIT_WORK” at the moment receives two arguments.

That is to say, the file config.h is replaced at the moment by the file autoconf.h
Solution:

4. Open ppscsi.h in the editing program of your choice.
Change the where it says #include <linux/config.h> to read #include <linux/autoconf.h>
This is on line 16 of the copy of ppscsi.h that I'm working with.

5. Save and close ppscsi.h and open ppscsi.c

Change the following lines:
static void ppsc_tq_int (void *data)
change to
static void ppsc_tq_int (struct work_struct *data)
(Note: This is line 191 in the copy of ppscsi.c I'm working with)

INIT_WORK (&pha->wq, ppsc_tq_int, pha);

change to
INIT_WORK (&pha->wq, ppsc_tq_int);
(Note: This is line 1148 in the copy of ppscsi.c I'm working with)

6. Save and close ppscsi.c and run make. This should produce a set of .ko files, including the all important (to us anyway) ppscsi.ko and epst.ko.

7. Since the Makefile for ppscsi has no instructions for installing these files we need to copy them to their new location manually:
Code:
sudo cp ppscsi.ko epst.ko /lib/modules/`uname -r`/kernel/drivers/parport
8. Next we need to tell the kernel that they exist:
Code:
sudo depmod
9. Lastly we need to load the modules:
Code:
sudo modprobe ppscsi
sudo modprobe epst
This will make the scanner useable until next time the computer is rebooted.

In order to make sure that the scanner is recognised from the moment you boot up it is necessary to edit /etc/modules and add the following two lines to the end of the file:
Code:
ppscsi
epst
My apologies if this seems a little cluttered, but hopefully it should work as well for you as it did for me.
 
Old 06-02-2007, 02:26 AM   #3
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Debian Squeeze AMD64
Posts: 94

Original Poster
Rep: Reputation: 16
Thumbs up

Thank you very much! This did the trick. I got it to work now!
 
Old 07-06-2007, 03:09 PM   #4
jimbo54321
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Rep: Reputation: 0
hi all.

what do you mean in number 6 and run make
 
Old 07-06-2007, 05:40 PM   #5
broxtor
Member
 
Registered: Jul 2003
Location: The Netherlands
Distribution: Debian Squeeze AMD64
Posts: 94

Original Poster
Rep: Reputation: 16
Hi Jimbo,

This means that you have to open a terminal (e.g. konsole) and cd to the folder where you extracted the source (after you ran through steps 1 to 5). Then in the terminal type "make" (without quotes, or sudo make in case the directory is writeable for your current user). This will compile the neccesary binaries. After that continu with step 7.
 
Old 07-07-2007, 01:24 AM   #6
jimbo54321
LQ Newbie
 
Registered: Jul 2007
Posts: 2

Rep: Reputation: 0
cheers, it works a treat,

switched from m$ about 6 weeks ago now and this was the last real reason i booted into m$ regularly.

BYE BYE BILL he he

do i need to keep the ppscsi-beta2 folder now and does it need to stay in same place or is it no longer needed.

also dont have a clue what i've just done and am eager to learn. i have read most areas on the ubuntu official pages and on ubuntu wiki. is there any decent sites to visit to help us noobs

thanks again

jimbo

Last edited by jimbo54321; 07-07-2007 at 01:46 AM.
 
Old 07-08-2007, 02:37 PM   #7
haydnc
LQ Newbie
 
Registered: Jun 2007
Posts: 12

Rep: Reputation: 0
Hi Jimbo.

You no longer need the ppscsi-beta2 folder as in step 7 you copied the files you created into the modules folder for your kernel.

Keep hold of the instructions and the original source files though as you'll probably need to repeat this whole process next time a major update to the kernel comes out.
 
Old 08-19-2007, 01:39 PM   #8
labyrinthH5
LQ Newbie
 
Registered: Aug 2007
Posts: 1

Rep: Reputation: 0
Hello, there!

Up to modprobing, everything works fine for me.

I can modprobe ppscsi without a problem, but not epst:

Quote:
FATAL: Error inserting epst (/lib/modules/2.6.20-16-generic/kernel/drivers/parport/epst.ko): No such device
The file does exist, though:

Quote:
installateur@hans-desktop:/etc/sane.d$ ls -la /lib/modules/2.6.20-16-generic/kernel/drivers/parport/
insgesamt 520
drwxr-xr-x 2 root root 4096 2007-08-19 19:27 .
drwxr-xr-x 44 root root 4096 2007-08-18 16:00 ..
-rw-r--r-- 1 root root 190777 2007-08-19 19:27 epst.ko
-rw-r--r-- 1 root root 11292 2007-06-07 22:59 parport_ax88796.ko
-rw-r--r-- 1 root root 8224 2007-06-07 22:59 parport_cs.ko
-rw-r--r-- 1 root root 45104 2007-06-07 22:59 parport.ko
-rw-r--r-- 1 root root 48048 2007-06-07 22:59 parport_pc.ko
-rw-r--r-- 1 root root 12184 2007-06-07 22:59 parport_serial.ko
-rw-r--r-- 1 root root 186418 2007-08-19 19:27 ppscsi.ko
Why does modprobe say "No such DEVICE", anyway?

Can you help me here?

Thank you and thanks for the howto!

Klaus
 
Old 08-30-2007, 04:45 AM   #9
hrossm
LQ Newbie
 
Registered: Aug 2007
Posts: 6

Rep: Reputation: 0
Smile Worked for me (Kubuntu 7.04)

No problems at all,
Many thanks for this post, it was just what I was looking for,
Ross
 
Old 01-24-2010, 12:05 AM   #10
peterlowrie
Member
 
Registered: May 2009
Location: New Zealand
Distribution: mdv-x86/aurora-sparc64/solaris10-x86/solaris10-sparc
Posts: 42

Rep: Reputation: 15
Quote:
Originally Posted by haydnc View Post
I just put these instructions together today after struggling through this exact problem on my Ubuntu Feisty setup. I think they should work equally well for Kubuntu.

I have managed to get ppscsi to work properly in feisty. I'm posting the full instructions I've typed up here for anyone else who stumbles across them. The individual parts of this all exist out there on the net, but I've not found anywhere that puts the whole lot together, so here goes:

How to make a HP ScanJet 5100/5200C work with (K)Ubuntu? Feisty (Kernel 2.6.20)

1. Make sure that you have the kernel headers installed:

Code:
sudo apt-get install linux-headers-`uname -r`
2. Download the latest(?) version of ppscsi from http://penguin-breeder.org/kernel/download/ : ppscsi-beta2-20060424.tar.gz

3. Once downloaded extract the file:
tar zxvf ppscsi-beta2-20060424.tar.gz

This next bit is from translated instructions on the spanish Ubuntu website:



Solution:

4. Open ppscsi.h in the editing program of your choice.
Change the where it says #include <linux/config.h> to read #include <linux/autoconf.h>
This is on line 16 of the copy of ppscsi.h that I'm working with.

5. Save and close ppscsi.h and open ppscsi.c

Change the following lines:
static void ppsc_tq_int (void *data)
change to
static void ppsc_tq_int (struct work_struct *data)
(Note: This is line 191 in the copy of ppscsi.c I'm working with)

INIT_WORK (&pha->wq, ppsc_tq_int, pha);

change to
INIT_WORK (&pha->wq, ppsc_tq_int);
(Note: This is line 1148 in the copy of ppscsi.c I'm working with)

6. Save and close ppscsi.c and run make. This should produce a set of .ko files, including the all important (to us anyway) ppscsi.ko and epst.ko.

7. Since the Makefile for ppscsi has no instructions for installing these files we need to copy them to their new location manually:
Code:
sudo cp ppscsi.ko epst.ko /lib/modules/`uname -r`/kernel/drivers/parport
8. Next we need to tell the kernel that they exist:
Code:
sudo depmod
9. Lastly we need to load the modules:
Code:
sudo modprobe ppscsi
sudo modprobe epst
This will make the scanner useable until next time the computer is rebooted.

In order to make sure that the scanner is recognised from the moment you boot up it is necessary to edit /etc/modules and add the following two lines to the end of the file:
Code:
ppscsi
epst
My apologies if this seems a little cluttered, but hopefully it should work as well for you as it did for me.
I dunno what I've done wrong. I followed your instructions and I still got these errors:
Code:
/home/peter/Download/ppscsi-beta2/ppscsi.c: In function 'ppsc_start':
/home/peter/Download/ppscsi-beta2/ppscsi.c:425: error: 'struct scsi_cmnd' has no member named 'use_sg'
/home/peter/Download/ppscsi-beta2/ppscsi.c:428: error: 'struct scsi_cmnd' has no member named 'request_buffer'
/home/peter/Download/ppscsi-beta2/ppscsi.c:434: error: 'struct scsi_cmnd' has no member named 'request_bufflen'
/home/peter/Download/ppscsi-beta2/ppscsi.c: In function 'ppsc_update_sg':
/home/peter/Download/ppscsi-beta2/ppscsi.c:486: error: 'struct scatterlist' has no member named 'page'
/home/peter/Download/ppscsi-beta2/ppscsi.c: In function 'ppsc_engine':
/home/peter/Download/ppscsi-beta2/ppscsi.c:568: error: 'struct scsi_cmnd' has no member named 'use_sg'
/home/peter/Download/ppscsi-beta2/ppscsi.c:572: error: 'struct scsi_cmnd' has no member named 'request_buffer'
/home/peter/Download/ppscsi-beta2/ppscsi.c:573: error: 'struct scatterlist' has no member named 'page'
/home/peter/Download/ppscsi-beta2/ppscsi.c:576: error: 'struct scsi_cmnd' has no member named 'request_buffer'
/home/peter/Download/ppscsi-beta2/ppscsi.c:577: error: 'struct scsi_cmnd' has no member named 'request_bufflen'
/home/peter/Download/ppscsi-beta2/ppscsi.c:623: error: 'struct scsi_cmnd' has no member named 'request_buffer'
/home/peter/Download/ppscsi-beta2/ppscsi.c: In function 'ppsc_cleanup':
/home/peter/Download/ppscsi-beta2/ppscsi.c:818: error: 'struct scsi_cmnd' has no member named 'use_sg'
/home/peter/Download/ppscsi-beta2/ppscsi.c:819: error: 'struct scsi_cmnd' has no member named 'request_buffer'
/home/peter/Download/ppscsi-beta2/ppscsi.c:820: error: 'struct scsi_cmnd' has no member named 'request_bufflen'
/home/peter/Download/ppscsi-beta2/ppscsi.c: In function 'ppsc_inquire':
/home/peter/Download/ppscsi-beta2/ppscsi.c:1017: error: 'struct scsi_cmnd' has no member named 'use_sg'
/home/peter/Download/ppscsi-beta2/ppscsi.c:1018: error: 'struct scsi_cmnd' has no member named 'request_buffer'
/home/peter/Download/ppscsi-beta2/ppscsi.c:1019: error: 'struct scsi_cmnd' has no member named 'request_bufflen'
make[2]: *** [/home/peter/Download/ppscsi-beta2/ppscsi.o] Error 1
make[1]: *** [_module_/home/peter/Download/ppscsi-beta2] Error 2
Does anyone know why the proposed editions work for others but not for me?

Has anyone got a clue as to how to make the rest of this go away so the ko files compile properly?

Thank you for your indulgence.

:-( Peter
 
Old 01-25-2010, 04:42 AM   #11
haydnc
LQ Newbie
 
Registered: Jun 2007
Posts: 12

Rep: Reputation: 0
Hi Peter,

Things have changed quite a bit since I originally posted those instructions. In fact every time a new version of Ubuntu was released - something broke.

What version of Kubuntu are you running? I'll see if I can dig up the correct fix for you.
 
Old 01-25-2010, 03:30 PM   #12
peterlowrie
Member
 
Registered: May 2009
Location: New Zealand
Distribution: mdv-x86/aurora-sparc64/solaris10-x86/solaris10-sparc
Posts: 42

Rep: Reputation: 15
Quote:
Originally Posted by haydnc View Post
Hi Peter,

Things have changed quite a bit since I originally posted those instructions. In fact every time a new version of Ubuntu was released - something broke.

What version of Kubuntu are you running? I'll see if I can dig up the correct fix for you.
Geewhiz

Thanks for replying so soon. I am actually not using ubuntu at all because it breaks too often. My distro of choice is Sun Solaris, but for this exercise it's Mandriva.

What I have noticed already is the ppscsi, epst and others are built into these later linux versions. Thus, I thort, no need to DL, compile and install any other drivers. Oh boy, I've tried and tried.

The parts of lsmod that matter are:

parport 34924 3 ppscsi,ppdev,parport_pc
sd_mod 37912 7
scsi_mod 138188 7 sg,epst,ppscsi,sr_mod,usb_storage,libata,sd_mod

...and still my scanner won't work. modprobe.conf looks like this:

Code:
[root@icute peter]# cat etc/modprobe.conf                                                                                           
install snd-via82xx-modem /bin/true                                                                                                  
install snd-intel8x0m /bin/true                                                                                                      
install snd-atiixp-modem /bin/true                                                                                                   
alias /dev/ttySHCF[0-9]* /dev/ttySHCF                                                                                                
alias char-major-244 /dev/ttySHCF                                                                                                    
alias char-major-244-* /dev/ttySHCF                                                                                                  
options hcfpciserial serialmajor=244                                                                                                 
alias /dev/hcfpcidiag hcfpciosspec                                                                                                   
alias /dev/hcfpcidiag* /dev/hcfpcidiag                                                                                               
alias char-major-246 /dev/hcfpcidiag                                                                                                 
alias char-major-246-* /dev/hcfpcidiag                                                                                               
options hcfpciosspec diagmajor=246                                                                                                   
install /dev/ttySHCF /sbin/modprobe hcfpcihw; /bin/true
# install /dev/parport0 /sbin/modprobe scsi_mod sg parport parport_pc ppscsi epst
# install /dev/parport0 /sbin/modprobe sg
# install /dev/parport0 /sbin/modprobe parport
# install /dev/parport0 /sbin/modprobe parport_pc
# install /dev/parport0 /sbin/modprobe ppscsi
# install /dev/parport0 /sbin/modprobe epst

alias /dev/ttySHSF[0-9]* /dev/ttySHSF
alias /dev/modem /dev/ttySHSF
alias char-major-240 /dev/ttySHSF
alias char-major-240-* /dev/ttySHSF
options hsfserial serialmajor=240
alias char-major-242 hsfosspec
alias char-major-242-* hsfosspec
alias /dev/hsfdiag hsfosspec
alias /dev/hsfdiag* /dev/hsfdiag
alias char-major-243 /dev/hsfdiag
alias char-major-243-* /dev/hsfdiag
options hsfosspec dcpmajor=242 diagmajor=243
install /dev/ttySHSF /sbin/modprobe hsfpcibasic2; /sbin/modprobe hsfpcibasic3; /sbin/modprobe hsfmc97ich; /sbin/modprobe hsfmc97via; /sbin/modprobe hsfmc97ali; /sbin/modprobe hsfmc97ati; /sbin/modprobe hsfmc97sis; [ -e /lib/modules/`uname -r`/extra/hsfusbcd2.ko ] && /sbin/modprobe hsfusbcd2; /sbin/modprobe snd_hda_intel; /bin/true
alias symbol:cnxthwhda_probe hsfhda
alias symbol:cnxthwhda_resume hsfhda
alias symbol:cnxthwhda_suspend hsfhda
and modules.conf like so...

Code:
[root@icute peter]# cat /etc/modules.conf                                                                                            
alias /dev/ttySHCF[0-9]* /dev/ttySHCF                                                                                                
alias /dev/modem /dev/ttySHCF                                                                                                        
alias char-major-244 /dev/ttySHCF                                                                                                    
alias /dev/cuaHCF[0-9]* /dev/ttySHCF                                                                                                 
alias char-major-245 /dev/ttySHCF                                                                                                    
options hcfpciserial serialmajor=244 calloutmajor=245
alias /dev/hcfpcidiag hcfpciosspec
alias /dev/hcfpcidiag* /dev/hcfpcidiag
alias char-major-246 /dev/hcfpcidiag
options hcfpciosspec diagmajor=246
probeall /dev/ttySHCF hcfpcihw
# /sbin/modprobe scsi_mod
# /sbin/modprobe sg
# /sbin/modprobe parport
# /sbin/modprobe parport_pc
# /sbin/modprobe ppscsi
# /sbin/modprobe epst
post-install parport modprobe parport_pc; modprobe epst; modprobe ppscsi;

alias /dev/ttySHSF[0-9]* /dev/ttySHSF
alias /dev/modem /dev/ttySHSF
alias char-major-240 /dev/ttySHSF
alias /dev/cuaHSF[0-9]* /dev/ttySHSF
alias char-major-241 /dev/ttySHSF
options hsfserial serialmajor=240 calloutmajor=241
alias char-major-242 hsfosspec
alias /dev/hsfdiag hsfosspec
alias /dev/hsfdiag* /dev/hsfdiag
alias char-major-243 /dev/hsfdiag
options hsfosspec dcpmajor=242 diagmajor=243
probeall /dev/ttySHSF hsfpcibasic2 hsfpcibasic3 hsfmc97ich hsfmc97via hsfmc97ali hsfmc97ati hsfmc97sis hsfusbcd2 snd_hda_intel
IE, nothing about it in either of those files, except, as you can see, my blathering blunders commented out. Eeek, what am I to do, I've been on this for two weeks! The only mention of these drivers' installation is in /etc/modprobe.preload:

Code:
epst
nvidia_agp
evdev
...hey, that gives me an idea. What is your take on this sorry situation?

Bless you
Peter
 
Old 01-25-2010, 07:05 PM   #13
haydnc
LQ Newbie
 
Registered: Jun 2007
Posts: 12

Rep: Reputation: 0
Unfortunately I've only been looking into the problems with ppscsi / epst from the Ubuntu angle, and being nothing of a programmer doing a rather poor job of it all told at that.

Mostly I've been compiling in a central location the verious solutions people have come up with to make a ScanJet 5100C work for others like me who don't want to get rid of a perfectly good scanner just because someone seems to have decided that parallel port scanning doesn't really need to be supported any more.

Because of the limits that sets on what I actually know - I can't look at your code dump and figure out why it isn't working.

That said, since the base code behind modern kernels is more or less the same, whatever OS is built on top of it, its possible that the solution that currently works for me might work for you:

The first thing to try is taking the latest patched version of ppscsi from here.

Unpack the archive:
tar -zxvf ppscsi-patched-karmic.tar.gz

Change to the extracted directory:
cd ppscsi-beta2

Compile the source code:
make

Then either switch to root (su) or type each of the following commands in super user mode:
# cp ppscsi.ko epst.ko /lib/modules/`uname -r`/kernel/drivers/parport
# depmod -a
# modprobe ppscsi
# modprobe epst

With luck that'll fix up the problems you're having.

Hopefully that makes some sense to you - and even more hopefully it'll help.

I should note that the thanks for the latest instructions go to tcsoft who posted them in his blog here. He in turn thanks others who've posted in the ongoing thread I have on this topic here.

The file download above has already had all the patches applied to it so you don't need to mess around with those - just download and build it then install as per the instructions.

Last edited by haydnc; 01-26-2010 at 01:25 AM.
 
  


Reply

Tags
configh, scanjet


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
upgrade to feisty (kubuntu), proxies... greenmuzz Ubuntu 0 05-03-2007 11:54 AM
Kubuntu Feisty - question about php and DB_DataObject dickgregory Ubuntu 3 04-24-2007 08:22 PM
LXer: Kubuntu 7.04 (Feisty Fawn) Released LXer Syndicated Linux News 0 04-20-2007 07:01 AM
Beryl install - Kubuntu Feisty and Nvidia btmiller Linux - Desktop 4 04-15-2007 05:08 AM
Scanjet 5100C under Slackware ! Cdzin Slackware 2 05-04-2006 01:25 PM


All times are GMT -5. The time now is 06:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration