diff options
| author | Felix Geyer <debfx-pkg@fobos.de> | 2010-05-02 13:24:51 +0200 |
|---|---|---|
| committer | Felix Geyer <debfx-pkg@fobos.de> | 2010-05-02 13:24:51 +0200 |
| commit | 4749e3a0c5d3a159d3ae751e6780b537c860923a (patch) | |
| tree | 28cd86e0a63ddac4224277df9ce83ef056629917 /src/VBox/HostDrivers/VBoxNetAdp | |
| parent | 0429962c55c464036f613d707f26b91f252584e7 (diff) | |
| download | virtualbox-4749e3a0c5d3a159d3ae751e6780b537c860923a.tar.gz | |
Imported Upstream version 3.1.51-dfsgupstream/3.1.51-dfsg
Diffstat (limited to 'src/VBox/HostDrivers/VBoxNetAdp')
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk | 10 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c | 156 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h | 8 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp | 29 | ||||
| -rwxr-xr-x | src/VBox/HostDrivers/VBoxNetAdp/darwin/loadnetadp.sh | 6 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile | 8 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c | 2 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/VBox/HostDrivers/VBoxNetAdp/freebsd/files_vboxnetadp | 6 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile | 6 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c | 17 | ||||
| -rw-r--r--[-rwxr-xr-x] | src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp | 9 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c | 42 | ||||
| -rw-r--r-- | src/VBox/HostDrivers/VBoxNetAdp/solaris/vboxnet.conf | 6 |
13 files changed, 92 insertions, 213 deletions
diff --git a/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk b/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk index 6deca7d88..3a5b45a02 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk +++ b/src/VBox/HostDrivers/VBoxNetAdp/Makefile.kmk @@ -1,10 +1,10 @@ -# $Id: Makefile.kmk $ +# $Id: Makefile.kmk 28800 2010-04-27 08:22:32Z vboxsync $ ## @file # Sub-Makefile for the Network Adapter Driver (VBoxNetAdp). # # -# Copyright (C) 2009 Sun Microsystems, Inc. +# Copyright (C) 2009 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -14,10 +14,6 @@ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa -# Clara, CA 95054 USA or visit http://www.sun.com if you need -# additional information or have any questions. -# SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk @@ -140,7 +136,7 @@ $$(PATH_VBoxNetAdp-sh)/build_in_tmp: \ $(VBOX_VERSION_STAMP) \ | $$(dir $$@) $(call MSG_TOOL,Creating,,$@) - $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetadp;g" --output $@ $< + $(QUIET)$(SED) -e "s;_VERSION_;${VBOX_VERSION_STRING};g; s;_MODULE_;vboxnetadp;g; s;_BUILDTYPE_;${KBUILD_TYPE};g" --output $@ $< $(QUIET)chmod 0755 $@ $$(PATH_VBoxNetAdp-src)/dkms.conf: \ diff --git a/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c b/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c index cadb4ba09..060e6c29a 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c +++ b/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c @@ -1,10 +1,10 @@ -/* $Id: VBoxNetAdp.c $ */ +/* $Id: VBoxNetAdp.c 28830 2010-04-27 14:05:25Z vboxsync $ */ /** @file * VBoxNetAdp - Virtual Network Adapter Driver (Host), Common Code. */ /* - * Copyright (C) 2008-2009 Sun Microsystems, Inc. + * Copyright (C) 2008-2009 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -13,10 +13,6 @@ * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - * Clara, CA 95054 USA or visit http://www.sun.com if you need - * additional information or have any questions. */ /** @page pg_netadp VBoxNetAdp - Network Adapter @@ -40,6 +36,7 @@ #include <iprt/string.h> #ifdef VBOXANETADP_DO_NOT_USE_NETFLT +#error "this code is broken" #include <VBox/sup.h> #include <iprt/assert.h> @@ -110,9 +107,9 @@ DECLINLINE(void) vboxNetAdpSetStateWithLock(PVBOXNETADP pThis, VBOXNETADPSTATE e { RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; Log(("vboxNetAdpSetStateWithLock: pThis=%p, state=%d.\n", pThis, enmNewState)); - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpSetState(pThis, enmNewState); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); } @@ -128,9 +125,9 @@ DECLINLINE(VBOXNETADPSTATE) vboxNetAdpGetStateWithLock(PVBOXNETADP pThis) { VBOXNETADPSTATE enmState; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); enmState = vboxNetAdpGetState(pThis); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); Log(("vboxNetAdpGetStateWithLock: pThis=%p, state=%d.\n", pThis, enmState)); return enmState; } @@ -151,13 +148,13 @@ DECLINLINE(bool) vboxNetAdpCheckAndSetState(PVBOXNETADP pThis, VBOXNETADPSTATE e bool fRc = true; /* be optimistic */ RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); enmActualState = vboxNetAdpGetState(pThis); /** @todo r=bird: ASMAtomicCmpXchgU32()*/ if (enmActualState == enmOldState) vboxNetAdpSetState(pThis, enmNewState); else fRc = false; - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); if (fRc) Log(("vboxNetAdpCheckAndSetState: pThis=%p, state changed: %d -> %d.\n", pThis, enmOldState, enmNewState)); @@ -182,14 +179,14 @@ static PVBOXNETADP vboxNetAdpFind(PVBOXNETADPGLOBALS pGlobals, const char *pszNa { RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; PVBOXNETADP pThis = &pGlobals->aAdapters[i]; - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); if ( vboxNetAdpGetState(pThis) && !strcmp(pThis->szName, pszName)) { - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); return pThis; } - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); } return NULL; } @@ -349,14 +346,14 @@ DECLHIDDEN(bool) vboxNetAdpPrepareToReceive(PVBOXNETADP pThis) */ AssertPtr(pThis); Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); if (vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Active) { fCanReceive = true; vboxNetAdpRetain(pThis); vboxNetAdpBusy(pThis); } - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); Log(("vboxNetAdpPrepareToReceive: fCanReceive=%d.\n", fCanReceive)); return fCanReceive; @@ -397,33 +394,11 @@ DECLHIDDEN(void) vboxNetAdpCancelReceive(PVBOXNETADP pThis) vboxNetAdpRelease(pThis); } -#ifdef RT_WITH_W64_UNWIND_HACK -# if defined(RT_OS_WINDOWS) && defined(RT_ARCH_AMD64) -# define NETADP_DECL_CALLBACK(type) DECLASM(DECLHIDDEN(type)) -# define NETADP_CALLBACK(_n) netfltNtWrap##_n - -NETADP_DECL_CALLBACK(int) NETADP_CALLBACK(vboxNetAdpPortXmit)(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst); -NETADP_DECL_CALLBACK(bool) NETADP_CALLBACK(vboxNetAdpPortIsPromiscuous)(PINTNETTRUNKIFPORT pIfPort); -NETADP_DECL_CALLBACK(void) NETADP_CALLBACK(vboxNetAdpPortGetMacAddress)(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac); -NETADP_DECL_CALLBACK(bool) NETADP_CALLBACK(vboxNetAdpPortIsHostMac)(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac); -NETADP_DECL_CALLBACK(int) NETADP_CALLBACK(vboxNetAdpPortWaitForIdle)(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies); -NETADP_DECL_CALLBACK(bool) NETADP_CALLBACK(vboxNetAdpPortSetActive)(PINTNETTRUNKIFPORT pIfPort, bool fActive); -NETADP_DECL_CALLBACK(void) NETADP_CALLBACK(vboxNetAdpPortDisconnectAndRelease)(PINTNETTRUNKIFPORT pIfPort); -NETADP_DECL_CALLBACK(void) NETADP_CALLBACK(vboxNetAdpPortRetain)(PINTNETTRUNKIFPORT pIfPort); -NETADP_DECL_CALLBACK(void) NETADP_CALLBACK(vboxNetAdpPortRelease)(PINTNETTRUNKIFPORT pIfPort); - -# else -# error "UNSUPPORTED (RT_WITH_W64_UNWIND_HACK)" -# endif -#else -# define NETADP_DECL_CALLBACK(type) static DECLCALLBACK(type) -# define NETADP_CALLBACK(_n) _n -#endif /** * @copydoc INTNETTRUNKIFPORT::pfnXmit */ -NETADP_DECL_CALLBACK(int) vboxNetAdpPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst) +static DECLCALLBACK(int) vboxNetAdpPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNETSG pSG, uint32_t fDst) { RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); @@ -441,17 +416,17 @@ NETADP_DECL_CALLBACK(int) vboxNetAdpPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNET /* * Do a retain/busy, invoke the OS specific code. */ - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Active) { - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); Log(("vboxNetAdpReceive: Dropping incoming packet for inactive interface %s.\n", pThis->szName)); return VERR_INVALID_STATE; } vboxNetAdpRetain(pThis); vboxNetAdpBusy(pThis); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); rc = vboxNetAdpPortOsXmit(pThis, pSG, fDst); vboxNetAdpIdle(pThis); @@ -462,30 +437,9 @@ NETADP_DECL_CALLBACK(int) vboxNetAdpPortXmit(PINTNETTRUNKIFPORT pIfPort, PINTNET /** - * @copydoc INTNETTRUNKIFPORT::pfnIsPromiscuous - */ -NETADP_DECL_CALLBACK(bool) vboxNetAdpPortIsPromiscuous(PINTNETTRUNKIFPORT pIfPort) -{ - PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); - - /* - * Input validation. - */ - AssertPtr(pThis); - Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); - Assert(vboxNetAdpGetStateWithLock(pThis) == kVBoxNetAdpState_Active); - - /* - * Ask the OS specific code. - */ - return vboxNetAdpPortOsIsPromiscuous(pThis); -} - - -/** * @copydoc INTNETTRUNKIFPORT::pfnGetMacAddress */ -NETADP_DECL_CALLBACK(void) vboxNetAdpPortGetMacAddress(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac) +static DECLCALLBACK(void) vboxNetAdpPortGetMacAddress(PINTNETTRUNKIFPORT pIfPort, PRTMAC pMac) { PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); @@ -504,30 +458,9 @@ NETADP_DECL_CALLBACK(void) vboxNetAdpPortGetMacAddress(PINTNETTRUNKIFPORT pIfPor /** - * @copydoc INTNETTRUNKIFPORT::pfnIsHostMac - */ -NETADP_DECL_CALLBACK(bool) vboxNetAdpPortIsHostMac(PINTNETTRUNKIFPORT pIfPort, PCRTMAC pMac) -{ - PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); - - /* - * Input validation. - */ - AssertPtr(pThis); - Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); - Assert(vboxNetAdpGetStateWithLock(pThis) == kVBoxNetAdpState_Active); - - /* - * Ask the OS specific code. - */ - return vboxNetAdpPortOsIsHostMac(pThis, pMac); -} - - -/** * @copydoc INTNETTRUNKIFPORT::pfnWaitForIdle */ -NETADP_DECL_CALLBACK(int) vboxNetAdpPortWaitForIdle(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies) +static DECLCALLBACK(int) vboxNetAdpPortWaitForIdle(PINTNETTRUNKIFPORT pIfPort, uint32_t cMillies) { int rc; PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); @@ -557,7 +490,7 @@ NETADP_DECL_CALLBACK(int) vboxNetAdpPortWaitForIdle(PINTNETTRUNKIFPORT pIfPort, /** * @copydoc INTNETTRUNKIFPORT::pfnSetActive */ -NETADP_DECL_CALLBACK(bool) vboxNetAdpPortSetActive(PINTNETTRUNKIFPORT pIfPort, bool fActive) +static DECLCALLBACK(bool) vboxNetAdpPortSetActive(PINTNETTRUNKIFPORT pIfPort, bool fActive) { bool fPreviouslyActive; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; @@ -571,7 +504,7 @@ NETADP_DECL_CALLBACK(bool) vboxNetAdpPortSetActive(PINTNETTRUNKIFPORT pIfPort, b Assert(pThis->MyPort.u32Version == INTNETTRUNKIFPORT_VERSION); Log(("vboxNetAdpPortSetActive: pThis=%p, fActive=%d, state before: %d.\n", pThis, fActive, vboxNetAdpGetState(pThis))); - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); fPreviouslyActive = vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Active; if (fPreviouslyActive != fActive) @@ -589,7 +522,7 @@ NETADP_DECL_CALLBACK(bool) vboxNetAdpPortSetActive(PINTNETTRUNKIFPORT pIfPort, b } } - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); Log(("vboxNetAdpPortSetActive: state after: %RTbool.\n", vboxNetAdpGetState(pThis))); return fPreviouslyActive; } @@ -598,7 +531,7 @@ NETADP_DECL_CALLBACK(bool) vboxNetAdpPortSetActive(PINTNETTRUNKIFPORT pIfPort, b /** * @copydoc INTNETTRUNKIFPORT::pfnDisconnectAndRelease */ -NETADP_DECL_CALLBACK(void) vboxNetAdpPortDisconnectAndRelease(PINTNETTRUNKIFPORT pIfPort) +static DECLCALLBACK(void) vboxNetAdpPortDisconnectAndRelease(PINTNETTRUNKIFPORT pIfPort) { PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; @@ -617,18 +550,18 @@ NETADP_DECL_CALLBACK(void) vboxNetAdpPortDisconnectAndRelease(PINTNETTRUNKIFPORT /* * Disconnect and release it. */ - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); //Assert(vboxNetAdpGetState(pThis) == kVBoxNetAdpState_Connected); Assert(!pThis->cBusy); vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpOsDisconnectIt(pThis); pThis->pSwitchPort = NULL; - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpRelease(pThis); } @@ -637,7 +570,7 @@ NETADP_DECL_CALLBACK(void) vboxNetAdpPortDisconnectAndRelease(PINTNETTRUNKIFPORT /** * @copydoc INTNETTRUNKIFPORT::pfnRelease */ -NETADP_DECL_CALLBACK(void) vboxNetAdpPortRelease(PINTNETTRUNKIFPORT pIfPort) +static DECLCALLBACK(void) vboxNetAdpPortRelease(PINTNETTRUNKIFPORT pIfPort) { PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); vboxNetAdpRelease(pThis); @@ -647,7 +580,7 @@ NETADP_DECL_CALLBACK(void) vboxNetAdpPortRelease(PINTNETTRUNKIFPORT pIfPort) /** * @copydoc INTNETTRUNKIFPORT::pfnRetain */ -NETADP_DECL_CALLBACK(void) vboxNetAdpPortRetain(PINTNETTRUNKIFPORT pIfPort) +static DECLCALLBACK(void) vboxNetAdpPortRetain(PINTNETTRUNKIFPORT pIfPort) { PVBOXNETADP pThis = IFPORT_2_VBOXNETADP(pIfPort); vboxNetAdpRetain(pThis); @@ -673,9 +606,9 @@ int vboxNetAdpCreate (PINTNETTRUNKFACTORY pIfFactory, PVBOXNETADP *ppNew) vboxNetAdpComposeMACAddress(pThis, &Mac); rc = vboxNetAdpOsCreate(pThis, &Mac); *ppNew = pThis; - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpSetState(pThis, kVBoxNetAdpState_Available); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); return rc; } } @@ -689,21 +622,21 @@ int vboxNetAdpDestroy (PVBOXNETADP pThis) int rc = VINF_SUCCESS; RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); if (vboxNetAdpGetState(pThis) != kVBoxNetAdpState_Available || pThis->cBusy) { - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); return VERR_INTNET_FLT_IF_BUSY; } vboxNetAdpSetState(pThis, kVBoxNetAdpState_Transitional); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpRelease(pThis); vboxNetAdpOsDestroy(pThis); - RTSpinlockAcquire(pThis->hSpinlock, &Tmp); + RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); vboxNetAdpSetState(pThis, kVBoxNetAdpState_Invalid); - RTSpinlockRelease(pThis->hSpinlock, &Tmp); + RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); return rc; } @@ -906,15 +839,12 @@ static int vboxNetAdpSlotCreate(PVBOXNETADPGLOBALS pGlobals, unsigned uUnit, PVB int rc; pNew->MyPort.u32Version = INTNETTRUNKIFPORT_VERSION; - pNew->MyPort.pfnRetain = NETADP_CALLBACK(vboxNetAdpPortRetain); - pNew->MyPort.pfnRelease = NETADP_CALLBACK(vboxNetAdpPortRelease); - pNew->MyPort.pfnDisconnectAndRelease= NETADP_CALLBACK(vboxNetAdpPortDisconnectAndRelease); - pNew->MyPort.pfnSetActive = NETADP_CALLBACK(vboxNetAdpPortSetActive); - pNew->MyPort.pfnWaitForIdle = NETADP_CALLBACK(vboxNetAdpPortWaitForIdle); - pNew->MyPort.pfnGetMacAddress = NETADP_CALLBACK(vboxNetAdpPortGetMacAddress); - pNew->MyPort.pfnIsHostMac = NETADP_CALLBACK(vboxNetAdpPortIsHostMac); - pNew->MyPort.pfnIsPromiscuous = NETADP_CALLBACK(vboxNetAdpPortIsPromiscuous); - pNew->MyPort.pfnXmit = NETADP_CALLBACK(vboxNetAdpPortXmit); + pNew->MyPort.pfnRetain = vboxNetAdpPortRetain; + pNew->MyPort.pfnRelease = vboxNetAdpPortRelease; + pNew->MyPort.pfnDisconnectAndRelease= vboxNetAdpPortDisconnectAndRelease; + pNew->MyPort.pfnSetState = vboxNetAdpPortSetState; + pNew->MyPort.pfnWaitForIdle = vboxNetAdpPortWaitForIdle; + pNew->MyPort.pfnXmit = vboxNetAdpPortXmit; pNew->MyPort.u32VersionEnd = INTNETTRUNKIFPORT_VERSION; pNew->pSwitchPort = NULL; pNew->pGlobals = pGlobals; diff --git a/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h b/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h index 3cd801698..a607ce33f 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h +++ b/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h @@ -1,10 +1,10 @@ -/* $Id: VBoxNetAdpInternal.h $ */ +/* $Id: VBoxNetAdpInternal.h 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VBoxNetAdp - Network Filter Driver (Host), Internal Header. */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. + * Copyright (C) 2008 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -13,10 +13,6 @@ * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - * Clara, CA 95054 USA or visit http://www.sun.com if you need - * additional information or have any questions. */ #ifndef ___VBoxNetAdpInternal_h___ diff --git a/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp b/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp index aa01ba1f7..b2ddb307e 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp +++ b/src/VBox/HostDrivers/VBoxNetAdp/darwin/VBoxNetAdp-darwin.cpp @@ -1,10 +1,10 @@ -/* $Id: VBoxNetAdp-darwin.cpp $ */ +/* $Id: VBoxNetAdp-darwin.cpp 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VBoxNetAdp - Virtual Network Adapter Driver (Host), Darwin Specific Code. */ /* - * Copyright (C) 2008 Sun Microsystems, Inc. + * Copyright (C) 2008 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -13,10 +13,6 @@ * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - * Clara, CA 95054 USA or visit http://www.sun.com if you need - * additional information or have any questions. */ /******************************************************************************* @@ -75,23 +71,6 @@ RT_C_DECLS_END #define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface)) -/* debug printf */ -#if defined(RT_OS_WINDOWS) -# define OSDBGPRINT(a) DbgPrint a -#elif defined(RT_OS_LINUX) -# define OSDBGPRINT(a) printk a -#elif defined(RT_OS_DARWIN) -# define OSDBGPRINT(a) printf a -#elif defined(RT_OS_OS2) -# define OSDBGPRINT(a) SUPR0Printf a -#elif defined(RT_OS_FREEBSD) -# define OSDBGPRINT(a) printf a -#elif defined(RT_OS_SOLARIS) -# define OSDBGPRINT(a) SUPR0Printf a -#else -# define OSDBGPRINT(a) -#endif - /******************************************************************************* * Internal Functions * *******************************************************************************/ @@ -224,7 +203,7 @@ int vboxNetAdpOsCreate(PVBOXNETADP pThis, PCRTMAC pMACAddress) rc = RTSemEventCreate(&pThis->u.s.hEvtDetached); if (RT_FAILURE(rc)) { - OSDBGPRINT(("vboxNetAdpOsCreate: failed to create semaphore (rc=%d).\n", rc)); + printf("vboxNetAdpOsCreate: failed to create semaphore (rc=%d).\n", rc); return rc; } @@ -400,7 +379,7 @@ static int VBoxNetAdpDarwinIOCtl(dev_t Dev, u_long iCmd, caddr_t pData, int fFla } default: - OSDBGPRINT(("VBoxNetAdpDarwinIOCtl: unknown command %lx.\n", IOCBASECMD(iCmd))); + printf("VBoxNetAdpDarwinIOCtl: unknown command %lx.\n", IOCBASECMD(iCmd)); return EINVAL; } diff --git a/src/VBox/HostDrivers/VBoxNetAdp/darwin/loadnetadp.sh b/src/VBox/HostDrivers/VBoxNetAdp/darwin/loadnetadp.sh index fdec7dce5..b6fe7cfe7 100755 --- a/src/VBox/HostDrivers/VBoxNetAdp/darwin/loadnetadp.sh +++ b/src/VBox/HostDrivers/VBoxNetAdp/darwin/loadnetadp.sh @@ -4,7 +4,7 @@ # # -# Copyright (C) 2006-2008 Sun Microsystems, Inc. +# Copyright (C) 2006-2008 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -14,10 +14,6 @@ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa -# Clara, CA 95054 USA or visit http://www.sun.com if you need -# additional information or have any questions. -# SCRIPT_NAME="loadnetadp" XNU_VERSION=`LC_ALL=C uname -r | LC_ALL=C cut -d . -f 1` diff --git a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile index f848a338e..ae66f4e1b 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile +++ b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/Makefile @@ -1,11 +1,11 @@ -# $Id: Makefile $ +# $Id: Makefile 28800 2010-04-27 08:22:32Z vboxsync $ ## @file # Makefile for the VirtualBox FreeBSD Host Driver. # # # -# Copyright (C) 2006-2007 Sun Microsystems, Inc. +# Copyright (C) 2006-2007 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -15,10 +15,6 @@ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa -# Clara, CA 95054 USA or visit http://www.sun.com if you need -# additional information or have any questions. -# KMOD = vboxnetadp diff --git a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c index 07536eca7..a58741da7 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c +++ b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c @@ -1,4 +1,4 @@ -/* $Id: VBoxNetAdp-freebsd.c $ */ +/* $Id: VBoxNetAdp-freebsd.c 23159 2009-09-19 20:00:54Z vboxsync $ */ /** @file * VBoxNetAdp - Virtual Network Adapter Driver (Host), FreeBSD Specific Code. */ diff --git a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/files_vboxnetadp b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/files_vboxnetadp index e08985432..aa8819b54 100755..100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/freebsd/files_vboxnetadp +++ b/src/VBox/HostDrivers/VBoxNetAdp/freebsd/files_vboxnetadp @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: files_vboxnetadp $ +# $Id: files_vboxnetadp 26881 2010-02-27 09:11:22Z vboxsync $ ## @file # Shared file between Makefile.kmk and export_modules # @@ -70,10 +70,8 @@ VBOX_VBOXNETADP_SOURCES=" \ ${PATH_ROOT}/src/VBox/HostDrivers/VBoxNetAdp/freebsd/VBoxNetAdp-freebsd.c=>VBoxNetAdp-freebsd.c \ ${PATH_ROOT}/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdp.c=>VBoxNetAdp.c \ ${PATH_ROOT}/src/VBox/HostDrivers/VBoxNetAdp/VBoxNetAdpInternal.h=>VBoxNetAdpInternal.h \ - ${PATH_ROOT}/src/VBox/Runtime/include/internal/initterm.h=>include/internal/initterm.h \ - ${PATH_ROOT}/src/VBox/Runtime/include/internal/iprt.h=>include/internal/iprt.h \ - ${PATH_ROOT}/src/VBox/Runtime/include/internal/magics.h=>include/internal/magics.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/freebsd/the-freebsd-kernel.h=>r0drv/freebsd/the-freebsd-kernel.h \ ${PATH_OUT}/version-generated.h=>version-generated.h \ + ${PATH_OUT}/product-generated.h=>product-generated.h \ " diff --git a/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile b/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile index 9ae7c0264..4259fb1c6 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile +++ b/src/VBox/HostDrivers/VBoxNetAdp/linux/Makefile @@ -5,7 +5,7 @@ # # -# Copyright (C) 2006-2007 Sun Microsystems, Inc. +# Copyright (C) 2006-2007 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -15,10 +15,6 @@ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa -# Clara, CA 95054 USA or visit http://www.sun.com if you need -# additional information or have any questions. -# # # First, figure out which architecture we're targeting and the build type. diff --git a/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c b/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c index c54210666..cf95576fb 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c +++ b/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c @@ -1,10 +1,10 @@ -/* $Id: VBoxNetAdp-linux.c $ */ +/* $Id: VBoxNetAdp-linux.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VBoxNetAdp - Virtual Network Adapter Driver (Host), Linux Specific Code. */ /* - * Copyright (C) 2009 Sun Microsystems, Inc. + * Copyright (C) 2009 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -13,10 +13,6 @@ * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - * Clara, CA 95054 USA or visit http://www.sun.com if you need - * additional information or have any questions. */ /******************************************************************************* @@ -24,6 +20,7 @@ *******************************************************************************/ #include "the-linux-kernel.h" #include "version-generated.h" +#include "product-generated.h" #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/miscdevice.h> @@ -53,9 +50,6 @@ #define VBOXNETADP_LINUX_NAME "vboxnet%d" #define VBOXNETADP_CTL_DEV_NAME "vboxnetctl" -/* debug printf */ -#define OSDBGPRINT(a) printk a - #define VBOXNETADP_FROM_IFACE(iface) ((PVBOXNETADP) ifnet_softc(iface)) /******************************************************************************* @@ -74,8 +68,8 @@ static int VBoxNetAdpLinuxIOCtl(struct inode *pInode, struct file *pFilp, unsign module_init(VBoxNetAdpLinuxInit); module_exit(VBoxNetAdpLinuxUnload); -MODULE_AUTHOR("Sun Microsystems, Inc."); -MODULE_DESCRIPTION("VirtualBox Network Adapter Driver"); +MODULE_AUTHOR(VBOX_VENDOR); +MODULE_DESCRIPTION(VBOX_PRODUCT " Network Adapter Driver"); MODULE_LICENSE("GPL"); #ifdef MODULE_VERSION MODULE_VERSION(VBOX_VERSION_STRING " (" RT_XSTR(INTNETTRUNKIFPORT_VERSION) ")"); @@ -114,7 +108,6 @@ typedef VBOXNETADPPRIV *PVBOXNETADPPRIV; static int vboxNetAdpLinuxOpen(struct net_device *pNetDev) { netif_start_queue(pNetDev); - printk("vboxNetAdpOpen returns 0\n"); return 0; } diff --git a/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp b/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp index 59987b4ab..47cd2a441 100755..100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp +++ b/src/VBox/HostDrivers/VBoxNetAdp/linux/files_vboxnetadp @@ -1,11 +1,11 @@ #!/bin/sh -# $Revision: 53782 $ +# $Revision: 28800 $ ## @files # Shared file between Makefile.kmk and export_modules # # -# Copyright (C) 2009 Sun Microsystems, Inc. +# Copyright (C) 2009 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -15,10 +15,6 @@ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa -# Clara, CA 95054 USA or visit http://www.sun.com if you need -# additional information or have any questions. -# VBOX_VBOXNETADP_SOURCES=" \ ${PATH_ROOT}/include/iprt/alloc.h=>include/iprt/alloc.h \ @@ -75,5 +71,6 @@ VBOX_VBOXNETADP_SOURCES=" \ ${PATH_ROOT}/src/VBox/Runtime/include/internal/iprt.h=>include/internal/iprt.h \ ${PATH_ROOT}/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h=>r0drv/linux/the-linux-kernel.h \ ${PATH_OUT}/version-generated.h=>version-generated.h \ + ${PATH_OUT}/product-generated.h=>product-generated.h \ " diff --git a/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c b/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c index 4c95af200..9cd616ed4 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c +++ b/src/VBox/HostDrivers/VBoxNetAdp/solaris/VBoxNetAdp-solaris.c @@ -1,10 +1,10 @@ -/* $Id: VBoxNetAdp-solaris.c $ */ +/* $Id: VBoxNetAdp-solaris.c 28800 2010-04-27 08:22:32Z vboxsync $ */ /** @file * VBoxNetAdapter - Network Adapter Driver (Host), Solaris Specific Code. */ /* - * Copyright (C) 2009 Sun Microsystems, Inc. + * Copyright (C) 2009 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -13,10 +13,6 @@ * Foundation, in version 2 as it comes in the "COPYING" file of the * VirtualBox OSE distribution. VirtualBox OSE is distributed in the * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa - * Clara, CA 95054 USA or visit http://www.sun.com if you need - * additional information or have any questions. */ /******************************************************************************* @@ -58,10 +54,12 @@ #define VBOXNETADP_MTU 1500 #if defined(DEBUG_ramshankar) +# undef LogFlowFunc +# define LogFlowFunc LogRel # undef Log -# define Log LogRel +# define Log LogRel # undef LogFlow -# define LogFlow LogRel +# define LogFlow LogRel #endif static int VBoxNetAdpSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd); @@ -176,8 +174,10 @@ static struct modldrv g_VBoxNetAdpSolarisDriver = static struct modlinkage g_VBoxNetAdpSolarisModLinkage = { MODREV_1, /* loadable module system revision */ - &g_VBoxNetAdpSolarisDriver, /* adapter streams driver framework */ - NULL /* terminate array of linkage structures */ + { + &g_VBoxNetAdpSolarisDriver, /* adapter streams driver framework */ + NULL /* terminate array of linkage structures */ + } }; @@ -214,7 +214,7 @@ static int vboxNetAdpSolarisSetMulticast(gld_mac_info_t *pMacInfo, unsigned char */ int _init(void) { - LogFlow((DEVICE_NAME ":_init\n")); + LogFlowFunc((DEVICE_NAME ":_init\n")); /* * Prevent module autounloading. @@ -247,8 +247,7 @@ int _init(void) int _fini(void) { - int rc; - LogFlow((DEVICE_NAME ":_fini\n")); + LogFlowFunc((DEVICE_NAME ":_fini\n")); /* * Undo the work done during start (in reverse order). @@ -261,7 +260,7 @@ int _fini(void) int _info(struct modinfo *pModInfo) { - LogFlow((DEVICE_NAME ":_info\n")); + LogFlowFunc((DEVICE_NAME ":_info\n")); int rc = mod_info(&g_VBoxNetAdpSolarisModLinkage, pModInfo); @@ -280,7 +279,7 @@ int _info(struct modinfo *pModInfo) */ static int VBoxNetAdpSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd) { - LogFlow((DEVICE_NAME ":VBoxNetAdpSolarisAttach pDip=%p enmCmd=%d\n", pDip, enmCmd)); + LogFlowFunc((DEVICE_NAME ":VBoxNetAdpSolarisAttach pDip=%p enmCmd=%d\n", pDip, enmCmd)); int rc = -1; switch (enmCmd) @@ -366,8 +365,11 @@ static int VBoxNetAdpSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd) /* Nothing to do here... */ return DDI_SUCCESS; } + + /* case DDI_PM_RESUME: */ + default: + return DDI_FAILURE; } - return DDI_FAILURE; } @@ -381,7 +383,7 @@ static int VBoxNetAdpSolarisAttach(dev_info_t *pDip, ddi_attach_cmd_t enmCmd) */ static int VBoxNetAdpSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd) { - LogFlow((DEVICE_NAME ":VBoxNetAdpSolarisDetach pDip=%p enmCmd=%d\n", pDip, enmCmd)); + LogFlowFunc((DEVICE_NAME ":VBoxNetAdpSolarisDetach pDip=%p enmCmd=%d\n", pDip, enmCmd)); switch (enmCmd) { @@ -420,8 +422,12 @@ static int VBoxNetAdpSolarisDetach(dev_info_t *pDip, ddi_detach_cmd_t enmCmd) /* Nothing to do here... */ return DDI_SUCCESS; } + + /* case DDI_SUSPEND: */ + /* case DDI_HOTPLUG_DETACH: */ + default: + return DDI_FAILURE; } - return DDI_FAILURE; } diff --git a/src/VBox/HostDrivers/VBoxNetAdp/solaris/vboxnet.conf b/src/VBox/HostDrivers/VBoxNetAdp/solaris/vboxnet.conf index df8b3a090..c09f4ca11 100644 --- a/src/VBox/HostDrivers/VBoxNetAdp/solaris/vboxnet.conf +++ b/src/VBox/HostDrivers/VBoxNetAdp/solaris/vboxnet.conf @@ -2,7 +2,7 @@ # Sun VirtualBox # Solaris Host VBoxNet Configuration # -# Copyright (C) 2009 Sun Microsystems, Inc. +# Copyright (C) 2009 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; @@ -12,10 +12,6 @@ # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa -# Clara, CA 95054 USA or visit http://www.sun.com if you need -# additional information or have any questions. -# # This needs to go into /platform/i86pc/kernel/drv, # while the 64-bit driver object goes into the amd64 |
