Commit 94488a7e authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

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: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b2020431
...@@ -707,7 +707,7 @@ struct vnt_private { ...@@ -707,7 +707,7 @@ struct vnt_private {
u8 byBBCR09; u8 byBBCR09;
/* command timer */ /* command timer */
struct timer_list sTimerCommand; struct delayed_work run_command_work;
struct timer_list sTimerTxData; struct timer_list sTimerTxData;
unsigned long nTxDataTimeCout; unsigned long nTxDataTimeCout;
......
...@@ -702,6 +702,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -702,6 +702,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
device_set_options(pDevice); device_set_options(pDevice);
spin_lock_init(&pDevice->lock); spin_lock_init(&pDevice->lock);
INIT_DELAYED_WORK(&pDevice->run_command_work, vRunCommand);
pDevice->tx_80211 = device_dma0_tx_80211; pDevice->tx_80211 = device_dma0_tx_80211;
pDevice->vnt_mgmt.pAdapter = (void *) pDevice; pDevice->vnt_mgmt.pAdapter = (void *) pDevice;
...@@ -1076,7 +1077,9 @@ static int device_close(struct net_device *dev) ...@@ -1076,7 +1077,9 @@ static int device_close(struct net_device *dev)
MP_CLEAR_FLAG(pDevice, fMP_POST_WRITES); MP_CLEAR_FLAG(pDevice, fMP_POST_WRITES);
MP_CLEAR_FLAG(pDevice, fMP_POST_READS); MP_CLEAR_FLAG(pDevice, fMP_POST_READS);
pDevice->fKillEventPollingThread = true; pDevice->fKillEventPollingThread = true;
del_timer(&pDevice->sTimerCommand);
cancel_delayed_work_sync(&pDevice->run_command_work);
del_timer(&pMgmt->sTimerSecondCallback); del_timer(&pMgmt->sTimerSecondCallback);
del_timer(&pDevice->sTimerTxData); del_timer(&pDevice->sTimerTxData);
......
...@@ -268,20 +268,14 @@ struct vnt_tx_mgmt *s_MgrMakeProbeRequest(struct vnt_private *pDevice, ...@@ -268,20 +268,14 @@ struct vnt_tx_mgmt *s_MgrMakeProbeRequest(struct vnt_private *pDevice,
void vCommandTimerWait(struct vnt_private *pDevice, unsigned long MSecond) void vCommandTimerWait(struct vnt_private *pDevice, unsigned long MSecond)
{ {
schedule_delayed_work(&pDevice->run_command_work,
init_timer(&pDevice->sTimerCommand); msecs_to_jiffies(MSecond));
pDevice->sTimerCommand.data = (unsigned long)pDevice;
pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
pDevice->sTimerCommand.expires = RUN_AT((MSecond * HZ) / 1000);
add_timer(&pDevice->sTimerCommand);
return;
} }
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; struct vnt_manager *pMgmt = &pDevice->vnt_mgmt;
PWLAN_IE_SSID pItemSSID; PWLAN_IE_SSID pItemSSID;
PWLAN_IE_SSID pItemSSIDCurr; PWLAN_IE_SSID pItemSSIDCurr;
...@@ -1156,14 +1150,8 @@ static int s_bClearBSSID_SCAN(struct vnt_private *pDevice) ...@@ -1156,14 +1150,8 @@ static int s_bClearBSSID_SCAN(struct vnt_private *pDevice)
//mike add:reset command timer //mike add:reset command timer
void vResetCommandTimer(struct vnt_private *pDevice) 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->cbFreeCmdQueue = CMD_Q_SIZE;
pDevice->uCmdDequeueIdx = 0; pDevice->uCmdDequeueIdx = 0;
pDevice->uCmdEnqueueIdx = 0; pDevice->uCmdEnqueueIdx = 0;
......
...@@ -105,14 +105,7 @@ void vResetCommandTimer(struct vnt_private *); ...@@ -105,14 +105,7 @@ void vResetCommandTimer(struct vnt_private *);
int bScheduleCommand(struct vnt_private *, CMD_CODE eCommand, u8 *pbyItem0); int bScheduleCommand(struct vnt_private *, CMD_CODE eCommand, u8 *pbyItem0);
void vRunCommand(struct vnt_private *); void vRunCommand(struct work_struct *work);
/*
void
WCMDvCommandThread(
void * Context
);
*/
void BSSvSecondTxData(struct vnt_private *); void BSSvSecondTxData(struct vnt_private *);
......
...@@ -218,11 +218,6 @@ void vMgrObjectInit(struct vnt_private *pDevice) ...@@ -218,11 +218,6 @@ void vMgrObjectInit(struct vnt_private *pDevice)
pMgmt->sTimerSecondCallback.function = (TimerFunction)BSSvSecondCallBack; pMgmt->sTimerSecondCallback.function = (TimerFunction)BSSvSecondCallBack;
pMgmt->sTimerSecondCallback.expires = RUN_AT(HZ); pMgmt->sTimerSecondCallback.expires = RUN_AT(HZ);
init_timer(&pDevice->sTimerCommand);
pDevice->sTimerCommand.data = (unsigned long)pDevice;
pDevice->sTimerCommand.function = (TimerFunction)vRunCommand;
pDevice->sTimerCommand.expires = RUN_AT(HZ);
init_timer(&pDevice->sTimerTxData); init_timer(&pDevice->sTimerTxData);
pDevice->sTimerTxData.data = (unsigned long)pDevice; pDevice->sTimerTxData.data = (unsigned long)pDevice;
pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData; pDevice->sTimerTxData.function = (TimerFunction)BSSvSecondTxData;
...@@ -844,8 +839,8 @@ static void s_vMgrRxAssocResponse(struct vnt_private *pDevice, ...@@ -844,8 +839,8 @@ static void s_vMgrRxAssocResponse(struct vnt_private *pDevice,
pDevice->bwextstep3 = false; pDevice->bwextstep3 = false;
pDevice->bWPASuppWextEnabled = false; pDevice->bWPASuppWextEnabled = false;
if(pMgmt->eCurrState == WMAC_STATE_ASSOC) if (pMgmt->eCurrState == WMAC_STATE_ASSOC)
timer_expire(pDevice->sTimerCommand, 0); schedule_delayed_work(&pDevice->run_command_work, 0);
return; return;
} }
...@@ -1127,7 +1122,7 @@ static void s_vMgrRxAuthenSequence_2(struct vnt_private *pDevice, ...@@ -1127,7 +1122,7 @@ static void s_vMgrRxAuthenSequence_2(struct vnt_private *pDevice,
if ( cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS ){ if ( cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS ){
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (OPEN) Successful.\n"); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (OPEN) Successful.\n");
pMgmt->eCurrState = WMAC_STATE_AUTH; pMgmt->eCurrState = WMAC_STATE_AUTH;
timer_expire(pDevice->sTimerCommand, 0); schedule_delayed_work(&pDevice->run_command_work, 0);
} }
else { else {
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (OPEN) Failed.\n"); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (OPEN) Failed.\n");
...@@ -1302,7 +1297,7 @@ static void s_vMgrRxAuthenSequence_4(struct vnt_private *pDevice, ...@@ -1302,7 +1297,7 @@ static void s_vMgrRxAuthenSequence_4(struct vnt_private *pDevice,
if ( cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS ){ if ( cpu_to_le16((*(pFrame->pwStatus))) == WLAN_MGMT_STATUS_SUCCESS ){
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Successful.\n"); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Successful.\n");
pMgmt->eCurrState = WMAC_STATE_AUTH; pMgmt->eCurrState = WMAC_STATE_AUTH;
timer_expire(pDevice->sTimerCommand, 0); schedule_delayed_work(&pDevice->run_command_work, 0);
} }
else{ else{
DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Failed.\n"); DBG_PRT(MSG_LEVEL_INFO, KERN_INFO "802.11 Authen (SHAREDKEY) Failed.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment