• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ NdisReleaseSpinLock函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中NdisReleaseSpinLock函数的典型用法代码示例。如果您正苦于以下问题:C++ NdisReleaseSpinLock函数的具体用法?C++ NdisReleaseSpinLock怎么用?C++ NdisReleaseSpinLock使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了NdisReleaseSpinLock函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ndisprotAuditFreeMem

VOID
ndisprotAuditFreeMem(
	PVOID	Pointer
)
{
	PNPROTD_ALLOCATION	pAllocInfo;

	NdisAcquireSpinLock(&(ndisprotdMemoryLock));

	pAllocInfo = CONTAINING_RECORD(Pointer, NPROTD_ALLOCATION, UserData);

	if (pAllocInfo->Signature != NPROTD_MEMORY_SIGNATURE)
	{
		DEBUGP(DL_ERROR,
		 ("ndisprotAuditFreeMem: unknown buffer 0x%p!\n", Pointer));
		NdisReleaseSpinLock(&(ndisprotdMemoryLock));
#if DBG
		DbgBreakPoint();
#endif
		return;
	}

	pAllocInfo->Signature = (ULONG)'DEAD';
	if (pAllocInfo->Prev != (PNPROTD_ALLOCATION)NULL)
	{
		pAllocInfo->Prev->Next = pAllocInfo->Next;
	}
	else
	{
		ndisprotdMemoryHead = pAllocInfo->Next;
	}
	if (pAllocInfo->Next != (PNPROTD_ALLOCATION)NULL)
	{
		pAllocInfo->Next->Prev = pAllocInfo->Prev;
	}
	else
	{
		ndisprotdMemoryTail = pAllocInfo->Prev;
	}
	ndisprotdAllocCount--;
	NdisReleaseSpinLock(&(ndisprotdMemoryLock));

	NdisFreeMemory(pAllocInfo, 0, 0);
}
开发者ID:TLmaK0,项目名称:weppinhole,代码行数:44,代码来源:debug.c


示例2: FilterCancelOidRequest

VOID
FilterCancelOidRequest(
    IN NDIS_HANDLE	FilterModuleContext,
    IN PVOID		RequestId
)
{
    PNETGW_ADAPT pAdapter = (PNETGW_ADAPT)FilterModuleContext;
    PNDIS_OID_REQUEST OriginalRequest = NULL;

    NdisAcquireSpinLock(&pAdapter->Lock);

    OriginalRequest = pAdapter->m_IntReq.pOrigReq;
    if ((OriginalRequest != NULL) && (OriginalRequest->RequestId == RequestId)) {
        NdisReleaseSpinLock(&pAdapter->Lock);
        NdisFCancelOidRequest(pAdapter->FilterHandle, RequestId);
    }
    else
        NdisReleaseSpinLock(&pAdapter->Lock);
}
开发者ID:mnestratov,项目名称:natflt,代码行数:19,代码来源:request.c


示例3: NPF_StopUsingOpenInstance

VOID
NPF_StopUsingOpenInstance(
				  IN POPEN_INSTANCE pOpen
				  )
{
	NdisAcquireSpinLock(&pOpen->OpenInUseLock);
	ASSERT(pOpen->NumPendingIrps > 0);
	pOpen->NumPendingIrps --;
	NdisReleaseSpinLock(&pOpen->OpenInUseLock);
}
开发者ID:52M,项目名称:npcap,代码行数:10,代码来源:Openclos.c


示例4: ba_mpdu_blk_free

static void ba_mpdu_blk_free(struct rt_rtmp_adapter *pAd,
			     struct reordering_mpdu *mpdu_blk)
{
	ASSERT(mpdu_blk);

	NdisAcquireSpinLock(&pAd->mpdu_blk_pool.lock);
/*      blk_count--; */
	ba_enqueue(&pAd->mpdu_blk_pool.freelist, mpdu_blk);
	NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
}
开发者ID:ANFS,项目名称:ANFS-kernel,代码行数:10,代码来源:ba_action.c


示例5: ReceiverWaitForPacketReturn

/* Wait for NDIS to return any outstanding packets.  The caller must
   already have taken some appropriate measures to make sure that no
   more packets arrive in the meantime. */
