Changeset 33141 in vbox for trunk/src/VBox
- Timestamp:
- Oct 14, 2010 4:35:21 PM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetFlt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFltInternal.h
r30119 r33141 208 208 RTMAC MacAddr; 209 209 /** Mutex protection used for loopback. */ 210 RTSEMFASTMUTEX hFastMtx;210 kmutex_t hMtx; 211 211 /** Mutex protection used for dynamic IPv6 attaches. */ 212 212 RTSEMFASTMUTEX hPollMtx; -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r32773 r33141 909 909 vboxnetflt_promisc_stream_t *pPromiscStream = (vboxnetflt_promisc_stream_t *)pStream; 910 910 911 int rc = RTSemFastMutexRequest(pStream->pThis->u.s.hFastMtx); 912 AssertRCReturn(rc, rc); 911 mutex_enter(&pStream->pThis->u.s.hMtx); 913 912 914 913 /* … … 938 937 #endif 939 938 940 RTSemFastMutexRelease(pStream->pThis->u.s.hFastMtx);939 mutex_exit(&pStream->pThis->u.s.hMtx); 941 940 } 942 941 … … 3064 3063 return VERR_NET_MSG_SIZE; 3065 3064 3066 int rc = RTSemFastMutexRequest(pThis->u.s.hFastMtx);3067 AssertRCReturn(rc, rc);3065 int rc = VINF_SUCCESS; 3066 mutex_enter(&pThis->u.s.hMtx); 3068 3067 3069 3068 PVBOXNETFLTPACKETID pCur = NULL; … … 3156 3155 } 3157 3156 3158 RTSemFastMutexRelease(pThis->u.s.hFastMtx);3157 mutex_exit(&pThis->u.s.hMtx); 3159 3158 3160 3159 return rc; … … 3189 3188 return false; 3190 3189 3191 int rc = RTSemFastMutexRequest(pThis->u.s.hFastMtx); 3192 AssertRCReturn(rc, rc); 3190 mutex_enter(&pThis->u.s.hMtx); 3193 3191 3194 3192 PVBOXNETFLTPACKETID pPrev = NULL; … … 3247 3245 3248 3246 LogFlow((DEVICE_NAME ":vboxNetFltSolarisIsOurMBlk returns %d.\n", fIsOurPacket)); 3249 RTSemFastMutexRelease(pThis->u.s.hFastMtx);3247 mutex_exit(&pThis->u.s.hMtx); 3250 3248 return fIsOurPacket; 3251 3249 } … … 3697 3695 vboxNetFltSolarisDetachFromInterface(pThis); 3698 3696 3699 if (pThis->u.s.hFastMtx != NIL_RTSEMFASTMUTEX) 3700 { 3701 RTSemFastMutexDestroy(pThis->u.s.hFastMtx); 3702 pThis->u.s.hFastMtx = NIL_RTSEMFASTMUTEX; 3703 } 3697 return VINF_SUCCESS; 3698 } 3699 3700 3701 int vboxNetFltOsConnectIt(PVBOXNETFLTINS pThis) 3702 { 3703 /* Nothing to do here. */ 3704 return VINF_SUCCESS; 3705 } 3706 3707 3708 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis) 3709 { 3710 LogFlowFunc((DEVICE_NAME ":vboxNetFltOsDeleteInstance pThis=%p\n", pThis)); 3711 3712 mutex_destroy(&pThis->u.s.hMtx); 3704 3713 3705 3714 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING … … 3711 3720 #endif 3712 3721 3713 return VINF_SUCCESS;3714 }3715 3716 3717 int vboxNetFltOsConnectIt(PVBOXNETFLTINS pThis)3718 {3719 /* Nothing to do here. */3720 return VINF_SUCCESS;3721 }3722 3723 3724 void vboxNetFltOsDeleteInstance(PVBOXNETFLTINS pThis)3725 {3726 LogFlowFunc((DEVICE_NAME ":vboxNetFltOsDeleteInstance pThis=%p\n", pThis));3727 /* Nothing to do here. */3728 3722 } 3729 3723 … … 3736 3730 * Mutex used for loopback lockouts. 3737 3731 */ 3738 int rc = RTSemFastMutexCreate(&pThis->u.s.hFastMtx); 3732 int rc = VINF_SUCCESS; 3733 mutex_init(&pThis->u.s.hMtx, NULL /* name */, MUTEX_DRIVER, NULL /* cookie */); 3734 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING 3735 rc = RTSemFastMutexCreate(&pThis->u.s.hPollMtx); 3739 3736 if (RT_SUCCESS(rc)) 3740 3737 { 3738 #endif 3739 rc = vboxNetFltSolarisAttachToInterface(pThis); 3740 if (RT_SUCCESS(rc)) 3741 return rc; 3742 3743 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachToInterface failed. rc=%Rrc\n", rc)); 3744 3741 3745 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING 3742 rc = RTSemFastMutexCreate(&pThis->u.s.hPollMtx); 3743 if (RT_SUCCESS(rc)) 3744 { 3746 RTSemFastMutexDestroy(pThis->u.s.hPollMtx); 3747 pThis->u.s.hPollMtx = NIL_RTSEMFASTMUTEX; 3748 } 3749 else 3750 LogRel((DEVICE_NAME ":vboxNetFltOsInitInstance failed to create poll mutex. rc=%Rrc\n", rc)); 3745 3751 #endif 3746 rc = vboxNetFltSolarisAttachToInterface(pThis); 3747 if (RT_SUCCESS(rc)) 3748 return rc; 3749 3750 LogRel((DEVICE_NAME ":vboxNetFltSolarisAttachToInterface failed. rc=%Rrc\n", rc)); 3751 3752 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING 3753 RTSemFastMutexDestroy(pThis->u.s.hPollMtx); 3754 pThis->u.s.hPollMtx = NIL_RTSEMFASTMUTEX; 3755 } 3756 else 3757 LogRel((DEVICE_NAME ":vboxNetFltOsInitInstance failed to create poll mutex. rc=%Rrc\n", rc)); 3758 #endif 3759 3760 RTSemFastMutexDestroy(pThis->u.s.hFastMtx); 3761 pThis->u.s.hFastMtx = NIL_RTSEMFASTMUTEX; 3762 } 3763 else 3764 LogRel((DEVICE_NAME ":vboxNetFltOsInitInstance failed to create mutex. rc=%Rrc\n", rc)); 3752 3753 mutex_destroy(&pThis->u.s.hMtx); 3765 3754 3766 3755 NOREF(pvContext); … … 3781 3770 pThis->u.s.fAttaching = false; 3782 3771 pThis->u.s.fVLAN = false; 3783 pThis->u.s.hFastMtx = NIL_RTSEMFASTMUTEX;3784 3772 #ifdef VBOXNETFLT_SOLARIS_IPV6_POLLING 3785 3773 pThis->u.s.hPollMtx = NIL_RTSEMFASTMUTEX;
Note:
See TracChangeset
for help on using the changeset viewer.