Skip to contentSkip to conversation

CDC ethernet device support ?

Qemu-devel Frédéric Blanchet-Momas 1 participant 1 message Mar 15, 2007

lore
Share & tools
lore
#0 lore raw

Hello

We would use qemu and a target Linux platform with CDC Ethernet
equipment.
The host is Linux or Windows with libusb.

When The device is plugged to the target system, the usb0 network
interface is up, like a no-virtualized system, but all frames are marked in error.

ifconfig usb0 ->
usb0 Link encap:Ethernet HWaddr 92:A9:08:75:E0:83
inet adr:172.17.100.100 Bcast:172.17.255.255 Masque:255.255.0.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:687 dropped:0 overruns:0 frame:0 TX packets:0 errors:3 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000
RX bytes:0 (0.0 GiB) TX bytes:0 (0.0 MiB)

So I made a Linux qemu version with DEBUG_PACKET defined in the
'usb-uhci.c' file.
All initialisation before loading the usbnet module, work fine, but when I load usbnet modules, It seems that usb communcation with external device and target system fails. I don't know very well USB protcols and CDC communication, so I'm not sure.

My target's kernel is 2.6.12, but the problem exists with 2.6.14 and
2.6.18 too (with initial usbnet module is replaced by both usbnet and cdc_ether modules). Is anybody able to use CDC equipment with qemu subsystem ? If not, I can modify the qemu usb-uhci support. But I don't know where to begin. Can you give me some advice ?

With the strace command on qemu system, I have see ioctl command
fail. ("ioctl(8, UI_DEV_DESTROY or USBDEVFS_BULK, 0xbfeec200) = -1
EINVAL (Invalid argument)" I trace the same message with DEBUG defined in usb-linux.c the Bulk message fail)

Thanks in advance for any help or advice.

Best regards
Frédéric Blanchet-Momas

.

Message on the qemu stdout with DEBUG_PACKET defined :

System intialisation
...
...
frame 139: pid=IN addr=0x02 ep=0 len=64
ret=26 p->len = 64 data_in= 1a 03 43 00 44 00 43 00 20 00 45 00 74 00
68 00 65 00 72 00 6e 00 65 00 74 00

frame 140: pid=OUT addr=0x02 ep=0 len=0
p->len = 0 data_out=
ret=0

frame 149: pid=SETUP addr=0x02 ep=0 len=8
p->len = 8 data_out= 80 06 05 03 09 04 ff 00
ret=54

frame 149: pid=IN addr=0x02 ep=0 len=64
ret=54 p->len = 64 data_in= 36 03 43 00 44 00 43 00 20 00 43 00 6f 00
6d 00 6d 00 75 00 6e 00 69 00 63 00 61 00 74 00 69 00 6f 00 6e 00 73 00 20 00 43 00 6f 00 6e 00 74 00 72 00 6f 00 6c 00

frame 151: pid=OUT addr=0x02 ep=0 len=0
p->len = 0 data_out=
ret=0

//-> usbnet.ko loaded

frame 1851: pid=SETUP addr=0x02 ep=0 len=8
p->len = 8 data_out= 01 0b 01 00 01 00 00 00
ret=0

frame 1851: pid=IN addr=0x02 ep=0 len=0
ret=0

frame 1910: pid=SETUP addr=0x02 ep=0 len=8
p->len = 8 data_out= 80 06 03 03 09 04 ff 00
ret=26

frame 1910: pid=IN addr=0x02 ep=0 len=64
ret=26 p->len = 64 data_in= 1a 03 39 00 32 00 41 00 39 00 30 00 38 00
37 00 35 00 45 00 30 00 38 00 33 00

frame 1912: pid=OUT addr=0x02 ep=0 len=0
p->len = 0 data_out=
ret=0

frame 535: pid=IN addr=0x02 ep=1 len=64
ret=-3

frame 560: pid=IN addr=0x02 ep=3 len=8
ret=8 p->len = 8 data_in= a1 00 01 00 01 00 00 00

frame 562: pid=SETUP addr=0x02 ep=0 len=8
p->len = 8 data_out= 02 01 00 00 81 00 00 00
ret=0

frame 562: pid=IN addr=0x02 ep=0 len=0
ret=0

frame 563: pid=IN addr=0x02 ep=1 len=64
ret=-3

frame 564: pid=SETUP addr=0x02 ep=0 len=8
p->len = 8 data_out= 02 01 00 00 81 00 00 00
ret=0

frame 564: pid=IN addr=0x02 ep=0 len=0
ret=0

frame 565: pid=IN addr=0x02 ep=1 len=64
ret=-3

... // usb message loop -> the usb0 network marks in error all packets