From: Jerry Zhang <zhangjerry@google.com>
To: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org
Cc: Michal Nazarewicz <mina86@mina86.com>,
Krzysztof Opasiak <kopasiak90@gmail.com>,
Badhri Jagan Sridharan <badhri@google.com>,
Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
Lars-Peter Clausen <lars@metafoo.de>,
felixhaedicke@web.de, Jerry Zhang <zhangjerry@google.com>
Subject: [3/3] Documentation: usb: Add docs for configfs control requests
Date: Mon, 16 Apr 2018 18:17:42 -0700 [thread overview]
Message-ID: <20180417011742.192184-4-zhangjerry@google.com> (raw)
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
---
Documentation/usb/gadget_configfs.txt | 32 +++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/Documentation/usb/gadget_configfs.txt b/Documentation/usb/gadget_configfs.txt
index 635e57493709..a50f16c8a4bb 100644
--- a/Documentation/usb/gadget_configfs.txt
+++ b/Documentation/usb/gadget_configfs.txt
@@ -285,6 +285,38 @@ e.g.:
$ rmdir g1
+8. Handling control requests
+--------------
+
+A composite gadget with changing configurations may still want to handle
+vendor control requests in a centralized location. In particular, functionfs
+instances can pass control requests to user-space, but there is no
+guarantee that a functionfs is in the current config.
+
+To handle this there is a special config in the root of the gadget
+called control_config. Functions linked here do not appear in the
+configuration, but will receive control requests. To use it:
+
+Create a special instance of functionfs.
+
+$ mkdir functions/ffs.ctrl
+
+Mount the functionfs instance and write descriptors.
+
+mount functionfs ctrl /dev/ffs-ctrl
+# Write dummy functionfs descriptors to /dev/ffs-ctrl/ep0
+# Descriptors should include flag FUNCTIONFS_ALL_CTRL_RECIP
+
+Link the function into control config.
+
+$ ln -s functions/ffs.ctrl control_config/f1
+
+Link normal functions into the appropriate config, and enable the gadget.
+
+$ echo <udc name> > UDC
+
+Handle control requests in /dev/ffs-ctrl/ep0. See functionfs documentation on how to do this.
+
next reply other threads:[~2018-04-17 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 1:17 Jerry Zhang [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-07-02 22:01 [3/3] Documentation: usb: Add docs for configfs control requests Jerry Zhang
2018-07-03 6:35 Greg Kroah-Hartman
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=20180417011742.192184-4-zhangjerry@google.com \
--to=zhangjerry@google.com \
--cc=andrzej.p@samsung.com \
--cc=badhri@google.com \
--cc=balbi@kernel.org \
--cc=felixhaedicke@web.de \
--cc=gregkh@linuxfoundation.org \
--cc=kopasiak90@gmail.com \
--cc=lars@metafoo.de \
--cc=linux-usb@vger.kernel.org \
--cc=mina86@mina86.com \
/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;
as well as URLs for NNTP newsgroup(s).