[PATCH 323/510] staging: brcm80211: remove some more packet related macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Arend van Spriel <arend@xxxxxxxxxxxx>

macros PKTHEADROOM and PKTTAILROOM have been replaced by native
skbuff functions and macros PKTALLOCED and PKTUNALLOC have been
removed.

Reviewed-by: Roland Vossen <rvossen@xxxxxxxxxxxx>
Reviewed-by: Brett Rudley <brudley@xxxxxxxxxxxx>
Signed-off-by: Arend van Spriel <arend@xxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |    8 ++++----
 drivers/staging/brcm80211/include/linux_osl.h |    7 ++-----
 drivers/staging/brcm80211/sys/wlc_mac80211.c  |    8 ++++----
 3 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 1d06fb2..9e96c7e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -932,9 +932,9 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
 	/* Add alignment padding, allocate new packet if needed */
 	pad = ((unsigned long)frame % DHD_SDALIGN);
 	if (pad) {
-		if (PKTHEADROOM(pkt) < pad) {
+		if (skb_headroom(pkt) < pad) {
 			DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
-				  __func__, (int)PKTHEADROOM(pkt), pad));
+				  __func__, skb_headroom(pkt), pad));
 			bus->dhd->tx_realloc++;
 			new = PKTGET(osh, (pkt->len + DHD_SDALIGN), true);
 			if (!new) {
@@ -994,7 +994,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
 		u16 pad = bus->blocksize - (len % bus->blocksize);
 		if ((pad <= bus->roundup) && (pad < bus->blocksize))
 #ifdef NOTUSED
-			if (pad <= PKTTAILROOM(pkt))
+			if (pad <= skb_tailroom(pkt))
 #endif				/* NOTUSED */
 				len += pad;
 	} else if (len % DHD_SDALIGN) {
@@ -1004,7 +1004,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
 	/* Some controllers have trouble with odd bytes -- round to even */
 	if (forcealign && (len & (ALIGNMENT - 1))) {
 #ifdef NOTUSED
-		if (PKTTAILROOM(pkt))
+		if (skb_tailroom(pkt))
 #endif
 			len = roundup(len, ALIGNMENT);
 #ifdef NOTUSED
diff --git a/drivers/staging/brcm80211/include/linux_osl.h b/drivers/staging/brcm80211/include/linux_osl.h
index 4e44660..b973f3f 100644
--- a/drivers/staging/brcm80211/include/linux_osl.h
+++ b/drivers/staging/brcm80211/include/linux_osl.h
@@ -17,6 +17,7 @@
 #ifndef _linux_osl_h_
 #define _linux_osl_h_
 
+#include <linux/skbuff.h>
 
 extern struct osl_info *osl_attach(void *pdev, uint bustype);
 extern void osl_detach(struct osl_info *osh);
@@ -248,9 +249,7 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
 /* packet primitives */
 #define	PKTGET(osh, len, send)	osl_pktget((osh), (len))
 #define	PKTFREE(osh, skb, send)	osl_pktfree((osh), (skb), (send))
-#define PKTHEADROOM(skb)	((skb)->data - (skb)->head)
-#define PKTTAILROOM(skb)	((skb)->end - (skb)->tail)
-#define PKTALLOCED(osh)		(((struct osl_pubinfo *)(osh))->pktalloced)
+
 extern void *osl_pktget(struct osl_info *osh, uint len);
 extern void osl_pktfree(struct osl_info *osh, void *skb, bool send);
 
@@ -281,8 +280,6 @@ osl_pkt_tonative(struct osl_pubinfo *osh, void *pkt)
 #define PKTTONATIVE(osh, pkt)	\
 	osl_pkt_tonative((struct osl_pubinfo *)(osh), (pkt))
 #else /* !BRCM_FULLMAC */
-#define PKTUNALLOC(osh)		(((struct osl_pubinfo *)(osh))->pktalloced--)
-
 #define	PKTSETSKIPCT(osh, skb)
 #define	PKTCLRSKIPCT(osh, skb)
 #define	PKTSKIPCT(osh, skb)
diff --git a/drivers/staging/brcm80211/sys/wlc_mac80211.c b/drivers/staging/brcm80211/sys/wlc_mac80211.c
index 52e4d95..e61aa5a 100644
--- a/drivers/staging/brcm80211/sys/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wlc_mac80211.c
@@ -2732,9 +2732,9 @@ uint wlc_down(wlc_info_t *wlc)
 
 
 	/* Verify all packets are flushed from the driver */
-	if (PKTALLOCED(wlc->osh) != 0) {
+	if (wlc->osh->pub.pktalloced != 0) {
 		WL_ERROR(("%d packets not freed at wlc_down!!!!!!\n",
-			  PKTALLOCED(wlc->osh)));
+			  wlc->osh->pub.pktalloced));
 	}
 #ifdef BCMDBG
 	/* Since all the packets should have been freed,
@@ -5123,7 +5123,7 @@ wlc_sendpkt_mac80211(wlc_info_t *wlc, struct sk_buff *sdu,
 	prio = (type == FC_TYPE_DATA ? sdu->priority : MAXPRIO);
 	fifo = prio2fifo[prio];
 
-	ASSERT((uint) PKTHEADROOM(sdu) >= TXOFF);
+	ASSERT((uint) skb_headroom(sdu) >= TXOFF);
 	ASSERT(!(sdu->cloned));
 	ASSERT(!(sdu->next));
 	ASSERT(!(sdu->prev));
@@ -6933,7 +6933,7 @@ wlc_recvctl(wlc_info_t *wlc, struct osl_info *osh, d11rxhdr_t *rxh,
 	ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
 
 	WLCNTINCR(wlc->pub->_cnt->ieee_rx);
-	PKTUNALLOC(osh);
+	osh->pub.pktalloced--;
 	return;
 }
 
-- 
1.7.3.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux