*/
static void dhdsdio_pktfree2(dhd_bus_t *bus, struct sk_buff *pkt)
{
- dhd_os_sdlock_rxq(bus->dhd);
if ((bus->bus != SPI_BUS) || bus->usebufpool)
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
}
static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size)
/* If there's a descriptor, generate the packet chain */
if (bus->glomd) {
- dhd_os_sdlock_rxq(bus->dhd);
-
pfirst = plast = pnext = NULL;
dlen = (u16) (bus->glomd->len);
dptr = bus->glomd->data;
brcmu_pkt_buf_free_skb(bus->glomd);
bus->glomd = NULL;
bus->nextlen = 0;
-
- dhd_os_sdunlock_rxq(bus->dhd);
}
/* Ok -- either we just generated a packet chain,
} else {
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(bus->glom);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
} else {
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(bus->glom);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
bus->glom = NULL;
plast = NULL;
- dhd_os_sdlock_rxq(bus->dhd);
for (num = 0; pfirst; rxseq++, pfirst = pnext) {
pnext = pfirst->next;
pfirst->next = NULL;
}
#endif /* DHD_DEBUG */
}
- dhd_os_sdunlock_rxq(bus->dhd);
if (num) {
dhd_os_sdunlock(bus->dhd);
dhd_rx_frame(bus->dhd, ifidx, save_pfirst, num);
* or non-data frame.
*/
/* Allocate a packet buffer */
- dhd_os_sdlock_rxq(bus->dhd);
pkt = brcmu_pkt_buf_get_skb(rdlen + DHD_SDALIGN);
if (!pkt) {
if (bus->bus == SPI_BUS) {
rdlen, sdret));
/* dhd.rx_ctlerrs is higher */
bus->rxc_errors++;
- dhd_os_sdunlock_rxq(bus->dhd);
dhdsdio_rxfail(bus, true,
(bus->bus ==
SPI_BUS) ? false
" len %d rdlen %d expected"
" rxseq %d\n", __func__,
len, rdlen, rxseq));
- /* Just go try again w/normal
- header read */
- dhd_os_sdunlock_rxq(bus->dhd);
continue;
}
} else {
__func__, rdlen, sdret));
brcmu_pkt_buf_free_skb(pkt);
bus->dhd->rx_errors++;
- dhd_os_sdunlock_rxq(bus->dhd);
/* Force retry w/normal header read.
* Don't attempt NAK for
* gSPI
continue;
}
}
- dhd_os_sdunlock_rxq(bus->dhd);
/* Now check the header */
memcpy(bus->rxhdr, rxbuf, SDPCM_HDRLEN);
continue;
}
- dhd_os_sdlock_rxq(bus->dhd);
pkt = brcmu_pkt_buf_get_skb(rdlen + firstread + DHD_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
" chan %d\n", __func__, rdlen, chan));
bus->dhd->rx_dropped++;
- dhd_os_sdunlock_rxq(bus->dhd);
dhdsdio_rxfail(bus, false, RETRYCHAN(chan));
continue;
}
- dhd_os_sdunlock_rxq(bus->dhd);
ASSERT(!(pkt->prev));
SDPCM_DATA_CHANNEL)
? "data" : "test")),
sdret));
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
continue;
#endif /* SDTEST */
if (pkt->len == 0) {
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
continue;
} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
DHD_ERROR(("%s: rx protocol error\n", __func__));
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
continue;
}