From abf422bffca4a4767e7e242c44910dbf5ef7094f Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Tue, 24 Jan 2017 14:22:25 -0800 Subject: libusbgx: Add interface name for Feature Descriptors This adds interface name required for "Feature Descriptors". If specified, we can assume that a Feature Descriptor with the interface name of the specified string is understood by the kernel (e.g. interface.rndis). Signed-off-by: Stefan Agner [Allow multiple os_desc ifaces per funciton] Signed-off-by: Krzysztof Opasiak --- include/usbg/usbg_internal.h | 3 +++ src/function/ether.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/include/usbg/usbg_internal.h b/include/usbg/usbg_internal.h index db8c77b..cde3ad3 100644 --- a/include/usbg/usbg_internal.h +++ b/include/usbg/usbg_internal.h @@ -52,6 +52,9 @@ struct usbg_function_type /* Name of this function type */ char *name; + /* OS Descriptor interface name */ + char **os_desc_iname; + /* Called to allocate instance of function */ int (*alloc_inst)(struct usbg_function_type *, usbg_function_type, const char *, const char *, usbg_gadget *, diff --git a/src/function/ether.c b/src/function/ether.c index 010b9fb..dcb3208 100644 --- a/src/function/ether.c +++ b/src/function/ether.c @@ -191,8 +191,14 @@ struct usbg_function_type usbg_f_type_eem = { ETHER_FUNCTION_OPTS }; +static char *rndis_os_desc_ifnames[] = { + "rndis", + NULL +}; + struct usbg_function_type usbg_f_type_rndis = { .name = "rndis", + .os_desc_iname = rndis_os_desc_ifnames, ETHER_FUNCTION_OPTS }; -- cgit v1.2.3