summaryrefslogtreecommitdiff
path: root/switch.h
blob: 1c964db582f588fccc77b897cac92391e1a5594b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef __USBMODE_SWITCH_H
#define __USBMODE_SWITCH_H

#include <libubox/blobmsg.h>
#include <libusb.h>

struct usbdev_data {
	struct libusb_device_descriptor desc;
	struct libusb_config_descriptor *config;
	libusb_device_handle *devh;
	struct blob_attr *info;
	int interface;
	int msg_endpoint;
	int response_endpoint;
	bool need_response;

	char idstr[10];
	char mfg[128], prod[128], serial[128];
};

extern struct blob_attr **messages;
extern int *message_len;
extern int n_messages;

void handle_switch(struct usbdev_data *data);

#endif