Commit 9a95e60e authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcm80211: util: move brcmu_pkttotlen() function to brcmfmac

The functions brcmu_pkttotlen() is only used in brcmfmac driver
so it has been moved there. It also does not use the sk_buff
next pointer anymore but walks a skb queue to determine the total
length.
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarAlwin Beukers <alwin@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 02a588a2
...@@ -1107,6 +1107,18 @@ static uint brcmf_sdbrcm_glom_from_buf(struct brcmf_bus *bus, uint len) ...@@ -1107,6 +1107,18 @@ static uint brcmf_sdbrcm_glom_from_buf(struct brcmf_bus *bus, uint len)
return ret; return ret;
} }
/* return total length of buffer chain */
static uint brcmf_sdbrcm_glom_len(struct brcmf_bus *bus)
{
struct sk_buff *p;
uint total;
total = 0;
skb_queue_walk(&bus->glom, p)
total += p->len;
return total;
}
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;
...@@ -1218,7 +1230,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq) ...@@ -1218,7 +1230,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
} }
pfirst = skb_peek(&bus->glom); pfirst = skb_peek(&bus->glom);
dlen = (u16) brcmu_pkttotlen(pfirst); dlen = (u16) brcmf_sdbrcm_glom_len(bus);
/* Do an SDIO read for the superframe. Configurable iovar to /* Do an SDIO read for the superframe. Configurable iovar to
* read directly into the chained packet, or allocate a large * read directly into the chained packet, or allocate a large
......
...@@ -66,19 +66,6 @@ void brcmu_pkt_buf_free_skb(struct sk_buff *skb) ...@@ -66,19 +66,6 @@ void brcmu_pkt_buf_free_skb(struct sk_buff *skb)
} }
EXPORT_SYMBOL(brcmu_pkt_buf_free_skb); EXPORT_SYMBOL(brcmu_pkt_buf_free_skb);
/* return total length of buffer chain */
uint brcmu_pkttotlen(struct sk_buff *p)
{
uint total;
total = 0;
for (; p; p = p->next)
total += p->len;
return total;
}
EXPORT_SYMBOL(brcmu_pkttotlen);
/* /*
* osl multiple-precedence packet queue * osl multiple-precedence packet queue
* hi_prec is always >= the number of the highest non-empty precedence * hi_prec is always >= the number of the highest non-empty precedence
......
...@@ -170,9 +170,6 @@ extern void brcmu_pktq_flush(struct pktq *pq, bool dir, ...@@ -170,9 +170,6 @@ extern void brcmu_pktq_flush(struct pktq *pq, bool dir,
bool (*fn)(struct sk_buff *, void *), void *arg); bool (*fn)(struct sk_buff *, void *), void *arg);
/* externs */ /* externs */
/* packet */
extern uint brcmu_pkttotlen(struct sk_buff *p);
/* ip address */ /* ip address */
struct ipv4_addr; struct ipv4_addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment