Re: [PATCH] USB: usblp: add USBLP_QUIRK_NO_SET_INTF flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 21, 2021 at 05:02:49PM -0600, Pete Zaitcev wrote:
> On Thu, 21 Jan 2021 14:29:29 -0500
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> 
> > > I'm also concerned about regressions. This is a legacy class driver,
> > > only used where CUPS is not applicable, mostly with truly ancient
> > > devices. So yes, setting a zero altsetting after enumeration should
> > > be unnecessary. But you never know with the old firmware.  
> 
> > How about skipping the call whenever the interface has only one 
> > altsetting?
> 
> Do you mean when it's only one and not equal to zero?

If there's only one, it _has_ to be equal to 0.  According to section 
9.2.3 of the USB-2 spec:

	Alternate settings range from zero to one less than the number 
	of alternate settings for a specific interface.

> BTW, one other thing bothers me. Jeremy confirmed that my patch
> worked, which skips the call when USB_QUIRK_NO_SET_INTF is set.
> But if we look into drivers/usb/core/message.c, the control
> exchange to set the altsetting is skipped in that case anyway.
> So, usblp was calling usb_set_protocol, the suspect control was
> skipped, but something else caused a problem. Could it be the
> attempt to clear halt that triggered the problem?

It could very well be.  The printer might not reset the endpoint toggle 
when it gets the Clear-Halt request.

It's also possible that when the quirk flag wasn't set (so the 
Set-Interface request was issued), the printer failed reset the endpoint 
toggle.

Alan Stern




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux