Changeset 60517 in vbox for trunk/src/VBox/ValidationKit/utils/usb/UsbTestServiceGadgetClassTest.cpp
- Timestamp:
- Apr 15, 2016 12:20:51 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/utils/usb/UsbTestServiceGadgetClassTest.cpp
r60493 r60517 37 37 38 38 #include "UsbTestServiceGadgetInternal.h" 39 #include "UsbTestServicePlatform.h" 39 40 40 41 /********************************************************************************************************************************* … … 253 254 /* Finally delete the gadget template. */ 254 255 utsGadgetClassTestDirRemove(pClass->pszGadgetPath); 256 257 /* Release the UDC. */ 258 if (pClass->pszUdc) 259 { 260 rc = utsPlatformLnxReleaseUDC(pClass->pszUdc); 261 AssertRC(rc); 262 RTStrFree(pClass->pszUdc); 263 } 255 264 } 256 265 … … 343 352 344 353 /* Finally enable the gadget by attaching it to a UDC. */ 345 /** @todo: Figure out a free UDC dynamically. */ 346 if (RT_SUCCESS(rc)) 347 rc = RTLinuxSysFsWriteStrFile("dummy_udc.0", 0, NULL, "%s/UDC", pClass->pszGadgetPath); 354 if (RT_SUCCESS(rc)) 355 { 356 pClass->pszUdc = NULL; 357 358 rc = utsPlatformLnxAcquireUDC(&pClass->pszUdc, &pClass->uBusId); 359 if (RT_SUCCESS(rc)) 360 rc = RTLinuxSysFsWriteStrFile(pClass->pszUdc, 0, NULL, "%s/UDC", pClass->pszGadgetPath); 361 } 348 362 } 349 363 … … 378 392 379 393 394 /** 395 * @interface_method_impl{UTSGADGETCLASS,pfnGetBusId} 396 */ 397 static DECLCALLBACK(uint32_t) utsGadgetClassTestGetBusId(PUTSGADGETCLASSINT pClass) 398 { 399 return pClass->uBusId; 400 } 401 402 403 /** 404 * @interface_method_impl{UTSGADGETCLASS,pfnConnect} 405 */ 406 static DECLCALLBACK(int) utsGadgetClassTestConnect(PUTSGADGETCLASSINT pClass) 407 { 408 return RTLinuxSysFsWriteStrFile("connect", 0, NULL, "/sys/class/udc/%s/soft_connect", pClass->pszUdc); 409 } 410 411 412 /** 413 * @interface_method_impl{UTSGADGETCLASS,pfnDisconnect} 414 */ 415 static DECLCALLBACK(int) utsGadgetClassTestDisconnect(PUTSGADGETCLASSINT pClass) 416 { 417 return RTLinuxSysFsWriteStrFile("disconnect", 0, NULL, "/sys/class/udc/%s/soft_connect", pClass->pszUdc);} 418 419 380 420 381 421 /** … … 393 433 utsGadgetClassTestInit, 394 434 /** pfnTerm */ 395 utsGadgetClassTestTerm 435 utsGadgetClassTestTerm, 436 /** pfnGetBusId */ 437 utsGadgetClassTestGetBusId, 438 /** pfnConnect */ 439 utsGadgetClassTestConnect, 440 /** pfnDisconnect. */ 441 utsGadgetClassTestDisconnect 396 442 }; 397 443
Note:
See TracChangeset
for help on using the changeset viewer.