]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/brcm80211/phy/wlc_phy_cmn.c
staging: brcm80211 needs lots of delay.h
[mv-sheeva.git] / drivers / staging / brcm80211 / phy / wlc_phy_cmn.c
index 5d470dd6def0e7da74c3f7bf487688becf0a942c..b223433482f15b7ccad1f94035dc9652e102f538 100644 (file)
 
 #include <wlc_cfg.h>
 
-#include <typedefs.h>
-#include <osl.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
-#include <linuxver.h>
+#include <bcmdefs.h>
+#include <osl.h>
+#include <linux/delay.h>
+#include <linux/module.h>
+#include <linux/pci.h>
 #include <bcmendian.h>
 #include <bcmnvram.h>
 #include <sbchipc.h>
+#include <bcmdevs.h>
+#include <sbhndpio.h>
+#include <sbhnddma.h>
 
 #include <wlc_phy_int.h>
 #include <wlc_phyreg_n.h>
 #include <wlc_phy_radio.h>
 #include <wlc_phy_lcn.h>
 
-uint32 phyhal_msg_level = PHYHAL_ERROR;
+u32 phyhal_msg_level = PHYHAL_ERROR;
 
 typedef struct _chan_info_basic {
-       uint16 chan;
-       uint16 freq;
+       u16 chan;
+       u16 freq;
 } chan_info_basic_t;
 
 static chan_info_basic_t chan_info_all[] = {
@@ -97,7 +102,7 @@ static chan_info_basic_t chan_info_all[] = {
        {216, 50800}
 };
 
-uint16 ltrn_list[PHY_LTRN_LIST_LEN] = {
+u16 ltrn_list[PHY_LTRN_LIST_LEN] = {
        0x18f9, 0x0d01, 0x00e4, 0xdef4, 0x06f1, 0x0ffc,
        0xfa27, 0x1dff, 0x10f0, 0x0918, 0xf20a, 0xe010,
        0x1417, 0x1104, 0xf114, 0xf2fa, 0xf7db, 0xe2fc,
@@ -126,14 +131,14 @@ const u8 ofdm_rate_lookup[] = {
 #define PHY_WREG_LIMIT 24
 
 static void wlc_set_phy_uninitted(phy_info_t *pi);
-static uint32 wlc_phy_get_radio_ver(phy_info_t *pi);
+static u32 wlc_phy_get_radio_ver(phy_info_t *pi);
 static void wlc_phy_timercb_phycal(void *arg);
 
-static bool wlc_phy_noise_calc_phy(phy_info_t *pi, uint32 *cmplx_pwr,
-                                  int8 *pwr_ant);
+static bool wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr,
+                                  s8 *pwr_ant);
 
 static void wlc_phy_cal_perical_mphase_schedule(phy_info_t *pi, uint delay);
-static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, int8 noise_dbm);
+static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, s8 noise_dbm);
 static void wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason,
                                         u8 ch);
 
@@ -141,11 +146,11 @@ static void wlc_phy_txpower_reg_limit_calc(phy_info_t *pi,
                                           struct txpwr_limits *tp, chanspec_t);
 static bool wlc_phy_cal_txpower_recalc_sw(phy_info_t *pi);
 
-static int8 wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan,
-                                            uint32 band, u8 rate);
-static void wlc_phy_upd_env_txpwr_rate_limits(phy_info_t *pi, uint32 band);
-static int8 wlc_phy_env_measure_vbat(phy_info_t *pi);
-static int8 wlc_phy_env_measure_temperature(phy_info_t *pi);
+static s8 wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan,
+                                            u32 band, u8 rate);
+static void wlc_phy_upd_env_txpwr_rate_limits(phy_info_t *pi, u32 band);
+static s8 wlc_phy_env_measure_vbat(phy_info_t *pi);
+static s8 wlc_phy_env_measure_temperature(phy_info_t *pi);
 
 char *phy_getvar(phy_info_t *pi, const char *name)
 {
@@ -163,7 +168,7 @@ char *phy_getvar(phy_info_t *pi, const char *name)
                return NULL;
 
        for (s = vars; s && *s;) {
-               if ((bcmp(s, name, len) == 0) && (s[len] == '='))
+               if ((memcmp(s, name, len) == 0) && (s[len] == '='))
                        return &s[len + 1];
 
                while (*s++)
@@ -201,22 +206,22 @@ void wlc_radioreg_enter(wlc_phy_t *pih)
        phy_info_t *pi = (phy_info_t *) pih;
        wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, MCTL_LOCK_RADIO);
 
-       OSL_DELAY(10);
+       udelay(10);
 }
 
 void wlc_radioreg_exit(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
-       volatile uint16 dummy;
+       volatile u16 dummy;
 
        dummy = R_REG(pi->sh->osh, &pi->regs->phyversion);
        pi->phy_wreg = 0;
        wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, 0);
 }
 
-uint16 read_radio_reg(phy_info_t *pi, uint16 addr)
+u16 read_radio_reg(phy_info_t *pi, u16 addr)
 {
-       uint16 data;
+       u16 data;
 
        if ((addr == RADIO_IDCODE))
                return 0xffff;
@@ -270,9 +275,9 @@ uint16 read_radio_reg(phy_info_t *pi, uint16 addr)
        return data;
 }
 
-void write_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
+void write_radio_reg(phy_info_t *pi, u16 addr, u16 val)
 {
-       osl_t *osh;
+       struct osl_info *osh;
 
        if (NORADIO_ENAB(pi->pubpi))
                return;
@@ -296,7 +301,7 @@ void write_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
                W_REG(osh, &pi->regs->phy4wdatalo, val);
        }
 
