Commit 2cb8ada6 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: replaced PKTSETLEN macro by native __skb_trim call

- removed PKTSETLEN macro and used __skb_trim call instead.
- removed unused macros PKTSETPOOL and PKTPOOL
Reviewed-by: default avatarHenry Ptasinski <henryp@broadcom.com>
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c303ecbd
...@@ -366,7 +366,7 @@ extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable); ...@@ -366,7 +366,7 @@ extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable);
ASSERT(PKTLEN((p)) >= ((len) + datalign)); \ ASSERT(PKTLEN((p)) >= ((len) + datalign)); \
if (datalign) \ if (datalign) \
skb_pull((p), datalign); \ skb_pull((p), datalign); \
PKTSETLEN((p), (len)); \ __skb_trim((p), (len)); \
} while (0) } while (0)
/* Limit on rounding up frames */ /* Limit on rounding up frames */
...@@ -3521,7 +3521,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) ...@@ -3521,7 +3521,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
prhex("Rx Subframe Data", dptr, dlen); prhex("Rx Subframe Data", dptr, dlen);
#endif #endif
PKTSETLEN(pfirst, sublen); __skb_trim(pfirst, sublen);
skb_pull(pfirst, doff); skb_pull(pfirst, doff);
if (PKTLEN(pfirst) == 0) { if (PKTLEN(pfirst) == 0) {
...@@ -4151,7 +4151,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -4151,7 +4151,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
prhex("Glom Data", PKTDATA(pkt), len); prhex("Glom Data", PKTDATA(pkt), len);
} }
#endif #endif
PKTSETLEN(pkt, len); __skb_trim(pkt, len);
ASSERT(doff == SDPCM_HDRLEN); ASSERT(doff == SDPCM_HDRLEN);
skb_pull(pkt, SDPCM_HDRLEN); skb_pull(pkt, SDPCM_HDRLEN);
bus->glomd = pkt; bus->glomd = pkt;
...@@ -4164,7 +4164,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -4164,7 +4164,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
} }
/* Fill in packet len and prio, deliver upward */ /* Fill in packet len and prio, deliver upward */
PKTSETLEN(pkt, len); __skb_trim(pkt, len);
skb_pull(pkt, doff); skb_pull(pkt, doff);
#ifdef SDTEST #ifdef SDTEST
......
...@@ -273,10 +273,7 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, ...@@ -273,10 +273,7 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
#define PKTNEXT(skb) (((struct sk_buff *)(skb))->next) #define PKTNEXT(skb) (((struct sk_buff *)(skb))->next)
#define PKTSETNEXT(skb, x) \ #define PKTSETNEXT(skb, x) \
(((struct sk_buff *)(skb))->next = (struct sk_buff *)(x)) (((struct sk_buff *)(skb))->next = (struct sk_buff *)(x))
#define PKTSETLEN(skb, len) __skb_trim((struct sk_buff *)(skb), (len))
#define PKTALLOCED(osh) (((struct osl_pubinfo *)(osh))->pktalloced) #define PKTALLOCED(osh) (((struct osl_pubinfo *)(osh))->pktalloced)
#define PKTSETPOOL(osh, skb, x, y) do {} while (0)
#define PKTPOOL(osh, skb) false
extern void *osl_pktget(struct osl_info *osh, uint len); extern void *osl_pktget(struct osl_info *osh, uint len);
extern void osl_pktfree(struct osl_info *osh, void *skb, bool send); extern void osl_pktfree(struct osl_info *osh, void *skb, bool send);
......
...@@ -7164,7 +7164,7 @@ wlc_recvctl(wlc_info_t *wlc, struct osl_info *osh, d11rxhdr_t *rxh, void *p) ...@@ -7164,7 +7164,7 @@ wlc_recvctl(wlc_info_t *wlc, struct osl_info *osh, d11rxhdr_t *rxh, void *p)
/* mac header+body length, exclude CRC and plcp header */ /* mac header+body length, exclude CRC and plcp header */
len_mpdu = PKTLEN(p) - D11_PHY_HDR_LEN - DOT11_FCS_LEN; len_mpdu = PKTLEN(p) - D11_PHY_HDR_LEN - DOT11_FCS_LEN;
skb_pull(p, D11_PHY_HDR_LEN); skb_pull(p, D11_PHY_HDR_LEN);
PKTSETLEN(p, len_mpdu); __skb_trim(p, len_mpdu);
ASSERT(!PKTNEXT(p)); ASSERT(!PKTNEXT(p));
ASSERT(!PKTLINK(p)); ASSERT(!PKTLINK(p));
......
...@@ -1003,7 +1003,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di) ...@@ -1003,7 +1003,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di)
/* set actual length */ /* set actual length */
pkt_len = min((di->rxoffset + len), di->rxbufsize); pkt_len = min((di->rxoffset + len), di->rxbufsize);
PKTSETLEN(head, pkt_len); __skb_trim(head, pkt_len);
resid = len - (di->rxbufsize - di->rxoffset); resid = len - (di->rxbufsize - di->rxoffset);
/* check for single or multi-buffer rx */ /* check for single or multi-buffer rx */
...@@ -1012,7 +1012,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di) ...@@ -1012,7 +1012,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di)
while ((resid > 0) && (p = _dma_getnextrxp(di, false))) { while ((resid > 0) && (p = _dma_getnextrxp(di, false))) {
PKTSETNEXT(tail, p); PKTSETNEXT(tail, p);
pkt_len = min(resid, (int)di->rxbufsize); pkt_len = min(resid, (int)di->rxbufsize);
PKTSETLEN(p, pkt_len); __skb_trim(p, pkt_len);
tail = p; tail = p;
resid -= di->rxbufsize; resid -= di->rxbufsize;
......
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