diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-07 17:04:47 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-07 17:04:47 -0700 |
commit | 7d4df48eba4cea654ee6fe6e1a51a0600807ed7b (patch) | |
tree | 7c4e3cbb7d576ac3a0b273b5908bbed460eceb0a /drivers/staging/brcm80211/util | |
parent | 4128dd9afb986321edf0baa8a3aaa3c7c5aa3730 (diff) | |
download | op-kernel-dev-7d4df48eba4cea654ee6fe6e1a51a0600807ed7b.zip op-kernel-dev-7d4df48eba4cea654ee6fe6e1a51a0600807ed7b.tar.gz |
Staging: brcm80211: s/uint16/u16/
Use the kernel types, don't invent your own.
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>
Diffstat (limited to 'drivers/staging/brcm80211/util')
-rw-r--r-- | drivers/staging/brcm80211/util/bcmotp.c | 54 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/bcmsrom.c | 56 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/bcmutils.c | 10 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/hnddma.c | 102 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/hndpmu.c | 10 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/linux_osl.c | 12 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/nicpci.c | 6 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/qmath.c | 32 | ||||
-rw-r--r-- | drivers/staging/brcm80211/util/siutils.c | 24 |
9 files changed, 153 insertions, 153 deletions
diff --git a/drivers/staging/brcm80211/util/bcmotp.c b/drivers/staging/brcm80211/util/bcmotp.c index 0e257ba..5bfc0ee 100644 --- a/drivers/staging/brcm80211/util/bcmotp.c +++ b/drivers/staging/brcm80211/util/bcmotp.c @@ -59,8 +59,8 @@ typedef int (*otp_status_t) (void *oh); typedef int (*otp_size_t) (void *oh); typedef void *(*otp_init_t) (si_t *sih); -typedef uint16(*otp_read_bit_t) (void *oh, chipcregs_t *cc, uint off); -typedef int (*otp_read_region_t) (si_t *sih, int region, uint16 *data, +typedef u16(*otp_read_bit_t) (void *oh, chipcregs_t *cc, uint off); +typedef int (*otp_read_region_t) (si_t *sih, int region, u16 *data, uint *wlen); typedef int (*otp_nvread_t) (void *oh, char *data, uint *len); @@ -82,18 +82,18 @@ typedef struct { #ifdef BCMIPXOTP /* IPX OTP section */ - uint16 wsize; /* Size of otp in words */ - uint16 rows; /* Geometry */ - uint16 cols; /* Geometry */ + u16 wsize; /* Size of otp in words */ + u16 rows; /* Geometry */ + u16 cols; /* Geometry */ uint32 status; /* Flag bits (lock/prog/rv). * (Reflected only when OTP is power cycled) */ - uint16 hwbase; /* hardware subregion offset */ - uint16 hwlim; /* hardware subregion boundary */ - uint16 swbase; /* software subregion offset */ - uint16 swlim; /* software subregion boundary */ - uint16 fbase; /* fuse subregion offset */ - uint16 flim; /* fuse subregion boundary */ + u16 hwbase; /* hardware subregion offset */ + u16 hwlim; /* hardware subregion boundary */ + u16 swbase; /* software subregion offset */ + u16 swlim; /* software subregion boundary */ + u16 fbase; /* fuse subregion offset */ + u16 flim; /* fuse subregion boundary */ int otpgu_base; /* offset to General Use Region */ #endif /* BCMIPXOTP */ @@ -173,7 +173,7 @@ static int ipxotp_size(void *oh) return (int)oi->wsize * 2; } -static uint16 ipxotp_otpr(void *oh, chipcregs_t *cc, uint wn) +static u16 ipxotp_otpr(void *oh, chipcregs_t *cc, uint wn) { otpinfo_t *oi; @@ -185,7 +185,7 @@ static uint16 ipxotp_otpr(void *oh, chipcregs_t *cc, uint wn) return R_REG(oi->osh, &cc->sromotp[wn]); } -static uint16 ipxotp_read_bit(void *oh, chipcregs_t *cc, uint off) +static u16 ipxotp_read_bit(void *oh, chipcregs_t *cc, uint off) { otpinfo_t *oi = (otpinfo_t *) oh; uint k, row, col; @@ -373,7 +373,7 @@ static void *BCMNMIATTACHFN(ipxotp_init) (si_t *sih) return (void *)oi; } -static int ipxotp_read_region(void *oh, int region, uint16 *data, uint *wlen) +static int ipxotp_read_region(void *oh, int region, u16 *data, uint *wlen) { otpinfo_t *oi = (otpinfo_t *) oh; uint idx; @@ -567,26 +567,26 @@ static int hndotp_size(void *oh) return (int)(oi->size); } -static uint16 hndotp_otpr(void *oh, chipcregs_t *cc, uint wn) +static u16 hndotp_otpr(void *oh, chipcregs_t *cc, uint wn) { otpinfo_t *oi = (otpinfo_t *) oh; osl_t *osh; - volatile uint16 *ptr; + volatile u16 *ptr; ASSERT(wn < ((oi->size / 2) + OTP_RC_LIM_OFF)); ASSERT(cc != NULL); osh = si_osh(oi->sih); - ptr = (volatile uint16 *)((volatile char *)cc + CC_SROM_OTP); + ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP); return R_REG(osh, &ptr[wn]); } -static uint16 hndotp_otproff(void *oh, chipcregs_t *cc, int woff) +static u16 hndotp_otproff(void *oh, chipcregs_t *cc, int woff) { otpinfo_t *oi = (otpinfo_t *) oh; osl_t *osh; - volatile uint16 *ptr; + volatile u16 *ptr; ASSERT(woff >= (-((int)oi->size / 2))); ASSERT(woff < OTP_LIM_OFF); @@ -594,12 +594,12 @@ static uint16 hndotp_otproff(void *oh, chipcregs_t *cc, int woff) osh = si_osh(oi->sih); - ptr = (volatile uint16 *)((volatile char *)cc + CC_SROM_OTP); + ptr = (volatile u16 *)((volatile char *)cc + CC_SROM_OTP); return R_REG(osh, &ptr[(oi->size / 2) + woff]); } -static uint16 hndotp_read_bit(void *oh, chipcregs_t *cc, uint idx) +static u16 hndotp_read_bit(void *oh, chipcregs_t *cc, uint idx) { otpinfo_t *oi = (otpinfo_t *) oh; uint k, row, col; @@ -627,7 +627,7 @@ static uint16 hndotp_read_bit(void *oh, chipcregs_t *cc, uint idx) return 0xffff; } st = (st & OTPP_VALUE_MASK) >> OTPP_VALUE_SHIFT; - return (uint16) st; + return (u16) st; } static void *BCMNMIATTACHFN(hndotp_init) (si_t *sih) @@ -706,7 +706,7 @@ static void *BCMNMIATTACHFN(hndotp_init) (si_t *sih) return ret; } -static int hndotp_read_region(void *oh, int region, uint16 *data, uint *wlen) +static int hndotp_read_region(void *oh, int region, u16 *data, uint *wlen) { otpinfo_t *oi = (otpinfo_t *) oh; uint32 idx, st; @@ -745,7 +745,7 @@ static int hndotp_nvread(void *oh, char *data, uint *len) uint32 idx; chipcregs_t *cc; uint offset; - uint16 *rawotp = NULL; + u16 *rawotp = NULL; /* save the orig core */ idx = si_coreidx(oi->sih); @@ -885,12 +885,12 @@ int otp_size(void *oh) return oi->fn->size(oh); } -uint16 otp_read_bit(void *oh, uint offset) +u16 otp_read_bit(void *oh, uint offset) { otpinfo_t *oi = (otpinfo_t *) oh; uint idx = si_coreidx(oi->sih); chipcregs_t *cc = si_setcoreidx(oi->sih, SI_CC_IDX); - uint16 readBit = (uint16) oi->fn->read_bit(oh, cc, offset); + u16 readBit = (u16) oi->fn->read_bit(oh, cc, offset); si_setcoreidx(oi->sih, idx); return readBit; } @@ -928,7 +928,7 @@ void *BCMNMIATTACHFN(otp_init) (si_t *sih) } int -BCMNMIATTACHFN(otp_read_region) (si_t *sih, int region, uint16 *data, +BCMNMIATTACHFN(otp_read_region) (si_t *sih, int region, u16 *data, uint *wlen) { bool wasup = FALSE; void *oh; diff --git a/drivers/staging/brcm80211/util/bcmsrom.c b/drivers/staging/brcm80211/util/bcmsrom.c index 842b70a..73e48a6 100644 --- a/drivers/staging/brcm80211/util/bcmsrom.c +++ b/drivers/staging/brcm80211/util/bcmsrom.c @@ -70,7 +70,7 @@ extern uint _varsz; static int initvars_srom_si(si_t *sih, osl_t *osh, void *curmap, char **vars, uint *count); -static void _initvars_srom_pci(u8 sromrev, uint16 *srom, uint off, +static void _initvars_srom_pci(u8 sromrev, u16 *srom, uint off, varbuf_t *b); static int initvars_srom_pci(si_t *sih, void *curmap, char **vars, uint *count); @@ -78,15 +78,15 @@ static int initvars_flash_si(si_t *sih, char **vars, uint *count); #ifdef BCMSDIO static int initvars_cis_sdio(osl_t *osh, char **vars, uint *count); static int sprom_cmd_sdio(osl_t *osh, u8 cmd); -static int sprom_read_sdio(osl_t *osh, uint16 addr, uint16 *data); +static int sprom_read_sdio(osl_t *osh, u16 addr, u16 *data); #endif /* BCMSDIO */ -static int sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff, - uint16 *buf, uint nwords, bool check_crc); +static int sprom_read_pci(osl_t *osh, si_t *sih, u16 *sprom, uint wordoff, + u16 *buf, uint nwords, bool check_crc); #if defined(BCMNVRAMR) -static int otp_read_pci(osl_t *osh, si_t *sih, uint16 *buf, uint bufsz); +static int otp_read_pci(osl_t *osh, si_t *sih, u16 *buf, uint bufsz); #endif -static uint16 srom_cc_cmd(si_t *sih, osl_t *osh, void *ccregs, uint32 cmd, - uint wordoff, uint16 data); +static u16 srom_cc_cmd(si_t *sih, osl_t *osh, void *ccregs, uint32 cmd, + uint wordoff, u16 data); static int initvars_table(osl_t *osh, char *start, char *end, char **vars, uint *count); @@ -197,7 +197,7 @@ BCMATTACHFN(srom_var_init) (si_t *sih, uint bustype, void *curmap, osl_t *osh, /* support only 16-bit word read from srom */ int srom_read(si_t *sih, uint bustype, void *curmap, osl_t *osh, - uint byteoff, uint nbytes, uint16 *buf, bool check_crc) + uint byteoff, uint nbytes, u16 *buf, bool check_crc) { uint off, nw; #ifdef BCMSDIO @@ -218,9 +218,9 @@ srom_read(si_t *sih, uint bustype, void *curmap, osl_t *osh, return 1; if (si_is_sprom_available(sih)) { - uint16 *srom; + u16 *srom; - srom = (uint16 *) SROM_OFFSET(sih); + srom = (u16 *) SROM_OFFSET(sih); if (srom == NULL) return 1; @@ -240,7 +240,7 @@ srom_read(si_t *sih, uint bustype, void *curmap, osl_t *osh, nw = nbytes / 2; for (i = 0; i < nw; i++) { if (sprom_read_sdio - (osh, (uint16) (off + i), (uint16 *) (buf + i))) + (osh, (u16) (off + i), (u16 *) (buf + i))) return 1; } #endif /* BCMSDIO */ @@ -1014,7 +1014,7 @@ BCMATTACHFN(srom_parsecis) (osl_t *osh, u8 *pcis[], uint ciscnt, break; case HNBU_FEM:{ - uint16 fem = + u16 fem = (cis[i + 2] << 8) + cis[i + 1]; varbuf_append(&b, @@ -1336,7 +1336,7 @@ BCMATTACHFN(srom_parsecis) (osl_t *osh, u8 *pcis[], uint ciscnt, #if defined(BCMSDIO) case HNBU_SROM3SWRGN: if (tlen >= 73) { - uint16 srom[35]; + u16 srom[35]; u8 srev = cis[i + 1 + 70]; ASSERT(srev == 3); /* make tuple value 16-bit aligned and parse it */ @@ -1412,9 +1412,9 @@ BCMATTACHFN(srom_parsecis) (osl_t *osh, u8 *pcis[], uint ciscnt, /* In chips with chipcommon rev 32 and later, the srom is in chipcommon, * not in the bus cores. */ -static uint16 +static u16 srom_cc_cmd(si_t *sih, osl_t *osh, void *ccregs, uint32 cmd, uint wordoff, - uint16 data) + u16 data) { chipcregs_t *cc = (chipcregs_t *) ccregs; uint wait_cnt = 1000; @@ -1437,7 +1437,7 @@ srom_cc_cmd(si_t *sih, osl_t *osh, void *ccregs, uint32 cmd, uint wordoff, return 0xffff; } if (cmd == SRC_OP_READ) - return (uint16) R_REG(osh, &cc->sromdata); + return (u16) R_REG(osh, &cc->sromdata); else return 0xffff; } @@ -1447,8 +1447,8 @@ srom_cc_cmd(si_t *sih, osl_t *osh, void *ccregs, uint32 cmd, uint wordoff, * Return 0 on success, nonzero on error. */ static int -sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff, - uint16 *buf, uint nwords, bool check_crc) +sprom_read_pci(osl_t *osh, si_t *sih, u16 *sprom, uint wordoff, + u16 *buf, uint nwords, bool check_crc) { int err = 0; uint i; @@ -1507,7 +1507,7 @@ sprom_read_pci(osl_t *osh, si_t *sih, uint16 *sprom, uint wordoff, } #if defined(BCMNVRAMR) -static int otp_read_pci(osl_t *osh, si_t *sih, uint16 *buf, uint bufsz) +static int otp_read_pci(osl_t *osh, si_t *sih, u16 *buf, uint bufsz) { u8 *otp; uint sz = OTP_SZ_MAX / 2; /* size in words */ @@ -1522,7 +1522,7 @@ static int otp_read_pci(osl_t *osh, si_t *sih, uint16 *buf, uint bufsz) bzero(otp, OTP_SZ_MAX); - err = otp_read_region(sih, OTP_HW_RGN, (uint16 *) otp, &sz); + err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz); bcopy(otp, buf, bufsz); @@ -1673,7 +1673,7 @@ BCMATTACHFN(initvars_flash_si) (si_t *sih, char **vars, uint *count) * SROM3_SWRG_OFF (full SROM or software region). */ -static uint mask_shift(uint16 mask) +static uint mask_shift(u16 mask) { uint i; for (i = 0; i < (sizeof(mask) << 3); i++) { @@ -1684,7 +1684,7 @@ static uint mask_shift(uint16 mask) return 0; } -static uint mask_width(uint16 mask) +static uint mask_width(u16 mask) { int i; for (i = (sizeof(mask) << 3) - 1; i >= 0; i--) { @@ -1696,7 +1696,7 @@ static uint mask_width(uint16 mask) } #if defined(BCMDBG) -static bool mask_valid(uint16 mask) +static bool mask_valid(u16 mask) { uint shift = mask_shift(mask); uint width = mask_width(mask); @@ -1705,9 +1705,9 @@ static bool mask_valid(uint16 mask) #endif /* BCMDBG */ static void -BCMATTACHFN(_initvars_srom_pci) (u8 sromrev, uint16 *srom, uint off, +BCMATTACHFN(_initvars_srom_pci) (u8 sromrev, u16 *srom, uint off, varbuf_t *b) { - uint16 w; + u16 w; uint32 val; const sromvar_t *srv; uint width; @@ -1856,7 +1856,7 @@ BCMATTACHFN(_initvars_srom_pci) (u8 sromrev, uint16 *srom, uint off, static int BCMATTACHFN(initvars_srom_pci) (si_t *sih, void *curmap, char **vars, uint *count) { - uint16 *srom, *sromwindow; + u16 *srom, *sromwindow; u8 sromrev = 0; uint32 sr; varbuf_t b; @@ -1876,7 +1876,7 @@ BCMATTACHFN(initvars_srom_pci) (si_t *sih, void *curmap, char **vars, if (!srom) return -2; - sromwindow = (uint16 *) SROM_OFFSET(sih); + sromwindow = (u16 *) SROM_OFFSET(sih); if (si_is_sprom_available(sih)) { err = sprom_read_pci(osh, sih, sromwindow, 0, srom, SROM_WORDS, @@ -2059,7 +2059,7 @@ static int BCMATTACHFN(sprom_cmd_sdio) (osl_t *osh, u8 cmd) } /* read a word from the SDIO srom */ -static int sprom_read_sdio(osl_t *osh, uint16 addr, uint16 *data) +static int sprom_read_sdio(osl_t *osh, u16 addr, u16 *data) { u8 addr_l, addr_h, data_l, data_h; diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index 6489c1e..e36937a 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c @@ -200,9 +200,9 @@ void pktq_init(struct pktq *pq, int num_prec, int max_len) bzero(pq, OFFSETOF(struct pktq, q) + (sizeof(struct pktq_prec) * num_prec)); - pq->num_prec = (uint16) num_prec; + pq->num_prec = (u16) num_prec; - pq->max = (uint16) max_len; + pq->max = (u16) max_len; for (prec = 0; prec < num_prec; prec++) pq->q[prec].max = pq->max; @@ -491,7 +491,7 @@ u8 BCMROMFN(hndcrc8) (u8 *pdata, /* pointer to array of data to process */ * **************************************************************************** */ -static const uint16 crc16_table[256] = { +static const u16 crc16_table[256] = { 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF, 0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7, 0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E, @@ -526,9 +526,9 @@ static const uint16 crc16_table[256] = { 0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78 }; -uint16 BCMROMFN(hndcrc16) (u8 *pdata, /* pointer to array of data to process */ +u16 BCMROMFN(hndcrc16) (u8 *pdata, /* pointer to array of data to process */ uint nbytes, /* number of input data bytes to process */ - uint16 crc /* either CRC16_INIT_VALUE or previous return value */ + u16 crc /* either CRC16_INIT_VALUE or previous return value */ ) { while (nbytes-- > 0) CRC_INNER_LOOP(16, crc, *pdata++); diff --git a/drivers/staging/brcm80211/util/hnddma.c b/drivers/staging/brcm80211/util/hnddma.c index a4e1a0d..dd6e0d9 100644 --- a/drivers/staging/brcm80211/util/hnddma.c +++ b/drivers/staging/brcm80211/util/hnddma.c @@ -98,37 +98,37 @@ typedef struct dma_info { } d64_u; } dregs; - uint16 dmadesc_align; /* alignment requirement for dma descriptors */ + u16 dmadesc_align; /* alignment requirement for dma descriptors */ - uint16 ntxd; /* # tx descriptors tunable */ - uint16 txin; /* index of next descriptor to reclaim */ - uint16 txout; /* index of next descriptor to post */ + u16 ntxd; /* # tx descriptors tunable */ + u16 txin; /* index of next descriptor to reclaim */ + u16 txout; /* index of next descriptor to post */ void **txp; /* pointer to parallel array of pointers to packets */ osldma_t *tx_dmah; /* DMA TX descriptor ring handle */ hnddma_seg_map_t *txp_dmah; /* DMA MAP meta-data handle */ dmaaddr_t txdpa; /* Aligned physical address of descriptor ring */ dmaaddr_t txdpaorig; /* Original physical address of descriptor ring */ - uint16 txdalign; /* #bytes added to alloc'd mem to align txd */ + u16 txdalign; /* #bytes added to alloc'd mem to align txd */ uint32 txdalloc; /* #bytes allocated for the ring */ uint32 xmtptrbase; /* When using unaligned descriptors, the ptr register * is not just an index, it needs all 13 bits to be * an offset from the addr register. */ - uint16 nrxd; /* # rx descriptors tunable */ - uint16 rxin; /* index of next descriptor to reclaim */ - uint16 rxout; /* index of next descriptor to post */ + u16 nrxd; /* # rx descriptors tunable */ + u16 rxin; /* index of next descriptor to reclaim */ + u16 rxout; /* index of next descriptor to post */ void **rxp; /* pointer to parallel array of pointers to packets */ osldma_t *rx_dmah; /* DMA RX descriptor ring handle */ hnddma_seg_map_t *rxp_dmah; /* DMA MAP meta-data handle */ dmaaddr_t rxdpa; /* Aligned physical address of descriptor ring */ dmaaddr_t rxdpaorig; /* Original physical address of descriptor ring */ - uint16 rxdalign; /* #bytes added to alloc'd mem to align rxd */ + u16 rxdalign; /* #bytes added to alloc'd mem to align rxd */ uint32 rxdalloc; /* #bytes allocated for the ring */ uint32 rcvptrbase; /* Base for ptr reg when using unaligned descriptors */ /* tunables */ - uint16 rxbufsize; /* rx buffer size in bytes, + u16 rxbufsize; /* rx buffer size in bytes, * not including the extra headroom */ uint rxextrahdrroom; /* extra rx headroom, reverseved to assist upper stack @@ -206,8 +206,8 @@ static bool _dma_rxfill(dma_info_t *di); static void _dma_rxreclaim(dma_info_t *di); static void _dma_rxenable(dma_info_t *di); static void *_dma_getnextrxp(dma_info_t *di, bool forceall); -static void _dma_rx_param_get(dma_info_t *di, uint16 *rxoffset, - uint16 *rxbufsize); +static void _dma_rx_param_get(dma_info_t *di, u16 *rxoffset, + u16 *rxbufsize); static void _dma_txblock(dma_info_t *di); static void _dma_txunblock(dma_info_t *di); @@ -224,7 +224,7 @@ static void _dma_fifoloopbackenable(dma_info_t *di); static uint _dma_ctrlflags(dma_info_t *di, uint mask, uint flags); static u8 dma_align_sizetobits(uint size); static void *dma_ringalloc(osl_t *osh, uint32 boundary, uint size, - uint16 *alignbits, uint *alloced, + u16 *alignbits, uint *alloced, dmaaddr_t *descpa, osldma_t **dmah); /* Prototypes for 32-bit routines */ @@ -446,18 +446,18 @@ hnddma_t *dma_attach(osl_t *osh, char *name, si_t *sih, void *dmaregstx, di->sih = sih; /* save tunables */ - di->ntxd = (uint16) ntxd; - di->nrxd = (uint16) nrxd; + di->ntxd = (u16) ntxd; + di->nrxd = (u16) nrxd; /* the actual dma size doesn't include the extra headroom */ di->rxextrahdrroom = (rxextheadroom == -1) ? BCMEXTRAHDROOM : rxextheadroom; if (rxbufsize > BCMEXTRAHDROOM) - di->rxbufsize = (uint16) (rxbufsize - di->rxextrahdrroom); + di->rxbufsize = (u16) (rxbufsize - di->rxextrahdrroom); else - di->rxbufsize = (uint16) rxbufsize; + di->rxbufsize = (u16) rxbufsize; - di->nrxpost = (uint16) nrxpost; + di->nrxpost = (u16) nrxpost; di->rxoffset = (u8) rxoffset; /* @@ -970,11 +970,11 @@ static void _dma_rxenable(dma_info_t *di) } static void -_dma_rx_param_get(dma_info_t *di, uint16 *rxoffset, uint16 *rxbufsize) +_dma_rx_param_get(dma_info_t *di, u16 *rxoffset, u16 *rxbufsize) { /* the normal values fit into 16 bits */ - *rxoffset = (uint16) di->rxoffset; - *rxbufsize = (uint16) di->rxbufsize; + *rxoffset = (u16) di->rxoffset; + *rxbufsize = (u16) di->rxbufsize; } /* !! rx entry routine @@ -998,15 +998,15 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di) if (head == NULL) return NULL; - len = ltoh16(*(uint16 *) (PKTDATA(head))); + len = ltoh16(*(u16 *) (PKTDATA(head))); DMA_TRACE(("%s: dma_rx len %d\n", di->name, len)); #if defined(__mips__) if (!len) { - while (!(len = *(uint16 *) OSL_UNCACHED(PKTDATA(head)))) + while (!(len = *(u16 *) OSL_UNCACHED(PKTDATA(head)))) OSL_DELAY(1); - *(uint16 *) PKTDATA(head) = htol16((uint16) len); + *(u16 *) PKTDATA(head) = htol16((u16) len); } #endif /* defined(__mips__) */ @@ -1064,7 +1064,7 @@ static void *BCMFASTPATH _dma_rx(dma_info_t *di) static bool BCMFASTPATH _dma_rxfill(dma_info_t *di) { void *p; - uint16 rxin, rxout; + u16 rxin, rxout; uint32 flags = 0; uint n; uint i; @@ -1406,7 +1406,7 @@ u8 dma_align_sizetobits(uint size) * not cross page boundary */ static void *dma_ringalloc(osl_t *osh, uint32 boundary, uint size, - uint16 *alignbits, uint *alloced, + u16 *alignbits, uint *alloced, dmaaddr_t *descpa, osldma_t **dmah) { void *va; @@ -1522,8 +1522,8 @@ static bool dma32_alloc(dma_info_t *di, uint direction) uint ddlen; void *va; uint alloced; - uint16 align; - uint16 align_bits; + u16 align; + u16 align_bits; ddlen = sizeof(dma32dd_t); @@ -1666,7 +1666,7 @@ static int dma32_txfast(dma_info_t *di, void *p0, bool commit) void *p, *next; unsigned char *data; uint len; - uint16 txout; + u16 txout; uint32 flags = 0; dmaaddr_t pa; @@ -1789,8 +1789,8 @@ static int dma32_txfast(dma_info_t *di, void *p0, bool commit) */ static void *dma32_getnexttxp(dma_info_t *di, txd_range_t range) { - uint16 start, end, i; - uint16 active_desc; + u16 start, end, i; + u16 active_desc; void *txp; DMA_TRACE(("%s: dma_getnexttxp %s\n", di->name, @@ -1811,14 +1811,14 @@ static void *dma32_getnexttxp(dma_info_t *di, txd_range_t range) dma32regs_t *dregs = di->d32txregs; end = - (uint16) B2I(R_REG(di->osh, &dregs->status) & XS_CD_MASK, + (u16) B2I(R_REG(di->osh, &dregs->status) & XS_CD_MASK, dma32dd_t); if (range == HNDDMA_RANGE_TRANSFERED) { active_desc = - (uint16) ((R_REG(di->osh, &dregs->status) & + (u16) ((R_REG(di->osh, &dregs->status) & XS_AD_MASK) >> XS_AD_SHIFT); - active_desc = (uint16) B2I(active_desc, dma32dd_t); + active_desc = (u16) B2I(active_desc, dma32dd_t); if (end != active_desc) end = PREVTXD(active_desc); } @@ -1918,17 +1918,17 @@ static void *dma32_getnextrxp(dma_info_t *di, bool forceall) */ static void dma32_txrotate(dma_info_t *di) { - uint16 ad; + u16 ad; uint nactive; uint rot; - uint16 old, new; + u16 old, new; uint32 w; - uint16 first, last; + u16 first, last; ASSERT(dma32_txsuspendedidle(di)); nactive = _dma_txactive(di); - ad = (uint16) (B2I + ad = (u16) (B2I (((R_REG(di->osh, &di->d32txregs->status) & XS_AD_MASK) >> XS_AD_SHIFT), dma32dd_t)); rot = TXD(ad - di->txin); @@ -2088,12 +2088,12 @@ static bool dma64_rxstopped(dma_info_t *di) static bool dma64_alloc(dma_info_t *di, uint direction) { - uint16 size; + u16 size; uint ddlen; void *va; uint alloced = 0; - uint16 align; - uint16 align_bits; + u16 align; + u16 align_bits; ddlen = sizeof(dma64dd_t); @@ -2260,7 +2260,7 @@ static void *dma64_getpos(dma_info_t *di, bool direction) */ static int dma64_txunframed(dma_info_t *di, void *buf, uint len, bool commit) { - uint16 txout; + u16 txout; uint32 flags = 0; dmaaddr_t pa; /* phys addr */ @@ -2317,7 +2317,7 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, void *p0, bool commit) void *p, *next; unsigned char *data; uint len; - uint16 txout; + u16 txout; uint32 flags = 0; dmaaddr_t pa; @@ -2439,8 +2439,8 @@ static int BCMFASTPATH dma64_txfast(dma_info_t *di, void *p0, bool commit) */ static void *BCMFASTPATH dma64_getnexttxp(dma_info_t *di, txd_range_t range) { - uint16 start, end, i; - uint16 active_desc; + u16 start, end, i; + u16 active_desc; void *txp; DMA_TRACE(("%s: dma_getnexttxp %s\n", di->name, @@ -2461,14 +2461,14 @@ static void *BCMFASTPATH dma64_getnexttxp(dma_info_t *di, txd_range_t range) dma64regs_t *dregs = di->d64txregs; end = - (uint16) (B2I + (u16) (B2I (((R_REG(di->osh, &dregs->status0) & D64_XS0_CD_MASK) - di->xmtptrbase) & D64_XS0_CD_MASK, dma64dd_t)); if (range == HNDDMA_RANGE_TRANSFERED) { active_desc = - (uint16) (R_REG(di->osh, &dregs->status1) & + (u16) (R_REG(di->osh, &dregs->status1) & D64_XS1_AD_MASK); active_desc = (active_desc - di->xmtptrbase) & D64_XS0_CD_MASK; @@ -2589,17 +2589,17 @@ static bool _dma64_addrext(osl_t *osh, dma64regs_t * dma64regs) */ static void dma64_txrotate(dma_info_t *di) { - uint16 ad; + u16 ad; uint nactive; uint rot; - uint16 old, new; + u16 old, new; uint32 w; - uint16 first, last; + u16 first, last; ASSERT(dma64_txsuspendedidle(di)); nactive = _dma_txactive(di); - ad = (uint16) (B2I + ad = (u16) (B2I ((((R_REG(di->osh, &di->d64txregs->status1) & D64_XS1_AD_MASK) - di->xmtptrbase) & D64_XS1_AD_MASK), dma64dd_t)); diff --git a/drivers/staging/brcm80211/util/hndpmu.c b/drivers/staging/brcm80211/util/hndpmu.c index 4adbd8c..4ba758a 100644 --- a/drivers/staging/brcm80211/util/hndpmu.c +++ b/drivers/staging/brcm80211/util/hndpmu.c @@ -185,7 +185,7 @@ BCMATTACHFN(si_pmu_set_ldo_voltage) (si_t *sih, osl_t *osh, u8 ldo, /* d11 slow to fast clock transition time in slow clock cycles */ #define D11SCC_SLOW2FAST_TRANSITION 2 -uint16 BCMINITFN(si_pmu_fast_pwrup_delay) (si_t *sih, osl_t *osh) +u16 BCMINITFN(si_pmu_fast_pwrup_delay) (si_t *sih, osl_t *osh) { uint delay = PMU_MAX_TRANSITION_DLY; chipcregs_t *cc; @@ -259,7 +259,7 @@ uint16 BCMINITFN(si_pmu_fast_pwrup_delay) (si_t *sih, osl_t *osh) /* Return to original core */ si_setcoreidx(sih, origidx); - return (uint16) delay; + return (u16) delay; } uint32 BCMATTACHFN(si_pmu_force_ilp) (si_t *sih, osl_t *osh, bool force) @@ -292,7 +292,7 @@ uint32 BCMATTACHFN(si_pmu_force_ilp) (si_t *sih, osl_t *osh, bool force) /* Setup resource up/down timers */ typedef struct { u8 resnum; - uint16 updown; + u16 updown; } pmu_res_updown_t; /* Change resource dependancies masks */ @@ -872,7 +872,7 @@ void BCMATTACHFN(si_pmu_res_init) (si_t *sih, osl_t *osh) /* setup pll and query clock speed */ typedef struct { - uint16 freq; + u16 freq; u8 xf; u8 wbint; uint32 wbfrac; @@ -902,7 +902,7 @@ static const pmu0_xtaltab0_t BCMINITDATA(pmu0_xtaltab0)[] = { /* setup pll and query clock speed */ typedef struct { - uint16 fref; + u16 fref; u8 xf; u8 p1div; u8 p2div; diff --git a/drivers/staging/brcm80211/util/linux_osl.c b/drivers/staging/brcm80211/util/linux_osl.c index f6046fe..76330a8 100644 --- a/drivers/staging/brcm80211/util/linux_osl.c +++ b/drivers/staging/brcm80211/util/linux_osl.c @@ -538,10 +538,10 @@ void *osl_dma_alloc_consistent(osl_t *osh, uint size, unsigned long *pap) return pci_alloc_consistent(osh->pdev, size, (dma_addr_t *) pap); } #else /* !BRCM_FULLMAC */ -void *osl_dma_alloc_consistent(osl_t *osh, uint size, uint16 align_bits, +void *osl_dma_alloc_consistent(osl_t *osh, uint size, u16 align_bits, uint *alloced, unsigned long *pap) { - uint16 align = (1 << align_bits); + u16 align = (1 << align_bits); ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC))); if (!ISALIGNED(DMA_CONSISTENT_ALIGN, align)) @@ -664,12 +664,12 @@ u8 osl_readb(osl_t *osh, volatile u8 *r) return (u8) ((rreg) (ctx, (void *)r, sizeof(u8))); } -uint16 osl_readw(osl_t *osh, volatile uint16 *r) +u16 osl_readw(osl_t *osh, volatile u16 *r) { osl_rreg_fn_t rreg = ((osl_pubinfo_t *) osh)->rreg_fn; void *ctx = ((osl_pubinfo_t *) osh)->reg_ctx; - return (uint16) ((rreg) (ctx, (void *)r, sizeof(uint16))); + return (u16) ((rreg) (ctx, (void *)r, sizeof(u16))); } uint32 osl_readl(osl_t *osh, volatile uint32 *r) @@ -688,12 +688,12 @@ void osl_writeb(osl_t *osh, volatile u8 *r, u8 v) ((wreg) (ctx, (void *)r, v, sizeof(u8))); } -void osl_writew(osl_t *osh, volatile uint16 *r, uint16 v) +void osl_writew(osl_t *osh, volatile u16 *r, u16 v) { osl_wreg_fn_t wreg = ((osl_pubinfo_t *) osh)->wreg_fn; void *ctx = ((osl_pubinfo_t *) osh)->reg_ctx; - ((wreg) (ctx, (void *)r, v, sizeof(uint16))); + ((wreg) (ctx, (void *)r, v, sizeof(u16))); } void osl_writel(osl_t *osh, volatile uint32 *r, uint32 v) diff --git a/drivers/staging/brcm80211/util/nicpci.c b/drivers/staging/brcm80211/util/nicpci.c index 49844ec..e6b16ea 100644 --- a/drivers/staging/brcm80211/util/nicpci.c +++ b/drivers/staging/brcm80211/util/nicpci.c @@ -484,7 +484,7 @@ static void pcie_war_aspm_clkreq(pcicore_info_t *pi) { sbpcieregs_t *pcieregs = pi->regs.pcieregs; si_t *sih = pi->sih; - uint16 val16, *reg16; + u16 val16, *reg16; uint32 w; if (!PCIE_ASPM(sih)) @@ -548,7 +548,7 @@ static void pcie_war_serdes(pcicore_info_t *pi) static void BCMINITFN(pcie_misc_config_fixup) (pcicore_info_t *pi) { sbpcieregs_t *pcieregs = pi->regs.pcieregs; - uint16 val16, *reg16; + u16 val16, *reg16; reg16 = &pcieregs->sprom[SRSH_PCIE_MISC_CONFIG]; val16 = R_REG(pi->osh, reg16); @@ -564,7 +564,7 @@ static void BCMINITFN(pcie_misc_config_fixup) (pcicore_info_t *pi) static void pcie_war_noplldown(pcicore_info_t *pi) { sbpcieregs_t *pcieregs = pi->regs.pcieregs; - uint16 *reg16; + u16 *reg16; ASSERT(pi->sih->buscorerev == 7); diff --git a/drivers/staging/brcm80211/util/qmath.c b/drivers/staging/brcm80211/util/qmath.c index f9b30a6..05b937d 100644 --- a/drivers/staging/brcm80211/util/qmath.c +++ b/drivers/staging/brcm80211/util/qmath.c @@ -81,9 +81,9 @@ int32 qm_muls321616(int16 op1, int16 op2) Description: This function make 16 bit unsigned multiplication. To fit the output into 16 bits the 32 bit multiplication result is right shifted by 16 bits. */ -uint16 qm_mulu16(uint16 op1, uint16 op2) +u16 qm_mulu16(u16 op1, u16 op2) { - return (uint16) (((uint32) op1 * (uint32) op2) >> 16); + return (u16) (((uint32) op1 * (uint32) op2) >> 16); } /* @@ -258,7 +258,7 @@ Example: qm_norm16(0x0080) = 7. */ int16 qm_norm16(int16 op) { - uint16 u16extraSignBits; + u16 u16extraSignBits; if (op == 0) { return 15; } else { @@ -277,7 +277,7 @@ Example: qm_norm32(0x00000080) = 23 */ int16 qm_norm32(int32 op) { - uint16 u16extraSignBits; + u16 u16extraSignBits; if (op == 0) { return 31; } else { @@ -407,7 +407,7 @@ into 32 bit output. int32 qm_mul323216(int32 op1, int16 op2) { int16 hi; - uint16 lo; + u16 lo; int32 result; hi = op1 >> 16; lo = (int16) (op1 & 0xffff); @@ -420,7 +420,7 @@ int32 qm_mul323216(int32 op1, int16 op2) Description: This function multiply signed 16 bit number with unsigned 16 bit number and return the result in 32 bits. */ -int32 qm_mulsu321616(int16 op1, uint16 op2) +int32 qm_mulsu321616(int16 op1, u16 op2) { return (int32) (op1) * op2; } @@ -434,7 +434,7 @@ When the input numbers are 0x80000000, 0x8000 the return value is saturated to 0 int32 qm_muls323216(int32 op1, int16 op2) { int16 hi; - uint16 lo; + u16 lo; int32 result; hi = op1 >> 16; lo = (int16) (op1 & 0xffff); @@ -451,12 +451,12 @@ multiplication result is returned as output. int32 qm_mul32(int32 a, int32 b) { int16 hi1, hi2; - uint16 lo1, lo2; + u16 lo1, lo2; int32 result; hi1 = a >> 16; hi2 = b >> 16; - lo1 = (uint16) (a & 0xffff); - lo2 = (uint16) (b & 0xffff); + lo1 = (u16) (a & 0xffff); + lo2 = (u16) (b & 0xffff); result = qm_mul321616(hi1, hi2); result = result + (qm_mulsu321616(hi1, lo2) >> 16); result = result + (qm_mulsu321616(hi2, lo1) >> 16); @@ -474,12 +474,12 @@ When the input numbers are 0x80000000, 0x80000000 the return value is saturated int32 qm_muls32(int32 a, int32 b) { int16 hi1, hi2; - uint16 lo1, lo2; + u16 lo1, lo2; int32 result; hi1 = a >> 16; hi2 = b >> 16; - lo1 = (uint16) (a & 0xffff); - lo2 = (uint16) (b & 0xffff); + lo1 = (u16) (a & 0xffff); + lo2 = (u16) (b & 0xffff); result = qm_muls321616(hi1, hi2); result = qm_add32(result, (qm_mulsu321616(hi1, lo2) >> 15)); result = qm_add32(result, (qm_mulsu321616(hi2, lo1) >> 15)); @@ -548,7 +548,7 @@ For accurate results input should be in normalized or near normalized form. void qm_log10(int32 N, int16 qN, int16 *log10N, int16 *qLog10N) { int16 s16norm, s16tableIndex, s16errorApproximation; - uint16 u16offset; + u16 u16offset; int32 s32log; /* Logerithm of negative values is undefined. @@ -580,13 +580,13 @@ void qm_log10(int32 N, int16 qN, int16 *log10N, int16 *qLog10N) /* take the offset as the 16 MSBS after table index. */ - u16offset = (uint16) (N >> (32 - (2 + LOG2_LOG_TABLE_SIZE + 16))); + u16offset = (u16) (N >> (32 - (2 + LOG2_LOG_TABLE_SIZE + 16))); /* look the log value in the table. */ s32log = log_table[s16tableIndex]; /* q.15 format */ /* interpolate using the offset. */ - s16errorApproximation = (int16) qm_mulu16(u16offset, (uint16) (log_table[s16tableIndex + 1] - log_table[s16tableIndex])); /* q.15 */ + s16errorApproximation = (int16) qm_mulu16(u16offset, (u16) (log_table[s16tableIndex + 1] - log_table[s16tableIndex])); /* q.15 */ s32log = qm_add16((int16) s32log, s16errorApproximation); /* q.15 format */ diff --git a/drivers/staging/brcm80211/util/siutils.c b/drivers/staging/brcm80211/util/siutils.c index 1a4c2b6..73b8a00 100644 --- a/drivers/staging/brcm80211/util/siutils.c +++ b/drivers/staging/brcm80211/util/siutils.c @@ -320,13 +320,13 @@ static __used void BCMATTACHFN(si_nvram_process) (si_info_t *sii, char *pvars) /* do a pci config read to get subsystem id and subvendor id */ w = OSL_PCI_READ_CONFIG(sii->osh, PCI_CFG_SVID, sizeof(uint32)); /* Let nvram variables override subsystem Vend/ID */ - sii->pub.boardvendor = (uint16)si_getdevpathintvar(&sii->pub, + sii->pub.boardvendor = (u16)si_getdevpathintvar(&sii->pub, "boardvendor"); if (sii->pub.boardvendor == 0) sii->pub.boardvendor = w & 0xffff; else SI_ERROR(("Overriding boardvendor: 0x%x instead of 0x%x\n", sii->pub.boardvendor, w & 0xffff)); - sii->pub.boardtype = (uint16)si_getdevpathintvar(&sii->pub, + sii->pub.boardtype = (u16)si_getdevpathintvar(&sii->pub, "boardtype"); if (sii->pub.boardtype == 0) sii->pub.boardtype = (w >> 16) & 0xffff; @@ -1389,23 +1389,23 @@ void si_watchdog_ms(si_t *sih, uint32 ms) si_watchdog(sih, wd_msticks * ms); } -uint16 BCMATTACHFN(si_d11_devid) (si_t *sih) +u16 BCMATTACHFN(si_d11_devid) (si_t *sih) { si_info_t *sii = SI_INFO(sih); - uint16 device; + u16 device; /* normal case: nvram variable with devpath->devid->wl0id */ - device = (uint16) si_getdevpathintvar(sih, "devid"); + device = (u16) si_getdevpathintvar(sih, "devid"); if (device != 0) goto bail; /* Get devid from OTP/SPROM depending on where the SROM is read */ - device = (uint16) getintvar(sii->vars, "devid"); + device = (u16) getintvar(sii->vars, "devid"); if (device != 0) goto bail; /* no longer support wl0id, but keep the code here for backward compatibility. */ - device = (uint16) getintvar(sii->vars, "wl0id"); + device = (u16) getintvar(sii->vars, "wl0id"); if (device != 0) goto bail; @@ -1543,13 +1543,13 @@ void BCMINITFN(si_clkctl_init) (si_t *sih) } /* return the value suitable for writing to the dot11 core FAST_PWRUP_DELAY register */ -uint16 BCMINITFN(si_clkctl_fast_pwrup_delay) (si_t *sih) +u16 BCMINITFN(si_clkctl_fast_pwrup_delay) (si_t *sih) { si_info_t *sii; uint origidx = 0; chipcregs_t *cc; uint slowminfreq; - uint16 fpdelay; + u16 fpdelay; uint intr_val = 0; bool fast; @@ -2183,7 +2183,7 @@ int si_pci_fixcfg(si_t *sih) sbpciregs_t *pciregs = NULL; sbpcieregs_t *pcieregs = NULL; void *regs = NULL; - uint16 val16, *reg16 = NULL; + u16 val16, *reg16 = NULL; si_info_t *sii = SI_INFO(sih); @@ -2208,9 +2208,9 @@ int si_pci_fixcfg(si_t *sih) } pciidx = si_coreidx(&sii->pub); val16 = R_REG(sii->osh, reg16); - if (((val16 & SRSH_PI_MASK) >> SRSH_PI_SHIFT) != (uint16) pciidx) { + if (((val16 & SRSH_PI_MASK) >> SRSH_PI_SHIFT) != (u16) pciidx) { val16 = - (uint16) (pciidx << SRSH_PI_SHIFT) | (val16 & + (u16) (pciidx << SRSH_PI_SHIFT) | (val16 & ~SRSH_PI_MASK); W_REG(sii->osh, reg16, val16); } |