struct usb_device *usb;
struct net_device_stats stats;
- struct work_struct read_work_item;
-
u64 tsf_time;
u8 rx_rate;
u32 int_interval;
/* Variables to track resources for the BULK In Pipe */
- struct vnt_rcb *pRCBMem;
struct vnt_rcb *apRCB[CB_MAX_RX_DESC];
u32 cbRD;
- struct vnt_rcb *FirstRecvFreeList;
- struct vnt_rcb *LastRecvFreeList;
- u32 NumRecvFreeList;
-
- int bIsRxWorkItemQueued;
/* Variables to track resources for the BULK Out Pipe */
struct vnt_usb_send_context *apTD[CB_MAX_TX_DESC];
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) { \
if ((uVar) >= ((uModulo) - 1)) \
(uVar) = 0; \
#include "rf.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,
unsigned long bytes_received)
{