本文整理汇总了C++中RTMP_TEST_FLAG函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMP_TEST_FLAG函数的具体用法?C++ RTMP_TEST_FLAG怎么用?C++ RTMP_TEST_FLAG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMP_TEST_FLAG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RT_CfgSetCountryRegion
/*
==========================================================================
Description:
Set Country Region to pAd->CommonCfg.CountryRegion.
This command will not work, if the field of CountryRegion in eeprom is programmed.
Return:
TRUE if all parameters are OK, FALSE otherwise
==========================================================================
*/
INT RT_CfgSetCountryRegion(
IN PRTMP_ADAPTER pAd,
IN PSTRING arg,
IN INT band)
{
LONG region;
UCHAR *pCountryRegion;
region = simple_strtol(arg, 0, 10);
if (band == BAND_24G)
pCountryRegion = &pAd->CommonCfg.CountryRegion;
else
pCountryRegion = &pAd->CommonCfg.CountryRegionForABand;
/*
1. If this value is set before interface up, do not reject this value.
2. Country can be set only when EEPROM not programmed
*/
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE) && (*pCountryRegion & EEPROM_IS_PROGRAMMED))
{
DBGPRINT(RT_DEBUG_ERROR, ("CfgSetCountryRegion():CountryRegion in eeprom was programmed\n"));
return FALSE;
}
if((region >= 0) &&
(((band == BAND_24G) &&((region <= REGION_MAXIMUM_BG_BAND) ||
(region == REGION_31_BG_BAND) || (region == REGION_32_BG_BAND) || (region == REGION_33_BG_BAND) )) ||
((band == BAND_5G) && (region <= REGION_MAXIMUM_A_BAND) ))
)
{
*pCountryRegion= (UCHAR) region;
}
else
{
DBGPRINT(RT_DEBUG_ERROR, ("CfgSetCountryRegion():region(%ld) out of range!\n", region));
return FALSE;
}
return TRUE;
}
示例2: MBSS_VirtualIF_Ioctl
/*
========================================================================
Routine Description:
IOCTL to WLAN.
Arguments:
pDev which WLAN network interface
pIoCtrl command information
Command command ID
Return Value:
0: IOCTL successfully
otherwise: IOCTL fail
Note:
SIOCETHTOOL 8946 New drivers use this ETHTOOL interface to
report link failure activity.
========================================================================
*/
INT MBSS_VirtualIF_Ioctl(
IN PNET_DEV pDev,
IN OUT struct ifreq *pIoCtrl,
IN INT Command)
{
RTMP_ADAPTER *pAd;
pAd = RTMP_OS_NETDEV_GET_PRIV(pDev);
ASSERT(pAd);
if (!pAd)
return -EINVAL;
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
return -ENETDOWN;
/* End of if */
/* do real IOCTL */
return rt28xx_ioctl(pDev, pIoCtrl, Command);
} /* End of MBSS_VirtualIF_Ioctl */
示例3: 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;
}
}
示例4: WaitForAsicReady
BOOLEAN WaitForAsicReady(RTMP_ADAPTER *pAd)
{
UINT32 mac_val = 0, reg = MAC_CSR0;
int idx = 0;
do {
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
return FALSE;
RTMP_IO_READ32(pAd, reg, &mac_val);
if ((mac_val != 0x00) && (mac_val != 0xFFFFFFFF))
return TRUE;
RtmpOsMsDelay(5);
} while (idx++ < 500);
DBGPRINT(RT_DEBUG_ERROR, ("%s(0x%x):AsicNotReady!\n",
__FUNCTION__, mac_val));
return FALSE;
}
示例5: AuthTimeout
void AuthTimeout(void *SystemSpecific1,
void *FunctionContext,
void *SystemSpecific2, void *SystemSpecific3)
{
struct rt_rtmp_adapter *pAd = (struct rt_rtmp_adapter *)FunctionContext;
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - AuthTimeout\n"));
/* Do nothing if the driver is starting halt state. */
/* This might happen when timer already been fired before cancel timer with mlmehalt */
if (RTMP_TEST_FLAG
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
return;
/* send a de-auth to reset AP's state machine (Patch AP-Dir635) */
if (pAd->Mlme.AuthMachine.CurrState == AUTH_WAIT_SEQ2)
Cls2errAction(pAd, pAd->MlmeAux.Bssid);
MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_AUTH_TIMEOUT, 0, NULL);
RTMP_MLME_HANDLER(pAd);
}
示例6: RTMPSetSignalLED
/*
========================================================================
Routine Description:
Set LED Signal Stregth
Arguments:
pAd Pointer to our adapter
Dbm Signal Stregth
Return Value:
None
IRQL = PASSIVE_LEVEL
Note:
Can be run on any IRQL level.
According to Microsoft Zero Config Wireless Signal Stregth definition as belows.
<= -90 No Signal
<= -81 Very Low
<= -71 Low
<= -67 Good
<= -57 Very Good
> -57 Excellent
========================================================================
*/
VOID RTMPSetSignalLED(
IN PRTMP_ADAPTER pAd,
IN NDIS_802_11_RSSI Dbm)
{
UCHAR nLed = 0;
#ifdef RTMP_MAC_USB
#ifdef STATS_COUNT_SUPPORT
if(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
return;
#endif /* STATS_COUNT_SUPPORT */
#endif /* RTMP_MAC_USB */
if (pAd->LedCntl.MCULedCntl.field.LedMode == LED_MODE_SIGNAL_STREGTH)
{
if (Dbm <= -90)
nLed = 0;
else if (Dbm <= -81)
nLed = 1;
else if (Dbm <= -71)
nLed = 3;
else if (Dbm <= -67)
nLed = 7;
else if (Dbm <= -57)
nLed = 15;
else
nLed = 31;
/* */
/* Update Signal Stregth to firmware if changed. */
/* */
if (pAd->LedCntl.LedIndicatorStrength != nLed)
{
AsicSendCommandToMcu(pAd, MCU_SET_LED_GPIO_SIGNAL_CFG, 0xff, nLed, pAd->LedCntl.MCULedCntl.field.Polarity, FALSE);
pAd->LedCntl.LedIndicatorStrength = nLed;
}
}
}
示例7: FT_OTA_AuthTimeout
/*
==========================================================================
Description:
function to be executed at timer thread when auth timer expires
IRQL = DISPATCH_LEVEL
==========================================================================
*/
VOID FT_OTA_AuthTimeout(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
USHORT Status;
MTWF_LOG(DBG_CAT_ALL, DBG_SUBCAT_ALL, DBG_LVL_TRACE,("FT_OTA_AUTH - FT_OTA_AuthTimeout\n"));
/* Do nothing if the driver is starting halt state. */
/* This might happen when timer already been fired before cancel timer with mlmehalt */
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
return;
pAd->StaCfg.Dot11RCommInfo.FtRspSuccess = FT_OTA_RESPONSE;
pAd->Mlme.FtOtaAuthMachine.CurrState = FT_OTA_AUTH_REQ_IDLE;
Status = MLME_REJ_TIMEOUT;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status, 0);
RTMP_MLME_HANDLER(pAd);
}
示例8: ac0_dma_done_tasklet
static void ac0_dma_done_tasklet(unsigned long data)
{
unsigned long flags;
struct rt_rtmp_adapter *pAd = (struct rt_rtmp_adapter *)data;
INT_SOURCE_CSR_STRUC IntSource;
struct os_cookie *pObj;
BOOLEAN bReschedule = 0;
/* Do nothing if the driver is starting halt state. */
/* This might happen when timer already been fired before cancel timer with mlmehalt */
if (RTMP_TEST_FLAG
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
return;
pObj = (struct os_cookie *)pAd->OS_Cookie;
/* printk("ac0_dma_done_process\n"); */
IntSource.word = 0;
IntSource.field.Ac0DmaDone = 1;
pAd->int_pending &= ~INT_AC0_DLY;
/* RTMPHandleMgmtRingDmaDoneInterrupt(pAd); */
bReschedule = RTMPHandleTxRingDmaDoneInterrupt(pAd, IntSource);
RTMP_INT_LOCK(&pAd->irq_lock, flags);
/*
* double check to avoid lose of interrupts
*/
if ((pAd->int_pending & INT_AC0_DLY) || bReschedule) {
tasklet_hi_schedule(&pObj->ac0_dma_done_task);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return;
}
/* enable TxDataInt again */
rt2860_int_enable(pAd, INT_AC0_DLY);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
}
示例9: mgmt_dma_done_tasklet
/***************************************************************************
*
* tasklet related procedures.
*
**************************************************************************/
static void mgmt_dma_done_tasklet(unsigned long data)
{
unsigned long flags;
struct rt_rtmp_adapter *pAd = (struct rt_rtmp_adapter *)data;
INT_SOURCE_CSR_STRUC IntSource;
struct os_cookie *pObj;
/* Do nothing if the driver is starting halt state. */
/* This might happen when timer already been fired before cancel timer with mlmehalt */
if (RTMP_TEST_FLAG
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
return;
pObj = (struct os_cookie *)pAd->OS_Cookie;
/* printk("mgmt_dma_done_process\n"); */
IntSource.word = 0;
IntSource.field.MgmtDmaDone = 1;
pAd->int_pending &= ~INT_MGMT_DLY;
RTMPHandleMgmtRingDmaDoneInterrupt(pAd);
/* if you use RTMP_SEM_LOCK, sometimes kernel will hang up, without any */
/* bug report output */
RTMP_INT_LOCK(&pAd->irq_lock, flags);
/*
* double check to avoid lose of interrupts
*/
if (pAd->int_pending & INT_MGMT_DLY) {
tasklet_hi_schedule(&pObj->mgmt_dma_done_task);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return;
}
/* enable TxDataInt again */
rt2860_int_enable(pAd, INT_MGMT_DLY);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
}
示例10: RTUSBBulkRxHandle
VOID RTUSBBulkRxHandle(
IN unsigned long data)
{
purbb_t pUrb = (purbb_t)data;
PRTMP_ADAPTER pAd;
PRX_CONTEXT pRxContext;
pRxContext = (PRX_CONTEXT)pUrb->context;
pAd = pRxContext->pAd;
/* device had been closed */
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS))
return;
if(pUrb->status != 0)
{
RTUSBBulkReceive(pAd);
return;
}
RTUSBRxPacket(data);
return;
}
示例11: CFG80211DRV_DisableApInterface
static VOID CFG80211DRV_DisableApInterface(
VOID *pAdOrg)
{
UINT32 Value;
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdOrg;
pAd->ApCfg.MBSSID[MAIN_MBSSID].bBcnSntReq = FALSE;
/* Disable pre-tbtt interrupt */
RTMP_IO_READ32(pAd, INT_TIMER_EN, &Value);
Value &=0xe;
RTMP_IO_WRITE32(pAd, INT_TIMER_EN, Value);
if (!INFRA_ON(pAd))
{
/* Disable piggyback */
RTMPSetPiggyBack(pAd, FALSE);
AsicUpdateProtect(pAd, 0, (ALLN_SETPROTECT|CCKSETPROTECT|OFDMSETPROTECT), TRUE, FALSE);
}
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
{
/*RTMP_ASIC_INTERRUPT_DISABLE(pAd); */
AsicDisableSync(pAd);
#ifdef LED_CONTROL_SUPPORT
/* Set LED */
RTMPSetLED(pAd, LED_LINK_DOWN);
#endif /* LED_CONTROL_SUPPORT */
}
#ifdef RTMP_MAC_USB
/* For RT2870, we need to clear the beacon sync buffer. */
RTUSBBssBeaconExit(pAd);
#endif /* RTMP_MAC_USB */
}
示例12: rtmp_ac0_dma_done_tasklet
static void rtmp_ac0_dma_done_tasklet(unsigned long data)
{
UINT32 irqsave;
UINT32 irqMask;
PRTMP_ADAPTER pAdapter = (PRTMP_ADAPTER) data;
INT_SOURCE_CSR_STRUC IntSource;
/* device had been closed */
if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_REMOVE_IN_PROGRESS)) {
return;
}
IntSource.word = 0;
IntSource.field.Ac0DmaDone = 1;
RTMPHandleTxRingDmaDoneInterrupt(pAdapter, IntSource);
RTMP_IRQ_LOCK(irqsave);
/*
* double check to avoid rotting packet
*/
if (pAdapter->Rtmp_Masked_Int & RTMP_MASK_INT_AC0_DMA_DONE) {
pAdapter->Rtmp_Masked_Int &= ~RTMP_MASK_INT_AC0_DMA_DONE;
tasklet_hi_schedule(&pAdapter->ac0_dma_done_task);
} else {
/* enable ac0 interrupt */
RTMP_IO_READ32(pAdapter, INT_MASK_CSR, &irqMask);
RTMP_IO_WRITE32(pAdapter, INT_MASK_CSR, irqMask & ~RTMP_MASK_INT_AC0_DMA_DONE);
pAdapter->ac0_dma_done_running = FALSE;
}
RTMP_IRQ_UNLOCK(irqsave);
}
示例13: 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);
}
if ( !RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF) )
BulkInCmdRspEvent(pAd);
}
开发者ID:3a1fa340-312c-11e6-8775-0016d322cfd3,项目名称:4b204d7c-312f-11e6-bd79-0016d322cfd3,代码行数:24,代码来源:rtusb_bulk.c
示例14: RTUSBBulkOutDataPacket
VOID RTUSBBulkOutDataPacket(
IN PRTMP_ADAPTER pAd,
IN UCHAR BulkOutPipeId,
IN UCHAR Index)
{
PHT_TX_CONTEXT pHTTXContext;
PURB pUrb;
int ret = 0;
PTXINFO_STRUC pTxInfo, pLastTxInfo = NULL;
PTXWI_STRUC pTxWI;
ULONG TmpBulkEndPos, ThisBulkSize;
unsigned long IrqFlags = 0, IrqFlags2 = 0;
PUCHAR pWirelessPkt, pAppendant;
#ifdef USB_BULK_BUF_ALIGMENT
BOOLEAN bLasAlignmentsectiontRound = FALSE;
#else
BOOLEAN bTxQLastRound = FALSE;
UCHAR allzero[4]= {0x0,0x0,0x0,0x0};
#endif /* USB_BULK_BUF_ALIGMENT */
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE) || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX))
{
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
return;
}
pAd->BulkOutPending[BulkOutPipeId] = TRUE;
if (((!OPSTATUS_TEST_FLAG(pAd, fOP_AP_STATUS_MEDIA_STATE_CONNECTED)) &&
( !OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)))
)
{
pAd->BulkOutPending[BulkOutPipeId] = FALSE;
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
return;
}
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pHTTXContext = &(pAd->TxContext[BulkOutPipeId]);
BULK_OUT_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags2);
#ifdef USB_BULK_BUF_ALIGMENT
if ( (pHTTXContext->NextBulkIdx != pHTTXContext->CurtBulkIdx)
|| ((pHTTXContext->CurWriteRealPos > pHTTXContext->CurWritePosition) &&(pHTTXContext->NextBulkIdx == pHTTXContext->CurWriteIdx))
|| ((pHTTXContext->CurWriteRealPos == 0) && (pHTTXContext->NextBulkIdx == pHTTXContext->CurWriteIdx))
)
#else
if ((pHTTXContext->ENextBulkOutPosition == pHTTXContext->CurWritePosition)
|| ((pHTTXContext->ENextBulkOutPosition-8) == pHTTXContext->CurWritePosition))
#endif /* USB_BULK_BUF_ALIGMENT */
/* druing writing. */
{
BULK_OUT_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags2);
BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
pAd->BulkOutPending[BulkOutPipeId] = FALSE;
/* Clear Data flag*/
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId));
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
BULK_OUT_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
return;
}
/* Clear Data flag*/
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId));
RTUSB_CLEAR_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
/*DBGPRINT(RT_DEBUG_TRACE,("BulkOut-B:I=0x%lx, CWPos=%ld, CWRPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", in_interrupt(), */
/* pHTTXContext->CurWritePosition, pHTTXContext->CurWriteRealPos, pHTTXContext->NextBulkOutPosition, */
/* pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));*/
pHTTXContext->NextBulkOutPosition = pHTTXContext->ENextBulkOutPosition;
ThisBulkSize = 0;
TmpBulkEndPos = pHTTXContext->NextBulkOutPosition;
#ifdef USB_BULK_BUF_ALIGMENT
INT idx;
idx = pHTTXContext->NextBulkIdx;
pWirelessPkt = &pHTTXContext->TransferBuffer[idx]->field.WirelessPacket[0];
#else
pWirelessPkt = &pHTTXContext->TransferBuffer->field.WirelessPacket[0];
#endif /* USB_BULK_BUF_ALIGMENT */
#ifndef USB_BULK_BUF_ALIGMENT
if ((pHTTXContext->bCopySavePad == TRUE))
{
if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero,4))
{
DBGPRINT_RAW(RT_DEBUG_ERROR,("e1, allzero : %x %x %x %x %x %x %x %x \n",
pHTTXContext->SavedPad[0], pHTTXContext->SavedPad[1], pHTTXContext->SavedPad[2],pHTTXContext->SavedPad[3]
,pHTTXContext->SavedPad[4], pHTTXContext->SavedPad[5], pHTTXContext->SavedPad[6],pHTTXContext->SavedPad[7]));
}
NdisMoveMemory(&pWirelessPkt[TmpBulkEndPos], pHTTXContext->SavedPad, 8);
pHTTXContext->bCopySavePad = FALSE;
if (pAd->bForcePrintTX == TRUE)
//.........这里部分代码省略.........
示例15: RTUSBBulkOutDataPacketComplete
// ************************ Completion Func ************************ //
VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs)
{
PTX_CONTEXT pTxContext;
PRTMP_ADAPTER pAd;
NTSTATUS status;
UCHAR BulkOutPipeId;
unsigned long IrqFlags;
DBGPRINT_RAW(RT_DEBUG_INFO, "--->RTUSBBulkOutDataPacketComplete\n");
pTxContext= (PTX_CONTEXT)pUrb->context;
pAd = pTxContext->pAd;
status = pUrb->status;
// Store BulkOut PipeId
BulkOutPipeId = pTxContext->BulkOutPipeId;
pAd->BulkOutDataOneSecCount++;
if (status == USB_ST_NOERROR)
{
DBGPRINT_RAW(RT_DEBUG_INFO, "BulkOutDataPacketComplete %d (STATUS_SUCCESS)\n", BulkOutPipeId);
if (pTxContext->LastOne == TRUE)
{
pAd->Counters.GoodTransmits++;
FREE_TX_RING(pAd, BulkOutPipeId, pTxContext);
pAd->TxRingTotalNumber[BulkOutPipeId]--; // sync. to TxCount
if (pAd->SendTxWaitQueue[BulkOutPipeId].Number > 0)
{
RTMPDeQueuePacket(pAd, BulkOutPipeId);
}
}
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)))
{
FREE_TX_RING(pAd, BulkOutPipeId, pTxContext);
pAd->TxRingTotalNumber[BulkOutPipeId]--; // sync. to TxCount
// Indicate next one is frag data which has highest priority
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId));
}
else
{
while (pTxContext->LastOne != TRUE)
{
FREE_TX_RING(pAd, BulkOutPipeId, pTxContext);
pAd->TxRingTotalNumber[BulkOutPipeId]--; // sync. to TxCount
pTxContext = &(pAd->TxContext[BulkOutPipeId][pAd->NextBulkOutIndex[BulkOutPipeId]]);
}
FREE_TX_RING(pAd, BulkOutPipeId, pTxContext);
pAd->TxRingTotalNumber[BulkOutPipeId]--; // sync. to TxCount
}
}
}
#if 1 // STATUS_OTHER
else
{
DBGPRINT_RAW(RT_DEBUG_ERROR, "BulkOutDataPacketComplete %d (STATUS_OTHER)\n", BulkOutPipeId);
while (pTxContext->LastOne != TRUE)
{
FREE_TX_RING(pAd, BulkOutPipeId, pTxContext);
pAd->TxRingTotalNumber[BulkOutPipeId]--; // sync. to TxCount
pTxContext = &(pAd->TxContext[BulkOutPipeId][pAd->NextBulkOutIndex[BulkOutPipeId]]);
}
FREE_TX_RING(pAd, BulkOutPipeId, pTxContext);
pAd->TxRingTotalNumber[BulkOutPipeId]--; // sync. to TxCount
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)))
{
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
RTUSBEnqueueInternalCmd(pAd, RT_OID_USB_RESET_BULK_OUT);
}
}
#endif
pTxContext = &(pAd->TxContext[BulkOutPipeId][pAd->NextBulkOutIndex[BulkOutPipeId]]);
//
// bInUse = TRUE, means some process are filling TX data, after that must turn on bWaitingBulkOut
// bWaitingBulkOut = TRUE, means the TX data are waiting for bulk out.
//
if ((pTxContext->bWaitingBulkOut == TRUE) && !RTUSB_TEST_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId)))
{
// Indicate There is data avaliable
RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
}
NdisAcquireSpinLock(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
//.........这里部分代码省略.........