uint datalign; \
datalign = (unsigned long)((_p)->data); \
datalign = roundup(datalign, (_align)) - datalign; \
- ASSERT(datalign < (_align)); \
- ASSERT((_p)->len >= ((_len) + datalign)); \
if (datalign) \
skb_pull((_p), datalign); \
__skb_trim((_p), (_len)); \
free_pkt = true;
pkt = new;
frame = (u8 *) (pkt->data);
- ASSERT(((unsigned long)frame % BRCMF_SDALIGN) == 0);
+ /* precondition: (frame % BRCMF_SDALIGN) == 0) */
pad = 0;
} else {
skb_push(pkt, pad);
frame = (u8 *) (pkt->data);
-
- ASSERT((pad + SDPCM_HDRLEN) <= (int)(pkt->len));
+ /* precondition: pad + SDPCM_HDRLEN <= pkt->len */
memset(frame, 0, pad + SDPCM_HDRLEN);
}
}
- ASSERT(pad < BRCMF_SDALIGN);
+ /* precondition: pad < BRCMF_SDALIGN */
/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
len = (u16) (pkt->len);
ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, frame, len, pkt, NULL, NULL);
bus->f2txdata++;
- ASSERT(ret != -BCME_PENDING);
if (ret < 0) {
/* On failure, abort the command
/* Add space for the header */
skb_push(pkt, SDPCM_HDRLEN);
- ASSERT(IS_ALIGNED((unsigned long)(pkt->data), 2));
+ /* precondition: IS_ALIGNED((unsigned long)(pkt->data), 2) */
prec = PRIO2PREC((pkt->priority & PRIOMASK));
msglen += doff;
memset(frame, 0, doff + SDPCM_HDRLEN);
}
- ASSERT(doff < BRCMF_SDALIGN);
+ /* precondition: doff < BRCMF_SDALIGN */
}
doff += SDPCM_HDRLEN;
if (forcealign && (len & (ALIGNMENT - 1)))
len = roundup(len, ALIGNMENT);
- ASSERT(IS_ALIGNED((unsigned long)frame, 2));
+ /* precondition: IS_ALIGNED((unsigned long)frame, 2) */
/* Need to lock here to protect txseq and SDIO tx calls */
brcmf_sdbrcm_sdlock(bus);
brcmf_sdcard_cur_sbwad(card), SDIO_FUNC_2,
F2SYNC, frame, len, NULL, NULL, NULL);
- ASSERT(ret != -BCME_PENDING);
-
if (ret < 0) {
/* On failure, abort the command and
terminate the frame */
bool set = (actionid == IOV_SVAL(IOV_MEMBYTES));
- ASSERT(plen >= 2 * sizeof(int));
-
address = (u32) int_val;
memcpy(&int_val, (char *)params + sizeof(int_val),
sizeof(int_val));
BRCMF_TRACE(("%s: Enter\n", __func__));
- ASSERT(name);
- ASSERT(len >= 0);
+ if (name == NULL || len <= 0)
+ return -EINVAL;
- /* Get MUST have return space */
- ASSERT(set || (arg && len));
+ /* Set does not take qualifiers */
+ if (set && (params || plen))
+ return -EINVAL;
- /* Set does NOT take qualifiers */
- ASSERT(!set || (!params && !plen));
+ /* Get must have return space;*/
+ if (!set && !(arg && len))
+ return -EINVAL;
/* Look up var locally; if not found pass to host driver */
vi = brcmu_iovar_lookup(brcmf_sdio_iovars, name);
return -1;
}
- ASSERT(bus->drvr);
if (!bus->drvr)
return 0;
if ((bus->bus == SPI_BUS) && (!bus->usebufpool))
goto gotpkt;
- ASSERT(bus->rxbuf);
/* Set rxctl for frame (w/optional alignment) */
bus->rxctl = bus->rxbuf;
if (brcmf_alignctl) {
bus->rxctl += (BRCMF_SDALIGN - pad);
bus->rxctl -= firstread;
}
- ASSERT(bus->rxctl >= bus->rxbuf);
/* Copy the already-read portion over */
memcpy(bus->rxctl, hdr, firstread);
F2SYNC, (bus->rxctl + firstread), rdlen,
NULL, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);
/* Control frame failures need retransmission */
if (sdret < 0) {
num, sublen));
break;
}
- ASSERT(!(pnext->prev));
if (!pfirst) {
- ASSERT(!plast);
pfirst = plast = pnext;
} else {
- ASSERT(plast);
plast->next = pnext;
plast = pnext;
}
errcode = -1;
}
bus->f2rxdata++;
- ASSERT(errcode != -BCME_PENDING);
/* On failure, kill the superframe, allow a couple retries */
if (errcode < 0) {
__func__, num, pfirst, pfirst->data,
pfirst->len, sublen, chan, seq));
- ASSERT((chan == SDPCM_DATA_CHANNEL)
- || (chan == SDPCM_EVENT_CHANNEL));
+ /* precondition: chan == SDPCM_DATA_CHANNEL ||
+ chan == SDPCM_EVENT_CHANNEL */
if (rxseq != seq) {
BRCMF_GLOM(("%s: rx_seq %d, expected %d\n",
if (plast) {
plast->next = pnext;
} else {
- ASSERT(save_pfirst == pfirst);
save_pfirst = pnext;
}
continue;
if (plast) {
plast->next = pnext;
} else {
- ASSERT(save_pfirst == pfirst);
save_pfirst = pnext;
}
continue;
BRCMF_TRACE(("%s: Enter\n", __func__));
- ASSERT(maxframes);
-
#ifdef SDTEST
/* Allow pktgen to override maxframes */
if (bus->pktgen_count && (bus->pktgen_mode == BRCMF_PKTGEN_RECV)) {
(BRCMF_SDALIGN - pad);
bus->rxctl -= firstread;
}
- ASSERT(bus->rxctl >= bus->rxbuf);
rxbuf = bus->rxctl;
/* Read the entire frame */
sdret = brcmf_sdcard_recv_buf(card,
rxbuf, rdlen,
NULL, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);
/* Control frame failures need
retransmission */
if (bus->bus == SPI_BUS)
bus->usebufpool = true;
- ASSERT(!(pkt->prev));
PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
rxbuf = (u8 *) (pkt->data);
/* Read the entire frame */
rxbuf, rdlen,
pkt, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);
if (sdret < 0) {
BRCMF_ERROR(("%s (nextlen): read %d"
SDIO_FUNC_2, F2SYNC, bus->rxhdr, firstread,
NULL, NULL, NULL);
bus->f2rxhdrs++;
- ASSERT(sdret != -BCME_PENDING);
if (sdret < 0) {
BRCMF_ERROR(("%s: RXHEADER FAILED: %d\n", __func__,
" min %d seq %d\n", __func__, doff,
len, SDPCM_HDRLEN, seq));
bus->rx_badhdr++;
- ASSERT(0);
brcmf_sdbrcm_rxfail(bus, false, false);
continue;
}
continue;
}
- ASSERT((chan == SDPCM_DATA_CHANNEL)
- || (chan == SDPCM_EVENT_CHANNEL)
- || (chan == SDPCM_TEST_CHANNEL)
- || (chan == SDPCM_GLOM_CHANNEL));
+ /* precondition: chan is either SDPCM_DATA_CHANNEL,
+ SDPCM_EVENT_CHANNEL, SDPCM_TEST_CHANNEL or
+ SDPCM_GLOM_CHANNEL */
/* Length to read */
rdlen = (len > firstread) ? (len - firstread) : 0;
continue;
}
- ASSERT(!(pkt->prev));
-
/* Leave room for what we already read, and align remainder */
- ASSERT(firstread < pkt->len);
skb_pull(pkt, firstread);
PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
SDIO_FUNC_2, F2SYNC, ((u8 *) (pkt->data)),
rdlen, pkt, NULL, NULL);
bus->f2rxdata++;
- ASSERT(sdret != -BCME_PENDING);
if (sdret < 0) {
BRCMF_ERROR(("%s: read %d %s bytes failed: %d\n",
}
#endif
__skb_trim(pkt, len);
- ASSERT(doff == SDPCM_HDRLEN);
skb_pull(pkt, SDPCM_HDRLEN);
bus->glomd = pkt;
} else {
BRCMF_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
bus->drvr->busstate = BRCMF_BUS_DOWN;
- } else {
- ASSERT(devctl & SBSDIO_DEVCTL_CA_INT_ONLY);
}
#endif /* BCMDBG */
ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf,
(u32) bus->ctrl_frame_len, NULL, NULL, NULL);
- ASSERT(ret != -BCME_PENDING);
if (ret < 0) {
/* On failure, abort the command and
BRCMF_TRACE(("%s: Enter\n", __func__));
BRCMF_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
- /* We make assumptions about address window mappings */
- ASSERT(regsva == SI_ENUM_BASE);
+ /* We make an assumption about address window mappings:
+ * regsva == SI_ENUM_BASE*/
/* SDIO car passes venid and devid based on CIS parsing -- but
* low-power start
BRCMF_TRACE(("%s: Enter\n", __func__));
if (bus) {
- ASSERT(bus->drvr);
brcmf_sdbrcm_release(bus);
}