Changeset 26945 in vbox for trunk/src/VBox/Devices/Input/UsbKbd.cpp
- Timestamp:
- Mar 2, 2010 1:56:01 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/UsbKbd.cpp
r26875 r26945 888 888 Log(("usbHid: Bad GET_DESCRIPTOR req: bmRequestType=%#x\n", pSetup->bmRequestType)); 889 889 return usbHidCompleteStall(pThis, pEp, pUrb, "Bad GET_DESCRIPTOR"); 890 } 891 break; 892 } 893 894 case VUSB_REQ_GET_STATUS: 895 { 896 uint16_t wRet = 0; 897 898 if (pSetup->wLength != 2) 899 { 900 Log(("usbHid: Bad GET_STATUS req: wLength=%#x\n", pSetup->wLength)); 901 break; 902 } 903 Assert(pSetup->wValue == 0); 904 switch (pSetup->bmRequestType) 905 { 906 case VUSB_TO_DEVICE | VUSB_REQ_STANDARD | VUSB_DIR_TO_HOST: 907 { 908 Assert(pSetup->wIndex == 0); 909 Log(("usbHid: GET_STATUS (device)\n")); 910 wRet = 0; /* Not self-powered, no remote wakeup. */ 911 memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, sizeof(wRet)); 912 return usbHidCompleteOk(pThis, pUrb, sizeof(wRet) + sizeof(*pSetup)); 913 } 914 915 case VUSB_TO_INTERFACE | VUSB_REQ_STANDARD | VUSB_DIR_TO_HOST: 916 { 917 if (pSetup->wIndex == 0) 918 { 919 memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, sizeof(wRet)); 920 return usbHidCompleteOk(pThis, pUrb, sizeof(wRet) + sizeof(*pSetup)); 921 } 922 else 923 { 924 Log(("usbHid: GET_STATUS (interface) invalid, wIndex=%#x\n", pSetup->wIndex)); 925 } 926 break; 927 } 928 929 case VUSB_TO_ENDPOINT | VUSB_REQ_STANDARD | VUSB_DIR_TO_HOST: 930 { 931 if (pSetup->wIndex < RT_ELEMENTS(pThis->aEps)) 932 { 933 wRet = pThis->aEps[pSetup->wIndex].fHalted ? 1 : 0; 934 memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, sizeof(wRet)); 935 return usbHidCompleteOk(pThis, pUrb, sizeof(wRet) + sizeof(*pSetup)); 936 } 937 else 938 { 939 Log(("usbHid: GET_STATUS (endpoint) invalid, wIndex=%#x\n", pSetup->wIndex)); 940 } 941 break; 942 } 943 944 default: 945 Log(("usbHid: Bad GET_STATUS req: bmRequestType=%#x\n", pSetup->bmRequestType)); 946 return usbHidCompleteStall(pThis, pEp, pUrb, "Bad GET_STATUS"); 890 947 } 891 948 break;
Note:
See TracChangeset
for help on using the changeset viewer.