Re: [PATCH] USB: OTG: Fix weirdnesses on enumerating partial otg devices

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Brownell
Date: Tuesday, February 12, 2008 - 6:02 am

On Tuesday 12 February 2008, Felipe Balbi wrote:

Wrong ... the meaning of that flag is:  *THIS* system is a
Linux-USB OTG device which came up in B-peripheral role, and
then through the magic of HNP morphed into the B-host role.

Linux is acting as a host at that point.  So either it's
being the A-host, or the B-host.  That flag says which.  If
the other device has the A-connector, yet we're the B-host,
then right now it is acting as an A-peripheral.  That's
exactly what HNP is designed to do.



Again wrong ... if the host side's b_hnp_enable flag is set,
that means this is a Linux-USB OTG device which came up in
A-host role and enumerated some vendor's OTG device, and
then set the b_hnp_enable flag.  (So it could in the future
use HNP to become an A-peripheral, despite having started
as an A-host.)



If the system is in b_host state, then HNP *ALREADY* happened.
So it can happen again, to go back into the b_peripheral state.
(And of course, we can't set the b_hnp_enable flag in a device
which is in the a_peripheral state...)


Seems like the root cause of the problem here is that you
have some correctly functioning code, but for some reason
you're surprised by that correct functioning.  (Maybe this
is a case where neither device is on the other's whitelist?)

- Dave

p.s. http://www.linux-usb.org/gadget/h2-otg.html
     does talk about those two bits, albeit succinctly.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] USB: OTG: Fix weirdnesses on enumerating parti ..., David Brownell, (Tue Feb 12, 6:02 am)