VirtualBox

Ignore:
Timestamp:
Jun 8, 2011 3:49:55 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72173
Message:

Devices/Input/UsbMouse, UsbKbd: Support explicit USB HID descriptor requests (USB HID spec 6.2.1), logging fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Input/UsbKbd.cpp

    r36445 r37388  
    4343/** @name USB HID specific descriptor types
    4444 * @{ */
     45#define DT_IF_HID_DESCRIPTOR        0x21
    4546#define DT_IF_HID_REPORT            0x22
    4647/** @} */
     
    318319        /* .MaxPower = */           50 /* 100mA */
    319320    },
    320     NULL,
    321     &g_aUsbHidInterfaces[0]
     321    NULL,                           /* pvMore */
     322    &g_aUsbHidInterfaces[0],
     323    NULL                            /* pvOriginal */
    322324};
    323325
     
    904906        AssertReturn(u8HidCode <= VBOX_USB_MAX_USAGE_CODE, VERR_INTERNAL_ERROR);
    905907
    906         LogRelFlowFunc(("key %s: 0x%x->0x%x\n",
     908        LogFlowFunc(("key %s: 0x%x->0x%x\n",
    907909                        fKeyDown ? "down" : "up", u8KeyCode, u8HidCode));
    908910
     
    10841086                        switch (pSetup->wValue >> 8)
    10851087                        {
     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
    10861100                            case DT_IF_HID_REPORT:
     1101                            {
    10871102                                uint32_t    cbCopy;
    10881103
     
    10931108                                memcpy(&pUrb->abData[sizeof(*pSetup)], &g_UsbHidReportDesc, cbCopy);
    10941109                                return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup));
     1110                            }
     1111
    10951112                            default:
    10961113                                Log(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex));
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette