do { \
uint datalign; \
datalign = (uintptr)PKTDATA((p)); \
- datalign = ROUNDUP(datalign, (align)) - datalign; \
+ datalign = roundup(datalign, (align)) - datalign; \
ASSERT(datalign < (align)); \
ASSERT(PKTLEN((p)) >= ((len) + datalign)); \
if (datalign) \
#ifdef NOTUSED
if (PKTTAILROOM(pkt))
#endif
- len = ROUNDUP(len, ALIGNMENT);
+ len = roundup(len, ALIGNMENT);
#ifdef NOTUSED
else
DHD_ERROR(("%s: sending unrounded %d-byte packet\n",
/* Satisfy length-alignment requirements */
if (forcealign && (len & (ALIGNMENT - 1)))
- len = ROUNDUP(len, ALIGNMENT);
+ len = roundup(len, ALIGNMENT);
ASSERT(IS_ALIGNED((uintptr) frame, 2));
/* Even if there are no vars are to be written, we still
need to set the ramsize. */
- varsize = bus->varsz ? ROUNDUP(bus->varsz, 4) : 0;
+ varsize = bus->varsz ? roundup(bus->varsz, 4) : 0;
varaddr = (bus->ramsize - 4) - varsize;
if (bus->vars) {
/* Satisfy length-alignment requirements */
if (forcealign && (rdlen & (ALIGNMENT - 1)))
- rdlen = ROUNDUP(rdlen, ALIGNMENT);
+ rdlen = roundup(rdlen, ALIGNMENT);
/* Drop if the read is too big or it exceeds our maximum */
if ((rdlen + firstread) > bus->dhd->maxctl) {
is a block multiple */
if (!dlen) {
sublen +=
- (ROUNDUP(totlen, bus->blocksize) - totlen);
- totlen = ROUNDUP(totlen, bus->blocksize);
+ (roundup(totlen, bus->blocksize) - totlen);
+ totlen = roundup(totlen, bus->blocksize);
}
/* Allocate/chain packet for next subframe */
DHD_ERROR(("%s (superframe): HW hdr error: len/check "
"0x%04x/0x%04x\n", __func__, sublen, check));
errcode = -1;
- } else if (ROUNDUP(sublen, bus->blocksize) != dlen) {
+ } else if (roundup(sublen, bus->blocksize) != dlen) {
DHD_ERROR(("%s (superframe): len 0x%04x, rounded "
"0x%04x, expect 0x%04x\n",
__func__, sublen,
- ROUNDUP(sublen, bus->blocksize), dlen));
+ roundup(sublen, bus->blocksize), dlen));
errcode = -1;
} else if (SDPCM_PACKET_CHANNEL(&dptr[SDPCM_FRAMETAG_LEN]) !=
SDPCM_GLOM_CHANNEL) {
}
/* Check for consistency withreadahead info */
- len_consistent = (nextlen != (ROUNDUP(len, 16) >> 4));
+ len_consistent = (nextlen != (roundup(len, 16) >> 4));
if (len_consistent) {
/* Mismatch, force retry w/normal
header (may be >4K) */
DHD_ERROR(("%s (nextlen): mismatch, nextlen %d len %d rnd %d; " "expected rxseq %d\n",
__func__, nextlen,
- len, ROUNDUP(len, 16), rxseq));
+ len, roundup(len, 16), rxseq));
dhd_os_sdlock_rxq(bus->dhd);
PKTFREE2();
dhd_os_sdunlock_rxq(bus->dhd);
/* Satisfy length-alignment requirements */
if (forcealign && (rdlen & (ALIGNMENT - 1)))
- rdlen = ROUNDUP(rdlen, ALIGNMENT);
+ rdlen = roundup(rdlen, ALIGNMENT);
if ((rdlen + firstread) > MAX_RX_DATASZ) {
/* Too long -- skip this frame */
pktq_init(&bus->txq, (PRIOMASK + 1), QLEN);
/* Locate an appropriately-aligned portion of hdrbuf */
- bus->rxhdr = (u8 *) ROUNDUP((uintptr)&bus->hdrbuf[0], DHD_SDALIGN);
+ bus->rxhdr = (u8 *) roundup((uintptr)&bus->hdrbuf[0], DHD_SDALIGN);
/* Set the poll and/or interrupt flags */
bus->intr = (bool) dhd_intr;
#ifndef DHD_USE_STATIC_BUF
if (bus->dhd->maxctl) {
bus->rxblen =
- ROUNDUP((bus->dhd->maxctl + SDPCM_HDRLEN),
+ roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + DHD_SDALIGN;
bus->rxbuf = MALLOC(osh, bus->rxblen);
if (!(bus->rxbuf)) {
#else
if (bus->dhd->maxctl) {
bus->rxblen =
- ROUNDUP((bus->dhd->maxctl + SDPCM_HDRLEN),
+ roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + DHD_SDALIGN;
bus->rxbuf = dhd_os_prealloc(DHD_PREALLOC_RXBUF, bus->rxblen);
if (!(bus->rxbuf)) {
if (NULL == va)
return NULL;
- desc_strtaddr = (u32) ROUNDUP((uintptr) va, alignbytes);
+ desc_strtaddr = (u32) roundup((uintptr) va, alignbytes);
if (((desc_strtaddr + size - 1) & boundary) != (desc_strtaddr
& boundary)) {
*alignbits = dma_align_sizetobits(size);
PHYSADDRHISET(di->txdpa, 0);
ASSERT(PHYSADDRHI(di->txdpaorig) == 0);
- di->txd32 = (dma32dd_t *) ROUNDUP((uintptr) va, align);
+ di->txd32 = (dma32dd_t *) roundup((uintptr) va, align);
di->txdalign =
(uint) ((s8 *)di->txd32 - (s8 *) va);
PHYSADDRHISET(di->rxdpa, 0);
ASSERT(PHYSADDRHI(di->rxdpaorig) == 0);
- di->rxd32 = (dma32dd_t *) ROUNDUP((uintptr) va, align);
+ di->rxd32 = (dma32dd_t *) roundup((uintptr) va, align);
di->rxdalign =
(uint) ((s8 *)di->rxd32 - (s8 *) va);
return FALSE;
}
align = (1 << align_bits);
- di->txd64 = (dma64dd_t *) ROUNDUP((uintptr) va, align);
+ di->txd64 = (dma64dd_t *) roundup((uintptr) va, align);
di->txdalign = (uint) ((s8 *)di->txd64 - (s8 *) va);
PHYSADDRLOSET(di->txdpa,
PHYSADDRLO(di->txdpaorig) + di->txdalign);
return FALSE;
}
align = (1 << align_bits);
- di->rxd64 = (dma64dd_t *) ROUNDUP((uintptr) va, align);
+ di->rxd64 = (dma64dd_t *) roundup((uintptr) va, align);
di->rxdalign = (uint) ((s8 *)di->rxd64 - (s8 *) va);
PHYSADDRLOSET(di->rxdpa,
PHYSADDRLO(di->rxdpaorig) + di->rxdalign);