-       if (BUSTYPE(pi->sh->bustype) == PCI_BUS) {
+       if (pi->sh->bustype == PCI_BUS) {
                if (++pi->phy_wreg >= pi->phy_wreg_limit) {
                        (void)R_REG(osh, &pi->regs->maccontrol);
                        pi->phy_wreg = 0;
@@ -304,31 +309,31 @@ void write_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
        }
 }
 
-static uint32 read_radio_id(phy_info_t *pi)
+static u32 read_radio_id(phy_info_t *pi)
 {
-       uint32 id;
+       u32 id;
 
        if (NORADIO_ENAB(pi->pubpi))
                return NORADIO_IDCODE;
 
        if (D11REV_GE(pi->sh->corerev, 24)) {
-               uint32 b0, b1, b2;
+               u32 b0, b1, b2;
 
                W_REG(pi->sh->osh, &pi->regs->radioregaddr, 0);
 #ifdef __mips__
                (void)R_REG(pi->sh->osh, &pi->regs->radioregaddr);
 #endif
-               b0 = (uint32) R_REG(pi->sh->osh, &pi->regs->radioregdata);
+               b0 = (u32) R_REG(pi->sh->osh, &pi->regs->radioregdata);
                W_REG(pi->sh->osh, &pi->regs->radioregaddr, 1);
 #ifdef __mips__
                (void)R_REG(pi->sh->osh, &pi->regs->radioregaddr);
 #endif
-               b1 = (uint32) R_REG(pi->sh->osh, &pi->regs->radioregdata);
+               b1 = (u32) R_REG(pi->sh->osh, &pi->regs->radioregdata);
                W_REG(pi->sh->osh, &pi->regs->radioregaddr, 2);
 #ifdef __mips__
                (void)R_REG(pi->sh->osh, &pi->regs->radioregaddr);
 #endif
-               b2 = (uint32) R_REG(pi->sh->osh, &pi->regs->radioregdata);
+               b2 = (u32) R_REG(pi->sh->osh, &pi->regs->radioregdata);
 
                id = ((b0 & 0xf) << 28) | (((b2 << 8) | b1) << 12) | ((b0 >> 4)
                                                                      & 0xf);
@@ -337,16 +342,16 @@ static uint32 read_radio_id(phy_info_t *pi)
 #ifdef __mips__
                (void)R_REG(pi->sh->osh, &pi->regs->phy4waddr);
 #endif
-               id = (uint32) R_REG(pi->sh->osh, &pi->regs->phy4wdatalo);
-               id |= (uint32) R_REG(pi->sh->osh, &pi->regs->phy4wdatahi) << 16;
+               id = (u32) R_REG(pi->sh->osh, &pi->regs->phy4wdatalo);
+               id |= (u32) R_REG(pi->sh->osh, &pi->regs->phy4wdatahi) << 16;
        }
        pi->phy_wreg = 0;
        return id;
 }
 
-void and_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
+void and_radio_reg(phy_info_t *pi, u16 addr, u16 val)
 {
-       uint16 rval;
+       u16 rval;
 
        if (NORADIO_ENAB(pi->pubpi))
                return;
@@ -355,9 +360,9 @@ void and_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
        write_radio_reg(pi, addr, (rval & val));
 }
 
-void or_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
+void or_radio_reg(phy_info_t *pi, u16 addr, u16 val)
 {
-       uint16 rval;
+       u16 rval;
 
        if (NORADIO_ENAB(pi->pubpi))
                return;
@@ -366,9 +371,9 @@ void or_radio_reg(phy_info_t *pi, uint16 addr, uint16 val)
        write_radio_reg(pi, addr, (rval | val));
 }
 
-void xor_radio_reg(phy_info_t *pi, uint16 addr, uint16 mask)
+void xor_radio_reg(phy_info_t *pi, u16 addr, u16 mask)
 {
-       uint16 rval;
+       u16 rval;
 
        if (NORADIO_ENAB(pi->pubpi))
                return;
@@ -377,9 +382,9 @@ void xor_radio_reg(phy_info_t *pi, uint16 addr, uint16 mask)
        write_radio_reg(pi, addr, (rval ^ mask));
 }
 
-void mod_radio_reg(phy_info_t *pi, uint16 addr, uint16 mask, uint16 val)
+void mod_radio_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
 {
-       uint16 rval;
+       u16 rval;
 
        if (NORADIO_ENAB(pi->pubpi))
                return;
@@ -396,16 +401,16 @@ void write_phy_channel_reg(phy_info_t *pi, uint val)
 #if defined(BCMDBG)
 static bool wlc_phy_war41476(phy_info_t *pi)
 {
-       uint32 mc = R_REG(pi->sh->osh, &pi->regs->maccontrol);
+       u32 mc = R_REG(pi->sh->osh, &pi->regs->maccontrol);
 
        return ((mc & MCTL_EN_MAC) == 0)
            || ((mc & MCTL_PHYLOCK) == MCTL_PHYLOCK);
 }
 #endif
 
-uint16 read_phy_reg(phy_info_t *pi, uint16 addr)
+u16 read_phy_reg(phy_info_t *pi, u16 addr)
 {
-       osl_t *osh;
+       struct osl_info *osh;
        d11regs_t *regs;
 
        osh = pi->sh->osh;
@@ -424,9 +429,9 @@ uint16 read_phy_reg(phy_info_t *pi, uint16 addr)
        return R_REG(osh, &regs->phyregdata);
 }
 
-void write_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
+void write_phy_reg(phy_info_t *pi, u16 addr, u16 val)
 {
-       osl_t *osh;
+       struct osl_info *osh;
        d11regs_t *regs;
 
        osh = pi->sh->osh;
@@ -439,9 +444,9 @@ void write_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
        if (addr == 0x72)
                (void)R_REG(osh, &regs->phyregdata);
 #else
-       W_REG(osh, (volatile uint32 *)(uintptr) (&regs->phyregaddr),
+       W_REG(osh, (volatile u32 *)(&regs->phyregaddr),
              addr | (val << 16));
-       if (BUSTYPE(pi->sh->bustype) == PCI_BUS) {
+       if (pi->sh->bustype == PCI_BUS) {
                if (++pi->phy_wreg >= pi->phy_wreg_limit) {
                        pi->phy_wreg = 0;
                        (void)R_REG(osh, &regs->phyversion);
@@ -450,9 +455,9 @@ void write_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
 #endif
 }
 
-void and_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
+void and_phy_reg(phy_info_t *pi, u16 addr, u16 val)
 {
-       osl_t *osh;
+       struct osl_info *osh;
        d11regs_t *regs;
 
        osh = pi->sh->osh;
@@ -471,9 +476,9 @@ void and_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
        pi->phy_wreg = 0;
 }
 
-void or_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
+void or_phy_reg(phy_info_t *pi, u16 addr, u16 val)
 {
-       osl_t *osh;
+       struct osl_info *osh;
        d11regs_t *regs;
 
        osh = pi->sh->osh;
@@ -492,9 +497,9 @@ void or_phy_reg(phy_info_t *pi, uint16 addr, uint16 val)
        pi->phy_wreg = 0;
 }
 
-void mod_phy_reg(phy_info_t *pi, uint16 addr, uint16 mask, uint16 val)
+void mod_phy_reg(phy_info_t *pi, u16 addr, u16 mask, u16 val)
 {
-       osl_t *osh;
+       struct osl_info *osh;
        d11regs_t *regs;
 
        osh = pi->sh->osh;
@@ -518,7 +523,7 @@ static void WLBANDINITFN(wlc_set_phy_uninitted) (phy_info_t *pi)
 {
        int i, j;
 
-       pi->initialized = FALSE;
+       pi->initialized = false;
 
        pi->tx_vos = 0xffff;
        pi->nrssi_table_delta = 0x7fffffff;
@@ -551,15 +556,14 @@ static void WLBANDINITFN(wlc_set_phy_uninitted) (phy_info_t *pi)
        }
 }
 
-shared_phy_t *BCMATTACHFN(wlc_phy_shared_attach) (shared_phy_params_t *shp)
+shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
 {
        shared_phy_t *sh;
 
-       sh = (shared_phy_t *) MALLOC(shp->osh, sizeof(shared_phy_t));
+       sh = kzalloc(sizeof(shared_phy_t), GFP_ATOMIC);
        if (sh == NULL) {
                return NULL;
        }
-       bzero((char *)sh, sizeof(shared_phy_t));
 
        sh->osh = shp->osh;
        sh->sih = shp->sih;
@@ -590,9 +594,9 @@ shared_phy_t *BCMATTACHFN(wlc_phy_shared_attach) (shared_phy_params_t *shp)
        return sh;
 }
 
-void BCMATTACHFN(wlc_phy_shared_detach) (shared_phy_t *phy_sh)
+void wlc_phy_shared_detach(shared_phy_t *phy_sh)
 {
-       osl_t *osh;
+       struct osl_info *osh;
 
        if (phy_sh) {
                osh = phy_sh->osh;
@@ -600,17 +604,17 @@ void BCMATTACHFN(wlc_phy_shared_detach) (shared_phy_t *phy_sh)
                if (phy_sh->phy_head) {
                        ASSERT(!phy_sh->phy_head);
                }
-               MFREE(osh, phy_sh, sizeof(shared_phy_t));
+               kfree(phy_sh);
        }
 }
 
-wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
-                                       int bandtype, char *vars) {
+wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype, char *vars)
+{
        phy_info_t *pi;
-       uint32 sflags = 0;
+       u32 sflags = 0;
        uint phyversion;
        int i;
-       osl_t *osh;
+       struct osl_info *osh;
 
        osh = sh->osh;
 
@@ -633,21 +637,20 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
                return &pi->pubpi_ro;
        }
 
-       pi = (phy_info_t *) MALLOC(osh, sizeof(phy_info_t));
+       pi = kzalloc(sizeof(phy_info_t), GFP_ATOMIC);
        if (pi == NULL) {
                return NULL;
        }
-       bzero((char *)pi, sizeof(phy_info_t));
        pi->regs = (d11regs_t *) regs;
        pi->sh = sh;
-       pi->phy_init_por = TRUE;
+       pi->phy_init_por = true;
        pi->phy_wreg_limit = PHY_WREG_LIMIT;
 
        pi->vars = vars;
 
        pi->txpwr_percent = 100;
 
-       pi->do_initcal = TRUE;
+       pi->do_initcal = true;
 
        pi->phycal_tempdelta = 0;
 
@@ -686,7 +689,7 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
                pi->pubpi.radioid = NORADIO_ID;
                pi->pubpi.radiorev = 5;
        } else {
-               uint32 idcode;
+               u32 idcode;
 
                wlc_phy_anacore((wlc_phy_t *) pi, ON);
 
@@ -713,7 +716,7 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
        pi->rxiq_samps = PHY_NOISE_SAMPLE_LOG_NUM_NPHY;
        pi->rxiq_antsel = ANT_RX_DIV_DEF;
 
-       pi->watchdog_override = TRUE;
+       pi->watchdog_override = true;
 
        pi->cal_type_override = PHY_PERICAL_AUTO;
 
@@ -732,13 +735,13 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
        pi->phy_txcore_enable_temp =
            PHY_CHAIN_TX_DISABLE_TEMP - PHY_HYSTERESIS_DELTATEMP;
        pi->phy_tempsense_offset = 0;
-       pi->phy_txcore_heatedup = FALSE;
+       pi->phy_txcore_heatedup = false;
 
        pi->nphy_lastcal_temp = -50;
 
-       pi->phynoise_polling = TRUE;
+       pi->phynoise_polling = true;
        if (ISNPHY(pi) || ISLCNPHY(pi))
-               pi->phynoise_polling = FALSE;
+               pi->phynoise_polling = false;
 
        for (i = 0; i < TXP_NUM_RATES; i++) {
                pi->txpwr_limit[i] = WLC_TXPWR_MAX;
@@ -748,7 +751,7 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
 
        pi->radiopwr_override = RADIOPWR_OVERRIDE_DEF;
 
-       pi->user_txpwr_at_rfport = FALSE;
+       pi->user_txpwr_at_rfport = false;
 
        if (ISNPHY(pi)) {
 
@@ -782,11 +785,11 @@ wlc_phy_t *BCMATTACHFN(wlc_phy_attach) (shared_phy_t *sh, void *regs,
 
  err:
        if (pi)
-               MFREE(sh->osh, pi, sizeof(phy_info_t));
+               kfree(pi);
        return NULL;
 }
 
-void BCMATTACHFN(wlc_phy_detach) (wlc_phy_t *pih)
+void wlc_phy_detach(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
 
@@ -810,21 +813,21 @@ void BCMATTACHFN(wlc_phy_detach) (wlc_phy_t *pih)
                if (pi->pi_fptr.detach)
                        (pi->pi_fptr.detach) (pi);
 
-               MFREE(pi->sh->osh, pi, sizeof(phy_info_t));
+               kfree(pi);
        }
 }
 
 bool
-wlc_phy_get_phyversion(wlc_phy_t *pih, uint16 *phytype, uint16 *phyrev,
-                      uint16 *radioid, uint16 *radiover)
+wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, u16 *phyrev,
+                      u16 *radioid, u16 *radiover)
 {
        phy_info_t *pi = (phy_info_t *) pih;
-       *phytype = (uint16) pi->pubpi.phy_type;
-       *phyrev = (uint16) pi->pubpi.phy_rev;
+       *phytype = (u16) pi->pubpi.phy_type;
+       *phyrev = (u16) pi->pubpi.phy_rev;
        *radioid = pi->pubpi.radioid;
        *radiover = pi->pubpi.radiorev;
 
-       return TRUE;
+       return true;
 }
 
 bool wlc_phy_get_encore(wlc_phy_t *pih)
@@ -833,7 +836,7 @@ bool wlc_phy_get_encore(wlc_phy_t *pih)
        return pi->pubpi.abgphy_encore;
 }
 
-uint32 wlc_phy_get_coreflags(wlc_phy_t *pih)
+u32 wlc_phy_get_coreflags(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
        return pi->pubpi.coreflags;
@@ -899,11 +902,11 @@ void wlc_phy_anacore(wlc_phy_t *pih, bool on)
        }
 }
 
-uint32 wlc_phy_clk_bwbits(wlc_phy_t *pih)
+u32 wlc_phy_clk_bwbits(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
 
-       uint32 phy_bw_clkbits = 0;
+       u32 phy_bw_clkbits = 0;
 
        if (pi && (ISNPHY(pi) || ISLCNPHY(pi))) {
                switch (pi->bw) {
@@ -929,7 +932,7 @@ void WLBANDINITFN(wlc_phy_por_inform) (wlc_phy_t *ppi)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
 
-       pi->phy_init_por = TRUE;
+       pi->phy_init_por = true;
 }
 
 void wlc_phy_edcrs_lock(wlc_phy_t *pih, bool lock)
@@ -973,14 +976,14 @@ void wlc_phy_hw_state_upd(wlc_phy_t *pih, bool newstate)
 
 void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
 {
-       uint32 mc;
+       u32 mc;
        initfn_t phy_init = NULL;
        phy_info_t *pi = (phy_info_t *) pih;
 
        if (pi->init_in_progress)
                return;
 
-       pi->init_in_progress = TRUE;
+       pi->init_in_progress = true;
 
        pi->radio_chanspec = chanspec;
 
@@ -1012,26 +1015,26 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
                wlapi_bmac_bw_set(pi->sh->physhim,
                                  CHSPEC_BW(pi->radio_chanspec));
 
-       pi->nphy_gain_boost = TRUE;
+       pi->nphy_gain_boost = true;
 
        wlc_phy_switch_radio((wlc_phy_t *) pi, ON);
 
        (*phy_init) (pi);
 
-       pi->phy_init_por = FALSE;
+       pi->phy_init_por = false;
 
        if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12))
-               wlc_phy_do_dummy_tx(pi, TRUE, OFF);
+               wlc_phy_do_dummy_tx(pi, true, OFF);
 
        if (!(ISNPHY(pi)))
                wlc_phy_txpower_update_shm(pi);
 
        wlc_phy_ant_rxdiv_set((wlc_phy_t *) pi, pi->sh->rx_antdiv);
 
-       pi->init_in_progress = FALSE;
+       pi->init_in_progress = false;
 }
 
-void BCMINITFN(wlc_phy_cal_init) (wlc_phy_t *pih)
+void wlc_phy_cal_init(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
        initfn_t cal_init = NULL;
@@ -1043,16 +1046,16 @@ void BCMINITFN(wlc_phy_cal_init) (wlc_phy_t *pih)
                if (cal_init)
                        (*cal_init) (pi);
 
-               pi->initialized = TRUE;
+               pi->initialized = true;
        }
 }
 
-int BCMUNINITFN(wlc_phy_down) (wlc_phy_t *pih)
+int wlc_phy_down(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
        int callbacks = 0;
 
-       ASSERT(pi->phytest_on == FALSE);
+       ASSERT(pi->phytest_on == false);
 
        if (pi->phycal_timer
            && !wlapi_del_timer(pi->sh->physhim, pi->phycal_timer))
@@ -1064,9 +1067,9 @@ int BCMUNINITFN(wlc_phy_down) (wlc_phy_t *pih)
        return callbacks;
 }
 
-static uint32 wlc_phy_get_radio_ver(phy_info_t *pi)
+static u32 wlc_phy_get_radio_ver(phy_info_t *pi)
 {
-       uint32 ver;
+       u32 ver;
 
        ver = read_radio_id(pi);
 
@@ -1075,7 +1078,7 @@ static uint32 wlc_phy_get_radio_ver(phy_info_t *pi)
 
 void
 wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
-                  uint16 tblAddr, uint16 tblDataHi, uint16 tblDataLo)
+                  u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
 {
        write_phy_reg(pi, tblAddr, (tbl_id << 10) | tbl_offset);
 
@@ -1091,7 +1094,7 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
        }
 }
 
-void wlc_phy_table_data_write(phy_info_t *pi, uint width, uint32 val)
+void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
 {
        ASSERT((width == 8) || (width == 16) || (width == 32));
 
@@ -1108,25 +1111,25 @@ void wlc_phy_table_data_write(phy_info_t *pi, uint width, uint32 val)
 
        if (width == 32) {
 
-               write_phy_reg(pi, pi->tbl_data_hi, (uint16) (val >> 16));
-               write_phy_reg(pi, pi->tbl_data_lo, (uint16) val);
+               write_phy_reg(pi, pi->tbl_data_hi, (u16) (val >> 16));
+               write_phy_reg(pi, pi->tbl_data_lo, (u16) val);
        } else {
 
-               write_phy_reg(pi, pi->tbl_data_lo, (uint16) val);
+               write_phy_reg(pi, pi->tbl_data_lo, (u16) val);
        }
 }
 
 void
 wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
-                   uint16 tblAddr, uint16 tblDataHi, uint16 tblDataLo)
+                   u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
 {
        uint idx;
        uint tbl_id = ptbl_info->tbl_id;
        uint tbl_offset = ptbl_info->tbl_offset;
        uint tbl_width = ptbl_info->tbl_width;
        const u8 *ptbl_8b = (const u8 *)ptbl_info->tbl_ptr;
-       const uint16 *ptbl_16b = (const uint16 *)ptbl_info->tbl_ptr;
-       const uint32 *ptbl_32b = (const uint32 *)ptbl_info->tbl_ptr;
+       const u16 *ptbl_16b = (const u16 *)ptbl_info->tbl_ptr;
+       const u32 *ptbl_32b = (const u32 *)ptbl_info->tbl_ptr;
 
        ASSERT((tbl_width == 8) || (tbl_width == 16) || (tbl_width == 32));
 
@@ -1147,8 +1150,8 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
                if (tbl_width == 32) {
 
                        write_phy_reg(pi, tblDataHi,
-                                     (uint16) (ptbl_32b[idx] >> 16));
-                       write_phy_reg(pi, tblDataLo, (uint16) ptbl_32b[idx]);
+                                     (u16) (ptbl_32b[idx] >> 16));
+                       write_phy_reg(pi, tblDataLo, (u16) ptbl_32b[idx]);
                } else if (tbl_width == 16) {
 
                        write_phy_reg(pi, tblDataLo, ptbl_16b[idx]);
@@ -1161,15 +1164,15 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
 
 void
 wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
-                  uint16 tblAddr, uint16 tblDataHi, uint16 tblDataLo)
+                  u16 tblAddr, u16 tblDataHi, u16 tblDataLo)
 {
        uint idx;
        uint tbl_id = ptbl_info->tbl_id;
        uint tbl_offset = ptbl_info->tbl_offset;
        uint tbl_width = ptbl_info->tbl_width;
-       u8 *ptbl_8b = (u8 *) (uintptr) ptbl_info->tbl_ptr;
-       uint16 *ptbl_16b = (uint16 *) (uintptr) ptbl_info->tbl_ptr;
-       uint32 *ptbl_32b = (uint32 *) (uintptr) ptbl_info->tbl_ptr;
+       u8 *ptbl_8b = (u8 *)ptbl_info->tbl_ptr;
+       u16 *ptbl_16b = (u16 *)ptbl_info->tbl_ptr;
+       u32 *ptbl_32b = (u32 *)ptbl_info->tbl_ptr;
 
        ASSERT((tbl_width == 8) || (tbl_width == 16) || (tbl_width == 32));
 
@@ -1208,7 +1211,7 @@ wlc_phy_init_radio_regs_allbands(phy_info_t *pi, radio_20xx_regs_t *radioregs)
        do {
                if (radioregs[i].do_init) {
                        write_radio_reg(pi, radioregs[i].address,
-                                       (uint16) radioregs[i].init);
+                                       (u16) radioregs[i].init);
                }
 
                i++;
@@ -1219,7 +1222,7 @@ wlc_phy_init_radio_regs_allbands(phy_info_t *pi, radio_20xx_regs_t *radioregs)
 
 uint
 wlc_phy_init_radio_regs(phy_info_t *pi, radio_regs_t *radioregs,
-                       uint16 core_offset)
+                       u16 core_offset)
 {
        uint i = 0;
        uint count = 0;
@@ -1230,7 +1233,7 @@ wlc_phy_init_radio_regs(phy_info_t *pi, radio_regs_t *radioregs,
                                write_radio_reg(pi,
                                                radioregs[i].
                                                address | core_offset,
-                                               (uint16) radioregs[i].init_a);
+                                               (u16) radioregs[i].init_a);
                                if (ISNPHY(pi) && (++count % 4 == 0))
                                        WLC_PHY_WAR_PR51571(pi);
                        }
