Commit a747b095 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: f_rndis: OS Descriptors configfs support

Added handling of OS Descriptors support for f_rndis.
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent da424314
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "u_ether_configfs.h" #include "u_ether_configfs.h"
#include "u_rndis.h" #include "u_rndis.h"
#include "rndis.h" #include "rndis.h"
#include "configfs.h"
/* /*
* This function is an RNDIS Ethernet port -- a Microsoft protocol that's * This function is an RNDIS Ethernet port -- a Microsoft protocol that's
...@@ -895,12 +896,15 @@ static void rndis_free_inst(struct usb_function_instance *f) ...@@ -895,12 +896,15 @@ static void rndis_free_inst(struct usb_function_instance *f)
else else
free_netdev(opts->net); free_netdev(opts->net);
} }
kfree(opts->rndis_os_desc.group.default_groups); /* single VLA chunk */
kfree(opts); kfree(opts);
} }
static struct usb_function_instance *rndis_alloc_inst(void) static struct usb_function_instance *rndis_alloc_inst(void)
{ {
struct f_rndis_opts *opts; struct f_rndis_opts *opts;
struct usb_os_desc *descs[1];
opts = kzalloc(sizeof(*opts), GFP_KERNEL); opts = kzalloc(sizeof(*opts), GFP_KERNEL);
if (!opts) if (!opts)
...@@ -917,6 +921,9 @@ static struct usb_function_instance *rndis_alloc_inst(void) ...@@ -917,6 +921,9 @@ static struct usb_function_instance *rndis_alloc_inst(void)
} }
INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop); INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop);
descs[0] = &opts->rndis_os_desc;
usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs,
THIS_MODULE);
config_group_init_type_name(&opts->func_inst.group, "", config_group_init_type_name(&opts->func_inst.group, "",
&rndis_func_type); &rndis_func_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment