diff options
Diffstat (limited to 'drivers/staging/rt2870/common')
-rw-r--r-- | drivers/staging/rt2870/common/2870_rtmp_init.c | 35 | ||||
-rw-r--r-- | drivers/staging/rt2870/common/cmm_data.c | 3 | ||||
-rw-r--r-- | drivers/staging/rt2870/common/rtmp_init.c | 2 | ||||
-rw-r--r-- | drivers/staging/rt2870/common/rtusb_io.c | 3 |
4 files changed, 22 insertions, 21 deletions
diff --git a/drivers/staging/rt2870/common/2870_rtmp_init.c b/drivers/staging/rt2870/common/2870_rtmp_init.c index 9f5143b3922..cb16d2fcf60 100644 --- a/drivers/staging/rt2870/common/2870_rtmp_init.c +++ b/drivers/staging/rt2870/common/2870_rtmp_init.c @@ -727,8 +727,8 @@ NDIS_STATUS AdapterBlockAllocateMemory( usb_dev = pObj->pUsb_Dev; - pObj->MLMEThr_pid = THREAD_PID_INIT_VALUE; - pObj->RTUSBCmdThr_pid = THREAD_PID_INIT_VALUE; + pObj->MLMEThr_task = NULL; + pObj->RTUSBCmdThr_task = NULL; *ppAd = (PVOID)vmalloc(sizeof(RTMP_ADAPTER)); @@ -765,7 +765,7 @@ NDIS_STATUS CreateThreads( { PRTMP_ADAPTER pAd = net_dev->ml_priv; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; - pid_t pid_number = -1; + struct task_struct *tsk; //init_MUTEX(&(pAd->usbdev_semaphore)); @@ -779,36 +779,39 @@ NDIS_STATUS CreateThreads( init_completion (&pAd->TimerQComplete); // Creat MLME Thread - pObj->MLMEThr_pid= THREAD_PID_INIT_VALUE; - pid_number = kernel_thread(MlmeThread, pAd, CLONE_VM); - if (pid_number < 0) - { + pObj->MLMEThr_task = NULL; + tsk = kthread_run(MlmeThread, pAd, pAd->net_dev->name); + + if (IS_ERR(tsk)) { printk (KERN_WARNING "%s: unable to start Mlme thread\n",pAd->net_dev->name); return NDIS_STATUS_FAILURE; } - pObj->MLMEThr_pid = GET_PID(pid_number); + + pObj->MLMEThr_task = tsk; // Wait for the thread to start wait_for_completion(&(pAd->mlmeComplete)); // Creat Command Thread - pObj->RTUSBCmdThr_pid= THREAD_PID_INIT_VALUE; - pid_number = kernel_thread(RTUSBCmdThread, pAd, CLONE_VM); - if (pid_number < 0) + pObj->RTUSBCmdThr_task = NULL; + tsk = kthread_run(RTUSBCmdThread, pAd, pAd->net_dev->name); + + if (IS_ERR(tsk) < 0) { printk (KERN_WARNING "%s: unable to start RTUSBCmd thread\n",pAd->net_dev->name); return NDIS_STATUS_FAILURE; } - pObj->RTUSBCmdThr_pid = GET_PID(pid_number); + + pObj->RTUSBCmdThr_task = tsk; wait_for_completion(&(pAd->CmdQComplete)); - pObj->TimerQThr_pid= THREAD_PID_INIT_VALUE; - pid_number = kernel_thread(TimerQThread, pAd, CLONE_VM); - if (pid_number < 0) + pObj->TimerQThr_task = NULL; + tsk = kthread_run(TimerQThread, pAd, pAd->net_dev->name); + if (IS_ERR(tsk) < 0) { printk (KERN_WARNING "%s: unable to start TimerQThread\n",pAd->net_dev->name); return NDIS_STATUS_FAILURE; } - pObj->TimerQThr_pid = GET_PID(pid_number); + pObj->TimerQThr_task = tsk; // Wait for the thread to start wait_for_completion(&(pAd->TimerQComplete)); diff --git a/drivers/staging/rt2870/common/cmm_data.c b/drivers/staging/rt2870/common/cmm_data.c index fd809abf6df..f8e0ebd7bca 100644 --- a/drivers/staging/rt2870/common/cmm_data.c +++ b/drivers/staging/rt2870/common/cmm_data.c @@ -709,9 +709,6 @@ BOOLEAN RTMP_FillTxBlkInfo( } return TRUE; - -FillTxBlkErr: - return FALSE; } diff --git a/drivers/staging/rt2870/common/rtmp_init.c b/drivers/staging/rt2870/common/rtmp_init.c index 870a00da3da..099b6a806f8 100644 --- a/drivers/staging/rt2870/common/rtmp_init.c +++ b/drivers/staging/rt2870/common/rtmp_init.c @@ -3655,7 +3655,7 @@ VOID UserCfgInit( #ifdef RALINK_28xx_QA //pAd->ate.Repeat = 0; pAd->ate.TxStatus = 0; - pAd->ate.AtePid = THREAD_PID_INIT_VALUE; + pAd->ate.AtePid = NULL; #endif // RALINK_28xx_QA // #endif // RALINK_ATE // diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c index 6db443e9268..afde136a9a0 100644 --- a/drivers/staging/rt2870/common/rtusb_io.c +++ b/drivers/staging/rt2870/common/rtusb_io.c @@ -958,7 +958,8 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis( POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; - CHECK_PID_LEGALITY(pObj->RTUSBCmdThr_pid) + BUG_ON(pObj->RTUSBCmdThr_task == NULL); + CHECK_PID_LEGALITY(task_pid(pObj->RTUSBCmdThr_task)) return (NDIS_STATUS_RESOURCES); status = RTMPAllocateMemory((PVOID *)&cmdqelmt, sizeof(CmdQElmt)); |