本文整理汇总了C++中RTMP_SET_FLAG函数的典型用法代码示例。如果您正苦于以下问题:C++ RTMP_SET_FLAG函数的具体用法?C++ RTMP_SET_FLAG怎么用?C++ RTMP_SET_FLAG使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RTMP_SET_FLAG函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rt2860_suspend
static int rt2860_suspend(
struct pci_dev *pci_dev,
pm_message_t state)
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
INT32 retval = 0;
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n"));
if (net_dev == NULL)
{
DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
}
else
{
GET_PAD_FROM_NET_DEV(pAd, net_dev);
/* we can not use IFF_UP because ra0 down but ra1 up */
/* and 1 suspend/resume function for 1 module, not for each interface */
/* so Linux will call suspend/resume function once */
if (VIRTUAL_IF_NUM(pAd) > 0)
{
// avoid users do suspend after interface is down
// stop interface
netif_carrier_off(net_dev);
netif_stop_queue(net_dev);
// mark device as removed from system and therefore no longer available
netif_device_detach(net_dev);
// mark halt flag
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
// take down the device
rt28xx_close((PNET_DEV)net_dev);
RT_MOD_DEC_USE_COUNT();
}
}
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10)
// reference to http://vovo2000.com/type-lab/linux/kernel-api/linux-kernel-api.html
// enable device to generate PME# when suspended
// pci_choose_state(): Choose the power state of a PCI device to be suspended
retval = pci_enable_wake(pci_dev, pci_choose_state(pci_dev, state), 1);
// save the PCI configuration space of a device before suspending
pci_save_state(pci_dev);
// disable PCI device after use
pci_disable_device(pci_dev);
retval = pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
#endif
DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_suspend()\n"));
return retval;
}
示例2: mt7612u_radio_off
void mt7612u_radio_off(struct rtmp_adapter *pAd, u8 Stage)
{
uint32_t Value, ret;
DBGPRINT(RT_DEBUG_TRACE, ("--> %s\n", __FUNCTION__));
mt7612u_disable_txrx(pAd);
ret = down_interruptible(&pAd->hw_atomic);
if (ret != 0) {
DBGPRINT(RT_DEBUG_ERROR, ("reg_atomic get failed(ret=%d)\n", ret));
return;
}
RTMP_SET_PSFLAG(pAd, fRTMP_PS_MCU_SLEEP);
if (Stage == MLME_RADIO_OFF)
mt7612u_mcu_pwr_saving(pAd, RADIO_OFF, 1);
mt7612u_mcu_ctrl_exit(pAd);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
/* Stop bulkin pipe*/
//if((pAd->PendingRx > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
if((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
{
RTUSBCancelPendingBulkInIRP(pAd);
//pAd->PendingRx = 0;
}
up(&pAd->hw_atomic);
DBGPRINT(RT_DEBUG_TRACE, ("<== %s\n", __FUNCTION__));
}
示例3: 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;
}
}
}
示例4: TDLS_MlmeChannelSwitchRspAction
/*
==========================================================================
Description:
IRQL = PASSIVE_LEVEL
==========================================================================
*/
VOID
TDLS_MlmeChannelSwitchRspAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
PMLME_TDLS_CH_SWITCH_STRUCT pMlmeChSwitchRsp = NULL;
NDIS_STATUS NStatus = NDIS_STATUS_SUCCESS;
PRT_802_11_TDLS pTdls = NULL;
int LinkId = 0xff;
DBGPRINT(RT_DEBUG_WARN,("TDLS ===> TDLS_MlmeChannelSwitchRspAction() \n"));
pMlmeChSwitchRsp = (PMLME_TDLS_CH_SWITCH_STRUCT)Elem->Msg;
if (INFRA_ON(pAd))
{
// Drop not within my TDLS Table that created before !
LinkId = TDLS_SearchLinkId(pAd, pMlmeChSwitchRsp->PeerMacAddr);
if (LinkId == -1 || LinkId == MAX_NUM_OF_TDLS_ENTRY)
{
DBGPRINT(RT_DEBUG_OFF,("TDLS - TDLS_MlmeChannelSwitchRspAction() can not find the LinkId!\n"));
return;
}
/* Point to the current Link ID */
pTdls = &pAd->StaCfg.TdlsInfo.TDLSEntry[LinkId];
/* Build TDLS channel switch Request Frame */
NStatus = TDLS_ChannelSwitchRspAction(pAd, pTdls, pTdls->ChSwitchTime, pTdls->ChSwitchTimeout, 0, (RTMP_TDLS_SPECIFIC_CS_RSP_NOACK + RTMP_TDLS_SPECIFIC_HCCA));
if (NStatus != NDIS_STATUS_SUCCESS)
{
DBGPRINT(RT_DEBUG_ERROR,("TDLS - TDLS_MlmeChannelSwitchRspAction() Build Channel Switch Response Fail !!!\n"));
}
else
{
RTMPusecDelay(300);
NdisGetSystemUpTime(&pAd->StaCfg.TdlsGoBackStartTime);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_ABOVE);
else if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_BELOW);
else
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_NONE);
TDLS_EnablePktChannel(pAd, TDLS_FIFO_ALL);
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
DBGPRINT(RT_DEBUG_WARN,("TDLS <=== TDLS_MlmeChannelSwitchRspAction() \n"));
}
}
else
{
DBGPRINT(RT_DEBUG_ERROR,("TDLS - TDLS_MlmeChannelSwitchRspAction() TDLS only support infra mode !!!\n"));
}
return;
}
示例5: AsicSetRDG
INT AsicSetRDG(RTMP_ADAPTER *pAd, BOOLEAN bEnable)
{
INT ret = FALSE;
#if defined(RTMP_MAC) || defined(RLT_MAC)
if (pAd->chipCap.hif_type == HIF_RTMP ||pAd->chipCap.hif_type == HIF_RLT)
ret = RtAsicSetRDG(pAd, bEnable);
#endif
#ifdef MT_MAC
if (pAd->chipCap.hif_type == HIF_MT)
ret = MtAsicSetRDG(pAd, bEnable);
#endif
if (ret == TRUE)
{
if (bEnable)
{
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RDG_ACTIVE);
}
else
{
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RDG_ACTIVE);
}
}
//AsicNotSupportFunc(pAd, __FUNCTION__);
return ret;
}
示例6: mt7612u_stop_dma_tx
static void mt7612u_stop_dma_tx(struct rtmp_adapter *pAd)
{
uint32_t MacReg = 0, MTxCycle = 0;
UINT8 IdleNums = 0;
DBGPRINT(RT_DEBUG_TRACE, ("====> %s\n", __FUNCTION__));
for (MTxCycle = 0; MTxCycle < 2000; MTxCycle++) {
MacReg = mt76u_sys_read(pAd, U3DMA_WLCFG);
if (((MacReg & 0x80000000) == 0) && IdleNums > 10) {
break;
} else {
IdleNums++;
udelay(50);
}
if (MacReg == 0xFFFFFFFF) {
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST);
return;
}
}
if (MTxCycle >= 2000)
DBGPRINT(RT_DEBUG_ERROR, ("TX DMA busy!! DMA_CFG(%x)\n", MacReg));
}
示例7: rt2870_disconnect
/*
========================================================================
Routine Description:
Release allocated resources.
Arguments:
*dev Point to the PCI or USB device
pAd driver control block pointer
Return Value:
None
Note:
========================================================================
*/
static void rt2870_disconnect(struct usb_device *dev, struct rt_rtmp_adapter *pAd)
{
DBGPRINT(RT_DEBUG_ERROR,
("rtusb_disconnect: unregister usbnet usb-%s-%s\n",
dev->bus->bus_name, dev->devpath));
if (!pAd) {
usb_put_dev(dev);
printk("rtusb_disconnect: pAd == NULL!\n");
return;
}
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST);
/* for debug, wait to show some messages to /proc system */
udelay(1);
RtmpPhyNetDevExit(pAd, pAd->net_dev);
/* FIXME: Shall we need following delay and flush the schedule?? */
udelay(1);
flush_scheduled_work();
udelay(1);
/* free the root net_device */
RtmpOSNetDevFree(pAd->net_dev);
RtmpRaDevCtrlExit(pAd);
/* release a use of the usb device structure */
usb_put_dev(dev);
udelay(1);
DBGPRINT(RT_DEBUG_ERROR, (" RTUSB disconnect successfully\n"));
}
示例8: rt73_suspend
static int
rt73_suspend(struct usb_interface *intf, pm_message_t state)
{
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
DBGPRINT(RT_DEBUG_TRACE,"---> rt73_suspend()\n");
pAd = usb_get_intfdata(intf);
// need to send it first before USB go susped.
// without it system unable to reume back.
RTUSB_VendorRequest(pAd,
0,
DEVICE_VENDOR_REQUEST_OUT,
0x0C,
0x0,
0x0,
NULL,
0);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
MlmeRadioOff(pAd);
DBGPRINT(RT_DEBUG_TRACE,"<--- rt73_suspend()\n");
return 0;
}
示例9: RTMPDrvOpen
VOID RTMPDrvOpen(
IN VOID *pAdSrc)
{
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)pAdSrc;
#ifdef CONFIG_STA_SUPPORT
#endif /* CONFIG_STA_SUPPORT */
/* Enable Interrupt*/
RTMP_IRQ_ENABLE(pAd);
/* Now Enable RxTx*/
RTMPEnableRxTx(pAd);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP);
{
UINT32 reg = 0;
RTMP_IO_READ32(pAd, 0x1300, ®); /* clear garbage interrupts*/
DBGPRINT(RT_DEBUG_TRACE, ("Clear Interrupts: 0x1300 = %08x\n", reg));
}
{
/* u32 reg;*/
/* UINT8 byte;*/
/* u16 tmp;*/
/* RTMP_IO_READ32(pAd, XIFS_TIME_CFG, ®);*/
/* tmp = 0x0805;*/
/* reg = (reg & 0xffff0000) | tmp;*/
/* RTMP_IO_WRITE32(pAd, XIFS_TIME_CFG, reg);*/
}
#ifdef CONFIG_STA_SUPPORT
#ifdef PCIE_PS_SUPPORT
IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
RTMPInitPCIeLinkCtrlValue(pAd);
#endif /* PCIE_PS_SUPPORT */
#endif /* CONFIG_STA_SUPPORT */
#ifdef CONFIG_STA_SUPPORT
/*
To reduce connection time,
do auto reconnect here instead of waiting STAMlmePeriodicExec to do auto reconnect.
*/
if (pAd->OpMode == OPMODE_STA)
MlmeAutoReconnectLastSSID(pAd);
#endif /* CONFIG_STA_SUPPORT */
}
示例10: MlmeThread
/*
========================================================================
Routine Description:
MLME kernel thread.
Arguments:
*Context the pAd, driver control block pointer
Return Value:
0 close the thread
Note:
========================================================================
*/
INT MlmeThread(
IN ULONG Context)
{
RTMP_ADAPTER *pAd;
RTMP_OS_TASK *pTask;
int status;
status = 0;
pTask = (RTMP_OS_TASK *)Context;
pAd = (PRTMP_ADAPTER)pTask->priv;
RtmpOSTaskCustomize(pTask);
while(!pTask->task_killed)
{
#ifdef KTHREAD_SUPPORT
RTMP_WAIT_EVENT_INTERRUPTIBLE(pAd, pTask);
#else
RTMP_SEM_EVENT_WAIT(&(pTask->taskSema), status);
/* unlock the device pointers */
if (status != 0)
{
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
#endif
/* lock the device pointers , need to check if required*/
//down(&(pAd->usbdev_semaphore));
if (!pAd->PM_FlgSuspend)
MlmeHandler(pAd);
}
/* notify the exit routine that we're actually exiting now
*
* complete()/wait_for_completion() is similar to up()/down(),
* except that complete() is safe in the case where the structure
* is getting deleted in a parallel mode of execution (i.e. just
* after the down() -- that's necessary for the thread-shutdown
* case.
*
* complete_and_exit() goes even further than this -- it is safe in
* the case that the thread of the caller is going away (not just
* the structure) -- this is necessary for the module-remove case.
* This is important in preemption kernels, which transfer the flow
* of execution immediately upon a complete().
*/
DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__FUNCTION__));
#ifndef KTHREAD_SUPPORT
pTask->taskPID = THREAD_PID_INIT_VALUE;
complete_and_exit (&pTask->taskComplete, 0);
#endif
return 0;
}
示例11: rt2870_disconnect
/*
========================================================================
Routine Description:
Release allocated resources.
Arguments:
*dev Point to the PCI or USB device
pAd driver control block pointer
Return Value:
None
Note:
========================================================================
*/
static void rt2870_disconnect(struct usb_device *dev, PRTMP_ADAPTER pAd)
{
DBGPRINT(RT_DEBUG_ERROR, ("rtusb_disconnect: unregister usbnet usb-%s-%s\n",
dev->bus->bus_name, dev->devpath));
if (!pAd)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) /* kernel 2.4 series */
while(MOD_IN_USE > 0)
{
MOD_DEC_USE_COUNT;
}
#else
usb_put_dev(dev);
#endif // LINUX_VERSION_CODE //
printk("rtusb_disconnect: pAd == NULL!\n");
return;
}
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST);
// for debug, wait to show some messages to /proc system
udelay(1);
RtmpPhyNetDevExit(pAd, pAd->net_dev);
// FIXME: Shall we need following delay and flush the schedule??
udelay(1);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) /* kernel 2.4 series */
#else
flush_scheduled_work();
#endif // LINUX_VERSION_CODE //
udelay(1);
// free the root net_device
RtmpOSNetDevFree(pAd->net_dev);
#ifdef RT_CFG80211_SUPPORT
CFG80211_UnRegister(pAd, pAd->net_dev);
#endif // RT_CFG80211_SUPPORT //
RtmpRaDevCtrlExit(pAd);
// release a use of the usb device structure
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) /* kernel 2.4 series */
while(MOD_IN_USE > 0)
{
MOD_DEC_USE_COUNT;
}
#else
usb_put_dev(dev);
#endif // LINUX_VERSION_CODE //
udelay(1);
DBGPRINT(RT_DEBUG_ERROR, (" RTUSB disconnect successfully\n"));
}
示例12: 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);
}
示例13: 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);
}
示例14: MlmeThread
/*
========================================================================
Routine Description:
MLME kernel thread.
Arguments:
*Context the pAd, driver control block pointer
Return Value:
0 close the thread
Note:
========================================================================
*/
INT MlmeThread(
IN ULONG Context)
{
RTMP_ADAPTER *pAd;
RTMP_OS_TASK *pTask;
int status;
status = 0;
pTask = (RTMP_OS_TASK *)Context;
pAd = (PRTMP_ADAPTER)RTMP_OS_TASK_DATA_GET(pTask);
if (pAd == NULL)
goto LabelExit; /* avoid compile warning */
RtmpOSTaskCustomize(pTask);
while(!RTMP_OS_TASK_IS_KILLED(pTask))
{
if (RtmpOSTaskWait(pAd, pTask, &status) == FALSE)
{
DBGPRINT_ERR(("RtmpOSTaskWait returned false in MlmeThread, setting halt in progress flag!\n"));
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
break;
}
/* lock the device pointers , need to check if required*/
/*down(&(pAd->usbdev_semaphore)); */
if (!pAd->PM_FlgSuspend)
MlmeHandler(pAd);
}
/* notify the exit routine that we're actually exiting now
*
* complete()/wait_for_completion() is similar to up()/down(),
* except that complete() is safe in the case where the structure
* is getting deleted in a parallel mode of execution (i.e. just
* after the down() -- that's necessary for the thread-shutdown
* case.
*
* complete_and_exit() goes even further than this -- it is safe in
* the case that the thread of the caller is going away (not just
* the structure) -- this is necessary for the module-remove case.
* This is important in preemption kernels, which transfer the flow
* of execution immediately upon a complete().
*/
LabelExit:
DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__FUNCTION__));
RtmpOSTaskNotifyToExit(pTask);
return 0;
}
示例15: TDLS_ChannelSwitchTimeOutAction
/*
==========================================================================
Description:
IRQL = PASSIVE_LEVEL
==========================================================================
*/
VOID TDLS_ChannelSwitchTimeOutAction(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3)
{
PRT_802_11_TDLS pTDLS = (PRT_802_11_TDLS)FunctionContext;
PRTMP_ADAPTER pAd = pTDLS->pAd;
BOOLEAN TimerCancelled;
DBGPRINT(RT_DEBUG_WARN, ("TDLS - Failed to wait for channel switch, terminate the channel switch procedure (%02x:%02x:%02x:%02x:%02x:%02x)\n",
pTDLS->MacAddr[0], pTDLS->MacAddr[1], pTDLS->MacAddr[2],
pTDLS->MacAddr[3], pTDLS->MacAddr[4], pTDLS->MacAddr[5]));
{
ULONG Now, temp1;
NdisGetSystemUpTime(&Now);
temp1 = (((Now - pTDLS->ChannelSwitchTimerStartTime) * 1000) / OS_HZ);
if (temp1 < (pTDLS->ChSwitchTimeout / 1000))
{
RTMPSetTimer(&pTDLS->ChannelSwitchTimeoutTimer, ((pTDLS->ChSwitchTimeout / 1000) - temp1));
return;
}
if (temp1 < (pTDLS->ChSwitchTimeout / 1000))
{
DBGPRINT(RT_DEBUG_OFF, ("Timer = %ld < 11 !!!\n", temp1));
}
}
RTMPCancelTimer(&pAd->StaCfg.TdlsResponderGoBackBaseChTimer, &TimerCancelled);
pAd->StaCfg.bTdlsCurrentDoingChannelSwitchWaitSuccess = FALSE;
pAd->StaCfg.bDoingPeriodChannelSwitch = FALSE;
RTMPusecDelay(300);
NdisGetSystemUpTime(&pAd->StaCfg.TdlsGoBackStartTime);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_ABOVE);
else if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_BELOW);
else
TDLS_InitChannelRelatedValue(pAd, pAd->CommonCfg.Channel, EXTCHA_NONE);
TDLS_EnablePktChannel(pAd, TDLS_FIFO_ALL);
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_TDLS_DOING_CHANNEL_SWITCH);
}