SDLX_MSG(("%s: Cannot enable PCI device\n", __func__));
goto err;
}
- sdh = bcmsdh_attach(osh, (void *)(uintptr) pci_resource_start(pdev, 0),
+ sdh = bcmsdh_attach(osh, (void *)(unsigned long)pci_resource_start(pdev, 0),
(void **)®s, pdev->irq);
if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
}
/* ensure that the msg buf directly follows the cdc msg struct */
- if ((uintptr) (&cdc->msg + 1) != (uintptr) cdc->buf) {
+ if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
DHD_ERROR(("dhd_prot_t is not correctly defined\n"));
goto fail;
}
bi->BSSID.octet[2], bi->BSSID.octet[3],
bi->BSSID.octet[4], bi->BSSID.octet[5]));
- bi = (wl_bss_info_t *) ((uintptr) bi +
+ bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length));
}
iscan_cur = iscan_cur->next;
bi->BSSID.octet[5]));
bi_new = bi;
- bi = (wl_bss_info_t *) ((uintptr) bi +
+ bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32
(bi->length));
/*
bi->BSSID.octet[5]));
bi_next =
- (wl_bss_info_t
- *) ((uintptr) bi +
+ (wl_bss_info_t *)((unsigned long)bi +
dtoh32
(bi->length));
bcopy(bi, bi_new,
dtoh32
(bi->length));
bi_new =
- (wl_bss_info_t
- *) ((uintptr)
- bi_new +
+ (wl_bss_info_t *)((unsigned long)bi_new +
dtoh32
(bi_new->
length));
}
break;
}
- bi = (wl_bss_info_t *) ((uintptr) bi +
+ bi = (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length));
}
}
dhd_iscan_delete_bss(dhdp, bi->BSSID.octet, iscan_cur);
- bi = (wl_bss_info_t *) ((uintptr) bi + dtoh32(bi->length));
+ bi = (wl_bss_info_t *)((unsigned long)bi + dtoh32(bi->length));
}
done:
#define PKTALIGN(osh, p, len, align) \
do { \
uint datalign; \
- datalign = (uintptr)PKTDATA((p)); \
+ datalign = (unsigned long)PKTDATA((p)); \
datalign = roundup(datalign, (align)) - datalign; \
ASSERT(datalign < (align)); \
ASSERT(PKTLEN((p)) >= ((len) + datalign)); \
frame = (u8 *) PKTDATA(pkt);
/* Add alignment padding, allocate new packet if needed */
- pad = ((uintptr) frame % DHD_SDALIGN);
+ pad = ((unsigned long)frame % DHD_SDALIGN);
if (pad) {
if (PKTHEADROOM(pkt) < pad) {
DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
free_pkt = true;
pkt = new;
frame = (u8 *) PKTDATA(pkt);
- ASSERT(((uintptr) frame % DHD_SDALIGN) == 0);
+ ASSERT(((unsigned long)frame % DHD_SDALIGN) == 0);
pad = 0;
} else {
PKTPUSH(pkt, pad);
/* Add space for the header */
PKTPUSH(pkt, SDPCM_HDRLEN);
- ASSERT(IS_ALIGNED((uintptr) PKTDATA(pkt), 2));
+ ASSERT(IS_ALIGNED((unsigned long)PKTDATA(pkt), 2));
prec = PRIO2PREC((PKTPRIO(pkt) & PRIOMASK));
/* Add alignment padding (optional for ctl frames) */
if (dhd_alignctl) {
- doff = ((uintptr) frame % DHD_SDALIGN);
+ doff = ((unsigned long)frame % DHD_SDALIGN);
if (doff) {
frame -= doff;
len += doff;
if (forcealign && (len & (ALIGNMENT - 1)))
len = roundup(len, ALIGNMENT);
- ASSERT(IS_ALIGNED((uintptr) frame, 2));
+ ASSERT(IS_ALIGNED((unsigned long)frame, 2));
/* Need to lock here to protect txseq and SDIO tx calls */
dhd_os_sdlock(bus->dhd);
sd_ptr = (sdreg_t *) params;
- addr = (uintptr) bus->regs + sd_ptr->offset;
+ addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
if (bcmsdh_regfail(bus->sdh))
sd_ptr = (sdreg_t *) params;
- addr = (uintptr) bus->regs + sd_ptr->offset;
+ addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
bcmsdh_reg_write(bus->sdh, addr, size, sd_ptr->value);
if (bcmsdh_regfail(bus->sdh))
bus->rxctl = bus->rxbuf;
if (dhd_alignctl) {
bus->rxctl += firstread;
- pad = ((uintptr) bus->rxctl % DHD_SDALIGN);
+ pad = ((unsigned long)bus->rxctl % DHD_SDALIGN);
if (pad)
bus->rxctl += (DHD_SDALIGN - pad);
bus->rxctl -= firstread;
bus->rxctl = bus->rxbuf;
if (dhd_alignctl) {
bus->rxctl += firstread;
- pad = ((uintptr) bus->rxctl %
+ pad = ((unsigned long)bus->rxctl %
DHD_SDALIGN);
if (pad)
bus->rxctl +=
DHD_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
/* We make assumptions about address window mappings */
- ASSERT((uintptr) regsva == SI_ENUM_BASE);
+ ASSERT((unsigned long)regsva == SI_ENUM_BASE);
/* BCMSDH passes venid and devid based on CIS parsing -- but
* low-power start
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((unsigned long)&bus->hdrbuf[0], DHD_SDALIGN);
/* Set the poll and/or interrupt flags */
bus->intr = (bool) dhd_intr;
}
/* Align the buffer */
- if ((uintptr) bus->databuf % DHD_SDALIGN)
+ if ((unsigned long)bus->databuf % DHD_SDALIGN)
bus->dataptr =
bus->databuf + (DHD_SDALIGN -
- ((uintptr) bus->databuf % DHD_SDALIGN));
+ ((unsigned long)bus->databuf % DHD_SDALIGN));
else
bus->dataptr = bus->databuf;
__func__, MEMBLOCK));
goto err;
}
- if ((u32) (uintptr) memblock % DHD_SDALIGN)
+ if ((u32)(unsigned long)memblock % DHD_SDALIGN)
memptr +=
- (DHD_SDALIGN - ((u32) (uintptr) memblock % DHD_SDALIGN));
+ (DHD_SDALIGN - ((u32)(unsigned long)memblock % DHD_SDALIGN));
/* Download image */
while ((len =
struct wl_bss_info *bss)
{
return bss = bss ?
- (struct wl_bss_info *)((uintptr) bss +
+ (struct wl_bss_info *)((unsigned long)bss +
dtoh32(bss->length)) : list->bss_info;
}
for (i = 0, dwrq->length = 0;
i < list->count && dwrq->length < IW_MAX_AP; i++) {
- bi = bi ? (wl_bss_info_t *) ((uintptr) bi +
+ bi = bi ? (wl_bss_info_t *) ((unsigned long)bi +
dtoh32(bi->length)) : list->
bss_info;
- ASSERT(((uintptr) bi + dtoh32(bi->length)) <=
- ((uintptr) list + buflen));
+ ASSERT(((unsigned long)bi + dtoh32(bi->length)) <=
+ ((unsigned long)list + buflen));
if (!(dtoh16(bi->capability) & DOT11_CAP_ESS))
continue;
bi = NULL;
for (i = 0, dwrq->length = 0;
i < list->count && dwrq->length < IW_MAX_AP; i++) {
- bi = bi ? (wl_bss_info_t *) ((uintptr) bi +
+ bi = bi ? (wl_bss_info_t *) ((unsigned long)bi +
dtoh32(bi->length)) :
list->bss_info;
- ASSERT(((uintptr) bi + dtoh32(bi->length)) <=
- ((uintptr) list + WLC_IW_ISCAN_MAXLEN));
+ ASSERT(((unsigned long)bi + dtoh32(bi->length)) <=
+ ((unsigned long)list + WLC_IW_ISCAN_MAXLEN));
if (!(dtoh16(bi->capability) & DOT11_CAP_ESS))
continue;
return ret;
}
- bi = bi ? (wl_bss_info_t *) ((uintptr) bi +
+ bi = bi ? (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length)) : list->
bss_info;
if (bi->rateset.count) {
if (((event - extra) +
- IW_EV_LCP_LEN) <= (uintptr) end) {
+ IW_EV_LCP_LEN) <= (unsigned long)end) {
value = event + IW_EV_LCP_LEN;
iwe.cmd = SIOCGIWRATE;
iwe.u.bitrate.fixed = iwe.u.bitrate.disabled =
bi = NULL;
for (ii = 0; ii < list->count && apcnt < IW_MAX_AP;
apcnt++, ii++) {
- bi = bi ? (wl_bss_info_t *) ((uintptr) bi +
+ bi = bi ? (wl_bss_info_t *)((unsigned long)bi +
dtoh32(bi->length)) :
list->bss_info;
- ASSERT(((uintptr) bi + dtoh32(bi->length)) <=
- ((uintptr) list + WLC_IW_ISCAN_MAXLEN));
+ ASSERT(((unsigned long)bi + dtoh32(bi->length)) <=
+ ((unsigned long)list + WLC_IW_ISCAN_MAXLEN));
if (event + ETHER_ADDR_LEN + bi->SSID_len +
IW_EV_UINT_LEN + IW_EV_FREQ_LEN + IW_EV_QUAL_LEN >=
#ifdef __i386__
1 ||
#endif
- (((uintptr) src1 | (uintptr) src2 | (uintptr) dst) &
+ (((unsigned long) src1 | (unsigned long) src2 | (unsigned long) dst) &
3) == 0) {
/* ARM CM3 rel time: 1229 (727 if alignment check could be omitted) */
/* x86 supports unaligned. This version runs 6x-9x faster on x86. */
typedef bool(*di_rxfill_t) (hnddma_t *dmah);
typedef void (*di_txreclaim_t) (hnddma_t *dmah, txd_range_t range);
typedef void (*di_rxreclaim_t) (hnddma_t *dmah);
-typedef uintptr(*di_getvar_t) (hnddma_t *dmah, const char *name);
+typedef unsigned long (*di_getvar_t) (hnddma_t *dmah, const char *name);
typedef void *(*di_getnexttxp_t) (hnddma_t *dmah, txd_range_t range);
typedef void *(*di_getnextrxp_t) (hnddma_t *dmah, bool forceall);
typedef void *(*di_peeknexttxp_t) (hnddma_t *dmah);
#ifdef BRCM_FULLMAC
#include <bcmsdh.h>
#endif
-#define OSL_WRITE_REG(osh, r, v) (bcmsdh_reg_write(NULL, (uintptr)(r), sizeof(*(r)), (v)))
-#define OSL_READ_REG(osh, r) (bcmsdh_reg_read(NULL, (uintptr)(r), sizeof(*(r))))
+#define OSL_WRITE_REG(osh, r, v) (bcmsdh_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), (v)))
+#define OSL_READ_REG(osh, r) (bcmsdh_reg_read(NULL, (unsigned long)(r), sizeof(*(r))))
#endif
#if defined(BCMSDIO)
#define GOODCOREADDR(x, b) (((x) >= (b)) && ((x) < ((b) + SI_MAXCORES * SI_CORE_SIZE)) && \
IS_ALIGNED((x), SI_CORE_SIZE))
-#define GOODREGS(regs) ((regs) != NULL && IS_ALIGNED((uintptr)(regs), SI_CORE_SIZE))
+#define GOODREGS(regs) ((regs) != NULL && IS_ALIGNED((unsigned long)(regs), SI_CORE_SIZE))
#define BADCOREADDR 0
#define GOODIDX(idx) (((uint)idx) < SI_MAXCORES)
#define NOREV -1 /* Invalid rev */
#include <linux/types.h>
-#if defined(__x86_64__)
-#define TYPEDEF_UINTPTR
-typedef unsigned long long int uintptr;
-#endif
-
-#ifndef TYPEDEF_UINTPTR
-typedef unsigned int uintptr;
-#endif
-
-#undef TYPEDEF_UINTPTR
-
#ifndef OFF
#define OFF 0
#endif
for (i = 1; i < MAXBANDS; i++) {
wlc->hw->bandstate[i] = (wlc_hwband_t *)
- ((uintptr) wlc->hw->bandstate[0] +
+ ((unsigned long)wlc->hw->bandstate[0] +
(sizeof(wlc_hwband_t) * i));
}
}
int i;
for (i = 1; i < WLC_DEFAULT_KEYS; i++) {
wlc->wsec_def_keys[i] = (wsec_key_t *)
- ((uintptr) wlc->wsec_def_keys[0] +
+ ((unsigned long)wlc->wsec_def_keys[0] +
(sizeof(wsec_key_t) * i));
}
}
for (i = 1; i < MAXBANDS; i++) {
wlc->bandstate[i] =
- (wlcband_t *) ((uintptr) wlc->bandstate[0] +
+ (wlcband_t *) ((unsigned long)wlc->bandstate[0] +
(sizeof(wlcband_t) * i));
}
}
if (r->size == sizeof(u32))
r->val =
R_REG(osh,
- (u32 *) ((unsigned char *) (uintptr) regs +
+ (u32 *)((unsigned char *)(unsigned long)regs +
r->byteoff));
else if (r->size == sizeof(u16))
r->val =
R_REG(osh,
- (u16 *) ((unsigned char *) (uintptr) regs +
+ (u16 *)((unsigned char *)(unsigned long)regs +
r->byteoff));
else
bcmerror = BCME_BADADDR;
}
if (r->size == sizeof(u32))
W_REG(osh,
- (u32 *) ((unsigned char *) (uintptr) regs +
+ (u32 *)((unsigned char *)(unsigned long) regs +
r->byteoff), r->val);
else if (r->size == sizeof(u16))
W_REG(osh,
- (u16 *) ((unsigned char *) (uintptr) regs +
+ (u16 *)((unsigned char *)(unsigned long) regs +
r->byteoff), r->val);
else
bcmerror = BCME_BADADDR;
ASSERT(!set || (!params && !p_len));
if (!set && (len == sizeof(int)) &&
- !(IS_ALIGNED((uintptr) (arg), (uint) sizeof(int)))) {
+ !(IS_ALIGNED((unsigned long)(arg), (uint) sizeof(int)))) {
WL_ERROR(("wl%d: %s unaligned get ptr for %s\n",
wlc->pub->unit, __func__, name));
ASSERT(0);
bcopy(params, &int_val, sizeof(int_val));
if (p_len >= (int)sizeof(int_val) * 2)
- bcopy((void *)((uintptr) params + sizeof(int_val)), &int_val2,
+ bcopy((void *)((unsigned long)params + sizeof(int_val)), &int_val2,
sizeof(int_val));
/* convenience int ptr for 4-byte gets (requires int aligned arg) */
}
/* RTS PLCP header */
- ASSERT(IS_ALIGNED((uintptr) txh->RTSPhyHeader, sizeof(u16)));
+ ASSERT(IS_ALIGNED((unsigned long)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(IS_ALIGNED((uintptr) skb->data, 2));
+ ASSERT(IS_ALIGNED((unsigned long)skb->data, 2));
memcpy(IEEE80211_SKB_RXCB(p), &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(wlc->pub->ieee_hw, p);
bcm_xdr_buf_init(&b, bcm_rpc_buf_data(bcm_rpc_tp_get(rpc), buf),
sizeof(u32));
- bcm_xdr_unpack_u32(&b, (u32 *) ((uintptr) & rpc_id));
+ bcm_xdr_unpack_u32(&b, (u32 *)((unsigned long) & rpc_id));
return rpc_id;
}
#endif
case PCI_BUS:
/* Set wrappers address */
- sii->curwrap = (void *)((uintptr) regs + SI_CORE_SIZE);
+ sii->curwrap = (void *)((unsigned long)regs + SI_CORE_SIZE);
/* Now point the window at the erom */
OSL_PCI_WRITE_CONFIG(sii->osh, PCI_BAR0_WIN, 4, erombase);
int rc = 0;
pktdata = (u8 *) PKTDATA(pkt);
- ASSERT(IS_ALIGNED((uintptr) pktdata, sizeof(u16)));
+ ASSERT(IS_ALIGNED((unsigned long)pktdata, sizeof(u16)));
eh = (struct ether_header *)pktdata;
static void *_dma_peeknexttxp(dma_info_t *di);
static void *_dma_peeknextrxp(dma_info_t *di);
-static uintptr _dma_getvar(dma_info_t *di, const char *name);
+static unsigned long _dma_getvar(dma_info_t *di, const char *name);
static void _dma_counterreset(dma_info_t *di);
static void _dma_fifoloopbackenable(dma_info_t *di);
static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags);
}
/* get the address of the var in order to change later */
-static uintptr _dma_getvar(dma_info_t *di, const char *name)
+static unsigned long _dma_getvar(dma_info_t *di, const char *name)
{
if (!strcmp(name, "&txavail"))
- return (uintptr) &(di->hnddma.txavail);
+ return (unsigned long)&(di->hnddma.txavail);
else {
ASSERT(0);
}
if (NULL == va)
return NULL;
- desc_strtaddr = (u32) roundup((uintptr) va, alignbytes);
+ desc_strtaddr = (u32) roundup((unsigned long)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((unsigned long)va, align);
di->txdalign =
(uint) ((s8 *)di->txd32 - (s8 *) va);
ASSERT(PHYSADDRLO(di->txdpa) >= PHYSADDRLO(di->txdpaorig));
di->txdalloc = alloced;
- ASSERT(IS_ALIGNED((uintptr) di->txd32, align));
+ ASSERT(IS_ALIGNED((unsigned long)di->txd32, align));
} else {
va = dma_ringalloc(di->osh, D32RINGALIGN, size, &align_bits,
&alloced, &di->rxdpaorig, &di->rx_dmah);
PHYSADDRHISET(di->rxdpa, 0);
ASSERT(PHYSADDRHI(di->rxdpaorig) == 0);
- di->rxd32 = (dma32dd_t *) roundup((uintptr) va, align);
+ di->rxd32 = (dma32dd_t *) roundup((unsigned long)va, align);
di->rxdalign =
(uint) ((s8 *)di->rxd32 - (s8 *) va);
/* Make sure that alignment didn't overflow */
ASSERT(PHYSADDRLO(di->rxdpa) >= PHYSADDRLO(di->rxdpaorig));
di->rxdalloc = alloced;
- ASSERT(IS_ALIGNED((uintptr) di->rxd32, align));
+ ASSERT(IS_ALIGNED((unsigned long)di->rxd32, align));
}
return true;
return false;
}
align = (1 << align_bits);
- di->txd64 = (dma64dd_t *) roundup((uintptr) va, align);
+ di->txd64 = (dma64dd_t *) roundup((unsigned long)va, align);
di->txdalign = (uint) ((s8 *)di->txd64 - (s8 *) va);
PHYSADDRLOSET(di->txdpa,
PHYSADDRLO(di->txdpaorig) + di->txdalign);
PHYSADDRHISET(di->txdpa, PHYSADDRHI(di->txdpaorig));
di->txdalloc = alloced;
- ASSERT(IS_ALIGNED((uintptr) di->txd64, align));
+ ASSERT(IS_ALIGNED((unsigned long)di->txd64, align));
} else {
va = dma_ringalloc(di->osh, D64RINGALIGN, size, &align_bits,
&alloced, &di->rxdpaorig, &di->rx_dmah);
return false;
}
align = (1 << align_bits);
- di->rxd64 = (dma64dd_t *) roundup((uintptr) va, align);
+ di->rxd64 = (dma64dd_t *) roundup((unsigned long)va, align);
di->rxdalign = (uint) ((s8 *)di->rxd64 - (s8 *) va);
PHYSADDRLOSET(di->rxdpa,
PHYSADDRLO(di->rxdpaorig) + di->rxdalign);
PHYSADDRHISET(di->rxdpa, PHYSADDRHI(di->rxdpaorig));
di->rxdalloc = alloced;
- ASSERT(IS_ALIGNED((uintptr) di->rxd64, align));
+ ASSERT(IS_ALIGNED((unsigned long)di->rxd64, align));
}
return true;
switch (BUSTYPE(sii->pub.bustype)) {
case SPI_BUS:
case SDIO_BUS:
- sbaddr = (u32) (uintptr) sii->curmap;
+ sbaddr = (u32)(unsigned long)sii->curmap;
break;
default:
ASSERT(0);