@@ -1239,7 +1242,7 @@ wlc_phy_init_radio_regs(phy_info_t *pi, radio_regs_t *radioregs,
                                write_radio_reg(pi,
                                                radioregs[i].
                                                address | core_offset,
-                                               (uint16) radioregs[i].init_g);
+                                               (u16) radioregs[i].init_g);
                                if (ISNPHY(pi) && (++count % 4 == 0))
                                        WLC_PHY_WAR_PR51571(pi);
                        }
@@ -1264,11 +1267,11 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
                0x6e, 0x84, 0x0b, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00
        };
-       uint32 *dummypkt;
+       u32 *dummypkt;
 
        ASSERT((R_REG(pi->sh->osh, &pi->regs->maccontrol) & MCTL_EN_MAC) == 0);
 
-       dummypkt = (uint32 *) (ofdm ? ofdmpkt : cckpkt);
+       dummypkt = (u32 *) (ofdm ? ofdmpkt : cckpkt);
        wlapi_bmac_write_template_ram(pi->sh->physhim, 0, DUMMY_PKT_LEN,
                                      dummypkt);
 
@@ -1316,20 +1319,20 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
 
        while ((i++ < count)
               && (R_REG(pi->sh->osh, &regs->txe_status) & (1 << 7))) {
-               OSL_DELAY(10);
+               udelay(10);
        }
 
        i = 0;
 
        while ((i++ < 10)
               && ((R_REG(pi->sh->osh, &regs->txe_status) & (1 << 10)) == 0)) {
-               OSL_DELAY(10);
+               udelay(10);
        }
 
        i = 0;
 
        while ((i++ < 10) && ((R_REG(pi->sh->osh, &regs->ifsstat) & (1 << 8)))) {
-               OSL_DELAY(10);
+               udelay(10);
        }
        if (!pa_on) {
                if (ISNPHY(pi))
@@ -1382,7 +1385,7 @@ void wlc_phy_clear_tssi(wlc_phy_t *pih)
 
 static bool wlc_phy_cal_txpower_recalc_sw(phy_info_t *pi)
 {
-       return FALSE;
+       return false;
 }
 
 void wlc_phy_switch_radio(wlc_phy_t *pih, bool on)
@@ -1428,14 +1431,14 @@ void wlc_phy_switch_radio(wlc_phy_t *pih, bool on)
        }
 }
 
