Changeset 37388 in vbox
- Timestamp:
- Jun 8, 2011 3:49:55 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72173
- Location:
- trunk/src/VBox/Devices/Input
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/UsbKbd.cpp
r36445 r37388 43 43 /** @name USB HID specific descriptor types 44 44 * @{ */ 45 #define DT_IF_HID_DESCRIPTOR 0x21 45 46 #define DT_IF_HID_REPORT 0x22 46 47 /** @} */ … … 318 319 /* .MaxPower = */ 50 /* 100mA */ 319 320 }, 320 NULL, 321 &g_aUsbHidInterfaces[0] 321 NULL, /* pvMore */ 322 &g_aUsbHidInterfaces[0], 323 NULL /* pvOriginal */ 322 324 }; 323 325 … … 904 906 AssertReturn(u8HidCode <= VBOX_USB_MAX_USAGE_CODE, VERR_INTERNAL_ERROR); 905 907 906 Log RelFlowFunc(("key %s: 0x%x->0x%x\n",908 LogFlowFunc(("key %s: 0x%x->0x%x\n", 907 909 fKeyDown ? "down" : "up", u8KeyCode, u8HidCode)); 908 910 … … 1084 1086 switch (pSetup->wValue >> 8) 1085 1087 { 1088 case DT_IF_HID_DESCRIPTOR: 1089 { 1090 uint32_t cbCopy; 1091 1092 /* Returned data is written after the setup message. */ 1093 cbCopy = pUrb->cbData - sizeof(*pSetup); 1094 cbCopy = RT_MIN(cbCopy, sizeof(g_UsbHidIfHidDesc)); 1095 Log(("usbHidKbd: GET_DESCRIPTOR DT_IF_HID_DESCRIPTOR wValue=%#x wIndex=%#x cbCopy=%#x\n", pSetup->wValue, pSetup->wIndex, cbCopy)); 1096 memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbHidIfHidDesc, cbCopy); 1097 return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); 1098 } 1099 1086 1100 case DT_IF_HID_REPORT: 1101 { 1087 1102 uint32_t cbCopy; 1088 1103 … … 1093 1108 memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbHidReportDesc, cbCopy); 1094 1109 return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); 1110 } 1111 1095 1112 default: 1096 1113 Log(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex)); -
trunk/src/VBox/Devices/Input/UsbMouse.cpp
r36445 r37388 43 43 /** @name USB HID specific descriptor types 44 44 * @{ */ 45 #define DT_IF_HID_DESCRIPTOR 0x21 45 46 #define DT_IF_HID_REPORT 0x22 46 47 /** @} */ … … 409 410 /* .MaxPower = */ 50 /* 100mA */ 410 411 }, 411 NULL, 412 &g_aUsbHidMInterfaces[0] 412 NULL, /* pvMore */ 413 &g_aUsbHidMInterfaces[0], 414 NULL /* pvOriginal */ 413 415 }; 414 416 … … 425 427 /* .MaxPower = */ 50 /* 100mA */ 426 428 }, 427 NULL, 428 &g_aUsbHidTInterfaces[0] 429 NULL, /* pvMore */ 430 &g_aUsbHidTInterfaces[0], 431 NULL /* pvOriginal */ 429 432 }; 430 433 … … 960 963 switch (pSetup->wValue >> 8) 961 964 { 965 case DT_IF_HID_DESCRIPTOR: 966 { 967 uint32_t cbCopy; 968 uint32_t cbDesc; 969 const uint8_t *pDesc; 970 971 if (pThis->isAbsolute) 972 { 973 cbDesc = sizeof(g_UsbHidTIfHidDesc); 974 pDesc = (const uint8_t *)&g_UsbHidTIfHidDesc; 975 } 976 else 977 { 978 cbDesc = sizeof(g_UsbHidMIfHidDesc); 979 pDesc = (const uint8_t *)&g_UsbHidMIfHidDesc; 980 } 981 /* Returned data is written after the setup message. */ 982 cbCopy = pUrb->cbData - sizeof(*pSetup); 983 cbCopy = RT_MIN(cbCopy, cbDesc); 984 Log(("usbHidMouse: GET_DESCRIPTOR DT_IF_HID_DESCRIPTOR wValue=%#x wIndex=%#x cbCopy=%#x\n", pSetup->wValue, pSetup->wIndex, cbCopy)); 985 memcpy(&pUrb->abData[sizeof(*pSetup)], pDesc, cbCopy); 986 return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); 987 } 988 962 989 case DT_IF_HID_REPORT: 990 { 963 991 uint32_t cbCopy; 964 992 uint32_t cbDesc; … … 981 1009 memcpy(&pUrb->abData[sizeof(*pSetup)], pDesc, cbCopy); 982 1010 return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); 1011 } 1012 983 1013 default: 984 1014 Log(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
Note:
See TracChangeset
for help on using the changeset viewer.