Announcement

Collapse
No announcement yet.

USB TEST : USB3 Plug Passmark - On the fly switch from USB 3.0 to USB 2.0 under Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • USB TEST : USB3 Plug Passmark - On the fly switch from USB 3.0 to USB 2.0 under Linux

    Hello

    I need implement automatized test from USB3 adapter where is on the fly switch from 3.0 to 2.0 on Linux Software.
    I was analysing the API and USB protocols to see how the the Windows Software does this, but everything visible is the USB Command 0x40 what causes the adapter to (i guess restart) and the rest seem to be handled by your device driver, so my question is what is proper sequence of commands for libusb driver does in this situation to get the same result in linux.

    I use the current linux API version 2.1.1000 you provide. Using USB2.0 cables is not solutions, because of automatized test. We tried use USB Hub to connect two devices, but was not always stable for detections.

  • #2
    The current version of the Linux API allows you to select the connection speed by re-enumerating the plug. The ConnectUSBPlug function takes a few parameters and one of them is "Speed" which lets you switch between SuperSpeed, High Speed and Full Speed modes.
    We have added more info in Linux API documentation, see https://www.passmark.com/ftp/Linux_U...ming_Guide.zip

    Comment


    • #3
      Thank you for your reply

      I set the USB3_SPEED argument of ConnectUSBPlug as for example USB_3_ST_HS but i still get USB 3.0 settings and speed like be set as SS (5GBit/s is displayed) and test bandwidth is around 2500Mbit/s.

      As in the example code defined, ConnectUSBPlug is called two times for the reconnect and we do same approach

      myspeed=USB_3_ST_HS; //2.0 speed

      if(ConnectUSBPlug(false, plugindex, myspeed, USB_3_TEST_LOOPBACK, &handle_udev, &MaxTransferSize, &CurrentTransferSize, &inBuffer, &outBuffer) == false)
      {
      printf("Couldn't connect to USB plug %d - %s\n", plugindex, usbInfo[plugindex].usbSerial);
      res=1;
      continue;
      }


      //if(usbInfo[plugindex].type == LOOPBACK_USB_3_PRODUCT_ID)
      if(true)
      {
      //Need to close and re-open device for USB 3 config
      if(ConnectUSBPlug ( true, plugindex, myspeed, USB_3_TEST_LOOPBACK, &handle_udev, &MaxTransferSize, &CurrentTransferSize, &inBuffer, &outBuffer) == false)
      {
      printf("Couldn't re-open USB3 plug %d - %s\n", plugindex, usbInfo[plugindex].usbSerial);
      usbInfo[plugindex].error=1; //error
      continue;
      }
      }

      Comment


      • #4
        You should do the same thing for calls to ConnectUSBPlug from within USB_3_BenchmarkTest.

        Comment

        Working...
        X