staging: r8712u: Merging Realtek's latest (v2.6.6). Tx-code refactoring.
Refactor the TX code to prepare for aggregation. Signed-off-by: Ali Bahar <ali@internetDog.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c13b6f2498
commit
07a6b03707
@ -423,31 +423,31 @@ int r8712_xmitframe_complete(struct _adapter *padapter,
|
|||||||
if (!pxmitbuf)
|
if (!pxmitbuf)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
do {
|
/* 1st frame dequeued */
|
||||||
pxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry);
|
pxmitframe = dequeue_xframe_ex(pxmitpriv, phwxmits, hwentry);
|
||||||
if (pxmitframe) {
|
/* need to remember the 1st frame */
|
||||||
pxmitframe->pxmitbuf = pxmitbuf;
|
if (pxmitframe != NULL) {
|
||||||
pxmitframe->pxmit_urb[0] = pxmitbuf->pxmit_urb[0];
|
|
||||||
pxmitframe->buf_addr = pxmitbuf->pbuf;
|
|
||||||
if (pxmitframe->frame_tag == DATA_FRAMETAG) {
|
xmitframe_xmitbuf_attach(pxmitframe, pxmitbuf);
|
||||||
if (pxmitframe->attrib.priority <= 15)
|
if (pxmitframe->frame_tag == DATA_FRAMETAG) {
|
||||||
res = r8712_xmitframe_coalesce(padapter,
|
if (pxmitframe->attrib.priority <= 15)
|
||||||
pxmitframe->pkt, pxmitframe);
|
res = r8712_xmitframe_coalesce(padapter,
|
||||||
/* always return ndis_packet after
|
pxmitframe->pkt, pxmitframe);
|
||||||
* r8712_xmitframe_coalesce */
|
/* always return ndis_packet after
|
||||||
r8712_xmit_complete(padapter, pxmitframe);
|
* r8712_xmitframe_coalesce */
|
||||||
}
|
r8712_xmit_complete(padapter, pxmitframe);
|
||||||
if (res == _SUCCESS)
|
|
||||||
dump_xframe(padapter, pxmitframe);
|
|
||||||
else
|
|
||||||
r8712_free_xmitframe_ex(pxmitpriv, pxmitframe);
|
|
||||||
xcnt++;
|
|
||||||
} else {
|
|
||||||
r8712_free_xmitbuf(pxmitpriv, pxmitbuf);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
break;
|
if (res == _SUCCESS)
|
||||||
} while (0);
|
dump_xframe(padapter, pxmitframe);
|
||||||
|
else
|
||||||
|
r8712_free_xmitframe_ex(pxmitpriv, pxmitframe);
|
||||||
|
xcnt++;
|
||||||
|
|
||||||
|
} else { /* pxmitframe == NULL && p2ndxmitframe == NULL */
|
||||||
|
r8712_free_xmitbuf(pxmitpriv, pxmitbuf);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1011,6 +1011,19 @@ static void init_hwxmits(struct hw_xmit *phwxmit, sint entry)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xmitframe_xmitbuf_attach(struct xmit_frame *pxmitframe,
|
||||||
|
struct xmit_buf *pxmitbuf)
|
||||||
|
{
|
||||||
|
/* pxmitbuf attach to pxmitframe */
|
||||||
|
pxmitframe->pxmitbuf = pxmitbuf;
|
||||||
|
/* urb and irp connection */
|
||||||
|
pxmitframe->pxmit_urb[0] = pxmitbuf->pxmit_urb[0];
|
||||||
|
/* buffer addr assoc */
|
||||||
|
pxmitframe->buf_addr = pxmitbuf->pbuf;
|
||||||
|
/* pxmitframe attach to pxmitbuf */
|
||||||
|
pxmitbuf->priv_data = pxmitframe;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* tx_action == 0 == no frames to transmit
|
* tx_action == 0 == no frames to transmit
|
||||||
* tx_action > 0 ==> we have frames to transmit
|
* tx_action > 0 ==> we have frames to transmit
|
||||||
@ -1042,9 +1055,7 @@ int r8712_pre_xmit(struct _adapter *padapter, struct xmit_frame *pxmitframe)
|
|||||||
} else { /*dump packet directly*/
|
} else { /*dump packet directly*/
|
||||||
spin_unlock_irqrestore(&pxmitpriv->lock, irqL);
|
spin_unlock_irqrestore(&pxmitpriv->lock, irqL);
|
||||||
ret = true;
|
ret = true;
|
||||||
pxmitframe->pxmitbuf = pxmitbuf;
|
xmitframe_xmitbuf_attach(pxmitframe, pxmitbuf);
|
||||||
pxmitframe->pxmit_urb[0] = pxmitbuf->pxmit_urb[0];
|
|
||||||
pxmitframe->buf_addr = pxmitbuf->pbuf;
|
|
||||||
r8712_xmit_direct(padapter, pxmitframe);
|
r8712_xmit_direct(padapter, pxmitframe);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -135,7 +135,9 @@ struct xmit_buf {
|
|||||||
|
|
||||||
u8 *pallocated_buf;
|
u8 *pallocated_buf;
|
||||||
u8 *pbuf;
|
u8 *pbuf;
|
||||||
|
void *priv_data;
|
||||||
struct urb *pxmit_urb[8];
|
struct urb *pxmit_urb[8];
|
||||||
|
u32 aggr_nr;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct xmit_frame {
|
struct xmit_frame {
|
||||||
@ -280,6 +282,9 @@ int r8712_xmit_enqueue(struct _adapter *padapter,
|
|||||||
int r8712_xmit_direct(struct _adapter *padapter, struct xmit_frame *pxmitframe);
|
int r8712_xmit_direct(struct _adapter *padapter, struct xmit_frame *pxmitframe);
|
||||||
void r8712_xmit_bh(void *priv);
|
void r8712_xmit_bh(void *priv);
|
||||||
|
|
||||||
|
void xmitframe_xmitbuf_attach(struct xmit_frame *pxmitframe,
|
||||||
|
struct xmit_buf *pxmitbuf);
|
||||||
|
|
||||||
#include "rtl8712_xmit.h"
|
#include "rtl8712_xmit.h"
|
||||||
|
|
||||||
#endif /*_RTL871X_XMIT_H_*/
|
#endif /*_RTL871X_XMIT_H_*/
|
||||||
|
Reference in New Issue
Block a user