-uint16 wlc_phy_bw_state_get(wlc_phy_t *ppi)
+u16 wlc_phy_bw_state_get(wlc_phy_t *ppi)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
 
        return pi->bw;
 }
 
-void wlc_phy_bw_state_set(wlc_phy_t *ppi, uint16 bw)
+void wlc_phy_bw_state_set(wlc_phy_t *ppi, u16 bw)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
 
@@ -1459,7 +1462,7 @@ chanspec_t wlc_phy_chanspec_get(wlc_phy_t *ppi)
 void wlc_phy_chanspec_set(wlc_phy_t *ppi, chanspec_t chanspec)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
-       uint16 m_cur_channel;
+       u16 m_cur_channel;
        chansetfn_t chanspec_set = NULL;
 
        ASSERT(!wf_chspec_malformed(chanspec));
@@ -1521,7 +1524,7 @@ int wlc_phy_channel2freq(uint channel)
 {
        uint i;
 
-       for (i = 0; i < ARRAYSIZE(chan_info_all); i++)
+       for (i = 0; i < ARRAY_SIZE(chan_info_all); i++)
                if (chan_info_all[i].chan == channel)
                        return chan_info_all[i].freq;
        return 0;
@@ -1536,9 +1539,9 @@ wlc_phy_chanspec_band_validch(wlc_phy_t *ppi, uint band, chanvec_t *channels)
 
        ASSERT((band == WLC_BAND_2G) || (band == WLC_BAND_5G));
 
-       bzero(channels, sizeof(chanvec_t));
+       memset(channels, 0, sizeof(chanvec_t));
 
-       for (i = 0; i < ARRAYSIZE(chan_info_all); i++) {
+       for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) {
                channel = chan_info_all[i].chan;
 
                if ((pi->a_band_high_disable) && (channel >= FIRST_REF5_CHANNUM)
@@ -1560,19 +1563,19 @@ chanspec_t wlc_phy_chanspec_band_firstch(wlc_phy_t *ppi, uint band)
 
        ASSERT((band == WLC_BAND_2G) || (band == WLC_BAND_5G));
 
-       for (i = 0; i < ARRAYSIZE(chan_info_all); i++) {
+       for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) {
                channel = chan_info_all[i].chan;
 
                if (ISNPHY(pi) && IS40MHZ(pi)) {
                        uint j;
 
-                       for (j = 0; j < ARRAYSIZE(chan_info_all); j++) {
+                       for (j = 0; j < ARRAY_SIZE(chan_info_all); j++) {
                                if (chan_info_all[j].chan ==
                                    channel + CH_10MHZ_APART)
                                        break;
                        }
 
-                       if (j == ARRAYSIZE(chan_info_all))
+                       if (j == ARRAY_SIZE(chan_info_all))
                                continue;
 
                        channel = UPPER_20_SB(channel);
@@ -1613,7 +1616,7 @@ int wlc_phy_txpower_get(wlc_phy_t *ppi, uint *qdbm, bool *override)
 
 void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
 {
-       bool mac_enabled = FALSE;
+       bool mac_enabled = false;
        phy_info_t *pi = (phy_info_t *) ppi;
 
        bcopy(&txpwr->cck[0], &pi->tx_user_target[TXP_FIRST_CCK],
@@ -1652,7 +1655,7 @@ void wlc_phy_txpower_target_set(wlc_phy_t *ppi, struct txpwr_limits *txpwr)
              WLC_NUM_RATES_MCS_2_STREAM);
 
        if (R_REG(pi->sh->osh, &pi->regs->maccontrol) & MCTL_EN_MAC)
-               mac_enabled = TRUE;
+               mac_enabled = true;
 
        if (mac_enabled)
                wlapi_suspend_mac_and_wait(pi->sh->physhim);
@@ -1675,7 +1678,7 @@ int wlc_phy_txpower_set(wlc_phy_t *ppi, uint qdbm, bool override)
        for (i = 0; i < TXP_NUM_RATES; i++)
                pi->tx_user_target[i] = (u8) qdbm;
 
-       pi->txpwroverride = FALSE;
+       pi->txpwroverride = false;
 
        if (pi->sh->up) {
                if (!SCAN_INPROG_PHY(pi)) {
@@ -1725,12 +1728,12 @@ wlc_phy_txpower_sromlimit(wlc_phy_t *ppi, uint channel, u8 *min_pwr,
                if (txp_rate_idx < 0)
                        txp_rate_idx = TXP_FIRST_OFDM;
 
-               for (i = 0; i < ARRAYSIZE(chan_info_all); i++) {
+               for (i = 0; i < ARRAY_SIZE(chan_info_all); i++) {
                        if (channel == chan_info_all[i].chan) {
                                break;
                        }
                }
-               ASSERT(i < ARRAYSIZE(chan_info_all));
+               ASSERT(i < ARRAY_SIZE(chan_info_all));
 
                if (pi->hwtxpwr) {
                        *max_pwr = pi->hwtxpwr[i];
@@ -1774,16 +1777,16 @@ wlc_phy_txpower_sromlimit_max_get(wlc_phy_t *ppi, uint chan, u8 *max_txpwr,
 
                maxtxpwr = (maxtxpwr > 6) ? (maxtxpwr - 6) : 0;
 
-               tx_pwr_max = MAX(tx_pwr_max, maxtxpwr);
-               tx_pwr_min = MIN(tx_pwr_min, maxtxpwr);
+               tx_pwr_max = max(tx_pwr_max, maxtxpwr);
+               tx_pwr_min = min(tx_pwr_min, maxtxpwr);
        }
        *max_txpwr = tx_pwr_max;
        *min_txpwr = tx_pwr_min;
 }
 
 void
-wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint bandunit, int32 *max_pwr,
-                               int32 *min_pwr, uint32 *step_pwr)
+wlc_phy_txpower_boardlimit_band(wlc_phy_t *ppi, uint bandunit, s32 *max_pwr,
+                               s32 *min_pwr, u32 *step_pwr)
 {
        return;
 }
@@ -1813,7 +1816,7 @@ void wlc_phy_txpower_recalc_target(phy_info_t *pi)
        u8 max_num_rate;
        u8 start_rate = 0;
        chanspec_t chspec;
-       uint32 band = CHSPEC2WLC_BAND(pi->radio_chanspec);
+       u32 band = CHSPEC2WLC_BAND(pi->radio_chanspec);
        initfn_t txpwr_recalc_fn = NULL;
 
        chspec = pi->radio_chanspec;
@@ -1826,7 +1829,7 @@ void wlc_phy_txpower_recalc_target(phy_info_t *pi)
 
        pactrl = 0;
        if (ISLCNPHY(pi)) {
-               uint32 offset_mcs, i;
+               u32 offset_mcs, i;
 
                if (CHSPEC_IS40(pi->radio_chanspec)) {
                        offset_mcs = pi->mcs40_po;
@@ -1873,32 +1876,32 @@ void wlc_phy_txpower_recalc_target(phy_info_t *pi)
                        wlc_phy_txpower_sromlimit((wlc_phy_t *) pi, target_chan,
                                                  &mintxpwr, &maxtxpwr, rate);
 
-                       maxtxpwr = MIN(maxtxpwr, pi->txpwr_limit[rate]);
+                       maxtxpwr = min(maxtxpwr, pi->txpwr_limit[rate]);
 
                        maxtxpwr =
                            (maxtxpwr > pactrl) ? (maxtxpwr - pactrl) : 0;
 
                        maxtxpwr = (maxtxpwr > 6) ? (maxtxpwr - 6) : 0;
 
-                       maxtxpwr = MIN(maxtxpwr, tx_pwr_target[rate]);
+                       maxtxpwr = min(maxtxpwr, tx_pwr_target[rate]);
 
                        if (pi->txpwr_percent <= 100)
                                maxtxpwr = (maxtxpwr * pi->txpwr_percent) / 100;
 
-                       tx_pwr_target[rate] = MAX(maxtxpwr, mintxpwr);
+                       tx_pwr_target[rate] = max(maxtxpwr, mintxpwr);
                }
 
                tx_pwr_target[rate] =
-                   MIN(tx_pwr_target[rate], pi->txpwr_env_limit[rate]);
+                   min(tx_pwr_target[rate], pi->txpwr_env_limit[rate]);
 
                if (tx_pwr_target[rate] > tx_pwr_max)
                        tx_pwr_max_rate_ind = rate;
 
-               tx_pwr_max = MAX(tx_pwr_max, tx_pwr_target[rate]);
-               tx_pwr_min = MIN(tx_pwr_min, tx_pwr_target[rate]);
+               tx_pwr_max = max(tx_pwr_max, tx_pwr_target[rate]);
+               tx_pwr_min = min(tx_pwr_min, tx_pwr_target[rate]);
        }
 
-       bzero(pi->tx_power_offset, sizeof(pi->tx_power_offset));
+       memset(pi->tx_power_offset, 0, sizeof(pi->tx_power_offset));
        pi->tx_power_max = tx_pwr_max;
        pi->tx_power_min = tx_pwr_min;
        pi->tx_power_max_rate_ind = tx_pwr_max_rate_ind;
@@ -1978,7 +1981,7 @@ wlc_phy_txpower_reg_limit_calc(phy_info_t *pi, struct txpwr_limits *txpwr,
                        for (rate1 = rate_start_index, rate2 = 0;
                             rate2 < WLC_NUM_RATES_OFDM; rate1++, rate2++)
                                pi->txpwr_limit[rate1] =
-                                   MIN(txpwr_ptr2[rate2],
+                                   min(txpwr_ptr2[rate2],
                                        tmp_txpwr_limit[rate2]);
                }
 
@@ -2021,7 +2024,7 @@ wlc_phy_txpower_reg_limit_calc(phy_info_t *pi, struct txpwr_limits *txpwr,
                             rate2 < WLC_NUM_RATES_MCS_1_STREAM;
                             rate1++, rate2++)
                                pi->txpwr_limit[rate1] =
-                                   MIN(txpwr_ptr2[rate2],
+                                   min(txpwr_ptr2[rate2],
                                        tmp_txpwr_limit[rate2]);
                }
 
@@ -2066,7 +2069,7 @@ wlc_phy_txpower_reg_limit_calc(phy_info_t *pi, struct txpwr_limits *txpwr,
                pi->txpwr_limit[WL_TX_POWER_MCS_32] = txpwr->mcs32;
 
                pi->txpwr_limit[WL_TX_POWER_MCS40_CDD_FIRST] =
-                   MIN(pi->txpwr_limit[WL_TX_POWER_MCS40_CDD_FIRST],
+                   min(pi->txpwr_limit[WL_TX_POWER_MCS40_CDD_FIRST],
                        pi->txpwr_limit[WL_TX_POWER_MCS_32]);
                pi->txpwr_limit[WL_TX_POWER_MCS_32] =
                    pi->txpwr_limit[WL_TX_POWER_MCS40_CDD_FIRST];
@@ -2080,7 +2083,7 @@ void wlc_phy_txpwr_percent_set(wlc_phy_t *ppi, u8 txpwr_percent)
        pi->txpwr_percent = txpwr_percent;
 }
 
-void wlc_phy_machwcap_set(wlc_phy_t *ppi, uint32 machwcap)
+void wlc_phy_machwcap_set(wlc_phy_t *ppi, u32 machwcap)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
 
@@ -2090,7 +2093,7 @@ void wlc_phy_machwcap_set(wlc_phy_t *ppi, uint32 machwcap)
 void wlc_phy_runbist_config(wlc_phy_t *ppi, bool start_end)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
-       uint16 rxc;
+       u16 rxc;
        rxc = 0;
 
        if (start_end == ON) {
@@ -2169,7 +2172,7 @@ void wlc_phy_txpower_update_shm(phy_info_t *pi)
                return;
 
        if (pi->hwpwrctrl) {
-               uint16 offset;
+               u16 offset;
 
                wlapi_bmac_write_shm(pi->sh->physhim, M_TXPWR_MAX, 63);
                wlapi_bmac_write_shm(pi->sh->physhim, M_TXPWR_N,
@@ -2201,9 +2204,9 @@ void wlc_phy_txpower_update_shm(phy_info_t *pi)
 
                for (i = TXP_FIRST_OFDM; i <= TXP_LAST_OFDM; i++)
                        pi->tx_power_offset[i] =
-                           (u8) ROUNDUP(pi->tx_power_offset[i], 8);
+                           (u8) roundup(pi->tx_power_offset[i], 8);
                wlapi_bmac_write_shm(pi->sh->physhim, M_OFDM_OFFSET,
-                                    (uint16) ((pi->
+                                    (u16) ((pi->
                                                tx_power_offset[TXP_FIRST_OFDM]
                                                + 7) >> 3));
        }
@@ -2265,19 +2268,19 @@ void wlc_phy_txpower_ipa_upd(phy_info_t *pi)
                pi->ipa2g_on = (pi->srom_fem2g.extpagain == 2);
                pi->ipa5g_on = (pi->srom_fem5g.extpagain == 2);
        } else {
-               pi->ipa2g_on = FALSE;
-               pi->ipa5g_on = FALSE;
+               pi->ipa2g_on = false;
+               pi->ipa5g_on = false;
        }
 }
 
-static uint32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi);
+static u32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi);
 
-static uint32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi)
+static u32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi)
 {
-       int16 tx0_status, tx1_status;
-       uint16 estPower1, estPower2;
+       s16 tx0_status, tx1_status;
+       u16 estPower1, estPower2;
        u8 pwr0, pwr1, adj_pwr0, adj_pwr1;
-       uint32 est_pwr;
+       u32 est_pwr;
 
        estPower1 = read_phy_reg(pi, 0x118);
        estPower2 = read_phy_reg(pi, 0x119);
@@ -2317,7 +2320,7 @@ static uint32 wlc_phy_txpower_est_power_nphy(phy_info_t *pi)
        }
 
        est_pwr =
-           (uint32) ((pwr0 << 24) | (pwr1 << 16) | (adj_pwr0 << 8) | adj_pwr1);
+           (u32) ((pwr0 << 24) | (pwr1 << 16) | (adj_pwr0 << 8) | adj_pwr1);
        return est_pwr;
 }
 
@@ -2360,7 +2363,7 @@ wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)
        }
 
        if (ISNPHY(pi)) {
-               uint32 est_pout;
+               u32 est_pout;
 
                wlapi_suspend_mac_and_wait(pi->sh->physhim);
                wlc_phyreg_enter((wlc_phy_t *) pi);
@@ -2412,8 +2415,8 @@ wlc_phy_txpower_get_current(wlc_phy_t *ppi, tx_power_t *power, uint channel)
                                power->flags &=
                                    ~(WL_TX_POWER_F_HW | WL_TX_POWER_F_ENABLED);
 
-                       wlc_lcnphy_get_tssi(pi, (int8 *) &power->est_Pout[0],
-                                           (int8 *) &power->est_Pout_cck);
+                       wlc_lcnphy_get_tssi(pi, (s8 *) &power->est_Pout[0],
+                                           (s8 *) &power->est_Pout_cck);
                }
                wlc_phyreg_exit(ppi);
        }
@@ -2436,16 +2439,16 @@ bool wlc_phy_test_ison(wlc_phy_t *ppi)
 bool wlc_phy_ant_rxdiv_get(wlc_phy_t *ppi, u8 *pval)
 {
        phy_info_t *pi = (phy_info_t *) ppi;
-       bool ret = TRUE;
+       bool ret = true;
 
        wlc_phyreg_enter(ppi);
 
        if (ISNPHY(pi)) {
 
-               ret = FALSE;
+               ret = false;
        } else if (ISLCNPHY(pi)) {
-               uint16 crsctrl = read_phy_reg(pi, 0x410);
-               uint16 div = crsctrl & (0x1 << 1);
+               u16 crsctrl = read_phy_reg(pi, 0x410);
+               u16 div = crsctrl & (0x1 << 1);
                *pval = (div | ((crsctrl & (0x1 << 0)) ^ (div >> 1)));
        }
 
@@ -2491,7 +2494,7 @@ void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
                                    ((ANT_RX_DIV_START_1 == val) ? 1 : 0) << 0);
                } else {
                        mod_phy_reg(pi, 0x410, (0x1 << 1), 0x00 << 1);
-                       mod_phy_reg(pi, 0x410, (0x1 << 0), (uint16) val << 0);
+                       mod_phy_reg(pi, 0x410, (0x1 << 0), (u16) val << 0);
                }
        } else {
                ASSERT(0);
@@ -2504,21 +2507,21 @@ void wlc_phy_ant_rxdiv_set(wlc_phy_t *ppi, u8 val)
 }
 
 static bool
-wlc_phy_noise_calc_phy(phy_info_t *pi, uint32 *cmplx_pwr, int8 *pwr_ant)
+wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant)
 {
-       int8 cmplx_pwr_dbm[PHY_CORE_MAX];
+       s8 cmplx_pwr_dbm[PHY_CORE_MAX];
        u8 i;
 
-       bzero((u8 *) cmplx_pwr_dbm, sizeof(cmplx_pwr_dbm));
+       memset((u8 *) cmplx_pwr_dbm, 0, sizeof(cmplx_pwr_dbm));
        ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX);
        wlc_phy_compute_dB(cmplx_pwr, cmplx_pwr_dbm, pi->pubpi.phy_corenum);
 
        for (i = 0; i < pi->pubpi.phy_corenum; i++) {
                if (NREV_GE(pi->pubpi.phy_rev, 3))
-                       cmplx_pwr_dbm[i] += (int8) PHY_NOISE_OFFSETFACT_4322;
+                       cmplx_pwr_dbm[i] += (s8) PHY_NOISE_OFFSETFACT_4322;
                else
 
-                       cmplx_pwr_dbm[i] += (int8) (16 - (15) * 3 - 70);
+                       cmplx_pwr_dbm[i] += (s8) (16 - (15) * 3 - 70);
        }
 
        for (i = 0; i < pi->pubpi.phy_corenum; i++) {
@@ -2527,16 +2530,16 @@ wlc_phy_noise_calc_phy(phy_info_t *pi, uint32 *cmplx_pwr, int8 *pwr_ant)
        }
        pi->nphy_noise_index =
            MODINC_POW2(pi->nphy_noise_index, PHY_NOISE_WINDOW_SZ);
-       return TRUE;
+       return true;
 }
 
 static void
 wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
 {
        phy_info_t *pi = (phy_info_t *) pih;
-       int8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
+       s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
        bool sampling_in_progress = (pi->phynoise_state != 0);
-       bool wait_for_intr = TRUE;
+       bool wait_for_intr = true;
 
        if (NORADIO_ENAB(pi->pubpi)) {
                return;
@@ -2580,7 +2583,7 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
                        noise_dbm = PHY_NOISE_FIXED_VAL;
                }
 
-               wait_for_intr = FALSE;
+               wait_for_intr = false;
                goto done;
        }
 
@@ -2598,10 +2601,10 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
                } else {
                        wlapi_suspend_mac_and_wait(pi->sh->physhim);
                        wlc_lcnphy_deaf_mode(pi, (bool) 0);
-                       noise_dbm = (int8) wlc_lcnphy_rx_signal_power(pi, 20);
+                       noise_dbm = (s8) wlc_lcnphy_rx_signal_power(pi, 20);
                        wlc_lcnphy_deaf_mode(pi, (bool) 1);
                        wlapi_enable_mac(pi->sh->physhim);
-                       wait_for_intr = FALSE;
+                       wait_for_intr = false;
                }
        } else if (ISNPHY(pi)) {
                if (!pi->phynoise_polling
@@ -2616,16 +2619,16 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
                               MCMD_BG_NOISE);
                } else {
                        phy_iq_est_t est[PHY_CORE_MAX];
-                       uint32 cmplx_pwr[PHY_CORE_MAX];
-                       int8 noise_dbm_ant[PHY_CORE_MAX];
-                       uint16 log_num_samps, num_samps, classif_state = 0;
+                       u32 cmplx_pwr[PHY_CORE_MAX];
+                       s8 noise_dbm_ant[PHY_CORE_MAX];
+                       u16 log_num_samps, num_samps, classif_state = 0;
                        u8 wait_time = 32;
                        u8 wait_crs = 0;
                        u8 i;
 
-                       bzero((u8 *) est, sizeof(est));
-                       bzero((u8 *) cmplx_pwr, sizeof(cmplx_pwr));
-                       bzero((u8 *) noise_dbm_ant, sizeof(noise_dbm_ant));
+                       memset((u8 *) est, 0, sizeof(est));
+                       memset((u8 *) cmplx_pwr, 0, sizeof(cmplx_pwr));
+                       memset((u8 *) noise_dbm_ant, 0, sizeof(noise_dbm_ant));
 
                        log_num_samps = PHY_NOISE_SAMPLE_LOG_NUM_NPHY;
                        num_samps = 1 << log_num_samps;
@@ -2655,7 +2658,7 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
                        pi->nphy_noise_index = MODINC_POW2(pi->nphy_noise_index,
                                                           PHY_NOISE_WINDOW_SZ);
 
-                       wait_for_intr = FALSE;
+                       wait_for_intr = false;
                }
        }
 
