Changeset 52394 in vbox
- Timestamp:
- Aug 15, 2014 10:25:31 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/intnet.h
r52393 r52394 387 387 388 388 389 /** Pointer to the interface side of a trunk port. */ 390 typedef struct INTNETTRUNKIFPORT *PINTNETTRUNKIFPORT; 391 392 393 /** 394 * Special variation of INTNETTRUNKIFPORT::pfnRelease for use with 395 * INTNETTRUNKSWPORT::pfnDisconnect. 396 * 397 * @param pIfPort Pointer to the INTNETTRUNKIFPORT instance. 398 */ 399 typedef DECLCALLBACK(void) FNINTNETTRUNKIFPORTRELEASEBUSY(PINTNETTRUNKIFPORT pIfPort); 400 /** Pointer to a FNINTNETTRUNKIFPORTRELEASEBUSY function. */ 401 typedef FNINTNETTRUNKIFPORTRELEASEBUSY *PFNINTNETTRUNKIFPORTRELEASEBUSY; 402 403 389 404 /** Pointer to the switch side of a trunk port. */ 390 405 typedef struct INTNETTRUNKSWPORT *PINTNETTRUNKSWPORT; … … 566 581 * 567 582 * The caller shall must be busy when calling this method to prevent racing the 568 * network destruction code. This method will consume this busy reference569 * (released via INTNETTRUNKIFPORT::pfnRelease).583 * network destruction code. This method will always consume this busy reference 584 * (released via @a pfnReleaseBusy using @a pIfPort). 570 585 * 571 586 * The caller shall guarantee that there are absolutely no chance of concurrent … … 573 588 * 574 589 * @param pSwitchPort Pointer to this structure. 575 */ 576 DECLR0CALLBACKMEMBER(void, pfnDisconnect,(PINTNETTRUNKSWPORT pSwitchPort)); 590 * @param pIfPort The interface port structure corresponding to @a 591 * pSwitchPort and which should be used when 592 * calling @a pfnReleaseBusy. This is required as 593 * the method may no longer have access to a valid 594 * @a pIfPort pointer. 595 * @param pfnReleaseBusy Callback for releasing the callers busy 596 * reference to it's side of things. 597 */ 598 DECLR0CALLBACKMEMBER(void, pfnDisconnect,(PINTNETTRUNKSWPORT pSwitchPort, PINTNETTRUNKIFPORT pIfPort, 599 PFNINTNETTRUNKIFPORTRELEASEBUSY pfnReleaseBusy)); 577 600 #endif /* VBOX_WITH_INTNET_DISCONNECT */ 578 601 … … 583 606 /** Version number for the INTNETTRUNKIFPORT::u32Version and INTNETTRUNKIFPORT::u32VersionEnd fields. */ 584 607 #ifdef VBOX_WITH_INTNET_DISCONNECT 585 # define INTNETTRUNKSWPORT_VERSION UINT32_C(0xA2CDf002)586 #else /* !VBOX_WITH_INTNET_DISCONNECT */587 # define INTNETTRUNKSWPORT_VERSION UINT32_C(0xA2CDf001)588 #endif /* !VBOX_WITH_INTNET_DISCONNECT */608 # define INTNETTRUNKSWPORT_VERSION UINT32_C(0xA2CDf003) 609 #else 610 # define INTNETTRUNKSWPORT_VERSION UINT32_C(0xA2CDf001) 611 #endif 589 612 590 613 … … 610 633 } INTNETTRUNKIFSTATE; 611 634 612 /** Pointer to the interface side of a trunk port. */ 613 typedef struct INTNETTRUNKIFPORT *PINTNETTRUNKIFPORT; 635 614 636 /** 615 637 * This is the port on the trunk interface, i.e. the driver side which the … … 639 661 * This must be called for every pfnRetain call. 640 662 * 641 *642 663 * @param pIfPort Pointer to this structure. 643 664 * 644 665 * @remarks May own the big mutex, no spinlocks. 645 666 */ 646 #ifdef VBOX_WITH_INTNET_DISCONNECT647 DECLR0CALLBACKMEMBER(void, pfnRelease,(PINTNETTRUNKIFPORT pIfPort, bool fBusy));648 #else /* !VBOX_WITH_INTNET_DISCONNECT */649 667 DECLR0CALLBACKMEMBER(void, pfnRelease,(PINTNETTRUNKIFPORT pIfPort)); 650 #endif /* !VBOX_WITH_INTNET_DISCONNECT */651 668 652 669 /** … … 770 787 771 788 /** Version number for the INTNETTRUNKIFPORT::u32Version and INTNETTRUNKIFPORT::u32VersionEnd fields. */ 772 #ifdef VBOX_WITH_INTNET_DISCONNECT773 #define INTNETTRUNKIFPORT_VERSION UINT32_C(0xA2CDe002)774 #else /* !VBOX_WITH_INTNET_DISCONNECT */775 789 #define INTNETTRUNKIFPORT_VERSION UINT32_C(0xA2CDe001) 776 #endif /* !VBOX_WITH_INTNET_DISCONNECT */777 790 778 791 -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r52393 r52394 450 450 451 451 452 #ifdef VBOX_WITH_INTNET_DISCONNECT453 452 /******************************************************************************* 454 453 * Forward Declarations * … … 472 471 return false; 473 472 } 474 #endif /* VBOX_WITH_INTNET_DISCONNECT */475 473 476 474 … … 5012 5010 #ifdef VBOX_WITH_INTNET_DISCONNECT 5013 5011 /** @copydoc INTNETTRUNKSWPORT::pfnDisconnect */ 5014 static DECLCALLBACK(void) intnetR0TrunkIfPortDisconnect(PINTNETTRUNKSWPORT pSwitchPort) 5012 static DECLCALLBACK(void) intnetR0TrunkIfPortDisconnect(PINTNETTRUNKSWPORT pSwitchPort, PINTNETTRUNKIFPORT pIfPort, 5013 PFNINTNETTRUNKIFPORTRELEASEBUSY pfnReleaseBusy) 5015 5014 { 5016 5015 PINTNETTRUNKIF pThis = INTNET_SWITCHPORT_2_TRUNKIF(pSwitchPort); … … 5037 5036 * pointer after taking ownership of the big mutex. 5038 5037 */ 5039 p This->pIfPort->pfnRelease(pThis->pIfPort, true /*fBusy*/);5038 pfnReleaseBusy(pIfPort); 5040 5039 5041 5040 RTSemMutexRequest(pIntNet->hMtxCreateOpenDestroy, RT_INDEFINITE_WAIT); … … 5044 5043 { 5045 5044 Assert(pNetwork->MacTab.pTrunk == pThis); /* Must be valid as long as tehre are no concurrent calls to this method. */ 5045 Assert(pThis->pIfPort == pIfPort); /* Ditto */ 5046 5046 5047 5047 /* … … 5049 5049 * intnetR0NetworkDestruct. 5050 5050 */ 5051 p This->pIfPort->pfnSetState(pThis->pIfPort, INTNETTRUNKIFSTATE_DISCONNECTING);5051 pIfPort->pfnSetState(pIfPort, INTNETTRUNKIFSTATE_DISCONNECTING); 5052 5052 5053 5053 RTSpinlockAcquire(pNetwork->hAddrSpinlock); … … 5060 5060 RTSemMutexRelease(pIntNet->hMtxCreateOpenDestroy); 5061 5061 } 5062 /* 5063 * We must always release the busy reference. 5064 */ 5065 else 5066 pfnReleaseBusy(pIfPort); 5062 5067 } 5063 5068 #endif /* VBOX_WITH_INTNET_DISCONNECT */ -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r52134 r52394 749 749 750 750 /** 751 * @copydoc INTNETTRUNKIFPORT::pfnRetain 752 */ 753 #ifdef VBOX_WITH_INTNET_DISCONNECT 754 static DECLCALLBACK(void) vboxNetFltPortRelease(PINTNETTRUNKIFPORT pIfPort, bool fBusy) 755 { 756 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 757 vboxNetFltRelease(pThis, fBusy); 758 } 759 #else /* !VBOX_WITH_INTNET_DISCONNECT */ 751 * @copydoc INTNETTRUNKIFPORT::pfnRelease 752 */ 760 753 static DECLCALLBACK(void) vboxNetFltPortRelease(PINTNETTRUNKIFPORT pIfPort) 761 754 { … … 763 756 vboxNetFltRelease(pThis, false /* fBusy */); 764 757 } 765 #endif /* !VBOX_WITH_INTNET_DISCONNECT */ 758 759 760 /** 761 * @callback_method_impl{FNINTNETTRUNKIFPORTRELEASEBUSY} 762 */ 763 DECLHIDDEN(DECLCALLBACK(void)) vboxNetFltPortReleaseBusy(PINTNETTRUNKIFPORT pIfPort) 764 { 765 PVBOXNETFLTINS pThis = IFPORT_2_VBOXNETFLTINS(pIfPort); 766 vboxNetFltRelease(pThis, true /*fBusy*/); 767 } 766 768 767 769 -
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFltInternal.h
r46904 r52394 330 330 DECLHIDDEN(PVBOXNETFLTINS) vboxNetFltFindInstance(PVBOXNETFLTGLOBALS pGlobals, const char *pszName); 331 331 332 DECLHIDDEN(DECLCALLBACK(void)) vboxNetFltPortReleaseBusy(PINTNETTRUNKIFPORT pIfPort); 332 333 DECLHIDDEN(void) vboxNetFltRetain(PVBOXNETFLTINS pThis, bool fBusy); 333 334 DECLHIDDEN(bool) vboxNetFltTryRetainBusyActive(PVBOXNETFLTINS pThis);
Note:
See TracChangeset
for help on using the changeset viewer.