summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2017-01-24 14:22:25 -0800
committerKrzysztof Opasiak <k.opasiak@samsung.com>2017-12-12 14:06:36 +0100
commitabf422bffca4a4767e7e242c44910dbf5ef7094f (patch)
tree300fd0a0827f5657caa5e5de9ab31077986a3e8f
parent47526ac2a6480df6ac8268ff0dcaf463822f83a4 (diff)
downloadlibusbg-abf422bffca4a4767e7e242c44910dbf5ef7094f.tar.gz
libusbg-abf422bffca4a4767e7e242c44910dbf5ef7094f.tar.bz2
libusbg-abf422bffca4a4767e7e242c44910dbf5ef7094f.zip
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 <stefan.agner@toradex.com> [Allow multiple os_desc ifaces per funciton] Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
-rw-r--r--include/usbg/usbg_internal.h3
-rw-r--r--src/function/ether.c6
2 files changed, 9 insertions, 0 deletions
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
};