* [3/3] Documentation: usb: Add docs for configfs control requests
@ 2018-04-17 1:17 Jerry Zhang
0 siblings, 0 replies; 3+ messages in thread
From: Jerry Zhang @ 2018-04-17 1:17 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman, linux-usb
Cc: Michal Nazarewicz, Krzysztof Opasiak, Badhri Jagan Sridharan,
Andrzej Pietrasiewicz, Lars-Peter Clausen, felixhaedicke,
Jerry Zhang
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.
+
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [3/3] Documentation: usb: Add docs for configfs control requests
@ 2018-07-02 22:01 Jerry Zhang
0 siblings, 0 replies; 3+ messages in thread
From: Jerry Zhang @ 2018-07-02 22:01 UTC (permalink / raw)
To: Felipe Balbi, Michal Nazarewicz, Greg Kroah-Hartman
Cc: linux-usb, zhangjerry, jerryxzha, android-kernel-team
Signed-off-by: Jerry Zhang <zhangjerry@google.com>
---
Documentation/usb/gadget_configfs.txt | 34 +++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/Documentation/usb/gadget_configfs.txt b/Documentation/usb/gadget_configfs.txt
index b8cb38a98c19..64f69dd3f123 100644
--- a/Documentation/usb/gadget_configfs.txt
+++ b/Documentation/usb/gadget_configfs.txt
@@ -285,6 +285,40 @@ 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 functionfs descriptors to /dev/ffs-ctrl/ep0
+# Descriptor header must include ALL_CTRL_RECIP AND CONTROL_ONLY
+# and must *not* include any speed descriptors.
+
+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.
+
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [3/3] Documentation: usb: Add docs for configfs control requests
@ 2018-07-03 6:35 Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2018-07-03 6:35 UTC (permalink / raw)
To: Jerry Zhang
Cc: Felipe Balbi, Michal Nazarewicz, linux-usb, jerryxzha,
android-kernel-team
On Mon, Jul 02, 2018 at 03:01:03PM -0700, Jerry Zhang wrote:
> Signed-off-by: Jerry Zhang <zhangjerry@google.com>
> ---
> Documentation/usb/gadget_configfs.txt | 34 +++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
I can't take patches without any changelog text at all, sorry.
greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-03 6:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-03 6:35 [3/3] Documentation: usb: Add docs for configfs control requests Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2018-07-02 22:01 Jerry Zhang
2018-04-17 1:17 Jerry Zhang
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).