diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-05-08 08:06:27 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-05-14 10:39:36 -0400 |
commit | a747b0958b5ead2d4ba46dc1f77d46e693a06efa (patch) | |
tree | a74a43d04c3518f76c7604cebf1e325a3d5182a8 | |
parent | da4243145fb197622425d4c2feff5d6422f2391e (diff) |
usb: gadget: f_rndis: OS Descriptors configfs support
Added handling of OS Descriptors support for f_rndis.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/gadget/f_rndis.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 28d1891f11fa..f1bf5763eac4 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "u_ether_configfs.h" | 27 | #include "u_ether_configfs.h" |
28 | #include "u_rndis.h" | 28 | #include "u_rndis.h" |
29 | #include "rndis.h" | 29 | #include "rndis.h" |
30 | #include "configfs.h" | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * This function is an RNDIS Ethernet port -- a Microsoft protocol that's | 33 | * 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 | else | 896 | else |
896 | free_netdev(opts->net); | 897 | free_netdev(opts->net); |
897 | } | 898 | } |
899 | |||
900 | kfree(opts->rndis_os_desc.group.default_groups); /* single VLA chunk */ | ||
898 | kfree(opts); | 901 | kfree(opts); |
899 | } | 902 | } |
900 | 903 | ||
901 | static struct usb_function_instance *rndis_alloc_inst(void) | 904 | static struct usb_function_instance *rndis_alloc_inst(void) |
902 | { | 905 | { |
903 | struct f_rndis_opts *opts; | 906 | struct f_rndis_opts *opts; |
907 | struct usb_os_desc *descs[1]; | ||
904 | 908 | ||
905 | opts = kzalloc(sizeof(*opts), GFP_KERNEL); | 909 | opts = kzalloc(sizeof(*opts), GFP_KERNEL); |
906 | if (!opts) | 910 | if (!opts) |
@@ -917,6 +921,9 @@ static struct usb_function_instance *rndis_alloc_inst(void) | |||
917 | } | 921 | } |
918 | INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop); | 922 | INIT_LIST_HEAD(&opts->rndis_os_desc.ext_prop); |
919 | 923 | ||
924 | descs[0] = &opts->rndis_os_desc; | ||
925 | usb_os_desc_prepare_interf_dir(&opts->func_inst.group, 1, descs, | ||
926 | THIS_MODULE); | ||
920 | config_group_init_type_name(&opts->func_inst.group, "", | 927 | config_group_init_type_name(&opts->func_inst.group, "", |
921 | &rndis_func_type); | 928 | &rndis_func_type); |
922 | 929 | ||