[Mod] DuoS Sourcesink 免驱正常

This commit is contained in:
gaoyang3513
2025-01-01 23:40:48 +08:00
parent 0a3ea3f789
commit 8894286775
2 changed files with 56 additions and 57 deletions

View File

@ -230,3 +230,6 @@ CONFIG_DEBUG_FS=y
# CONFIG_FTRACE is not set # CONFIG_FTRACE is not set
# CONFIG_STRICT_DEVMEM is not set # CONFIG_STRICT_DEVMEM is not set
# CONFIG_RUNTIME_TESTING_MENU is not set # CONFIG_RUNTIME_TESTING_MENU is not set
CONFIG_USB_ZERO=m
CONFIG_USB_F_SS_LB=y
CONFIG_DEBUG_INFO=y

View File

@ -24,65 +24,53 @@
// (struct usb_descriptor_header *) &WINUSB_WCIDDescriptor, // (struct usb_descriptor_header *) &WINUSB_WCIDDescriptor,
//#endif // defined (CONFIG_GAOYANG) //#endif // defined (CONFIG_GAOYANG)
#if defined (CONFIG_GAOYANG) #if defined (CONFIG_GAOYANG)
#define WINUSB_IF0_WCID_PROPERTIES_SIZE (142)
const uint8_t WINUSB_IF0_WCIDProperties [142] = { #define WINUSB_IF0_WCID_PROPERTIES_SIZE (162)
///////////////////////////////////////
/// WCID property descriptor
///////////////////////////////////////
0x8e, 0x00, 0x00, 0x00, /* dwLength */
0x00, 0x01, /* bcdVersion */
0x05, 0x00, /* wIndex */
0x01, 0x00, /* wCount */
/////////////////////////////////////// const uint8_t WINUSB20_WCIDDescriptorSet [162] = {
/// registry propter descriptor ///////////////////////////////////////
/////////////////////////////////////// /// WCID20 descriptor set descriptor
0x84, 0x00, 0x00, 0x00, /* dwSize */ ///////////////////////////////////////
0x01, 0x00, 0x00, 0x00, /* dwPropertyDataType */ 0x0a, 0x00, /* wLength */
0x28, 0x00, /* wPropertyNameLength */ 0x00, 0x00, /* wDescriptorType */
/* DeviceInterfaceGUID */ 0x00, 0x00, 0x03, 0x06, /* dwWindowsVersion */
'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, /* wcName_20 */ 0xa2, 0x00, /* wDescriptorSetTotalLength */
'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, /* wcName_20 */ ///////////////////////////////////////
't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, /* wcName_20 */ /// WCID20 compatible ID descriptor
'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, /* wcName_20 */ ///////////////////////////////////////
'U', 0x00, 'I', 0x00, 'D', 0x00, 0x00, 0x00, /* wcName_20 */ 0x14, 0x00, /* wLength */
0x4e, 0x00, 0x00, 0x00, /* dwPropertyDataLength */ 0x03, 0x00, /* wDescriptorType */
/* {1D4B2365-4749-48EA-B38A-7C6FDDDD7E26} */ /* WINUSB */
'{', 0x00, '1', 0x00, 'D', 0x00, '4', 0x00, /* wcData_39 */ 'W', 'I', 'N', 'U', 'S', 'B', 0x00, 0x00, /* cCID_8 */
'B', 0x00, '2', 0x00, '3', 0x00, '6', 0x00, /* wcData_39 */ /* */
'5', 0x00, '-', 0x00, '4', 0x00, '7', 0x00, /* wcData_39 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* cSubCID_8 */
'4', 0x00, '9', 0x00, '-', 0x00, '4', 0x00, /* wcData_39 */ ///////////////////////////////////////
'8', 0x00, 'E', 0x00, 'A', 0x00, '-', 0x00, /* wcData_39 */ /// WCID20 registry property descriptor
'B', 0x00, '3', 0x00, '8', 0x00, 'A', 0x00, /* wcData_39 */ ///////////////////////////////////////
'-', 0x00, '7', 0x00, 'C', 0x00, '6', 0x00, /* wcData_39 */ 0x84, 0x00, /* wLength */
'F', 0x00, 'D', 0x00, 'D', 0x00, 'D', 0x00, /* wcData_39 */ 0x04, 0x00, /* wDescriptorType */
'D', 0x00, '7', 0x00, 'E', 0x00, '2', 0x00, /* wcData_39 */ 0x07, 0x00, /* wPropertyDataType */
'6', 0x00, '}', 0x00, 0x00, 0x00, /* wcData_39 */ 0x2a, 0x00, /* wPropertyNameLength */
}; /* DeviceInterfaceGUIDs */
'D', 0x00, 'e', 0x00, 'v', 0x00, 'i', 0x00, /* wcPropertyName_21 */
#define WINUSB_WCID_DESCRIPTOR_SIZE (40) 'c', 0x00, 'e', 0x00, 'I', 0x00, 'n', 0x00, /* wcPropertyName_21 */
const uint8_t WINUSB_WCIDDescriptor [40] = { 't', 0x00, 'e', 0x00, 'r', 0x00, 'f', 0x00, /* wcPropertyName_21 */
/////////////////////////////////////// 'a', 0x00, 'c', 0x00, 'e', 0x00, 'G', 0x00, /* wcPropertyName_21 */
/// WCID descriptor 'U', 0x00, 'I', 0x00, 'D', 0x00, 's', 0x00, /* wcPropertyName_21 */
/////////////////////////////////////// 0x00, 0x00, /* wcPropertyName_21 */
0x28, 0x00, 0x00, 0x00, /* dwLength */ 0x50, 0x00, /* wPropertyDataLength */
0x00, 0x01, /* bcdVersion */ /* {1D4B2365-4749-48EA-B38A-7C6FDDDD7E26} */
0x04, 0x00, /* wIndex */ '{', 0x00, '1', 0x00, 'D', 0x00, '4', 0x00, /* wcPropertyData_40 */
0x01, /* bCount */ 'B', 0x00, '2', 0x00, '3', 0x00, '6', 0x00, /* wcPropertyData_40 */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* bReserved_7 */ '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 */
/// WCID function descriptor 'B', 0x00, '3', 0x00, '8', 0x00, 'A', 0x00, /* wcPropertyData_40 */
/////////////////////////////////////// '-', 0x00, '7', 0x00, 'C', 0x00, '6', 0x00, /* wcPropertyData_40 */
0x00, /* bFirstInterfaceNumber */ 'F', 0x00, 'D', 0x00, 'D', 0x00, 'D', 0x00, /* wcPropertyData_40 */
0x01, /* bReserved */ 'D', 0x00, '7', 0x00, 'E', 0x00, '2', 0x00, /* wcPropertyData_40 */
/* WINUSB */ '6', 0x00, '}', 0x00, 0x00, 0x00, 0x00, 0x00, /* wcPropertyData_40 */
'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 */
};
#endif // defined (CONFIG_GAOYANG) #endif // defined (CONFIG_GAOYANG)
/** /**
@ -2002,6 +1990,14 @@ unknown:
/* /*
* OS descriptors handling * 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 && if (cdev->use_os_string && cdev->os_desc_config &&
(ctrl->bRequestType & USB_TYPE_VENDOR) && (ctrl->bRequestType & USB_TYPE_VENDOR) &&
ctrl->bRequest == cdev->b_vendor_code) { ctrl->bRequest == cdev->b_vendor_code) {