BR,Peter Chen On Thu, Mar 7, 2019 at 11:26 PM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote: > > On Thu, Mar 07, 2019 at 03:24:29PM +0100, rchmielarz wrote: > > Hi, > > > > I'm trying to certify USB on our device that is running Linux 4.14. > > For windows systems we were using https://www.usb.org/usb2tools. For > > linux the only option I have found is a kernel module called EHSET. > > Unfortunately I can't manage to get it working, can You please help? > > > > I have added the following configuration: > > CONFIG_USB_HCD_TEST_MODE=y > > USB_EHSET_TEST_FIXTURE=m > > > > Then on the system I type in modprobe ehset. After this looking at the > > source code of ehset.c I assumed that inserting USB stick with > > VendorID: 0x1a0a and ProductID: 0x0104 would start the Packet command, > > but it doesn't do anything (not output visible on the oscilloscope). > > The device is loaded as a regular USB stick. > > > > The output I see is: > > [ 1059.904034] ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1 > > [ 1059.935515] ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00 > > [ 1059.941700] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 > > [ 1059.948523] usb usb1: New USB device strings: Mfr=3, Product=2, > > SerialNumber=1 > > [ 1059.955776] usb usb1: Product: EHCI Host Controller > > [ 1059.960680] usb usb1: Manufacturer: Linux 4.14.87-rt50 ehci_hcd > > [ 1059.966627] usb usb1: SerialNumber: ci_hdrc.0 > > [ 1059.974486] usb usb1: usb_probe_device > > [ 1059.982387] hub 1-0:1.0: usb_probe_interface > > [ 1059.986735] hub 1-0:1.0: USB hub found > > [ 1059.990614] hub 1-0:1.0: 1 port detected > > [ 1060.475521] usb 1-1: new high-speed USB device number 2 using ci_hdrc > > [ 1060.677970] usb 1-1: New USB device found, idVendor=1a0a, idProduct=0104 > > [ 1060.684709] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > > [ 1060.691877] usb 1-1: Product: USB DISK 3.0 > > [ 1060.696005] usb 1-1: Manufacturer: > > [ 1060.700215] usb 1-1: SerialNumber: 190073AE389B2300 > > [ 1060.708279] usb 1-1: usb_probe_device > > [ 1060.716351] usb-storage 1-1:1.0: usb_probe_interface > > [ 1060.724692] usb-storage 1-1:1.0: USB Mass Storage device detected > > [ 1060.745330] scsi host1: usb-storage 1-1:1.0 > You need to have a device with the below vid and pid, that device can let your ehci host enter test mode, eg, sending test packet for eye diagram. 122 static const struct usb_device_id ehset_id_table[] = { 123 { USB_DEVICE(0x1a0a, TEST_SE0_NAK_PID) }, 124 { USB_DEVICE(0x1a0a, TEST_J_PID) }, 125 { USB_DEVICE(0x1a0a, TEST_K_PID) }, 126 { USB_DEVICE(0x1a0a, TEST_PACKET_PID) }, 127 { USB_DEVICE(0x1a0a, TEST_HS_HOST_PORT_SUSPEND_RESUME) }, 128 { USB_DEVICE(0x1a0a, TEST_SINGLE_STEP_GET_DEV_DESC) }, 129 { USB_DEVICE(0x1a0a, TEST_SINGLE_STEP_SET_FEATURE) }, 130 { } /* Terminating entry */ 131 }; 132 MODULE_DEVICE_TABLE(usb, ehset_id_table); Peter > The usb-storage driver bound to your device first. Try building a > kernel without that driver and then it shoudl bind to the other driver. > > Or manually bind the ehset driver to your device through sysfs. Read up > on the documentation for the "new_id" and "bind" and "unbind" sysfs > files for how to do that. > > thanks, > > greg k-h