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

staging: brcm80211: remove macro usage for sk_buff release

PKTFREE macro calls osl_pktfree. This function has been renamed to
pkt_buf_free_skb as it comprises of functionality additional to
dev_kfree_skb(_any) function and to get rid of the OSL concept in
this driver.
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Reviewed-by: default avatarDowan Kim <dowan@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f09e0232
...@@ -1057,7 +1057,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1057,7 +1057,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (!write) if (!write)
bcopy(mypkt->data, buffer, buflen_u); bcopy(mypkt->data, buffer, buflen_u);
PKTFREE(sd->osh, mypkt, write ? true : false); pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) { } else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */ /* Case 2: We have a packet, but it is unaligned. */
...@@ -1084,7 +1084,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write, ...@@ -1084,7 +1084,7 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (!write) if (!write)
bcopy(mypkt->data, pkt->data, mypkt->len); bcopy(mypkt->data, pkt->data, mypkt->len);
PKTFREE(sd->osh, mypkt, write ? true : false); pkt_buf_free_skb(sd->osh, mypkt, write ? true : false);
} else { /* case 3: We have a packet and } else { /* case 3: We have a packet and
it is aligned. */ it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n", sd_data(("%s: Aligned %s Packet, direct DMA\n",
......
...@@ -368,7 +368,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt, ...@@ -368,7 +368,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
ASSERT(p); ASSERT(p);
} }
PKTFREE(dhdp->osh, p, true); pkt_buf_free_skb(dhdp->osh, p, true);
} }
/* Enqueue */ /* Enqueue */
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
* bufpool was present for gspi bus. * bufpool was present for gspi bus.
*/ */
#define PKTFREE2() if ((bus->bus != SPI_BUS) || bus->usebufpool) \ #define PKTFREE2() if ((bus->bus != SPI_BUS) || bus->usebufpool) \
PKTFREE(bus->dhd->osh, pkt, false); pkt_buf_free_skb(bus->dhd->osh, pkt, false);
DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep); DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len); uint len);
...@@ -948,7 +948,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, ...@@ -948,7 +948,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
PKTALIGN(osh, new, pkt->len, DHD_SDALIGN); PKTALIGN(osh, new, pkt->len, DHD_SDALIGN);
bcopy(pkt->data, new->data, pkt->len); bcopy(pkt->data, new->data, pkt->len);
if (free_pkt) if (free_pkt)
PKTFREE(osh, pkt, true); pkt_buf_free_skb(osh, pkt, true);
/* free the pkt if canned one is not used */ /* free the pkt if canned one is not used */
free_pkt = true; free_pkt = true;
pkt = new; pkt = new;
...@@ -1061,7 +1061,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan, ...@@ -1061,7 +1061,7 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
dhd_os_sdlock(bus->dhd); dhd_os_sdlock(bus->dhd);
if (free_pkt) if (free_pkt)
PKTFREE(osh, pkt, true); pkt_buf_free_skb(osh, pkt, true);
return ret; return ret;
} }
...@@ -1112,7 +1112,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt) ...@@ -1112,7 +1112,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) { if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN); skb_pull(pkt, SDPCM_HDRLEN);
dhd_txcomplete(bus->dhd, pkt, false); dhd_txcomplete(bus->dhd, pkt, false);
PKTFREE(osh, pkt, true); pkt_buf_free_skb(osh, pkt, true);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__)); DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = BCME_NORESOURCE; ret = BCME_NORESOURCE;
} else { } else {
...@@ -2882,10 +2882,10 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex) ...@@ -2882,10 +2882,10 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Clear any held glomming stuff */ /* Clear any held glomming stuff */
if (bus->glomd) if (bus->glomd)
PKTFREE(osh, bus->glomd, false); pkt_buf_free_skb(osh, bus->glomd, false);
if (bus->glom) if (bus->glom)
PKTFREE(osh, bus->glom, false); pkt_buf_free_skb(osh, bus->glom, false);
bus->glom = bus->glomd = NULL; bus->glom = bus->glomd = NULL;
...@@ -3276,13 +3276,13 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) ...@@ -3276,13 +3276,13 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
pfirst = pnext = NULL; pfirst = pnext = NULL;
} else { } else {
if (pfirst) if (pfirst)
PKTFREE(osh, pfirst, false); pkt_buf_free_skb(osh, pfirst, false);
bus->glom = NULL; bus->glom = NULL;
num = 0; num = 0;
} }
/* Done with descriptor packet */ /* Done with descriptor packet */
PKTFREE(osh, bus->glomd, false); pkt_buf_free_skb(osh, bus->glomd, false);
bus->glomd = NULL; bus->glomd = NULL;
bus->nextlen = 0; bus->nextlen = 0;
...@@ -3351,7 +3351,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) ...@@ -3351,7 +3351,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
bus->glomerr = 0; bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false); dhdsdio_rxfail(bus, true, false);
dhd_os_sdlock_rxq(bus->dhd); dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(osh, bus->glom, false); pkt_buf_free_skb(osh, bus->glom, false);
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++; bus->rxglomfail++;
bus->glom = NULL; bus->glom = NULL;
...@@ -3480,7 +3480,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) ...@@ -3480,7 +3480,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
bus->glomerr = 0; bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false); dhdsdio_rxfail(bus, true, false);
dhd_os_sdlock_rxq(bus->dhd); dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(osh, bus->glom, false); pkt_buf_free_skb(osh, bus->glom, false);
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++; bus->rxglomfail++;
bus->glom = NULL; bus->glom = NULL;
...@@ -3528,7 +3528,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) ...@@ -3528,7 +3528,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
skb_pull(pfirst, doff); skb_pull(pfirst, doff);
if (pfirst->len == 0) { if (pfirst->len == 0) {
PKTFREE(bus->dhd->osh, pfirst, false); pkt_buf_free_skb(bus->dhd->osh, pfirst, false);
if (plast) { if (plast) {
plast->next = pnext; plast->next = pnext;
} else { } else {
...@@ -3541,7 +3541,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq) ...@@ -3541,7 +3541,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
DHD_ERROR(("%s: rx protocol error\n", DHD_ERROR(("%s: rx protocol error\n",
__func__)); __func__));
bus->dhd->rx_errors++; bus->dhd->rx_errors++;
PKTFREE(osh, pfirst, false); pkt_buf_free_skb(osh, pfirst, false);
if (plast) { if (plast) {
plast->next = pnext; plast->next = pnext;
} else { } else {
...@@ -3753,7 +3753,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -3753,7 +3753,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (sdret < 0) { if (sdret < 0) {
DHD_ERROR(("%s (nextlen): read %d bytes failed: %d\n", DHD_ERROR(("%s (nextlen): read %d bytes failed: %d\n",
__func__, rdlen, sdret)); __func__, rdlen, sdret));
PKTFREE(bus->dhd->osh, pkt, false); pkt_buf_free_skb(bus->dhd->osh, pkt, false);
bus->dhd->rx_errors++; bus->dhd->rx_errors++;
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
/* Force retry w/normal header read. /* Force retry w/normal header read.
...@@ -3901,7 +3901,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -3901,7 +3901,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
doff); doff);
if (bus->usebufpool) { if (bus->usebufpool) {
dhd_os_sdlock_rxq(bus->dhd); dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(bus->dhd->osh, pkt, pkt_buf_free_skb(bus->dhd->osh, pkt,
false); false);
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
} }
...@@ -4127,7 +4127,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -4127,7 +4127,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
? "data" : "test")), ? "data" : "test")),
sdret)); sdret));
dhd_os_sdlock_rxq(bus->dhd); dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(bus->dhd->osh, pkt, false); pkt_buf_free_skb(bus->dhd->osh, pkt, false);
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++; bus->dhd->rx_errors++;
dhdsdio_rxfail(bus, true, RETRYCHAN(chan)); dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
...@@ -4180,13 +4180,13 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished) ...@@ -4180,13 +4180,13 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (pkt->len == 0) { if (pkt->len == 0) {
dhd_os_sdlock_rxq(bus->dhd); dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(bus->dhd->osh, pkt, false); pkt_buf_free_skb(bus->dhd->osh, pkt, false);
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
continue; continue;
} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) { } else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
DHD_ERROR(("%s: rx protocol error\n", __func__)); DHD_ERROR(("%s: rx protocol error\n", __func__));
dhd_os_sdlock_rxq(bus->dhd); dhd_os_sdlock_rxq(bus->dhd);
PKTFREE(bus->dhd->osh, pkt, false); pkt_buf_free_skb(bus->dhd->osh, pkt, false);
dhd_os_sdunlock_rxq(bus->dhd); dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++; bus->dhd->rx_errors++;
continue; continue;
...@@ -4694,7 +4694,7 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) ...@@ -4694,7 +4694,7 @@ static void dhdsdio_pktgen(dhd_bus_t *bus)
default: default:
DHD_ERROR(("Unrecognized pktgen mode %d\n", DHD_ERROR(("Unrecognized pktgen mode %d\n",
bus->pktgen_mode)); bus->pktgen_mode));
PKTFREE(osh, pkt, true); pkt_buf_free_skb(osh, pkt, true);
bus->pktgen_count = 0; bus->pktgen_count = 0;
return; return;
} }
...@@ -4779,7 +4779,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) ...@@ -4779,7 +4779,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
if (pktlen < SDPCM_TEST_HDRLEN) { if (pktlen < SDPCM_TEST_HDRLEN) {
DHD_ERROR(("dhdsdio_restrcv: toss runt frame, pktlen %d\n", DHD_ERROR(("dhdsdio_restrcv: toss runt frame, pktlen %d\n",
pktlen)); pktlen));
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
return; return;
} }
...@@ -4797,7 +4797,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) ...@@ -4797,7 +4797,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
DHD_ERROR(("dhdsdio_testrcv: frame length mismatch, " DHD_ERROR(("dhdsdio_testrcv: frame length mismatch, "
"pktlen %d seq %d" " cmd %d extra %d len %d\n", "pktlen %d seq %d" " cmd %d extra %d len %d\n",
pktlen, seq, cmd, extra, len)); pktlen, seq, cmd, extra, len));
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
return; return;
} }
} }
...@@ -4812,14 +4812,14 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) ...@@ -4812,14 +4812,14 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
bus->pktgen_sent++; bus->pktgen_sent++;
} else { } else {
bus->pktgen_fail++; bus->pktgen_fail++;
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
} }
bus->pktgen_rcvd++; bus->pktgen_rcvd++;
break; break;
case SDPCM_TEST_ECHORSP: case SDPCM_TEST_ECHORSP:
if (bus->ext_loop) { if (bus->ext_loop) {
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
bus->pktgen_rcvd++; bus->pktgen_rcvd++;
break; break;
} }
...@@ -4832,12 +4832,12 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) ...@@ -4832,12 +4832,12 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
break; break;
} }
} }
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
bus->pktgen_rcvd++; bus->pktgen_rcvd++;
break; break;
case SDPCM_TEST_DISCARD: case SDPCM_TEST_DISCARD:
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
bus->pktgen_rcvd++; bus->pktgen_rcvd++;
break; break;
...@@ -4847,7 +4847,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq) ...@@ -4847,7 +4847,7 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
DHD_INFO(("dhdsdio_testrcv: unsupported or unknown command, " DHD_INFO(("dhdsdio_testrcv: unsupported or unknown command, "
"pktlen %d seq %d" " cmd %d extra %d len %d\n", "pktlen %d seq %d" " cmd %d extra %d len %d\n",
pktlen, seq, cmd, extra, len)); pktlen, seq, cmd, extra, len));
PKTFREE(osh, pkt, false); pkt_buf_free_skb(osh, pkt, false);
break; break;
} }
......
...@@ -208,9 +208,7 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size, ...@@ -208,9 +208,7 @@ extern void osl_dma_unmap(struct osl_info *osh, uint pa, uint size,
#define bcopy(src, dst, len) memcpy((dst), (src), (len)) #define bcopy(src, dst, len) memcpy((dst), (src), (len))
/* packet primitives */ /* packet primitives */
#define PKTFREE(osh, skb, send) osl_pktfree((osh), (skb), (send))
extern struct sk_buff *pkt_buf_get_skb(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); extern void pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send);
#endif /* _osl_h_ */ #endif /* _osl_h_ */
...@@ -3336,7 +3336,7 @@ static bool wlc_bmac_txstatus_corerev4(wlc_hw_info_t *wlc_hw) ...@@ -3336,7 +3336,7 @@ static bool wlc_bmac_txstatus_corerev4(wlc_hw_info_t *wlc_hw)
fatal = wlc_bmac_dotxstatus(wlc_hw, txs, 0); fatal = wlc_bmac_dotxstatus(wlc_hw, txs, 0);
PKTFREE(osh, status_p, false); pkt_buf_free_skb(osh, status_p, false);
} }
if (fatal) if (fatal)
......
...@@ -5052,7 +5052,7 @@ wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q, struct sk_buff *pkt, ...@@ -5052,7 +5052,7 @@ wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q, struct sk_buff *pkt,
} }
ASSERT(0); ASSERT(0);
PKTFREE(wlc->osh, p, true); pkt_buf_free_skb(wlc->osh, p, true);
WLCNTINCR(wlc->pub->_cnt->txnobuf); WLCNTINCR(wlc->pub->_cnt->txnobuf);
} }
...@@ -5085,7 +5085,7 @@ void BCMFASTPATH wlc_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu, ...@@ -5085,7 +5085,7 @@ void BCMFASTPATH wlc_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
wlc->pub->unit)); wlc->pub->unit));
/* ASSERT(9 == 8); *//* XXX we might hit this condtion in case packet flooding from mac80211 stack */ /* ASSERT(9 == 8); *//* XXX we might hit this condtion in case packet flooding from mac80211 stack */
PKTFREE(wlc->osh, sdu, true); pkt_buf_free_skb(wlc->osh, sdu, true);
WLCNTINCR(wlc->pub->_cnt->txnobuf); WLCNTINCR(wlc->pub->_cnt->txnobuf);
} }
...@@ -6671,7 +6671,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) ...@@ -6671,7 +6671,7 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
fatal: fatal:
ASSERT(0); ASSERT(0);
if (p) if (p)
PKTFREE(osh, p, true); pkt_buf_free_skb(osh, p, true);
return true; return true;
...@@ -7056,7 +7056,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p) ...@@ -7056,7 +7056,7 @@ void BCMFASTPATH wlc_recv(struct wlc_info *wlc, struct sk_buff *p)
return; return;
toss: toss:
PKTFREE(osh, p, false); pkt_buf_free_skb(osh, p, false);
} }
/* calculate frame duration for Mixed-mode L-SIG spoofing, return /* calculate frame duration for Mixed-mode L-SIG spoofing, return
......
...@@ -198,7 +198,7 @@ void pktq_pflush(struct osl_info *osh, struct pktq *pq, int prec, bool dir) ...@@ -198,7 +198,7 @@ void pktq_pflush(struct osl_info *osh, struct pktq *pq, int prec, bool dir)
while (p) { while (p) {
q->head = p->prev; q->head = p->prev;
p->prev = NULL; p->prev = NULL;
PKTFREE(osh, p, dir); pkt_buf_free_skb(osh, p, dir);
q->len--; q->len--;
pq->len--; pq->len--;
p = q->head; p = q->head;
...@@ -232,7 +232,7 @@ pktq_pflush(struct osl_info *osh, struct pktq *pq, int prec, bool dir, ...@@ -232,7 +232,7 @@ pktq_pflush(struct osl_info *osh, struct pktq *pq, int prec, bool dir,
else else
prev->prev = p->prev; prev->prev = p->prev;
p->prev = NULL; p->prev = NULL;
PKTFREE(osh, p, dir); pkt_buf_free_skb(osh, p, dir);
q->len--; q->len--;
pq->len--; pq->len--;
p = (head ? q->head : prev->prev); p = (head ? q->head : prev->prev);
......
...@@ -1046,7 +1046,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di) ...@@ -1046,7 +1046,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di)
if ((di->hnddma.dmactrlflags & DMA_CTRL_RXMULTI) == 0) { if ((di->hnddma.dmactrlflags & DMA_CTRL_RXMULTI) == 0) {
DMA_ERROR(("%s: dma_rx: bad frame length (%d)\n", DMA_ERROR(("%s: dma_rx: bad frame length (%d)\n",
di->name, len)); di->name, len));
PKTFREE(di->osh, head, false); pkt_buf_free_skb(di->osh, head, false);
di->hnddma.rxgiants++; di->hnddma.rxgiants++;
goto next_frame; goto next_frame;
} }
...@@ -1230,15 +1230,10 @@ static void _dma_rxreclaim(dma_info_t *di) ...@@ -1230,15 +1230,10 @@ static void _dma_rxreclaim(dma_info_t *di)
{ {
void *p; void *p;
/* "unused local" warning suppression for OSLs that
* define PKTFREE() without using the di->osh arg
*/
di = di;
DMA_TRACE(("%s: dma_rxreclaim\n", di->name)); DMA_TRACE(("%s: dma_rxreclaim\n", di->name));
while ((p = _dma_getnextrxp(di, true))) while ((p = _dma_getnextrxp(di, true)))
PKTFREE(di->osh, p, false); pkt_buf_free_skb(di->osh, p, false);
} }
static void *BCMFASTPATH _dma_getnextrxp(dma_info_t *di, bool forceall) static void *BCMFASTPATH _dma_getnextrxp(dma_info_t *di, bool forceall)
...@@ -1501,7 +1496,7 @@ static void dma32_txreclaim(dma_info_t *di, txd_range_t range) ...@@ -1501,7 +1496,7 @@ static void dma32_txreclaim(dma_info_t *di, txd_range_t range)
return; return;
while ((p = dma32_getnexttxp(di, range))) while ((p = dma32_getnexttxp(di, range)))
PKTFREE(di->osh, p, true); pkt_buf_free_skb(di->osh, p, true);
} }
static bool dma32_txstopped(dma_info_t *di) static bool dma32_txstopped(dma_info_t *di)
...@@ -1772,7 +1767,7 @@ static int dma32_txfast(dma_info_t *di, struct sk_buff *p0, bool commit) ...@@ -1772,7 +1767,7 @@ static int dma32_txfast(dma_info_t *di, struct sk_buff *p0, bool commit)
outoftxd: outoftxd:
DMA_ERROR(("%s: dma_txfast: out of txds\n", di->name)); DMA_ERROR(("%s: dma_txfast: out of txds\n", di->name));
PKTFREE(di->osh, p0, true); pkt_buf_free_skb(di->osh, p0, true);
di->hnddma.txavail = 0; di->hnddma.txavail = 0;
di->hnddma.txnobuf++; di->hnddma.txnobuf++;
return -1; return -1;
...@@ -2071,7 +2066,7 @@ static void BCMFASTPATH dma64_txreclaim(dma_info_t *di, txd_range_t range) ...@@ -2071,7 +2066,7 @@ static void BCMFASTPATH dma64_txreclaim(dma_info_t *di, txd_range_t range)
while ((p = dma64_getnexttxp(di, range))) { while ((p = dma64_getnexttxp(di, range))) {
/* For unframed data, we don't have any packets to free */ /* For unframed data, we don't have any packets to free */
if (!(di->hnddma.dmactrlflags & DMA_CTRL_UNFRAMED)) if (!(di->hnddma.dmactrlflags & DMA_CTRL_UNFRAMED))
PKTFREE(di->osh, p, true); pkt_buf_free_skb(di->osh, p, true);
} }
} }
...@@ -2422,7 +2417,7 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, struct sk_buff *p0, ...@@ -2422,7 +2417,7 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, struct sk_buff *p0,
outoftxd: outoftxd:
DMA_ERROR(("%s: dma_txfast: out of txds !!!\n", di->name)); DMA_ERROR(("%s: dma_txfast: out of txds !!!\n", di->name));
PKTFREE(di->osh, p0, true); pkt_buf_free_skb(di->osh, p0, true);
di->hnddma.txavail = 0; di->hnddma.txavail = 0;
di->hnddma.txnobuf++; di->hnddma.txnobuf++;
return -1; return -1;
......
...@@ -95,12 +95,11 @@ struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len) ...@@ -95,12 +95,11 @@ struct sk_buff *BCMFASTPATH pkt_buf_get_skb(struct osl_info *osh, uint len)
} }
/* Free the driver packet. Free the tag if present */ /* Free the driver packet. Free the tag if present */
void BCMFASTPATH osl_pktfree(struct osl_info *osh, void *p, bool send) void BCMFASTPATH pkt_buf_free_skb(struct osl_info *osh, struct sk_buff *skb, bool send)
{ {
struct sk_buff *skb, *nskb; struct sk_buff *nskb;
int nest = 0; int nest = 0;
skb = (struct sk_buff *)p;
ASSERT(skb); ASSERT(skb);
/* perversion: we use skb->next to chain multi-skb packets */ /* perversion: we use skb->next to chain multi-skb packets */
......
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