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