Commit 068ce7d0 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: dead code remove RXvWorkItem and RXvFreeRCB

Remove work_struct and queue variables

Remove EnqueueRCB and DequeueRCB macros
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8cffb3cf
...@@ -289,8 +289,6 @@ struct vnt_private { ...@@ -289,8 +289,6 @@ struct vnt_private {
struct usb_device *usb; struct usb_device *usb;
struct net_device_stats stats; struct net_device_stats stats;
struct work_struct read_work_item;
u64 tsf_time; u64 tsf_time;
u8 rx_rate; u8 rx_rate;
...@@ -308,14 +306,8 @@ struct vnt_private { ...@@ -308,14 +306,8 @@ struct vnt_private {
u32 int_interval; u32 int_interval;
/* Variables to track resources for the BULK In Pipe */ /* Variables to track resources for the BULK In Pipe */
struct vnt_rcb *pRCBMem;
struct vnt_rcb *apRCB[CB_MAX_RX_DESC]; struct vnt_rcb *apRCB[CB_MAX_RX_DESC];
u32 cbRD; u32 cbRD;
struct vnt_rcb *FirstRecvFreeList;
struct vnt_rcb *LastRecvFreeList;
u32 NumRecvFreeList;
int bIsRxWorkItemQueued;
/* Variables to track resources for the BULK Out Pipe */ /* Variables to track resources for the BULK Out Pipe */
struct vnt_usb_send_context *apTD[CB_MAX_TX_DESC]; struct vnt_usb_send_context *apTD[CB_MAX_TX_DESC];
...@@ -448,27 +440,6 @@ struct vnt_private { ...@@ -448,27 +440,6 @@ struct vnt_private {
struct iw_statistics wstats; /* wireless stats */ struct iw_statistics wstats; /* wireless stats */
}; };
#define EnqueueRCB(_Head, _Tail, _RCB) \
{ \
if (!_Head) { \
_Head = _RCB; \
} \
else { \
_Tail->Next = _RCB; \
} \
_RCB->Next = NULL; \
_Tail = _RCB; \
}
#define DequeueRCB(Head, Tail) \
{ \
struct vnt_rcb *RCB = Head; \
if (!RCB->Next) { \
Tail = NULL; \
} \
Head = RCB->Next; \
}
#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \ #define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) { \
if ((uVar) >= ((uModulo) - 1)) \ if ((uVar) >= ((uModulo) - 1)) \
(uVar) = 0; \ (uVar) = 0; \
......
...@@ -44,74 +44,6 @@ ...@@ -44,74 +44,6 @@
#include "rf.h" #include "rf.h"
#include "usbpipe.h" #include "usbpipe.h"
//static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO;
void RXvWorkItem(struct work_struct *work)
{
struct vnt_private *priv =
container_of(work, struct vnt_private, read_work_item);
int status;
struct vnt_rcb *rcb = NULL;
unsigned long flags;
if (priv->Flags & fMP_DISCONNECTED)
return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->Rx Polling Thread\n");
spin_lock_irqsave(&priv->lock, flags);
while ((priv->Flags & fMP_POST_READS) && MP_IS_READY(priv) &&
(priv->NumRecvFreeList != 0)) {
rcb = priv->FirstRecvFreeList;
priv->NumRecvFreeList--;
DequeueRCB(priv->FirstRecvFreeList, priv->LastRecvFreeList);
status = PIPEnsBulkInUsbRead(priv, rcb);
}
priv->bIsRxWorkItemQueued = false;
spin_unlock_irqrestore(&priv->lock, flags);
}
void RXvFreeRCB(struct vnt_rcb *rcb, int re_alloc_skb)
{
struct vnt_private *priv = rcb->pDevice;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->RXvFreeRCB\n");
if (re_alloc_skb == false) {
kfree_skb(rcb->skb);
re_alloc_skb = true;
}
if (re_alloc_skb == true) {
rcb->skb = dev_alloc_skb(priv->rx_buf_sz);
/* TODO error handling */
if (!rcb->skb) {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR
" Failed to re-alloc rx skb\n");
}
}
/* Insert the RCB back in the Recv free list */
EnqueueRCB(priv->FirstRecvFreeList, priv->LastRecvFreeList, rcb);
priv->NumRecvFreeList++;
if ((priv->Flags & fMP_POST_READS) && MP_IS_READY(priv) &&
(priv->bIsRxWorkItemQueued == false)) {
priv->bIsRxWorkItemQueued = true;
schedule_work(&priv->read_work_item);
}
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"<----RXFreeRCB %d\n",
priv->NumRecvFreeList);
}
int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb, int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb *ptr_rcb,
unsigned long bytes_received) unsigned long bytes_received)
{ {
......
...@@ -1104,7 +1104,6 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id) ...@@ -1104,7 +1104,6 @@ vt6656_probe(struct usb_interface *intf, const struct usb_device_id *id)
mutex_init(&priv->usb_lock); mutex_init(&priv->usb_lock);
INIT_DELAYED_WORK(&priv->run_command_work, vRunCommand); INIT_DELAYED_WORK(&priv->run_command_work, vRunCommand);
INIT_WORK(&priv->read_work_item, RXvWorkItem);
usb_set_intfdata(intf, priv); usb_set_intfdata(intf, priv);
......
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