Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/linux/usb
File: gadgetfs.h
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
[0] Fix | Delete
/*
[1] Fix | Delete
* Filesystem based user-mode API to USB Gadget controller hardware
[2] Fix | Delete
*
[3] Fix | Delete
* Other than ep0 operations, most things are done by read() and write()
[4] Fix | Delete
* on endpoint files found in one directory. They are configured by
[5] Fix | Delete
* writing descriptors, and then may be used for normal stream style
[6] Fix | Delete
* i/o requests. When ep0 is configured, the device can enumerate;
[7] Fix | Delete
* when it's closed, the device disconnects from usb. Operations on
[8] Fix | Delete
* ep0 require ioctl() operations.
[9] Fix | Delete
*
[10] Fix | Delete
* Configuration and device descriptors get written to /dev/gadget/$CHIP,
[11] Fix | Delete
* which may then be used to read usb_gadgetfs_event structs. The driver
[12] Fix | Delete
* may activate endpoints as it handles SET_CONFIGURATION setup events,
[13] Fix | Delete
* or earlier; writing endpoint descriptors to /dev/gadget/$ENDPOINT
[14] Fix | Delete
* then performing data transfers by reading or writing.
[15] Fix | Delete
*/
[16] Fix | Delete
[17] Fix | Delete
#ifndef __LINUX_USB_GADGETFS_H
[18] Fix | Delete
#define __LINUX_USB_GADGETFS_H
[19] Fix | Delete
[20] Fix | Delete
#include <linux/types.h>
[21] Fix | Delete
#include <linux/ioctl.h>
[22] Fix | Delete
[23] Fix | Delete
#include <linux/usb/ch9.h>
[24] Fix | Delete
[25] Fix | Delete
/*
[26] Fix | Delete
* Events are delivered on the ep0 file descriptor, when the user mode driver
[27] Fix | Delete
* reads from this file descriptor after writing the descriptors. Don't
[28] Fix | Delete
* stop polling this descriptor.
[29] Fix | Delete
*/
[30] Fix | Delete
[31] Fix | Delete
enum usb_gadgetfs_event_type {
[32] Fix | Delete
GADGETFS_NOP = 0,
[33] Fix | Delete
[34] Fix | Delete
GADGETFS_CONNECT,
[35] Fix | Delete
GADGETFS_DISCONNECT,
[36] Fix | Delete
GADGETFS_SETUP,
[37] Fix | Delete
GADGETFS_SUSPEND,
[38] Fix | Delete
/* and likely more ! */
[39] Fix | Delete
};
[40] Fix | Delete
[41] Fix | Delete
/* NOTE: this structure must stay the same size and layout on
[42] Fix | Delete
* both 32-bit and 64-bit kernels.
[43] Fix | Delete
*/
[44] Fix | Delete
struct usb_gadgetfs_event {
[45] Fix | Delete
union {
[46] Fix | Delete
/* NOP, DISCONNECT, SUSPEND: nothing
[47] Fix | Delete
* ... some hardware can't report disconnection
[48] Fix | Delete
*/
[49] Fix | Delete
[50] Fix | Delete
/* CONNECT: just the speed */
[51] Fix | Delete
enum usb_device_speed speed;
[52] Fix | Delete
[53] Fix | Delete
/* SETUP: packet; DATA phase i/o precedes next event
[54] Fix | Delete
*(setup.bmRequestType & USB_DIR_IN) flags direction
[55] Fix | Delete
* ... includes SET_CONFIGURATION, SET_INTERFACE
[56] Fix | Delete
*/
[57] Fix | Delete
struct usb_ctrlrequest setup;
[58] Fix | Delete
} u;
[59] Fix | Delete
enum usb_gadgetfs_event_type type;
[60] Fix | Delete
};
[61] Fix | Delete
[62] Fix | Delete
[63] Fix | Delete
/* The 'g' code is also used by printer gadget ioctl requests.
[64] Fix | Delete
* Don't add any colliding codes to either driver, and keep
[65] Fix | Delete
* them in unique ranges (size 0x20 for now).
[66] Fix | Delete
*/
[67] Fix | Delete
[68] Fix | Delete
/* endpoint ioctls */
[69] Fix | Delete
[70] Fix | Delete
/* IN transfers may be reported to the gadget driver as complete
[71] Fix | Delete
* when the fifo is loaded, before the host reads the data;
[72] Fix | Delete
* OUT transfers may be reported to the host's "client" driver as
[73] Fix | Delete
* complete when they're sitting in the FIFO unread.
[74] Fix | Delete
* THIS returns how many bytes are "unclaimed" in the endpoint fifo
[75] Fix | Delete
* (needed for precise fault handling, when the hardware allows it)
[76] Fix | Delete
*/
[77] Fix | Delete
#define GADGETFS_FIFO_STATUS _IO('g', 1)
[78] Fix | Delete
[79] Fix | Delete
/* discards any unclaimed data in the fifo. */
[80] Fix | Delete
#define GADGETFS_FIFO_FLUSH _IO('g', 2)
[81] Fix | Delete
[82] Fix | Delete
/* resets endpoint halt+toggle; used to implement set_interface.
[83] Fix | Delete
* some hardware (like pxa2xx) can't support this.
[84] Fix | Delete
*/
[85] Fix | Delete
#define GADGETFS_CLEAR_HALT _IO('g', 3)
[86] Fix | Delete
[87] Fix | Delete
#endif /* __LINUX_USB_GADGETFS_H */
[88] Fix | Delete
[89] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function