@@ -2675,7 +2678,7 @@ void wlc_phy_noise_sample_request_external(wlc_phy_t *pih)
        wlc_phy_noise_sample_request(pih, PHY_NOISE_SAMPLE_EXTERNAL, channel);
 }
 
-static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, int8 noise_dbm)
+static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, s8 noise_dbm)
 {
        if (!pi->phynoise_state)
                return;
@@ -2696,18 +2699,18 @@ static void wlc_phy_noise_cb(phy_info_t *pi, u8 channel, int8 noise_dbm)
 
 }
 
-static int8 wlc_phy_noise_read_shmem(phy_info_t *pi)
+static s8 wlc_phy_noise_read_shmem(phy_info_t *pi)
 {
-       uint32 cmplx_pwr[PHY_CORE_MAX];
-       int8 noise_dbm_ant[PHY_CORE_MAX];
-       uint16 lo, hi;
-       uint32 cmplx_pwr_tot = 0;
-       int8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
+       u32 cmplx_pwr[PHY_CORE_MAX];
+       s8 noise_dbm_ant[PHY_CORE_MAX];
+       u16 lo, hi;
+       u32 cmplx_pwr_tot = 0;
+       s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
        u8 idx, core;
 
        ASSERT(pi->pubpi.phy_corenum <= PHY_CORE_MAX);
-       bzero((u8 *) cmplx_pwr, sizeof(cmplx_pwr));
-       bzero((u8 *) noise_dbm_ant, sizeof(noise_dbm_ant));
+       memset((u8 *) cmplx_pwr, 0, sizeof(cmplx_pwr));
+       memset((u8 *) noise_dbm_ant, 0, sizeof(noise_dbm_ant));
 
        for (idx = 0, core = 0; core < pi->pubpi.phy_corenum; idx += 2, core++) {
                lo = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP(idx));
@@ -2741,15 +2744,15 @@ static int8 wlc_phy_noise_read_shmem(phy_info_t *pi)
 void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
-       uint16 jssi_aux;
+       u16 jssi_aux;
        u8 channel = 0;
-       int8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
+       s8 noise_dbm = PHY_NOISE_FIXED_VAL_NPHY;
 
        if (ISLCNPHY(pi)) {
-               uint32 cmplx_pwr, cmplx_pwr0, cmplx_pwr1;
-               uint16 lo, hi;
-               int32 pwr_offset_dB, gain_dB;
-               uint16 status_0, status_1;
+               u32 cmplx_pwr, cmplx_pwr0, cmplx_pwr1;
+               u16 lo, hi;
+               s32 pwr_offset_dB, gain_dB;
+               u16 status_0, status_1;
 
                jssi_aux = wlapi_bmac_read_shm(pi->sh->physhim, M_JSSI_AUX);
                channel = jssi_aux & D11_CURCHANNEL_MAX;
@@ -2774,10 +2777,10 @@ void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
                        if (pwr_offset_dB > 127)
                                pwr_offset_dB -= 256;
 
-                       noise_dbm += (int8) (pwr_offset_dB - 30);
+                       noise_dbm += (s8) (pwr_offset_dB - 30);
 
                        gain_dB = (status_0 & 0x1ff);
-                       noise_dbm -= (int8) (gain_dB);
+                       noise_dbm -= (s8) (gain_dB);
                } else {
                        noise_dbm = PHY_NOISE_FIXED_VAL_LCNPHY;
                }
@@ -2795,7 +2798,7 @@ void wlc_phy_noise_sample_intr(wlc_phy_t *pih)
 
 }
 
