本文整理汇总了C++中RTMP_IRQ_LOCK函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMP_IRQ_LOCK函数的具体用法?C++ RTMP_IRQ_LOCK怎么用?C++ RTMP_IRQ_LOCK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMP_IRQ_LOCK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoBulkIn
VOID DoBulkIn(IN RTMP_ADAPTER *pAd)
{
PRX_CONTEXT pRxContext;
PURB pUrb;
int ret = 0;
unsigned long IrqFlags;
RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
pRxContext = &(pAd->RxContext[pAd->NextRxBulkInIndex]);
if ((pAd->PendingRx > 0) || (pRxContext->Readable == TRUE) || (pRxContext->InUse == TRUE))
{
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
return;
}
pRxContext->InUse = TRUE;
pRxContext->IRPPending = TRUE;
pAd->PendingRx++;
pAd->BulkInReq++;
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
// Init Rx context descriptor
NdisZeroMemory(pRxContext->TransferBuffer, pRxContext->BulkInOffset);
RTUSBInitRxDesc(pAd, pRxContext);
pUrb = pRxContext->pUrb;
if ((ret = RTUSB_SUBMIT_URB(pUrb))!=0)
{ // fail
RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
pRxContext->InUse = FALSE;
pRxContext->IRPPending = FALSE;
pAd->PendingRx--;
pAd->BulkInReq--;
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
DBGPRINT(RT_DEBUG_ERROR, ("RTUSBBulkReceive: Submit Rx URB failed %d\n", ret));
}
else
{ // success
ASSERT((pRxContext->InUse == pRxContext->IRPPending));
//printk("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex);
}
}
示例2: client
/*
========================================================================
Routine Description:
This routine is used to do insert packet into power-saveing queue.
Arguments:
pAd: Pointer to our adapter
pPacket: Pointer to send packet
pMacEntry: portint to entry of MacTab. the pMacEntry store attribute of client (STA).
QueIdx: Priority queue idex.
Return Value:
NDIS_STATUS_SUCCESS:If succes to queue the packet into TxSwQueue.
NDIS_STATUS_FAILURE: If failed to do en-queue.
========================================================================
*/
NDIS_STATUS RtmpInsertPsQueue(
IN PRTMP_ADAPTER pAd,
IN PNDIS_PACKET pPacket,
IN MAC_TABLE_ENTRY *pMacEntry,
IN UCHAR QueIdx)
{
ULONG IrqFlags;
#ifdef UAPSD_SUPPORT
/* put the U-APSD packet to its U-APSD queue by AC ID */
UINT32 ac_id = QueIdx - QID_AC_BE; /* should be >= 0 */
if (UAPSD_MR_IS_UAPSD_AC(pMacEntry, ac_id))
{
UAPSD_PacketEnqueue(pAd, pMacEntry, pPacket, ac_id);
}
else
#endif /* UAPSD_SUPPORT */
{
if (pMacEntry->PsQueue.Number >= MAX_PACKETS_IN_PS_QUEUE)
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return NDIS_STATUS_FAILURE;
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("legacy ps> queue a packet!\n"));
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
InsertTailQueue(&pMacEntry->PsQueue, PACKET_TO_QUEUE_ENTRY(pPacket));
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
}
}
#ifdef CONFIG_AP_SUPPORT
/* mark corresponding TIM bit in outgoing BEACON frame */
#ifdef UAPSD_SUPPORT
if (UAPSD_MR_IS_NOT_TIM_BIT_NEEDED_HANDLED(pMacEntry, QueIdx))
{
/* 1. the station is UAPSD station;
2. one of AC is non-UAPSD (legacy) AC;
3. the destinated AC of the packet is UAPSD AC. */
/* So we can not set TIM bit due to one of AC is legacy AC */
}
else
#endif /* UAPSD_SUPPORT */
{
WLAN_MR_TIM_BIT_SET(pAd, pMacEntry->apidx, pMacEntry->Aid);
}
#endif /* CONFIG_AP_SUPPORT */
return NDIS_STATUS_SUCCESS;
}
示例3: MtEnqTxSwqFromPsQueue
VOID MtEnqTxSwqFromPsQueue(RTMP_ADAPTER *pAd, UCHAR qidx, STA_TR_ENTRY *tr_entry)
{
ULONG IrqFlags = 0;
//struct tx_swq_fifo *fifo_swq;
QUEUE_ENTRY *pQEntry;
QUEUE_HEADER *pAcPsQue;
QUEUE_HEADER *pAcTxQue;
#ifdef UAPSD_SUPPORT
MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[tr_entry->wcid];
#endif /* UAPSD_SUPPORT */
//fifo_swq = &pAd->tx_swq[qidx];
pAcPsQue = &tr_entry->ps_queue;
pAcTxQue = &tr_entry->tx_queue[qidx];
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
#ifdef UAPSD_SUPPORT
if (UAPSD_MR_IS_UAPSD_AC(pEntry, qidx))
{
while(pAcPsQue->Head)
{
pQEntry = RemoveTailQueue(pAcPsQue);
UAPSD_PacketEnqueue(pAd, pEntry, PACKET_TO_QUEUE_ENTRY(pQEntry), qidx, TRUE);
}
}
else
#endif /* UAPSD_SUPPORT */
{
/*check and insert PS Token queue*/
if(pAcPsQue->Number > 0 && tr_entry->wcid > 0 && tr_entry->wcid < MAX_LEN_OF_TR_TABLE)
{
rtmp_ps_enq(pAd,tr_entry);
DBGPRINT(RT_DEBUG_TRACE | DBG_FUNC_PS, ("pAcPsQue->Number=%d,PS:%d\n",pAcPsQue->Number,tr_entry->PsTokenFlag));
}
while(pAcPsQue->Head)
{
pQEntry = RemoveTailQueue(pAcPsQue);
if(tr_entry->enqCount > SQ_ENQ_NORMAL_MAX) {
RELEASE_NDIS_PACKET(pAd, QUEUE_ENTRY_TO_PACKET(pQEntry), NDIS_STATUS_FAILURE);
continue;
}
InsertHeadQueue(pAcTxQue, pQEntry);
#ifdef LIMIT_GLOBAL_SW_QUEUE
TR_ENQ_COUNT_INC(tr_entry, &pAd->TxSwQueue[qidx]);
#else /* LIMIT_GLOBAL_SW_QUEUE */
TR_ENQ_COUNT_INC(tr_entry);
#endif /* ! LIMIT_GLOBAL_SW_QUEUE */
}
}
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
return;
}
示例4: DoBulkIn
void DoBulkIn(struct rt_rtmp_adapter *pAd)
{
struct rt_rx_context *pRxContext;
PURB pUrb;
int ret = 0;
unsigned long IrqFlags;
RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
pRxContext = &(pAd->RxContext[pAd->NextRxBulkInIndex]);
if ((pAd->PendingRx > 0) || (pRxContext->Readable == TRUE)
|| (pRxContext->InUse == TRUE)) {
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
return;
}
pRxContext->InUse = TRUE;
pRxContext->IRPPending = TRUE;
pAd->PendingRx++;
pAd->BulkInReq++;
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
/* Init Rx context descriptor */
NdisZeroMemory(pRxContext->TransferBuffer, pRxContext->BulkInOffset);
RTUSBInitRxDesc(pAd, pRxContext);
pUrb = pRxContext->pUrb;
ret = RTUSB_SUBMIT_URB(pUrb);
if (ret != 0) { /* fail */
RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
pRxContext->InUse = FALSE;
pRxContext->IRPPending = FALSE;
pAd->PendingRx--;
pAd->BulkInReq--;
RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
DBGPRINT(RT_DEBUG_ERROR,
("RTUSBBulkReceive: Submit Rx URB failed %d\n", ret));
} else { /* success */
ASSERT((pRxContext->InUse == pRxContext->IRPPending));
/*printk("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n", pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex); */
}
}
示例5: RTUSBBulkOutPsPoll
/*
========================================================================
Routine Description:
Arguments:
Return Value:
Note: PsPoll use BulkOutPipeId = 0
========================================================================
*/
void RTUSBBulkOutPsPoll(struct rt_rtmp_adapter *pAd)
{
struct rt_tx_context *pPsPollContext = &(pAd->PsPollContext);
PURB pUrb;
int ret = 0;
unsigned long IrqFlags;
RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags);
if ((pAd->BulkOutPending[0] == TRUE)
|| RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX)) {
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags);
return;
}
pAd->BulkOutPending[0] = TRUE;
pAd->watchDogTxPendingCnt[0] = 1;
pPsPollContext->IRPPending = TRUE;
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags);
/* Clear PS-Poll bulk flag */
RTUSB_CLEAR_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL);
/* Init Tx context descriptor */
RTUSBInitTxDesc(pAd, pPsPollContext, MGMTPIPEIDX,
(usb_complete_t) RTUSBBulkOutPsPollComplete);
pUrb = pPsPollContext->pUrb;
ret = RTUSB_SUBMIT_URB(pUrb);
if (ret != 0) {
RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], IrqFlags);
pAd->BulkOutPending[0] = FALSE;
pAd->watchDogTxPendingCnt[0] = 0;
pPsPollContext->IRPPending = FALSE;
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], IrqFlags);
DBGPRINT(RT_DEBUG_ERROR,
("RTUSBBulkOutPsPoll: Submit Tx URB failed %d\n",
ret));
return;
}
}
示例6: RTUSBFreeDescriptorRequest
/*
========================================================================
Routine Description:
This subroutine will scan through releative ring descriptor to find
out avaliable free ring descriptor and compare with request size.
Arguments:
pAd Pointer to our adapter
RingType Selected Ring
Return Value:
NDIS_STATUS_FAILURE Not enough free descriptor
NDIS_STATUS_SUCCESS Enough free descriptor
Note:
========================================================================
*/
NDIS_STATUS RTUSBFreeDescriptorRequest(
IN PRTMP_ADAPTER pAd,
IN UCHAR BulkOutPipeId,
IN UINT32 NumberRequired)
{
/* UCHAR FreeNumber = 0;*/
/* UINT Index;*/
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
unsigned long IrqFlags;
HT_TX_CONTEXT *pHTTXContext;
pHTTXContext = &pAd->TxContext[BulkOutPipeId];
RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
#ifdef USB_BULK_BUF_ALIGMENT
if( ((pHTTXContext->CurWriteIdx< pHTTXContext->NextBulkIdx ) && (pHTTXContext->NextBulkIdx - pHTTXContext->CurWriteIdx == 1))
|| ((pHTTXContext->CurWriteIdx ==(BUF_ALIGMENT_RINGSIZE -1) ) && (pHTTXContext->NextBulkIdx == 0 )))
{
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
}
else if (pHTTXContext->bCurWriting == TRUE)
{
DBGPRINT(RT_DEBUG_TRACE,("BUF_ALIGMENT RTUSBFreeD c3 --> QueIdx=%d, CWPos=%ld, NBOutPos=%ld!\n", BulkOutPipeId, pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition));
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
}
#else
if ((pHTTXContext->CurWritePosition < pHTTXContext->NextBulkOutPosition) && ((pHTTXContext->CurWritePosition + NumberRequired + LOCAL_TXBUF_SIZE) > pHTTXContext->NextBulkOutPosition))
{
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
}
else if ((pHTTXContext->CurWritePosition == 8) && (pHTTXContext->NextBulkOutPosition < (NumberRequired + LOCAL_TXBUF_SIZE)))
{
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
}
else if (pHTTXContext->bCurWriting == TRUE)
{
DBGPRINT(RT_DEBUG_TRACE,("RTUSBFreeD c3 --> QueIdx=%d, CWPos=%ld, NBOutPos=%ld!\n", BulkOutPipeId, pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition));
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
}
#endif /* USB_BULK_BUF_ALIGMENT */
else
{
Status = NDIS_STATUS_SUCCESS;
}
RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
return (Status);
}
示例7: rtusb_dataout_complete
static void rtusb_dataout_complete(unsigned long data)
{
PRTMP_ADAPTER pAd;
purbb_t pUrb;
POS_COOKIE pObj;
PHT_TX_CONTEXT pHTTXContext;
UCHAR BulkOutPipeId;
NTSTATUS Status;
unsigned long IrqFlags;
pUrb = (purbb_t)data;
/* pHTTXContext = (PHT_TX_CONTEXT)pUrb->context; */
pHTTXContext = (PHT_TX_CONTEXT)RTMP_USB_URB_DATA_GET(pUrb);
Status = RTMP_USB_URB_STATUS_GET(pUrb);
pAd = pHTTXContext->pAd;
pObj = (POS_COOKIE) pAd->OS_Cookie;
/* Status = pUrb->status; */
/* Store BulkOut PipeId */
BulkOutPipeId = pHTTXContext->BulkOutPipeId;
pAd->BulkOutDataOneSecCount++;
/*DBGPRINT(RT_DEBUG_LOUD, ("Done-B(%d):I=0x%lx, CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", BulkOutPipeId, in_interrupt(), pHTTXContext->CurWritePosition, */
/* pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad)); */
RTMP_IRQ_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pAd->BulkOutPending[BulkOutPipeId] = FALSE;
pHTTXContext->IRPPending = FALSE;
pAd->watchDogTxPendingCnt[BulkOutPipeId] = 0;
if (Status == USB_ST_NOERROR)
{
pAd->BulkOutComplete++;
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pAd->Counters8023.GoodTransmits++;
/*RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); */
FREE_HTTX_RING(pAd, BulkOutPipeId, pHTTXContext);
/*RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); */
#ifdef CONFIG_AP_SUPPORT
#ifdef UAPSD_AP_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
{
UAPSD_UnTagFrame(pAd, BulkOutPipeId, pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition);
}
#endif /* UAPSD_AP_SUPPORT */
#endif /* CONFIG_AP_SUPPORT */
}
示例8: rt2870_rts_frame_complete_tasklet
static void rt2870_rts_frame_complete_tasklet(unsigned long data)
{
PRTMP_ADAPTER pAd;
PTX_CONTEXT pRTSContext;
purbb_t pUrb;
NTSTATUS Status;
unsigned long irqFlag;
pUrb = (purbb_t)data;
pRTSContext = (PTX_CONTEXT)pUrb->context;
pAd = pRTSContext->pAd;
Status = pUrb->status;
// Reset RTS frame context flags
RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], irqFlag);
pRTSContext->IRPPending = FALSE;
pRTSContext->InUse = FALSE;
if (Status == USB_ST_NOERROR)
{
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
}
else // STATUS_OTHER
{
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);
pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
}
else
{
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
}
}
RTMP_SEM_LOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId]);
pAd->BulkOutPending[pRTSContext->BulkOutPipeId] = FALSE;
RTMP_SEM_UNLOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId]);
// Always call Bulk routine, even reset bulk.
// The protectioon of rest bulk should be in BulkOut routine
RTUSBKickBulkOut(pAd);
}
示例9: rtusb_null_frame_done_tasklet
static void rtusb_null_frame_done_tasklet(unsigned long data)
{
PRTMP_ADAPTER pAd;
PTX_CONTEXT pNullContext;
purbb_t pUrb;
NTSTATUS Status;
unsigned long irqFlag;
pUrb = (purbb_t)data;
/* pNullContext = (PTX_CONTEXT)pUrb->context; */
pNullContext = (PTX_CONTEXT)RTMP_USB_URB_DATA_GET(pUrb);
Status = RTMP_USB_URB_STATUS_GET(pUrb);
pAd = pNullContext->pAd;
/* Status = pUrb->status; */
/* Reset Null frame context flags */
RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], irqFlag);
pNullContext->IRPPending = FALSE;
pNullContext->InUse = FALSE;
pAd->BulkOutPending[0] = FALSE;
pAd->watchDogTxPendingCnt[0] = 0;
if (Status == USB_ST_NOERROR)
{
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
}
else /* STATUS_OTHER */
{
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 Null Frame Failed, ReasonCode=%d!\n", Status));
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
RTEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
}
else
{
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
}
}
/* Always call Bulk routine, even reset bulk. */
/* The protectioon of rest bulk should be in BulkOut routine */
RTUSBKickBulkOut(pAd);
}
示例10: RTUSBFreeDescriptorRelease
int RTUSBFreeDescriptorRelease(struct rt_rtmp_adapter *pAd,
u8 BulkOutPipeId)
{
unsigned long IrqFlags;
struct rt_ht_tx_context *pHTTXContext;
pHTTXContext = &pAd->TxContext[BulkOutPipeId];
RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
pHTTXContext->bCurWriting = FALSE;
RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
return (NDIS_STATUS_SUCCESS);
}
示例11: RTUSBFreeDescriptorRelease
NDIS_STATUS RTUSBFreeDescriptorRelease(RTMP_ADAPTER *pAd, UCHAR BulkOutPipeId)
{
HT_TX_CONTEXT *pHTTXContext;
unsigned long IrqFlags;
pHTTXContext = &pAd->TxContext[BulkOutPipeId];
RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
pHTTXContext->bCurWriting = FALSE;
RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
return NDIS_STATUS_SUCCESS;
}
示例12: RTUSBBulkCmdRspEventReceive
VOID RTUSBBulkCmdRspEventReceive(PRTMP_ADAPTER pAd)
{
unsigned long IrqFlags;
PCMD_RSP_CONTEXT pCmdRspEventContext = &pAd->CmdRspEventContext;
RTMP_IRQ_LOCK(&pAd->CmdRspLock, IrqFlags);
if ((pCmdRspEventContext->InUse) == FALSE && (pCmdRspEventContext->Readable == TRUE))
{
RTMP_IRQ_UNLOCK(&pAd->CmdRspLock, IrqFlags);
CmdRspEventHandle(pAd);
RTMP_IRQ_LOCK(&pAd->CmdRspLock, IrqFlags);
pCmdRspEventContext->Readable = FALSE;
RTMP_IRQ_UNLOCK(&pAd->CmdRspLock, IrqFlags);
}
else
{
RTMP_IRQ_UNLOCK(&pAd->CmdRspLock, IrqFlags);
}
BulkInCmdRspEvent(pAd);
}
示例13: rtusb_dataout_complete
static void rtusb_dataout_complete(unsigned long data)
{
PRTMP_ADAPTER pAd;
purbb_t pUrb;
POS_COOKIE pObj;
PHT_TX_CONTEXT pHTTXContext;
UCHAR BulkOutPipeId;
NTSTATUS Status;
unsigned long IrqFlags;
pUrb = (purbb_t)data;
pHTTXContext = (PHT_TX_CONTEXT)RTMP_USB_URB_DATA_GET(pUrb);
Status = RTMP_USB_URB_STATUS_GET(pUrb);
pAd = pHTTXContext->pAd;
pObj = (POS_COOKIE) pAd->OS_Cookie;
/* Store BulkOut PipeId */
BulkOutPipeId = pHTTXContext->BulkOutPipeId;
pAd->BulkOutDataOneSecCount++;
RTMP_IRQ_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pAd->BulkOutPending[BulkOutPipeId] = FALSE;
pHTTXContext->IRPPending = FALSE;
pAd->watchDogTxPendingCnt[BulkOutPipeId] = 0;
if (Status == USB_ST_NOERROR) {
pAd->BulkOutComplete++;
RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pAd->Counters8023.GoodTransmits++;
/*RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); */
FREE_HTTX_RING(pAd, BulkOutPipeId, pHTTXContext);
/*RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags); */
#ifdef UAPSD_SUPPORT
#ifdef CONFIG_AP_SUPPORT
#ifdef RT_CFG80211_P2P_SUPPORT
if (RTMP_CFG80211_VIF_P2P_GO_ON(pAd))
#else
IF_DEV_CONFIG_OPMODE_ON_AP(pAd)
#endif /* RT_CFG80211_P2P_SUPPORT */
{
UAPSD_UnTagFrame(pAd, BulkOutPipeId, pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition);
}
#endif /* CONFIG_AP_SUPPORT */
#endif /* UAPSD_SUPPORT */
} else {
示例14: RTUSBFreeDescriptorRequest
/*
========================================================================
Routine Description:
This subroutine will scan through releative ring descriptor to find
out avaliable free ring descriptor and compare with request size.
Arguments:
pAd Pointer to our adapter
RingType Selected Ring
Return Value:
NDIS_STATUS_FAILURE Not enough free descriptor
NDIS_STATUS_SUCCESS Enough free descriptor
Note:
========================================================================
*/
int RTUSBFreeDescriptorRequest(struct rt_rtmp_adapter *pAd,
u8 BulkOutPipeId,
u32 NumberRequired)
{
/* u8 FreeNumber = 0; */
/* u32 Index; */
int Status = NDIS_STATUS_FAILURE;
unsigned long IrqFlags;
struct rt_ht_tx_context *pHTTXContext;
pHTTXContext = &pAd->TxContext[BulkOutPipeId];
RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
if ((pHTTXContext->CurWritePosition < pHTTXContext->NextBulkOutPosition)
&&
((pHTTXContext->CurWritePosition + NumberRequired +
LOCAL_TXBUF_SIZE) > pHTTXContext->NextBulkOutPosition)) {
RTUSB_SET_BULK_FLAG(pAd,
(fRTUSB_BULK_OUT_DATA_NORMAL <<
BulkOutPipeId));
} else if ((pHTTXContext->CurWritePosition == 8)
&& (pHTTXContext->NextBulkOutPosition <
(NumberRequired + LOCAL_TXBUF_SIZE))) {
RTUSB_SET_BULK_FLAG(pAd,
(fRTUSB_BULK_OUT_DATA_NORMAL <<
BulkOutPipeId));
} else if (pHTTXContext->bCurWriting == TRUE) {
DBGPRINT(RT_DEBUG_TRACE,
("RTUSBFreeD c3 --> QueIdx=%d, CWPos=%ld, NBOutPos=%ld!\n",
BulkOutPipeId, pHTTXContext->CurWritePosition,
pHTTXContext->NextBulkOutPosition));
RTUSB_SET_BULK_FLAG(pAd,
(fRTUSB_BULK_OUT_DATA_NORMAL <<
BulkOutPipeId));
} else {
Status = NDIS_STATUS_SUCCESS;
}
RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
return (Status);
}
示例15: client
/*
========================================================================
Routine Description:
This routine is used to do insert packet into power-saveing queue.
Arguments:
pAd: Pointer to our adapter
pPacket: Pointer to send packet
pMacEntry: portint to entry of MacTab. the pMacEntry store attribute of client (STA).
QueIdx: Priority queue idex.
Return Value:
NDIS_STATUS_SUCCESS:If succes to queue the packet into TxSwQueue.
NDIS_STATUS_FAILURE: If failed to do en-queue.
========================================================================
*/
NDIS_STATUS RtmpInsertPsQueue(
IN PRTMP_ADAPTER pAd,
IN PNDIS_PACKET pPacket,
IN MAC_TABLE_ENTRY *pMacEntry,
IN UCHAR QueIdx)
{
ULONG IrqFlags;
#ifdef UAPSD_SUPPORT
/* put the U-APSD packet to its U-APSD queue by AC ID */
UINT32 ac_id = QueIdx - QID_AC_BE; /* should be >= 0 */
if (UAPSD_MR_IS_UAPSD_AC(pMacEntry, ac_id))
{
UAPSD_PacketEnqueue(pAd, pMacEntry, pPacket, ac_id);
#ifdef DOT11Z_TDLS_SUPPORT
TDLS_UAPSDP_TrafficIndSend(pAd, pMacEntry->Addr);
#endif /* DOT11Z_TDLS_SUPPORT */
}
else
#endif /* UAPSD_SUPPORT */
{
if (pMacEntry->PsQueue.Number >= MAX_PACKETS_IN_PS_QUEUE)
{
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
return NDIS_STATUS_FAILURE;
}
else
{
DBGPRINT(RT_DEBUG_TRACE, ("legacy ps> queue a packet!\n"));
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
InsertTailQueue(&pMacEntry->PsQueue, PACKET_TO_QUEUE_ENTRY(pPacket));
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
}
}
return NDIS_STATUS_SUCCESS;
}