Improve the process for GNU tools
[minix3.git] / minix / commands / devmand / usb_driver.h
blobe7ed2053daf37b29ed3a0a9f394cb39e64e3e352
1 #ifndef DEVMAN_USB_DRIVER
2 #define DEVMAN_USB_DRIVER
4 #include <minix/usb.h>
5 #include <sys/queue.h>
7 #define USB_MATCH_ID_VENDOR (1 << 0)
8 #define USB_MATCH_ID_PRODUCT (1 << 1)
9 #define USB_MATCH_BCD_DEVICE (1 << 2)
10 #define USB_MATCH_DEVICE_CLASS (1 << 3)
11 #define USB_MATCH_DEVICE_SUBCLASS (1 << 4)
12 #define USB_MATCH_DEVICE_PROTOCOL (1 << 5)
13 #define USB_MATCH_INTERFACE_CLASS (1 << 6)
14 #define USB_MATCH_INTERFACE_SUBCLASS (1 << 7)
15 #define USB_MATCH_INTERFACE_PROTOCOL (1 << 8)
17 enum devmand_device_type {
18 char_dev,
19 block_dev
22 struct devmand_usb_match_id {
23 unsigned match_flags;
24 struct usb_device_id match_id;
25 LIST_ENTRY(devmand_usb_match_id) list;
28 #define DEVMAND_DRIVER_LABEL_LEN 32
30 struct devmand_driver_instance {
31 int dev_id;
32 int major;
33 char label[DEVMAND_DRIVER_LABEL_LEN];
34 struct devmand_usb_driver *drv;
35 LIST_ENTRY(devmand_driver_instance) list;
38 struct devmand_usb_driver {
39 char *name;
40 char *devprefix;
41 char *binary;
42 char *upscript;
43 char *downscript;
44 enum devmand_device_type dev_type;
45 LIST_HEAD(devid_head, devmand_usb_match_id) ids;
46 LIST_ENTRY(devmand_usb_driver) list;
49 struct devmand_usb_driver * add_usb_driver(char *name);
50 struct devmand_usb_match_id *add_usb_match_id(struct devmand_usb_driver *drv);
52 #endif