brcm80211: smac: remove skb next pointer usage from the driver
In two places the next pointer was used to process a sk_buff chain but it will always get a single sk_buff so this has been removed. Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Родитель
0b45bf74f9
Коммит
3030794fca
|
@ -1239,10 +1239,9 @@ bool dma_rxreset(struct dma_pub *pub)
|
||||||
* the error(toss frames) could be fatal and cause many subsequent hard
|
* the error(toss frames) could be fatal and cause many subsequent hard
|
||||||
* to debug problems
|
* to debug problems
|
||||||
*/
|
*/
|
||||||
int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
|
int dma_txfast(struct dma_pub *pub, struct sk_buff *p, bool commit)
|
||||||
{
|
{
|
||||||
struct dma_info *di = (struct dma_info *)pub;
|
struct dma_info *di = (struct dma_info *)pub;
|
||||||
struct sk_buff *p, *next;
|
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
uint len;
|
uint len;
|
||||||
u16 txout;
|
u16 txout;
|
||||||
|
@ -1254,50 +1253,37 @@ int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
|
||||||
txout = di->txout;
|
txout = di->txout;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Walk the chain of packet buffers
|
* obtain and initialize transmit descriptor entry.
|
||||||
* allocating and initializing transmit descriptor entries.
|
|
||||||
*/
|
*/
|
||||||
for (p = p0; p; p = next) {
|
data = p->data;
|
||||||
data = p->data;
|
len = p->len;
|
||||||
len = p->len;
|
|
||||||
next = p->next;
|
|
||||||
|
|
||||||
/* return nonzero if out of tx descriptors */
|
/* no use to transmit a zero length packet */
|
||||||
if (nexttxd(di, txout) == di->txin)
|
if (len == 0)
|
||||||
goto outoftxd;
|
return 0;
|
||||||
|
|
||||||
if (len == 0)
|
/* return nonzero if out of tx descriptors */
|
||||||
continue;
|
if (nexttxd(di, txout) == di->txin)
|
||||||
|
goto outoftxd;
|
||||||
|
|
||||||
/* get physical address of buffer start */
|
/* get physical address of buffer start */
|
||||||
pa = pci_map_single(di->pbus, data, len, PCI_DMA_TODEVICE);
|
pa = pci_map_single(di->pbus, data, len, PCI_DMA_TODEVICE);
|
||||||
|
|
||||||
flags = 0;
|
/* With a DMA segment list, Descriptor table is filled
|
||||||
if (p == p0)
|
* using the segment list instead of looping over
|
||||||
flags |= D64_CTRL1_SOF;
|
* buffers in multi-chain DMA. Therefore, EOF for SGLIST
|
||||||
|
* is when end of segment list is reached.
|
||||||
|
*/
|
||||||
|
flags = D64_CTRL1_SOF | D64_CTRL1_IOC | D64_CTRL1_EOF;
|
||||||
|
if (txout == (di->ntxd - 1))
|
||||||
|
flags |= D64_CTRL1_EOT;
|
||||||
|
|
||||||
/* With a DMA segment list, Descriptor table is filled
|
dma64_dd_upd(di, di->txd64, pa, txout, &flags, len);
|
||||||
* using the segment list instead of looping over
|
|
||||||
* buffers in multi-chain DMA. Therefore, EOF for SGLIST
|
|
||||||
* is when end of segment list is reached.
|
|
||||||
*/
|
|
||||||
if (next == NULL)
|
|
||||||
flags |= (D64_CTRL1_IOC | D64_CTRL1_EOF);
|
|
||||||
if (txout == (di->ntxd - 1))
|
|
||||||
flags |= D64_CTRL1_EOT;
|
|
||||||
|
|
||||||
dma64_dd_upd(di, di->txd64, pa, txout, &flags, len);
|
txout = nexttxd(di, txout);
|
||||||
|
|
||||||
txout = nexttxd(di, txout);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* if last txd eof not set, fix it */
|
|
||||||
if (!(flags & D64_CTRL1_EOF))
|
|
||||||
di->txd64[prevtxd(di, txout)].ctrl1 =
|
|
||||||
cpu_to_le32(flags | D64_CTRL1_IOC | D64_CTRL1_EOF);
|
|
||||||
|
|
||||||
/* save the packet */
|
/* save the packet */
|
||||||
di->txp[prevtxd(di, txout)] = p0;
|
di->txp[prevtxd(di, txout)] = p;
|
||||||
|
|
||||||
/* bump the tx descriptor index */
|
/* bump the tx descriptor index */
|
||||||
di->txout = txout;
|
di->txout = txout;
|
||||||
|
@ -1314,7 +1300,7 @@ int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
|
||||||
|
|
||||||
outoftxd:
|
outoftxd:
|
||||||
DMA_ERROR("%s: out of txds !!!\n", di->name);
|
DMA_ERROR("%s: out of txds !!!\n", di->name);
|
||||||
brcmu_pkt_buf_free_skb(p0);
|
brcmu_pkt_buf_free_skb(p);
|
||||||
di->dma.txavail = 0;
|
di->dma.txavail = 0;
|
||||||
di->dma.txnobuf++;
|
di->dma.txnobuf++;
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -955,8 +955,6 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
|
||||||
brcms_c_txfifo_complete(wlc, queue, 1);
|
brcms_c_txfifo_complete(wlc, queue, 1);
|
||||||
|
|
||||||
if (lastframe) {
|
if (lastframe) {
|
||||||
p->next = NULL;
|
|
||||||
p->prev = NULL;
|
|
||||||
/* remove PLCP & Broadcom tx descriptor header */
|
/* remove PLCP & Broadcom tx descriptor header */
|
||||||
skb_pull(p, D11_PHY_HDR_LEN);
|
skb_pull(p, D11_PHY_HDR_LEN);
|
||||||
skb_pull(p, D11_TXH_LEN);
|
skb_pull(p, D11_TXH_LEN);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче