On 07/14/2010 09:52 AM, Brendan Jurd wrote:
Hi there, I am attempting to get data from an Opticon OPN-2001 USB barcode scanner (ID 065a:0009 Optoelectronics Co., Ltd). This device is detected successfully by the 'opticon' USB serial driver, and I get a device at /dev/ttyUSB0. dmesg output follows: usbserial: USB Serial Driver core USB Serial support registered for opticon opticon 5-2:1.0: opticon converter detected usb 5-2: opticon converter now attached to ttyUSB0 usbcore: registered new interface driver opticon When I attempt to write anything to /dev/ttyUSB0, I get an ENOEXEC "Exec format error": opticon ttyUSB0: opticon_write - usb_submit_urb(write bulk) failed with status = -8 I am currently seeing this bug on gentoo with 2.6.30, 2.6.32 and 2.6.34, but it has also been observed on an x64 Ubuntu Lucid machine. The bug has also been described separately in a gentoo forum post: http://forums.gentoo.org/viewtopic-t-719954.html I'm not sure how attempting to write to a device could possibly give rise to an ENOEXEC. My hunch is that drivers/usb/serial/opticon.c is populating the URB incorrectly or otherwise feeding bad information to usb_submit_urb(). I have attached the output from strace while trying to write to the device, my kernel .config, and the output of lspci -vvv. Please let me know if I can help by providing any other information. The device as reported by lsusb -v: Bus 005 Device 006: ID 065a:0009 Optoelectronics Co., Ltd Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x065a Optoelectronics Co., Ltd idProduct 0x0009 bcdDevice 9.00 iManufacturer 1 Optoelectronics Co., Ltd. iProduct 2 Barcode Device iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 25 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 5
The problem is that your device has only bulk in endpoint. Bulk out endpoint is needed for opticon driver to send data to device. Maybe this device receives data through control endpoint? Can you sniff this data transfer on Windows with original driver?
Device Status: 0x0000 (Bus Powered)
-- 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