Changeset 59117 in vbox for trunk/src/VBox/Main/src-server/linux
- Timestamp:
- Dec 14, 2015 2:04:37 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104688
- Location:
- trunk/src/VBox/Main/src-server/linux
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/linux/USBGetDevices.cpp
r58170 r59117 1352 1352 pInfo->mDevice); 1353 1353 Dev->pszAddress = pszAddress; 1354 Dev->pszBackend = RTStrDup("host"); 1354 1355 1355 1356 /* Work out from the data collected whether we can support this device. */ -
trunk/src/VBox/Main/src-server/linux/USBProxyBackendLinux.cpp
r59116 r59117 60 60 * Initialize data members. 61 61 */ 62 USBProxy ServiceLinux::USBProxyServiceLinux(Host *aHost)63 : USBProxy Service(aHost), mhFile(NIL_RTFILE), mhWakeupPipeR(NIL_RTPIPE),62 USBProxyBackendLinux::USBProxyBackendLinux(USBProxyService *aUsbProxyService) 63 : USBProxyBackend(aUsbProxyService), mhFile(NIL_RTFILE), mhWakeupPipeR(NIL_RTPIPE), 64 64 mhWakeupPipeW(NIL_RTPIPE), mUsingUsbfsDevices(true /* see init */), 65 65 mUdevPolls(0), mpWaiter(NULL) 66 66 { 67 LogFlowThisFunc(("a Host=%p\n", aHost));67 LogFlowThisFunc(("aUsbProxyService=%p\n", aUsbProxyService)); 68 68 } 69 69 … … 71 71 * Initializes the object (called right after construction). 72 72 * 73 * @returns S_OK on success and non-fatal failures, some COM error otherwise.74 */ 75 HRESULT USBProxyServiceLinux::init(void)73 * @returns VBox status code. 74 */ 75 int USBProxyBackendLinux::init(void) 76 76 { 77 77 const char *pcszDevicesRoot; … … 86 86 mUsingUsbfsDevices ? "USBFS" : "sysfs")); 87 87 } 88 mLastError = rc; 89 return S_OK;88 89 return rc; 90 90 } 91 91 … … 95 95 * @returns iprt status code. 96 96 */ 97 int USBProxy ServiceLinux::initUsbfs(void)97 int USBProxyBackendLinux::initUsbfs(void) 98 98 { 99 99 Assert(mUsingUsbfsDevices); … … 128 128 } 129 129 else 130 Log(("USBProxy ServiceLinux::USBProxyServiceLinux: RTFilePipe failed with rc=%Rrc\n", rc));130 Log(("USBProxyBackendLinux::USBProxyBackendLinux: RTFilePipe failed with rc=%Rrc\n", rc)); 131 131 RTFileClose(mhFile); 132 132 } … … 137 137 { 138 138 rc = VERR_NO_MEMORY; 139 Log(("USBProxy ServiceLinux::USBProxyServiceLinux: out of memory!\n"));139 Log(("USBProxyBackendLinux::USBProxyBackendLinux: out of memory!\n")); 140 140 } 141 141 … … 150 150 * @returns iprt status code 151 151 */ 152 int USBProxy ServiceLinux::initSysfs(void)152 int USBProxyBackendLinux::initSysfs(void) 153 153 { 154 154 Assert(!mUsingUsbfsDevices); … … 181 181 * Stop all service threads and free the device chain. 182 182 */ 183 USBProxy ServiceLinux::~USBProxyServiceLinux()183 USBProxyBackendLinux::~USBProxyBackendLinux() 184 184 { 185 185 LogFlowThisFunc(("\n")); … … 206 206 * and mark them as freed. 207 207 */ 208 void USBProxy ServiceLinux::doUsbfsCleanupAsNeeded()208 void USBProxyBackendLinux::doUsbfsCleanupAsNeeded() 209 209 { 210 210 /* … … 220 220 221 221 222 int USBProxy ServiceLinux::captureDevice(HostUSBDevice *aDevice)222 int USBProxyBackendLinux::captureDevice(HostUSBDevice *aDevice) 223 223 { 224 224 AssertReturn(aDevice, VERR_GENERAL_FAILURE); … … 239 239 240 240 241 int USBProxy ServiceLinux::releaseDevice(HostUSBDevice *aDevice)241 int USBProxyBackendLinux::releaseDevice(HostUSBDevice *aDevice) 242 242 { 243 243 AssertReturn(aDevice, VERR_GENERAL_FAILURE); … … 258 258 259 259 260 bool USBProxy ServiceLinux::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters,260 bool USBProxyBackendLinux::updateDeviceState(HostUSBDevice *aDevice, PUSBDEVICE aUSBDevice, bool *aRunFilters, 261 261 SessionMachine **aIgnoreMachine) 262 262 { … … 265 265 AutoReadLock devLock(aDevice COMMA_LOCKVAL_SRC_POS); 266 266 if ( aUSBDevice->enmState == USBDEVICESTATE_USED_BY_HOST_CAPTURABLE 267 && aDevice-> mUsb->enmState == USBDEVICESTATE_USED_BY_HOST)267 && aDevice->i_getUsbData()->enmState == USBDEVICESTATE_USED_BY_HOST) 268 268 LogRel(("USBProxy: Device %04x:%04x (%s) has become accessible.\n", 269 269 aUSBDevice->idVendor, aUSBDevice->idProduct, aUSBDevice->pszAddress)); … … 278 278 * See USBProxyService::deviceAdded for details. 279 279 */ 280 void USBProxy ServiceLinux::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines,280 void USBProxyBackendLinux::deviceAdded(ComObjPtr<HostUSBDevice> &aDevice, SessionMachinesList &llOpenedMachines, 281 281 PUSBDEVICE aUSBDevice) 282 282 { … … 292 292 293 293 devLock.release(); 294 USBProxy Service::deviceAdded(aDevice, llOpenedMachines, aUSBDevice);295 } 296 297 298 int USBProxy ServiceLinux::wait(RTMSINTERVAL aMillies)294 USBProxyBackend::deviceAdded(aDevice, llOpenedMachines, aUSBDevice); 295 } 296 297 298 int USBProxyBackendLinux::wait(RTMSINTERVAL aMillies) 299 299 { 300 300 int rc; … … 312 312 #define WAKE_UP_STRING_LEN ( sizeof(WAKE_UP_STRING) - 1 ) 313 313 314 int USBProxy ServiceLinux::waitUsbfs(RTMSINTERVAL aMillies)314 int USBProxyBackendLinux::waitUsbfs(RTMSINTERVAL aMillies) 315 315 { 316 316 struct pollfd PollFds[2]; … … 347 347 348 348 349 int USBProxy ServiceLinux::waitSysfs(RTMSINTERVAL aMillies)349 int USBProxyBackendLinux::waitSysfs(RTMSINTERVAL aMillies) 350 350 { 351 351 #ifdef VBOX_USB_WITH_SYSFS … … 363 363 364 364 365 int USBProxy ServiceLinux::interruptWait(void)365 int USBProxyBackendLinux::interruptWait(void) 366 366 { 367 367 AssertReturn(!isWriteLockOnCurrentThread(), VERR_GENERAL_FAILURE); … … 385 385 386 386 387 PUSBDEVICE USBProxy ServiceLinux::getDevices(void)387 PUSBDEVICE USBProxyBackendLinux::getDevices(void) 388 388 { 389 389 return USBProxyLinuxGetDevices(mDevicesRoot.c_str(), !mUsingUsbfsDevices);
Note:
See TracChangeset
for help on using the changeset viewer.