Changeset 46930 in vbox for trunk/src/VBox/Devices/Input/UsbMouse.cpp
- Timestamp:
- Jul 3, 2013 12:55:30 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Input/UsbMouse.cpp
r46923 r46930 788 788 static int usbHidCompleteStall(PUSBHID pThis, PUSBHIDEP pEp, PVUSBURB pUrb, const char *pszWhy) 789 789 { 790 Log(("usbHidCompleteStall/#%u: pUrb=%p:%s: %s\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, pszWhy)); 790 LogRelFlow(("usbHidCompleteStall/#%u: pUrb=%p:%s: %s\n", 791 pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, pszWhy)); 791 792 792 793 pUrb->enmStatus = VUSBSTATUS_STALL; … … 811 812 static int usbHidCompleteOk(PUSBHID pThis, PVUSBURB pUrb, size_t cbData) 812 813 { 813 Log(("usbHidCompleteOk/#%u: pUrb=%p:%s cbData=%#zx\n", pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, cbData)); 814 LogRelFlow(("usbHidCompleteOk/#%u: pUrb=%p:%s cbData=%#zx\n", 815 pThis->pUsbIns->iInstance, pUrb, pUrb->pszDesc, cbData)); 814 816 815 817 pUrb->enmStatus = VUSBSTATUS_OK; … … 896 898 897 899 cbCopy = sizeof(pReport->t); 898 // LogRel(("Abs movement, X=%d, Y=%d, dZ=%d, btn=%02x, report size %d\n", pReport->t.cx, pReport->t.cy, pReport->t.dz, pReport->t.btn, cbCopy)); 900 LogRel3(("Abs event, X=%d, Y=%d, dZ=%d, btn=%02x, report size %d\n", 901 pReport->t.cx, pReport->t.cy, pReport->t.dz, pReport->t.btn, 902 cbCopy)); 899 903 break; 900 904 } … … 907 911 908 912 cbCopy = sizeof(pReport->m); 909 // LogRel(("Rel movement, dX=%d, dY=%d, dZ=%d, btn=%02x, report size %d\n", pReport->m.dx, pReport->m.dy, pReport->m.dz, pReport->m.btn, cbCopy)); 913 LogRel3(("Rel event, dX=%d, dY=%d, dZ=%d, btn=%02x, report size %d\n", 914 pReport->m.dx, pReport->m.dy, pReport->m.dz, pReport->m.btn, 915 cbCopy)); 910 916 break; 911 917 } … … 950 956 else 951 957 { 952 Log 2(("No available URB for USB mouse\n"));958 LogRelFlow(("No available URB for USB mouse\n")); 953 959 pThis->fHasPendingChanges = true; 954 960 } … … 1039 1045 { 1040 1046 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1041 Log Flow(("usbHidUrbReap/#%u: cMillies=%u\n", pUsbIns->iInstance, cMillies));1047 LogRelFlow(("usbHidUrbReap/#%u: cMillies=%u\n", pUsbIns->iInstance, cMillies)); 1042 1048 1043 1049 RTCritSectEnter(&pThis->CritSect); … … 1061 1067 1062 1068 if (pUrb) 1063 Log(("usbHidUrbReap/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc)); 1069 LogRelFlow(("usbHidUrbReap/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, 1070 pUrb->pszDesc)); 1064 1071 return pUrb; 1065 1072 } … … 1072 1079 { 1073 1080 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1074 LogFlow(("usbHidUrbCancel/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc)); 1081 LogRelFlow(("usbHidUrbCancel/#%u: pUrb=%p:%s\n", pUsbIns->iInstance, pUrb, 1082 pUrb->pszDesc)); 1075 1083 RTCritSectEnter(&pThis->CritSect); 1076 1084 … … 1110 1118 { 1111 1119 AssertFailed(); 1112 Log (("usbHidHandleIntrDevToHost: Entering STATUS\n"));1120 LogRelFlow(("usbHidHandleIntrDevToHost: Entering STATUS\n")); 1113 1121 return usbHidCompleteOk(pThis, pUrb, 0); 1114 1122 } … … 1120 1128 { 1121 1129 AssertFailed(); 1122 Log (("usbHidHandleIntrDevToHost: Entering READY\n"));1130 LogRelFlow(("usbHidHandleIntrDevToHost: Entering READY\n")); 1123 1131 pThis->enmState = USBHIDREQSTATE_READY; 1124 1132 return usbHidCompleteOk(pThis, pUrb, 0); … … 1130 1138 if (pThis->fHasPendingChanges) 1131 1139 usbHidSendReport(pThis); 1132 LogFlow(("usbHidHandleIntrDevToHost: Added %p:%s to the queue\n", pUrb, pUrb->pszDesc)); 1140 LogRelFlow(("usbHidHandleIntrDevToHost: Added %p:%s to the queue\n", 1141 pUrb, pUrb->pszDesc)); 1133 1142 return VINF_SUCCESS; 1134 1143 … … 1137 1146 */ 1138 1147 default: 1139 Log(("usbHidHandleIntrDevToHost: enmState=%d cbData=%#x\n", pThis->enmState, pUrb->cbData)); 1148 LogRelFlow(("usbHidHandleIntrDevToHost: enmState=%d cbData=%#x\n", 1149 pThis->enmState, pUrb->cbData)); 1140 1150 return usbHidCompleteStall(pThis, NULL, pUrb, "Really bad state (D2H)!"); 1141 1151 } … … 1164 1174 { 1165 1175 case VUSB_DT_STRING: 1166 Log(("usbHid: GET_DESCRIPTOR DT_STRING wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex)); 1176 LogRelFlow(("usbHid: GET_DESCRIPTOR DT_STRING wValue=%#x wIndex=%#x\n", 1177 pSetup->wValue, pSetup->wIndex)); 1167 1178 break; 1168 1179 default: 1169 Log(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex)); 1180 LogRelFlow(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", 1181 pSetup->wValue, pSetup->wIndex)); 1170 1182 break; 1171 1183 } … … 1207 1219 cbCopy = pUrb->cbData - sizeof(*pSetup); 1208 1220 cbCopy = RT_MIN(cbCopy, cbDesc); 1209 Log(("usbHidMouse: GET_DESCRIPTOR DT_IF_HID_DESCRIPTOR wValue=%#x wIndex=%#x cbCopy=%#x\n", pSetup->wValue, pSetup->wIndex, cbCopy)); 1221 LogRelFlow(("usbHidMouse: GET_DESCRIPTOR DT_IF_HID_DESCRIPTOR wValue=%#x wIndex=%#x cbCopy=%#x\n", 1222 pSetup->wValue, pSetup->wIndex, 1223 cbCopy)); 1210 1224 memcpy(&pUrb->abData[sizeof(*pSetup)], pDesc, cbCopy); 1211 1225 return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); … … 1238 1252 cbCopy = pUrb->cbData - sizeof(*pSetup); 1239 1253 cbCopy = RT_MIN(cbCopy, cbDesc); 1240 Log(("usbHid: GET_DESCRIPTOR DT_IF_HID_REPORT wValue=%#x wIndex=%#x cbCopy=%#x\n", pSetup->wValue, pSetup->wIndex, cbCopy)); 1254 LogRelFlow(("usbHid: GET_DESCRIPTOR DT_IF_HID_REPORT wValue=%#x wIndex=%#x cbCopy=%#x\n", 1255 pSetup->wValue, pSetup->wIndex, 1256 cbCopy)); 1241 1257 memcpy(&pUrb->abData[sizeof(*pSetup)], pDesc, cbCopy); 1242 1258 return usbHidCompleteOk(pThis, pUrb, cbCopy + sizeof(*pSetup)); … … 1244 1260 1245 1261 default: 1246 Log(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", pSetup->wValue, pSetup->wIndex)); 1262 LogRelFlow(("usbHid: GET_DESCRIPTOR, huh? wValue=%#x wIndex=%#x\n", 1263 pSetup->wValue, pSetup->wIndex)); 1247 1264 break; 1248 1265 } … … 1251 1268 1252 1269 default: 1253 Log(("usbHid: Bad GET_DESCRIPTOR req: bmRequestType=%#x\n", pSetup->bmRequestType)); 1270 LogRelFlow(("usbHid: Bad GET_DESCRIPTOR req: bmRequestType=%#x\n", 1271 pSetup->bmRequestType)); 1254 1272 return usbHidCompleteStall(pThis, pEp, pUrb, "Bad GET_DESCRIPTOR"); 1255 1273 } … … 1263 1281 if (pSetup->wLength != 2) 1264 1282 { 1265 Log(("usbHid: Bad GET_STATUS req: wLength=%#x\n", pSetup->wLength)); 1283 LogRelFlow(("usbHid: Bad GET_STATUS req: wLength=%#x\n", 1284 pSetup->wLength)); 1266 1285 break; 1267 1286 } … … 1272 1291 { 1273 1292 Assert(pSetup->wIndex == 0); 1274 Log (("usbHid: GET_STATUS (device)\n"));1293 LogRelFlow(("usbHid: GET_STATUS (device)\n")); 1275 1294 wRet = 0; /* Not self-powered, no remote wakeup. */ 1276 1295 memcpy(&pUrb->abData[sizeof(*pSetup)], &wRet, sizeof(wRet)); … … 1287 1306 else 1288 1307 { 1289 Log(("usbHid: GET_STATUS (interface) invalid, wIndex=%#x\n", pSetup->wIndex)); 1308 LogRelFlow(("usbHid: GET_STATUS (interface) invalid, wIndex=%#x\n", 1309 pSetup->wIndex)); 1290 1310 } 1291 1311 break; … … 1302 1322 else 1303 1323 { 1304 Log(("usbHid: GET_STATUS (endpoint) invalid, wIndex=%#x\n", pSetup->wIndex)); 1324 LogRelFlow(("usbHid: GET_STATUS (endpoint) invalid, wIndex=%#x\n", 1325 pSetup->wIndex)); 1305 1326 } 1306 1327 break; … … 1308 1329 1309 1330 default: 1310 Log(("usbHid: Bad GET_STATUS req: bmRequestType=%#x\n", pSetup->bmRequestType)); 1331 LogRelFlow(("usbHid: Bad GET_STATUS req: bmRequestType=%#x\n", 1332 pSetup->bmRequestType)); 1311 1333 return usbHidCompleteStall(pThis, pEp, pUrb, "Bad GET_STATUS"); 1312 1334 } … … 1319 1341 1320 1342 /** @todo implement this. */ 1321 Log(("usbHid: Implement standard request: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n", 1322 pSetup->bmRequestType, pSetup->bRequest, pSetup->wValue, pSetup->wIndex, pSetup->wLength)); 1343 LogRelFlow(("usbHid: Implement standard request: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n", 1344 pSetup->bmRequestType, pSetup->bRequest, pSetup->wValue, 1345 pSetup->wIndex, pSetup->wLength)); 1323 1346 1324 1347 usbHidCompleteStall(pThis, pEp, pUrb, "TODO: standard request stuff"); … … 1331 1354 && pSetup->wIndex == 0) 1332 1355 { 1333 Log (("usbHidHandleDefaultPipe: Bulk-Only Mass Storage Reset\n"));1356 LogRelFlow(("usbHidHandleDefaultPipe: Bulk-Only Mass Storage Reset\n")); 1334 1357 return usbHidResetWorker(pThis, pUrb, false /*fSetConfig*/); 1335 1358 } 1336 1359 else 1337 1360 { 1338 Log(("usbHid: Unknown control msg: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n", 1339 pSetup->bmRequestType, pSetup->bRequest, pSetup->wValue, pSetup->wIndex, pSetup->wLength)); 1361 LogRelFlow(("usbHid: Unknown control msg: bmRequestType=%#x bRequest=%#x wValue=%#x wIndex=%#x wLength=%#x\n", 1362 pSetup->bmRequestType, pSetup->bRequest, pSetup->wValue, 1363 pSetup->wIndex, pSetup->wLength)); 1340 1364 return usbHidCompleteStall(pThis, pEp, pUrb, "Unknown control msg"); 1341 1365 } … … 1351 1375 { 1352 1376 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1353 LogFlow(("usbHidQueue/#%u: pUrb=%p:%s EndPt=%#x\n", pUsbIns->iInstance, pUrb, pUrb->pszDesc, pUrb->EndPt)); 1377 LogRelFlow(("usbHidQueue/#%u: pUrb=%p:%s EndPt=%#x\n", pUsbIns->iInstance, 1378 pUrb, pUrb->pszDesc, pUrb->EndPt)); 1354 1379 RTCritSectEnter(&pThis->CritSect); 1355 1380 … … 1387 1412 { 1388 1413 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1389 LogFlow(("usbHidUsbClearHaltedEndpoint/#%u: uEndpoint=%#x\n", pUsbIns->iInstance, uEndpoint)); 1414 LogRelFlow(("usbHidUsbClearHaltedEndpoint/#%u: uEndpoint=%#x\n", 1415 pUsbIns->iInstance, uEndpoint)); 1390 1416 1391 1417 if ((uEndpoint & ~0x80) < RT_ELEMENTS(pThis->aEps)) … … 1405 1431 static DECLCALLBACK(int) usbHidUsbSetInterface(PPDMUSBINS pUsbIns, uint8_t bInterfaceNumber, uint8_t bAlternateSetting) 1406 1432 { 1407 LogFlow(("usbHidUsbSetInterface/#%u: bInterfaceNumber=%u bAlternateSetting=%u\n", pUsbIns->iInstance, bInterfaceNumber, bAlternateSetting)); 1433 LogRelFlow(("usbHidUsbSetInterface/#%u: bInterfaceNumber=%u bAlternateSetting=%u\n", 1434 pUsbIns->iInstance, bInterfaceNumber, bAlternateSetting)); 1408 1435 Assert(bAlternateSetting == 0); 1409 1436 return VINF_SUCCESS; … … 1418 1445 { 1419 1446 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1420 LogFlow(("usbHidUsbSetConfiguration/#%u: bConfigurationValue=%u\n", pUsbIns->iInstance, bConfigurationValue)); 1447 LogRelFlow(("usbHidUsbSetConfiguration/#%u: bConfigurationValue=%u\n", 1448 pUsbIns->iInstance, bConfigurationValue)); 1421 1449 Assert(bConfigurationValue == 1); 1422 1450 RTCritSectEnter(&pThis->CritSect); … … 1447 1475 { 1448 1476 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1449 Log Flow(("usbHidUsbGetDescriptorCache/#%u:\n", pUsbIns->iInstance));1477 LogRelFlow(("usbHidUsbGetDescriptorCache/#%u:\n", pUsbIns->iInstance)); 1450 1478 switch (pThis->enmMode) 1451 1479 { … … 1468 1496 { 1469 1497 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1470 Log Flow(("usbHidUsbReset/#%u:\n", pUsbIns->iInstance));1498 LogRelFlow(("usbHidUsbReset/#%u:\n", pUsbIns->iInstance)); 1471 1499 RTCritSectEnter(&pThis->CritSect); 1472 1500 … … 1484 1512 { 1485 1513 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1486 Log Flow(("usbHidDestruct/#%u:\n", pUsbIns->iInstance));1514 LogRelFlow(("usbHidDestruct/#%u:\n", pUsbIns->iInstance)); 1487 1515 1488 1516 if (RTCritSectIsInitialized(&pThis->CritSect)) … … 1508 1536 PUSBHID pThis = PDMINS_2_DATA(pUsbIns, PUSBHID); 1509 1537 bool isAbsolute; 1510 Log (("usbHidConstruct/#%u:\n", iInstance));1538 LogRelFlow(("usbHidConstruct/#%u:\n", iInstance)); 1511 1539 1512 1540 /*
Note:
See TracChangeset
for help on using the changeset viewer.