diff options
Diffstat (limited to 'examples/gadget-ms.c')
-rw-r--r-- | examples/gadget-ms.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/examples/gadget-ms.c b/examples/gadget-ms.c index a37b163..69c3406 100644 --- a/examples/gadget-ms.c +++ b/examples/gadget-ms.c @@ -23,6 +23,7 @@ #include <errno.h> #include <stdio.h> +#include <linux/usb/ch9.h> #include <usbg/usbg.h> #define VENDOR 0x1d6b @@ -36,6 +37,24 @@ int main(int argc, char **argv) usbg_function *f_ms; int ret = -EINVAL; int usbg_ret; + + usbg_gadget_attrs g_attrs = { + .bcdUSB = 0x0200, + .bDeviceClass = USB_CLASS_PER_INTERFACE, + .bDeviceSubClass = 0x00, + .bDeviceProtocol = 0x00, + .bMaxPacketSize0 = 0x0040, /* Max allowed ep0 packet size */ + .idVendor = VENDOR, + .idProduct = PRODUCT, + .bcdDevice = 0x0001, /* Verson of device */ + }; + + usbg_gadget_strs g_strs = { + .str_ser = "0123456789", /* Serial number */ + .str_mnf = "Foo Inc.", /* Manufacturer */ + .str_prd = "Bar Gadget" /* Product string */ + }; + usbg_f_ms_lun_attrs f_ms_luns_array[] = { { .id = -1, /* allows to place in any position */ @@ -73,23 +92,6 @@ int main(int argc, char **argv) }, }; - usbg_gadget_attrs g_attrs = { - 0x0200, /* bcdUSB */ - 0x00, /* Defined at interface level */ - 0x00, /* subclass */ - 0x00, /* device protocol */ - 0x0040, /* Max allowed packet size */ - VENDOR, - PRODUCT, - 0x0001, /* Verson of device */ - }; - - usbg_gadget_strs g_strs = { - "0123456789", /* Serial number */ - "Foo Inc.", /* Manufacturer */ - "Bar Gadget" /* Product string */ - }; - usbg_config_strs c_strs = { "1xMass Storage" }; |