/* ========================================================================== Description: function to be executed at timer thread when auth timer expires ========================================================================== */ VOID AuthTimeout( IN unsigned long data) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)data; DBGPRINT(RT_DEBUG_TRACE,"AUTH - AuthTimeout\n"); MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_AUTH_TIMEOUT, 0, NULL); RTUSBMlmeUp(pAd); }
/* ========================================================================== Description: Disassociation timeout procedure. After disassociation timeout, this function will be called and put a message into the MLME queue Parameters: Standard timer parameters ========================================================================== */ VOID DisassocTimeout( IN PVOID SystemSpecific1, IN PVOID FunctionContext, IN PVOID SystemSpecific2, IN PVOID SystemSpecific3) { RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext; DBGPRINT(RT_DEBUG_TRACE,"ASSOC - enqueue MT2_DISASSOC_TIMEOUT \n"); MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_DISASSOC_TIMEOUT, 0, NULL); RTUSBMlmeUp(pAd); }
static int usb_rtusb_close_device( IN PRTMP_ADAPTER pAd) { int i = 0; int ret; DECLARE_WAIT_QUEUE_HEAD (unlink_wakeup); DECLARE_WAITQUEUE (wait, current); DBGPRINT(RT_DEBUG_TRACE, "-->usb_rtusb_close_device \n"); // ensure there are no more active urbs. add_wait_queue (&unlink_wakeup, &wait); pAd->wait = &unlink_wakeup; // maybe wait for deletions to finish. while ((i < 25) && atomic_read(&pAd->PendingRx) > 0) { #if LINUX_VERSION_CODE >KERNEL_VERSION(2,6,9) msleep(UNLINK_TIMEOUT_MS); #endif i++; } pAd->wait = NULL; remove_wait_queue (&unlink_wakeup, &wait); if (pAd->MLMEThr_pid >= 0) { mlme_kill = 1; RTUSBMlmeUp(pAd); wmb(); // need to check ret = KILL_THREAD_PID (pAd->MLMEThr_pid, SIGTERM, 1); if (ret) { printk (KERN_WARNING "%s: unable to Mlme thread \n", pAd->net_dev->name); } wait_for_completion (&pAd->MlmeThreadNotify); // reset mlme thread pAd->MLMEThr_pid = THREAD_PID_INIT_VALUE; } if (pAd->RTUSBCmdThr_pid>= 0) { RTUSBCmd_kill = 1; RTUSBCMDUp(pAd); wmb(); // need to check ret = KILL_THREAD_PID (pAd->RTUSBCmdThr_pid, SIGTERM, 1); if (ret) { printk (KERN_WARNING "%s: unable to RTUSBCmd thread \n", pAd->net_dev->name); } wait_for_completion (&pAd->CmdThreadNotify); // reset cmd thread pAd->RTUSBCmdThr_pid= THREAD_PID_INIT_VALUE; } RTUSBHalt(pAd, TRUE); RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS); tasklet_kill(&pAd->rx_bh); DBGPRINT(RT_DEBUG_TRACE,"<--usb_rtusb_close_device \n"); return 0; }