Page 9 of 11 FirstFirst ... 7891011 LastLast
Results 81 to 90 of 103

Thread: HP Scanjet 5100C / ppscsi in Hardy

  1. #81
    Join Date
    Jun 2007
    Location
    Auckland, New Zealand
    Beans
    110
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HP Scanjet 5100C / ppscsi in Hardy

    I notice that there hasn't been any movement on this thread since before 10.10 came out and we're now into the era of 11.04 so I guess maybe it is time to mark this thread as closed/dead.

    I have finally ditched my old HP Scanjet 5100C in favour of a new Canon CanoScan LiDE 110 which works perfectly well out of the box with current versions of Ubuntu.

    Best of luck for anyone wanting to keep their 5100C alive but it is time for me to move on into the realm of more up-to-date hardware.

    If you're considering the purchase of a new scanner and you're unsure if it'll work in linux I suggest very strongly you check out the list of SANE compatible devices that can be found here: http://www.sane-project.org/sane-mfgs.html#SCANNERS. There is quite a large list of scanners there these days and they're clearly labelled which ones work and which ones don't.

    I hit the websites for my local hardware suppliers and checked the scanners that they had available then compared it to the list of compatible scanners and found one that I could afford that was on the list of working scanners.

  2. #82
    Join Date
    Jan 2006
    Beans
    51

    Re: HP Scanjet 5100C / ppscsi in Hardy

    Short answer: The scanner still works. At least on Gentoo. I think it might on 10.10, but since I skipped this release and I'm kind of busy working , I haven't gotten to test it on 11.04 yet.

    For the gentoo thread: http://forums.gentoo.org/viewtopic-t...-start-75.html

  3. #83
    Join Date
    Jun 2007
    Location
    Auckland, New Zealand
    Beans
    110
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: HP Scanjet 5100C / ppscsi in Hardy

    Hi kebajonathan, I did test my 5100C when I was using 10.10 and while the ppscsi code compiled and the modules appeared to load for reasons I don't understand my scanner refused to function.

    If others have managed to get it working on 10.10 and it was just me having bad luck, well let's just say it wouldn't be the first time I've had random things go wrong after an upgrade.

    As it happens for the first time in a very long time I had some money that I could call spare and I discovered that there were some very reasonably priced flatbed scanners on the SANE 'working' list so I decided to give up on the ongoing fight to keep my old parallel port scanner working and move on to a fully supported USB one. I also gave away the old scanner so I don't even have it for testing purposes any more which in hindsight is kind of sad, but it is much too late now.

    I guess there are probably still some people out there trying to keep the 5100C working in 10.10 or even 11.04, it's just that this thread used to see a fairly large number of posts following each new release and it went utterly quiet around the time 10.10 came out.

    It seemed like a logical assumption to make that since it hadn't worked at all for me since 10.04 that most of the regular visitors had given up and moved on to a friendlier low cost replacement.

    If you do manage to get your 5100C working successfully under 11.04 and you've time to post that confirmation here I guess there are probably people out there who'd love to know about it.

  4. #84
    Join Date
    Jan 2006
    Beans
    51

    Re: HP Scanjet 5100C / ppscsi in Hardy

    So the problem is this code:

    Code:
    struct scsi_host_template   driver_template = PPSC_TEMPLATE(onscsi);
    in t348.c:302, t358.c:378, onscsi.c:529, epsa2.c:492, epst.c:463, vpi0.c:261 and sparcsi.c:373 because it's (apparently) an "initialization from incompatible pointer type". This structure is declared in /usr/src/linux/include/scsi/libiscsi.h, /usr/src/linux/include/scsi/scsi_host.h and /usr/src/linux/drivers/scsi/scsi_priv.h

    When loading the modules, it produces a kernel panic, which explains the system freeze that can occur.

    I don't know how to fix this, as I'm no C programmer, but maybe someone here knows? That would be a great help...

  5. #85
    Join Date
    Jun 2011
    Beans
    2

    Re: HP Scanjet 5100C / ppscsi in Hardy

    I recently upgraded directly to Ubuntu 11.04 (Natty) from Ubuntu 10.04 (Lucid) and then started debugging this code as it no longer worked. I have a diff from ppscsi-patched-karmic.tar.gz posted by haydnc that compiles without errors or warnings for Ubuntu 11.04 (other than the stack frame bytes exceeding 1024 in function ppsc_inquire).

    $ diff ppscsi-beta2-karmic/ ppscsi-beta2-natty/
    diff ppscsi-beta2-karmic//ppscsi.c ppscsi-beta2-natty//ppscsi.c
    191c191
    < static void ppsc_tq_int (void *data)
    ---
    > static void ppsc_tq_int (struct work_struct *data)
    386c386
    < int ppsc_queuecommand (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
    ---
    > int ppsc_queuecommand (struct Scsi_Host *host, struct scsi_cmnd *cmd)
    388c388
    < PHA *pha = (PHA *) cmd->device->host->hostdata[0];
    ---
    > PHA *pha = (PHA *) host->hostdata[0];
    396c396
    < pha->done = done;
    ---
    > pha->done = cmd->scsi_done;
    1045d1044
    <
    1235c1234
    < hreg->unique_id = (int) pha; /* What should we put in here??? */
    ---
    > hreg->unique_id = (unsigned long)pha; /* What should we put in here??? */
    diff ppscsi-beta2-karmic//ppscsi.h ppscsi-beta2-natty//ppscsi.h
    16c16
    < #include <linux/autoconf.h>
    ---
    > #include <generated/autoconf.h>
    35c35
    < extern int ppsc_queuecommand(struct scsi_cmnd *, void (* done)(struct scsi_cmnd *));
    ---
    > extern int ppsc_queuecommand(struct Scsi_Host *, struct scsi_cmnd *);

    Although this diff patch compiles correctly for kernel 2.6.37 and above it still does not function correctly and it is not compatible with kernel 2.6.36 or lower due to the change in queuecommand for the structure scsi_host_template in the file /usr/src/linux/include/scsi/scsi_host.h, which is where the major difference is between Ubuntu 10.10 (maverick) and Ubuntu 11.04 (natty). In theory, the code modifications should work but fails to find the scanner in Simple Scan as it did in 10.04 (Lucid). I've since back tracked to Ubuntu 10.10 (maverick) and found that the kernel version for that distro does not work either even though the diff changes are very simple requiring only the path to autoconf.h to change. I am guessing whatever failed in 10.10 (maverick) is also the same problem with 11.04 (natty), if these diffs I've provided are correct. In summary, kernel 2.6.37 involves changes to queuecommand with the scsi done() callback and has reduced the pointer dereferencing of the host parameter by passing a separate argument.

    http://lxr.free-electrons.com/source...ost.h?v=2.6.36
    http://lxr.free-electrons.com/source...ost.h?v=2.6.37

    The following macro in ppscsi.h for queuecommand is the source of error for kernel 2.6.37 or Ubuntu 11.04 (natty):

    Code:
    #define PPSC_TEMPLATE(proto){               \
        .name =            #proto,              \
        .detect =             proto##_detect,    \
        .release =        ppsc_release,      \
        .proc_name =        #proto,           \
        .proc_info =          ppsc_proc_info,    \
        .queuecommand =       ppsc_queuecommand, \
        .eh_abort_handler =    ppsc_abort,       \
        .eh_bus_reset_handler =   ppsc_reset,       \
        .eh_host_reset_handler =  ppsc_reset,       \
        .bios_param =         ppsc_biosparam,    \
        .can_queue =          1,                \
        .sg_tablesize =       SG_NONE,           \
        .cmd_per_lun =        1,                 \
        .use_clustering =     DISABLE_CLUSTERING \
    }
    Documentation on queuecommand discusses changes on the arguments and locking mechanism:
    http://www.kernel.org/doc/Documentat...id_low_api.txt

    Here are the 2.6.37 release candidate changes for SCSI queuecommand and many drivers effected by that change (search 'done' in your browser to see the relevant changes):
    http://www.gossamer-threads.com/list...kernel/1301610

    Isolating the exact kernel version (somewhere between 2.6.32 and 2.6.35) that caused this code to stop functioning would be a good starting point so that the kernel differences and documentation can be analysed. I have verified 2.6.32 to work as expected and would like to know which version it stopped working under (2.6.33 or 2.6.34 since 2.6.35 doesn't seem to work). Debugging this code is very time consuming so if anyone else has input at this point it would be useful.

    Thanks for all the previous work that allowed the HP Scanjet 5100C to operate under Ubuntu 10.04 (lucid)

  6. #86
    Join Date
    Jan 2006
    Beans
    51

    Re: HP Scanjet 5100C / ppscsi in Hardy

    I would help if I could, but I have no idea how to fix this. At least there is no kernel panic any more.

    The problem seems to be that the scanner does not get recognized... I'm sorry, I'm no programmer...

  7. #87
    Join Date
    Jun 2011
    Beans
    2

    Re: HP Scanjet 5100C / ppscsi in Hardy

    I updated Ubuntu 10.04 to the latest supported kernel which is 2.6.32-32-generic and the scanner works fine. I also have Ubuntu 10.10 Beta which is using kernel version 2.6.35-19-generic while the official release of Ubuntu 10.10 shipped with 2.6.35-22-generic. There does not appear to be an Ubuntu release that ever used 2.6.33 or 2.6.34 versions of the kernel and the scanner stopped working somewhere along this transition.

    I will research the kernel differences as relates to the scsi driver and try to enable verbose diagnostics of the patched code being used on this forum. I have enough coding experience to understand the driver and I believe the problem is early on during the initialisation stage. The book, "Essential Linux Device Drivers" by Sreekrishnan Venkateswaran from Prentice Hall has several examples using the parallel port and scsi block drivers and some good advice on debugging. I'll try my best to gain some insight on the problem and report back.

    I have a vested interest in getting the driver working again as I've recently purchased a special ordered compact PCI Express Parallel Port Adaptor for my Gigabyte EX-58 Extreme motherboard with i7-980 hex core that fits right beside the CPU cooler in a tight spot that most adaptors won't fit. It was all a gamble to see if I could use the scanner with Ubuntu - it worked and now I want to keep using it!

    http://www.startech.com/product/PEX1...Parallel-Card-

  8. #88
    Join Date
    Jan 2006
    Beans
    51

    Re: HP Scanjet 5100C / ppscsi in Hardy

    I thought I'd try again in kernel 2.6.39, and here is what I get:
    Code:
    user@dhcppc5 ~/ppscsi-beta2 $ make
    make -C /lib/modules/`uname -r`/build M=`pwd` modules
    make[1]: entrant dans le répertoire « /usr/src/linux-2.6.39-pf2 »
      CC [M]  /home/user/ppscsi-beta2/ppscsi.o
    /home/user/ppscsi-beta2/ppscsi.c:73: erreur: ‘SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)
    make[2]: *** [/home/user/ppscsi-beta2/ppscsi.o] Erreur 1
    make[1]: *** [_module_/home/user/ppscsi-beta2] Erreur 2
    make[1]: quittant le répertoire « /usr/src/linux-2.6.39-pf2 »
    make: *** [all] Erreur 2
    Obviously, you'll not be interested in this kernel (yet) because it will probably only be in the next Ubuntu release (unless kernel 3.0 makes it in there), but if you find out how to solve this problem, I'd be very much interested.

  9. #89
    Join Date
    Nov 2006
    Beans
    30

    Re: HP Scanjet 5100C / ppscsi in Hardy

    After looking at a little discussion here, http://http://forums.gentoo.org/view...p-6858304.html it appeared the remaining patches to get the 5100C going were not too extensive. Compared to the patch already in this thread, it actually was just reverting two lines of the patch, and patching a couple other lines -- ppsc_queuecommand in 2.6.37+ runs with no locks and interrupts enabled, which won't work for something like a parallel port where timing is so important. Renaming this function ppsc_queuecommand_lck and adding one line makes the scsi layer wrap an IRQ disable/enable around this call like it used to -- resulting in a working driver again. VERIFIED WORKING ON Ubuntu 11.04 -- 2.6.38-11-generic kernel!

    This patch incorporates the patch to make the driver build cleanly against 2.6.37, so this goes directly against ppscsi-patched-karmic.tar.gz :
    Code:
    diff -cr ppscsi-beta2/ppscsi.c ppscsi-beta2-updated/ppscsi.c
    *** ppscsi-beta2/ppscsi.c	2010-01-06 18:47:53.000000000 -0600
    --- ppscsi-beta2-updated/ppscsi.c	2011-10-31 14:15:02.000000000 -0500
    ***************
    *** 188,194 ****
      	spin_unlock_irqrestore(&ppsc_spinlock,flags);
      }
      
    ! static void ppsc_tq_int (void *data)
      {
      	void (*con)(PHA *);
      	unsigned long flags;
    --- 188,194 ----
      	spin_unlock_irqrestore(&ppsc_spinlock,flags);
      }
      
    ! static void ppsc_tq_int (struct work_struct *data)
      {
      	void (*con)(PHA *);
      	unsigned long flags;
    ***************
    *** 383,389 ****
      	return cmd->result;
      }
      
    ! int ppsc_queuecommand (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
      {
      	PHA *pha = (PHA *) cmd->device->host->hostdata[0];
      
    --- 383,389 ----
      	return cmd->result;
      }
      
    ! int ppsc_queuecommand_lck (struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
      {
      	PHA *pha = (PHA *) cmd->device->host->hostdata[0];
      
    ***************
    *** 393,405 ****
      	}
      
      	pha->cur_cmd = cmd;
    ! 	pha->done = done;
      	pha->then = jiffies;
      
      	ppsc_do_claimed(pha,ppsc_start);
      
      	return 0;
      }
      
      static void ppsc_arb_fail (PHA *pha)
      {
    --- 393,407 ----
      	}
      
      	pha->cur_cmd = cmd;
    !     pha->done = cmd->scsi_done;
      	pha->then = jiffies;
      
      	ppsc_do_claimed(pha,ppsc_start);
      
      	return 0;
      }
    + DEF_SCSI_QCMD(ppsc_queuecommand)
    + 
      
      static void ppsc_arb_fail (PHA *pha)
      {
    ***************
    *** 1232,1238 ****
      		hreg = scsi_register(tpnt,sizeof(PHA*));
      		hreg->dma_channel = -1;
      		hreg->n_io_port = 0;
    ! 		hreg->unique_id = (int) pha; /* What should we put in here??? */
      		hreg->sg_tablesize = s;
      		hreg->hostdata[0]=(unsigned long)pha; /* Will be our pointer */
      
    --- 1234,1240 ----
      		hreg = scsi_register(tpnt,sizeof(PHA*));
      		hreg->dma_channel = -1;
      		hreg->n_io_port = 0;
    !        hreg->unique_id = (unsigned long)pha; /* What should we put in here??? */
      		hreg->sg_tablesize = s;
      		hreg->hostdata[0]=(unsigned long)pha; /* Will be our pointer */
      
    diff -cr ppscsi-beta2/ppscsi.h ppscsi-beta2-updated/ppscsi.h
    *** ppscsi-beta2/ppscsi.h	2010-01-06 18:47:53.000000000 -0600
    --- ppscsi-beta2-updated/ppscsi.h	2011-10-31 15:56:35.000000000 -0500
    ***************
    *** 13,19 ****
      #define	PPSC_H_VERSION	"0.92"
      
      #include <linux/module.h>
    ! #include <linux/autoconf.h>
      #include <linux/version.h>
      #include <linux/stddef.h>
      #include <linux/types.h>
    --- 13,19 ----
      #define	PPSC_H_VERSION	"0.92"
      
      #include <linux/module.h>
    ! #include <generated/autoconf.h>
      #include <linux/version.h>
      #include <linux/stddef.h>
      #include <linux/types.h>
    ***************
    *** 32,38 ****
      
      extern int ppsc_proc_info(struct Scsi_Host *, char *,char **,off_t,int,int);
      extern int ppsc_command(struct scsi_cmnd *);
    ! extern int ppsc_queuecommand(struct scsi_cmnd *, void (* done)(struct scsi_cmnd *));
      extern int ppsc_abort(struct scsi_cmnd *);
      extern int ppsc_reset(struct scsi_cmnd *);
      extern int ppsc_biosparam(struct scsi_device *, struct block_device *, sector_t capacity, int[]);
    --- 32,38 ----
      
      extern int ppsc_proc_info(struct Scsi_Host *, char *,char **,off_t,int,int);
      extern int ppsc_command(struct scsi_cmnd *);
    ! extern int ppsc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *cmd);
      extern int ppsc_abort(struct scsi_cmnd *);
      extern int ppsc_reset(struct scsi_cmnd *);
      extern int ppsc_biosparam(struct scsi_device *, struct block_device *, sector_t capacity, int[]);
    And to avoid the inevitable mangling of whitespace and such from cut-n-paste, it's also attached. Had to gzip it since the forum won't take a .patch file but will take a .patch.gz.
    Attached Files Attached Files

  10. #90
    Join Date
    Nov 2006
    Beans
    30

    Re: HP Scanjet 5100C / ppscsi in Hardy

    A few more items to make it nice:
    This was on an earlier page, to fix the permissions problems the scanner has by default so xsane and such don't have to be run as root. This is in /etc/udev/rules.d/45-libsane.rules:
    Code:
    SUBSYSTEM=="scsi_generic",ATTRS{type}=="3", NAME="%k", SYMLINK="scanner%n", MODE="0777", GROUP="scanner"
    Secondly, Ubuntu has plenty of kernel updates, and who wants to remember to rebuild ppscsi each time? Make runs very fast when there's nothing to build, and ~30 seconds (on a pretty antiquated box) when it does. So I stuck this in /etc/rc.local just before the "exit 0":
    Code:
    (cd /usr/src/ppscsi-beta2/
     make
     insmod ./ppscsi.ko
     insmod ./epst.ko)
    Rebuilds ppscsi if needed, and loads the modules.

Page 9 of 11 FirstFirst ... 7891011 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •