Changeset 33540 in vbox for trunk/src/VBox/Devices/USB
- Timestamp:
- Oct 28, 2010 9:27:05 AM (14 years ago)
- Location:
- trunk/src/VBox/Devices/USB
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r33419 r33540 56 56 * routine (ohciRhXferComplete) carries out a number of tasks: 57 57 * -# Retires the TD associated with the transfer, setting the 58 * relev ent error code etc.58 * relevant error code etc. 59 59 * -# Updates done-queue interrupt timer and potentially causes 60 60 * a writeback of the done-queue. … … 394 394 /** HeadP - TD Queue head pointer. Bit 0 - Halted, Bit 1 - toggleCarry. Bit 2&3 - 0. */ 395 395 uint32_t HeadP; 396 /** NextED - Next Endpoint Desc iptor. Bits 0-3 ignored / preserved. */396 /** NextED - Next Endpoint Descriptor. Bits 0-3 ignored / preserved. */ 397 397 uint32_t NextED; 398 398 } OHCIED, *POHCIED; … … 860 860 861 861 /** 862 * Get the number of av ilable ports in the hub.862 * Get the number of available ports in the hub. 863 863 * 864 864 * @returns The number of ports available. … … 1004 1004 1005 1005 /* 1006 * We're p rending to _reattach_ the device without resetting them.1006 * We're pending to _reattach_ the device without resetting them. 1007 1007 * Except, during VM reset where we use the opportunity to do a proper 1008 1008 * reset before the guest comes along and expect things. 1009 1009 * 1010 1010 * However, it's very very likely that we're not doing the right thing 1011 * here if com ming from the guest (USB Reset state). The docs talks about1011 * here if coming from the guest (USB Reset state). The docs talks about 1012 1012 * root hub resetting, however what exact behaviour in terms of root hub 1013 1013 * status and changed bits, and HC interrupts aren't stated clearly. IF we … … 1773 1773 * This is called upon completion to adjust the sector lengths if 1774 1774 * the total length has changed. (received less then we had space for 1775 * or a par ital transfer.)1775 * or a partial transfer.) 1776 1776 * 1777 1777 * @param pBuf The buffer to update. cbTotal contains the new total on input. … … 1892 1892 { 1893 1893 /* 1894 * It's pro ably somewhere in the list, not a unlikely situation with1894 * It's probably somewhere in the list, not a unlikely situation with 1895 1895 * the current isochronous code. 1896 1896 */ … … 2455 2455 ohciRhXferCompleteGeneralURB(pOhci, pUrb, &Ed, cFmAge); 2456 2456 2457 /* final y write back the endpoint descriptor. */2457 /* finally write back the endpoint descriptor. */ 2458 2458 ohciWriteEd(pOhci, pUrb->Hci.EdAddr, &Ed); 2459 2459 } … … 2464 2464 * 2465 2465 * VUSB calls this when a transfer attempt failed. This function will respond 2466 * indicating whet er to retry or complete the URB with failure.2466 * indicating whether to retry or complete the URB with failure. 2467 2467 * 2468 2468 * @returns true if the URB should be retired. … … 2538 2538 2539 2539 /* 2540 * Determin the direction.2540 * Determine the direction. 2541 2541 */ 2542 2542 VUSBDIRECTION enmDir; … … 2693 2693 2694 2694 /* 2695 * Determin the direction.2695 * Determine the direction. 2696 2696 */ 2697 2697 VUSBDIRECTION enmDir; … … 3012 3012 /* 3013 3013 * We currently process this as if the guest follows the interrupt end point chaining 3014 * hie archy described in the documenation. This means that for an isochronous endpoint3014 * hierarchy described in the documenation. This means that for an isochronous endpoint 3015 3015 * with a 1 ms interval we expect to find in-flight TDs at the head of the list. We will 3016 3016 * skip over all in-flight TDs which timeframe has been exceed. Those which aren't in … … 3082 3082 * Windows will, upon the completion of another ITD it seems, check for if 3083 3083 * any other TDs has been unlinked. If we unlink them before they really 3084 * complete all the packet status codes will be NotAcces ed and Windows3084 * complete all the packet status codes will be NotAccessed and Windows 3085 3085 * will fail the URB with status USBD_STATUS_ISOCH_REQUEST_FAILED. 3086 3086 * … … 3104 3104 * If it's in flight we will try unlink it from the list prematurely to 3105 3105 * help the guest to move on and shorten the list we have to walk. We currently 3106 * are successful lwith the first URB but then it goes too slowly...3106 * are successful with the first URB but then it goes too slowly... 3107 3107 */ 3108 3108 int iInFlight = ohci_in_flight_find(pOhci, ITdAddr); … … 3666 3666 VUSBIRhReapAsyncUrbs(pOhci->RootHub.pIRhConn, 0); 3667 3667 3668 /* Frame boundary, so do EOF stuf here */3668 /* Frame boundary, so do EOF stuff here */ 3669 3669 bump_frame_number(pOhci); 3670 3670 if ( (pOhci->dqic != 0x7) && (pOhci->dqic != 0) ) … … 4019 4019 chg & RT_BIT(30) ? "*" : "", (res >> 30) & 1, 4020 4020 chg & RT_BIT(31) ? "*" : "", (res >> 31) & 1)); 4021 /* Don't bitch about invalid bits here since it makes sense to dis ble4021 /* Don't bitch about invalid bits here since it makes sense to disable 4022 4022 * interrupts you don't know about. */ 4023 4023 … … 4274 4274 /** 4275 4275 * Read the HcPeriodicStart register. 4276 * The register determin s when in a frame to switch from control&bulk to periodic lists.4276 * The register determines when in a frame to switch from control&bulk to periodic lists. 4277 4277 */ 4278 4278 static int HcPeriodicStart_r(POHCI pOhci, uint32_t iReg, uint32_t *pu32Value) … … 4285 4285 /** 4286 4286 * Write to the HcPeriodicStart register. 4287 * The register determin s when in a frame to switch from control&bulk to periodic lists.4287 * The register determines when in a frame to switch from control&bulk to periodic lists. 4288 4288 */ 4289 4289 static int HcPeriodicStart_w(POHCI pOhci, uint32_t iReg, uint32_t val) … … 4524 4524 if (!pPort) 4525 4525 { 4526 Assert(pPort); /* sometimes happen ds because of #1510 */4526 Assert(pPort); /* sometimes happens because of #1510 */ 4527 4527 return; 4528 4528 } … … 4544 4544 { 4545 4545 /* 4546 * Damn, something weird happen d during reset. We'll pretend the user did an4547 * incredible fast reconnect or something. (pro lly not gonna work)4546 * Damn, something weird happened during reset. We'll pretend the user did an 4547 * incredible fast reconnect or something. (probably not gonna work) 4548 4548 */ 4549 4549 Log2(("uchi_port_reset_done: The reset failed (rc=%Rrc)!!! Pretending reconnect at the speed of light.\n", rc)); … … 5041 5041 } 5042 5042 } 5043 /* else: we ASSUME no device can be attached or detach in the period e5043 /* else: we ASSUME no device can be attached or detach in the period 5044 5044 * between a state load and the pLoad stuff is processed. */ 5045 5045 return rc; -
trunk/src/VBox/Devices/USB/DrvVUSBRootHub.cpp
r32010 r33540 32 32 * 33 33 * The URB is created when the HCI calls the roothub (VUSB) method pfnNewUrb. 34 * VUSB has a pool of URBs, if no free URBs are availab e a new one is34 * VUSB has a pool of URBs, if no free URBs are available a new one is 35 35 * allocated. The returned URB starts life in the ALLOCATED state and all 36 * fields are init alized with sensible defaults.36 * fields are initialized with sensible defaults. 37 37 * 38 38 * The HCI then copies any request data into the URB if it's an host2dev … … 85 85 * the STATUS stage. 86 86 * 87 * To complicate matters fu ther, VUSB must intercept and in some cases emulate87 * To complicate matters further, VUSB must intercept and in some cases emulate 88 88 * some of the standard requests in order to keep the virtual device state 89 89 * correct and provide the correct virtualization of a device. -
trunk/src/VBox/Devices/USB/USBProxyDevice.cpp
r31890 r33540 306 306 break; 307 307 308 /* Check we didn t see this alternate setting already308 /* Check we didn't see this alternate setting already 309 309 * because that will break stuff 310 310 */ -
trunk/src/VBox/Devices/USB/USBProxyDevice.h
r32472 r33540 67 67 68 68 /** 69 * Optional callback for init alizing the device after the configuration69 * Optional callback for initializing the device after the configuration 70 70 * has been established. 71 71 * … … 183 183 /** Pointer to the backend. */ 184 184 PCUSBPROXYBACK pOps; 185 /** The currently active config ration.185 /** The currently active configuration. 186 186 * It's -1 if no configuration is active. This is set to -1 before open and reset, 187 187 * the backend will change it if open or reset implies SET_CONFIGURATION. */ -
trunk/src/VBox/Devices/USB/VUSBDevice.cpp
r32010 r33540 1302 1302 1303 1303 /* 1304 * We use a timer to commu icate the result back to EMT.1304 * We use a timer to communicate the result back to EMT. 1305 1305 * This avoids suspend + poweroff issues, and it should give 1306 1306 * us more accurate scheduling than making this thread sleep. -
trunk/src/VBox/Devices/USB/VUSBUrb.cpp
r32431 r33540 1180 1180 /** 1181 1181 * Queues an URB for asynchronous transfer. 1182 * A list of asynch ornous URBs is kept by the roothub.1182 * A list of asynchronous URBs is kept by the roothub. 1183 1183 * 1184 1184 * @returns VBox status code (from pfnUrbQueue). … … 1282 1282 * Callback to free a cancelled message URB. 1283 1283 * 1284 * This is yet another place we're we have to perform ce acrobatics to1284 * This is yet another place we're we have to performance acrobatics to 1285 1285 * deal with cancelled URBs. sigh. 1286 1286 * -
trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp
r31890 r33540 1179 1179 1180 1180 /* 1181 * Determin the active configuration.1181 * Determine the active configuration. 1182 1182 * Can cause hangs, so drop it for now. 1183 1183 */ … … 1774 1774 1775 1775 /* 1776 * Determin the interface / endpoint ref and invoke AbortPipe.1776 * Determine the interface / endpoint ref and invoke AbortPipe. 1777 1777 */ 1778 1778 IOReturn irc = kIOReturnSuccess; -
trunk/src/VBox/Devices/USB/freebsd/USBProxyDevice-freebsd.cpp
r31890 r33540 129 129 * Wrapper for the ioctl call. 130 130 * 131 * This wrapper will repeat ethe call if we get an EINTR or EAGAIN. It can also131 * This wrapper will repeat the call if we get an EINTR or EAGAIN. It can also 132 132 * handle ENODEV (detached device) errors. 133 133 * … … 521 521 usbProxyFreeBSDEndpointClose(pProxyDev, i); 522 522 523 /* We need to release kernel res sources first. */523 /* We need to release kernel resources first. */ 524 524 struct usb_fs_uninit UsbFsUninit; 525 525 UsbFsUninit.dummy = 0; … … 536 536 #endif 537 537 538 /* Allocate kernel res sources again. */538 /* Allocate kernel resources again. */ 539 539 struct usb_fs_init UsbFsInit; 540 540 … … 587 587 usbProxyFreeBSDEndpointClose(pProxyDev, i); 588 588 589 /* We need to release kernel res sources first. */589 /* We need to release kernel resources first. */ 590 590 struct usb_fs_uninit UsbFsUninit; 591 591 UsbFsUninit.dummy = 0; … … 596 596 int iCfgIndex = 0; 597 597 598 /* Get the configuration index matching the value. */598 /* Get the configuration index matching the value. */ 599 599 for (iCfgIndex = 0; iCfgIndex < pProxyDev->DevDesc.bNumConfigurations; iCfgIndex++) 600 600 { … … 617 617 } 618 618 619 /* Allocate kernel res sources again. */619 /* Allocate kernel resources again. */ 620 620 struct usb_fs_init UsbFsInit; 621 621 … … 681 681 usbProxyFreeBSDEndpointClose(pProxyDev, i); 682 682 683 /* We need to release kernel res sources first. */683 /* We need to release kernel resources first. */ 684 684 struct usb_fs_uninit UsbFsUninit; 685 685 UsbFsUninit.dummy = 0; … … 698 698 } 699 699 700 /* Allocate kernel res sources again. */700 /* Allocate kernel resources again. */ 701 701 struct usb_fs_init UsbFsInit; 702 702 -
trunk/src/VBox/Devices/USB/linux/USBProxyDevice-linux.cpp
r32472 r33540 175 175 * Wrapper for the ioctl call. 176 176 * 177 * This wrapper will repeat ethe call if we get an EINTR or EAGAIN. It can also177 * This wrapper will repeat the call if we get an EINTR or EAGAIN. It can also 178 178 * handle ENODEV (detached device) errors. 179 179 * … … 716 716 717 717 /* 718 * Determin the active configuration.718 * Determine the active configuration. 719 719 * 720 720 * If there isn't any active configuration, we will get EHOSTUNREACH (113) errors … … 1050 1050 1051 1051 /* 1052 * This is the alternative, we will al lways reset when asked to do so.1052 * This is the alternative, we will always reset when asked to do so. 1053 1053 * 1054 1054 * The problem we're facing here is that on reset failure linux will do … … 1624 1624 } 1625 1625 #if 0 1626 /* Disabled for the time be eing as some USB devices have URBs pending for an unknown amount of time.1626 /* Disabled for the time being as some USB devices have URBs pending for an unknown amount of time. 1627 1627 * One example is the OmniKey CardMan 3821. */ 1628 1628 else if (u64MilliTS - pCur->u64SubmitTS >= 200*1000 /* 200 sec (180 sec has been observed with XP) */) -
trunk/src/VBox/Devices/USB/os2/USBProxyDevice-os2.cpp
r31890 r33540 487 487 488 488 /* 489 * Try open (a quire) it.489 * Try open (acquire) it. 490 490 */ 491 491 USBHANDLE hDevice = 0; … … 510 510 511 511 /** @todo 512 * Determin the active configuration.512 * Determine the active configuration. 513 513 */ 514 514 //pProxyDev->cIgnoreSetConfigs = 1; -
trunk/src/VBox/Devices/USB/testcase/tstPalmOne.c
r31890 r33540 296 296 // reset_ep(6); 297 297 298 /* This seems to be some kind of 'i ndentify device' request. */298 /* This seems to be some kind of 'identify device' request. */ 299 299 uint8_t abVendor[0x14] = {0}; 300 300 int cb = doctrl(VUSB_DIR_TO_HOST | VUSB_REQ_VENDOR | VUSB_TO_ENDPOINT,
Note:
See TracChangeset
for help on using the changeset viewer.