提交 046808da 编写于 作者: A Arend van Spriel 提交者: John W. Linville

brcm80211: fmac: add function to free the glom skb queue

In several places in dhd_sdio.c a skb packet queue was being emptied
and the packets freed. This warrants to have a function in place to
do this.
Reviewed-by: NPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: NAlwin Beukers <alwin@broadcom.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 53ee4bc4
...@@ -1119,6 +1119,16 @@ static uint brcmf_sdbrcm_glom_len(struct brcmf_bus *bus) ...@@ -1119,6 +1119,16 @@ static uint brcmf_sdbrcm_glom_len(struct brcmf_bus *bus)
return total; return total;
} }
static void brcmf_sdbrcm_free_glom(struct brcmf_bus *bus)
{
struct sk_buff *cur, *next;
skb_queue_walk_safe(&bus->glom, cur, next) {
skb_unlink(cur, &bus->glom);
brcmu_pkt_buf_free_skb(cur);
}
}
static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
{ {
u16 dlen, totlen; u16 dlen, totlen;
...@@ -1203,11 +1213,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) ...@@ -1203,11 +1213,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
} }
pfirst = pnext = NULL; pfirst = pnext = NULL;
} else { } else {
if (!skb_queue_empty(&bus->glom)) brcmf_sdbrcm_free_glom(bus);
skb_queue_walk_safe(&bus->glom, pfirst, pnext) {
skb_unlink(pfirst, &bus->glom);
brcmu_pkt_buf_free_skb(pfirst);
}
num = 0; num = 0;
} }
...@@ -1274,10 +1280,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) ...@@ -1274,10 +1280,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
bus->glomerr = 0; bus->glomerr = 0;
brcmf_sdbrcm_rxfail(bus, true, false); brcmf_sdbrcm_rxfail(bus, true, false);
bus->rxglomfail++; bus->rxglomfail++;
skb_queue_walk_safe(&bus->glom, pfirst, pnext) { brcmf_sdbrcm_free_glom(bus);
skb_unlink(pfirst, &bus->glom);
brcmu_pkt_buf_free_skb(pfirst);
}
} }
return 0; return 0;
} }
...@@ -1399,10 +1402,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) ...@@ -1399,10 +1402,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
bus->glomerr = 0; bus->glomerr = 0;
brcmf_sdbrcm_rxfail(bus, true, false); brcmf_sdbrcm_rxfail(bus, true, false);
bus->rxglomfail++; bus->rxglomfail++;
skb_queue_walk_safe(&bus->glom, pfirst, pnext) { brcmf_sdbrcm_free_glom(bus);
skb_unlink(pfirst, &bus->glom);
brcmu_pkt_buf_free_skb(pfirst);
}
} }
bus->nextlen = 0; bus->nextlen = 0;
return 0; return 0;
...@@ -3369,8 +3369,6 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus) ...@@ -3369,8 +3369,6 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus)
u8 saveclk; u8 saveclk;
uint retries; uint retries;
int err; int err;
struct sk_buff *cur;
struct sk_buff *next;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
...@@ -3430,11 +3428,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus) ...@@ -3430,11 +3428,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus)
/* Clear any held glomming stuff */ /* Clear any held glomming stuff */
if (bus->glomd) if (bus->glomd)
brcmu_pkt_buf_free_skb(bus->glomd); brcmu_pkt_buf_free_skb(bus->glomd);
if (!skb_queue_empty(&bus->glom)) brcmf_sdbrcm_free_glom(bus);
skb_queue_walk_safe(&bus->glom, cur, next) {
skb_unlink(cur, &bus->glom);
brcmu_pkt_buf_free_skb(cur);
}
/* Clear rx control and wake any waiters */ /* Clear rx control and wake any waiters */
bus->rxlen = 0; bus->rxlen = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册