summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2011-11-10 20:30:31 +0100
committerJohn W. Linville <linville@tuxdriver.com>2011-11-11 14:28:44 -0500
commit046808daf9f6b8c5275861330d4f8c2e6cfe3c31 (patch)
tree08e7c7f80cbd0f4070d719d663905bf9ffdcc0ac /drivers/net/wireless
parent53ee4bc46784ad53d0a9be52e8d687dd4e89a055 (diff)
downloadlinux-046808daf9f6b8c5275861330d4f8c2e6cfe3c31.tar.gz
linux-046808daf9f6b8c5275861330d4f8c2e6cfe3c31.tar.bz2
linux-046808daf9f6b8c5275861330d4f8c2e6cfe3c31.zip
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: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Alwin Beukers <alwin@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index c406b46b6905..d8a521ae45da 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -1119,6 +1119,16 @@ static uint brcmf_sdbrcm_glom_len(struct brcmf_bus *bus)
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)
{
u16 dlen, totlen;
@@ -1203,11 +1213,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
}
pfirst = pnext = NULL;
} else {
- if (!skb_queue_empty(&bus->glom))
- skb_queue_walk_safe(&bus->glom, pfirst, pnext) {
- skb_unlink(pfirst, &bus->glom);
- brcmu_pkt_buf_free_skb(pfirst);
- }
+ brcmf_sdbrcm_free_glom(bus);
num = 0;
}
@@ -1274,10 +1280,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
bus->glomerr = 0;
brcmf_sdbrcm_rxfail(bus, true, false);
bus->rxglomfail++;
- skb_queue_walk_safe(&bus->glom, pfirst, pnext) {
- skb_unlink(pfirst, &bus->glom);
- brcmu_pkt_buf_free_skb(pfirst);
- }
+ brcmf_sdbrcm_free_glom(bus);
}
return 0;
}
@@ -1399,10 +1402,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
bus->glomerr = 0;
brcmf_sdbrcm_rxfail(bus, true, false);
bus->rxglomfail++;
- skb_queue_walk_safe(&bus->glom, pfirst, pnext) {
- skb_unlink(pfirst, &bus->glom);
- brcmu_pkt_buf_free_skb(pfirst);
- }
+ brcmf_sdbrcm_free_glom(bus);
}
bus->nextlen = 0;
return 0;
@@ -3369,8 +3369,6 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus)
u8 saveclk;
uint retries;
int err;
- struct sk_buff *cur;
- struct sk_buff *next;
brcmf_dbg(TRACE, "Enter\n");
@@ -3430,11 +3428,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus)
/* Clear any held glomming stuff */
if (bus->glomd)
brcmu_pkt_buf_free_skb(bus->glomd);
- if (!skb_queue_empty(&bus->glom))
- skb_queue_walk_safe(&bus->glom, cur, next) {
- skb_unlink(cur, &bus->glom);
- brcmu_pkt_buf_free_skb(cur);
- }
+ brcmf_sdbrcm_free_glom(bus);
/* Clear rx control and wake any waiters */
bus->rxlen = 0;