diff options
Diffstat (limited to 'examples/gadget-acm-ecm.c')
-rw-r--r-- | examples/gadget-acm-ecm.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/examples/gadget-acm-ecm.c b/examples/gadget-acm-ecm.c index 4e8010f..14b8a7d 100644 --- a/examples/gadget-acm-ecm.c +++ b/examples/gadget-acm-ecm.c @@ -16,6 +16,7 @@ #include <errno.h> #include <stdio.h> +#include <linux/usb/ch9.h> #include <usbg/usbg.h> /** @@ -37,24 +38,24 @@ int main(void) int usbg_ret; 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 */ + .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 = { - "0123456789", /* Serial number */ - "Foo Inc.", /* Manufacturer */ - "Bar Gadget" /* Product string */ + .str_ser = "0123456789", /* Serial number */ + .str_mnf = "Foo Inc.", /* Manufacturer */ + .str_prd = "Bar Gadget" /* Product string */ }; usbg_config_strs c_strs = { - "CDC 2xACM+ECM" + .configuration = "CDC 2xACM+ECM" }; usbg_ret = usbg_init("/sys/kernel/config", &s); |