diff options
author | Malcolm Priestley <tvboxspy@gmail.com> | 2013-09-27 16:48:14 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-30 18:33:13 -0700 |
commit | 94488a7ebfbc95c4b8fbfe39644e97b926a550a7 (patch) | |
tree | 3a03f7886838be248c3767123c63214e5385bd29 /drivers/staging/vt6656/wcmd.c | |
parent | b20204310ad18516146264830bc7b840b6052d57 (diff) |
staging: vt6656: device.h convert sTimerCommand to delayed_work
timer to delay workqueue.
sTimerCommand -> run_command_work
sTimerCommand is very heavy on the system timer.
Improves over performance of driver and reduce the atomic
area of driver.
Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656/wcmd.c')
-rw-r--r-- | drivers/staging/vt6656/wcmd.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/drivers/staging/vt6656/wcmd.c b/drivers/staging/vt6656/wcmd.c index 0013cb73d83b..3b9bfcb40fcb 100644 --- a/drivers/staging/vt6656/wcmd.c +++ b/drivers/staging/vt6656/wcmd.c @@ -268,20 +268,14 @@ struct vnt_tx_mgmt *s_MgrMakeProbeRequest(struct vnt_private *pDevice, void vCommandTimerWait(struct vnt_private *pDevice, unsigned long MSecond) { - - init_timer(&pDevice->sTimerCommand); - - pDevice->sTimerCommand.data = (unsigned long)pDevice; - pDevice->sTimerCommand.function = (TimerFunction)vRunCommand; - pDevice->sTimerCommand.expires = RUN_AT((MSecond * HZ) / 1000); - - add_timer(&pDevice->sTimerCommand); - - return; + schedule_delayed_work(&pDevice->run_command_work, + msecs_to_jiffies(MSecond)); } -void vRunCommand(struct vnt_private *pDevice) +void vRunCommand(struct work_struct *work) { + struct vnt_private *pDevice = + container_of(work, struct vnt_private, run_command_work.work); struct vnt_manager *pMgmt = &pDevice->vnt_mgmt; PWLAN_IE_SSID pItemSSID; PWLAN_IE_SSID pItemSSIDCurr; @@ -1156,14 +1150,8 @@ static int s_bClearBSSID_SCAN(struct vnt_private *pDevice) //mike add:reset command timer void vResetCommandTimer(struct vnt_private *pDevice) { + cancel_delayed_work_sync(&pDevice->run_command_work); - //delete timer - del_timer(&pDevice->sTimerCommand); - //init timer - init_timer(&pDevice->sTimerCommand); - pDevice->sTimerCommand.data = (unsigned long)pDevice; - pDevice->sTimerCommand.function = (TimerFunction)vRunCommand; - pDevice->sTimerCommand.expires = RUN_AT(HZ); pDevice->cbFreeCmdQueue = CMD_Q_SIZE; pDevice->uCmdDequeueIdx = 0; pDevice->uCmdEnqueueIdx = 0; |