Hi,

On Thu, Jul 02, 2015 at 06:02:50PM -0700, Y. Zhang wrote:
> Hi all,
> 
> I'm new to linux usb and would like some guidance on achieving some of
> the following goals.
> I have a beaglebone black (BBB - currently running kernel v3.12) with

you need to ask for support from whoever gave you that v3.12 kernel. If
you're using TI's releases, then you need to get in touch with TI's
official support channels. This forum, can't really help you out unless
you move to v4.1 kernel.

> OTG in peripheral mode on usb bus#1 and a host port to connect devices
> on usb bus#2.
> 
> 1. usb bus#1: connect OTG on BBB as a musb gadget (via gadgetfs) to
> another PC host (e.g. linux, windows, etc); usb bus#2: connect a hub
> to BBB host
> + using libusb to control the hub
> + relay all traffics from host->musb gadget->libusb->hub->(applicable
> multiple devices hot-plugged to the hub), and vice versa
> 
> So far I'm able to see traffics between the PC host and the hub before
> plugging any device into the hub. That is, usb traffics for endpoints
> of the hub itself. Once I plug in a device, after certain actions on
> the hub port, the host will send requests (get_descriptor/set_address)
> to address 0, which are not forwarded to the gadhetfs user space. I'd
> like to know:
> * Are traffics for address 0 visible to musb gadget? What code in
> usb/musb and/or usb/gadget can be used/revised to retrieve/handle
> them?
> * If it is feasible to accomplish the above, then the PC host would
> enumerate devices plugged into the hub. What code usage/change would
> be necessary to further retrieve messages addressed to endpoints of
> individual devices and relay them to the HUB (so the HUB can broadcast
> to individual devices), and also forward messages from devices
> received via hub (with libusb) back to host via musb gadget?
> 
> 2. usb bus#1: connect the BBB OTG to a hub attached to the PC host
>    + using musb gadget if needed: host-hub-OTG-(gadget)
>    + when the host sends any messages to the hub, it would then
> broadcast (at least for usb2.0) to all ports on the hub.
>    + sniff broadcast traffic on the OTG usb port (on bus#1)
> 
> I don't necessarily need the OTG gadget to respond anything to the hub
> or PC host, but hope to sniff all usb messages broadcast by the hub,
> which means I will be able to see messages sent by the PC host to
> other devices plugged into the hub. What code in usb/musb and/or
> usb/gadget can be used/revised to sniff such traffics? I've tried
> usbmon but it only monitors devices controlled by hcd (on bus#2) not
> the OTG in peripheral mode (on bus#1)

you really want a HW sniffer. Another option is to mess around with
tracepoints and add support for tracing usb_requests and dump out the
necessary data.

cheers

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to