switch.h 667 B

1234567891011121314151617181920212223242526272829303132
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. #ifndef __USBMODE_SWITCH_H
  3. #define __USBMODE_SWITCH_H
  4. #include <libubox/blobmsg.h>
  5. #include <libusb.h>
  6. struct usbdev_data {
  7. struct libusb_device_descriptor desc;
  8. struct libusb_config_descriptor *config;
  9. libusb_device *dev;
  10. libusb_device_handle *devh;
  11. struct blob_attr *info;
  12. int interface;
  13. int msg_endpoint;
  14. int response_endpoint;
  15. int release_delay;
  16. int dev_class;
  17. bool need_response;
  18. char idstr[10];
  19. char mfg[128], prod[128], serial[128];
  20. };
  21. extern char **messages;
  22. extern int *message_len;
  23. extern int n_messages;
  24. extern struct libusb_context *usb;
  25. void handle_switch(struct usbdev_data *data);
  26. #endif