Changeset 3392 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jul 3, 2007 2:54:26 PM (18 years ago)
- svn:sync-xref-src-repo-rev:
- 22590
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/USBProxyService.cpp
r3035 r3392 276 276 Log (("USBProxyService::processChanges: attached %p/%p:{.idVendor=%#06x, .idProduct=%#06x, .pszProduct=\"%s\", .pszManufacturer=\"%s\"}\n", 277 277 (HostUSBDevice *)NewObj, pNew, pNew->idVendor, pNew->idProduct, pNew->pszProduct, pNew->pszManufacturer)); 278 279 /* not really necessary to lock here, but make Assert 280 * checks happy*/278 deviceAdded (NewObj, pNew); 279 280 /* Not really necessary to lock here, but make Assert checks happy. */ 281 281 AutoLock newDevLock (NewObj); 282 282 … … 293 293 { 294 294 It = mDevices.erase (It); 295 deviceRemoved (DevPtr); 295 296 mHost->onUSBDeviceDetached (DevPtr); 296 297 Log (("USBProxyService::processChanges: detached %p\n", … … 380 381 381 382 382 /*static*/ void USBProxyService::freeDevice (PUSBDEVICE pDevice)383 /*static*/ void USBProxyService::freeDeviceMembers (PUSBDEVICE pDevice) 383 384 { 384 385 PUSBCONFIG pCfg = pDevice->paConfigurations; … … 419 420 RTStrFree ((char *)pDevice->pszAddress); 420 421 pDevice->pszAddress = NULL; 421 422 } 423 424 /*static*/ void USBProxyService::freeDevice (PUSBDEVICE pDevice) 425 { 426 freeDeviceMembers (pDevice); 422 427 RTMemFree (pDevice); 423 424 428 } 425 429 … … 520 524 521 525 522 int USBProxyService::captureDevice (HostUSBDevice * pDevice)526 int USBProxyService::captureDevice (HostUSBDevice */*aDevice*/) 523 527 { 524 528 return VERR_NOT_IMPLEMENTED; … … 526 530 527 531 528 int USBProxyService::holdDevice (HostUSBDevice * pDevice)532 int USBProxyService::holdDevice (HostUSBDevice */*aDevice*/) 529 533 { 530 534 return VERR_NOT_IMPLEMENTED; … … 532 536 533 537 534 int USBProxyService::releaseDevice (HostUSBDevice * pDevice)538 int USBProxyService::releaseDevice (HostUSBDevice */*aDevice*/) 535 539 { 536 540 return VERR_NOT_IMPLEMENTED; … … 538 542 539 543 540 int USBProxyService::resetDevice (HostUSBDevice * pDevice)544 int USBProxyService::resetDevice (HostUSBDevice */*aDevice*/) 541 545 { 542 546 return VERR_NOT_IMPLEMENTED; … … 544 548 545 549 546 bool USBProxyService::updateDeviceState (HostUSBDevice *pDevice, PUSBDEVICE pUSBDevice) 547 { 548 AssertReturn (pDevice, false); 549 AssertReturn (pDevice->isLockedOnCurrentThread(), false); 550 551 return pDevice->updateState (pUSBDevice); 552 } 553 550 bool USBProxyService::updateDeviceState (HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice) 551 { 552 AssertReturn (aDevice, false); 553 AssertReturn (aDevice->isLockedOnCurrentThread(), false); 554 555 return aDevice->updateState (aUSBDevice); 556 } 557 558 559 void USBProxyService::deviceAdded (HostUSBDevice */*aDevice*/, PUSBDEVICE /*aUSBDevice*/) 560 { 561 } 562 563 564 void USBProxyService::deviceRemoved (HostUSBDevice */*aDevice*/) 565 { 566 } 567 -
trunk/src/VBox/Main/include/HostUSBDeviceImpl.h
r3034 r3392 140 140 * Only used for host devices. */ 141 141 PUSBDEVICE mUsb; 142 143 friend class USBProxyService; 144 #ifdef __LINUX__ 145 friend class USBProxyServiceLinux; 146 #endif 142 147 }; 143 148 -
trunk/src/VBox/Main/include/USBProxyService.h
r2981 r3392 88 88 * 89 89 * @returns true if there is a state change. 90 * @param pDevice The device in question. 91 * @param pUSBDevice The USB device structure for the last enumeration. 92 */ 93 virtual bool updateDeviceState (HostUSBDevice *pDevice, PUSBDEVICE pUSBDevice); 90 * @param aDevice The device in question. 91 * @param aUSBDevice The USB device structure for the last enumeration. 92 */ 93 virtual bool updateDeviceState (HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice); 94 95 /** 96 * Add device notification hook for the OS specific code. 97 * 98 * @param aDevice The device in question. 99 * @param aUSBDevice The USB device structure. 100 */ 101 virtual void deviceAdded (HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice); 102 103 /** 104 * Remove device notification hook for the OS specific code. 105 * 106 * @param aDevice The device in question. 107 */ 108 virtual void deviceRemoved (HostUSBDevice *aDevice); 94 109 95 110 /** … … 182 197 183 198 public: 199 /** 200 * Free all the members of a USB device returned by getDevice(). 201 * 202 * @param pDevice Pointer to the device. 203 */ 204 static void freeDeviceMembers (PUSBDEVICE pDevice); 205 184 206 /** 185 207 * Free one USB device returned by getDevice(). … … 282 304 virtual int resetDevice (HostUSBDevice *aDevice); 283 305 virtual bool updateDeviceState (HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice); 306 virtual void deviceAdded (HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice); 284 307 285 308 protected: … … 287 310 virtual int interruptWait (void); 288 311 virtual PUSBDEVICE getDevices (void); 312 int addDeviceToChain (PUSBDEVICE pDev, PUSBDEVICE *ppFirst, PUSBDEVICE **pppNext, int rc); 289 313 290 314 private: … … 299 323 /** The root of usbfs. */ 300 324 Utf8Str mUsbfsRoot; 325 /** Number of 500ms polls left to do. See usbDeterminState for details. */ 326 unsigned mUdevPolls; 301 327 }; 302 328 # endif /* __LINUX__ */
Note:
See TracChangeset
for help on using the changeset viewer.