/* ======================================================================== Routine Description: Create kernel threads & tasklets. Arguments: *net_dev Pointer to wireless net device interface Return Value: NDIS_STATUS_SUCCESS NDIS_STATUS_FAILURE Note: ======================================================================== */ NDIS_STATUS RtmpMgmtTaskInit(RTMP_ADAPTER *pAd) { RTMP_OS_TASK *pTask; NDIS_STATUS status; /* Create TimerQ Thread, We need init timerQ related structure before create the timer thread. */ RtmpTimerQInit(pAd); pTask = &pAd->timerTask; RTMP_OS_TASK_INIT(pTask, "RtmpTimerTask", pAd); status = RtmpOSTaskAttach(pTask, RtmpTimerQThread, (ULONG)pTask); if (status == NDIS_STATUS_FAILURE) { printk (KERN_WARNING "%s: unable to start RtmpTimerQThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev)); return NDIS_STATUS_FAILURE; } /* Creat Command Thread */ pTask = &pAd->cmdQTask; RTMP_OS_TASK_INIT(pTask, "RtmpCmdQTask", pAd); status = RtmpOSTaskAttach(pTask, RTUSBCmdThread, (ULONG)pTask); if (status == NDIS_STATUS_FAILURE) { printk (KERN_WARNING "%s: unable to start RTUSBCmdThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev)); return NDIS_STATUS_FAILURE; } return NDIS_STATUS_SUCCESS; }
/* ======================================================================== Routine Description: Create kernel threads & tasklets. Arguments: *net_dev Pointer to wireless net device interface Return Value: NDIS_STATUS_SUCCESS NDIS_STATUS_FAILURE Note: ======================================================================== */ NDIS_STATUS RtmpMgmtTaskInit( IN RTMP_ADAPTER *pAd) { RTMP_OS_TASK *pTask; NDIS_STATUS status; /* Creat TimerQ Thread, We need init timerQ related structure before create the timer thread. */ RtmpTimerQInit(pAd); pTask = &pAd->timerTask; RTMP_OS_TASK_INIT(pTask, "rtmp_timer_task", pAd); status = RtmpOSTaskAttach(pTask, RtmpTimerQThread, (ULONG)pTask); if (status == NDIS_STATUS_FAILURE) { #ifdef DBG printk(KERN_WARNING "%s: unable to start RtmpTimerQThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev)); #endif /* DBG */ return NDIS_STATUS_FAILURE; } /* Creat MLME Thread */ pTask = &pAd->mlmeTask; RTMP_OS_TASK_INIT(pTask, "rtmp_mlme_task", pAd); status = RtmpOSTaskAttach(pTask, MlmeThread, (ULONG)pTask); if (status == NDIS_STATUS_FAILURE) { #ifdef DBG printk(KERN_WARNING "%s: unable to start MlmeThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev)); #endif /* DBG */ return NDIS_STATUS_FAILURE; } /* Creat Command Thread */ pTask = &pAd->cmdQTask; RTMP_OS_TASK_INIT(pTask, "rtmp_cmd_qtask", pAd); status = RtmpOSTaskAttach(pTask, RTUSBCmdThread, (ULONG)pTask); if (status == NDIS_STATUS_FAILURE) { #ifdef DBG printk(KERN_WARNING "%s: unable to start RTUSBCmdThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev)); #endif /* DBG */ return NDIS_STATUS_FAILURE; } #ifdef WSC_INCLUDED /* start the crediential write task first. */ WscThreadInit(pAd); #endif /* WSC_INCLUDED */ return NDIS_STATUS_SUCCESS; }
NDIS_STATUS WriteDatThread( IN RTMP_ADAPTER *pAd) { NDIS_STATUS status = NDIS_STATUS_FAILURE; RTMP_OS_TASK *pTask; if (pAd->bWriteDat == FALSE) return 0; DBGPRINT(RT_DEBUG_TRACE, ("-->WriteDatThreadInit()\n")); pTask = &pAd->WriteDatTask; RTMP_OS_TASK_INIT(pTask, "RtmpWriteDatTask", pAd); status = RtmpOSTaskAttach(pTask, write_dat_file_thread, (ULONG)&pAd->WriteDatTask); DBGPRINT(RT_DEBUG_TRACE, ("<--WriteDatThreadInit(), status=%d!\n", status)); return status; }