LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Scanjet 5100c in Kubuntu Feisty (https://www.linuxquestions.org/questions/linux-hardware-18/scanjet-5100c-in-kubuntu-feisty-555861/)

broxtor 05-22-2007 02:37 PM

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.

haydnc 06-02-2007 12:52 AM

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.

broxtor 06-02-2007 01:26 AM

Thank you very much! This did the trick. I got it to work now!

jimbo54321 07-06-2007 02:09 PM

hi all.

what do you mean in number 6 and run make

broxtor 07-06-2007 04:40 PM

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.

jimbo54321 07-07-2007 12:24 AM

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

haydnc 07-08-2007 01:37 PM

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.

labyrinthH5 08-19-2007 12:39 PM

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

hrossm 08-30-2007 03:45 AM

Worked for me (Kubuntu 7.04)
 
No problems at all,
Many thanks for this post, it was just what I was looking for,
Ross

peterlowrie 01-23-2010 11:05 PM

Quote:

Originally Posted by haydnc (Post 2771928)
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

haydnc 01-25-2010 03:42 AM

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.

peterlowrie 01-25-2010 02:30 PM

Quote:

Originally Posted by haydnc (Post 3839524)
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

haydnc 01-25-2010 06:05 PM

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.


All times are GMT -5. The time now is 05:50 PM.