]> 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 26ff202fe0fe6e307661b0138d024d2eb4e8147f..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>
@@ -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,7 +206,7 @@ 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)
@@ -272,7 +277,7 @@ u16 read_radio_reg(phy_info_t *pi, u16 addr)
 
 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, u16 addr, u16 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;
@@ -405,7 +410,7 @@ static bool wlc_phy_war41476(phy_info_t *pi)
 
 u16 read_phy_reg(phy_info_t *pi, u16 addr)
 {
-       osl_t *osh;
+       struct osl_info *osh;
        d11regs_t *regs;
 
        osh = pi->sh->osh;
@@ -426,7 +431,7 @@ u16 read_phy_reg(phy_info_t *pi, u16 addr)
 
 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, u16 addr, u16 val)
        if (addr == 0x72)
                (void)R_REG(osh, &regs->phyregdata);
 #else
-       W_REG(osh, (volatile u32 *)(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);
@@ -452,7 +457,7 @@ void write_phy_reg(phy_info_t *pi, u16 addr, u16 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;
@@ -473,7 +478,7 @@ void and_phy_reg(phy_info_t *pi, u16 addr, u16 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;
@@ -494,7 +499,7 @@ void or_phy_reg(phy_info_t *pi, u16 addr, u16 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;
        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;
 
@@ -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,7 +813,7 @@ 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);
        }
 }
 
@@ -824,7 +827,7 @@ wlc_phy_get_phyversion(wlc_phy_t *pih, u16 *phytype, u16 *phyrev,
        *radioid = pi->pubpi.radioid;
        *radiover = pi->pubpi.radiorev;
 
-       return TRUE;
+       return true;
 }
 
 bool wlc_phy_get_encore(wlc_phy_t *pih)
@@ -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)
@@ -980,7 +983,7 @@ void WLBANDINITFN(wlc_phy_init) (wlc_phy_t *pih, chanspec_t chanspec)
        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))
@@ -1167,9 +1170,9 @@ wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
        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;
-       u16 *ptbl_16b = (u16 *) (uintptr) ptbl_info->tbl_ptr;
-       u32 *ptbl_32b = (u32 *) (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));
 
@@ -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)
@@ -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];
@@ -1898,7 +1901,7 @@ void wlc_phy_txpower_recalc_target(phy_info_t *pi)
                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;
@@ -2201,7 +2204,7 @@ 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,
                                     (u16) ((pi->
                                                tx_power_offset[TXP_FIRST_OFDM]
@@ -2265,8 +2268,8 @@ 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;
        }
 }
 
@@ -2436,13 +2439,13 @@ 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)) {
                u16 crsctrl = read_phy_reg(pi, 0x410);
                u16 div = crsctrl & (0x1 << 1);
@@ -2509,7 +2512,7 @@ wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant)
        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);
 
@@ -2527,7 +2530,7 @@ wlc_phy_noise_calc_phy(phy_info_t *pi, u32 *cmplx_pwr, s8 *pwr_ant)
        }
        pi->nphy_noise_index =
            MODINC_POW2(pi->nphy_noise_index, PHY_NOISE_WINDOW_SZ);
-       return TRUE;
+       return true;
 }
 
 static void
@@ -2536,7 +2539,7 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
        phy_info_t *pi = (phy_info_t *) pih;
        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;
        }
 
@@ -2601,7 +2604,7 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
                        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
@@ -2623,9 +2626,9 @@ wlc_phy_noise_sample_request(wlc_phy_t *pih, u8 reason, u8 ch)
                        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;
                }
        }
 
@@ -2706,8 +2709,8 @@ static s8 wlc_phy_noise_read_shmem(phy_info_t *pi)
        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));
@@ -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);
                }
@@ -3121,7 +3124,7 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
 {
        s16 nphy_currtemp = 0;
        s16 delta_temp = 0;
-       bool do_periodic_cal = TRUE;
+       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;
 
@@ -3174,7 +3177,7 @@ void wlc_phy_cal_perical(wlc_phy_t *pih, u8 reason)
                        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;
                        }
@@ -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;
                        }
                }
        }