staging: vt6656: convert RXvWorkItem to work queue
Tasklet to workqueue. ReadWorkItem -> read_work_item Reduce atomic area of driver. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bd9a6dbada
commit
81d720d315
@ -384,7 +384,7 @@ struct vnt_private {
|
|||||||
|
|
||||||
struct tasklet_struct CmdWorkItem;
|
struct tasklet_struct CmdWorkItem;
|
||||||
struct tasklet_struct EventWorkItem;
|
struct tasklet_struct EventWorkItem;
|
||||||
struct tasklet_struct ReadWorkItem;
|
struct work_struct read_work_item;
|
||||||
struct tasklet_struct RxMngWorkItem;
|
struct tasklet_struct RxMngWorkItem;
|
||||||
|
|
||||||
u32 rx_buf_sz;
|
u32 rx_buf_sz;
|
||||||
|
@ -1332,8 +1332,10 @@ static int s_bAPModeRxData(struct vnt_private *pDevice, struct sk_buff *skb,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RXvWorkItem(struct vnt_private *pDevice)
|
void RXvWorkItem(struct work_struct *work)
|
||||||
{
|
{
|
||||||
|
struct vnt_private *pDevice =
|
||||||
|
container_of(work, struct vnt_private, read_work_item);
|
||||||
int ntStatus;
|
int ntStatus;
|
||||||
struct vnt_rcb *pRCB = NULL;
|
struct vnt_rcb *pRCB = NULL;
|
||||||
|
|
||||||
@ -1383,7 +1385,7 @@ void RXvFreeRCB(struct vnt_rcb *pRCB, int bReAllocSkb)
|
|||||||
(pDevice->bIsRxWorkItemQueued == false) ) {
|
(pDevice->bIsRxWorkItemQueued == false) ) {
|
||||||
|
|
||||||
pDevice->bIsRxWorkItemQueued = true;
|
pDevice->bIsRxWorkItemQueued = true;
|
||||||
tasklet_schedule(&pDevice->ReadWorkItem);
|
schedule_work(&pDevice->read_work_item);
|
||||||
}
|
}
|
||||||
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----RXFreeRCB %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList);
|
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----RXFreeRCB %d %d\n",pDevice->NumRecvFreeList, pDevice->NumRecvMngList);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "wcmd.h"
|
#include "wcmd.h"
|
||||||
|
|
||||||
void RXvWorkItem(void *Context);
|
void RXvWorkItem(struct work_struct *work);
|
||||||
|
|
||||||
void RXvMngWorkItem(void *Context);
|
void RXvMngWorkItem(void *Context);
|
||||||
|
|
||||||
|
@ -704,6 +704,7 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
|
|||||||
spin_lock_init(&pDevice->lock);
|
spin_lock_init(&pDevice->lock);
|
||||||
INIT_DELAYED_WORK(&pDevice->run_command_work, vRunCommand);
|
INIT_DELAYED_WORK(&pDevice->run_command_work, vRunCommand);
|
||||||
INIT_DELAYED_WORK(&pDevice->second_callback_work, BSSvSecondCallBack);
|
INIT_DELAYED_WORK(&pDevice->second_callback_work, BSSvSecondCallBack);
|
||||||
|
INIT_WORK(&pDevice->read_work_item, RXvWorkItem);
|
||||||
|
|
||||||
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;
|
||||||
@ -984,7 +985,6 @@ static int device_open(struct net_device *dev)
|
|||||||
|
|
||||||
vMgrObjectInit(pDevice);
|
vMgrObjectInit(pDevice);
|
||||||
tasklet_init(&pDevice->RxMngWorkItem, (void *)RXvMngWorkItem, (unsigned long)pDevice);
|
tasklet_init(&pDevice->RxMngWorkItem, (void *)RXvMngWorkItem, (unsigned long)pDevice);
|
||||||
tasklet_init(&pDevice->ReadWorkItem, (void *)RXvWorkItem, (unsigned long)pDevice);
|
|
||||||
tasklet_init(&pDevice->EventWorkItem, (void *)INTvWorkItem, (unsigned long)pDevice);
|
tasklet_init(&pDevice->EventWorkItem, (void *)INTvWorkItem, (unsigned long)pDevice);
|
||||||
|
|
||||||
schedule_delayed_work(&pDevice->second_callback_work, HZ);
|
schedule_delayed_work(&pDevice->second_callback_work, HZ);
|
||||||
@ -1004,7 +1004,7 @@ static int device_open(struct net_device *dev)
|
|||||||
pDevice->bWPASuppWextEnabled = false;
|
pDevice->bWPASuppWextEnabled = false;
|
||||||
pDevice->byReAssocCount = 0;
|
pDevice->byReAssocCount = 0;
|
||||||
|
|
||||||
RXvWorkItem(pDevice);
|
schedule_work(&pDevice->read_work_item);
|
||||||
INTvWorkItem(pDevice);
|
INTvWorkItem(pDevice);
|
||||||
|
|
||||||
/* if WEP key already set by iwconfig but device not yet open */
|
/* if WEP key already set by iwconfig but device not yet open */
|
||||||
@ -1092,7 +1092,9 @@ static int device_close(struct net_device *dev)
|
|||||||
del_timer(&pDevice->TimerSQ3Tmax3);
|
del_timer(&pDevice->TimerSQ3Tmax3);
|
||||||
}
|
}
|
||||||
tasklet_kill(&pDevice->RxMngWorkItem);
|
tasklet_kill(&pDevice->RxMngWorkItem);
|
||||||
tasklet_kill(&pDevice->ReadWorkItem);
|
|
||||||
|
cancel_work_sync(&pDevice->read_work_item);
|
||||||
|
|
||||||
tasklet_kill(&pDevice->EventWorkItem);
|
tasklet_kill(&pDevice->EventWorkItem);
|
||||||
|
|
||||||
pDevice->bRoaming = false;
|
pDevice->bRoaming = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user