diff -urN vbox-clean-bk\src\VBox\Devices/Makefile.kmk vbox-clean\src\VBox\Devices/Makefile.kmk
old
|
new
|
|
538 | 538 | $(PATH_SDK_$(VBOX_WINDDK)_LIB)/dsound.lib |
539 | 539 | endif |
540 | 540 | |
| 541 | ifeq ($(KBUILD_TARGET),os2) |
| 542 | VBoxDD_LIBS += $(PATH_STAGE_LIB)/VBox-os2-poll$(VBOX_SUFF_LIB) |
| 543 | VBoxDD_INCS += $(PATH_SUB_CURRENT)/src/libs/poll-os2 |
| 544 | endif |
| 545 | |
541 | 546 | ifeq ($(KBUILD_TARGET),linux) |
542 | 547 | VBoxDD_SOURCES += \ |
543 | 548 | Audio/DrvHostOSSAudio.cpp |
diff -urN vbox-clean-bk\src\VBox\Devices/Network/DrvNAT.cpp vbox-clean\src\VBox\Devices/Network/DrvNAT.cpp
old
|
new
|
|
42 | 42 | #include <iprt/string.h> |
43 | 43 | #include <iprt/stream.h> |
44 | 44 | #include <iprt/uuid.h> |
| 45 | #ifdef RT_OS_OS2 |
| 46 | #include <iprt/socket.h> |
| 47 | #include <resolv.h> |
| 48 | #endif |
45 | 49 | |
46 | 50 | #include "VBoxDD.h" |
47 | 51 | |
… |
… |
|
171 | 175 | PDMNETWORKLINKSTATE enmLinkStateWant; |
172 | 176 | |
173 | 177 | #ifndef RT_OS_WINDOWS |
| 178 | #ifndef RT_OS_OS2 |
174 | 179 | /** The write end of the control pipe. */ |
175 | 180 | RTPIPE hPipeWrite; |
176 | 181 | /** The read end of the control pipe. */ |
177 | 182 | RTPIPE hPipeRead; |
| 183 | #else |
| 184 | /** The write end of the control pipe. */ |
| 185 | RTSOCKET hPipeWrite; |
| 186 | /** The read end of the control pipe. */ |
| 187 | RTSOCKET hPipeRead; |
| 188 | #endif |
178 | 189 | # if HC_ARCH_BITS == 32 |
179 | 190 | uint32_t u32Padding; |
180 | 191 | # endif |
… |
… |
|
610 | 621 | #ifndef RT_OS_WINDOWS |
611 | 622 | /* kick poll() */ |
612 | 623 | size_t cbIgnored; |
| 624 | #ifndef RT_OS_OS2 |
613 | 625 | rc = RTPipeWrite(pThis->hPipeWrite, "", 1, &cbIgnored); |
614 | 626 | #else |
| 627 | rc = RTSocketWrite(pThis->hPipeWrite, "", 1); |
| 628 | #endif |
| 629 | |
| 630 | #else |
615 | 631 | /* kick WSAWaitForMultipleEvents */ |
616 | 632 | rc = WSASetEvent(pThis->hWakeupEvent); |
617 | 633 | #endif |
… |
… |
|
784 | 800 | |
785 | 801 | /* don't pass the management pipe */ |
786 | 802 | slirp_select_fill(pThis->pNATState, &nFDs, &polls[1]); |
787 | | |
| 803 | #ifndef RT_OS_OS2 |
788 | 804 | polls[0].fd = RTPipeToNative(pThis->hPipeRead); |
| 805 | #else |
| 806 | polls[0].fd = RTSocketToNative(pThis->hPipeRead); |
| 807 | #endif |
789 | 808 | /* POLLRDBAND usually doesn't used on Linux but seems used on Solaris */ |
790 | 809 | polls[0].events = POLLRDNORM | POLLPRI | POLLRDBAND; |
791 | 810 | polls[0].revents = 0; |
… |
… |
|
825 | 844 | * pipe.*/ |
826 | 845 | char ch; |
827 | 846 | size_t cbRead; |
| 847 | #ifndef RT_OS_OS2 |
828 | 848 | RTPipeRead(pThis->hPipeRead, &ch, 1, &cbRead); |
| 849 | #else |
| 850 | RTSocketRead(pThis->hPipeRead, &ch, 1, &cbRead); |
| 851 | #endif |
829 | 852 | } |
830 | 853 | } |
831 | 854 | /* process _all_ outstanding requests but don't wait */ |
… |
… |
|
1611 | 1634 | /* |
1612 | 1635 | * Create the control pipe. |
1613 | 1636 | */ |
| 1637 | #ifndef RT_OS_OS2 |
1614 | 1638 | rc = RTPipeCreate(&pThis->hPipeRead, &pThis->hPipeWrite, 0 /*fFlags*/); |
1615 | 1639 | AssertRCReturn(rc, rc); |
1616 | 1640 | #else |
| 1641 | int so[2]; |
| 1642 | |
| 1643 | /* Create a pair of connected local sockets */ |
| 1644 | rc = socketpair(AF_LOCAL, SOCK_STREAM, 0, (int *)so); |
| 1645 | |
| 1646 | AssertRCReturn(rc, rc); |
| 1647 | RTSocketFromNative(&pThis->hPipeRead, so[0]); |
| 1648 | RTSocketFromNative(&pThis->hPipeWrite, so[1]); |
| 1649 | #endif |
| 1650 | |
| 1651 | #else |
1617 | 1652 | pThis->hWakeupEvent = CreateEvent(NULL, FALSE, FALSE, NULL); /* auto-reset event */ |
1618 | 1653 | slirp_register_external_event(pThis->pNATState, pThis->hWakeupEvent, |
1619 | 1654 | VBOX_WAKEUP_EVENT_INDEX); |
diff -urN vbox-clean-bk\src\VBox\Devices/Network/DrvTAP.cpp vbox-clean\src\VBox\Devices/Network/DrvTAP.cpp
old
|
new
|
|
39 | 39 | # include <iprt/process.h> |
40 | 40 | # include <iprt/env.h> |
41 | 41 | #endif |
| 42 | #ifdef RT_OS_OS2 |
| 43 | #include <iprt/socket.h> |
| 44 | #endif |
42 | 45 | |
43 | 46 | #include <sys/ioctl.h> |
44 | 47 | #include <sys/poll.h> |
… |
… |
|
96 | 99 | char *pszSetupApplication; |
97 | 100 | /** TAP terminate application. */ |
98 | 101 | char *pszTerminateApplication; |
| 102 | #ifndef RT_OS_OS2 |
99 | 103 | /** The write end of the control pipe. */ |
100 | 104 | RTPIPE hPipeWrite; |
101 | 105 | /** The read end of the control pipe. */ |
102 | 106 | RTPIPE hPipeRead; |
| 107 | #else |
| 108 | /** The write end of the control pipe. */ |
| 109 | RTSOCKET hPipeWrite; |
| 110 | /** The read end of the control pipe. */ |
| 111 | RTSOCKET hPipeRead; |
| 112 | #endif |
103 | 113 | /** Reader thread. */ |
104 | 114 | PPDMTHREAD pThread; |
105 | 115 | |
… |
… |
|
347 | 357 | aFDs[0].fd = RTFileToNative(pThis->hFileDevice); |
348 | 358 | aFDs[0].events = POLLIN | POLLPRI; |
349 | 359 | aFDs[0].revents = 0; |
| 360 | #ifndef RT_OS_OS2 |
350 | 361 | aFDs[1].fd = RTPipeToNative(pThis->hPipeRead); |
| 362 | #else |
| 363 | aFDs[1].fd = RTSocketToNative(pThis->hPipeRead); |
| 364 | #endif |
351 | 365 | aFDs[1].events = POLLIN | POLLPRI | POLLERR | POLLHUP; |
352 | 366 | aFDs[1].revents = 0; |
353 | 367 | STAM_PROFILE_ADV_STOP(&pThis->StatReceive, a); |
… |
… |
|
431 | 445 | /* drain the pipe */ |
432 | 446 | char ch; |
433 | 447 | size_t cbRead; |
| 448 | #ifndef RT_OS_OS2 |
434 | 449 | RTPipeRead(pThis->hPipeRead, &ch, 1, &cbRead); |
| 450 | #else |
| 451 | RTSocketRead(pThis->hPipeRead, &ch, 1, &cbRead); |
| 452 | #endif |
435 | 453 | } |
436 | 454 | else |
437 | 455 | { |
… |
… |
|
468 | 486 | PDRVTAP pThis = PDMINS_2_DATA(pDrvIns, PDRVTAP); |
469 | 487 | |
470 | 488 | size_t cbIgnored; |
| 489 | #ifndef RT_OS_OS2 |
471 | 490 | int rc = RTPipeWrite(pThis->hPipeWrite, "", 1, &cbIgnored); |
| 491 | #else |
| 492 | int rc = RTSocketWrite(pThis->hPipeWrite, "", 1); |
| 493 | #endif |
472 | 494 | AssertRC(rc); |
473 | 495 | |
474 | 496 | return VINF_SUCCESS; |
… |
… |
|
772 | 794 | * Terminate the control pipe. |
773 | 795 | */ |
774 | 796 | int rc; |
| 797 | #ifndef RT_OS_OS2 |
775 | 798 | if (pThis->hPipeWrite != NIL_RTPIPE) |
776 | 799 | { |
777 | 800 | rc = RTPipeClose(pThis->hPipeWrite); AssertRC(rc); |
… |
… |
|
782 | 805 | rc = RTPipeClose(pThis->hPipeRead); AssertRC(rc); |
783 | 806 | pThis->hPipeRead = NIL_RTPIPE; |
784 | 807 | } |
| 808 | #else |
| 809 | if (pThis->hPipeWrite != NIL_RTSOCKET) |
| 810 | { |
| 811 | rc = RTSocketClose(pThis->hPipeWrite); AssertRC(rc); |
| 812 | pThis->hPipeWrite = NIL_RTSOCKET; |
| 813 | } |
| 814 | if (pThis->hPipeRead != NIL_RTSOCKET) |
| 815 | { |
| 816 | rc = RTSocketClose(pThis->hPipeRead); AssertRC(rc); |
| 817 | pThis->hPipeRead = NIL_RTSOCKET; |
| 818 | } |
| 819 | #endif |
785 | 820 | |
786 | 821 | #ifdef RT_OS_SOLARIS |
787 | 822 | /** @todo r=bird: This *does* need checking against ConsoleImpl2.cpp if used on non-solaris systems. */ |
… |
… |
|
849 | 884 | */ |
850 | 885 | pThis->pDrvIns = pDrvIns; |
851 | 886 | pThis->hFileDevice = NIL_RTFILE; |
| 887 | #ifndef RT_OS_OS2 |
852 | 888 | pThis->hPipeWrite = NIL_RTPIPE; |
853 | 889 | pThis->hPipeRead = NIL_RTPIPE; |
| 890 | #else |
| 891 | pThis->hPipeWrite = NIL_RTSOCKET; |
| 892 | pThis->hPipeRead = NIL_RTSOCKET; |
| 893 | #endif |
854 | 894 | pThis->pszDeviceName = NULL; |
855 | 895 | #ifdef RT_OS_SOLARIS |
856 | 896 | pThis->iIPFileDes = -1; |
… |
… |
|
983 | 1023 | /* |
984 | 1024 | * Create the control pipe. |
985 | 1025 | */ |
| 1026 | #ifndef RT_OS_OS2 |
986 | 1027 | rc = RTPipeCreate(&pThis->hPipeRead, &pThis->hPipeWrite, 0 /*fFlags*/); |
987 | 1028 | AssertRCReturn(rc, rc); |
| 1029 | #else |
| 1030 | int so[2]; |
988 | 1031 | |
| 1032 | /* Create a pair of connected local sockets */ |
| 1033 | rc = socketpair(AF_LOCAL, SOCK_STREAM, 0, (int *)so); |
| 1034 | AssertRCReturn(rc, rc); |
| 1035 | |
| 1036 | RTSocketFromNative(&pThis->hPipeRead, so[0]); |
| 1037 | RTSocketFromNative(&pThis->hPipeWrite, so[1]); |
| 1038 | #endif |
989 | 1039 | /* |
990 | 1040 | * Create the async I/O thread. |
991 | 1041 | */ |
diff -urN vbox-clean-bk\src\VBox\Devices/Network/DrvVDE.cpp vbox-clean\src\VBox\Devices/Network/DrvVDE.cpp
old
|
new
|
|
38 | 38 | #include <iprt/string.h> |
39 | 39 | #include <iprt/thread.h> |
40 | 40 | #include <iprt/uuid.h> |
| 41 | #ifdef RT_OS_OS2 |
| 42 | #include <iprt/socket.h> |
| 43 | #endif |
41 | 44 | |
42 | 45 | #include <sys/ioctl.h> |
43 | 46 | #include <sys/poll.h> |
… |
… |
|
66 | 69 | PPDMDRVINS pDrvIns; |
67 | 70 | /** The configured VDE device name. */ |
68 | 71 | char *pszDeviceName; |
| 72 | #ifndef RT_OS_OS2 |
69 | 73 | /** The write end of the control pipe. */ |
70 | 74 | RTPIPE hPipeWrite; |
71 | 75 | /** The read end of the control pipe. */ |
72 | 76 | RTPIPE hPipeRead; |
| 77 | #else |
| 78 | /** The write end of the control pipe. */ |
| 79 | RTSOCKET hPipeWrite; |
| 80 | /** The read end of the control pipe. */ |
| 81 | RTSOCKET hPipeRead; |
| 82 | #endif |
73 | 83 | /** Reader thread. */ |
74 | 84 | PPDMTHREAD pThread; |
75 | 85 | /** The connection to the VDE switch */ |
… |
… |
|
320 | 330 | aFDs[0].fd = vde_datafd(pThis->pVdeConn); |
321 | 331 | aFDs[0].events = POLLIN | POLLPRI; |
322 | 332 | aFDs[0].revents = 0; |
| 333 | #ifndef RT_OS_OS2 |
323 | 334 | aFDs[1].fd = RTPipeToNative(pThis->hPipeRead); |
| 335 | #else |
| 336 | aFDs[1].fd = RTSocketToNative(pThis->hPipeRead); |
| 337 | #endif |
324 | 338 | aFDs[1].events = POLLIN | POLLPRI | POLLERR | POLLHUP; |
325 | 339 | aFDs[1].revents = 0; |
326 | 340 | STAM_PROFILE_ADV_STOP(&pThis->StatReceive, a); |
… |
… |
|
402 | 416 | /* drain the pipe */ |
403 | 417 | char ch; |
404 | 418 | size_t cbRead; |
| 419 | #ifndef RT_OS_OS2 |
405 | 420 | RTPipeRead(pThis->hPipeRead, &ch, 1, &cbRead); |
| 421 | #else |
| 422 | RTSocketRead(pThis->hPipeRead, &ch, 1, &cbRead); |
| 423 | #endif |
406 | 424 | } |
407 | 425 | else |
408 | 426 | { |
… |
… |
|
439 | 457 | PDRVVDE pThis = PDMINS_2_DATA(pDrvIns, PDRVVDE); |
440 | 458 | |
441 | 459 | size_t cbIgnored; |
| 460 | #ifndef RT_OS_OS2 |
442 | 461 | int rc = RTPipeWrite(pThis->hPipeWrite, "", 1, &cbIgnored); |
| 462 | #else |
| 463 | int rc = RTSocketWrite(pThis->hPipeWrite, "", 1); |
| 464 | #endif |
443 | 465 | AssertRC(rc); |
444 | 466 | |
445 | 467 | return VINF_SUCCESS; |
… |
… |
|
480 | 502 | /* |
481 | 503 | * Terminate the control pipe. |
482 | 504 | */ |
| 505 | #ifndef RT_OS_OS2 |
483 | 506 | if (pThis->hPipeWrite != NIL_RTPIPE) |
484 | 507 | { |
485 | 508 | RTPipeClose(pThis->hPipeWrite); |
… |
… |
|
490 | 513 | RTPipeClose(pThis->hPipeRead); |
491 | 514 | pThis->hPipeRead = NIL_RTPIPE; |
492 | 515 | } |
| 516 | #else |
| 517 | if (pThis->hPipeWrite != NIL_RTSOCKET) |
| 518 | { |
| 519 | RTSocketClose(pThis->hPipeWrite); |
| 520 | pThis->hPipeWrite = NIL_RTSOCKET; |
| 521 | } |
| 522 | if (pThis->hPipeRead != NIL_RTSOCKET) |
| 523 | { |
| 524 | RTSocketClose(pThis->hPipeRead); |
| 525 | pThis->hPipeRead = NIL_RTSOCKET; |
| 526 | } |
| 527 | #endif |
493 | 528 | |
494 | 529 | MMR3HeapFree(pThis->pszDeviceName); |
495 | 530 | pThis->pszDeviceName = NULL; |
… |
… |
|
535 | 570 | */ |
536 | 571 | pThis->pDrvIns = pDrvIns; |
537 | 572 | pThis->pszDeviceName = NULL; |
| 573 | #ifndef RT_OS_OS2 |
538 | 574 | pThis->hPipeRead = NIL_RTPIPE; |
539 | 575 | pThis->hPipeWrite = NIL_RTPIPE; |
| 576 | #else |
| 577 | pThis->hPipeRead = NIL_RTSOCKET; |
| 578 | pThis->hPipeWrite = NIL_RTSOCKET; |
| 579 | #endif |
540 | 580 | |
541 | 581 | /* IBase */ |
542 | 582 | pDrvIns->IBase.pfnQueryInterface = drvVDEQueryInterface; |
… |
… |
|
608 | 648 | /* |
609 | 649 | * Create the control pipe. |
610 | 650 | */ |
| 651 | #ifndef RT_OS_OS2 |
611 | 652 | rc = RTPipeCreate(&pThis->hPipeRead, &pThis->hPipeWrite, 0 /*fFlags*/); |
612 | 653 | AssertRCReturn(rc, rc); |
| 654 | #else |
| 655 | int so[2]; |
| 656 | |
| 657 | /* Create a pair of connected local sockets */ |
| 658 | rc = socketpair(AF_LOCAL, SOCK_STREAM, 0, (int *)so); |
| 659 | AssertRCReturn(rc, rc); |
| 660 | |
| 661 | RTSocketFromNative(&pThis->hPipeRead, so[0]); |
| 662 | RTSocketFromNative(&pThis->hPipeWrite, so[1]); |
| 663 | #endif |
613 | 664 | |
614 | 665 | /* |
615 | 666 | * Create the async I/O thread. |
diff -urN vbox-clean-bk\src\VBox\Devices/Network/slirp/resolv_conf_parser.c vbox-clean\src\VBox\Devices/Network/slirp/resolv_conf_parser.c
old
|
new
|
|
299 | 299 | } |
300 | 300 | |
301 | 301 | break; |
| 302 | #if !defined(RT_OS_OS2) |
302 | 303 | case tok_ipv6: |
303 | 304 | case tok_ipv6_port: |
304 | 305 | { |
… |
… |
|
316 | 317 | } |
317 | 318 | |
318 | 319 | break; |
| 320 | #endif |
319 | 321 | default: /* loop condition doesn't let enter enything */ |
320 | 322 | AssertMsgFailed(("shouldn't ever happen tok:%d, %s", tok, |
321 | 323 | isprint(tok) ? parser->rcpp_str_buffer : "#")); |
diff -urN vbox-clean-bk\src\VBox\Devices/Network/slirp/slirp_dns.c vbox-clean\src\VBox\Devices/Network/slirp/slirp_dns.c
old
|
new
|
|
161 | 161 | |
162 | 162 | /* XXX: perhaps IPv6 shouldn't be ignored if we're using DNS proxy */ |
163 | 163 | st.rcps_flags = RCPSF_IGNORE_IPV6; |
| 164 | #ifndef RT_OS_OS2 |
164 | 165 | rc = rcp_parse(&st, RESOLV_CONF_FILE); |
| 166 | #else |
| 167 | char *etc = getenv("ETC"); |
| 168 | char fn[256]; |
| 169 | |
| 170 | if (! etc) |
| 171 | return -1; |
| 172 | |
| 173 | strcpy(fn, etc); |
| 174 | strcat(fn, "\resolv2"); |
| 175 | |
| 176 | rc = rcp_parse(&st, fn); |
| 177 | #endif |
165 | 178 | |
166 | 179 | if (rc < 0) |
167 | 180 | return -1; |
diff -urN vbox-clean-bk\src\VBox\Devices/Network/slirp/slirp.c vbox-clean\src\VBox\Devices/Network/slirp/slirp.c
old
|
new
|
|
2109 | 2109 | int rc; |
2110 | 2110 | |
2111 | 2111 | rcp_state.rcps_flags |= RCPSF_IGNORE_IPV6; |
| 2112 | #ifndef RT_OS_OS2 |
2112 | 2113 | rc = rcp_parse(&rcp_state, RESOLV_CONF_FILE); |
| 2114 | #else |
| 2115 | char *etc = getenv("ETC"); |
| 2116 | char fn[256]; |
| 2117 | |
| 2118 | if (! etc) |
| 2119 | return VERR_FILE_NOT_FOUND; |
| 2120 | |
| 2121 | strcpy(fn, etc); |
| 2122 | strcat(fn, "\resolv2"); |
| 2123 | |
| 2124 | rc = rcp_parse(&rcp_state, fn); |
| 2125 | #endif |
2113 | 2126 | LogRelFunc(("NAT: rcp_parse:%Rrc old domain:%s new domain:%s\n", |
2114 | 2127 | rc, LIST_EMPTY(&pData->pDomainList) |
2115 | 2128 | ? "(null)" |
diff -urN vbox-clean-bk\src\VBox\Devices/Storage/DevATA.cpp vbox-clean\src\VBox\Devices/Storage/DevATA.cpp
old
|
new
|
|
4499 | 4499 | cBusy = 0; |
4500 | 4500 | PDMCritSectLeave(&pCtl->lock); |
4501 | 4501 | |
4502 | | #ifndef RT_OS_WINDOWS |
| 4502 | #if !defined(RT_OS_WINDOWS) && !defined(RT_OS_OS2) |
4503 | 4503 | /* |
4504 | 4504 | * The thread might be stuck in an I/O operation |
4505 | 4505 | * due to a high I/O load on the host. (see @bugref{3301}) |
diff -urN vbox-clean-bk\src\VBox\Devices/Storage/VSCSI/VSCSIVpdPages.h vbox-clean\src\VBox\Devices/Storage/VSCSI/VSCSIVpdPages.h
old
|
new
|
|
65 | 65 | uint8_t abVpdPages[1]; |
66 | 66 | } VSCSIVPDPAGESUPPORTEDPAGES; |
67 | 67 | #pragma pack() |
| 68 | #ifndef RT_OS_OS2 // skip the check |
68 | 69 | AssertCompileSize(VSCSIVPDPAGESUPPORTEDPAGES, VSCSI_VPD_SUPPORTED_PAGES_SIZE+1); |
| 70 | #endif |
69 | 71 | typedef VSCSIVPDPAGESUPPORTEDPAGES *PVSCSIVPDPAGESUPPORTEDPAGES; |
70 | 72 | typedef const VSCSIVPDPAGESUPPORTEDPAGES *PCVSCSIVPDPAGESUPPORTEDPAGES; |
71 | 73 | |
… |
… |
|
99 | 101 | uint8_t abReserved[56]; |
100 | 102 | } VSCSIVPDPAGEBLOCKCHARACTERISTICS; |
101 | 103 | #pragma pack() |
| 104 | #ifndef RT_OS_OS2 // skip the check |
102 | 105 | AssertCompileSize(VSCSIVPDPAGEBLOCKCHARACTERISTICS, VSCSI_VPD_BLOCK_CHARACTERISTICS_SIZE); |
| 106 | #endif |
103 | 107 | typedef VSCSIVPDPAGEBLOCKCHARACTERISTICS *PVSCSIVPDPAGEBLOCKCHARACTERISTICS; |
104 | 108 | typedef const VSCSIVPDPAGEBLOCKCHARACTERISTICS *PCVSCSIVPDPAGEBLOCKCHARACTERISTICS; |
105 | 109 | |
diff -urN vbox-clean-bk\src\VBox\Devices/USB/os2/USBProxyDevice-os2.cpp vbox-clean\src\VBox\Devices/USB/os2/USBProxyDevice-os2.cpp
old
|
new
|
|
174 | 174 | */ |
175 | 175 | static PUSBPROXYURBOS2 usbProxyOs2UrbAlloc(PUSBPROXYDEV pProxyDev) |
176 | 176 | { |
177 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 177 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
178 | 178 | PUSBPROXYURBOS2 pUrbOs2; |
179 | 179 | |
180 | 180 | RTCritSectEnter(&pDevOs2->CritSect); |
… |
… |
|
216 | 216 | */ |
217 | 217 | static void usbProxyOs2UrbFree(PUSBPROXYDEV pProxyDev, PUSBPROXYURBOS2 pUrbOs2) |
218 | 218 | { |
219 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 219 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
220 | 220 | |
221 | 221 | RTCritSectEnter(&pDevOs2->CritSect); |
222 | 222 | |
… |
… |
|
260 | 260 | static DECLCALLBACK(int) usbProxyOs2AsyncThread(RTTHREAD Thread, void *pvProxyDev) |
261 | 261 | { |
262 | 262 | PUSBPROXYDEV pProxyDev = (PUSBPROXYDEV)pvProxyDev; |
263 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 263 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
264 | 264 | size_t cbLow = 0; |
265 | 265 | void *pvLow = NULL; |
266 | 266 | |
… |
… |
|
429 | 429 | * @param pszAddress The path to the device. |
430 | 430 | * @param pvBackend Backend specific pointer, unused for the linux backend. |
431 | 431 | */ |
432 | | static int usbProxyOs2Open(PUSBPROXYDEV pProxyDev, const char *pszAddress, void *pvBackend) |
| 432 | static DECLCALLBACK(int) usbProxyOs2Open(PUSBPROXYDEV pProxyDev, const char *pszAddress, void *pvBackend) |
433 | 433 | { |
434 | 434 | LogFlow(("usbProxyOs2Open: pProxyDev=%p pszAddress=%s\n", pProxyDev, pszAddress)); |
435 | 435 | int rc; |
… |
… |
|
468 | 468 | const char chValue = *psz; |
469 | 469 | AssertReleaseReturn(psz[1] == '=', VERR_INTERNAL_ERROR); |
470 | 470 | uint64_t u64Value; |
471 | | int rc = RTStrToUInt64Ex(psz + 2, (char **)&psz, 0, &u64Value); |
| 471 | rc = RTStrToUInt64Ex(psz + 2, (char **)&psz, 0, &u64Value); |
472 | 472 | AssertReleaseRCReturn(rc, rc); |
473 | 473 | AssertReleaseReturn(!*psz || *psz == ';', rc); |
474 | 474 | switch (chValue) |
… |
… |
|
506 | 506 | rc = RTSemEventCreate(&pDevOs2->EventSyncWait); |
507 | 507 | if (RT_SUCCESS(rc)) |
508 | 508 | { |
509 | | pProxyDev->Backend.pv = pDevOs2; |
| 509 | pProxyDev->pvInstanceDataR3 = pDevOs2; |
510 | 510 | |
511 | 511 | /** @todo |
512 | 512 | * Determine the active configuration. |
… |
… |
|
542 | 542 | rc = VERR_VUSB_USBFS_PERMISSION; /** @todo fix me */ |
543 | 543 | |
544 | 544 | Log(("usbProxyOs2Open(%p, %s) failed, rc=%Rrc! urc=%d\n", pProxyDev, pszAddress, rc, urc)); NOREF(urc); |
545 | | pProxyDev->Backend.pv = NULL; |
| 545 | pProxyDev->pvInstanceDataR3 = NULL; |
546 | 546 | |
547 | 547 | NOREF(pvBackend); |
548 | 548 | return rc; |
… |
… |
|
552 | 552 | /** |
553 | 553 | * Closes the proxy device. |
554 | 554 | */ |
555 | | static void usbProxyOs2Close(PUSBPROXYDEV pProxyDev) |
| 555 | static DECLCALLBACK(void) usbProxyOs2Close(PUSBPROXYDEV pProxyDev) |
556 | 556 | { |
557 | 557 | LogFlow(("usbProxyOs2Close: pProxyDev=%s\n", pProxyDev->pUsbIns->pszName)); |
558 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 558 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
559 | 559 | Assert(pDevOs2); |
560 | 560 | if (!pDevOs2) |
561 | 561 | return; |
… |
… |
|
590 | 590 | pDevOs2->hDevice = 0; |
591 | 591 | |
592 | 592 | RTMemFree(pDevOs2); |
593 | | pProxyDev->Backend.pv = NULL; |
| 593 | pProxyDev->pvInstanceDataR3 = NULL; |
594 | 594 | LogFlow(("usbProxyOs2Close: returns\n")); |
595 | 595 | } |
596 | 596 | |
… |
… |
|
601 | 601 | * @returns VBox status code. |
602 | 602 | * @param pDev The device to reset. |
603 | 603 | */ |
604 | | static int usbProxyOs2Reset(PUSBPROXYDEV pProxyDev, bool fResetOnLinux) |
| 604 | static DECLCALLBACK(int) usbProxyOs2Reset(PUSBPROXYDEV pProxyDev, bool fResetOnLinux) |
605 | 605 | { |
606 | 606 | return VINF_SUCCESS; |
607 | 607 | } |
… |
… |
|
617 | 617 | * @param pProxyDev The device instance data. |
618 | 618 | * @param iCfg The configuration to set. |
619 | 619 | */ |
620 | | static int usbProxyOs2SetConfig(PUSBPROXYDEV pProxyDev, int iCfg) |
| 620 | static DECLCALLBACK(int) usbProxyOs2SetConfig(PUSBPROXYDEV pProxyDev, int iCfg) |
621 | 621 | { |
622 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 622 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
623 | 623 | LogFlow(("usbProxyOs2SetConfig: pProxyDev=%s cfg=%#x\n", |
624 | 624 | pProxyDev->pUsbIns->pszName, iCfg)); |
625 | 625 | |
… |
… |
|
644 | 644 | * Claims an interface. |
645 | 645 | * @returns success indicator. |
646 | 646 | */ |
647 | | static int usbProxyOs2ClaimInterface(PUSBPROXYDEV pProxyDev, int iIf) |
| 647 | static DECLCALLBACK(int) usbProxyOs2ClaimInterface(PUSBPROXYDEV pProxyDev, int iIf) |
648 | 648 | { |
649 | 649 | LogFlow(("usbProxyOs2ClaimInterface: pProxyDev=%s ifnum=%#x\n", pProxyDev->pUsbIns->pszName, iIf)); |
650 | 650 | return true; |
… |
… |
|
655 | 655 | * Releases an interface. |
656 | 656 | * @returns success indicator. |
657 | 657 | */ |
658 | | static int usbProxyOs2ReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf) |
| 658 | static DECLCALLBACK(int) usbProxyOs2ReleaseInterface(PUSBPROXYDEV pProxyDev, int iIf) |
659 | 659 | { |
660 | 660 | LogFlow(("usbProxyOs2ReleaseInterface: pProxyDev=%s ifnum=%#x\n", pProxyDev->pUsbIns->pszName, iIf)); |
661 | 661 | return true; |
… |
… |
|
667 | 667 | * |
668 | 668 | * @returns success indicator. |
669 | 669 | */ |
670 | | static int usbProxyOs2SetInterface(PUSBPROXYDEV pProxyDev, int iIf, int iAlt) |
| 670 | static DECLCALLBACK(int) usbProxyOs2SetInterface(PUSBPROXYDEV pProxyDev, int iIf, int iAlt) |
671 | 671 | { |
672 | 672 | LogFlow(("usbProxyOs2SetInterface: pProxyDev=%p iIf=%#x iAlt=%#x\n", pProxyDev, iIf, iAlt)); |
673 | 673 | return true; |
… |
… |
|
677 | 677 | /** |
678 | 678 | * Clears the halted endpoint 'EndPt'. |
679 | 679 | */ |
680 | | static bool usbProxyOs2ClearHaltedEp(PUSBPROXYDEV pProxyDev, unsigned int EndPt) |
| 680 | static DECLCALLBACK(int) usbProxyOs2ClearHaltedEp(PUSBPROXYDEV pProxyDev, unsigned int EndPt) |
681 | 681 | { |
682 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 682 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
683 | 683 | LogFlow(("usbProxyOs2ClearHaltedEp: pProxyDev=%s EndPt=%x\n", pProxyDev->pUsbIns->pszName, EndPt)); |
684 | 684 | |
685 | 685 | /* |
… |
… |
|
702 | 702 | /** |
703 | 703 | * @copydoc USBPROXYBACK::pfnUrbQueue |
704 | 704 | */ |
705 | | static int usbProxyOs2UrbQueue(PVUSBURB pUrb) |
| 705 | static DECLCALLBACK(int) usbProxyOs2UrbQueue(PUSBPROXYDEV pProxyDev, PVUSBURB pUrb) |
706 | 706 | { |
707 | | PUSBPROXYDEV pProxyDev = (PUSBPROXYDEV)pUrb->pDev; |
708 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 707 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
709 | 708 | LogFlow(("usbProxyOs2UrbQueue: pProxyDev=%s pUrb=%p EndPt=%d cbData=%d\n", |
710 | 709 | pProxyDev->pUsbIns->pszName, pUrb, pUrb->EndPt, pUrb->cbData)); |
711 | 710 | |
… |
… |
|
771 | 770 | * @param pProxyDev The device. |
772 | 771 | * @param cMillies Number of milliseconds to wait. Use 0 to not wait at all. |
773 | 772 | */ |
774 | | static PVUSBURB usbProxyOs2UrbReap(PUSBPROXYDEV pProxyDev, RTMSINTERVAL cMillies) |
| 773 | static DECLCALLBACK(PVUSBURB) usbProxyOs2UrbReap(PUSBPROXYDEV pProxyDev, RTMSINTERVAL cMillies) |
775 | 774 | { |
776 | 775 | PVUSBURB pUrb = NULL; |
777 | | PUSBPROXYDEVOS2 pDevOs2 = (PUSBPROXYDEVOS2)pProxyDev->Backend.pv; |
| 776 | PUSBPROXYDEVOS2 pDevOs2 = USBPROXYDEV_2_DATA(pProxyDev, PUSBPROXYDEVOS2); |
778 | 777 | |
779 | 778 | RTCritSectEnter(&pDevOs2->CritSect); |
780 | 779 | for (;;) |
… |
… |
|
818 | 817 | * Cancels the URB. |
819 | 818 | * The URB requires reaping, so we don't change its state. |
820 | 819 | */ |
821 | | static void usbProxyOs2UrbCancel(PVUSBURB pUrb) |
| 820 | static DECLCALLBACK(int) usbProxyOs2UrbCancel(PUSBPROXYDEV pProxyDev, PVUSBURB pUrb) |
822 | 821 | { |
823 | 822 | #if 0 |
824 | | PUSBPROXYDEV pProxyDev = (PUSBPROXYDEV)pUrb->pDev; |
825 | 823 | PUSBPROXYURBOS2 pUrbOs2 = (PUSBPROXYURBOS2)pUrb->Dev.pvProxyUrb; |
826 | 824 | if (pUrbOs2->pSplitHead) |
827 | 825 | { |
… |
… |
|
850 | 848 | pUrb, errno, pProxyDev->pUsbIns->pszName)); |
851 | 849 | } |
852 | 850 | #endif |
| 851 | return 0; |
853 | 852 | } |
854 | 853 | |
| 854 | static DECLCALLBACK(int) usbProxyOs2Wakeup(PUSBPROXYDEV pProxyDev) |
| 855 | { |
| 856 | return 1; // (???) |
| 857 | } |
855 | 858 | |
856 | 859 | /** |
857 | 860 | * The Linux USB Proxy Backend. |
858 | 861 | */ |
859 | 862 | extern const USBPROXYBACK g_USBProxyDeviceHost = |
860 | 863 | { |
861 | | "host", |
| 864 | "host", /* pszName */ |
| 865 | sizeof(USBPROXYDEVOS2), /* cbBackend */ |
862 | 866 | usbProxyOs2Open, |
863 | | NULL, |
| 867 | NULL, /* usbProxyOs2Init */ |
864 | 868 | usbProxyOs2Close, |
865 | 869 | usbProxyOs2Reset, |
866 | 870 | usbProxyOs2SetConfig, |
… |
… |
|
871 | 875 | usbProxyOs2UrbQueue, |
872 | 876 | usbProxyOs2UrbCancel, |
873 | 877 | usbProxyOs2UrbReap, |
| 878 | NULL, /* usbProxyOs2Wakeup */ |
874 | 879 | 0 |
875 | 880 | }; |
876 | | |