-int8 lcnphy_gain_index_offset_for_pkt_rssi[] = {
+s8 lcnphy_gain_index_offset_for_pkt_rssi[] = {
        8,
        8,
        8,
@@ -2836,10 +2839,10 @@ int8 lcnphy_gain_index_offset_for_pkt_rssi[] = {
        0
 };
 
-void wlc_phy_compute_dB(uint32 *cmplx_pwr, int8 *p_cmplx_pwr_dB, u8 core)
+void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_cmplx_pwr_dB, u8 core)
 {
        u8 shift_ct, lsb, msb, secondmsb, i;
-       uint32 tmp;
+       u32 tmp;
 
        for (i = 0; i < core; i++) {
                tmp = cmplx_pwr[i];
@@ -2852,7 +2855,7 @@ void wlc_phy_compute_dB(uint32 *cmplx_pwr, int8 *p_cmplx_pwr_dB, u8 core)
                                msb = shift_ct;
                }
                secondmsb = (u8) ((cmplx_pwr[i] >> (msb - 1)) & 1);
-               p_cmplx_pwr_dB[i] = (int8) (3 * msb + 2 * secondmsb);
+               p_cmplx_pwr_dB[i] = (s8) (3 * msb + 2 * secondmsb);
        }
 }
 
@@ -2905,7 +2908,7 @@ void BCMFASTPATH wlc_phy_rssi_compute(wlc_phy_t *pih, void *ctx)
        }
 
  end:
