Changeset 67590 in vbox
- Timestamp:
- Jun 23, 2017 7:24:52 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116348
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vusb.h
r66989 r67590 832 832 */ 833 833 DECLR3CALLBACKMEMBER(uint32_t, pfnGetPeriodicFrameRate, (PVUSBIROOTHUBCONNECTOR pInterface)); 834 835 /** 836 * Updates the internally stored isochronous scheduling frame for a given 837 * endpoint and returns the delta between the current and previous frame. 838 * 839 * @returns Delta between currently and previously scheduled frame. 840 * @retval 0 if no previous frame was set. 841 * @param pInterface Pointer to this struct. 842 */ 843 DECLR3CALLBACKMEMBER(uint32_t, pfnUpdateIsocFrameDelta, (PVUSBIROOTHUBCONNECTOR pInterface, PVUSBIDEVICE pDevice, 844 int EndPt, VUSBDIRECTION enmDir, uint16_t uNewFrameID, uint8_t uBits)); 834 845 835 846 } VUSBIROOTHUBCONNECTOR; … … 1175 1186 * IN: The packet size. I.e. the number of bytes to the next packet or end of buffer. 1176 1187 * OUT: The actual size transferred. */ 1177 uint 16_t cb;1188 uint32_t cb; 1178 1189 /** The offset of the packet. (Relative to VUSBURB::abData[0].) 1179 1190 * OUT: This can be changed by the USB device if it does some kind of buffer squeezing. */ 1180 uint 16_t off;1191 uint32_t off; 1181 1192 /** The status of the transfer. 1182 1193 * IN: VUSBSTATUS_INVALID … … 1260 1271 VUSBSTATUS enmStatus; 1261 1272 1273 /** The relative starting frame for isochronous transfers. 1274 * Zero indicates "transfer ASAP". 1275 * This is ignored when enmType isn't VUSBXFERTYPE_ISOC. */ 1276 uint16_t uStartFrameDelta; 1277 /** Flag indicating whether the start frame delta is relative 1278 * to the previous transfer (false) or now (true). 1279 * This is ignored when enmType isn't VUSBXFERTYPE_ISOC. */ 1280 bool fStartRelToNow; 1262 1281 /** The number of isochronous packets describe in aIsocPkts. 1263 1282 * This is ignored when enmType isn't VUSBXFERTYPE_ISOC. */ 1264 uint 32_tcIsocPkts;1283 uint8_t cIsocPkts; 1265 1284 /** The iso packets within abData. 1266 1285 * This is ignored when enmType isn't VUSBXFERTYPE_ISOC. */ -
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r67589 r67590 982 982 983 983 /** @interface_method_impl{VUSBIROOTHUBCONNECTOR,pfnGetPeriodicFrameRate} */ 984 static DECLCALLBACK(uint32_t) vusbRhGetP riodicFrameRate(PVUSBIROOTHUBCONNECTOR pInterface)984 static DECLCALLBACK(uint32_t) vusbRhGetPeriodicFrameRate(PVUSBIROOTHUBCONNECTOR pInterface) 985 985 { 986 986 PVUSBROOTHUB pThis = VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface); 987 987 988 988 return pThis->uFrameRate; 989 } 990 991 /** @interface_method_impl{VUSBIROOTHUBCONNECTOR,pfnGetPeriodicFrameRate} */ 992 static DECLCALLBACK(uint32_t) vusbRhUpdateIsocFrameDelta(PVUSBIROOTHUBCONNECTOR pInterface, PVUSBIDEVICE pDevice, 993 int EndPt, VUSBDIRECTION enmDir, uint16_t uNewFrame, uint8_t uBits) 994 { 995 PVUSBROOTHUB pRh = VUSBIROOTHUBCONNECTOR_2_VUSBROOTHUB(pInterface); 996 AssertReturn(pRh, 0); 997 PVUSBDEV pDev = (PVUSBDEV)pDevice; 998 PVUSBPIPE pPipe = &pDev->aPipes[EndPt]; 999 uint32_t *puLastFrame; 1000 int32_t uFrameDelta; 1001 uint32_t uMaxVal = 1 << uBits; 1002 1003 puLastFrame = enmDir == VUSBDIRECTION_IN ? &pPipe->uLastFrameIn : &pPipe->uLastFrameOut; 1004 uFrameDelta = uNewFrame - *puLastFrame; 1005 *puLastFrame = uNewFrame; 1006 /* Take care of wrap-around. */ 1007 if (uFrameDelta < 0) 1008 uFrameDelta += uMaxVal; 1009 1010 return (uint16_t)uFrameDelta; 989 1011 } 990 1012 … … 1131 1153 pRh->pDevices = pDev; 1132 1154 RTCritSectLeave(&pRh->CritSectDevices); 1133 LogRel(("VUSB: Attached '%s' to port %d on %s (%sSpeed)\n", pDev->pUsbIns->pszName, 1155 LogRel(("VUSB: Attached '%s' to port %d on %s (%sSpeed)\n", pDev->pUsbIns->pszName, 1134 1156 iPort, pHub->pszName, vusbGetSpeedString(pDev->pUsbIns->enmSpeed))); 1135 1157 } … … 1323 1345 pThis->IRhConnector.pfnDetachDevice = vusbRhDetachDevice; 1324 1346 pThis->IRhConnector.pfnSetPeriodicFrameProcessing = vusbRhSetFrameProcessing; 1325 pThis->IRhConnector.pfnGetPeriodicFrameRate = vusbRhGetPriodicFrameRate; 1347 pThis->IRhConnector.pfnGetPeriodicFrameRate = vusbRhGetPeriodicFrameRate; 1348 pThis->IRhConnector.pfnUpdateIsocFrameDelta = vusbRhUpdateIsocFrameDelta; 1326 1349 pThis->hSniffer = VUSBSNIFFER_NIL; 1327 1350 pThis->cbHci = 0; -
trunk/src/VBox/Devices/USB/VUSBInternal.h
r67589 r67590 158 158 /** Count of active async transfers. */ 159 159 volatile uint32_t async; 160 /** Last scheduled frame - only valid for isochronous IN endpoints. */ 161 uint32_t uLastFrameIn; 162 /** Last scheduled frame - only valid for isochronous OUT endpoints. */ 163 uint32_t uLastFrameOut; 160 164 } VUSBPIPE; 161 165 /** Pointer to a VUSB pipe structure. */
Note:
See TracChangeset
for help on using the changeset viewer.