Re: [CDC-ACM] Linux USB

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

 



> >  		rcv->buffer = buf;
> > +	        if (acm->dev->quirks == TI_EZ430U)
> > +                    rcv->urb->interval = 0xFF;
> 
> As I said this is a separate issue.

The issue here is that urb->interval always equals to 0, causing a problem in
the usb_urb functions. What should be the proper way to solve this ?


> > -	if (quirks == NO_UNION_NORMAL) {
> > +	if (quirks == NO_UNION_NORMAL || quirks == TI_EZ430U) {
> 
> I don't understand why you define a quirk here. These devices should
> be autodetectable by comparing the number of the probed interface
> and the number of the data interface from the union descriptor.

You're right, without adding the device in the quirk list, the device is indeed
detected as a CDC-ACM device (but is finally not added to /dev/ttyACM). When
debugging, I could see that during driver-init, it finally went to "no union
descriptor" ... so, I added the device to the list.

> >  	/*workaround for switched interfaces */
> >  	if (data_interface->cur_altsetting->desc.bInterfaceClass !=
> > CDC_DATA_INTERFACE_TYPE) {
> > -		if (control_interface->cur_altsetting->desc.bInterfaceClass ==
> > CDC_DATA_INTERFACE_TYPE) {
> > +		if ( (control_interface->cur_altsetting->desc.bInterfaceClass ==
> > CDC_DATA_INTERFACE_TYPE) || (quirks == TI_EZ430U) ) {
> >  			struct usb_interface *t;
> >  			dev_dbg(&intf->dev,"Your device has switched interfaces.\n");
> >
> > @@ -1038,7 +1040,7 @@ skip_normal_probe:
> >  		return -EINVAL;
> >
> >  	epctrl = &control_interface->cur_altsetting->endpoint[0].desc;
> > -	epread = &data_interface->cur_altsetting->endpoint[0].desc;
> > +	epread = (quirks == TI_EZ430U) ?
> > &data_interface->cur_altsetting->endpoint[1].desc :
> > &data_interface->cur_altsetting->endpoint[0].desc;
> >  	epwrite = &data_interface->cur_altsetting->endpoint[1].desc;
> 
> This should not be done. If we know a device violates the spec by having
> only a single interface we should search the endpoints and not hardcode
> the endpoints.

You're right. Could you please help me a little bit ? I actually don't know how
to search the endpoints.

Regards

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

  Powered by Linux