• Home
  • Raw
  • Download

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
94 ------------------------------
101 where <name> can be any string which is legal in a filesystem and the
123 3. Creating the functions
124 -------------------------
126 The gadget will provide some functions, for each function its corresponding
129 $ mkdir functions/<name>.<instance name>
132 is an arbitrary string allowed in a filesystem, e.g.::
134 $ mkdir functions/ncm.usb0 # usb_f_ncm.ko gets loaded with request_module()
140 Each function provides its specific set of attributes, with either read-only
141 or read-write access. Where applicable they need to be written to as
143 Please refer to Documentation/ABI/*/configfs-usb-gadget* for more information.
145 4. Associating the functions with their configurations
146 ------------------------------------------------------
149 configurations specified and a number of functions available. What remains
150 is specifying which function is available in which configuration (the same
151 function can be used in multiple configurations). This is achieved with
154 $ ln -s functions/<name>.<instance name> configs/<name>.<number>
158 $ ln -s functions/ncm.usb0 configs/c.1
165 ----------------------
168 configurations and functions.
180 ./configs/c.1/ncm.usb0 -> ../../../../usb_gadget/g1/functions/ncm.usb0
186 ./functions
187 ./functions/ncm.usb0
188 ./functions/ncm.usb0/ifname
189 ./functions/ncm.usb0/qmult
190 ./functions/ncm.usb0/host_addr
191 ./functions/ncm.usb0/dev_addr
205 In order to enable the gadget it must be bound to a UDC (USB Device
210 where <udc name> is one of those found in /sys/class/udc/*
213 $ echo s3c-hsotg > UDC
217 -----------------------
224 --------------
226 Remove functions from configurations::
239 Remove strings directories in configurations:
263 Remove functions (function modules are not unloaded, though):
265 $ rmdir functions/<name>.<instance name>
269 $ rmdir functions/ncm.usb0
275 Remove strings directories in the gadget::
299 In configfs there are items and groups, both represented as directories.
301 other groups. In the picture below only an item is shown.
304 which can be read-only or read-write, depending on what they represent.
308 configured elements. However, they are embedded in usage-specific
309 larger structures. In the picture below there is a "cs" which contains
317 +--sa (file)
325 In the said function the "cs" and "sa" are retrieved using the well
331 two functions to decide what they actually do.
339 +----------------------------------+
341 +-----------------+ | (*store)(cs *, buffer, length); |
343 | +-------------+ | | +------------------+ |
344 | | struct |-|----|------>|struct | |
346 | +-------------+ | | +------------------+ |
347 | | +----------------------------------+
350 +-----------------+ .
353 the directories in general can be named at will. A group can have
354 a number of its default sub-groups created automatically.
362 idProduct etc) and default sub-groups (configs, functions, strings).
363 Writing to the attributes causes the information to be stored in
364 appropriate locations. In the configs, functions and strings sub-groups
365 a user can create their sub-groups to represent configurations, functions,
366 and groups of strings in a given language.
368 2. The user creates configurations and functions, in the configurations
369 creates symbolic links to functions. This information is used when the
371 to the UDC. The code in drivers/usb/gadget/configfs.c iterates over
372 all configurations, and in each configuration it iterates over all
373 functions and binds them. This way the whole gadget is bound.
377 - gadget's config_group
378 - gadget's default groups (configs, functions, strings)
379 - associating functions with configurations (symlinks)
382 configured, so config_groups for particular functions are defined
383 in the functions implementation files drivers/usb/gadget/f_*.c.
385 5. Function's code is written in such a way that it uses
387 usb_get_function_instance(), which, in turn, calls request_module.
388 So, provided that modprobe works, modules for particular functions