Greg, There is a problem in the usblp GET_DEVICE_ID ioctl() implementation. The patch below (against 2.6 current) fixes the code to be according to the official usb printer spec.
Most printers are not affected by this fix, as they use interface 0 and alternate 0. For those, nothing changes. But my printer/scanner uses interface 1 for the printer. Best regards, Martin Habets On Sat, May 01, 2004 at 03:19:43PM +0200, Vojtech Pavlik wrote: > On Sat, May 01, 2004 at 09:27:37AM +0100, Martin Habets wrote: > > Hi Pete, > > > > I've had no response from Vojtech at all. I did a resend last week, > > but no response from that yet. Will follow up once I'm back at home > > (am now attending Linux Audio Conference). > > I'm fine with the patch, (and sorry for the very delayed response). > Martin, please send it to Greg. --- 2.6/drivers/usb/class/usblp.c.original 2004-03-20 00:11:03.000000000 +0000 +++ 2.6/drivers/usb/class/usblp.c 2004-04-03 04:18:19.000000000 +0100 @@ -226,11 +226,21 @@ 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; } @@ -440,6 +450,9 @@ goto done; } + dbg("usblp_ioctl: cmd=0x%x (%c nr=%d len=%d dir=%d)", cmd, _IOC_TYPE(cmd), + _IOC_NR(cmd), _IOC_SIZE(cmd), _IOC_DIR(cmd) ); + if (_IOC_TYPE(cmd) == 'P') /* new-style ioctl number */ switch (_IOC_NR(cmd)) { ------------------------------------------------------- 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