Lines Matching +full:enabled +full:- +full:strings
1 // SPDX-License-Identifier: GPL-2.0
5 * We call the USB code inside a Linux-based peripheral device a "gadget"
6 * driver, except for the hardware-specific bus glue. One USB host can
11 * (C) Copyright 2002-2004 by David Brownell
35 * struct usb_request - describes one i/o request
41 * @sg: a scatterlist for SG-capable controllers.
57 * its buffer may be re-used. The function will always be called with
72 * Code "-ESHUTDOWN" indicates completion caused by device disconnect,
79 * reside in a device-side FIFO when the request is reported as
83 * hardware's driver can add extra per-request data to the memory it returns,
94 * transfers. interrupt-only endpoints can be much less functional.
97 * it's thinner and promotes more pre-allocation.
127 /*-------------------------------------------------------------------------*/
129 /* endpoint-specific parts of the api to the usb controller hardware.
158 * struct usb_ep_caps - endpoint capabilities description
196 * struct usb_ep - device side representation of USB endpoint
197 * @name:identifier for the endpoint, such as "ep-a" or "ep9in-bulk"
198 * @ops: Function pointers used to access hardware-specific operations.
201 * @enabled: The current endpoint enabled/disabled state.
210 * by this EP (0 - 16, actual number is 2^n)
217 * enabled and remains valid until the endpoint is disabled.
222 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list,
234 bool enabled; member
245 /*-------------------------------------------------------------------------*/
291 /*-------------------------------------------------------------------------*/
298 __u8 besl_baseline; /* Recommended baseline BESL (0-15) */
299 __u8 besl_deep; /* Recommended deep BESL (0-15) */
336 * struct usb_gadget - represents a usb device
339 * @ops: Function pointers used to access hardware-specific operations.
359 * @sg_supported: true if we can handle scatter-gather
360 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
363 * is in the Mini-AB jack, and HNP has been used to switch roles
364 * so that the "A" device currently acts as A-Peripheral, not A-Host.
365 * @a_hnp_support: OTG device feature flag, indicating that the A-Host
367 * @a_alt_hnp_support: OTG device feature flag, indicating that the A-Host
369 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
370 * enabled HNP support.
373 * @host_request_flag: OTG device feature flag, indicating if A-Peripheral
374 * or B-Peripheral wants to take host role.
382 * @is_selfpowered: if the gadget is self-powered.
383 * @deactivated: True if gadget is deactivated - in deactivated state it cannot
390 * Gadgets have a mostly-portable "gadget driver" implementing device
392 * drivers talk to hardware-specific code indirectly, through ops vectors.
398 * read-only to the gadget driver. That driver data is part of the
406 * device is acting as a B-Peripheral (so is_a_peripheral is false).
454 { dev_set_drvdata(&gadget->dev, data); } in set_gadget_data()
456 { return dev_get_drvdata(&gadget->dev); } in get_gadget_data()
463 get_device(&gadget->dev); in usb_get_gadget()
468 put_device(&gadget->dev); in usb_put_gadget()
475 /* Legacy device-model interface */
482 /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
484 list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
487 * usb_ep_align - returns @len aligned to ep's maxpacketsize.
495 int max_packet_size = (size_t)usb_endpoint_maxp(ep->desc); in usb_ep_align()
501 * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget
513 return g->quirk_ep_out_aligned_size ? usb_ep_align(ep, len) : len; in usb_ep_align_maybe()
517 * gadget_is_altset_supported - return true iff the hardware supports
523 return !g->quirk_altset_not_supp; in gadget_is_altset_supported()
527 * gadget_is_stall_supported - return true iff the hardware supports stalling
532 return !g->quirk_stall_not_supp; in gadget_is_stall_supported()
536 * gadget_is_zlp_supported - return true iff the hardware supports zlp
541 return !g->quirk_zlp_not_supp; in gadget_is_zlp_supported()
545 * gadget_avoids_skb_reserve - return true iff the hardware would like to avoid
551 return g->quirk_avoids_skb_reserve; in gadget_avoids_skb_reserve()
555 * gadget_is_dualspeed - return true iff the hardware handles high speed
560 return g->max_speed >= USB_SPEED_HIGH; in gadget_is_dualspeed()
564 * gadget_is_superspeed() - return true if the hardware handles superspeed
569 return g->max_speed >= USB_SPEED_SUPER; in gadget_is_superspeed()
573 * gadget_is_superspeed_plus() - return true if the hardware handles
579 return g->max_speed >= USB_SPEED_SUPER_PLUS; in gadget_is_superspeed_plus()
583 * gadget_is_otg - return true iff the hardware is OTG-ready
584 * @g: controller that might have a Mini-AB connector
586 * This is a runtime test, since kernels with a USB-OTG stack sometimes
587 * run on boards which only have a Mini-B (or Mini-A) connector.
592 return g->is_otg; in gadget_is_otg()
598 /*-------------------------------------------------------------------------*/
640 /*-------------------------------------------------------------------------*/
643 * struct usb_gadget_driver - driver for usb gadget devices
675 * If gadget->is_otg is true, the gadget driver must provide an OTG
681 * Drivers use hardware-specific knowledge to configure the usb hardware.
710 * local controls (buttons, dials, etc) may need to be re-enabled since
738 /*-------------------------------------------------------------------------*/
743 * these will usually be implemented directly by the hardware-dependent
748 * usb_gadget_probe_driver - probe a gadget driver
761 * usb_gadget_unregister_driver - unregister a gadget driver
775 /*-------------------------------------------------------------------------*/
780 * struct usb_string - wraps a C string and its USB id
782 * @s:the string, in UTF-8 encoding
793 * struct usb_gadget_strings - a set of USB strings in a given language
794 * @language:identifies the strings' language (0x0409 for en-us)
795 * @strings:array of strings with their ids
798 * strings for a given language.
801 u16 language; /* 0x0409 for en-us */
802 struct usb_string *strings; member
816 /*-------------------------------------------------------------------------*/
828 /* copy a NULL-terminated vector of descriptors */
833 * usb_free_descriptors - free descriptors returned by usb_copy_descriptors()
853 /*-------------------------------------------------------------------------*/
869 struct usb_request *req, int is_in) { return -ENOSYS; } in usb_gadget_map_request_by_dev()
871 struct usb_request *req, int is_in) { return -ENOSYS; } in usb_gadget_map_request()
879 /*-------------------------------------------------------------------------*/
886 /*-------------------------------------------------------------------------*/
892 /*-------------------------------------------------------------------------*/
899 /*-------------------------------------------------------------------------*/
906 /*-------------------------------------------------------------------------*/
914 /*-------------------------------------------------------------------------*/
919 /*-------------------------------------------------------------------------*/