-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hi guys,
I am trying to get my usb2sniffer to work, but upon pluging in, I get this:
[462615.961437] FT60x i/f 0 now probed: (0403:601F)
[462615.961443] ID->bNumEndpoints: 02
[462615.961446] ID->bInterfaceClass: FF
[462615.961448] ED[0]->bEndpointAddress: 0x01
[462615.961451] ED[0]->bmAttributes: 0x02
[462615.961453] ED[0]->wMaxPacketSize: 0x0200 (512)
[462615.961456] ED[1]->bEndpointAddress: 0x81
[462615.961458] ED[1]->bmAttributes: 0x03
[462615.961459] ED[1]->wMaxPacketSize: 0x0040 (64)
[462615.961464] maxp = 64
[462615.962239] FT60x i/f 1 now probed: (0403:601F)
[462615.962245] ID->bNumEndpoints: 02
[462615.962247] ID->bInterfaceClass: FF
[462615.962249] ED[0]->bEndpointAddress: 0x02
[462615.962251] ED[0]->bmAttributes: 0x02
[462615.962253] ED[0]->wMaxPacketSize: 0x0200 (512)
[462615.962266] ED[1]->bEndpointAddress: 0x82
[462615.962268] ED[1]->bmAttributes: 0x02
[462615.962269] ED[1]->wMaxPacketSize: 0x0200 (512)
[462615.962414] ft60x 3-2:1.1: USB FT60x device now attached to ft60x-0
[462618.499149] ft60x_int_callback - urb shutting down with status: -108
And these are my changes:
ard@lenny:/mnt/source/ard/usb2sniffer/ft60x_driver$ git diff -u
diff --git a/ft60x.c b/ft60x.c
index 2e92cec..3d5036a 100644
--- a/ft60x.c
+++ b/ft60x.c
@@ -464,7 +464,7 @@ static int ft60x_send_cmd_read(struct usb_ft60x *dev, size_t count)
dev->ft->ctrlreq.pipe = dev->bulk_in_endpointAddr;
dev->ft->ctrlreq.cmd = 1;
if (notif) {
- dev->ft->ctrlreq.len = min(dev->bulk_in_size * 128, dev->len_to_read);
+ dev->ft->ctrlreq.len = min_t(size_t,dev->bulk_in_size * 128, dev->len_to_read);
} else {
dev->ft->ctrlreq.len = dev->bulk_in_size * 128;
}
@@ -507,7 +507,7 @@ static int ft60x_do_read_io(struct usb_ft60x *dev, size_t count)
usb_rcvbulkpipe(dev->udev,
dev->bulk_in_endpointAddr),
dev->bulk_in_buffer,
- min(dev->bulk_in_size * 128,
+ min_t(size_t,dev->bulk_in_size * 128,
dev->len_to_read),
ft60x_read_bulk_callback, dev);
} else {
@@ -1061,7 +1061,9 @@ static int ft60x_alloc_ctrl_interface(struct usb_ft60x *dev,
/* get a handle to the interrupt data pipe */
pipe = usb_rcvintpipe(dev->udev,
endpoint->bEndpointAddress);
- maxp = usb_maxpacket(dev->udev, pipe, usb_pipeout(pipe));
+ //maxp = usb_maxpacket(dev->udev, pipe, usb_pipeout(pipe));
+ maxp = usb_maxpacket(dev->udev, pipe);
+ printk(KERN_INFO "maxp = %d\n", maxp);
usb_fill_int_urb(dev->int_in_urb, dev->udev, pipe,
dev->int_in_buffer, maxp,
ft60x_int_callback, dev,
As far as I know, these were just necessary janitory changes:
usb_maxpacket had an argument that was obsolete.
The maxp is still 64 for an INT message, so that looks ok.
the min_t is a typed change.
I put it here as an issue because maybe someone else knows of more changes in the linux kernel, or my last few years not programming in C has made the obvious less obvious to me.
Anyway:
I tried usbsniffer-qt and that seems not to get any data from the sniffer, and I suspect that's because the URB is shutdown, and hence all communication with the board has halted because we don't schedule any new interrupt polls.
The USB shutdown happens on plugin. As far as I can tell, there are 2 interfaces being used.
Hmmm, I should be able to sniff what's going on with mere tcpdump...
For completeness: the usb device descriptor:
ard@lenny:~$ sudo lsusb -v -d 0403:601f
[sudo] password for ard:
Bus 003 Device 005: ID 0403:601f Future Technology Devices International, Ltd Myriad-RF LimeSDR-Mini
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.10
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x0403 Future Technology Devices International, Ltd
idProduct 0x601f Myriad-RF LimeSDR-Mini
bcdDevice 0.00
iManufacturer 1 FTDI
iProduct 2 FTDI SuperSpeed-FIFO Bridge
iSerial 3 000000000001
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x003f
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 96mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 255 Vendor Specific Class
bFunctionSubClass 255 Vendor Specific Subclass
bFunctionProtocol 255 Vendor Specific Protocol
iFunction 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
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 9
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Binary Object Store Descriptor:
bLength 5
bDescriptorType 15
wTotalLength 0x0016
bNumDeviceCaps 2
USB 2.0 Extension Device Capability:
bLength 7
bDescriptorType 16
bDevCapabilityType 2
bmAttributes 0x00000006
BESL Link Power Management (LPM) Supported
SuperSpeed USB Device Capability:
bLength 10
bDescriptorType 16
bDevCapabilityType 3
bmAttributes 0x00
wSpeedsSupported 0x000e
Device can operate at Full Speed (12Mbps)
Device can operate at High Speed (480Mbps)
Device can operate at SuperSpeed (5Gbps)
bFunctionalitySupport 2
Lowest fully-functional device speed is High Speed (480Mbps)
bU1DevExitLat 10 micro seconds
bU2DevExitLat 2047 micro seconds
Device Status: 0x000d
Self Powered
Test Mode