Hi Greg,

this makes Elite II scanners much more useable. It's against 2.4.
Please apply.

        Regards
                Oliver

You can import this changeset into BK by piping this whole message to:
'| bk receive [path to repository]' or apply the patch as usual.

===================================================================


[EMAIL PROTECTED], 2003-02-08 00:58:02+01:00, [EMAIL PROTECTED]
   - short command work around


 hpusbscsi.c |   20 ++++++++++++++++++--
 hpusbscsi.h |    1 +
 2 files changed, 19 insertions(+), 2 deletions(-)


diff -Nru a/drivers/usb/hpusbscsi.c b/drivers/usb/hpusbscsi.c
--- a/drivers/usb/hpusbscsi.c   Sat Feb  8 01:00:12 2003
+++ b/drivers/usb/hpusbscsi.c   Sat Feb  8 01:00:12 2003
@@ -127,6 +127,9 @@
        init_waitqueue_head (&new->deathrow);
        init_MUTEX(&new->lock);
        INIT_LIST_HEAD (&new->lh);
+       
+       if (id->idVendor == 0x0686 && id->idProduct == 0x4004)
+               new->need_short_workaround = 1;
 
 
 
@@ -340,7 +343,7 @@
 {
        struct hpusbscsi* hpusbscsi = (struct hpusbscsi*)(srb->host->hostdata[0]);
        usb_urb_callback usb_callback;
-       int res;
+       int res, passed_length;
 
        spin_unlock_irq(&io_request_lock);
 
@@ -359,6 +362,19 @@
                callback(srb);
                goto out;
        }
+       
+       /* otto fix - the Scan Elite II has a 5 second
+       * delay anytime the srb->cmd_len=6
+       * This causes it to run very slowly unless we
+       * pad the command length to 10 */
+        
+       if (hpusbscsi -> need_short_workaround && srb->cmd_len < 10) {
+               memset(srb->cmnd + srb->cmd_len, 0, 10 - srb->cmd_len);
+               passed_length = 10;
+       } else {
+               passed_length = srb->cmd_len;
+       }
+        
 
        /* Now we need to decide which callback to give to the urb we send the 
command with */
 
@@ -404,7 +420,7 @@
                hpusbscsi->dev,
                usb_sndbulkpipe(hpusbscsi->dev,hpusbscsi->ep_out),
                srb->cmnd,
-               srb->cmd_len,
+               passed_length,
                usb_callback,
                hpusbscsi
        );
diff -Nru a/drivers/usb/hpusbscsi.h b/drivers/usb/hpusbscsi.h
--- a/drivers/usb/hpusbscsi.h   Sat Feb  8 01:00:12 2003
+++ b/drivers/usb/hpusbscsi.h   Sat Feb  8 01:00:12 2003
@@ -20,6 +20,7 @@
         int ep_in;
         int ep_int;
         int interrupt_interval;
+       int need_short_workaround;
 
         struct Scsi_Host *host;
         Scsi_Host_Template ctempl;

===================================================================


This BitKeeper patch contains the following changesets:
1.901
## Wrapped with gzip_uu ##


begin 664 bkpatch5040
M'XL(`(U(1#X``ZU6VV[;1A!]YG[%``&"^$)Q=KF\R9'@-@Y:HP5J.)?7@.*.
M14(4U^"2E86R_]XEZ?H61[`=$X(([<P<GCUS9JDW\,50/75T6?Q--7L#OVO3
MV)]4Z8HFN5Y3653MU4372QL\U]H&O7[9&RN\Q<IM:B+CM6;ABHED-NTL;;(<
M;-1,'3[Q;U::[25-G?./OWWY\Y=SQF8S^)"GU9(^40.S&5NLCE5+Y615ZS3O
MG]C=A#N!R#%`+GP9HN@P0AYT8:322/J8!(%4G#@;.1T_QOX^EH\"(RZE[_-.
M\#B.V`GP28(<T/=0>!@#XC2([email protected]$\180<T'`APD?T*/[^!#RP#<,'DNFX@
MT^MU6BG8Z'H%::W;2K$_0,@P3MC9K73,?>;%&*;(YG#9-^58D5G=8:SJ?I]#
M.[W\TGZ;S!23;.#/$2-[#T38B2A*L%,1J5@I&:M%M*#0WZ72+N2A'<(/8N0=
M#T48/8]=_AV[!'W924F1N."1$$F<HI(O8)<_9!>(./('Z_Y@.[V17U]8MJQI
M>3R"65OL`A-<6+S8<@XZZ8<B&:PMQ'?.YD]Q-H_!%:]F[=W.'CO_%[CU9OA8
MIY[]2.87F/Z4BP1\YC"GN(!WA7+GA?I*E=*U[1G@%89Q"&_?PA@YJ[5JLV8,
M242YQQRGHHT[KXC4MV$?WWK^(WV8`3]B)[[T@;/3\>8450,UF4/K96-L44G5
MLLF/;#SDP`<JWC[HIM%P45Q9=9J<X%.65O"Q+!J"TU/(4P,I!&`HTU8D9Q\4
ME>D6TFK;%&L:*DR]<.?9>L"?A7W.Y[PPD*6M(0-%`Q:_;JO^0-Z"*?6FW$);
ME60,;*A/OTS5`/1_6T:>?1E'V/<87%^C<C==`'<.CXMA5;Q+"MY;H#WXQRJX
MIK6AYMUUU*8>W,L\!#SL'^K>6]T[LI7W-.SE1KOZ+U!I:$!^&+\+T&?>[N)$
M8M1W:;P]J#S<,=SY,X?[B>?2TX8[?SC<=N(B'(8[?N%LO^9;:_=HC\?FDT8[
F?\EHV^/M>MX>->31[;^2+*=L9=KU+,XRF?"%9/\!I+]#R@,)````
`
end



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to