From: Krzysztof Opasiak <k.opasiak@samsung.com>
To: "'Michal Nazarewicz'" <mina86@mina86.com>,
"'Alan Stern'" <stern@rowland.harvard.edu>,
"'Felipe Balbi'" <balbi@ti.com>
Cc: Robert Baldyga <r.baldyga@samsung.com>,
gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
linux-kernel@vger.kernel.org,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
Karol Lewandowski <k.lewandowsk@samsung.com>,
Stanislaw Wadas <s.wadas@samsung.com>
Subject: RE: [PATCH] usb: gadget: f_fs: add "zombie" mode
Date: Wed, 08 Oct 2014 12:09:55 +0200 [thread overview]
Message-ID: <0ab101cfe2e0$030e6360$092b2a20$%opasiak@samsung.com> (raw)
In-Reply-To: <xa1toatny765.fsf@mina86.com>
Hi,
> -----Original Message-----
> From: Mike Nazarewicz [mailto:mpn@google.com] On Behalf Of Michal
> Nazarewicz
> Sent: Tuesday, October 07, 2014 10:08 PM
> To: Alan Stern; Felipe Balbi
> Cc: Krzysztof Opasiak; 'Robert Baldyga';
> gregkh@linuxfoundation.org; linux-usb@vger.kernel.org; linux-
> kernel@vger.kernel.org; andrzej.p@samsung.com
> Subject: Re: [PATCH] usb: gadget: f_fs: add "zombie" mode
>
> > On Tue, 7 Oct 2014, Felipe Balbi wrote:
> >> Right, but if we allow this, I can already see folks abusing to
> >> connect to the host early and only when necessary do some
> trickery to
> >> e.g. start adbd (not saying Android will do this, just using it
> as an
> >> easy example).
>
> I don't really see that happening. For the gadget to start all
> descriptors need to be known. Functionfs will know the
> descriptors
> only once the user space daemon provides them. Therefore, with the
> current features (or even with addition of Robert's feature) there
> is no
> way to let the gadget start without having the daemon running.
Well, to be honest we do some lazy daemon startup in gadgetd. The idea is to provide functionality quite similar to inet. So we have divided functionfs services into two parts:
- Descriptors - provided in configuration file
- function implementation - provided in binary
Now user can create ffs function using gadgetd without worrying about mounting the file system, running daemon and many other stuff. Gadgetd is system-wide usb gadget manager which provides abstraction layer for kernel functions and ffs-based functions.
Example:
User would like to create gadget which contains MTP in first configuration and ADB in second. When gadgetd receives such request via DBUS it creates suitable functions on configfs, find suitable configuration files, mount two instances of ffs, write descriptors from config files and run poll() on both ep0. Please notice here that any other daemon has not been run but the whole gadget can be bound to UDC.
When usb device is connected to host then host will select one of available configurations. All functions in that configuration receive ENABLE event. When gadgetd receives such event from one of ep0 then fork() is executed and desired service is being run with all file descriptors opened and ready to use. Please also notice here that if host select first configuration, only one of those daemon is going to be run.
(...)
--
Krzysztof Opasiak
Samsung R&D Institute Poland
Samsung Electronics
k.opasiak@samsung.com
next prev parent reply other threads:[~2014-10-08 10:10 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-06 11:25 Robert Baldyga
2014-10-06 12:36 ` Michal Nazarewicz
2014-10-06 12:51 ` Robert Baldyga
2014-10-06 14:07 ` Michal Nazarewicz
2014-10-07 2:28 ` Felipe Balbi
2014-10-07 6:33 ` Robert Baldyga
2014-10-07 14:06 ` Felipe Balbi
2014-10-07 15:01 ` Krzysztof Opasiak
2014-10-07 15:28 ` Felipe Balbi
2014-10-07 16:37 ` Krzysztof Opasiak
2014-10-07 16:51 ` Felipe Balbi
2014-10-07 17:15 ` Alan Stern
2014-10-07 17:57 ` Felipe Balbi
2014-10-07 18:42 ` Alan Stern
2014-10-07 18:57 ` Felipe Balbi
2014-10-07 19:16 ` Alan Stern
2014-10-07 20:08 ` Michal Nazarewicz
2014-10-08 10:09 ` Krzysztof Opasiak [this message]
2014-10-08 11:28 ` Michal Nazarewicz
2014-10-08 14:52 ` Alan Stern
2014-10-09 10:56 ` Michal Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='0ab101cfe2e0$030e6360$092b2a20$%opasiak@samsung.com' \
--to=k.opasiak@samsung.com \
--cc=andrzej.p@samsung.com \
--cc=balbi@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=k.lewandowsk@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mina86@mina86.com \
--cc=r.baldyga@samsung.com \
--cc=s.wadas@samsung.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®