本文整理汇总了C++中RTMP_INT_LOCK函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMP_INT_LOCK函数的具体用法?C++ RTMP_INT_LOCK怎么用?C++ RTMP_INT_LOCK使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMP_INT_LOCK函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RtmpTimerQRemove
BOOLEAN RtmpTimerQRemove(RTMP_ADAPTER *pAd, RALINK_TIMER_STRUCT *pTimer)
{
RTMP_TIMER_TASK_ENTRY *pNode, *pPrev = NULL;
unsigned long irqFlags;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
if (pAd->TimerQ.status >= RTMP_TASK_STAT_INITED) {
pNode = pAd->TimerQ.pQHead;
while (pNode) {
if (pNode->pRaTimer == pTimer)
break;
pPrev = pNode;
pNode = pNode->pNext;
}
/* Now move it to freeList queue.*/
if (pNode) {
if (pNode == pAd->TimerQ.pQHead)
pAd->TimerQ.pQHead = pNode->pNext;
if (pNode == pAd->TimerQ.pQTail)
pAd->TimerQ.pQTail = pPrev;
if (pPrev != NULL)
pPrev->pNext = pNode->pNext;
/* return this queue entry to timerQFreeList.*/
pNode->pNext = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pNode;
}
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
return TRUE;
}
示例2: RTMP_INT_LOCK
RTMP_TIMER_TASK_ENTRY *RtmpTimerQInsert(RTMP_ADAPTER *pAd,
RALINK_TIMER_STRUCT *pTimer)
{
RTMP_TIMER_TASK_ENTRY *pQNode = NULL, *pQTail;
unsigned long irqFlags;
RTMP_OS_TASK *pTask = &pAd->timerTask;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
if (pAd->TimerQ.status & RTMP_TASK_CAN_DO_INSERT) {
if(pAd->TimerQ.pQPollFreeList) {
pQNode = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pQNode->pNext;
pQNode->pRaTimer = pTimer;
pQNode->pNext = NULL;
pQTail = pAd->TimerQ.pQTail;
if (pAd->TimerQ.pQTail != NULL)
pQTail->pNext = pQNode;
pAd->TimerQ.pQTail = pQNode;
if (pAd->TimerQ.pQHead == NULL)
pAd->TimerQ.pQHead = pQNode;
}
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
if (pQNode) {
RTMP_OS_TASK_WAKE_UP(pTask);
}
return pQNode;
}
示例3: rx_done_tasklet
static void rx_done_tasklet(unsigned long data)
{
unsigned long flags;
struct rt_rtmp_adapter *pAd = (struct rt_rtmp_adapter *)data;
BOOLEAN bReschedule = 0;
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;
pAd->int_pending &= ~(INT_RX);
bReschedule = STARxDoneInterruptHandle(pAd, 0);
RTMP_INT_LOCK(&pAd->irq_lock, flags);
/*
* double check to avoid rotting packet
*/
if (pAd->int_pending & INT_RX || bReschedule) {
tasklet_hi_schedule(&pObj->rx_done_task);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return;
}
/* enable Rxint again */
rt2860_int_enable(pAd, INT_RX);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
}
示例4: fifo_statistic_full_tasklet
void fifo_statistic_full_tasklet(unsigned long data)
{
unsigned long flags;
struct rt_rtmp_adapter *pAd = (struct rt_rtmp_adapter *)data;
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;
pAd->int_pending &= ~(FifoStaFullInt);
NICUpdateFifoStaCounters(pAd);
RTMP_INT_LOCK(&pAd->irq_lock, flags);
/*
* double check to avoid rotting packet
*/
if (pAd->int_pending & FifoStaFullInt) {
tasklet_hi_schedule(&pObj->fifo_statistic_full_task);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return;
}
/* enable Rxint again */
rt2860_int_enable(pAd, FifoStaFullInt);
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
}
示例5: RtmpTimerQRemove
BOOLEAN RtmpTimerQRemove(struct rt_rtmp_adapter *pAd, struct rt_ralink_timer *pTimer)
{
struct rt_rtmp_timer_task_entry *pNode, *pPrev = NULL;
unsigned long irqFlags;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
if (pAd->TimerQ.status >= RTMP_TASK_STAT_INITED) {
pNode = pAd->TimerQ.pQHead;
while (pNode) {
if (pNode->pRaTimer == pTimer)
break;
pPrev = pNode;
pNode = pNode->pNext;
}
/* Now move it to freeList queue. */
if (pNode) {
if (pNode == pAd->TimerQ.pQHead)
pAd->TimerQ.pQHead = pNode->pNext;
if (pNode == pAd->TimerQ.pQTail)
pAd->TimerQ.pQTail = pPrev;
if (pPrev != NULL)
pPrev->pNext = pNode->pNext;
/* return this queue entry to timerQFreeList. */
pNode->pNext = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pNode;
}
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
return TRUE;
}
示例6: rtmp_wdev_idx_unreg
INT rtmp_wdev_idx_unreg(RTMP_ADAPTER *pAd, struct wifi_dev *wdev)
{
INT idx;
ULONG flags;
if (!wdev)
return -1;
RTMP_INT_LOCK(&pAd->irq_lock, flags);
for (idx = 0; idx < WDEV_NUM_MAX; idx++) {
if (pAd->wdev_list[idx] == wdev) {
DBGPRINT(RT_DEBUG_WARN,
("unregister wdev(type:%d, idx:%d) from wdev_list\n",
wdev->wdev_type, wdev->wdev_idx));
pAd->wdev_list[idx] = NULL;
wdev->wdev_idx = WDEV_NUM_MAX;
break;
}
}
if (idx == WDEV_NUM_MAX) {
DBGPRINT(RT_DEBUG_ERROR,
("Cannot found wdev(%p, type:%d, idx:%d) in wdev_list\n",
wdev, wdev->wdev_type, wdev->wdev_idx));
DBGPRINT(RT_DEBUG_OFF, ("Dump wdev_list:\n"));
for (idx = 0; idx < WDEV_NUM_MAX; idx++) {
DBGPRINT(RT_DEBUG_OFF, ("Idx %d: 0x%p\n", idx, pAd->wdev_list[idx]));
}
}
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return ((idx < WDEV_NUM_MAX) ? 0 : -1);
}
示例7: rtmp_wdev_idx_reg
INT rtmp_wdev_idx_reg(RTMP_ADAPTER *pAd, struct wifi_dev *wdev)
{
INT idx;
ULONG flags;
if (!wdev)
return -1;
RTMP_INT_LOCK(&pAd->irq_lock, flags);
for (idx = 0; idx < WDEV_NUM_MAX; idx++) {
if (pAd->wdev_list[idx] == wdev) {
DBGPRINT(RT_DEBUG_WARN,
("wdev(type:%d) already registered and idx(%d) %smatch\n",
wdev->wdev_type, wdev->wdev_idx,
((idx != wdev->wdev_idx) ? "mis" : "")));
break;
}
if (pAd->wdev_list[idx] == NULL) {
pAd->wdev_list[idx] = wdev;
break;
}
}
wdev->wdev_idx = idx;
if (idx < WDEV_NUM_MAX) {
DBGPRINT(RT_DEBUG_TRACE, ("Assign wdev_idx=%d\n", idx));
}
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return ((idx < WDEV_NUM_MAX) ? idx : -1);
}
示例8: RtmpTimerQHandle
static void RtmpTimerQHandle(RTMP_ADAPTER *pAd)
{
int status;
RALINK_TIMER_STRUCT *pTimer;
RTMP_TIMER_TASK_ENTRY *pEntry;
unsigned long irqFlag;
RTMP_OS_TASK *pTask;
pTask = &pAd->timerTask;
while(!RTMP_OS_TASK_IS_KILLED(pTask))
{
pTimer = NULL;
if (RtmpOSTaskWait(pAd, pTask, &status) == FALSE)
{
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
if (pAd->TimerQ.status == RTMP_TASK_STAT_STOPED)
break;
/* event happened.*/
while(pAd->TimerQ.pQHead)
{
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlag);
pEntry = pAd->TimerQ.pQHead;
if (pEntry)
{
pTimer = pEntry->pRaTimer;
/* update pQHead*/
pAd->TimerQ.pQHead = pEntry->pNext;
if (pEntry == pAd->TimerQ.pQTail)
pAd->TimerQ.pQTail = NULL;
/* return this queue entry to timerQFreeList.*/
pEntry->pNext = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pEntry;
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlag);
if (pTimer)
{
if ((pTimer->handle != NULL) && (!pAd->PM_FlgSuspend))
pTimer->handle(NULL, (PVOID) pTimer->cookie, NULL, pTimer);
if ((pTimer->Repeat) && (pTimer->State == FALSE))
RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue);
}
}
if (status != 0)
{
pAd->TimerQ.status = RTMP_TASK_STAT_STOPED;
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
}
}
示例9: rtmp_wdev_idx_find_by_p2p_ifaddr
INT rtmp_wdev_idx_find_by_p2p_ifaddr(RTMP_ADAPTER *pAd, UCHAR *ifAddr)
{
INT idx, type;
ULONG flags;
PNET_DEV if_dev = NULL;
struct wifi_dev *wdev = NULL;
if (!ifAddr)
return -1;
RTMP_INT_LOCK(&pAd->irq_lock, flags);
for (idx = 0; idx < WDEV_NUM_MAX; idx++) {
wdev = pAd->wdev_list[idx];
if (!wdev)
continue;
if_dev = wdev->if_dev;
if (!if_dev)
continue;
if (!if_dev->ieee80211_ptr)
continue;
type = if_dev->ieee80211_ptr->iftype;
if ( RTMPEqualMemory(wdev->if_addr, ifAddr, MAC_ADDR_LEN) &&
( type == RT_CMD_80211_IFTYPE_P2P_CLIENT ||
type == RT_CMD_80211_IFTYPE_P2P_GO ||
type == RT_CMD_80211_IFTYPE_P2P_DEVICE
))
{
//MTWF_LOG(DBG_CAT_ALL, DBG_LVL_INFO,
// ("find the wdev(type:%d, idx:%d) from wdev_list\n",
// pAd->wdev_list[idx]->wdev_type, pAd->wdev_list[idx]->wdev_idx));
break;
}
}
RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
return ((idx < WDEV_NUM_MAX) ? idx : -1);
}
示例10: RtmpTimerQExit
void RtmpTimerQExit(struct rt_rtmp_adapter *pAd)
{
struct rt_rtmp_timer_task_entry *pTimerQ;
unsigned long irqFlags;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
while (pAd->TimerQ.pQHead) {
pTimerQ = pAd->TimerQ.pQHead;
pAd->TimerQ.pQHead = pTimerQ->pNext;
/* remove the timeQ */
}
pAd->TimerQ.pQPollFreeList = NULL;
os_free_mem(pAd, pAd->TimerQ.pTimerQPoll);
pAd->TimerQ.pQTail = NULL;
pAd->TimerQ.pQHead = NULL;
#ifndef KTHREAD_SUPPORT
pAd->TimerQ.status = RTMP_TASK_STAT_STOPED;
#endif
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
}
示例11: RtmpTimerQExit
void RtmpTimerQExit(RTMP_ADAPTER *pAd)
{
RTMP_TIMER_TASK_ENTRY *pTimerQ;
unsigned long irqFlags;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
while (pAd->TimerQ.pQHead) {
pTimerQ = pAd->TimerQ.pQHead;
pAd->TimerQ.pQHead = pTimerQ->pNext;
/* remove the timeQ*/
}
pAd->TimerQ.pQPollFreeList = NULL;
os_free_mem(pAd->TimerQ.pTimerQPoll);
pAd->TimerQ.pQTail = NULL;
pAd->TimerQ.pQHead = NULL;
/*#ifndef KTHREAD_SUPPORT*/
pAd->TimerQ.status = RTMP_TASK_STAT_STOPPED;
/*#endif*/
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
/* NdisFreeSpinLock(&pAd->TimerQLock); */
}
示例12: 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);
}
示例13: 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);
}
示例14: RTMP_INT_LOCK
struct rt_rtmp_timer_task_entry *RtmpTimerQInsert(struct rt_rtmp_adapter *pAd,
struct rt_ralink_timer *pTimer)
{
struct rt_rtmp_timer_task_entry *pQNode = NULL, *pQTail;
unsigned long irqFlags;
struct rt_rtmp_os_task *pTask = &pAd->timerTask;
RTMP_INT_LOCK(&pAd->TimerQLock, irqFlags);
if (pAd->TimerQ.status & RTMP_TASK_CAN_DO_INSERT) {
if (pAd->TimerQ.pQPollFreeList) {
pQNode = pAd->TimerQ.pQPollFreeList;
pAd->TimerQ.pQPollFreeList = pQNode->pNext;
pQNode->pRaTimer = pTimer;
pQNode->pNext = NULL;
pQTail = pAd->TimerQ.pQTail;
if (pAd->TimerQ.pQTail != NULL)
pQTail->pNext = pQNode;
pAd->TimerQ.pQTail = pQNode;
if (pAd->TimerQ.pQHead == NULL)
pAd->TimerQ.pQHead = pQNode;
}
}
RTMP_INT_UNLOCK(&pAd->TimerQLock, irqFlags);
if (pQNode) {
#ifdef KTHREAD_SUPPORT
WAKE_UP(pTask);
#else
RTMP_SEM_EVENT_UP(&pTask->taskSema);
#endif
}
return pQNode;
}
示例15: CMDHandler
//.........这里部分代码省略.........
if ((MACValue & 0xc00000) == 0)
RTUSBReadMACRegister(pAd, USB_DMA_CFG, &MACValue);
// To prevent Read Register error, we 3rd check the validity.
if ((MACValue & 0xc00000) == 0)
RTUSBReadMACRegister(pAd, USB_DMA_CFG, &MACValue);
MACValue |= 0x80000;
RTUSBWriteMACRegister(pAd, USB_DMA_CFG, MACValue);
// Wait 1ms to prevent next URB to bulkout before HW reset. by MAXLEE 12-25-2007
RTMPusecDelay(1000);
MACValue &= (~0x80000);
RTUSBWriteMACRegister(pAd, USB_DMA_CFG, MACValue);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("\tSet 0x2a0 bit19. Clear USB DMA TX path\n"));
// Wait 5ms to prevent next URB to bulkout before HW reset. by MAXLEE 12-25-2007
//RTMPusecDelay(5000);
if ((pAd->bulkResetPipeid & BULKOUT_MGMT_RESET_FLAG) == BULKOUT_MGMT_RESET_FLAG)
{
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
if (pAd->MgmtRing.TxSwFreeIdx < MGMT_RING_SIZE /* pMLMEContext->bWaitingBulkOut == TRUE */)
{
RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME);
}
RTUSBKickBulkOut(pAd);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("\tTX MGMT RECOVER Done!\n"));
}
else
{
pHTTXContext = &(pAd->TxContext[pAd->bulkResetPipeid]);
//NdisAcquireSpinLock(&pAd->BulkOutLock[pAd->bulkResetPipeid]);
RTMP_INT_LOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags);
if ( pAd->BulkOutPending[pAd->bulkResetPipeid] == FALSE)
{
pAd->BulkOutPending[pAd->bulkResetPipeid] = TRUE;
pHTTXContext->IRPPending = TRUE;
pAd->watchDogTxPendingCnt[pAd->bulkResetPipeid] = 1;
// no matter what, clean the flag
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
//NdisReleaseSpinLock(&pAd->BulkOutLock[pAd->bulkResetPipeid]);
RTMP_INT_UNLOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags);
/*-----------------------------------------------------------------------------------------------*/
/*-----------------------------------------------------------------------------------------------*/
{
RTUSBInitHTTxDesc(pAd, pHTTXContext, pAd->bulkResetPipeid, pHTTXContext->BulkOutSize, (usb_complete_t)RTUSBBulkOutDataPacketComplete);
if((ret = RTUSB_SUBMIT_URB(pHTTXContext->pUrb))!=0)
{
RTMP_INT_LOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags);
pAd->BulkOutPending[pAd->bulkResetPipeid] = FALSE;
pHTTXContext->IRPPending = FALSE;
pAd->watchDogTxPendingCnt[pAd->bulkResetPipeid] = 0;
RTMP_INT_UNLOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags);
DBGPRINT(RT_DEBUG_ERROR, ("CmdThread : CMDTHREAD_RESET_BULK_OUT: Submit Tx URB failed %d\n", ret));
}
else
{
RTMP_IRQ_LOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags);
DBGPRINT_RAW(RT_DEBUG_TRACE,("\tCMDTHREAD_RESET_BULK_OUT: TxContext[%d]:CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d, pending=%d!\n",
pAd->bulkResetPipeid, pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition,
pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad, pAd->BulkOutPending[pAd->bulkResetPipeid]));