usbip icon indicating copy to clipboard operation
usbip copied to clipboard

not implemented: control in

Open jamesadevine opened this issue 3 years ago • 7 comments

Hiya!

I have an app exposing a usbip virtual device and getting the following when running sudo lsusb -v from Linux:

Control IN setup=SetupPacket { request_type: c0, request: a, value: 0, index: 1, length: 1 }
thread 'tokio-runtime-worker' panicked at 'not implemented: control in'

First, I'm not entirely sure what the 0xc0 request type is, any ideas? Second, it seems a bit harsh to simply panic - on a normal USB device I think it is conventional to stall? Is there a usbip equivalent that could be implemented instead?

jamesadevine avatar Jan 31 '23 18:01 jamesadevine

Which USB devices are you using? This seems to be a device-specific request by Linux driver.

You can find the definition of 0xc0 at https://www.beyondlogic.org/usbnutshell/usb6.shtml#SetupPacket

jiegec avatar Feb 01 '23 00:02 jiegec

Hi @jiegec , I faced same issue. My usb device is USB uart (0403:6010 Future Technology Devices International Limited Dual RS232-HS) Did you test with usb serial device?

khacluongspk avatar Feb 01 '23 04:02 khacluongspk

Hi @jiegec , I faced same issue. My usb device is USB uart (0403:6010 Future Technology Devices International Limited Dual RS232-HS) Did you test with usb serial device?

I see, the linux ftdi driver generates the request:

#define  FTDI_SIO_GET_LATENCY_TIMER_REQUEST_TYPE 0xC0
#define FTDI_SIO_GET_MODEM_STATUS_REQUEST_TYPE 0xc0
#define FTDI_SIO_READ_PINS_REQUEST_TYPE 0xc0
#define FTDI_SIO_READ_EEPROM_REQUEST_TYPE 0xc0

Will try to fix this. Currently I don't have a FTDI serial at hand, I can access one later this month.

jiegec avatar Feb 01 '23 04:02 jiegec

I pushed code to master branch, could you please test? I don't have testbed for now.

jiegec avatar Feb 01 '23 05:02 jiegec

Thanks! I am indeed emulating an ftdi device.

jamesadevine avatar Feb 01 '23 09:02 jamesadevine

If you emulating in Rust code, you might need to implement the new trait UsbDeviceHandler to handle the requests.

jiegec avatar Feb 01 '23 09:02 jiegec

yup - on it! Will contribute FTDI device handler when I have something that looks like it works...

jamesadevine avatar Feb 01 '23 09:02 jamesadevine