Changeset 17256 in vbox for trunk/src/VBox/HostDrivers/VBoxNetAdp/darwin
- Timestamp:
- Mar 2, 2009 4:23:00 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 43595
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp
r17184 r17256 101 101 * The (common) global data. 102 102 */ 103 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 103 104 static VBOXNETADPGLOBALS g_VBoxNetAdpGlobals; 105 106 #else /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 107 108 /** 109 * Generate a suitable MAC address. 110 * 111 * @param pThis The instance. 112 * @param pMac Where to return the MAC address. 113 */ 114 DECLHIDDEN(void) vboxNetAdpComposeMACAddress(PVBOXNETADP pThis, PRTMAC pMac) 115 { 116 #if 0 /* Use a locally administered version of the OUI we use for the guest NICs. */ 117 pMac->au8[0] = 0x08 | 2; 118 pMac->au8[1] = 0x00; 119 pMac->au8[2] = 0x27; 120 #else /* this is what \0vb comes down to. It seems to be unassigned atm. */ 121 pMac->au8[0] = 0; 122 pMac->au8[1] = 0x76; 123 pMac->au8[2] = 0x62; 124 #endif 125 126 pMac->au8[3] = 0; /* pThis->uUnit >> 16; */ 127 pMac->au8[4] = 0; /* pThis->uUnit >> 8; */ 128 pMac->au8[5] = pThis->uUnit; 129 } 130 #endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 104 131 105 132 … … 117 144 } 118 145 146 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 119 147 /** 120 148 * Reads and retains the host interface handle. … … 440 468 } 441 469 442 470 #endif /* VBOXANETADP_DO_NOT_USE_NETFLT */ 443 471 static errno_t vboxNetAdpDarwinOutput(ifnet_t pIface, mbuf_t pMBuf) 444 472 { 473 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 445 474 PVBOXNETADP pThis = VBOXNETADP_FROM_IFACE(pIface); 446 475 Assert(pThis); … … 457 486 vboxNetAdpCancelReceive(pThis); 458 487 } 488 #endif /* VBOXANETADP_DO_NOT_USE_NETFLT */ 459 489 mbuf_freem_list(pMBuf); 460 490 return 0; … … 508 538 509 539 540 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 510 541 511 542 int vboxNetAdpPortOsXmit(PVBOXNETADP pThis, PINTNETSG pSG, uint32_t fDst) … … 587 618 return VINF_SUCCESS; 588 619 } 620 #else /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 621 VBOXNETADP g_vboxnet0; 622 623 #endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 589 624 590 625 … … 725 760 * for establishing the connect to the support driver. 726 761 */ 762 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 727 763 memset(&g_VBoxNetAdpGlobals, 0, sizeof(g_VBoxNetAdpGlobals)); 728 764 rc = vboxNetAdpInitGlobals(&g_VBoxNetAdpGlobals); 765 #else /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 766 RTMAC Mac; 767 vboxNetAdpOsInit(&g_vboxnet0); 768 vboxNetAdpComposeMACAddress(&g_vboxnet0, &Mac); 769 rc = vboxNetAdpOsCreate(&g_vboxnet0, &Mac); 770 #endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 729 771 if (RT_SUCCESS(rc)) 730 772 { … … 739 781 printf("VBoxAdpDrv: failed to initialize IPRT (rc=%d)\n", rc); 740 782 783 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 741 784 memset(&g_VBoxNetAdpGlobals, 0, sizeof(g_VBoxNetAdpGlobals)); 785 #endif /* VBOXANETADP_DO_NOT_USE_NETFLT */ 742 786 return KMOD_RETURN_FAILURE; 743 787 } … … 756 800 * tracking for us! 757 801 */ 802 #ifdef VBOXANETADP_DO_NOT_USE_NETFLT 758 803 int rc = vboxNetAdpTryDeleteGlobals(&g_VBoxNetAdpGlobals); 759 804 if (RT_FAILURE(rc)) … … 767 812 */ 768 813 memset(&g_VBoxNetAdpGlobals, 0, sizeof(g_VBoxNetAdpGlobals)); 814 #else /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 815 vboxNetAdpOsDestroy(&g_vboxnet0); 816 #endif /* !VBOXANETADP_DO_NOT_USE_NETFLT */ 769 817 770 818 RTR0Term();
Note:
See TracChangeset
for help on using the changeset viewer.