On Fri, 16 Apr 2004 00:35:16 +0100
Martin Habets <[EMAIL PROTECTED]> wrote:

> There is a problem in the GET_DEVICE_ID ioctl() implementation. The patch below
> (against 2.6 current) fixes the code to be according to the official usb printer 
> spec.

Marin, you seem to have dropped the ball on this. Did Vojtech bless it,
rejected it, or refused to consider? If the latest, go to Greg.
Remember your patches are needed for you. You don't care, I don't care.

-- Pete

 static int usblp_ctrl_msg(struct usblp *usblp, int request, int type, int dir, int 
recip, int value, void *buf, int len)
 {
-       int retval = usb_control_msg(usblp->dev,
+       int retval;
+       int index = usblp->ifnum;
+
+       /* High byte has the interface index.
+          Low byte has the alternate setting.
+        */
+       if ((request == USBLP_REQ_GET_ID) && (type == USB_TYPE_CLASS)) {
+         index = 
(usblp->ifnum<<8)|usblp->protocol[usblp->current_protocol].alt_setting;
+       }
+
+       retval = usb_control_msg(usblp->dev,
                dir ? usb_rcvctrlpipe(usblp->dev, 0) : usb_sndctrlpipe(usblp->dev, 0),
-               request, type | dir | recip, value, usblp->ifnum, buf, len, 
USBLP_WRITE_TIMEOUT);
-       dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d len: %#x 
result: %d",
-               request, !!dir, recip, value, len, retval);
+               request, type | dir | recip, value, index, buf, len, 
USBLP_WRITE_TIMEOUT);
+       dbg("usblp_control_msg: rq: 0x%02x dir: %d recip: %d value: %d idx: %d len: 
%#x result: %d",
+               request, !!dir, recip, value, index, len, retval);
        return retval < 0 ? retval : 0;


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to