Discussion:
[CDC-ACM] Linux USB "Reduced" CDC-ACM driver
Vincent
2009-04-23 12:49:38 UTC
Permalink
Dear all,

I am actually working on the OMAP3 EVM from TI, and their eZ430u usb tool.
( http://focus.ti.com/docs/toolsw/folders/print/ez430-rf2480.html )

This kit contains a TUSB3410 which is a USB to UART bridge, and an EEPROM which
contains a firmware for using the tool as a CDC-ACM USB peripheral. This
firmware has been mostly written for beeing used under Windows XP, and for
compatibility reasons it only exports 1 interface ( kind of merged DATA and COMM
interface ).

The actual Linux CDC-ACM driver is waiting for 2 interfaces ( 1 for DATA and 1
for COMM ), so, the eZ430u tool does'nt work with Linux.

I made a small patch to "correct" this ( attached below ).

I wanted to have some feedbacks about this patch. As I suppose the eZ430u is NOT
the only device in the world that exports only 1 interface for CDC-ACM, I think
it would be nice if the Linux CDC-ACM Driver could support it.

More-over, with this patch, even if now the tool "is working", I loose some
bytes from time to time (only for the Reception, Transmition is ok), which is
actually a real problem. This seem to be a driver issue, since I don't loose any
data when using the tool on Windows.

Could you please tell me if you're interested in patching the Linux CDC-ACM
driver for backward compatibility ? Could you please have a glance at my patch
and give me some feedbacks ?


Thanks.

*** linux-orig/drivers/usb/class/
cdc-acm.c 2009-01-22 06:00:07.000000000 -0500
--- linux-new/drivers/usb/class/cdc-acm.c 2009-04-17 05:00:22.000000000 -0400
***************
*** 445,450 ****
--- 445,452 ----
list_del(&buf->list);

rcv->buffer = buf;
+ if (acm->dev->quirks == TI_EZ430U)
+ rcv->urb->interval = 0xFF;

usb_fill_bulk_urb(rcv->urb, acm->dev,
acm->rx_endpoint,
***************
*** 916,922 ****
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;

/* handle quirks deadly to normal probing*/
- if (quirks == NO_UNION_NORMAL) {
data_interface = usb_ifnum_to_if(usb_dev, 1);
control_interface = usb_ifnum_to_if(usb_dev, 0);
goto skip_normal_probe;
--- 918,924 ----
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;

/* handle quirks deadly to normal probing*/
+ if (quirks == NO_UNION_NORMAL || quirks == TI_EZ430U) {
data_interface = usb_ifnum_to_if(usb_dev, 1);
control_interface = usb_ifnum_to_if(usb_dev, 0);
goto skip_normal_probe;
***************
*** 1012,1018 ****

/*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) {
struct usb_interface *t;
dev_dbg(&intf->dev,"Your device has switched interfaces.\n");

--- 1014,1020 ----

/*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) || (quirks == TI_EZ430U) ) {
struct usb_interface *t;
dev_dbg(&intf->dev,"Your device has switched interfaces.\n");

***************
*** 1038,1044 ****
return -EINVAL;

epctrl = &control_interface->cur_altsetting->endpoint[0].desc;
- epread = &data_interface->cur_altsetting->endpoint[0].desc;
epwrite = &data_interface->cur_altsetting->endpoint[1].desc;


--- 1040,1046 ----
return -EINVAL;

epctrl = &control_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;


***************
*** 1370,1375 ****
--- 1372,1380 ----
{ USB_DEVICE(0x0572, 0x1321), /* Conexant USB MODEM CX93010 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
+ { USB_DEVICE(0x0451, 0xF432), /* TI TUSB3410 */
+ .driver_info = TI_EZ430U,
+ },

/* control interfaces with various AT-command sets */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
*** linux-orig/drivers/usb/class/cdc-acm.h 2009-01-22 06:00:07.000000000 -0500
--- linux-new/drivers/usb/class/cdc-acm.h 2009-04-17 04:34:52.000000000 -0400
***************
*** 134,136 ****
--- 134,138 ----
/* constants describing various quirks and errors */
#define NO_UNION_NORMAL 1
#define SINGLE_RX_URB 2
+ #define TI_EZ430U 3
+

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-23 13:22:36 UTC
Permalink
This firmware has been mostly written for beeing used under Windows XP, and
for compatibility reasons it only exports 1 interface ( kind of merged DATA
and COMM interface ).
The actual Linux CDC-ACM driver is waiting for 2 interfaces ( 1 for DATA
and 1 for COMM ), so, the eZ430u tool does'nt work with Linux.
The spec says that a device has to have at least two interfaces.
But we live in the real world and want to support as much hardware
as cleanly possible.
More-over, with this patch, even if now the tool "is working", I loose some
bytes from time to time (only for the Reception, Transmition is ok), which
is actually a real problem. This seem to be a driver issue, since I don't
loose any data when using the tool on Windows.
Get a usbmon trace showing a loss of data.
Could you please tell me if you're interested in patching the Linux CDC-ACM
driver for backward compatibility ? Could you please have a glance at my
patch and give me some feedbacks ?
Thanks.
*** linux-orig/drivers/usb/class/
cdc-acm.c 2009-01-22 06:00:07.000000000 -0500
--- linux-new/drivers/usb/class/cdc-acm.c 2009-04-17 05:00:22.000000000
-0400 ***************
*** 445,450 ****
--- 445,452 ----
list_del(&buf->list);
rcv->buffer = buf;
+ if (acm->dev->quirks == TI_EZ430U)
+ rcv->urb->interval = 0xFF;
This is a separate issue. Please define a separate quirk for it. What happens
if you don't do this?
usb_fill_bulk_urb(rcv->urb, acm->dev,
acm->rx_endpoint,
***************
*** 916,922 ****
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
/* handle quirks deadly to normal probing*/
- if (quirks == NO_UNION_NORMAL) {
data_interface = usb_ifnum_to_if(usb_dev, 1);
control_interface = usb_ifnum_to_if(usb_dev, 0);
goto skip_normal_probe;
--- 918,924 ----
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
/* handle quirks deadly to normal probing*/
+ if (quirks == NO_UNION_NORMAL || quirks == TI_EZ430U) {
data_interface = usb_ifnum_to_if(usb_dev, 1);
control_interface = usb_ifnum_to_if(usb_dev, 0);
Maybe I am dense, but this supposes that you have two interfaces.
It seems to me we have some kind of misunderstanding. Could you please
1. post "lsusb -v" for your device?
2. Repost the patch made with "diff -up"?

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vincent
2009-04-23 13:57:55 UTC
Permalink
Thanks for your reply.
Post by Oliver Neukum
Get a usbmon trace showing a loss of data.
I don't have this tool on my environment ... I'll get it, thanks for the tip.
Post by Oliver Neukum
Maybe I am dense, but this supposes that you have two interfaces.
It seems to me we have some kind of misunderstanding. Could you please
1. post "lsusb -v" for your device?
Bus 001 Device 004: ID 0451:f432 Texas Instruments, Inc.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0451 Texas Instruments, Inc.
idProduct 0xf432
bcdDevice 1.00
iManufacturer 1 Texas Instruments
iProduct 2 Texas Instruments MSP-FET430UIF
iSerial 3 83FF598CDEC5112C
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 85
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 5 MSP430 Application UART
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x00
bDataInterface 0
CDC ACM:
bmCapabilities 0x02
line coding and serial state
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 255
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 255
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 255
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 4 MSP430 Debug-Interface
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.01
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 694
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Device Status: 0x0000
(Bus Powered)
Post by Oliver Neukum
2. Repost the patch made with "diff -up"?
diff -up linux-orig/drivers/usb/class/cdc-acm.c
linux-new/drivers/usb/class/cdc-acm.c
--- linux-orig/drivers/usb/class/cdc-acm.c 2009-01-22 06:00:07.000000000 -0500
+++ linux-new/drivers/usb/class/cdc-acm.c 2009-04-19 10:34:01.000000000 -0400
@@ -445,6 +445,8 @@ urbs:
list_del(&buf->list);

rcv->buffer = buf;
+ if (acm->dev->quirks == TI_EZ430U)
+ rcv->urb->interval = 0xFF;

usb_fill_bulk_urb(rcv->urb, acm->dev,
acm->rx_endpoint,
@@ -916,7 +918,7 @@ static int acm_probe (struct usb_interfa
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;

/* handle quirks deadly to normal probing*/
- if (quirks == NO_UNION_NORMAL) {
+ if (quirks == NO_UNION_NORMAL || quirks == TI_EZ430U) {
data_interface = usb_ifnum_to_if(usb_dev, 1);
control_interface = usb_ifnum_to_if(usb_dev, 0);
goto skip_normal_probe;
@@ -1012,7 +1014,7 @@ skip_normal_probe:

/*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;


@@ -1370,6 +1372,9 @@ static struct usb_device_id acm_ids[] =
{ USB_DEVICE(0x0572, 0x1321), /* Conexant USB MODEM CX93010 */
.driver_info = NO_UNION_NORMAL, /* has no union descriptor */
},
+ { USB_DEVICE(0x0451, 0xF432), /* TI TUSB3410 */
+ .driver_info = TI_EZ430U,
+ },

/* control interfaces with various AT-command sets */
{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
diff -up linux-orig/drivers/usb/class/cdc-acm.h
linux-new/drivers/usb/class/cdc-acm.h
--- linux-orig/drivers/usb/class/cdc-acm.h 2009-01-22 06:00:07.000000000 -0500
+++ linux-new/drivers/usb/class/cdc-acm.h 2009-04-19 10:34:01.000000000 -0400
@@ -134,3 +134,5 @@ struct acm {
/* constants describing various quirks and errors */
#define NO_UNION_NORMAL 1
#define SINGLE_RX_URB 2
+#define TI_EZ430U 3
+


Thanks for your help,

Regards.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-23 21:03:26 UTC
Permalink
Post by Vincent
Thanks for your reply.
Post by Oliver Neukum
Get a usbmon trace showing a loss of data.
I don't have this tool on my environment ... I'll get it, thanks for the tip.
You can find a HOWTO under Documentation/usb/usbmon.txt
in your kernel tree.
Post by Vincent
list_del(&buf->list);
rcv->buffer = buf;
+ if (acm->dev->quirks == TI_EZ430U)
+ rcv->urb->interval = 0xFF;
As I said this is a separate issue.
Post by Vincent
usb_fill_bulk_urb(rcv->urb, acm->dev,
acm->rx_endpoint,
@@ -916,7 +918,7 @@ static int acm_probe (struct usb_interfa
num_rx_buf = (quirks == SINGLE_RX_URB) ? 1 : ACM_NR;
/* handle quirks deadly to normal probing*/
- 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.
Post by Vincent
data_interface = usb_ifnum_to_if(usb_dev, 1);
control_interface = usb_ifnum_to_if(usb_dev, 0);
goto skip_normal_probe;
/*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");
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[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.

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vinccent
2009-04-24 05:15:41 UTC
Permalink
Post by Oliver Neukum
Post by Vincent
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 ?
Post by Oliver Neukum
Post by Vincent
- 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.
Post by Oliver Neukum
Post by Vincent
/*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");
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[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-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Xiaofan Chen
2009-04-24 01:32:46 UTC
Permalink
Post by Vincent
The actual Linux CDC-ACM driver is waiting for 2 interfaces ( 1 for DATA and 1
for COMM ), so, the eZ430u tool does'nt work with Linux.
I made a small patch to "correct" this ( attached below ).
I wanted to have some feedbacks about this patch. As I suppose the eZ430u is NOT
the only device in the world that exports only 1 interface for CDC-ACM, I think
it would be nice if the Linux CDC-ACM Driver could support it.
I believe it does not even work at Vista. It happens to work under XP.
Reference: https://community.ti.com/forums/p/1395/4941.aspx

Last time there was a long discussion in usb.org Forum where
Jan Axelson listed several options trying to support a USB composite
device involving one CDC-ACM device. The thread is now gone due
to the usb.org forum's stupid data retention policy. Anyway, I have
it mirrored here.
http://www.microchip.com/forums/tm.aspx?m=189607&mpage=2

So I guess there are some USB composite device with
this kind of non-compliant CDC interface since Windows does not
support IAD well last time (XP SP3 and Vista SP1 works). But if it is
not a composite device, this is the first time I know of a non-compliant
CDC-ACM device trying to use Windows' built-in usbser.sys. If it
has its own driver, that is another story.
--
Xiaofan http://mcuee.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-26 17:45:45 UTC
Permalink
Post by Xiaofan Chen
So I guess there are some USB composite device with
this kind of non-compliant CDC interface since Windows does not
support IAD well last time (XP SP3 and Vista SP1 works). But if it is
not a composite device, this is the first time I know of a non-compliant
CDC-ACM device trying to use Windows' built-in usbser.sys. If it
has its own driver, that is another story.
This patch should make Linux support such devices without the
need for quirks. Please test.

Regards
Oliver
Vincent Del Medico
2009-04-27 07:08:28 UTC
Permalink
Post by Oliver Neukum
Post by Xiaofan Chen
So I guess there are some USB composite device with
this kind of non-compliant CDC interface since Windows does not
support IAD well last time (XP SP3 and Vista SP1 works). But if it =
is
Post by Oliver Neukum
Post by Xiaofan Chen
not a composite device, this is the first time I know of a non-comp=
liant
Post by Oliver Neukum
Post by Xiaofan Chen
CDC-ACM device trying to use Windows' built-in usbser.sys. If it
has its own driver, that is another story.
This patch should make Linux support such devices without the
need for quirks. Please test.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
Thanks Oliver, but unfortunately this doesn't work.

usb 1-1.3.2: new full speed USB device using musb_hdrc and address 5
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no m=
odem.
cdc_acm 1-1.3.2:1.0: No union descriptor, giving up

Error shown is the reason why I inserted my device to the quirk list..
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-27 09:35:12 UTC
Permalink
Post by Vincent Del Medico
Thanks Oliver, but unfortunately this doesn't work.
usb 1-1.3.2: new full speed USB device using musb_hdrc and address 5
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no modem.
cdc_acm 1-1.3.2:1.0: No union descriptor, giving up
Error shown is the reason why I inserted my device to the quirk list..
OK, I see. I'll make an additional patch.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-27 12:49:58 UTC
Permalink
Post by Vincent Del Medico
Post by Oliver Neukum
This patch should make Linux support such devices without the
need for quirks. Please test.
Regards
Oliver
Thanks Oliver, but unfortunately this doesn't work.
usb 1-1.3.2: new full speed USB device using musb_hdrc and address 5
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no modem.
cdc_acm 1-1.3.2:1.0: No union descriptor, giving up
Please try the attached additional patch.

Regards
Oliver
Vincent Del Medico
2009-04-27 15:46:12 UTC
Permalink
Post by Oliver Neukum
Post by Vincent Del Medico
Post by Oliver Neukum
This patch should make Linux support such devices without the
need for quirks. Please test.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
Thanks Oliver, but unfortunately this doesn't work.
usb 1-1.3.2: new full speed USB device using musb_hdrc and address 5
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is n=
o modem.
Post by Oliver Neukum
Post by Vincent Del Medico
cdc_acm 1-1.3.2:1.0: No union descriptor, giving up
Please try the attached additional patch.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
This creates the /dev/ttyACM0 interface but I get errors when using
any application. See below

usb 1-1.3.2: new full speed USB device using musb_hdrc and address 4
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no m=
odem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x=
0 result:
0
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x=
7 result:
7
drivers/hid/usbhid/hid-core.c: usb_submit_urb(ctrl) failed
generic-usb 0003:0451:F432.0001: timeout initializing reports
generic-usb 0003:0451:F432.0001: claimed by neither input, hiddev nor h=
idraw
usb 1-1.3.2: New USB device found, idVendor=3D0451, idProduct=3Df432
usb 1-1.3.2: New USB device strings: Mfr=3D1, Product=3D2, SerialNumber=
=3D3
usb 1-1.3.2: Product: Texas Instruments MSP-FET430UIF
usb 1-1.3.2: Manufacturer: Texas Instruments
usb 1-1.3.2: SerialNumber: 83FF598CDEC5112C
***@arago:/#
***@arago:/# ./TI-RF2500-Demo
/dev/ttyACM0: Input/output error
***@arago:/# minicom
minicom: cannot open /dev/ttyACM0: Input/output error
***@arago:/#

Regards
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-27 16:37:01 UTC
Permalink
Post by Vincent Del Medico
This creates the /dev/ttyACM0 interface but I get errors when using
any application. See below
usb 1-1.3.2: new full speed USB device using musb_hdrc and address 4
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no modem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
Please recompile the driver with debugging enabled.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vincent Del Medico
2009-04-28 11:21:34 UTC
Permalink
Post by Oliver Neukum
Post by Vincent Del Medico
This creates the /dev/ttyACM0 interface but I get errors when using
any application. See below
usb 1-1.3.2: new full speed USB device using musb_hdrc and address 4
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is n=
o modem.
Post by Oliver Neukum
Post by Vincent Del Medico
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated devi=
ce
Post by Oliver Neukum
Post by Vincent Del Medico
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
Please recompile the driver with debugging enabled.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
Sorry, I thought debugging was enabled ..

usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no m=
odem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x22 val: 0x0 len:
0x0 result: 0
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x20 val: 0x0 len:
0x7 result: 7
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vincent
2009-04-28 11:27:19 UTC
Permalink
Post by Vincent Del Medico
Sorry, I thought debugging was enabled ..
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no modem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
0x0 result: 0
0x7 result: 7
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
And after opening the interface /dev/ttyACM0 :

drivers/usb/class/cdc-acm.c: Entering acm_tty_open.
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x22 val: 0x3 len: 0x0 result:
-32
drivers/usb/class/cdc-acm.c: acm_ctrl_irq - urb shutting down with status: -2


Regards.


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-28 11:59:47 UTC
Permalink
Post by Vincent
Post by Vincent Del Medico
Sorry, I thought debugging was enabled ..
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no modem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
0x0 result: 0
0x7 result: 7
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
That is an error. Please disregard my earlier mail. I hadn't read this mail.
Post by Vincent
drivers/usb/class/cdc-acm.c: Entering acm_tty_open.
-32
It fails USB_CDC_REQ_SET_CONTROL_LINE_STATE
Does your device support this control request?
Post by Vincent
drivers/usb/class/cdc-acm.c: acm_ctrl_irq - urb shutting down with status: -2
Expected consequence of an aborted opening.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vincent Del Medico
2009-04-28 12:43:46 UTC
Permalink
Post by Oliver Neukum
Post by Vincent
drivers/usb/class/cdc-acm.c: Entering acm_tty_open.
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x22 val: 0x3 len:=
=A0-32
It fails USB_CDC_REQ_SET_CONTROL_LINE_STATE
Does your device support this control request?
Post by Vincent
drivers/usb/class/cdc-acm.c: acm_ctrl_irq - urb shutting down with s=
tatus: -2
Post by Oliver Neukum
Expected consequence of an aborted opening.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
No idea ... I suppose the answer is in the firmware of the device ..
which I don't have access to ...
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-28 13:19:43 UTC
Permalink
Post by Vincent Del Medico
Post by Oliver Neukum
Post by Vincent
drivers/usb/class/cdc-acm.c: Entering acm_tty_open.
-32
It fails USB_CDC_REQ_SET_CONTROL_LINE_STATE
Does your device support this control request?
Post by Vincent
drivers/usb/class/cdc-acm.c: acm_ctrl_irq - urb shutting down with status: -2
Expected consequence of an aborted opening.
Regards
Oliver
No idea ... I suppose the answer is in the firmware of the device ..
which I don't have access to ...
I see. I'll make a patch. I think it worked with your patch because you
used the debug interface as control interface. This means a quirk will
be needed.

Regards
Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vincent Del Medico
2009-04-29 08:57:09 UTC
Permalink
I see. I'll make a patch. I think it worked with your patch because y=
ou
used the debug interface as control interface. This means a quirk wil=
l
be needed.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
If I can help ... don't hesitate ..
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-30 19:14:04 UTC
Permalink
Post by Vincent Del Medico
I see. I'll make a patch. I think it worked with your patch because=
you
Post by Vincent Del Medico
used the debug interface as control interface. This means a quirk w=
ill
Post by Vincent Del Medico
be needed.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
If I can help ... don't hesitate ..
Please try this additional patch.

Regards
Oliver

--

commit 0d789f334b8eda3db77ad55b9afdc42de7f261e6
Author: Oliver Neukum <***@linux-d698.(none)>
Date: Thu Apr 30 21:10:15 2009 +0200

add quirk

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 8910274..27239cd 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1107,6 +1107,8 @@ made_compressed_probe:
acm->minor =3D minor;
acm->dev =3D usb_dev;
acm->ctrl_caps =3D ac_management_function;
+ if (quirks & NO_CAP_LINE)
+ acm->ctrl_caps &=3D ~USB_CDC_CAP_LINE;
acm->ctrlsize =3D ctrlsize;
acm->readsize =3D readsize;
acm->rx_buflimit =3D num_rx_buf;
@@ -1416,6 +1418,9 @@ static struct usb_device_id acm_ids[] =3D {
{ USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */
.driver_info =3D NO_UNION_NORMAL, /* has no union descriptor */
},
+ { USB_DEVICE(0x0451, 0xF432), /* TI TUSB3410 */
+ .driver_info =3D NO_CAP_LINE,
+ },
{ USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */
},
{ USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */
diff --git a/drivers/usb/class/cdc-acm.h b/drivers/usb/class/cdc-acm.h
index 023ebe9..3812278 100644
--- a/drivers/usb/class/cdc-acm.h
+++ b/drivers/usb/class/cdc-acm.h
@@ -135,3 +135,4 @@ struct acm {
/* constants describing various quirks and errors */
#define NO_UNION_NORMAL 1
#define SINGLE_RX_URB 2
+#define NO_CAP_LINE 4

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
David Brownell
2009-05-04 02:34:51 UTC
Permalink
+=A0=A0=A0=A0=A0=A0=A0{ USB_DEVICE(0x0451, 0xF432), /* TI TUSB3410 */
+=A0=A0=A0=A0=A0=A0=A0.driver_info =3D NO_CAP_LINE,
+=A0=A0=A0=A0=A0=A0=A0},
Note that the TUSB3410 is a generic 805x + USB type
controller, which doesn't come AFAIK with CDC-ACM
firmware of any flavor.

So the comment there should say what device (and hence
firmware) it's being used with. Like the specific
MSP-FET430 product it's being used with, if I didn't
misremember earlier parts of this thread ...


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Vincent Del Medico
2009-05-04 09:04:38 UTC
Permalink
Post by Oliver Neukum
Please try this additional patch.
=A0 =A0 =A0 =A0Regards
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Oliver
While init :

usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no m=
odem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x22 val: 0x0 len: 0x=
0 result:
0
drivers/usb/class/cdc-acm.c: acm_control_msg: rq: 0x20 val: 0x0 len: 0x=
7 result:
7
cdc_acm 1-1.3.2:1.1: skipping garbage
cdc_acm 1-1.3.2:1.1: No union descriptor, giving up


Then, when I launch any program opening the /dev/ttyACM0 interface, it
goes very very very slowly ...
I suppose there's still something to change.

Thanks a lot for your help Oliver.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-05-04 13:35:24 UTC
Permalink
Post by Vincent Del Medico
Then, when I launch any program opening the /dev/ttyACM0 interface, it
goes very very very slowly ...
I suppose there's still something to change.
Good. We are getting somewhere. Please check your log files.
acm_tty_write() should write debbuging output.

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-***@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Oliver Neukum
2009-04-28 11:49:14 UTC
Permalink
Post by Vincent Del Medico
usb 1-1.3.2: configuration #1 chosen from 1 choice
cdc_acm 1-1.3.2:1.0: This device cannot do calls on its own. It is no modem.
cdc_acm 1-1.3.2:1.0: No union descriptor, testing for castrated device
drivers/usb/class/cdc-acm.c: interfaces are valid
cdc_acm 1-1.3.2:1.0: ttyACM0: USB ACM device
0x0 result: 0
0x7 result: 7
These are not errors. Can you do an strace?

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