[sane-devel] aha152x with mustek scanner and SANE

Bjoern Brill brill at samson.math.uni-frankfurt.de
Thu Oct 10 00:46:55 BST 2002


On Thu, 10 Oct 2002, Bjoern Brill wrote:

> 
> On Wed, 9 Oct 2002, Mike Nix wrote:
> 
[...]
> > > I've been trying to get the aha152x driver working with an adaptec SCSI
> > card
[...]
> > > With the aha152x diver, the scanner is found & initialized and the scan
> > > commences - but about the time the first data is returned from the scanner
> > I
> > > get a NULL pointer exception.
[...]
> > > I realize this is likely a SCSI driver problem, but imagine someone might
> > > have seen it before.
> 
[...]
> running command and can't handle that. Note the 2.4.20-pre series contains
> a small patch to aha152x.c, but I haven't tried it yet.
>

Update, replying to myself: tried said patch (attached, excerpt from
patch-2.4.20-pre9), works for me now.


Regards,

Bjoern
--
Bj"orn Brill <brill at fs.math.uni-frankfurt.de>
Frankfurt am Main, Germany

-------------- next part --------------
diff -Naur -X /home/marcelo/lib/dontdiff linux-2.4.19/drivers/scsi/aha152x.c linux-2.4.20/drivers/scsi/aha152x.c
--- linux-2.4.19/drivers/scsi/aha152x.c	2002-08-03 00:39:44.000000000 +0000
+++ linux-2.4.20/drivers/scsi/aha152x.c	2002-10-04 00:41:10.000000000 +0000
@@ -602,7 +602,11 @@
 #define SCDONE(SCpnt)		SCDATA(SCpnt)->done
 #define SCSEM(SCpnt)		SCDATA(SCpnt)->sem
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
+#define SG_ADDRESS(buffer)	((buffer)->address)
+#else
 #define SG_ADDRESS(buffer)	((char *) (page_address((buffer)->page)+(buffer)->offset))
+#endif
 
 /* state handling */
 static void seldi_run(struct Scsi_Host *shpnt);
@@ -2657,7 +2661,7 @@
 		 * STCNT to trigger ENSWRAP interrupt, instead of
 		 * polling for DFIFOFULL
 		 */
-		the_time=jiffies + 10*HZ;
+		the_time=jiffies + 100*HZ;
 		while(TESTLO(DMASTAT, DFIFOFULL|INTSTAT) && time_before(jiffies,the_time))
 			barrier();
 
@@ -2670,7 +2674,7 @@
 		if(TESTHI(DMASTAT, DFIFOFULL)) {
 			fifodata = 128;
 		} else {
-			the_time=jiffies + 10*HZ;
+			the_time=jiffies + 100*HZ;
 			while(TESTLO(SSTAT2, SEMPTY) && time_before(jiffies,the_time))
 				barrier();
 
@@ -2826,7 +2830,7 @@
 			CURRENT_SC->SCp.this_residual = CURRENT_SC->SCp.buffer->length;
 		}
 
-		the_time=jiffies + 10*HZ;
+		the_time=jiffies + 100*HZ;
 		while(TESTLO(DMASTAT, DFIFOEMP|INTSTAT) && time_before(jiffies,the_time))
 			barrier();
 


More information about the sane-devel mailing list