-       wlc_rxhdr->rssi = (int8) rssi;
+       wlc_rxhdr->rssi = (s8) rssi;
 }
 
 void wlc_phy_freqtrack_start(wlc_phy_t *pih)
@@ -2924,9 +2927,9 @@ void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)
        pi = (phy_info_t *) ppi;
 
        if (ISLCNPHY(pi))
-               wlc_lcnphy_deaf_mode(pi, TRUE);
+               wlc_lcnphy_deaf_mode(pi, true);
        else if (ISNPHY(pi))
-               wlc_nphy_deaf_mode(pi, TRUE);
+               wlc_nphy_deaf_mode(pi, true);
        else {
                ASSERT(0);
        }
@@ -2935,7 +2938,7 @@ void wlc_phy_set_deaf(wlc_phy_t *ppi, bool user_flag)
 void wlc_phy_watchdog(wlc_phy_t *pih)
 {
        phy_info_t *pi = (phy_info_t *) pih;
-       bool delay_phy_cal = FALSE;
+       bool delay_phy_cal = false;
        pi->sh->now++;
 
        if (!pi->watchdog_override)
@@ -2990,7 +2993,7 @@ void wlc_phy_watchdog(wlc_phy_t *pih)
                            (SCAN_RM_IN_PROGRESS(pi) || PLT_INPROG_PHY(pi)
                             || ASSOC_INPROG_PHY(pi)
                             || pi->carrier_suppr_disable
-                            || pi->pkteng_in_progress || pi->disable_percal))
+                            || pi->disable_percal))
                                wlc_lcnphy_calib_modes(pi,
                                                       PHY_PERICAL_WATCHDOG);
                }
@@ -3004,7 +3007,7 @@ void wlc_phy_BSSinit(wlc_phy_t *pih, bool bonlyap, int rssi)
        uint k;
 
        for (i = 0; i < MA_WINDOW_SZ; i++) {
-               pi->sh->phy_noise_window[i] = (int8) (rssi & 0xff);
+               pi->sh->phy_noise_window[i] = (s8) (rssi & 0xff);
        }
        if (ISLCNPHY(pi)) {
                for (i = 0; i < MA_WINDOW_SZ; i++)
@@ -3021,7 +3024,7 @@ void wlc_phy_BSSinit(wlc_phy_t *pih, bool bonlyap, int rssi)
 }
 
 void
-wlc_phy_papd_decode_epsilon(uint32 epsilon, int32 *eps_real, int32 *eps_imag)
+wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag)
 {
        *eps_imag = (epsilon >> 13);
        if (*eps_imag > 0xfff)
@@ -3053,7 +3056,7 @@ static const fixed AtanTbl[] = {
        29
 };
 
-void wlc_phy_cordic(fixed theta, cint32 *val)
+void wlc_phy_cordic(fixed theta, cs32 *val)
 {
        fixed angle, valtmp;
        unsigned iter;
@@ -3119,9 +3122,9 @@ static void wlc_phy_cal_perical_mphase_schedule(phy_info_t *pi, uint delay)
 
 void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
 {
-       int16 nphy_currtemp = 0;
-       int16 delta_temp = 0;
-       bool do_periodic_cal = TRUE;
+       s16 nphy_currtemp = 0;
+       s16 delta_temp = 0;
+       bool do_periodic_cal = true;
        phy_info_t *pi = (phy_info_t *) pih;
 
        if (!ISNPHY(pi))
@@ -3153,7 +3156,7 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
                        wlc_phy_cal_perical_mphase_reset(pi);
                }
 
-               pi->first_cal_after_assoc = TRUE;
+               pi->first_cal_after_assoc = true;
 
                pi->cal_type_override = PHY_PERICAL_FULL;
 
@@ -3171,10 +3174,10 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
                            nphy_currtemp - pi->nphy_lastcal_temp :
                            pi->nphy_lastcal_temp - nphy_currtemp;
 
-                       if ((delta_temp < (int16) pi->phycal_tempdelta) &&
+                       if ((delta_temp < (s16) pi->phycal_tempdelta) &&
                            (pi->nphy_txiqlocal_chanspec ==
                             pi->radio_chanspec)) {
-                               do_periodic_cal = FALSE;
+                               do_periodic_cal = false;
                        } else {
                                pi->nphy_lastcal_temp = nphy_currtemp;
                        }
@@ -3207,9 +3210,9 @@ void wlc_phy_cal_perical_mphase_restart(phy_info_t *pi)
        pi->mphase_txcal_cmdidx = 0;
 }
 
-u8 wlc_phy_nbits(int32 value)
+u8 wlc_phy_nbits(s32 value)
 {
-       int32 abs_val;
+       s32 abs_val;
        u8 nbits = 0;
 
        abs_val = ABS(value);
@@ -3219,9 +3222,9 @@ u8 wlc_phy_nbits(int32 value)
        return nbits;
 }
 
-uint32 wlc_phy_sqrt_int(uint32 value)
+u32 wlc_phy_sqrt_int(u32 value)
 {
-       uint32 root = 0, shift = 0;
+       u32 root = 0, shift = 0;
 
        for (shift = 0; shift < 32; shift += 2) {
                if (((0x40000000 >> shift) + root) <= value) {
@@ -3271,7 +3274,7 @@ void wlc_phy_stf_chain_get(wlc_phy_t *pih, u8 *txchain, u8 *rxchain)
 
 u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)
 {
-       int16 nphy_currtemp;
+       s16 nphy_currtemp;
        u8 active_bitmap;
        phy_info_t *pi = (phy_info_t *) pih;
 
@@ -3288,12 +3291,12 @@ u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)
                if (!pi->phy_txcore_heatedup) {
                        if (nphy_currtemp >= pi->phy_txcore_disable_temp) {
                                active_bitmap &= 0xFD;
-                               pi->phy_txcore_heatedup = TRUE;
+                               pi->phy_txcore_heatedup = true;
                        }
                } else {
                        if (nphy_currtemp <= pi->phy_txcore_enable_temp) {
                                active_bitmap |= 0x2;
-                               pi->phy_txcore_heatedup = FALSE;
+                               pi->phy_txcore_heatedup = false;
                        }
                }
        }
@@ -3301,7 +3304,7 @@ u8 wlc_phy_stf_chain_active_get(wlc_phy_t *pih)
        return active_bitmap;
 }
 
-int8 wlc_phy_stf_ssmode_get(wlc_phy_t *pih, chanspec_t chanspec)
+s8 wlc_phy_stf_ssmode_get(wlc_phy_t *pih, chanspec_t chanspec)
 {
        phy_info_t *pi = (phy_info_t *) pih;
        u8 siso_mcs_id, cdd_mcs_id;
@@ -3330,7 +3333,7 @@ void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
        if ((CHIPID(pi->sh->chip) == BCM4313_CHIP_ID) &&
            (pi->sh->boardflags & BFL_FEM)) {
                if (mode) {
-                       uint16 txant = 0;
+                       u16 txant = 0;
                        txant = wlapi_bmac_get_txant(pi->sh->physhim);
                        if (txant == 1) {
                                mod_phy_reg(pi, 0x44d, (0x1 << 2), (1) << 2);
@@ -3339,12 +3342,12 @@ void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
 
                        }
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpiocontrol), ~0x0,
+                                  offsetof(chipcregs_t, gpiocontrol), ~0x0,
                                   0x0);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioout), 0x40, 0x40);
+                                  offsetof(chipcregs_t, gpioout), 0x40, 0x40);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioouten), 0x40,
+                                  offsetof(chipcregs_t, gpioouten), 0x40,
                                   0x40);
                } else {
                        mod_phy_reg(pi, 0x44c, (0x1 << 2), (0) << 2);
@@ -3352,28 +3355,28 @@ void wlc_lcnphy_epa_switch(phy_info_t *pi, bool mode)
                        mod_phy_reg(pi, 0x44d, (0x1 << 2), (0) << 2);
 
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioout), 0x40, 0x00);
+                                  offsetof(chipcregs_t, gpioout), 0x40, 0x00);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpioouten), 0x40, 0x0);
+                                  offsetof(chipcregs_t, gpioouten), 0x40, 0x0);
                        si_corereg(pi->sh->sih, SI_CC_IDX,
-                                  OFFSETOF(chipcregs_t, gpiocontrol), ~0x0,
+                                  offsetof(chipcregs_t, gpiocontrol), ~0x0,
                                   0x40);
                }
        }
 }
 
-static int8
-wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan, uint32 band,
+static s8
+wlc_user_txpwr_antport_to_rfport(phy_info_t *pi, uint chan, u32 band,
                                 u8 rate)
 {
-       int8 offset = 0;
+       s8 offset = 0;
 
        if (!pi->user_txpwr_at_rfport)
                return offset;
        return offset;
 }
 
-static int8 wlc_phy_env_measure_vbat(phy_info_t *pi)
+static s8 wlc_phy_env_measure_vbat(phy_info_t *pi)
 {
        if (ISLCNPHY(pi))
                return wlc_lcnphy_vbatsense(pi, 0);
@@ -3381,7 +3384,7 @@ static int8 wlc_phy_env_measure_vbat(phy_info_t *pi)
                return 0;
 }
 
-static int8 wlc_phy_env_measure_temperature(phy_info_t *pi)
+static s8 wlc_phy_env_measure_temperature(phy_info_t *pi)
 {
        if (ISLCNPHY(pi))
                return wlc_lcnphy_tempsense_degree(pi, 0);
@@ -3389,10 +3392,10 @@ static int8 wlc_phy_env_measure_temperature(phy_info_t *pi)
                return 0;
 }
 
-static void wlc_phy_upd_env_txpwr_rate_limits(phy_info_t *pi, uint32 band)
+static void wlc_phy_upd_env_txpwr_rate_limits(phy_info_t *pi, u32 band)
 {
        u8 i;
-       int8 temp, vbat;
+       s8 temp, vbat;
 
        for (i = 0; i < TXP_NUM_RATES; i++)
                pi->txpwr_env_limit[i] = WLC_TXPWR_MAX;
@@ -3408,15 +3411,15 @@ void wlc_phy_ldpc_override_set(wlc_phy_t *ppi, bool ldpc)
 }
 
 void
-wlc_phy_get_pwrdet_offsets(phy_info_t *pi, int8 *cckoffset, int8 *ofdmoffset)
+wlc_phy_get_pwrdet_offsets(phy_info_t *pi, s8 *cckoffset, s8 *ofdmoffset)
 {
        *cckoffset = 0;
        *ofdmoffset = 0;
 }
 
-uint32 wlc_phy_qdiv_roundup(uint32 dividend, uint32 divisor, u8 precision)
+u32 wlc_phy_qdiv_roundup(u32 dividend, u32 divisor, u8 precision)
 {
-       uint32 quotient, remainder, roundup, rbit;
+       u32 quotient, remainder, roundup, rbit;
 
        ASSERT(divisor);
 
@@ -3441,7 +3444,7 @@ uint32 wlc_phy_qdiv_roundup(uint32 dividend, uint32 divisor, u8 precision)
        return quotient;
 }
 
-int8 wlc_phy_upd_rssi_offset(phy_info_t *pi, int8 rssi, chanspec_t chanspec)
+s8 wlc_phy_upd_rssi_offset(phy_info_t *pi, s8 rssi, chanspec_t chanspec)
 {
 
        return rssi;