none
Inline USB device class RRS feed

  • Question

  • Hi,

    I have hardware that is inline USB ie it has a host and a device USB interface.  Packets are passed through this device after some processing i.e commands are sent via the device interface and the result passed out through the host USB interface. What kind of device class should I use to enumerate this device?

    Thursday, June 12, 2014 3:34 PM

Answers

  • if the device is completely tied to an app, use winusb and you don't have to write a driver at all. as for the device class, just use the system class. no need to create your own class.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 13, 2014 5:12 PM

All replies

  • Is this a networking device such as the USB debugger cables?  I.E. does Host 1 send a USB packet and it passes through the device to go to Host 2?   As Pavel said, USB assumes the hardware on USB is a device.   I think we need to know more of what you are doing with this device before we can comment on how it should be handled?


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, June 12, 2014 4:13 PM
  • This device does some security processing - so commands come in through one port and results go through another. So what I enumerate this device as? A CDC?
    Thursday, June 12, 2014 4:15 PM
  • I guess I still have to ask, is this host 1 send encrpted or similar data and host 2 recieving the data or what?   If this thing has two ports is this that all commands are expected to go through one port and the response through the other?


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Thursday, June 12, 2014 4:27 PM
  • You are right. The commands come in through one port and the data (encrypted/deceypted) goes out the other.
    Thursday, June 12, 2014 7:00 PM
  • the device class is dictated by what functionality the OS sees the device providing. what type of data is the OS going to see and use? custom and specific to an app? networking? HID?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, June 12, 2014 7:09 PM
  • I am thinking custom headers on the data.
    Thursday, June 12, 2014 10:40 PM
  • what data? Networking? If your device wasn't messing with the data on the wire, what kind of data would it be?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, June 12, 2014 11:16 PM
  • data would be just a BLOB - something that needs to be encrypted/decrypted.
    Friday, June 13, 2014 1:24 AM
  • you are not helping your cause by not giving details. Is the host even aware of this device? Which app communicates with it?

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 13, 2014 4:45 AM
  • Sorry - I am providing the information I have! The product is in the architecture stages and we are still trying to figure out the details. We have a crypto device with two USB interfaces. We want to write a custom application on the host side that will provide commands like ENCRYPT/DECRYPT via the USB interface. The data to be encrypted would be a blob with some custom headers for the crypto device to know what to do with it.  I am thinking the host would need to enumerate this device  - just not sure what kind of device class to use.
    Friday, June 13, 2014 3:52 PM
  • Seriously consider just having a single USB interface.  There is nothing that says you cannot send commands and data down to the device and then read back the data from the same device.   Trying to have 2 USB devices makes little sense, and does make things a lot harder.


    Don Burn Windows Filesystem and Driver Consulting Website: http://www.windrvr.com Blog: http://msmvps.com/blogs/WinDrvr

    Friday, June 13, 2014 3:58 PM
  • Unfortunately there are some requirements that entail that the encrypt and decrypt data cannot mix on a given USB interface.

    Also, this is supposed to be an 'inline' device i.e. it takes data from one side - processes it (doesnt store it), and forwards it on out the other interface (which is also USB in this case) to the target endpoint.

    • Edited by catpheebs Friday, June 13, 2014 4:18 PM
    Friday, June 13, 2014 4:08 PM
  • if the device is completely tied to an app, use winusb and you don't have to write a driver at all. as for the device class, just use the system class. no need to create your own class.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, June 13, 2014 5:12 PM
  • Hi,

    Would I need to use (hijack) READ/WRITE CBW commands to send the device specific commands like ENCRYPT/DECRYPT etc?

    Wednesday, June 18, 2014 9:26 PM
  • now it sounds like a storage filter. You would want to filter above or below usbstor.sys

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, June 18, 2014 10:22 PM
  • Hmm. Is there any other way to send in the custom commands without using the read/write CDBs? If the device is enumerated with a system device class, would using a storage driver cause any conflicts?
    Wednesday, June 18, 2014 11:23 PM
  • the device class doesn't matter, the fdo matters. If usbstor is controlling the device, it will be treated as storage and you will need to filter . If you use your own fdo, you don't need a filter BUT it won't show up as a storage device

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, June 19, 2014 2:14 AM