Yecheng Zhao | 52b10d0 | 2024-04-04 09:34:15 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2024 The Fuchsia Authors |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <linux/usb/gadget.h> |
| 8 | #include <linux/usb/composite.h> |
| 9 | |
| 10 | typedef void (*usb_req_cb)(struct usb_ep *ep, struct usb_request *req); |
| 11 | |
| 12 | struct f_fastboot { |
| 13 | struct usb_function usb_function; |
| 14 | |
| 15 | /* IN/OUT EP's and corresponding requests */ |
| 16 | struct usb_ep *in_ep, *out_ep; |
| 17 | struct usb_request *in_req, *out_req; |
| 18 | }; |
| 19 | |
| 20 | // `fastboot_func` contains USB IN/OUT EP's and the corresponding USB requests. |
| 21 | extern struct f_fastboot *fastboot_func; |
| 22 | |
| 23 | // Sets custom Fastboot USB completion callback. |
| 24 | int set_fastboot_usb_completion_cb(usb_req_cb out_req, usb_req_cb in_req); |
| 25 | |
| 26 | // Resets to default Fastboot USB completion callback. |
| 27 | void reset_fastboot_usb_completion_cb(void); |