Compare commits
1 Commits
Develop_tm
...
f55cb62690
| Author | SHA1 | Date | |
|---|---|---|---|
| f55cb62690 |
@ -20,9 +20,6 @@
|
||||
|
||||
#include "u_os_desc.h"
|
||||
|
||||
//#if defined (CONFIG_GAOYANG)
|
||||
// (struct usb_descriptor_header *) &WINUSB_WCIDDescriptor,
|
||||
//#endif // defined (CONFIG_GAOYANG)
|
||||
#if defined (CONFIG_GAOYANG)
|
||||
|
||||
#define WINUSB_IF0_WCID_PROPERTIES_SIZE (162)
|
||||
@ -1990,14 +1987,6 @@ unknown:
|
||||
/*
|
||||
* OS descriptors handling
|
||||
*/
|
||||
#if defined (CONFIG_GAOYANG)
|
||||
if (ctrl->bRequestType == 0xC0) {
|
||||
value = min_t(int, w_length, sizeof(WINUSB20_WCIDDescriptorSet));
|
||||
memcpy(req->buf, WINUSB20_WCIDDescriptorSet, value);
|
||||
|
||||
goto check_value;
|
||||
}
|
||||
#endif // defined (CONFIG_GAOYANG)
|
||||
if (cdev->use_os_string && cdev->os_desc_config &&
|
||||
(ctrl->bRequestType & USB_TYPE_VENDOR) &&
|
||||
ctrl->bRequest == cdev->b_vendor_code) {
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/usb/composite.h>
|
||||
#include <linux/err.h>
|
||||
#include "configfs.h"
|
||||
|
||||
#include "g_zero.h"
|
||||
#include "u_f.h"
|
||||
@ -1237,12 +1238,17 @@ static void source_sink_free_instance(struct usb_function_instance *fi)
|
||||
struct f_ss_opts *ss_opts;
|
||||
|
||||
ss_opts = container_of(fi, struct f_ss_opts, func_inst);
|
||||
|
||||
kfree(ss_opts->sslb_interf_group); /* single VLA chunk */
|
||||
kfree(ss_opts);
|
||||
}
|
||||
|
||||
static struct usb_function_instance *source_sink_alloc_inst(void)
|
||||
{
|
||||
struct f_ss_opts *ss_opts;
|
||||
struct usb_os_desc *descs[1];
|
||||
struct config_group *sslb_interf_group;
|
||||
char *names[1];
|
||||
|
||||
ss_opts = kzalloc(sizeof(*ss_opts), GFP_KERNEL);
|
||||
if (!ss_opts)
|
||||
@ -1258,6 +1264,18 @@ static struct usb_function_instance *source_sink_alloc_inst(void)
|
||||
config_group_init_type_name(&ss_opts->func_inst.group, "",
|
||||
&ss_func_type);
|
||||
|
||||
INIT_LIST_HEAD(&ss_opts->sslb_os_desc.ext_prop);
|
||||
ss_opts->sslb_os_desc.ext_compat_id = ss_opts->sslb_ext_compat_id;
|
||||
|
||||
names[0] = "sslb";
|
||||
descs[0] = &ss_opts->sslb_os_desc;
|
||||
sslb_interf_group = usb_os_desc_prepare_interf_dir(&ss_opts->func_inst.group, 1, descs, names, THIS_MODULE);
|
||||
if (IS_ERR(sslb_interf_group)) {
|
||||
source_sink_free_instance(&ss_opts->func_inst);
|
||||
return ERR_CAST(sslb_interf_group);
|
||||
}
|
||||
ss_opts->sslb_interf_group = sslb_interf_group;
|
||||
|
||||
return &ss_opts->func_inst;
|
||||
}
|
||||
DECLARE_USB_FUNCTION(SourceSink, source_sink_alloc_inst,
|
||||
|
||||
@ -45,6 +45,10 @@ struct f_ss_opts {
|
||||
*/
|
||||
struct mutex lock;
|
||||
int refcnt;
|
||||
|
||||
struct config_group *sslb_interf_group;
|
||||
struct usb_os_desc sslb_os_desc;
|
||||
char sslb_ext_compat_id[16];
|
||||
};
|
||||
|
||||
struct f_lb_opts {
|
||||
|
||||
Reference in New Issue
Block a user