+config BRCMUTIL
+ tristate
+ default n
+
config BRCMSMAC
tristate "Broadcom IEEE802.11n PCIe SoftMAC WLAN driver"
default n
depends on PCI
depends on WLAN && MAC80211
+ select BRCMUTIL
select FW_LOADER
select CRC_CCITT
---help---
default n
depends on MMC
depends on WLAN && CFG80211
+ select BRCMUTIL
select FW_LOADER
select WIRELESS_EXT
select WEXT_PRIV
subdir-ccflags-y := -DBCMDMA32
subdir-ccflags-$(CONFIG_BRCMDBG) += -DBCMDBG -DBCMDBG_ASSERT
+obj-$(CONFIG_BRCMUTIL) += util/
obj-$(CONFIG_BRCMFMAC) += brcmfmac/
obj-$(CONFIG_BRCMSMAC) += brcmsmac/
bcmsdh.o \
bcmsdh_linux.o \
bcmsdh_sdmmc.o \
- bcmsdh_sdmmc_linux.o \
- bcmutils.o \
- bcmwifi.o
+ bcmsdh_sdmmc_linux.o
obj-m += brcmfmac.o
brcmfmac-objs += $(DHDOFILES)
if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", buflen_u));
- mypkt = pkt_buf_get_skb(buflen_u);
+ mypkt = bcm_pkt_buf_get_skb(buflen_u);
if (!mypkt) {
- sd_err(("%s: pkt_buf_get_skb failed: len %d\n",
+ sd_err(("%s: bcm_pkt_buf_get_skb failed: len %d\n",
__func__, buflen_u));
return SDIOH_API_RC_FAIL;
}
if (!write)
memcpy(buffer, mypkt->data, buflen_u);
- pkt_buf_free_skb(mypkt);
+ bcm_pkt_buf_free_skb(mypkt);
} else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */
sd_data(("%s: Creating aligned %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", pkt->len));
- mypkt = pkt_buf_get_skb(pkt->len);
+ mypkt = bcm_pkt_buf_get_skb(pkt->len);
if (!mypkt) {
- sd_err(("%s: pkt_buf_get_skb failed: len %d\n",
+ sd_err(("%s: bcm_pkt_buf_get_skb failed: len %d\n",
__func__, pkt->len));
return SDIOH_API_RC_FAIL;
}
if (!write)
memcpy(pkt->data, mypkt->data, mypkt->len);
- pkt_buf_free_skb(mypkt);
+ bcm_pkt_buf_free_skb(mypkt);
} else { /* case 3: We have a packet and
it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n",
+++ /dev/null
-#include "../util/bcmutils.c"
+++ /dev/null
-#include "../util/bcmwifi.c"
* exceeding total queue length
*/
if (!pktq_pfull(q, prec) && !pktq_full(q)) {
- pktq_penq(q, prec, pkt);
+ bcm_pktq_penq(q, prec, pkt);
return true;
}
if (pktq_pfull(q, prec))
eprec = prec;
else if (pktq_full(q)) {
- p = pktq_peek_tail(q, &eprec);
+ p = bcm_pktq_peek_tail(q, &eprec);
ASSERT(p);
if (eprec > prec)
return false;
if (eprec == prec && !discard_oldest)
return false; /* refuse newer (incoming) packet */
/* Evict packet according to discard policy */
- p = discard_oldest ? pktq_pdeq(q, eprec) : pktq_pdeq_tail(q,
- eprec);
+ p = discard_oldest ? bcm_pktq_pdeq(q, eprec) :
+ bcm_pktq_pdeq_tail(q, eprec);
if (p == NULL) {
- DHD_ERROR(("%s: pktq_penq() failed, oldest %d.",
+ DHD_ERROR(("%s: bcm_pktq_penq() failed, oldest %d.",
__func__, discard_oldest));
ASSERT(p);
}
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
}
/* Enqueue */
- p = pktq_penq(q, prec, pkt);
+ p = bcm_pktq_penq(q, prec, pkt);
if (p == NULL) {
- DHD_ERROR(("%s: pktq_penq() failed.", __func__));
+ DHD_ERROR(("%s: bcm_pktq_penq() failed.", __func__));
ASSERT(p);
}
{
dhd_os_sdlock_rxq(bus->dhd);
if ((bus->bus != SPI_BUS) || bus->usebufpool)
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
dhd_os_sdunlock_rxq(bus->dhd);
}
DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
__func__, skb_headroom(pkt), pad));
bus->dhd->tx_realloc++;
- new = pkt_buf_get_skb(pkt->len + DHD_SDALIGN);
+ new = bcm_pkt_buf_get_skb(pkt->len + DHD_SDALIGN);
if (!new) {
DHD_ERROR(("%s: couldn't allocate new %d-byte "
"packet\n",
PKTALIGN(new, pkt->len, DHD_SDALIGN);
memcpy(new->data, pkt->data, pkt->len);
if (free_pkt)
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
/* free the pkt if canned one is not used */
free_pkt = true;
pkt = new;
if (DHD_BYTES_ON() &&
(((DHD_CTL_ON() && (chan == SDPCM_CONTROL_CHANNEL)) ||
(DHD_DATA_ON() && (chan != SDPCM_CONTROL_CHANNEL))))) {
- prhex("Tx Frame", frame, len);
+ bcm_prhex("Tx Frame", frame, len);
} else if (DHD_HDRS_ON()) {
- prhex("TxHdr", frame, min_t(u16, len, 16));
+ bcm_prhex("TxHdr", frame, min_t(u16, len, 16));
}
#endif
dhd_os_sdlock(bus->dhd);
if (free_pkt)
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
return ret;
}
if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN);
dhd_txcomplete(bus->dhd, pkt, false);
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = -ENOSR;
} else {
/* Send frames until the limit or some other event */
for (cnt = 0; (cnt < maxframes) && DATAOK(bus); cnt++) {
dhd_os_sdlock_txq(bus->dhd);
- pkt = pktq_mdeq(&bus->txq, tx_prec_map, &prec_out);
+ pkt = bcm_pktq_mdeq(&bus->txq, tx_prec_map, &prec_out);
if (pkt == NULL) {
dhd_os_sdunlock_txq(bus->dhd);
break;
if (ret == -1) {
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_CTL_ON())
- prhex("Tx Frame", frame, len);
+ bcm_prhex("Tx Frame", frame, len);
else if (DHD_HDRS_ON())
- prhex("TxHdr", frame, min_t(u16, len, 16));
+ bcm_prhex("TxHdr", frame, min_t(u16, len, 16));
#endif
do {
dhdsdio_clkctl(bus, CLK_SDONLY, false);
/* Clear the data packet queues */
- pktq_flush(&bus->txq, true, NULL, 0);
+ bcm_pktq_flush(&bus->txq, true, NULL, 0);
/* Clear any held glomming stuff */
if (bus->glomd)
- pkt_buf_free_skb(bus->glomd);
+ bcm_pkt_buf_free_skb(bus->glomd);
if (bus->glom)
- pkt_buf_free_skb(bus->glom);
+ bcm_pkt_buf_free_skb(bus->glom);
bus->glom = bus->glomd = NULL;
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_CTL_ON())
- prhex("RxCtrl", bus->rxctl, len);
+ bcm_prhex("RxCtrl", bus->rxctl, len);
#endif
/* Point to valid data and indicate its length */
}
/* Allocate/chain packet for next subframe */
- pnext = pkt_buf_get_skb(sublen + DHD_SDALIGN);
+ pnext = bcm_pkt_buf_get_skb(sublen + DHD_SDALIGN);
if (pnext == NULL) {
- DHD_ERROR(("%s: pkt_buf_get_skb failed, num %d len %d\n",
- __func__, num, sublen));
+ DHD_ERROR(("%s: bcm_pkt_buf_get_skb failed, "
+ "num %d len %d\n", __func__,
+ num, sublen));
break;
}
ASSERT(!(pnext->prev));
pfirst = pnext = NULL;
} else {
if (pfirst)
- pkt_buf_free_skb(pfirst);
+ bcm_pkt_buf_free_skb(pfirst);
bus->glom = NULL;
num = 0;
}
/* Done with descriptor packet */
- pkt_buf_free_skb(bus->glomd);
+ bcm_pkt_buf_free_skb(bus->glomd);
bus->glomd = NULL;
bus->nextlen = 0;
}
pfirst = bus->glom;
- dlen = (u16) pkttotlen(pfirst);
+ dlen = (u16) bcm_pkttotlen(pfirst);
/* Do an SDIO read for the superframe. Configurable iovar to
* read directly into the chained packet, or allocate a large
bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
F2SYNC, bus->dataptr, dlen,
NULL, NULL, NULL);
- sublen = (u16) pktfrombuf(pfirst, 0, dlen,
+ sublen = (u16) bcm_pktfrombuf(pfirst, 0, dlen,
bus->dataptr);
if (sublen != dlen) {
DHD_ERROR(("%s: FAILED TO COPY, dlen %d sublen %d\n",
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
dhd_os_sdlock_rxq(bus->dhd);
- pkt_buf_free_skb(bus->glom);
+ bcm_pkt_buf_free_skb(bus->glom);
dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
#ifdef DHD_DEBUG
if (DHD_GLOM_ON()) {
- prhex("SUPERFRAME", pfirst->data,
+ bcm_prhex("SUPERFRAME", pfirst->data,
min_t(int, pfirst->len, 48));
}
#endif
doff = SDPCM_DOFFSET_VALUE(&dptr[SDPCM_FRAMETAG_LEN]);
#ifdef DHD_DEBUG
if (DHD_GLOM_ON())
- prhex("subframe", dptr, 32);
+ bcm_prhex("subframe", dptr, 32);
#endif
if ((u16)~(sublen ^ check)) {
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
dhd_os_sdlock_rxq(bus->dhd);
- pkt_buf_free_skb(bus->glom);
+ bcm_pkt_buf_free_skb(bus->glom);
dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON())
- prhex("Rx Subframe Data", dptr, dlen);
+ bcm_prhex("Rx Subframe Data", dptr, dlen);
#endif
__skb_trim(pfirst, sublen);
skb_pull(pfirst, doff);
if (pfirst->len == 0) {
- pkt_buf_free_skb(pfirst);
+ bcm_pkt_buf_free_skb(pfirst);
if (plast) {
plast->next = pnext;
} else {
DHD_ERROR(("%s: rx protocol error\n",
__func__));
bus->dhd->rx_errors++;
- pkt_buf_free_skb(pfirst);
+ bcm_pkt_buf_free_skb(pfirst);
if (plast) {
plast->next = pnext;
} else {
__func__, num, pfirst, pfirst->data,
pfirst->len, pfirst->next,
pfirst->prev));
- prhex("", (u8 *) pfirst->data,
+ bcm_prhex("", (u8 *) pfirst->data,
min_t(int, pfirst->len, 32));
}
#endif /* DHD_DEBUG */
*/
/* Allocate a packet buffer */
dhd_os_sdlock_rxq(bus->dhd);
- pkt = pkt_buf_get_skb(rdlen + DHD_SDALIGN);
+ pkt = bcm_pkt_buf_get_skb(rdlen + DHD_SDALIGN);
if (!pkt) {
if (bus->bus == SPI_BUS) {
bus->usebufpool = false;
} else {
/* Give up on data,
request rtx of events */
- DHD_ERROR(("%s (nextlen): pkt_buf_get_skb failed: len %d rdlen %d " "expected rxseq %d\n",
+ DHD_ERROR(("%s (nextlen): bcm_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 */
if (sdret < 0) {
DHD_ERROR(("%s (nextlen): read %d bytes failed: %d\n",
__func__, rdlen, sdret));
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
bus->dhd->rx_errors++;
dhd_os_sdunlock_rxq(bus->dhd);
/* Force retry w/normal header read.
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON())
- prhex("Rx Data", rxbuf, len);
+ bcm_prhex("Rx Data", rxbuf, len);
else if (DHD_HDRS_ON())
- prhex("RxHdr", bus->rxhdr, SDPCM_HDRLEN);
+ bcm_prhex("RxHdr", bus->rxhdr, SDPCM_HDRLEN);
#endif
if (chan == SDPCM_CONTROL_CHANNEL) {
}
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() || DHD_HDRS_ON())
- prhex("RxHdr", bus->rxhdr, SDPCM_HDRLEN);
+ bcm_prhex("RxHdr", bus->rxhdr, SDPCM_HDRLEN);
#endif
/* Extract hardware header fields */
}
dhd_os_sdlock_rxq(bus->dhd);
- pkt = pkt_buf_get_skb(rdlen + firstread + DHD_SDALIGN);
+ pkt = bcm_pkt_buf_get_skb(rdlen + firstread + DHD_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
- DHD_ERROR(("%s: pkt_buf_get_skb failed: rdlen %d chan %d\n",
- __func__, rdlen, chan));
+ DHD_ERROR(("%s: bcm_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));
? "data" : "test")),
sdret));
dhd_os_sdlock_rxq(bus->dhd);
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON())
- prhex("Rx Data", pkt->data, len);
+ bcm_prhex("Rx Data", pkt->data, len);
#endif
deliver:
__func__, len));
#ifdef DHD_DEBUG
if (DHD_GLOM_ON()) {
- prhex("Glom Data", pkt->data, len);
+ bcm_prhex("Glom Data", pkt->data, len);
}
#endif
__skb_trim(pkt, len);
if (pkt->len == 0) {
dhd_os_sdlock_rxq(bus->dhd);
- pkt_buf_free_skb(pkt);
+ bcm_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);
- pkt_buf_free_skb(pkt);
+ bcm_pkt_buf_free_skb(pkt);
dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
continue;
}
/* Send queued frames (limit 1 if rx may still be pending) */
else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
- pktq_mlen(&bus->txq, ~bus->flowcontrol) && txlimit
+ bcm_pktq_mlen(&bus->txq, ~bus->flowcontrol) && txlimit
&& DATAOK(bus)) {
framecnt = rxdone ? txlimit : min(txlimit, dhd_txminmax);
framecnt = dhdsdio_sendfromq(bus, framecnt);
"I_CHIPACTIVE interrupt\n", __func__));
resched = true;
} else if (bus->intstatus || bus->ipend ||
- (!bus->fcstate && pktq_mlen(&bus->txq, ~bus->flowcontrol) &&
+ (!bus->fcstate && bcm_pktq_mlen(&bus->txq, ~bus->flowcontrol) &&
DATAOK(bus)) || PKT_AVAILABLE()) {
resched = true;
}
/* Allocate an appropriate-sized packet */
len = bus->pktgen_len;
- pkt = pkt_buf_get_skb(
+ pkt = bcm_pkt_buf_get_skb(
(len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN),
true);
if (!pkt) {
- DHD_ERROR(("%s: pkt_buf_get_skb failed!\n", __func__));
+ DHD_ERROR(("%s: bcm_pkt_buf_get_skb failed!\n",
+ __func__));
break;
}
PKTALIGN(pkt, (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN),
default:
DHD_ERROR(("Unrecognized pktgen mode %d\n",
bus->pktgen_mode));
- pkt_buf_free_skb(pkt, true);
+ bcm_pkt_buf_free_skb(pkt, true);
bus->pktgen_count = 0;
return;
}
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON()) {
data = (u8 *) (pkt->data) + SDPCM_HDRLEN;
- prhex("dhdsdio_pktgen: Tx Data", data,
+ bcm_prhex("dhdsdio_pktgen: Tx Data", data,
pkt->len - SDPCM_HDRLEN);
}
#endif
u8 *data;
/* Allocate the packet */
- pkt = pkt_buf_get_skb(SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN,
- true);
+ pkt = bcm_pkt_buf_get_skb(SDPCM_HDRLEN + SDPCM_TEST_HDRLEN +
+ DHD_SDALIGN, true);
if (!pkt) {
- DHD_ERROR(("%s: pkt_buf_get_skb failed!\n", __func__));
+ DHD_ERROR(("%s: bcm_pkt_buf_get_skb failed!\n", __func__));
return;
}
PKTALIGN(pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), DHD_SDALIGN);
if (pktlen < SDPCM_TEST_HDRLEN) {
DHD_ERROR(("dhdsdio_restrcv: toss runt frame, pktlen %d\n",
pktlen));
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
return;
}
DHD_ERROR(("dhdsdio_testrcv: frame length mismatch, "
"pktlen %d seq %d" " cmd %d extra %d len %d\n",
pktlen, seq, cmd, extra, len));
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
return;
}
}
bus->pktgen_sent++;
} else {
bus->pktgen_fail++;
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
}
bus->pktgen_rcvd++;
break;
case SDPCM_TEST_ECHORSP:
if (bus->ext_loop) {
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
bus->pktgen_rcvd++;
break;
}
break;
}
}
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
bus->pktgen_rcvd++;
break;
case SDPCM_TEST_DISCARD:
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
bus->pktgen_rcvd++;
break;
DHD_INFO(("dhdsdio_testrcv: unsupported or unknown command, "
"pktlen %d seq %d" " cmd %d extra %d len %d\n",
pktlen, seq, cmd, extra, len));
- pkt_buf_free_skb(pkt, false);
+ bcm_pkt_buf_free_skb(pkt, false);
break;
}
/* Bump dongle by sending an empty event pkt.
* sdpcm_sendup (RX) checks for virtual console input.
*/
- pkt = pkt_buf_get_skb(4 + SDPCM_RESERVE);
+ pkt = bcm_pkt_buf_get_skb(4 + SDPCM_RESERVE);
if ((pkt != NULL) && bus->clkstate == CLK_AVAIL)
dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, true);
/* Set core control so an SDIO reset does a backplane reset */
OR_REG(&bus->regs->corecontrol, CC_BPRESEN);
- pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
+ bcm_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
/* Locate an appropriately-aligned portion of hdrbuf */
bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], DHD_SDALIGN);
if (fwrq->m > 4000 && fwrq->m < 5000)
sf = WF_CHAN_FACTOR_4_G;
- chan = wf_mhz2channel(fwrq->m, sf);
+ chan = bcm_mhz2channel(fwrq->m, sf);
}
chan = cpu_to_le32(chan);
bcmsrom.o \
hnddma.o \
nicpci.o \
- ../util/bcmutils.o \
- ../util/bcmwifi.o \
nvram.o
MODULEPFX := brcmsmac
/* fixup the endianness so crc8 will pass */
htol16_buf(buf, nwords * 2);
- if (hndcrc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
+ if (bcm_crc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
CRC8_GOOD_VALUE) {
/* DBG only pci always read srom4 first, then srom8/9 */
err = 1;
/* fixup the endianness so crc8 will pass */
htol16_buf(buf, bufsz);
- if (hndcrc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
+ if (bcm_crc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
CRC8_GOOD_VALUE) {
err = 1;
}
if ((di->hnddma.dmactrlflags & DMA_CTRL_RXMULTI) == 0) {
DMA_ERROR(("%s: dma_rx: bad frame length (%d)\n",
di->name, len));
- pkt_buf_free_skb(head);
+ bcm_pkt_buf_free_skb(head);
di->hnddma.rxgiants++;
goto next_frame;
}
size to be allocated
*/
- p = pkt_buf_get_skb(di->rxbufsize + extra_offset);
+ p = bcm_pkt_buf_get_skb(di->rxbufsize + extra_offset);
if (p == NULL) {
DMA_ERROR(("%s: dma_rxfill: out of rxbufs\n",
DMA_TRACE(("%s: dma_rxreclaim\n", di->name));
while ((p = _dma_getnextrxp(di, true)))
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
}
static void *BCMFASTPATH _dma_getnextrxp(dma_info_t *di, bool forceall)
while ((p = dma64_getnexttxp(di, range))) {
/* For unframed data, we don't have any packets to free */
if (!(di->hnddma.dmactrlflags & DMA_CTRL_UNFRAMED))
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
}
}
outoftxd:
DMA_ERROR(("%s: dma_txfast: out of txds !!!\n", di->name));
- pkt_buf_free_skb(p0);
+ bcm_pkt_buf_free_skb(p0);
di->hnddma.txavail = 0;
di->hnddma.txnobuf++;
return -1;
wl->pub->global_ampdu = &(scb->scb_ampdu);
wl->pub->global_ampdu->scb = scb;
wl->pub->global_ampdu->max_pdu = 16;
- pktq_init(&scb->scb_ampdu.txq, AMPDU_MAX_SCB_TID,
+ bcm_pktq_init(&scb->scb_ampdu.txq, AMPDU_MAX_SCB_TID,
AMPDU_MAX_SCB_TID * PKTQ_LEN_DEFAULT);
sta->ht_cap.ht_supported = true;
len = roundup(len, 4);
ampdu_len += (len + (ndelim + 1) * AMPDU_DELIMITER_LEN);
- dma_len += (u16) pkttotlen(p);
+ dma_len += (u16) bcm_pkttotlen(p);
BCMMSG(wlc->wiphy, "wl%d: ampdu_len %d"
" seg_cnt %d null delim %d\n",
((u8) (p->priority) == tid)) {
plen =
- pkttotlen(p) + AMPDU_MAX_MPDU_OVERHEAD;
+ bcm_pkttotlen(p) + AMPDU_MAX_MPDU_OVERHEAD;
plen = max(scb_ampdu->min_len, plen);
if ((plen + ampdu_len) > maxlen) {
p = NULL;
continue;
}
- p = pktq_pdeq(&qi->q, prec);
+ p = bcm_pktq_pdeq(&qi->q, prec);
} else {
p = NULL;
}
tx_info = IEEE80211_SKB_CB(p);
txh = (d11txh_t *) p->data;
mcl = le16_to_cpu(txh->MacTxControlLow);
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
/* break out if last packet of ampdu */
if (((mcl & TXC_AMPDU_MASK) >> TXC_AMPDU_SHIFT) ==
TXC_AMPDU_LAST)
txs->phyerr);
if (WL_ERROR_ON()) {
- prpkt("txpkt (AMPDU)", p);
+ bcm_prpkt("txpkt (AMPDU)", p);
wlc_print_txdesc((d11txh_t *) p->data);
}
wlc_print_txstatus(txs);
scb_ampdu = SCB_AMPDU_CUBBY(ampdu, ini->scb);
/* free all buffered tx packets */
- pktq_pflush(&scb_ampdu->txq, ini->tid, true, NULL, 0);
+ bcm_pktq_pflush(&scb_ampdu->txq, ini->tid, true, NULL, 0);
}
/* initialize the initiator code for tid */
ampdu_pars.sta = sta;
ampdu_pars.tid = tid;
for (prec = 0; prec < pq->num_prec; prec++) {
- pktq_pflush(pq, prec, true, cb_del_ampdu_pkt,
+ bcm_pktq_pflush(pq, prec, true, cb_del_ampdu_pkt,
(int)&du_pars);
}
wlc_inval_dma_pkts(wlc->hw, sta, dma_cb_fn_ampdu);
u8 channel = CHSPEC_CHANNEL(chspec);
/* check the chanspec */
- if (wf_chspec_malformed(chspec)) {
+ if (bcm_chspec_malformed(chspec)) {
wiphy_err(wlc->wiphy, "wl%d: malformed chanspec 0x%x\n",
wlc->pub->unit, chspec);
return false;
local = WLC_TXPWR_MAX;
if (wlc->pub->associated &&
- (wf_chspec_ctlchan(wlc->chanspec) ==
- wf_chspec_ctlchan(wlc->home_chanspec))) {
+ (bcm_chspec_ctlchan(wlc->chanspec) ==
+ bcm_chspec_ctlchan(wlc->home_chanspec))) {
/* get the local power constraint if we are on the AP's
* channel [802.11h, 7.3.2.13]
/* flush tx queues */
for (qi = wlc->tx_queues; qi != NULL; qi = qi->next) {
- pktq_flush(&qi->q, true, NULL, 0);
+ bcm_pktq_flush(&qi->q, true, NULL, 0);
}
callbacks += wlc_bmac_down_finish(wlc->hw);
char hexbuf[256];
/* add plcp header along with txh descriptor */
- prhex("Raw TxDesc + plcp header", (unsigned char *) txh, sizeof(d11txh_t) + 48);
+ bcm_prhex("Raw TxDesc + plcp header", (unsigned char *) txh,
+ sizeof(d11txh_t) + 48);
printk(KERN_DEBUG "TxCtlLow: %04x ", mtcl);
printk(KERN_DEBUG "TxCtlHigh: %04x ", mtch);
{0, NULL}
};
- prhex("Raw RxDesc", (unsigned char *) rxh, sizeof(d11rxhdr_t));
+ bcm_prhex("Raw RxDesc", (unsigned char *) rxh, sizeof(d11rxhdr_t));
bcm_format_flags(macstat_flags, macstatus1, flagstr, 64);
if (pktq_pfull(q, prec))
eprec = prec;
else if (pktq_full(q)) {
- p = pktq_peek_tail(q, &eprec);
+ p = bcm_pktq_peek_tail(q, &eprec);
if (eprec > prec) {
wiphy_err(wlc->wiphy, "%s: Failing: eprec %d > prec %d"
"\n", __func__, eprec, prec);
}
/* Evict packet according to discard policy */
- p = discard_oldest ? pktq_pdeq(q, eprec) : pktq_pdeq_tail(q,
- eprec);
+ p = discard_oldest ? bcm_pktq_pdeq(q, eprec) :
+ bcm_pktq_pdeq_tail(q, eprec);
/* Increment wme stats */
if (WME_ENAB(wlc->pub)) {
WLCNTINCR(wlc->pub->_wme_cnt->
tx_failed[WME_PRIO2AC(p->priority)].packets);
WLCNTADD(wlc->pub->_wme_cnt->
tx_failed[WME_PRIO2AC(p->priority)].bytes,
- pkttotlen(p));
+ bcm_pkttotlen(p));
}
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
wlc->pub->_cnt->txnobuf++;
}
/* Enqueue */
if (head)
- p = pktq_penq_head(q, prec, pkt);
+ p = bcm_pktq_penq_head(q, prec, pkt);
else
- p = pktq_penq(q, prec, pkt);
+ p = bcm_pktq_penq(q, prec, pkt);
return true;
}
* XXX we might hit this condtion in case
* packet flooding from mac80211 stack
*/
- pkt_buf_free_skb(sdu);
+ bcm_pkt_buf_free_skb(sdu);
wlc->pub->_cnt->txnobuf++;
}
/* Send all the enq'd pkts that we can.
* Dequeue packets with precedence with empty HW fifo only
*/
- while (prec_map && (pkt[0] = pktq_mdeq(q, prec_map, &prec))) {
+ while (prec_map && (pkt[0] = bcm_pktq_mdeq(q, prec_map, &prec))) {
tx_info = IEEE80211_SKB_CB(pkt[0]);
if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) {
err = wlc_sendampdu(wlc->ampdu, qi, pkt, prec);
}
if (err == -EBUSY) {
- pktq_penq_head(q, prec, pkt[0]);
+ bcm_pktq_penq_head(q, prec, pkt[0]);
/* If send failed due to any other reason than a change in
* HW FIFO condition, quit. Otherwise, read the new prec_map!
*/
qos = ieee80211_is_data_qos(h->frame_control);
/* compute length of frame in bytes for use in PLCP computations */
- len = pkttotlen(p);
+ len = bcm_pkttotlen(p);
phylen = len + FCS_LEN;
/* If WEP enabled, add room in phylen for the additional bytes of
tx_info->flags |= IEEE80211_TX_STAT_ACK;
}
- totlen = pkttotlen(p);
+ totlen = bcm_pkttotlen(p);
free_pdu = true;
wlc_txfifo_complete(wlc, queue, 1);
fatal:
if (p)
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
return true;
return;
toss:
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
}
/* calculate frame duration for Mixed-mode L-SIG spoofing, return
* leave PS mode. The watermark for flowcontrol to OS packets
* will remain the same
*/
- pktq_init(&qi->q, WLC_PREC_COUNT,
+ bcm_pktq_init(&qi->q, WLC_PREC_COUNT,
(2 * wlc->pub->tunables->datahiwat) + PKTQ_LEN_DEFAULT
+ wlc->pub->psq_pkts_total);
{
/* flush packet queue when requested */
if (drop)
- pktq_flush(&wlc->pkt_queue->q, false, NULL, 0);
+ bcm_pktq_flush(&wlc->pkt_queue->q, false, NULL, 0);
/* wait for queue and DMA fifos to run dry */
while (!pktq_empty(&wlc->pkt_queue->q) ||
#define pktq_ppeek(pq, prec) ((pq)->q[prec].head)
#define pktq_ppeek_tail(pq, prec) ((pq)->q[prec].tail)
-extern struct sk_buff *pktq_penq(struct pktq *pq, int prec,
+extern struct sk_buff *bcm_pktq_penq(struct pktq *pq, int prec,
struct sk_buff *p);
-extern struct sk_buff *pktq_penq_head(struct pktq *pq, int prec,
+extern struct sk_buff *bcm_pktq_penq_head(struct pktq *pq, int prec,
struct sk_buff *p);
-extern struct sk_buff *pktq_pdeq(struct pktq *pq, int prec);
-extern struct sk_buff *pktq_pdeq_tail(struct pktq *pq, int prec);
+extern struct sk_buff *bcm_pktq_pdeq(struct pktq *pq, int prec);
+extern struct sk_buff *bcm_pktq_pdeq_tail(struct pktq *pq, int prec);
/* packet primitives */
-extern struct sk_buff *pkt_buf_get_skb(uint len);
-extern void pkt_buf_free_skb(struct sk_buff *skb);
+extern struct sk_buff *bcm_pkt_buf_get_skb(uint len);
+extern void bcm_pkt_buf_free_skb(struct sk_buff *skb);
/* Empty the queue at particular precedence level */
-extern void pktq_pflush(struct pktq *pq, int prec,
+extern void bcm_pktq_pflush(struct pktq *pq, int prec,
bool dir, ifpkt_cb_t fn, int arg);
/* operations on a set of precedences in packet queue */
-extern int pktq_mlen(struct pktq *pq, uint prec_bmp);
-extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
+extern int bcm_pktq_mlen(struct pktq *pq, uint prec_bmp);
+extern struct sk_buff *bcm_pktq_mdeq(struct pktq *pq, uint prec_bmp,
+ int *prec_out);
/* operations on packet queue as a whole */
#define pktq_empty(pq) ((pq)->len == 0)
/* operations for single precedence queues */
-#define pktenq(pq, p) pktq_penq(((struct pktq *)pq), 0, (p))
-#define pktenq_head(pq, p) pktq_penq_head(((struct pktq *)pq), 0, (p))
-#define pktdeq(pq) pktq_pdeq(((struct pktq *)pq), 0)
-#define pktdeq_tail(pq) pktq_pdeq_tail(((struct pktq *)pq), 0)
-#define pktqinit(pq, len) pktq_init(((struct pktq *)pq), 1, len)
+#define pktenq(pq, p) bcm_pktq_penq(((struct pktq *)pq), 0, (p))
+#define pktenq_head(pq, p) bcm_pktq_penq_head(((struct pktq *)pq), 0, (p))
+#define pktdeq(pq) bcm_pktq_pdeq(((struct pktq *)pq), 0)
+#define pktdeq_tail(pq) bcm_pktq_pdeq_tail(((struct pktq *)pq), 0)
+#define pktqinit(pq, len) bcm_pktq_init(((struct pktq *)pq), 1, len)
- extern void pktq_init(struct pktq *pq, int num_prec, int max_len);
+extern void bcm_pktq_init(struct pktq *pq, int num_prec, int max_len);
/* prec_out may be NULL if caller is not interested in return value */
- extern struct sk_buff *pktq_peek_tail(struct pktq *pq, int *prec_out);
- extern void pktq_flush(struct pktq *pq, bool dir,
- ifpkt_cb_t fn, int arg);
+extern struct sk_buff *bcm_pktq_peek_tail(struct pktq *pq, int *prec_out);
+extern void bcm_pktq_flush(struct pktq *pq, bool dir,
+ ifpkt_cb_t fn, int arg);
/* externs */
/* packet */
- extern uint pktfrombuf(struct sk_buff *p,
- uint offset, int len, unsigned char *buf);
- extern uint pkttotlen(struct sk_buff *p);
+extern uint bcm_pktfrombuf(struct sk_buff *p,
+ uint offset, int len, unsigned char *buf);
+extern uint bcm_pkttotlen(struct sk_buff *p);
/* ethernet address */
- extern int bcm_ether_atoe(char *p, u8 *ea);
+extern int bcm_ether_atoe(char *p, u8 *ea);
/* ip address */
struct ipv4_addr;
extern char *bcm_ip_ntoa(struct ipv4_addr *ia, char *buf);
#ifdef BCMDBG
- extern void prpkt(const char *msg, struct sk_buff *p0);
+extern void bcm_prpkt(const char *msg, struct sk_buff *p0);
#else
-#define prpkt(a, b)
+#define bcm_prpkt(a, b)
#endif /* BCMDBG */
#define bcm_perf_enable()
/* externs */
/* crc */
- extern u8 hndcrc8(u8 *p, uint nbytes, u8 crc);
+extern u8 bcm_crc8(u8 *p, uint nbytes, u8 crc);
/* format/print */
#if defined(BCMDBG)
extern int bcm_format_flags(const bcm_bit_desc_t *bd, u32 flags,
extern int bcm_format_hex(char *str, const void *bytes, int len);
#endif
extern char *bcm_chipname(uint chipid, char *buf, uint len);
- extern void prhex(const char *msg, unsigned char *buf, uint len);
+ extern void bcm_prhex(const char *msg, unsigned char *buf, uint len);
extern bcm_tlv_t *bcm_parse_tlvs(void *buf, int buflen,
uint key);
* combination could be legal given any set of circumstances.
* RETURNS: true is the chanspec is malformed, false if it looks good.
*/
-extern bool wf_chspec_malformed(chanspec_t chanspec);
+extern bool bcm_chspec_malformed(chanspec_t chanspec);
/*
* This function returns the channel number that control traffic is being sent on, for legacy
* channels this is just the channel number, for 40MHZ channels it is the upper or lowre 20MHZ
* sideband depending on the chanspec selected
*/
-extern u8 wf_chspec_ctlchan(chanspec_t chspec);
+extern u8 bcm_chspec_ctlchan(chanspec_t chspec);
/*
* Return the channel number for a given frequency and base frequency.
*
* Reference 802.11 REVma, section 17.3.8.3, and 802.11B section 18.4.6.2
*/
-extern int wf_mhz2channel(uint freq, uint start_factor);
+extern int bcm_mhz2channel(uint freq, uint start_factor);
#endif /* _bcmwifi_h_ */
--- /dev/null
+#
+# Makefile fragment for Broadcom 802.11n Networking Device Driver Utilities
+#
+# Copyright (c) 2011 Broadcom Corporation
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+ccflags-y := \
+ -Idrivers/staging/brcm80211/util \
+ -Idrivers/staging/brcm80211/include
+
+BRCMUTIL_OFILES := \
+ bcmutils.o \
+ bcmwifi.o
+
+MODULEPFX := brcmutil
+
+obj-$(CONFIG_BRCMUTIL) += $(MODULEPFX).o
+$(MODULEPFX)-objs = $(BRCMUTIL_OFILES)
#include <bcmdevs.h>
#include <proto/802.11.h>
-struct sk_buff *BCMFASTPATH pkt_buf_get_skb(uint len)
+MODULE_AUTHOR("Broadcom Corporation");
+MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver utilities.");
+MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN cards");
+MODULE_LICENSE("Dual BSD/GPL");
+
+struct sk_buff *BCMFASTPATH bcm_pkt_buf_get_skb(uint len)
{
struct sk_buff *skb;
return skb;
}
+EXPORT_SYMBOL(bcm_pkt_buf_get_skb);
/* Free the driver packet. Free the tag if present */
-void BCMFASTPATH pkt_buf_free_skb(struct sk_buff *skb)
+void BCMFASTPATH bcm_pkt_buf_free_skb(struct sk_buff *skb)
{
struct sk_buff *nskb;
int nest = 0;
skb = nskb;
}
}
+EXPORT_SYMBOL(bcm_pkt_buf_free_skb);
+
/* copy a buffer into a pkt buffer chain */
-uint pktfrombuf(struct sk_buff *p, uint offset, int len,
+uint bcm_pktfrombuf(struct sk_buff *p, uint offset, int len,
unsigned char *buf)
{
uint n, ret = 0;
return ret;
}
+EXPORT_SYMBOL(bcm_pktfrombuf);
+
/* return total length of buffer chain */
-uint BCMFASTPATH pkttotlen(struct sk_buff *p)
+uint BCMFASTPATH bcm_pkttotlen(struct sk_buff *p)
{
uint total;
total += p->len;
return total;
}
+EXPORT_SYMBOL(bcm_pkttotlen);
/*
* osl multiple-precedence packet queue
* hi_prec is always >= the number of the highest non-empty precedence
*/
-struct sk_buff *BCMFASTPATH pktq_penq(struct pktq *pq, int prec,
+struct sk_buff *BCMFASTPATH bcm_pktq_penq(struct pktq *pq, int prec,
struct sk_buff *p)
{
struct pktq_prec *q;
return p;
}
+EXPORT_SYMBOL(bcm_pktq_penq);
-struct sk_buff *BCMFASTPATH pktq_penq_head(struct pktq *pq, int prec,
+struct sk_buff *BCMFASTPATH bcm_pktq_penq_head(struct pktq *pq, int prec,
struct sk_buff *p)
{
struct pktq_prec *q;
return p;
}
+EXPORT_SYMBOL(bcm_pktq_penq_head);
-struct sk_buff *BCMFASTPATH pktq_pdeq(struct pktq *pq, int prec)
+struct sk_buff *BCMFASTPATH bcm_pktq_pdeq(struct pktq *pq, int prec)
{
struct pktq_prec *q;
struct sk_buff *p;
return p;
}
+EXPORT_SYMBOL(bcm_pktq_pdeq);
-struct sk_buff *BCMFASTPATH pktq_pdeq_tail(struct pktq *pq, int prec)
+struct sk_buff *BCMFASTPATH bcm_pktq_pdeq_tail(struct pktq *pq, int prec)
{
struct pktq_prec *q;
struct sk_buff *p, *prev;
return p;
}
+EXPORT_SYMBOL(bcm_pktq_pdeq_tail);
void
-pktq_pflush(struct pktq *pq, int prec, bool dir,
+bcm_pktq_pflush(struct pktq *pq, int prec, bool dir,
ifpkt_cb_t fn, int arg)
{
struct pktq_prec *q;
else
prev->prev = p->prev;
p->prev = NULL;
- pkt_buf_free_skb(p);
+ bcm_pkt_buf_free_skb(p);
q->len--;
pq->len--;
p = (head ? q->head : prev->prev);
q->tail = NULL;
}
}
+EXPORT_SYMBOL(bcm_pktq_pflush);
-void pktq_flush(struct pktq *pq, bool dir,
+void bcm_pktq_flush(struct pktq *pq, bool dir,
ifpkt_cb_t fn, int arg)
{
int prec;
for (prec = 0; prec < pq->num_prec; prec++)
- pktq_pflush(pq, prec, dir, fn, arg);
+ bcm_pktq_pflush(pq, prec, dir, fn, arg);
}
+EXPORT_SYMBOL(bcm_pktq_flush);
-void pktq_init(struct pktq *pq, int num_prec, int max_len)
+void bcm_pktq_init(struct pktq *pq, int num_prec, int max_len)
{
int prec;
for (prec = 0; prec < num_prec; prec++)
pq->q[prec].max = pq->max;
}
+EXPORT_SYMBOL(bcm_pktq_init);
-struct sk_buff *pktq_peek_tail(struct pktq *pq, int *prec_out)
+struct sk_buff *bcm_pktq_peek_tail(struct pktq *pq, int *prec_out)
{
int prec;
return pq->q[prec].tail;
}
+EXPORT_SYMBOL(bcm_pktq_peek_tail);
/* Return sum of lengths of a specific set of precedences */
-int pktq_mlen(struct pktq *pq, uint prec_bmp)
+int bcm_pktq_mlen(struct pktq *pq, uint prec_bmp)
{
int prec, len;
return len;
}
+EXPORT_SYMBOL(bcm_pktq_mlen);
+
/* Priority dequeue from a specific set of precedences */
-struct sk_buff *BCMFASTPATH pktq_mdeq(struct pktq *pq, uint prec_bmp,
+struct sk_buff *BCMFASTPATH bcm_pktq_mdeq(struct pktq *pq, uint prec_bmp,
int *prec_out)
{
struct pktq_prec *q;
return p;
}
+EXPORT_SYMBOL(bcm_pktq_mdeq);
/* parse a xx:xx:xx:xx:xx:xx format ethernet address */
int bcm_ether_atoe(char *p, u8 *ea)
return i == 6;
}
+EXPORT_SYMBOL(bcm_ether_atoe);
#if defined(BCMDBG)
/* pretty hex print a pkt buffer chain */
-void prpkt(const char *msg, struct sk_buff *p0)
+void bcm_prpkt(const char *msg, struct sk_buff *p0)
{
struct sk_buff *p;
printk(KERN_DEBUG "%s:\n", msg);
for (p = p0; p; p = p->next)
- prhex(NULL, p->data, p->len);
+ bcm_prhex(NULL, p->data, p->len);
}
+EXPORT_SYMBOL(bcm_prpkt);
#endif /* defined(BCMDBG) */
/* iovar table lookup */
return NULL; /* var name not found */
}
+EXPORT_SYMBOL(bcm_iovar_lookup);
int bcm_iovar_lencheck(const bcm_iovar_t *vi, void *arg, int len, bool set)
{
return bcmerror;
}
+EXPORT_SYMBOL(bcm_iovar_lencheck);
/*******************************************************************************
* crc8
0xF4, 0x03, 0x4D, 0xBA, 0xD1, 0x26, 0x68, 0x9F
};
-u8 hndcrc8(u8 *pdata, /* pointer to array of data to process */
+u8 bcm_crc8(u8 *pdata, /* pointer to array of data to process */
uint nbytes, /* number of input data bytes to process */
u8 crc /* either CRC8_INIT_VALUE or previous return value */
) {
return crc;
}
+EXPORT_SYMBOL(bcm_crc8);
/*
* Traverse a string of 1-byte tag/1-byte length/variable-length value
return NULL;
}
+EXPORT_SYMBOL(bcm_parse_tlvs);
#if defined(BCMDBG)
return (int)(p - buf);
}
+EXPORT_SYMBOL(bcm_format_flags);
/* print bytes formatted as hex to a string. return the resulting string length */
int bcm_format_hex(char *str, const void *bytes, int len)
}
return (int)(p - str);
}
+EXPORT_SYMBOL(bcm_format_hex);
#endif /* defined(BCMDBG) */
/* pretty hex print a contiguous buffer */
-void prhex(const char *msg, unsigned char *buf, uint nbytes)
+void bcm_prhex(const char *msg, unsigned char *buf, uint nbytes)
{
char line[128], *p;
int len = sizeof(line);
if (p != line)
printk(KERN_DEBUG "%s\n", line);
}
+EXPORT_SYMBOL(bcm_prhex);
char *bcm_chipname(uint chipid, char *buf, uint len)
{
snprintf(buf, len, fmt, chipid);
return buf;
}
+EXPORT_SYMBOL(bcm_chipname);
uint bcm_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen)
{
return len;
}
+EXPORT_SYMBOL(bcm_mkiovar);
/* Quarter dBm units to mW
* Table starts at QDBM_OFFSET, so the first entry is mW for qdBm=153
*/
return (nqdBm_to_mW_map[idx] + factor / 2) / factor;
}
+EXPORT_SYMBOL(bcm_qdbm_to_mw);
+
u8 bcm_mw_to_qdbm(u16 mw)
{
u8 qdbm;
return qdbm;
}
+EXPORT_SYMBOL(bcm_mw_to_qdbm);
+
uint bcm_bitcount(u8 *bitmap, uint length)
{
uint bitcount = 0, i;
}
return bitcount;
}
+EXPORT_SYMBOL(bcm_bitcount);
+
/* Initialization of bcmstrbuf structure */
void bcm_binit(struct bcmstrbuf *b, char *buf, uint size)
{
b->origsize = b->size = size;
b->origbuf = b->buf = buf;
}
+EXPORT_SYMBOL(bcm_binit);
/* Buffer sprintf wrapper to guard against buffer overflow */
int bcm_bprintf(struct bcmstrbuf *b, const char *fmt, ...)
return r;
}
+EXPORT_SYMBOL(bcm_bprintf);
*/
#include <linux/ctype.h>
#include <linux/kernel.h>
+#include <linux/module.h>
#include <bcmdefs.h>
#include <bcmutils.h>
#include <bcmwifi.h>
* combination could be legal given any set of circumstances.
* RETURNS: true is the chanspec is malformed, false if it looks good.
*/
-bool wf_chspec_malformed(chanspec_t chanspec)
+bool bcm_chspec_malformed(chanspec_t chanspec)
{
/* must be 2G or 5G band */
if (!CHSPEC_IS5G(chanspec) && !CHSPEC_IS2G(chanspec))
return false;
}
+EXPORT_SYMBOL(bcm_chspec_malformed);
/*
* This function returns the channel number that control traffic is being sent on, for legacy
* channels this is just the channel number, for 40MHZ channels it is the upper or lowre 20MHZ
* sideband depending on the chanspec selected
*/
-u8 wf_chspec_ctlchan(chanspec_t chspec)
+u8 bcm_chspec_ctlchan(chanspec_t chspec)
{
u8 ctl_chan;
return ctl_chan;
}
+EXPORT_SYMBOL(bcm_chspec_ctlchan);
/*
* Return the channel number for a given frequency and base frequency.
*
* Reference 802.11 REVma, section 17.3.8.3, and 802.11B section 18.4.6.2
*/
-int wf_mhz2channel(uint freq, uint start_factor)
+int bcm_mhz2channel(uint freq, uint start_factor)
{
int ch = -1;
uint base;
return ch;
}
+EXPORT_SYMBOL(bcm_mhz2channel);