The MSCC bug fix in 'net' had to be slightly adjusted because the register accesses are done slightly differently in net-next.
Showing the changes to include/uapi/linux (1 of 422 files). Show all
Unified · Split
| @@ -93,6 +93,64 @@ struct usb_raw_ep_io { · 92 unmodified lines | ||
| 93 | 93 | __u8 data[0]; |
| 94 | 94 | }; |
| 95 | 95 | |
| 96 | +/* Maximum number of non-control endpoints in struct usb_raw_eps_info. */ | |
| 97 | +#define USB_RAW_EPS_NUM_MAX 30 | |
| 98 | + | |
| 99 | +/* Maximum length of UDC endpoint name in struct usb_raw_ep_info. */ | |
| 100 | +#define USB_RAW_EP_NAME_MAX 16 | |
| 101 | + | |
| 102 | +/* Used as addr in struct usb_raw_ep_info if endpoint accepts any address. */ | |
| 103 | +#define USB_RAW_EP_ADDR_ANY 0xff | |
| 104 | + | |
| 105 | +/* | |
| 106 | + * struct usb_raw_ep_caps - exposes endpoint capabilities from struct usb_ep | |
| 107 | + * (technically from its member struct usb_ep_caps). | |
| 108 | + */ | |
| 109 | +struct usb_raw_ep_caps { | |
| 110 | + __u32 type_control : 1; | |
| 111 | + __u32 type_iso : 1; | |
| 112 | + __u32 type_bulk : 1; | |
| 113 | + __u32 type_int : 1; | |
| 114 | + __u32 dir_in : 1; | |
| 115 | + __u32 dir_out : 1; | |
| 116 | +}; | |
| 117 | + | |
| 118 | +/* | |
| 119 | + * struct usb_raw_ep_limits - exposes endpoint limits from struct usb_ep. | |
| 120 | + * @maxpacket_limit: Maximum packet size value supported by this endpoint. | |
| 121 | + * @max_streams: maximum number of streams supported by this endpoint | |
| 122 | + * (actual number is 2^n). | |
| 123 | + * @reserved: Empty, reserved for potential future extensions. | |
| 124 | + */ | |
| 125 | +struct usb_raw_ep_limits { | |
| 126 | + __u16 maxpacket_limit; | |
| 127 | + __u16 max_streams; | |
| 128 | + __u32 reserved; | |
| 129 | +}; | |
| 130 | + | |
| 131 | +/* | |
| 132 | + * struct usb_raw_ep_info - stores information about a gadget endpoint. | |
| 133 | + * @name: Name of the endpoint as it is defined in the UDC driver. | |
| 134 | + * @addr: Address of the endpoint that must be specified in the endpoint | |
| 135 | + * descriptor passed to USB_RAW_IOCTL_EP_ENABLE ioctl. | |
| 136 | + * @caps: Endpoint capabilities. | |
| 137 | + * @limits: Endpoint limits. | |
| 138 | + */ | |
| 139 | +struct usb_raw_ep_info { | |
| 140 | + __u8 name[USB_RAW_EP_NAME_MAX]; | |
| 141 | + __u32 addr; | |
| 142 | + struct usb_raw_ep_caps caps; | |
| 143 | + struct usb_raw_ep_limits limits; | |
| 144 | +}; | |
| 145 | + | |
| 146 | +/* | |
| 147 | + * struct usb_raw_eps_info - argument for USB_RAW_IOCTL_EPS_INFO ioctl. | |
| 148 | + * eps: Structures that store information about non-control endpoints. | |
| 149 | + */ | |
| 150 | +struct usb_raw_eps_info { | |
| 151 | + struct usb_raw_ep_info eps[USB_RAW_EPS_NUM_MAX]; | |
| 152 | +}; | |
| 153 | + | |
| 96 | 154 | /* |
| 97 | 155 | * Initializes a Raw Gadget instance. |
| 98 | 156 | * Accepts a pointer to the usb_raw_init struct as an argument. |
| @@ -115,37 +173,38 @@ struct usb_raw_ep_io { · 16 unmodified lines | ||
| 115 | 173 | #define USB_RAW_IOCTL_EVENT_FETCH _IOR('U', 2, struct usb_raw_event) |
| 116 | 174 | |
| 117 | 175 | /* |
| 118 | − * Queues an IN (OUT for READ) urb as a response to the last control request | |
| 119 | − * received on endpoint 0, provided that was an IN (OUT for READ) request and | |
| 120 | − * waits until the urb is completed. Copies received data to user for READ. | |
| 176 | + * Queues an IN (OUT for READ) request as a response to the last setup request | |
| 177 | + * received on endpoint 0 (provided that was an IN (OUT for READ) request), and | |
| 178 | + * waits until the request is completed. Copies received data to user for READ. | |
| 121 | 179 | * Accepts a pointer to the usb_raw_ep_io struct as an argument. |
| 122 | − * Returns length of trasferred data on success or negative error code on | |
| 180 | + * Returns length of transferred data on success or negative error code on | |
| 123 | 181 | * failure. |
| 124 | 182 | */ |
| 125 | 183 | #define USB_RAW_IOCTL_EP0_WRITE _IOW('U', 3, struct usb_raw_ep_io) |
| 126 | 184 | #define USB_RAW_IOCTL_EP0_READ _IOWR('U', 4, struct usb_raw_ep_io) |
| 127 | 185 | |
| 128 | 186 | /* |
| 129 | − * Finds an endpoint that supports the transfer type specified in the | |
| 130 | − * descriptor and enables it. | |
| 131 | − * Accepts a pointer to the usb_endpoint_descriptor struct as an argument. | |
| 187 | + * Finds an endpoint that satisfies the parameters specified in the provided | |
| 188 | + * descriptors (address, transfer type, etc.) and enables it. | |
| 189 | + * Accepts a pointer to the usb_raw_ep_descs struct as an argument. | |
| 132 | 190 | * Returns enabled endpoint handle on success or negative error code on failure. |
| 133 | 191 | */ |
| 134 | 192 | #define USB_RAW_IOCTL_EP_ENABLE _IOW('U', 5, struct usb_endpoint_descriptor) |
| 135 | 193 | |
| 136 | −/* Disables specified endpoint. | |
| 194 | +/* | |
| 195 | + * Disables specified endpoint. | |
| 137 | 196 | * Accepts endpoint handle as an argument. |
| 138 | 197 | * Returns 0 on success or negative error code on failure. |
| 139 | 198 | */ |
| 140 | 199 | #define USB_RAW_IOCTL_EP_DISABLE _IOW('U', 6, __u32) |
| 141 | 200 | |
| 142 | 201 | /* |
| 143 | − * Queues an IN (OUT for READ) urb as a response to the last control request | |
| 144 | − * received on endpoint usb_raw_ep_io.ep, provided that was an IN (OUT for READ) | |
| 145 | − * request and waits until the urb is completed. Copies received data to user | |
| 146 | − * for READ. | |
| 202 | + * Queues an IN (OUT for READ) request as a response to the last setup request | |
| 203 | + * received on endpoint usb_raw_ep_io.ep (provided that was an IN (OUT for READ) | |
| 204 | + * request), and waits until the request is completed. Copies received data to | |
| 205 | + * user for READ. | |
| 147 | 206 | * Accepts a pointer to the usb_raw_ep_io struct as an argument. |
| 148 | − * Returns length of trasferred data on success or negative error code on | |
| 207 | + * Returns length of transferred data on success or negative error code on | |
| 149 | 208 | * failure. |
| 150 | 209 | */ |
| 151 | 210 | #define USB_RAW_IOCTL_EP_WRITE _IOW('U', 7, struct usb_raw_ep_io) |
| @@ -164,4 +223,27 @@ struct usb_raw_ep_io { · 12 unmodified lines | ||
| 164 | 223 | */ |
| 165 | 224 | #define USB_RAW_IOCTL_VBUS_DRAW _IOW('U', 10, __u32) |
| 166 | 225 | |
| 226 | +/* | |
| 227 | + * Fills in the usb_raw_eps_info structure with information about non-control | |
| 228 | + * endpoints available for the currently connected UDC. | |
| 229 | + * Returns the number of available endpoints on success or negative error code | |
| 230 | + * on failure. | |
| 231 | + */ | |
| 232 | +#define USB_RAW_IOCTL_EPS_INFO _IOR('U', 11, struct usb_raw_eps_info) | |
| 233 | + | |
| 234 | +/* | |
| 235 | + * Stalls a pending control request on endpoint 0. | |
| 236 | + * Returns 0 on success or negative error code on failure. | |
| 237 | + */ | |
| 238 | +#define USB_RAW_IOCTL_EP0_STALL _IO('U', 12) | |
| 239 | + | |
| 240 | +/* | |
| 241 | + * Sets or clears halt or wedge status of the endpoint. | |
| 242 | + * Accepts endpoint handle as an argument. | |
| 243 | + * Returns 0 on success or negative error code on failure. | |
| 244 | + */ | |
| 245 | +#define USB_RAW_IOCTL_EP_SET_HALT _IOW('U', 13, __u32) | |
| 246 | +#define USB_RAW_IOCTL_EP_CLEAR_HALT _IOW('U', 14, __u32) | |
| 247 | +#define USB_RAW_IOCTL_EP_SET_WEDGE _IOW('U', 15, __u32) | |
| 248 | + | |
| 167 | 249 | #endif /* _UAPI__LINUX_USB_RAW_GADGET_H */ |