Changeset 62960 in vbox for trunk/src/VBox/Devices/USB
- Timestamp:
- Aug 4, 2016 8:09:34 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 109563
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/VUSBSnifferPcapNg.cpp
r62959 r62960 452 452 static DECLCALLBACK(int) vusbSnifferFmtPcanNgInit(PVUSBSNIFFERFMTINT pThis, PVUSBSNIFFERSTRM pStrm) 453 453 { 454 int rc = VINF_SUCCESS;455 456 454 pThis->pStrm = pStrm; 457 455 pThis->cbBlockCur = 0; … … 470 468 471 469 /* Write the blocks. */ 472 rc = vusbSnifferBlockNew(pThis, &Shb.Hdr, sizeof(Shb));470 int rc = vusbSnifferBlockNew(pThis, &Shb.Hdr, sizeof(Shb)); 473 471 if (RT_SUCCESS(rc)) 474 472 { -
trunk/src/VBox/Devices/USB/VUSBSnifferUsbMon.cpp
r62956 r62960 81 81 static DECLCALLBACK(void) vusbSnifferFmtUsbMonDestroy(PVUSBSNIFFERFMTINT pThis) 82 82 { 83 83 RT_NOREF(pThis); 84 84 } 85 85 -
trunk/src/VBox/Devices/USB/VUSBSnifferVmx.cpp
r62956 r62960 93 93 static int vusbSnifferFmtVmxLogData(PVUSBSNIFFERFMTINT pThis, PRTTIME pTime, uint8_t *pbBuf, size_t cbBuf) 94 94 { 95 int rc = VINF_SUCCESS;96 char aszLineBuf[256];97 uint16_t off = 0;95 int rc; 96 char szLineBuf[256]; 97 size_t off = 0; 98 98 99 99 do 100 100 { 101 size_t cch = RTStrPrintf(&aszLineBuf[0], sizeof(aszLineBuf), 102 "%s %02u %02u:%02u:%02u.%3.*u: vmx| USBIO: %03x: %16.*Rhxs\n", 103 s_apszMonths[pTime->u8Month - 1], pTime->u8MonthDay, pTime->u8Hour, pTime->u8Minute, pTime->u8Second, 3, pTime->u32Nanosecond, 101 size_t cch = RTStrPrintf(&szLineBuf[0], sizeof(szLineBuf), 102 "%s %02u %02u:%02u:%02u.%3.*u: vmx| USBIO: %03zx: %16.*Rhxs\n", 103 s_apszMonths[pTime->u8Month - 1], pTime->u8MonthDay, 104 pTime->u8Hour, pTime->u8Minute, pTime->u8Second, 3, pTime->u32Nanosecond, 104 105 off, RT_MIN(cbBuf - off, 16), pbBuf); 105 rc = pThis->pStrm->pfnWrite(pThis->pStrm, & aszLineBuf[0], cch);106 rc = pThis->pStrm->pfnWrite(pThis->pStrm, &szLineBuf[0], cch); 106 107 off += RT_MIN(cbBuf, 16); 107 108 pbBuf += RT_MIN(cbBuf, 16); … … 131 132 RTTIMESPEC TimeNow; 132 133 RTTIME Time; 133 char aszLineBuf[256];134 char szLineBuf[256]; 134 135 const char *pszEvt = enmEvent == VUSBSNIFFEREVENT_SUBMIT ? "Down" : "Up"; 135 136 uint8_t cIsocPkts = pUrb->enmType == VUSBXFERTYPE_ISOC ? pUrb->cIsocPkts : 0; … … 138 139 return VINF_SUCCESS; 139 140 140 RT_ZERO( aszLineBuf);141 RT_ZERO(szLineBuf); 141 142 142 143 RTTimeNow(&TimeNow); 143 144 RTTimeExplode(&Time, &TimeNow); 144 145 145 size_t cch = RTStrPrintf(& aszLineBuf[0], sizeof(aszLineBuf),146 size_t cch = RTStrPrintf(&szLineBuf[0], sizeof(szLineBuf), 146 147 "%s %02u %02u:%02u:%02u.%3.*u: vmx| USBIO: %s dev=%u endpt=%x datalen=%u numPackets=%u status=%u 0\n", 147 148 s_apszMonths[Time.u8Month - 1], Time.u8MonthDay, Time.u8Hour, Time.u8Minute, Time.u8Second, 3, Time.u32Nanosecond, 148 149 pszEvt, pUrb->DstAddress, pUrb->EndPt | (pUrb->enmDir == VUSBDIRECTION_IN ? 0x80 : 0x00), 149 150 pUrb->cbData, cIsocPkts, pUrb->enmStatus); 150 int rc = pThis->pStrm->pfnWrite(pThis->pStrm, & aszLineBuf[0], cch);151 int rc = pThis->pStrm->pfnWrite(pThis->pStrm, &szLineBuf[0], cch); 151 152 if (RT_SUCCESS(rc)) 152 153 { -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r60515 r62960 746 746 * @param pUrb The URB to submit. 747 747 */ 748 static void vusbMsgDoTransfer(PVUSBURB pUrb, PVUSBSETUP pSetup, PVUSBCTRLEXTRA pExtra, PVUSBPIPE pPipe, PVUSBDEV pDev) 749 { 748 static void vusbMsgDoTransfer(PVUSBURB pUrb, PVUSBSETUP pSetup, PVUSBCTRLEXTRA pExtra, PVUSBPIPE pPipe) 749 { 750 RT_NOREF(pPipe); 751 750 752 /* 751 753 * Mark this transfer as sent (cleared at setup time). … … 904 906 /* pre-buffer our output if it's device-to-host */ 905 907 if (pSetup->bmRequestType & VUSB_DIR_TO_HOST) 906 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe , pDev);908 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe); 907 909 else if (pSetup->wLength) 908 910 { … … 919 921 { 920 922 LogFlow(("%s: vusbUrbSubmitCtrl: stage=SETUP - to dev: sending\n", pUrb->pszDesc)); 921 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe , pDev);923 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe); 922 924 } 923 925 break; … … 992 994 { 993 995 LogFlow(("%s: vusbUrbSubmitCtrl: stage=DATA - to dev: sending\n", pUrb->pszDesc)); 994 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe , pDev);996 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe); 995 997 break; 996 998 } … … 1015 1017 { 1016 1018 LogFlow(("%s: vusbUrbSubmitCtrl: stage=STATUS - to dev: sending\n", pUrb->pszDesc)); 1017 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe , pDev);1019 vusbMsgDoTransfer(pUrb, pSetup, pExtra, pPipe); 1018 1020 } 1019 1021 break; … … 1249 1251 while (pVUsbUrb) 1250 1252 { 1251 PVUSBURB pUrb = pVUsbUrb->pUrb; 1252 1253 vusbUrbAssert(pUrb); 1253 vusbUrbAssert(pVUsbUrb->pUrb); 1254 1254 PVUSBURBVUSB pVUsbUrbNext = RTListGetNext(pUrbLst, pVUsbUrb, VUSBURBVUSBINT, NdLst); 1255 1255 PVUSBDEV pDev = pVUsbUrb->pDev; -
trunk/src/VBox/Devices/USB/VUSBUrbPool.cpp
r62463 r62960 118 118 size_t cbHciTd, unsigned cTds) 119 119 { 120 Assert((uint32_t)cbData == cbData); 121 Assert((uint32_t)cbHci == cbHci); 122 120 123 /* 121 124 * Reuse or allocate a new URB. … … 188 191 * (Re)init the URB 189 192 */ 190 uint32_t offAlloc = cbData;193 uint32_t offAlloc = (uint32_t)cbData; 191 194 PVUSBURB pUrb = &pHdr->Urb; 192 195 pUrb->u32Magic = VUSBURB_MAGIC; … … 204 207 pUrb->Dev.pvPrivate = NULL; 205 208 pUrb->Dev.pNext = NULL; 206 pUrb->EndPt = ~0;209 pUrb->EndPt = UINT8_MAX; 207 210 pUrb->enmType = enmType; 208 211 pUrb->enmDir = enmDir; 209 212 pUrb->fShortNotOk = false; 210 213 pUrb->enmStatus = VUSBSTATUS_INVALID; 211 pUrb->cbData = cbData;214 pUrb->cbData = (uint32_t)cbData; 212 215 pUrb->pHci = cbHci ? (PVUSBURBHCI)&pUrb->abData[offAlloc] : NULL; 213 offAlloc += cbHci;216 offAlloc += (uint32_t)cbHci; 214 217 pUrb->paTds = (cbHciTd && cTds) ? (PVUSBURBHCITD)&pUrb->abData[offAlloc] : NULL; 215 218
Note:
See TracChangeset
for help on using the changeset viewer.