Compare commits
3 Commits
fa387c6f72
...
Develop_Wi
| Author | SHA1 | Date | |
|---|---|---|---|
| f55cb62690 | |||
| 6062e38207 | |||
| 8894286775 |
@ -230,3 +230,6 @@ CONFIG_DEBUG_FS=y
|
||||
# CONFIG_FTRACE is not set
|
||||
# CONFIG_STRICT_DEVMEM is not set
|
||||
# CONFIG_RUNTIME_TESTING_MENU is not set
|
||||
CONFIG_USB_ZERO=m
|
||||
CONFIG_USB_F_SS_LB=y
|
||||
CONFIG_DEBUG_INFO=y
|
||||
|
||||
@ -20,68 +20,53 @@
|
||||
|
||||
#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 (142)
|
||||
|
||||
const uint8_t WINUSB_IF0_WCIDProperties [142] = {
|
||||
///////////////////////////////////////
|
||||
/// WCID property descriptor
|
||||
///////////////////////////////////////
|
||||
0x8e, 0x00, 0x00, 0x00, /* dwLength */
|
||||
0x00, 0x01, /* bcdVersion */
|
||||
0x05, 0x00, /* wIndex */
|
||||
0x01, 0x00, /* wCount */
|
||||
#define WINUSB_IF0_WCID_PROPERTIES_SIZE (162)
|
||||
|
||||
const uint8_t WINUSB20_WCIDDescriptorSet [162] = {
|
||||
///////////////////////////////////////
|
||||
/// registry propter descriptor
|
||||
/// WCID20 descriptor set descriptor
|
||||
///////////////////////////////////////
|
||||
0x84, 0x00, 0x00, 0x00, /* dwSize */
|
||||
0x01, 0x00, 0x00, 0x00, /* dwPropertyDataType */
|
||||
0x28, 0x00, /* wPropertyNameLength */
|
||||
/* DeviceInterfaceGUID */
|
||||
'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, /* wcName_20 */
|
||||
'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, /* wcName_20 */
|
||||
't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, /* wcName_20 */
|
||||
'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, /* wcName_20 */
|
||||
'U', 0x00, 'I', 0x00, 'D', 0x00, 0x00, 0x00, /* wcName_20 */
|
||||
0x4e, 0x00, 0x00, 0x00, /* dwPropertyDataLength */
|
||||
/* {1D4B2365-4749-48EA-B38A-7C6FDDDD7E26} */
|
||||
'{', 0x00, '1', 0x00, 'D', 0x00, '4', 0x00, /* wcData_39 */
|
||||
'B', 0x00, '2', 0x00, '3', 0x00, '6', 0x00, /* wcData_39 */
|
||||
'5', 0x00, '-', 0x00, '4', 0x00, '7', 0x00, /* wcData_39 */
|
||||
'4', 0x00, '9', 0x00, '-', 0x00, '4', 0x00, /* wcData_39 */
|
||||
'8', 0x00, 'E', 0x00, 'A', 0x00, '-', 0x00, /* wcData_39 */
|
||||
'B', 0x00, '3', 0x00, '8', 0x00, 'A', 0x00, /* wcData_39 */
|
||||
'-', 0x00, '7', 0x00, 'C', 0x00, '6', 0x00, /* wcData_39 */
|
||||
'F', 0x00, 'D', 0x00, 'D', 0x00, 'D', 0x00, /* wcData_39 */
|
||||
'D', 0x00, '7', 0x00, 'E', 0x00, '2', 0x00, /* wcData_39 */
|
||||
'6', 0x00, '}', 0x00, 0x00, 0x00, /* wcData_39 */
|
||||
};
|
||||
|
||||
#define WINUSB_WCID_DESCRIPTOR_SIZE (40)
|
||||
const uint8_t WINUSB_WCIDDescriptor [40] = {
|
||||
0x0a, 0x00, /* wLength */
|
||||
0x00, 0x00, /* wDescriptorType */
|
||||
0x00, 0x00, 0x03, 0x06, /* dwWindowsVersion */
|
||||
0xa2, 0x00, /* wDescriptorSetTotalLength */
|
||||
///////////////////////////////////////
|
||||
/// WCID descriptor
|
||||
/// WCID20 compatible ID descriptor
|
||||
///////////////////////////////////////
|
||||
0x28, 0x00, 0x00, 0x00, /* dwLength */
|
||||
0x00, 0x01, /* bcdVersion */
|
||||
0x04, 0x00, /* wIndex */
|
||||
0x01, /* bCount */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bReserved_7 */
|
||||
|
||||
///////////////////////////////////////
|
||||
/// WCID function descriptor
|
||||
///////////////////////////////////////
|
||||
0x00, /* bFirstInterfaceNumber */
|
||||
0x01, /* bReserved */
|
||||
0x14, 0x00, /* wLength */
|
||||
0x03, 0x00, /* wDescriptorType */
|
||||
/* WINUSB */
|
||||
'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, /* cCID_8 */
|
||||
/* */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* cSubCID_8 */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bReserved_6 */
|
||||
///////////////////////////////////////
|
||||
/// WCID20 registry property descriptor
|
||||
///////////////////////////////////////
|
||||
0x84, 0x00, /* wLength */
|
||||
0x04, 0x00, /* wDescriptorType */
|
||||
0x07, 0x00, /* wPropertyDataType */
|
||||
0x2a, 0x00, /* wPropertyNameLength */
|
||||
/* DeviceInterfaceGUIDs */
|
||||
'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, /* wcPropertyName_21 */
|
||||
'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, /* wcPropertyName_21 */
|
||||
't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, /* wcPropertyName_21 */
|
||||
'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, /* wcPropertyName_21 */
|
||||
'U', 0x00, 'I', 0x00, 'D', 0x00, 's', 0x00, /* wcPropertyName_21 */
|
||||
0x00, 0x00, /* wcPropertyName_21 */
|
||||
0x50, 0x00, /* wPropertyDataLength */
|
||||
/* {1D4B2365-4749-48EA-B38A-7C6FDDDD7E26} */
|
||||
'{', 0x00, '1', 0x00, 'D', 0x00, '4', 0x00, /* wcPropertyData_40 */
|
||||
'B', 0x00, '2', 0x00, '3', 0x00, '6', 0x00, /* wcPropertyData_40 */
|
||||
'5', 0x00, '-', 0x00, '4', 0x00, '7', 0x00, /* wcPropertyData_40 */
|
||||
'4', 0x00, '9', 0x00, '-', 0x00, '4', 0x00, /* wcPropertyData_40 */
|
||||
'8', 0x00, 'E', 0x00, 'A', 0x00, '-', 0x00, /* wcPropertyData_40 */
|
||||
'B', 0x00, '3', 0x00, '8', 0x00, 'A', 0x00, /* wcPropertyData_40 */
|
||||
'-', 0x00, '7', 0x00, 'C', 0x00, '6', 0x00, /* wcPropertyData_40 */
|
||||
'F', 0x00, 'D', 0x00, 'D', 0x00, 'D', 0x00, /* wcPropertyData_40 */
|
||||
'D', 0x00, '7', 0x00, 'E', 0x00, '2', 0x00, /* wcPropertyData_40 */
|
||||
'6', 0x00, '}', 0x00, 0x00, 0x00, 0x00, 0x00, /* wcPropertyData_40 */
|
||||
};
|
||||
#endif // defined (CONFIG_GAOYANG)
|
||||
|
||||
|
||||
@ -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