Lines Matching +full:in +full:- +full:functions

15 be connected to a USB Host to extend it with additional functions like a serial
20 functions, each function representing e.g. a serial connection or a SCSI disk.
22 Linux provides a number of functions for gadgets to use.
25 and which functions each configuration will provide.
39 In order for this to work configfs must be available, so CONFIGFS_FS must be
40 'y' or 'm' in .config. As of this writing USB_LIBCOMPOSITE selects CONFIGFS_FS.
50 http://www.spinics.net/lists/linux-usb/msg76388.html)
55 $ mount none $CONFIGFS_HOME -t configfs
60 -----------------------
82 In order to have a place to store them, a strings subdirectory must be created
100 Where function drivers support it, functions may allow symlinks to these custom
104 ------------------------------
111 where <name> can be any string which is legal in a filesystem and the
133 3. Creating the functions
134 -------------------------
136 The gadget will provide some functions, for each function its corresponding
139 $ mkdir functions/<name>.<instance name>
142 is an arbitrary string allowed in a filesystem, e.g.::
144 $ mkdir functions/ncm.usb0 # usb_f_ncm.ko gets loaded with request_module()
150 Each function provides its specific set of attributes, with either read-only
151 or read-write access. Where applicable they need to be written to as
153 Please refer to Documentation/ABI/testing/configfs-usb-gadget for more information.
155 4. Associating the functions with their configurations
156 ------------------------------------------------------
159 configurations specified and a number of functions available. What remains
160 is specifying which function is available in which configuration (the same
161 function can be used in multiple configurations). This is achieved with
164 $ ln -s functions/<name>.<instance name> configs/<name>.<number>
168 $ ln -s functions/ncm.usb0 configs/c.1
175 ----------------------
178 configurations and functions.
190 ./configs/c.1/ncm.usb0 -> ../../../../usb_gadget/g1/functions/ncm.usb0
196 ./functions
197 ./functions/ncm.usb0
198 ./functions/ncm.usb0/ifname
199 ./functions/ncm.usb0/qmult
200 ./functions/ncm.usb0/host_addr
201 ./functions/ncm.usb0/dev_addr
215 In order to enable the gadget it must be bound to a UDC (USB Device
220 where <udc name> is one of those found in /sys/class/udc/*
223 $ echo s3c-hsotg > UDC
227 -----------------------
234 --------------
236 Remove functions from configurations::
249 Remove strings directories in configurations:
273 Remove functions (function modules are not unloaded, though):
275 $ rmdir functions/<name>.<instance name>
279 $ rmdir functions/ncm.usb0
285 Remove strings directories in the gadget::
309 In configfs there are items and groups, both represented as directories.
311 other groups. In the picture below only an item is shown.
314 which can be read-only or read-write, depending on what they represent.
318 configured elements. However, they are embedded in usage-specific
319 larger structures. In the picture below there is a "cs" which contains
327 +--sa (file)
335 In the said function the "cs" and "sa" are retrieved using the well
341 two functions to decide what they actually do.
349 +----------------------------------+
351 +-----------------+ | (*store)(cs *, buffer, length); |
353 | +-------------+ | | +------------------+ |
354 | | struct |-|----|------>|struct | |
356 | +-------------+ | | +------------------+ |
357 | | +----------------------------------+
360 +-----------------+ .
363 the directories in general can be named at will. A group can have
364 a number of its default sub-groups created automatically.
372 idProduct etc) and default sub-groups (configs, functions, strings).
373 Writing to the attributes causes the information to be stored in
374 appropriate locations. In the configs, functions and strings sub-groups
375 a user can create their sub-groups to represent configurations, functions,
376 and groups of strings in a given language.
378 2. The user creates configurations and functions, in the configurations
379 creates symbolic links to functions. This information is used when the
381 to the UDC. The code in drivers/usb/gadget/configfs.c iterates over
382 all configurations, and in each configuration it iterates over all
383 functions and binds them. This way the whole gadget is bound.
387 - gadget's config_group
388 - gadget's default groups (configs, functions, strings)
389 - associating functions with configurations (symlinks)
392 configured, so config_groups for particular functions are defined
393 in the functions implementation files drivers/usb/gadget/f_*.c.
395 5. Function's code is written in such a way that it uses
397 usb_get_function_instance(), which, in turn, calls request_module.
398 So, provided that modprobe works, modules for particular functions