void
ReceiverWaitForPacketReturn(PRECEIVER Receiver)
{
    LARGE_INTEGER interval;

    interval.QuadPart = -100000; /* 100ms in units of 100ns */

    NdisAcquireSpinLock(&Receiver->Common.Lock);
    while (Receiver->nRxInNdis) {
        TraceVerbose (("%d rx.\n", Receiver->nRxInNdis));

        NdisReleaseSpinLock(&Receiver->Common.Lock);
        KeDelayExecutionThread(KernelMode, FALSE, &interval);
        NdisAcquireSpinLock(&Receiver->Common.Lock);

        ReceiverSwizzle(Receiver);
    }
    NdisReleaseSpinLock(&Receiver->Common.Lock);
}
开发者ID:OpenXT,项目名称:xc-windows,代码行数:22,代码来源:receiver.c


示例6: ssh_interceptor_iodevice_cancel_queued_ioctl

void 
ssh_interceptor_iodevice_cancel_queued_ioctl(PDEVICE_OBJECT device,
                                             PIRP irp)
{
  SshInterceptorIoDevice io_dev;
  SshIoctlCancelFunction cancel_fn = NULL_FNPTR;
  void *cancel_context;
  SshIoctlCancelID cancel_id;
  Boolean cancelled = FALSE;
  PLIST_ENTRY entry;

  /* Cancel processing is protected by queue-specific lock, not by the (one 
     and only) system-wide Cancel lock */
  IoReleaseCancelSpinLock(irp->CancelIrql);

  io_dev = SSH_NTDEV_TO_SSHDEV(device);

  NdisAcquireSpinLock(&io_dev->ioctl_req_list_lock);
  entry = io_dev->active_ioctl_req_list.Flink;
  while (entry != &io_dev->active_ioctl_req_list)
    {
      SshIoDeviceIoctlRequest ioctl;
      SshIoDeviceIoctlHandler handler;

      ioctl = CONTAINING_RECORD(entry, 
                                SshIoDeviceIoctlRequestStruct, 
                                private_data.link);

      if (ioctl->private_data.irp == irp)
        {
          handler = ioctl->public_data.context;

          cancel_fn = handler->cancel_fn;
          cancel_context = handler->context;
          cancel_id = ioctl->public_data.cancel_id;
          
          break;
        }

      entry = entry->Flink;
    }
  NdisReleaseSpinLock(&io_dev->ioctl_req_list_lock);

  if (cancel_fn != NULL_FNPTR)
    {
      cancelled = (*cancel_fn)(cancel_context, cancel_id);
    }

  if (cancelled == FALSE)
    {
      /* We have a bug somewhere if we end up here */
      SSH_NOTREACHED;   
    }
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:54,代码来源:iodevice.c


示例7: RTMPRepeaterRemoveInvaildMacEntry

BOOLEAN RTMPRepeaterRemoveInvaildMacEntry(
	IN PRTMP_ADAPTER pAd,
	IN UCHAR idx,
	IN PUCHAR pAddr)
{
	USHORT HashIdx;
	INVAILD_TRIGGER_MAC_ENTRY *pEntry = NULL;
	INVAILD_TRIGGER_MAC_ENTRY *pPrevEntry, *pProbeEntry;

	NdisAcquireSpinLock(&pAd->ApCfg.ReptCliEntryLock);

	HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
	pEntry = &pAd->ApCfg.ReptControl.RepeaterInvaildEntry[idx];

	if (pEntry && pEntry->bInsert)
	{
		pPrevEntry = NULL;
		pProbeEntry = pAd->ApCfg.ReptControl.ReptInvaildHash[HashIdx];
		ASSERT(pProbeEntry);
		if (pProbeEntry != NULL)
		{
			/* update Hash list*/
			do
			{
				if (pProbeEntry == pEntry)
				{
					if (pPrevEntry == NULL)
					{
						pAd->ApCfg.ReptControl.ReptInvaildHash[HashIdx] = pEntry->pNext;
					}
					else
					{
						pPrevEntry->pNext = pEntry->pNext;
					}
					break;
				}
		
				pPrevEntry = pProbeEntry;
				pProbeEntry = pProbeEntry->pNext;
			} while (pProbeEntry);
		}
		/* not found !!!*/
		ASSERT(pProbeEntry != NULL);

		pAd->ApCfg.ReptControl.ReptInVaildMacSize--;
	}

	NdisZeroMemory(pEntry->MacAddr, MAC_ADDR_LEN);
	pEntry->bInsert = FALSE;

	NdisReleaseSpinLock(&pAd->ApCfg.ReptCliEntryLock);

	return TRUE;
}
开发者ID:andy-padavan,项目名称:rt-n56u,代码行数:54,代码来源:ap_repeater.c


示例8: NPF_StartUsingBinding

BOOLEAN NPF_StartUsingBinding(
    IN POPEN_INSTANCE pOpen)
{
	ASSERT(pOpen != NULL);
	ASSERT(KeGetCurrentIrql() == PASSIVE_LEVEL);
	
	NdisAcquireSpinLock(&pOpen->AdapterHandleLock);

	if (pOpen->AdapterBindingStatus != ADAPTER_BOUND)
	{
		NdisReleaseSpinLock(&pOpen->AdapterHandleLock);
		return FALSE;
	}
	
	pOpen->AdapterHandleUsageCounter++;

	NdisReleaseSpinLock(&pOpen->AdapterHandleLock);
	
	return TRUE;
}
开发者ID:52M,项目名称:npcap,代码行数:20,代码来源:Openclos.c


示例9: circbuf_unlock

//------------------------------------------------------------------------------
void circbuf_unlock(tCircBufInstance* pInstance_p)
{
    tCircBufArchInstance*   pArchInstance;

    // Check parameter validity
    ASSERT(pInstance_p != NULL);

    pArchInstance = (tCircBufArchInstance*)pInstance_p->pCircBufArchInstance;

    NdisReleaseSpinLock(&pArchInstance->spinlock);
}
开发者ID:OpenAutomationTechnologies,项目名称:openPOWERLINK_V2,代码行数:12,代码来源:circbuf-winkernel.c


示例10: ssh_iodevice_buffer_alloc

__inline SshDeviceBuffer
ssh_iodevice_buffer_alloc(SshInterceptorIoDevice io_dev,
                          Boolean reliable)
{
  SshDeviceBuffer buf = NULL;
  PLIST_ENTRY entry;

  /* 1. Try to get a SshDeviceBuffer from a free list */
  entry = NdisInterlockedRemoveHeadList(&io_dev->free_list,
                                        &io_dev->free_list_lock);
  if (entry)
    buf = CONTAINING_RECORD(entry, SshDeviceBufferStruct, link);

  /* 2. If failed and this is a reliable message, try to replace
     an existing unreliable one */
  if ((buf == NULL) && (reliable))
    {
      NdisAcquireSpinLock(&io_dev->output_queue_lock);
      if (!IsListEmpty(&io_dev->unreliable_output_queue))
        {
          /* We found an existing unreliable message */
          entry = RemoveHeadList(&io_dev->unreliable_output_queue);

          /* We must remove the entry from output_queue too */
          buf = CONTAINING_RECORD(entry, SshDeviceBufferStruct,
                                  unreliable_list_link);

          SSH_ASSERT(buf != io_dev->current_read_buf);

          /* This removes the entry from output_queue */
          RemoveEntryList(&(buf->link));
        }
      NdisReleaseSpinLock(&io_dev->output_queue_lock);

      /* If found, we must delete the old message */
      if (buf != NULL)
        ssh_free(buf->addr);
    }

  /* 3. If still failed, try to allocate memory for a new
     SshDeviceBuffer */
  if ((buf == NULL) && (reliable))
    {
      buf = ssh_malloc(sizeof(*buf));
      if (buf)
        {
          /* This buffer will be deleted after use */
          buf->pre_allocated = 0;
        }
    }

  return buf;
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:53,代码来源:iodevice.c


示例11: ssh_interceptor_iodevice_cancel_queued_read

/*
  Cancel routine for queued read operations initiated by user-mode daemons.
*/
void 
ssh_interceptor_iodevice_cancel_queued_read(PDEVICE_OBJECT device,
                                            PIRP irp)
{
  SshInterceptorIoDevice io_dev;
  PLIST_ENTRY entry, next_entry;
  LIST_ENTRY  cancelled_irps;

  /* Cancel processing is protected by queue-specific lock, not by the (one 
     and only) system-wide Cancel lock */
  IoReleaseCancelSpinLock(irp->CancelIrql);

  io_dev = SSH_NTDEV_TO_SSHDEV(device);

  NdisInitializeListHead(&cancelled_irps);

  SSH_DEBUG(SSH_D_MIDSTART, 
            ("ssh_interceptor_iodevice_cancel_queued_read()"));

  /* Find and dequeue all canceled IRPs (not just the one given as argument).
     Complete the IRPs after releasing the spin lock. */
  NdisAcquireSpinLock(&io_dev->read_queue_lock);
  entry = io_dev->read_queue.Flink;
  while (entry && (entry != &io_dev->read_queue))
    {
      next_entry = entry->Flink;

      irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry);
      if (irp->Cancel)
        {
          RemoveEntryList(entry);
          InsertTailList(&cancelled_irps, entry);
        }

      entry = next_entry;
    }
  NdisReleaseSpinLock(&io_dev->read_queue_lock);

  while (!IsListEmpty(&cancelled_irps))
    {
      entry = RemoveHeadList(&cancelled_irps);

      irp = CONTAINING_RECORD(entry, IRP, Tail.Overlay.ListEntry);

      irp->IoStatus.Status = STATUS_CANCELLED;
      irp->IoStatus.Information = 0;
      IoCompleteRequest(irp, IO_NO_INCREMENT);

      SSH_DEBUG(SSH_D_NICETOKNOW,
                ("IoCompleteRequest(irp = 0x%p, status = STATUS_CANCELLED)",
                irp));
    };
}
开发者ID:patrick-ken,项目名称:kernel_808l,代码行数:56,代码来源:iodevice.c


示例12: mtl_set_idd_mtu

/* set idd mtu */
mtl_set_idd_mtu(VOID *mtl_1, USHORT mtu)
{
	MTL	*mtl = (MTL*)mtl_1;

    D_LOG(D_ENTRY, ("mtl_set_idd_mtu: entry, mtu: 0x%x\n", mtu));

    /* get lock, set, release & return */
    NdisAcquireSpinLock(&mtl->lock);
    mtl->idd_mtu = mtu;
    NdisReleaseSpinLock(&mtl->lock);
    return(MTL_E_SUCC);
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:13,代码来源:mtl_set.c


示例13: NeoUnlock

// Unlock
void NeoUnlock(NEO_LOCK *lock)
{
	NDIS_SPIN_LOCK *spin_lock;
	// Validate arguments
	if (lock == NULL)
	{
		return;
	}

	spin_lock = &lock->spin_lock;
	NdisReleaseSpinLock(spin_lock);
}
开发者ID:RexSi,项目名称:SoftEtherVPN,代码行数:13,代码来源:NDIS5.c


示例14: QueueDescriptorForRxIndication

VOID
QueueDescriptorForRxIndication(
	MTL	*mtl,
	MTL_AS	*as
	)
{
	NdisAcquireSpinLock(&mtl->RxIndicationFifo.lock);

	InsertTailList(&mtl->RxIndicationFifo.head, &as->link);

	NdisReleaseSpinLock(&mtl->RxIndicationFifo.lock);
}
开发者ID:BillTheBest,项目名称:WinNT4,代码行数:12,代码来源:mtl_rx.c


示例15: RTUSBBulkOutNullFrame

/*
	========================================================================
	
	Routine Description:

	Arguments:

	Return Value:

	Note: NULL frame use BulkOutPipeId = 0
	
	========================================================================
*/
VOID	RTUSBBulkOutNullFrame(
	IN	PRTMP_ADAPTER	pAd)
{
	PTX_CONTEXT	pNullContext = &(pAd->NullContext);
	PURB		pUrb;
	int 		ret = 0;
	unsigned long	IrqFlags;
	
	NdisAcquireSpinLock(&pAd->BulkOutLock[0], IrqFlags);
	if (pAd->BulkOutPending[0] == TRUE)
	{
		NdisReleaseSpinLock(&pAd->BulkOutLock[0], IrqFlags);
		return;
	}
	pAd->BulkOutPending[0] = TRUE;
	NdisReleaseSpinLock(&pAd->BulkOutLock[0], IrqFlags);

	// Increase Total transmit byte counter
	pAd->RalinkCounters.TransmittedByteCount +=  pNullContext->BulkOutSize;

	DBGPRINT_RAW(RT_DEBUG_INFO, "--->RTUSBBulkOutNullFrame \n");
	
	// Clear Null frame bulk flag
	RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NULL);


	// Init Tx context descriptor
	RTUSBInitTxDesc(pAd, pNullContext, 0, RTUSBBulkOutNullFrameComplete);
	pNullContext->IRPPending = TRUE;

	pUrb = pNullContext->pUrb;
	if((ret = rtusb_submit_urb(pUrb))!=0)
	{
		DBGPRINT(RT_DEBUG_ERROR,"Submit Tx URB failed %d\n", ret);
		return;
	}	
	
	DBGPRINT_RAW(RT_DEBUG_INFO, "<---RTUSBBulkOutNullFrame \n");
	return;
}
开发者ID:AxelLin,项目名称:Drv,代码行数:53,代码来源:rtusb_bulk.c


示例16: RtmpMgmtTaskExit

/*
========================================================================
Routine Description:
    Close kernel threads.

Arguments:
	*pAd				the raxx interface data pointer

Return Value:
    NONE

Note:
========================================================================
*/
VOID RtmpMgmtTaskExit(
	IN RTMP_ADAPTER *pAd)
{
	INT			ret;
	RTMP_OS_TASK	*pTask;
	
	/* Sleep 50 milliseconds so pending io might finish normally */
	RtmpusecDelay(50000);

	/* We want to wait until all pending receives and sends to the */
	/* device object. We cancel any */
	/* irps. Wait until sends and receives have stopped. */
	RTUSBCancelPendingIRPs(pAd);

	/* We need clear timerQ related structure before exits of the timer thread. */
	RtmpTimerQExit(pAd);

	/* Terminate cmdQ thread */
	pTask = &pAd->cmdQTask;
	RTMP_OS_TASK_LEGALITY(pTask)
	{
		NdisAcquireSpinLock(&pAd->CmdQLock);
		pAd->CmdQ.CmdQState = RTMP_TASK_STAT_STOPED;
		NdisReleaseSpinLock(&pAd->CmdQLock);

		/*RTUSBCMDUp(&pAd->cmdQTask); */
		ret = RtmpOSTaskKill(pTask);
		if (ret == NDIS_STATUS_FAILURE)
		{
/*			DBGPRINT(RT_DEBUG_ERROR, ("%s: kill task(%s) failed!\n", */
/*					RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev), pTask->taskName)); */
			DBGPRINT(RT_DEBUG_ERROR, ("kill command task failed!\n"));
		}
		pAd->CmdQ.CmdQState = RTMP_TASK_STAT_UNKNOWN;
	}

	/* Terminate timer thread */
	pTask = &pAd->timerTask;
	ret = RtmpOSTaskKill(pTask);
	if (ret == NDIS_STATUS_FAILURE)
	{
/*		DBGPRINT(RT_DEBUG_ERROR, ("%s: kill task(%s) failed!\n", */
/*					RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev), pTask->taskName)); */
		DBGPRINT(RT_DEBUG_ERROR, ("kill timer task failed!\n"));
	}

#ifdef WSC_INCLUDED
	WscThreadExit(pAd);
#endif /* WSC_INCLUDED */

}
开发者ID:vm3vuy,项目名称:my-local-repository,代码行数:65,代码来源:rt_usb.c


示例17: PacketRequest

/************************************************************
Function that allows to perform a query on a network driver
or to set the parameters of an adapter.
************************************************************/
DWORD
PacketRequest(	POPEN_INSTANCE		Open,
				DWORD  				FunctionCode,
				DWORD  				dwDDB,
				DWORD				hDevice,
				PDIOCPARAMETERS 	pDiocParms )
{
	PLIST_ENTRY       RequestListEntry;
	PINTERNAL_REQUEST	pRequest;
	PPACKET_RESERVED  pReserved;
	PPACKET_OID_DATA	OidData;
	NDIS_STATUS			Status;
	TRACE_ENTER( "Request Packet" );
	/*extract a request from the list*/
	NdisAcquireSpinLock( &Open->RequestSpinLock );
	RequestListEntry = PacketRemoveHeadList(&Open->RequestList);
	NdisReleaseSpinLock( &Open->RequestSpinLock );
	if ( RequestListEntry == NULL ) 
	{
		IF_TRACE( "Request List Error" );
		*(DWORD *)(pDiocParms->lpcbBytesReturned) = 0;
		TRACE_LEAVE( "Request Packet" );
		return NDIS_STATUS_FAILURE/*NDIS_STATUS_SUCCESS*/;
	}
	pReserved = CONTAINING_RECORD( RequestListEntry, PACKET_RESERVED, ListElement );
	pRequest  = CONTAINING_RECORD( pReserved, INTERNAL_REQUEST, Reserved );
	OidData   = (PPACKET_OID_DATA)(pDiocParms->lpvInBuffer);
	if ( ( pDiocParms->cbInBuffer == pDiocParms->cbOutBuffer )	&&
	( pDiocParms->cbInBuffer >= sizeof(PACKET_OID_DATA) - 1 + OidData->Length) ) 
	{
		pReserved->lpBuffer			= (PVOID)PacketPageLock( pDiocParms->lpvInBuffer, 
									 					 pDiocParms->cbInBuffer );
		pReserved->lpcbBytesReturned= (PVOID)PacketPageLock( (PVOID)pDiocParms->lpcbBytesReturned,
													 sizeof(DWORD) );
		pReserved->lpoOverlapped	= (PVOID)PacketPageLock( (PVOID)pDiocParms->lpoOverlapped,
													 sizeof(OVERLAPPED) );
		pReserved->cbBuffer			= pDiocParms->cbInBuffer;
		if ( FunctionCode == BIOCSETOID ) 
		{
			pRequest->Request.RequestType              						= NdisRequestSetInformation;
			pRequest->Request.DATA.SET_INFORMATION.Oid 						= OidData->Oid;
			pRequest->Request.DATA.SET_INFORMATION.InformationBufferLength	= OidData->Length;
			pRequest->Request.DATA.SET_INFORMATION.InformationBuffer 	  	= OidData->Data;
			IF_PACKETDEBUG( PACKET_DEBUG_VERY_LOUD )
			{
				IF_TRACE_MSG2( "Request Set: Oid=%08lx, Length=%08lx",
								OidData->Oid,
								OidData->Length );
			}
		} 
开发者ID:kubuqi,项目名称:802.1x-supplicant,代码行数:54,代码来源:Request.c


示例18: RTUSBBulkOutRTSFrameComplete

// RTS frame use BulkOutPipeId = PipeID
VOID RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs)
{
	PRTMP_ADAPTER	pAd;
	PTX_CONTEXT		pRTSContext;
	NTSTATUS		status;
	unsigned long	IrqFlags;
	
	pRTSContext= (PTX_CONTEXT)pUrb->context;
	pAd = pRTSContext->pAd;
	
	
	DBGPRINT_RAW(RT_DEBUG_INFO, "--->RTUSBBulkOutRTSFrameComplete\n");

	// Reset RTS frame context flags
	pRTSContext->IRPPending = FALSE;
	pRTSContext->InUse = FALSE;
		
	status = pUrb->status;
	
	if (status == USB_ST_NOERROR)
	{
		// Don't worry about the queue is empty or not, this function will check itself
		RTMPDeQueuePacket(pAd, pRTSContext->BulkOutPipeId);
	}
#if 1	// STATUS_OTHER
	else
	{
		if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
			(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
			(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
			(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
		{
			DBGPRINT_RAW(RT_DEBUG_ERROR, "Bulk Out RTS Frame Failed\n");
			RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
			RTUSBEnqueueInternalCmd(pAd, RT_OID_USB_RESET_BULK_OUT);
		}
	}
#endif

	NdisAcquireSpinLock(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId], IrqFlags);
	pAd->BulkOutPending[pRTSContext->BulkOutPipeId] = FALSE;
	NdisReleaseSpinLock(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId], IrqFlags);

	// Always call Bulk routine, even reset bulk.
	// The protectioon of rest bulk should be in BulkOut routine
	RTUSBKickBulkOut(pAd);

	DBGPRINT_RAW(RT_DEBUG_INFO, "<---RTUSBBulkOutRTSFrameComplete\n");
	
}
开发者ID:AxelLin,项目名称:Drv,代码行数:51,代码来源:rtusb_bulk.c


示例19: MiniportFreeAllPacketPools5

VOID
MiniportFreeAllPacketPools5(
    IN PADAPTER                    pAdapt
    )
{
	RECEIVED_PACKET			PacketArray[MAX_RECV_PACKET_POOL_SIZE];
    ULONG					NumberOfPackets = 0, i;

	//释放所有已经接收并存储的包
	NdisAcquireSpinLock(&pAdapt->Lock);
	if(pAdapt->ReceivedPacketCount > 0)
	{
		NumberOfPackets = pAdapt->ReceivedPacketCount;
		
		NdisMoveMemory(PacketArray,
						pAdapt->ReceivedPackets,
						NumberOfPackets * sizeof(RECEIVED_PACKET));
		pAdapt->ReceivedPacketCount = 0;
		for(i=0;i<NumberOfPackets;i++)
		{
			if(PacketArray[i].pNdisPacket && PacketArray[i].bReturnPacket)
			{
				MiniportReturnPacket5(pAdapt, PacketArray[i].pNdisPacket);
			}
		}
	}
	NdisReleaseSpinLock(&pAdapt->Lock);

    if (pAdapt->RecvPacketPoolHandle != NULL)
    {
        NdisFreePacketPool(pAdapt->RecvPacketPoolHandle);
        pAdapt->RecvPacketPoolHandle = NULL;
    }

    if (pAdapt->SendPacketPoolHandle != NULL)
    {
        NdisFreePacketPool(pAdapt->SendPacketPoolHandle);
        pAdapt->SendPacketPoolHandle = NULL;
    }
	if(pAdapt->RecvBufferPool != NULL)
	{
		NdisFreeBufferPool(pAdapt->RecvBufferPool);
		pAdapt->RecvBufferPool  = NULL;
	}
	if(pAdapt->SendBufferPool != NULL)
	{
		NdisFreeBufferPool(pAdapt->SendBufferPool);
		pAdapt->SendBufferPool  = NULL;
	}
}
开发者ID:aldertotori,项目名称:antiarp,代码行数:50,代码来源:miniport51.c


示例20: BndStrg_InsertEntry

INT BndStrg_InsertEntry(
	PBND_STRG_CLI_TABLE table,
	PUCHAR pAddr,
	PBND_STRG_CLI_ENTRY *entry_out)
{
	INT i;
	UCHAR HashIdx;
	PBND_STRG_CLI_ENTRY entry = NULL, this_entry = NULL;
	INT ret_val = BND_STRG_SUCCESS;

	if (table->Size >= BND_STRG_MAX_TABLE_SIZE) {
		DBGPRINT(RT_DEBUG_WARN, ("%s(): Table is full!\n", __FUNCTION__));
		return BND_STRG_TABLE_FULL;
	}

	NdisAcquireSpinLock(&table->Lock);
	for (i = 0; i< BND_STRG_MAX_TABLE_SIZE; i++)
	{
		entry = &table->Entry[i];

		/* pick up the first available vacancy*/
		if (entry->bValid == FALSE)	{
			NdisZeroMemory(entry, sizeof(BND_STRG_CLI_ENTRY));
			/* Fill Entry */
			RTMP_GetCurrentSystemTick(&entry->jiffies);
			COPY_MAC_ADDR(entry->Addr, pAddr);
			entry->bValid = TRUE;
			break;
		}
	}

	if (entry) {
		/* add this MAC entry into HASH table */
		HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
		if (table->Hash[HashIdx] == NULL) {
			table->Hash[HashIdx] = entry;
		} else {
			this_entry = table->Hash[HashIdx];
			while (this_entry->pNext != NULL) {
				this_entry = this_entry->pNext;
			}
			this_entry->pNext = entry;
		}
		
		*entry_out = entry;
		table->Size++;
	}
	NdisReleaseSpinLock(&table->Lock);
	return ret_val;
}
开发者ID:23171580,项目名称:ralink,代码行数:50,代码来源:ap_band_steering.c



注:本文中的NdisReleaseSpinLock函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ NdisZeroMemory函数代码示例发布时间:2022-05-30
下一篇:
C++ NdisMoveMemory函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap