[PATCH 2/3] staging: brcm80211: replace PKTPUSH and PKTPULL macros with native skbuff calls

Arend van Spriel arend at broadcom.com
Wed Nov 17 14:39:36 UTC 2010


>From 1544d7c99b9d551833c20d1865066601f0d8e12c Mon Sep 17 00:00:00 2001
From: Arend van Spriel <arend at broadcom.com>
Date: Sat, 13 Nov 2010 16:07:23 +0100
Subject: [PATCH 2/3] staging: brcm80211: replace PKTPUSH and PKTPULL macros with native skbuff calls


Reviewed-by: Henry Ptasinski <henryp at broadcom.com>
Reviewed-by: Brett Rudley <brudley at broadcom.com>
Signed-off-by: Arend van Spriel <arend at broadcom.com>
---
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c  |    4 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   26 ++++++++++++------------
drivers/staging/brcm80211/include/linux_osl.h |    2 -
drivers/staging/brcm80211/sys/wlc_ampdu.c     |    8 +++---
drivers/staging/brcm80211/sys/wlc_mac80211.c  |   14 ++++++------
drivers/staging/brcm80211/util/hnddma.c       |    2 +-
6 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 0d14f6c..8e4e107 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -313,23 +313,23 @@ void dhd_prot_dump(dhd_pub_t *dhdp, struct bcmstrbuf *strbuf)
void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, void *pktbuf)
{
#ifdef BDC
struct bdc_header *h;
#endif				/* BDC */

DHD_TRACE(("%s: Entern", __func__));

#ifdef BDC
/* Push BDC header used to convey priority for buses that don't */

-	PKTPUSH(pktbuf, BDC_HEADER_LEN);
+	skb_push(pktbuf, BDC_HEADER_LEN);

h = (struct bdc_header *)PKTDATA(pktbuf);

h->flags = (BDC_PROTO_VER << BDC_FLAG_VER_SHIFT);
if (PKTSUMNEEDED(pktbuf))
h->flags |= BDC_FLAG_SUM_NEEDED;

h->priority = (PKTPRIO(pktbuf) & BDC_PRIORITY_MASK);
h->flags2 = 0;
h->rssi = 0;
#endif				/* BDC */
@@ -390,23 +390,23 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, void *pktbuf)
}

if (h->flags & BDC_FLAG_SUM_GOOD) {
DHD_INFO(("%s: BDC packet received with good rx-csum, "
"flags 0x%xn",
dhd_ifname(dhd, *ifidx), h->flags));
PKTSETSUMGOOD(pktbuf, true);
}

PKTSETPRIO(pktbuf, (h->priority & BDC_PRIORITY_MASK));

-	PKTPULL(pktbuf, BDC_HEADER_LEN);
+	skb_pull(pktbuf, BDC_HEADER_LEN);
#endif				/* BDC */

return 0;
}

int dhd_prot_attach(dhd_pub_t *dhd)
{
dhd_prot_t *cdc;

cdc = kzalloc(sizeof(dhd_prot_t), GFP_ATOMIC);
if (!cdc) {
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 66884d4..c822505 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -357,23 +357,23 @@ extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable);
#if defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD)
#error OOB_INTR_ONLY is NOT working with SDIO_ISR_THREAD
#endif	/* defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD) */
#define PKTALIGN(osh, p, len, align)					 	do {								 		uint datalign;						 		datalign = (unsigned long)PKTDATA((p));			 		datalign = roundup(datalign, (align)) - datalign;	 		ASSERT(datalign < (align));				 		ASSERT(PKTLEN((p)) >= ((len) + datalign));	 		if (datalign)						-			PKTPULL((p), datalign);			+			skb_pull((p), datalign);			 		PKTSETLEN((p), (len));				 	} while (0)

/* Limit on rounding up frames */
static const uint max_roundup = 512;

/* Try doing readahead */
static bool dhd_readahead;

/* To check if there's window offered */
#define DATAOK(bus) @@ -944,23 +944,23 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, void *pkt, uint chan, bool free_pkt)
PKTALIGN(osh, new, PKTLEN(pkt), DHD_SDALIGN);
bcopy(PKTDATA(pkt), PKTDATA(new), PKTLEN(pkt));
if (free_pkt)
PKTFREE(osh, pkt, true);
/* free the pkt if canned one is not used */
free_pkt = true;
pkt = new;
frame = (u8 *) PKTDATA(pkt);
ASSERT(((unsigned long)frame % DHD_SDALIGN) == 0);
pad = 0;
} else {
-			PKTPUSH(pkt, pad);
+			skb_push(pkt, pad);
frame = (u8 *) PKTDATA(pkt);

ASSERT((pad + SDPCM_HDRLEN) <= (int)PKTLEN(pkt));
bzero(frame, pad + SDPCM_HDRLEN);
}
}
ASSERT(pad < DHD_SDALIGN);

/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
len = (u16) PKTLEN(pkt);
*(u16 *) frame = htol16(len);
@@ -1043,23 +1043,23 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, void *pkt, uint chan, bool free_pkt)
break;
}

}
if (ret == 0)
bus->tx_seq = (bus->tx_seq + 1) % SDPCM_SEQUENCE_WRAP;

} while ((ret < 0) && retrydata && retries++ < TXRETRIES);

done:
/* restore pkt buffer pointer before calling tx complete routine */
-	PKTPULL(pkt, SDPCM_HDRLEN + pad);
+	skb_pull(pkt, SDPCM_HDRLEN + pad);
dhd_os_sdunlock(bus->dhd);
dhd_txcomplete(bus->dhd, pkt, ret != 0);
dhd_os_sdlock(bus->dhd);

if (free_pkt)
PKTFREE(osh, pkt, true);

return ret;
}

int dhd_bus_txdata(struct dhd_bus *bus, void *pkt)
@@ -1069,52 +1069,52 @@ int dhd_bus_txdata(struct dhd_bus *bus, void *pkt)
uint datalen, prec;

DHD_TRACE(("%s: Entern", __func__));

osh = bus->dhd->osh;
datalen = PKTLEN(pkt);

#ifdef SDTEST
/* Push the test header if doing loopback */
if (bus->ext_loop) {
u8 *data;
-		PKTPUSH(pkt, SDPCM_TEST_HDRLEN);
+		skb_push(pkt, SDPCM_TEST_HDRLEN);
data = PKTDATA(pkt);
*data++ = SDPCM_TEST_ECHOREQ;
*data++ = (u8) bus->loopid++;
*data++ = (datalen >> 0);
*data++ = (datalen >> 8);
datalen += SDPCM_TEST_HDRLEN;
}
#endif				/* SDTEST */

/* Add space for the header */
-	PKTPUSH(pkt, SDPCM_HDRLEN);
+	skb_push(pkt, SDPCM_HDRLEN);
ASSERT(IS_ALIGNED((unsigned long)PKTDATA(pkt), 2));

prec = PRIO2PREC((PKTPRIO(pkt) & PRIOMASK));

/* Check for existing queue, current flow-control,
pending event, or pending clock */
if (dhd_deferred_tx || bus->fcstate || pktq_len(&bus->txq)
|| bus->dpc_sched || (!DATAOK(bus))
|| (bus->flowcontrol & NBITVAL(prec))
|| (bus->clkstate != CLK_AVAIL)) {
DHD_TRACE(("%s: deferring pktq len %dn", __func__,
pktq_len(&bus->txq)));
bus->fcqueued++;

/* Priority based enq */
dhd_os_sdlock_txq(bus->dhd);
if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
-			PKTPULL(pkt, SDPCM_HDRLEN);
+			skb_pull(pkt, SDPCM_HDRLEN);
dhd_txcomplete(bus->dhd, pkt, false);
PKTFREE(osh, pkt, true);
DHD_ERROR(("%s: out of bus->txq !!!n", __func__));
ret = BCME_NORESOURCE;
} else {
ret = BCME_OK;
}
dhd_os_sdunlock_txq(bus->dhd);

if ((pktq_len(&bus->txq) >= FCHI) && dhd_doflow)
dhd_txflowcontrol(bus->dhd, 0, ON);
@@ -3417,23 +3417,23 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
}

/* Check window for sanity */
if ((u8) (txmax - bus->tx_seq) > 0x40) {
DHD_ERROR(("%s: unlikely tx max %d with tx_seq %dn",
__func__, txmax, bus->tx_seq));
txmax = bus->tx_seq + 2;
}
bus->tx_max = txmax;

/* Remove superframe header, remember offset */
-		PKTPULL(pfirst, doff);
+		skb_pull(pfirst, doff);
sfdoff = doff;

/* Validate all the subframe headers */
for (num = 0, pnext = pfirst; pnext && !errcode;
num++, pnext = PKTNEXT(pnext)) {
dptr = (u8 *) PKTDATA(pnext);
dlen = (u16) PKTLEN(pnext);
sublen = ltoh16_ua(dptr);
check = ltoh16_ua(dptr + sizeof(u16));
chan = SDPCM_PACKET_CHANNEL(&dptr[SDPCM_FRAMETAG_LEN]);
doff = SDPCM_DOFFSET_VALUE(&dptr[SDPCM_FRAMETAG_LEN]);
@@ -3462,23 +3462,23 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
__func__, num, doff, sublen,
SDPCM_HDRLEN));
errcode = -1;
}
}

if (errcode) {
/* Terminate frame on error, request
a couple retries */
if (bus->glomerr++ < 3) {
/* Restore superframe header space */
-				PKTPUSH(pfirst, sfdoff);
+				skb_push(pfirst, sfdoff);
dhdsdio_rxfail(bus, true, true);
} else {
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(osh, bus->glom, false);
dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
bus->nextlen = 0;
@@ -3513,23 +3513,23 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
DHD_GLOM(("%s: rx_seq %d, expected %dn",
__func__, seq, rxseq));
bus->rx_badseq++;
rxseq = seq;
}
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON())
prhex("Rx Subframe Data", dptr, dlen);
#endif

PKTSETLEN(pfirst, sublen);
-			PKTPULL(pfirst, doff);
+			skb_pull(pfirst, doff);

if (PKTLEN(pfirst) == 0) {
PKTFREE(bus->dhd->osh, pfirst, false);
if (plast) {
PKTSETNEXT(plast, pnext);
} else {
ASSERT(save_pfirst == pfirst);
save_pfirst = pnext;
}
continue;
} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pfirst) !=
@@ -4095,23 +4095,23 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
bus->dhd->rx_dropped++;
dhd_os_sdunlock_rxq(bus->dhd);
dhdsdio_rxfail(bus, false, RETRYCHAN(chan));
continue;
}
dhd_os_sdunlock_rxq(bus->dhd);

ASSERT(!PKTLINK(pkt));

/* Leave room for what we already read, and align remainder */
ASSERT(firstread < (PKTLEN(pkt)));
-		PKTPULL(pkt, firstread);
+		skb_pull(pkt, firstread);
PKTALIGN(osh, pkt, rdlen, DHD_SDALIGN);

/* Read the remaining frame data */
sdret =
dhd_bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
F2SYNC, ((u8 *) PKTDATA(pkt)), rdlen,
pkt, NULL, NULL);
bus->f2rxdata++;
ASSERT(sdret != BCME_PENDING);

if (sdret < 0) {
@@ -4123,56 +4123,56 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
? "data" : "test")),
sdret));
dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(bus->dhd->osh, pkt, false);
dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
continue;
}

/* Copy the already-read portion */
-		PKTPUSH(pkt, firstread);
+		skb_push(pkt, firstread);
bcopy(bus->rxhdr, PKTDATA(pkt), firstread);

#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON())
prhex("Rx Data", PKTDATA(pkt), len);
#endif

deliver:
/* Save superframe descriptor and allocate packet frame */
if (chan == SDPCM_GLOM_CHANNEL) {
if (SDPCM_GLOMDESC(&bus->rxhdr[SDPCM_FRAMETAG_LEN])) {
DHD_GLOM(("%s: glom descriptor, %d bytes:n",
__func__, len));
#ifdef DHD_DEBUG
if (DHD_GLOM_ON()) {
prhex("Glom Data", PKTDATA(pkt), len);
}
#endif
PKTSETLEN(pkt, len);
ASSERT(doff == SDPCM_HDRLEN);
-				PKTPULL(pkt, SDPCM_HDRLEN);
+				skb_pull(pkt, SDPCM_HDRLEN);
bus->glomd = pkt;
} else {
DHD_ERROR(("%s: glom superframe w/o "
"descriptor!n", __func__));
dhdsdio_rxfail(bus, false, false);
}
continue;
}

/* Fill in packet len and prio, deliver upward */
PKTSETLEN(pkt, len);
-		PKTPULL(pkt, doff);
+		skb_pull(pkt, doff);

#ifdef SDTEST
/* Test channel packets are processed separately */
if (chan == SDPCM_TEST_CHANNEL) {
dhdsdio_testrcv(bus, pkt, seq);
continue;
}
#endif				/* SDTEST */

if (PKTLEN(pkt) == 0) {
dhd_os_sdlock_rxq(bus->dhd);
diff --git a/drivers/staging/brcm80211/include/linux_osl.h b/drivers/staging/brcm80211/include/linux_osl.h
index 586e652..379c35a 100644
--- a/drivers/staging/brcm80211/include/linux_osl.h
+++ b/drivers/staging/brcm80211/include/linux_osl.h
@@ -274,24 +274,22 @@ extern void osl_dma_unmap(osl_t *osh, uint pa, uint size, int direction);
/* packet primitives */
#define	PKTGET(osh, len, send)		osl_pktget((osh), (len))
#define	PKTFREE(osh, skb, send)		osl_pktfree((osh), (skb), (send))
#define	PKTDATA(skb)		(((struct sk_buff *)(skb))->data)
#define	PKTLEN(skb)		(((struct sk_buff *)(skb))->len)
#define PKTHEADROOM(skb)		(PKTDATA(skb)-(((struct sk_buff *)(skb))->head))
#define PKTTAILROOM(skb) ((((struct sk_buff *)(skb))->end)-(((struct sk_buff *)(skb))->tail))
#define	PKTNEXT(skb)		(((struct sk_buff *)(skb))->next)
#define	PKTSETNEXT(skb, x)	 	(((struct sk_buff *)(skb))->next = (struct sk_buff *)(x))
#define	PKTSETLEN(skb, len)	__skb_trim((struct sk_buff *)(skb), (len))
-#define	PKTPUSH(skb, bytes)	skb_push((struct sk_buff *)(skb), (bytes))
-#define	PKTPULL(skb, bytes)	skb_pull((struct sk_buff *)(skb), (bytes))
#define PKTALLOCED(osh)		(((osl_pubinfo_t *)(osh))->pktalloced)
#define PKTSETPOOL(osh, skb, x, y)	do {} while (0)
#define PKTPOOL(osh, skb)		false
extern void *osl_pktget(osl_t *osh, uint len);
extern void osl_pktfree(osl_t *osh, void *skb, bool send);

#ifdef BRCM_FULLMAC
extern void *osl_pktget_static(osl_t *osh, uint len);
extern void osl_pktfree_static(osl_t *osh, void *skb, bool send);

static inline void *
diff --git a/drivers/staging/brcm80211/sys/wlc_ampdu.c b/drivers/staging/brcm80211/sys/wlc_ampdu.c
index 0bd7069..5d53973 100644
--- a/drivers/staging/brcm80211/sys/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/sys/wlc_ampdu.c
@@ -1179,24 +1179,24 @@ wlc_ampdu_dotxstatus_complete(ampdu_info_t *ampdu, struct scb *scb, void *p,

/* XXX TODO: Make these accurate. */
tx_info->status.ampdu_ack_len =
(txs->
status & TX_STATUS_FRM_RTX_MASK) >>
TX_STATUS_FRM_RTX_SHIFT;
tx_info->status.ampdu_len =
(txs->
status & TX_STATUS_FRM_RTX_MASK) >>
TX_STATUS_FRM_RTX_SHIFT;

-				PKTPULL(p, D11_PHY_HDR_LEN);
-				PKTPULL(p, D11_TXH_LEN);
+				skb_pull(p, D11_PHY_HDR_LEN);
+				skb_pull(p, D11_TXH_LEN);

ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw,
p);
ack_recd = true;
suc_mpdu++;
}
}
/* either retransmit or send bar if ack not recd */
if (!ack_recd) {
struct ieee80211_tx_rate *txrate =
tx_info->status.rates;
@@ -1205,24 +1205,24 @@ wlc_ampdu_dotxstatus_complete(ampdu_info_t *ampdu, struct scb *scb, void *p,
ini->tx_in_transit--;
/* Use high prededence for retransmit to give some punch */
/* wlc_txq_enq(wlc, scb, p, WLC_PRIO_TO_PREC(tid)); */
wlc_txq_enq(wlc, scb, p,
WLC_PRIO_TO_HI_PREC(tid));
} else {
/* Retry timeout */
ini->tx_in_transit--;
ieee80211_tx_info_clear_status(tx_info);
tx_info->flags |=
IEEE80211_TX_STAT_AMPDU_NO_BACK;
-				PKTPULL(p, D11_PHY_HDR_LEN);
-				PKTPULL(p, D11_TXH_LEN);
+				skb_pull(p, D11_PHY_HDR_LEN);
+				skb_pull(p, D11_TXH_LEN);
WL_ERROR(("%s: BA Timeout, seq %d, in_transit %dn", SHORTNAME, seq, ini->tx_in_transit));
ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw,
p);
}
}
tot_mpdu++;

/* break out if last packet of ampdu */
if (((mcl & TXC_AMPDU_MASK) >> TXC_AMPDU_SHIFT) ==
TXC_AMPDU_LAST)
break;
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index a9fa48a..e161ccb 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -5933,26 +5933,26 @@ wlc_d11hdrs_mac80211(wlc_info_t *wlc, struct ieee80211_hw *hw,
* in this case
*/
if (key) {
phylen += key->icv_len;
}

/* Get tx_info */
tx_info = IEEE80211_SKB_CB(p);
ASSERT(tx_info);

/* add PLCP */
-	plcp = PKTPUSH(p, D11_PHY_HDR_LEN);
+	plcp = skb_push(p, D11_PHY_HDR_LEN);

/* add Broadcom tx descriptor header */
-	txh = (d11txh_t *) PKTPUSH(p, D11_TXH_LEN);
+	txh = (d11txh_t *) skb_push(p, D11_TXH_LEN);
bzero((char *)txh, D11_TXH_LEN);

/* setup frameid */
if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
/* non-AP STA should never use BCMC queue */
ASSERT(queue != TX_BCMC_FIFO);
if (queue == TX_BCMC_FIFO) {
WL_ERROR(("wl%d: %s: ASSERT queue == TX_BCMC!n",
WLCWLUNIT(wlc), __func__));
frameid = bcmc_fid_generate(wlc, NULL, txh);
} else {
@@ -6881,24 +6881,24 @@ wlc_dotxstatus(wlc_info_t *wlc, tx_status_t *txs, u32 frm_tx2)

totlen = pkttotlen(osh, p);
free_pdu = true;

wlc_txfifo_complete(wlc, queue, 1);

if (lastframe) {
PKTSETNEXT(p, NULL);
PKTSETLINK(p, NULL);
wlc->txretried = 0;
/* remove PLCP & Broadcom tx descriptor header */
-		PKTPULL(p, D11_PHY_HDR_LEN);
-		PKTPULL(p, D11_TXH_LEN);
+		skb_pull(p, D11_PHY_HDR_LEN);
+		skb_pull(p, D11_TXH_LEN);
ieee80211_tx_status_irqsafe(wlc->pub->ieee_hw, p);
WLCNTINCR(wlc->pub->_cnt->ieee_tx_status);
} else {
WL_ERROR(("%s: Not last frame => not calling tx_statusn",
__func__));
}

return false;

fatal:
ASSERT(0);
@@ -7154,23 +7154,23 @@ wlc_recvctl(wlc_info_t *wlc, osl_t *osh, d11rxhdr_t *rxh, void *p)
/* Todo:
* Cache plcp for first MPDU of AMPD and use chacched version for INTERMEDIATE.
* Test for INTERMEDIATE  like so:
* if (!(plcp[0] | plcp[1] | plcp[2]))
*/

memset(&rx_status, 0, sizeof(rx_status));
prep_mac80211_status(wlc, rxh, p, &rx_status);

/* mac header+body length, exclude CRC and plcp header */
len_mpdu = PKTLEN(p) - D11_PHY_HDR_LEN - DOT11_FCS_LEN;
-	PKTPULL(p, D11_PHY_HDR_LEN);
+	skb_pull(p, D11_PHY_HDR_LEN);
PKTSETLEN(p, len_mpdu);

ASSERT(!PKTNEXT(p));
ASSERT(!PKTLINK(p));

ASSERT(IS_ALIGNED((unsigned long)skb->data, 2));

memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);

WLCNTINCR(wlc->pub->_cnt->ieee_rx);
@@ -7216,36 +7216,36 @@ void BCMFASTPATH wlc_recv(wlc_info_t *wlc, void *p)
uint len;
bool is_amsdu;

WL_TRACE(("wl%d: wlc_recvn", wlc->pub->unit));

osh = wlc->osh;

/* frame starts with rxhdr */
rxh = (d11rxhdr_t *) PKTDATA(p);

/* strip off rxhdr */
-	PKTPULL(p, wlc->hwrxoff);
+	skb_pull(p, wlc->hwrxoff);

/* fixup rx header endianness */
ltoh16_buf((void *)rxh, sizeof(d11rxhdr_t));

/* MAC inserts 2 pad bytes for a4 headers or QoS or A-MSDU subframes */
if (rxh->RxStatus1 & RXS_PBPRES) {
if (PKTLEN(p) < 2) {
WLCNTINCR(wlc->pub->_cnt->rxrunt);
WL_ERROR(("wl%d: wlc_recv: rcvd runt of len %dn",
wlc->pub->unit, PKTLEN(p)));
goto toss;
}
-		PKTPULL(p, 2);
+		skb_pull(p, 2);
}

h = (struct dot11_header *)(PKTDATA(p) + D11_PHY_HDR_LEN);
len = PKTLEN(p);

if (rxh->RxStatus1 & RXS_FCSERR) {
if (wlc->pub->mac80211_state & MAC80211_PROMISC_BCNS) {
WL_ERROR(("FCSERR while scanning******* - tossingn"));
goto toss;
} else {
WL_ERROR(("RCSERR!!!n"));
diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c
index b4dcb05..38bc6d7 100644
--- a/drivers/staging/brcm80211/util/hnddma.c
+++ b/drivers/staging/brcm80211/util/hnddma.c
@@ -1102,23 +1102,23 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di)
DMA_ERROR(("%s: rxfill32: ring is empty !n", di->name));
ring_empty = true;
}
} else
ASSERT(0);
}
di->hnddma.rxnobuf++;
break;
}
/* reserve an extra headroom, if applicable */
if (extra_offset)
-			PKTPULL(p, extra_offset);
+			skb_pull(p, extra_offset);

/* Do a cached write instead of uncached write since DMA_MAP
* will flush the cache.
*/
*(u32 *) (PKTDATA(p)) = 0;

if (DMASGLIST_ENAB)
bzero(&di->rxp_dmah[rxout], sizeof(hnddma_seg_map_t));

pa = DMA_MAP(di->osh, PKTDATA(p),
di->rxbufsize, DMA_RX, p, &di->rxp_dmah[rxout]);
--
1.7.1





More information about the devel mailing list