Passmark USB loopback test plugs

Greg KH greg at kroah.com
Tue Nov 20 21:06:56 UTC 2007


On Tue, Nov 20, 2007 at 04:24:19PM -0400, Felipe Balbi wrote:
> >
> > My question is _why_ does it need to be a kernel driver, why can't this
> > all be done in userspace instead?
> 
> On musb driver I was using a kernel driver with a sysfs interface and
> a hacked usb cable with 1k resistor between D+/D- and a switchable
> load between Vbus and GROUND (500mA and 100mA).
> Of course this code is musb specific and shouldn't even get integrated
> to linux-omap nor to mainline.

Why not, have you posted it anywhere?  That sounds a bit useful to have,
although why it too would need to be a kernel driver is a bit strange.

> Having a proper device for running loopback tests (it this is the same
> loopback test I'm wondering :-p)
> would allow us to provide "portable" code that would work with any
> HCD, not only this or that one.

Ah, I see, your hacked cable is not a "real" device that the HCD could
discover at all.

And have you looked at the usbtest module?  It already provides such a
driver, that works for all HCDs today.

> Using a sysfs interface (aka linux device driver), looks better to me,
> and that's what I plan to do for USB HSET and USB Command Verifier
> tools for linux. If you pay attention on windows, those tools provides
> a different Host Controller Driver from where they can issue the
> commands they want.

Are you thinking to use sysfs to send USB commands to a device?  You do
know that sysfs is not made for this, right?  :)

> Well, that's only my opinion. Userspace should only handle the results
> reported by sysfs interfaces or whatever the driver wanna do.

Again, at first glance, this driver looks like it can be written in
userspace, using usbfs, without any kernel code at all.  That's my main
question.

thanks,

greg k-h



More information about the devel mailing list