staging: brcm80211: remove macro usage for sk_buff allocation
authorArend van Spriel <arend@broadcom.com>
Sat, 4 Dec 2010 15:35:42 +0000 (16:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 7 Dec 2010 00:08:30 +0000 (16:08 -0800)
PKTGET macro calls osl_pktget. This function has been renamed to
pkt_buf_get_skb as it comprises of functionality additional to
dev_alloc_skb function and to get rid of the OSL concept in this driver.

Reviewed-by: Brett Rudley <brudley@broadcom.com>
Reviewed-by: Dowan Kim <dowan@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
drivers/staging/brcm80211/include/osl.h
drivers/staging/brcm80211/util/hnddma.c
drivers/staging/brcm80211/util/linux_osl.c

index 2e02d5e58415330075430b04fd2d36363b95e4e1..b8eb589cdaab04ea17f7fc3d8a69ce6304ab8bc5 100644 (file)
@@ -1039,9 +1039,9 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
        if (pkt == NULL) {
                sd_data(("%s: Creating new %s Packet, len=%d\n",
                         __func__, write ? "TX" : "RX", buflen_u));
-               mypkt = PKTGET(sd->osh, buflen_u, write ? true : false);
+               mypkt = pkt_buf_get_skb(sd->osh, buflen_u);
                if (!mypkt) {
-                       sd_err(("%s: PKTGET failed: len %d\n",
+                       sd_err(("%s: pkt_buf_get_skb failed: len %d\n",
                                __func__, buflen_u));
                        return SDIOH_API_RC_FAIL;
                }
@@ -1066,9 +1066,9 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
 
                sd_data(("%s: Creating aligned %s Packet, len=%d\n",
                         __func__, write ? "TX" : "RX", pkt->len));
-               mypkt = PKTGET(sd->osh, pkt->len, write ? true : false);
+               mypkt = pkt_buf_get_skb(sd->osh, pkt->len);
                if (!mypkt) {
-                       sd_err(("%s: PKTGET failed: len %d\n",
+                       sd_err(("%s: pkt_buf_get_skb failed: len %d\n",
                                __func__, pkt->len));
                        return SDIOH_API_RC_FAIL;
                }
index 6b41d1f1b7645cb5eca28b5192264f9ec7ac563d..c054f0d5015278941b7285b83d0ecbe044d03fe8 100644 (file)
@@ -936,7 +936,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
                        DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
                                  __func__, skb_headroom(pkt), pad));
                        bus->dhd->tx_realloc++;
-                       new = PKTGET(osh, (pkt->len + DHD_SDALIGN), true);
+                       new = pkt_buf_get_skb(osh, (pkt->len + DHD_SDALIGN));
                        if (!new) {
                                DHD_ERROR(("%s: couldn't allocate new %d-byte "
                                        "packet\n",
@@ -3240,9 +3240,9 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
                        }
 
                        /* Allocate/chain packet for next subframe */
-                       pnext = PKTGET(osh, sublen + DHD_SDALIGN, false);
+                       pnext = pkt_buf_get_skb(osh, sublen + DHD_SDALIGN);
                        if (pnext == NULL) {
-                               DHD_ERROR(("%s: PKTGET failed, num %d len %d\n",
+                               DHD_ERROR(("%s: pkt_buf_get_skb failed, num %d len %d\n",
                                           __func__, num, sublen));
                                break;
                        }
@@ -3680,7 +3680,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
                         */
                        /* Allocate a packet buffer */
                        dhd_os_sdlock_rxq(bus->dhd);
-                       pkt = PKTGET(osh, rdlen + DHD_SDALIGN, false);
+                       pkt = pkt_buf_get_skb(osh, rdlen + DHD_SDALIGN);
                        if (!pkt) {
                                if (bus->bus == SPI_BUS) {
                                        bus->usebufpool = false;
@@ -3726,7 +3726,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
                                } else {
                                        /* Give up on data,
                                        request rtx of events */
-                                       DHD_ERROR(("%s (nextlen): PKTGET failed: len %d rdlen %d " "expected rxseq %d\n",
+                                       DHD_ERROR(("%s (nextlen): pkt_buf_get_skb failed: len %d rdlen %d " "expected rxseq %d\n",
                                                __func__, len, rdlen, rxseq));
                                        /* Just go try again w/normal
                                        header read */
@@ -4091,10 +4091,10 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
                }
 
                dhd_os_sdlock_rxq(bus->dhd);
-               pkt = PKTGET(osh, (rdlen + firstread + DHD_SDALIGN), false);
+               pkt = pkt_buf_get_skb(osh, (rdlen + firstread + DHD_SDALIGN));
                if (!pkt) {
                        /* Give up on data, request rtx of events */
-                       DHD_ERROR(("%s: PKTGET failed: rdlen %d chan %d\n",
+                       DHD_ERROR(("%s: pkt_buf_get_skb failed: rdlen %d chan %d\n",
                                   __func__, rdlen, chan));
                        bus->dhd->rx_dropped++;
                        dhd_os_sdunlock_rxq(bus->dhd);
@@ -4663,11 +4663,11 @@ static void dhdsdio_pktgen(dhd_bus_t *bus)
 
                /* Allocate an appropriate-sized packet */
                len = bus->pktgen_len;
-               pkt = PKTGET(osh,
+               pkt = pkt_buf_get_skb(osh,
                        (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN),
                        true);
                if (!pkt) {
-                       DHD_ERROR(("%s: PKTGET failed!\n", __func__));
+                       DHD_ERROR(("%s: pkt_buf_get_skb failed!\n", __func__));
                        break;
                }
                PKTALIGN(osh, pkt, (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN),
@@ -4743,10 +4743,10 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start)
        struct osl_info *osh = bus->dhd->osh;
 
        /* Allocate the packet */
-       pkt = PKTGET(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN,
+       pkt = pkt_buf_get_skb(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN,
                        true);
        if (!pkt) {
-               DHD_ERROR(("%s: PKTGET failed!\n", __func__));
+               DHD_ERROR(("%s: pkt_buf_get_skb failed!\n", __func__));
                return;
        }
        PKTALIGN(osh, pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), DHD_SDALIGN);
@@ -5008,7 +5008,7 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
        /* Bump dongle by sending an empty event pkt.
         * sdpcm_sendup (RX) checks for virtual console input.
         */
-       pkt = PKTGET(bus->dhd->osh, 4 + SDPCM_RESERVE, true);
+       pkt = pkt_buf_get_skb(bus->dhd->osh, 4 + SDPCM_RESERVE);
        if ((pkt != NULL) && bus->clkstate == CLK_AVAIL)
                dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, true);
 
index 54fdfd609729aa0e87b00479576bdc510c1fe3ef..4d5893a70dd29fb09b67d593508f8e69be6e6132 100644 (file)
@@ -208,10 +208,9 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
 #define        bcopy(src, dst, len)    memcpy((dst), (src), (len))
 
 /* packet primitives */
-#define        PKTGET(osh, len, send)  osl_pktget((osh), (len))
 #define        PKTFREE(osh, skb, send) osl_pktfree((osh), (skb), (send))
 
-extern void *osl_pktget(struct osl_info *osh, uint len);
+extern struct sk_buff *pkt_buf_get_skb(struct osl_info *osh, uint len);
 extern void osl_pktfree(struct osl_info *osh, void *skb, bool send);
 
 #endif /* _osl_h_ */
index 0c8a1d25d98bac6431c8718f303c371d6ed8aa6c..a7805a88b5fea23841733e9517975424e1eecbe6 100644 (file)
@@ -1094,7 +1094,7 @@ static bool BCMFASTPATH _dma_rxfill(dma_info_t *di)
                   size to be allocated
                 */
 
-               p = osl_pktget(di->osh, di->rxbufsize + extra_offset);
+               p = pkt_buf_get_skb(di->osh, di->rxbufsize + extra_offset);
 
                if (p == NULL) {
                        DMA_ERROR(("%s: dma_rxfill: out of rxbufs\n",
index 2efce7aeec7896062df047c4161702d0a8f42c73..cd78edbcf43f9acc3ed14189f834aaa6b3a36b39 100644 (file)
@@ -79,7 +79,7 @@ void osl_detach(struct osl_info *osh)
        kfree(osh);
 }
 
-void *BCMFASTPATH osl_pktget(struct osl_info *osh, uint len)
+struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len)
 {
        struct sk_buff *skb;
 
@@ -91,7 +91,7 @@ void *BCMFASTPATH osl_pktget(struct osl_info *osh, uint len)
                osh->pktalloced++;
        }
 
-       return (void *)skb;
+       return skb;
 }
 
 /* Free the driver packet. Free the tag if present */