And use the kernel provided IS_ALIGNED one instead.
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Henry Ptasinski <henryp@broadcom.com>
Cc: Nohee Ko <noheek@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
int rc = 0;
pktdata = (u8 *) PKTDATA(pkt);
- ASSERT(ISALIGNED((uintptr) pktdata, sizeof(u16)));
+ ASSERT(IS_ALIGNED((uintptr) pktdata, sizeof(u16)));
eh = (struct ether_header *)pktdata;
/* Add space for the header */
PKTPUSH(pkt, SDPCM_HDRLEN);
- ASSERT(ISALIGNED((uintptr) PKTDATA(pkt), 2));
+ ASSERT(IS_ALIGNED((uintptr) PKTDATA(pkt), 2));
prec = PRIO2PREC((PKTPRIO(pkt) & PRIOMASK));
if (forcealign && (len & (ALIGNMENT - 1)))
len = ROUNDUP(len, ALIGNMENT);
- ASSERT(ISALIGNED((uintptr) frame, 2));
+ ASSERT(IS_ALIGNED((uintptr) frame, 2));
/* Need to lock here to protect txseq and SDIO tx calls */
dhd_os_sdlock(bus->dhd);
#define CEIL(x, y) (((x) + ((y)-1)) / (y))
#define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y))
-#define ISALIGNED(a, x) (((a) & ((x)-1)) == 0)
#define ISPOWEROF2(x) ((((x)-1)&(x)) == 0)
#define VALID_MASK(mask) (!((mask) & ((mask) + 1)))
#define SI_INFO(sih) (si_info_t *)(uintptr)sih
#define GOODCOREADDR(x, b) (((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
- ISALIGNED((x), SI_CORE_SIZE))
-#define GOODREGS(regs) ((regs) != NULL && ISALIGNED((uintptr)(regs), SI_CORE_SIZE))
+ IS_ALIGNED((x), SI_CORE_SIZE))
+#define GOODREGS(regs) ((regs) != NULL && IS_ALIGNED((uintptr)(regs), SI_CORE_SIZE))
#define BADCOREADDR 0
#define GOODIDX(idx) (((uint)idx) < SI_MAXCORES)
#define NOREV -1 /* Invalid rev */
regs = wlc_hw->regs;
osh = wlc_hw->osh;
- ASSERT(ISALIGNED(offset, sizeof(u32)));
- ASSERT(ISALIGNED(len, sizeof(u32)));
+ ASSERT(IS_ALIGNED(offset, sizeof(u32)));
+ ASSERT(IS_ALIGNED(len, sizeof(u32)));
ASSERT((offset & ~0xffff) == 0);
W_REG(osh, ®s->tplatewrptr, offset);
WL_TRACE(("wl%d: wlc_ucode_write\n", wlc_hw->unit));
- ASSERT(ISALIGNED(nbytes, sizeof(u32)));
+ ASSERT(IS_ALIGNED(nbytes, sizeof(u32)));
count = (nbytes / sizeof(u32));
ASSERT(sizeof(ht_cap_ie_t) == HT_CAP_IE_LEN);
ASSERT(offsetof(wl_scan_params_t, channel_list) ==
WL_SCAN_PARAMS_FIXED_SIZE);
- ASSERT(ISALIGNED(offsetof(wsec_key_t, data), sizeof(u32)));
+ ASSERT(IS_ALIGNED(offsetof(wsec_key_t, data), sizeof(u32)));
ASSERT(ISPOWEROF2(MA_WINDOW_SZ));
ASSERT(sizeof(wlc_d11rxhdr_t) <= WL_HWRXOFF);
ASSERT(!set || (!params && !p_len));
if (!set && (len == sizeof(int)) &&
- !(ISALIGNED((uintptr) (arg), (uint) sizeof(int)))) {
+ !(IS_ALIGNED((uintptr) (arg), (uint) sizeof(int)))) {
WL_ERROR(("wl%d: %s unaligned get ptr for %s\n",
wlc->pub->unit, __func__, name));
ASSERT(0);
}
/* RTS PLCP header */
- ASSERT(ISALIGNED((uintptr) txh->RTSPhyHeader, sizeof(u16)));
+ ASSERT(IS_ALIGNED((uintptr) txh->RTSPhyHeader, sizeof(u16)));
rts_plcp = txh->RTSPhyHeader;
if (use_cts)
rts_phylen = DOT11_CTS_LEN + DOT11_FCS_LEN;
ASSERT(!PKTNEXT(p));
ASSERT(!PKTLINK(p));
- ASSERT(ISALIGNED((uintptr) skb->data, 2));
+ ASSERT(IS_ALIGNED((uintptr) skb->data, 2));
memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
pa = DMA_MAP(di->osh, PKTDATA(p),
di->rxbufsize, DMA_RX, p, &di->rxp_dmah[rxout]);
- ASSERT(ISALIGNED(PHYSADDRLO(pa), 4));
+ ASSERT(IS_ALIGNED(PHYSADDRLO(pa), 4));
/* save the free packet pointer */
ASSERT(di->rxp[rxout] == NULL);
ASSERT(PHYSADDRLO(di->txdpa) >= PHYSADDRLO(di->txdpaorig));
di->txdalloc = alloced;
- ASSERT(ISALIGNED((uintptr) di->txd32, align));
+ ASSERT(IS_ALIGNED((uintptr) di->txd32, align));
} else {
va = dma_ringalloc(di->osh, D32RINGALIGN, size, &align_bits,
&alloced, &di->rxdpaorig, &di->rx_dmah);
/* Make sure that alignment didn't overflow */
ASSERT(PHYSADDRLO(di->rxdpa) >= PHYSADDRLO(di->rxdpaorig));
di->rxdalloc = alloced;
- ASSERT(ISALIGNED((uintptr) di->rxd32, align));
+ ASSERT(IS_ALIGNED((uintptr) di->rxd32, align));
}
return TRUE;
PHYSADDRHISET(di->txdpa, PHYSADDRHI(di->txdpaorig));
di->txdalloc = alloced;
- ASSERT(ISALIGNED((uintptr) di->txd64, align));
+ ASSERT(IS_ALIGNED((uintptr) di->txd64, align));
} else {
va = dma_ringalloc(di->osh, D64RINGALIGN, size, &align_bits,
&alloced, &di->rxdpaorig, &di->rx_dmah);
PHYSADDRHISET(di->rxdpa, PHYSADDRHI(di->rxdpaorig));
di->rxdalloc = alloced;
- ASSERT(ISALIGNED((uintptr) di->rxd64, align));
+ ASSERT(IS_ALIGNED((uintptr) di->rxd64, align));
}
return TRUE;
u16 align = (1 << align_bits);
ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
- if (!ISALIGNED(DMA_CONSISTENT_ALIGN, align))
+ if (!IS_ALIGNED(DMA_CONSISTENT_ALIGN, align))
size += align;
*alloced = size;