Re: question about functionfs and composite gadget

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 27 Jul 2011 14:17:28 +0200, jacob pan <jacob.jun.pan@xxxxxxxxx> wrote:
my goal is to inform userspace the connection status of otg port such
that user can make a decision on which gadget role he wants to use for
the device. It seems these ffs_data_xxx functions cannot definitively
tell the connection state. I guess i may have to add uevents to the UDC
driver or OTG transcriver driver. But it would not be a generic
solution as functionfs.

ffs_data_*() only inform you about the state of FunctionFS being changed.
Namely that some userspace process started configuration or closed all
files thus stopping using FunctionFS.  This is not related to being or
not being connected to host/(otg-)device.

Recently posted (and merged I believe) UDC class provides uevents when
a gadget driver is loaded (such as g_ffs or g_ether) but that again
does not inform about the state of connection.

I guess your best bet would be to look at composite.c and adding uevents
somewhere there as it proxies communication on ep0 thus also connections
and such.  This, obviously, will only work for composite gadgets though
(both g_ffs and g_ether are composite gadgets).

If you are interested in just being connected, there may be some other
place to look at, which I'm unaware of.  One way I can think of is always
having a “fake” g_mass_storage which would report a single ejected LUN
and monitoring when hosts sets configuration on it.  Again, someone may
know a better solution for this though.

--
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux