Lines Matching +full:sg +full:- +full:micro
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.
42 * @num_sgs: number of SG entries
43 * @num_mapped_sgs: number of SG entries mapped to DMA (internal)
57 * its buffer may be re-used. The function will always be called with
67 * @frame_number: Reports the interval number in (micro)frame in which the
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.
105 struct scatterlist *sg; member
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.
210 * by this EP (0 - 16, actual number is 2^n)
222 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list,
245 /*-------------------------------------------------------------------------*/
291 /*-------------------------------------------------------------------------*/
298 __u8 besl_baseline; /* Recommended baseline BESL (0-15) */
299 __u8 besl_deep; /* Recommended deep BESL (0-15) */
332 * struct usb_gadget - represents a usb device
335 * @ops: Function pointers used to access hardware-specific operations.
351 * @sg_supported: true if we can handle scatter-gather
352 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
355 * is in the Mini-AB jack, and HNP has been used to switch roles
356 * so that the "A" device currently acts as A-Peripheral, not A-Host.
357 * @a_hnp_support: OTG device feature flag, indicating that the A-Host
359 * @a_alt_hnp_support: OTG device feature flag, indicating that the A-Host
361 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
365 * @host_request_flag: OTG device feature flag, indicating if A-Peripheral
366 * or B-Peripheral wants to take host role.
374 * @is_selfpowered: if the gadget is self-powered.
375 * @deactivated: True if gadget is deactivated - in deactivated state it cannot
382 * Gadgets have a mostly-portable "gadget driver" implementing device
384 * drivers talk to hardware-specific code indirectly, through ops vectors.
390 * read-only to the gadget driver. That driver data is part of the
398 * device is acting as a B-Peripheral (so is_a_peripheral is false).
441 { dev_set_drvdata(&gadget->dev, data); } in set_gadget_data()
443 { return dev_get_drvdata(&gadget->dev); } in get_gadget_data()
450 get_device(&gadget->dev); in usb_get_gadget()
455 put_device(&gadget->dev); in usb_put_gadget()
462 /* Legacy device-model interface */
469 /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
471 list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
474 * usb_ep_align - returns @len aligned to ep's maxpacketsize.
482 int max_packet_size = (size_t)usb_endpoint_maxp(ep->desc) & 0x7ff; in usb_ep_align()
488 * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget
500 return g->quirk_ep_out_aligned_size ? usb_ep_align(ep, len) : len; in usb_ep_align_maybe()
504 * gadget_is_altset_supported - return true iff the hardware supports
510 return !g->quirk_altset_not_supp; in gadget_is_altset_supported()
514 * gadget_is_stall_supported - return true iff the hardware supports stalling
519 return !g->quirk_stall_not_supp; in gadget_is_stall_supported()
523 * gadget_is_zlp_supported - return true iff the hardware supports zlp
528 return !g->quirk_zlp_not_supp; in gadget_is_zlp_supported()
532 * gadget_avoids_skb_reserve - return true iff the hardware would like to avoid
538 return g->quirk_avoids_skb_reserve; in gadget_avoids_skb_reserve()
542 * gadget_is_dualspeed - return true iff the hardware handles high speed
547 return g->max_speed >= USB_SPEED_HIGH; in gadget_is_dualspeed()
551 * gadget_is_superspeed() - return true if the hardware handles superspeed
556 return g->max_speed >= USB_SPEED_SUPER; in gadget_is_superspeed()
560 * gadget_is_superspeed_plus() - return true if the hardware handles
566 return g->max_speed >= USB_SPEED_SUPER_PLUS; in gadget_is_superspeed_plus()
570 * gadget_is_otg - return true iff the hardware is OTG-ready
571 * @g: controller that might have a Mini-AB connector
573 * This is a runtime test, since kernels with a USB-OTG stack sometimes
574 * run on boards which only have a Mini-B (or Mini-A) connector.
579 return g->is_otg; in gadget_is_otg()
585 /*-------------------------------------------------------------------------*/
624 /*-------------------------------------------------------------------------*/
627 * struct usb_gadget_driver - driver for usb gadget devices
659 * If gadget->is_otg is true, the gadget driver must provide an OTG
665 * Drivers use hardware-specific knowledge to configure the usb hardware.
694 * local controls (buttons, dials, etc) may need to be re-enabled since
722 /*-------------------------------------------------------------------------*/
727 * these will usually be implemented directly by the hardware-dependent
732 * usb_gadget_probe_driver - probe a gadget driver
745 * usb_gadget_unregister_driver - unregister a gadget driver
759 /*-------------------------------------------------------------------------*/
764 * struct usb_string - wraps a C string and its USB id
766 * @s:the string, in UTF-8 encoding
777 * struct usb_gadget_strings - a set of USB strings in a given language
778 * @language:identifies the strings' language (0x0409 for en-us)
785 u16 language; /* 0x0409 for en-us */
800 /*-------------------------------------------------------------------------*/
812 /* copy a NULL-terminated vector of descriptors */
817 * usb_free_descriptors - free descriptors returned by usb_copy_descriptors()
837 /*-------------------------------------------------------------------------*/
853 struct usb_request *req, int is_in) { return -ENOSYS; } in usb_gadget_map_request_by_dev()
855 struct usb_request *req, int is_in) { return -ENOSYS; } in usb_gadget_map_request()
863 /*-------------------------------------------------------------------------*/
870 /*-------------------------------------------------------------------------*/
876 /*-------------------------------------------------------------------------*/
883 /*-------------------------------------------------------------------------*/
890 /*-------------------------------------------------------------------------*/
898 /*-------------------------------------------------------------------------*/
903 /*-------------------------------------------------------------------------*/