Lines Matching refs:sh

121 	wlapi_bmac_ucode_wake_override_phyreg_set(pi->sh->physhim);  in wlc_phyreg_enter()
127 wlapi_bmac_ucode_wake_override_phyreg_clear(pi->sh->physhim); in wlc_phyreg_exit()
133 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, MCTL_LOCK_RADIO); in wlc_radioreg_enter()
144 wlapi_bmac_mctrl(pi->sh->physhim, MCTL_LOCK_RADIO, 0); in wlc_radioreg_exit()
174 if ((D11REV_GE(pi->sh->corerev, 24)) || in read_radio_reg()
175 (D11REV_IS(pi->sh->corerev, 22) in read_radio_reg()
190 if ((D11REV_GE(pi->sh->corerev, 24)) || in write_radio_reg()
191 (D11REV_IS(pi->sh->corerev, 22) in write_radio_reg()
212 if (D11REV_GE(pi->sh->corerev, 24)) { in read_radio_id()
356 struct shared_phy *sh; in wlc_phy_shared_attach() local
358 sh = kzalloc(sizeof(*sh), GFP_ATOMIC); in wlc_phy_shared_attach()
359 if (sh == NULL) in wlc_phy_shared_attach()
362 sh->physhim = shp->physhim; in wlc_phy_shared_attach()
363 sh->unit = shp->unit; in wlc_phy_shared_attach()
364 sh->corerev = shp->corerev; in wlc_phy_shared_attach()
366 sh->vid = shp->vid; in wlc_phy_shared_attach()
367 sh->did = shp->did; in wlc_phy_shared_attach()
368 sh->chip = shp->chip; in wlc_phy_shared_attach()
369 sh->chiprev = shp->chiprev; in wlc_phy_shared_attach()
370 sh->chippkg = shp->chippkg; in wlc_phy_shared_attach()
371 sh->sromrev = shp->sromrev; in wlc_phy_shared_attach()
372 sh->boardtype = shp->boardtype; in wlc_phy_shared_attach()
373 sh->boardrev = shp->boardrev; in wlc_phy_shared_attach()
374 sh->boardflags = shp->boardflags; in wlc_phy_shared_attach()
375 sh->boardflags2 = shp->boardflags2; in wlc_phy_shared_attach()
377 sh->fast_timer = PHY_SW_TIMER_FAST; in wlc_phy_shared_attach()
378 sh->slow_timer = PHY_SW_TIMER_SLOW; in wlc_phy_shared_attach()
379 sh->glacial_timer = PHY_SW_TIMER_GLACIAL; in wlc_phy_shared_attach()
381 sh->rssi_mode = RSSI_ANT_MERGE_MAX; in wlc_phy_shared_attach()
383 return sh; in wlc_phy_shared_attach()
392 if (!pi->sh->up) { in wlc_phy_timercb_phycal()
419 wlc_phy_attach(struct shared_phy *sh, struct bcma_device *d11core, in wlc_phy_attach() argument
428 if (D11REV_IS(sh->corerev, 4)) in wlc_phy_attach()
438 pi = sh->phy_head; in wlc_phy_attach()
440 wlapi_bmac_corereset(pi->sh->physhim, pi->pubpi.coreflags); in wlc_phy_attach()
450 pi->sh = sh; in wlc_phy_attach()
463 wlapi_bmac_corereset(pi->sh->physhim, pi->pubpi.coreflags); in wlc_phy_attach()
521 pi->sh->phyrxchain = 0x3; in wlc_phy_attach()
549 pi->phycal_timer = wlapi_init_timer(pi->sh->physhim, in wlc_phy_attach()
564 pi->next = pi->sh->phy_head; in wlc_phy_attach()
565 sh->phy_head = pi; in wlc_phy_attach()
589 if (pi->sh->phy_head == pi) in wlc_phy_detach()
590 pi->sh->phy_head = pi->next; in wlc_phy_detach()
591 else if (pi->sh->phy_head->next == pi) in wlc_phy_detach()
592 pi->sh->phy_head->next = NULL; in wlc_phy_detach()
718 if (!pi || !pi->sh) in wlc_phy_hw_clk_state_upd()
721 pi->sh->clk = newstate; in wlc_phy_hw_clk_state_upd()
728 if (!pi || !pi->sh) in wlc_phy_hw_state_upd()
731 pi->sh->up = newstate; in wlc_phy_hw_state_upd()
766 wlapi_bmac_bw_set(pi->sh->physhim, in wlc_phy_init()
777 if (D11REV_IS(pi->sh->corerev, 11) || D11REV_IS(pi->sh->corerev, 12)) in wlc_phy_init()
783 wlc_phy_ant_rxdiv_set((struct brcms_phy_pub *) pi, pi->sh->rx_antdiv); in wlc_phy_init()
830 if (pi->sh->chip == BCMA_CHIP_ID_BCM43224 && in wlc_phy_table_addr()
831 pi->sh->chiprev == 1) { in wlc_phy_table_addr()
840 if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) && in wlc_phy_table_data_write()
841 (pi->sh->chiprev == 1) && in wlc_phy_table_data_write()
874 if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) && in wlc_phy_write_table()
875 (pi->sh->chiprev == 1) && in wlc_phy_write_table()
911 if ((pi->sh->chip == BCMA_CHIP_ID_BCM43224) && in wlc_phy_read_table()
912 (pi->sh->chiprev == 1)) { in wlc_phy_read_table()
998 wlapi_bmac_write_template_ram(pi->sh->physhim, 0, DUMMY_PKT_LEN, in wlc_phy_do_dummy_tx()
1003 if (D11REV_GE(pi->sh->corerev, 11)) in wlc_phy_do_dummy_tx()
1082 pi->nphy_perical_last = pi->sh->now - pi->sh->glacial_timer; in wlc_phy_mute_upd()
1093 wlapi_bmac_write_shm(pi->sh->physhim, M_B_TSSI_0, NULL_TSSI_W); in wlc_phy_clear_tssi()
1094 wlapi_bmac_write_shm(pi->sh->physhim, M_B_TSSI_1, NULL_TSSI_W); in wlc_phy_clear_tssi()
1095 wlapi_bmac_write_shm(pi->sh->physhim, M_G_TSSI_0, NULL_TSSI_W); in wlc_phy_clear_tssi()
1096 wlapi_bmac_write_shm(pi->sh->physhim, M_G_TSSI_1, NULL_TSSI_W); in wlc_phy_clear_tssi()
1177 wlapi_bmac_write_shm(pi->sh->physhim, M_CURCHANNEL, m_cur_channel); in wlc_phy_chanspec_set()
1352 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_txpower_target_set()
1358 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_txpower_target_set()
1374 if (pi->sh->up) { in wlc_phy_txpower_set()
1383 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_txpower_set()
1389 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_txpower_set()
1811 pi->sh->machwcap = machwcap; in wlc_phy_machwcap_set()
1862 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_txpower_limit_set()
1866 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_txpower_limit_set()
1889 if (!pi->sh->clk) in wlc_phy_txpower_update_shm()
1895 wlapi_bmac_write_shm(pi->sh->physhim, M_TXPWR_MAX, 63); in wlc_phy_txpower_update_shm()
1896 wlapi_bmac_write_shm(pi->sh->physhim, M_TXPWR_N, in wlc_phy_txpower_update_shm()
1899 wlapi_bmac_write_shm(pi->sh->physhim, M_TXPWR_TARGET, in wlc_phy_txpower_update_shm()
1902 wlapi_bmac_write_shm(pi->sh->physhim, M_TXPWR_CUR, in wlc_phy_txpower_update_shm()
1910 pi->sh->physhim, in wlc_phy_txpower_update_shm()
1912 wlapi_bmac_write_shm(pi->sh->physhim, offset + 6, in wlc_phy_txpower_update_shm()
1914 wlapi_bmac_write_shm(pi->sh->physhim, offset + 14, in wlc_phy_txpower_update_shm()
1918 wlapi_bmac_mhf(pi->sh->physhim, MHF2, MHF2_HWPWRCTL, in wlc_phy_txpower_update_shm()
1926 wlapi_bmac_write_shm(pi->sh->physhim, M_OFDM_OFFSET, in wlc_phy_txpower_update_shm()
1960 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_txpower_hw_ctrl_set()
1970 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_txpower_hw_ctrl_set()
2066 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_txpower_get_current()
2070 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_txpower_get_current()
2095 } else if (pi->hwpwrctrl && pi->sh->up) { in wlc_phy_txpower_get_current()
2143 pi->sh->rx_antdiv = val; in wlc_phy_ant_rxdiv_set()
2145 if (!(ISNPHY(pi) && D11REV_IS(pi->sh->corerev, 16))) { in wlc_phy_ant_rxdiv_set()
2147 wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_ANTDIV, in wlc_phy_ant_rxdiv_set()
2150 wlapi_bmac_mhf(pi->sh->physhim, MHF1, MHF1_ANTDIV, 0, in wlc_phy_ant_rxdiv_set()
2157 if (!pi->sh->clk) in wlc_phy_ant_rxdiv_set()
2163 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_ant_rxdiv_set()
2178 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_ant_rxdiv_set()
2216 pi->sh->phy_noise_window[pi->sh->phy_noise_index] = in wlc_phy_noise_cb()
2218 pi->sh->phy_noise_index = in wlc_phy_noise_cb()
2219 MODINC(pi->sh->phy_noise_index, MA_WINDOW_SZ); in wlc_phy_noise_cb()
2243 lo = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP(idx)); in wlc_phy_noise_read_shmem()
2244 hi = wlapi_bmac_read_shm(pi->sh->physhim, in wlc_phy_noise_read_shmem()
2284 jssi_aux = wlapi_bmac_read_shm(pi->sh->physhim, M_JSSI_AUX); in wlc_phy_noise_sample_intr()
2287 lo = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP0); in wlc_phy_noise_sample_intr()
2288 hi = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP1); in wlc_phy_noise_sample_intr()
2291 lo = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP2); in wlc_phy_noise_sample_intr()
2292 hi = wlapi_bmac_read_shm(pi->sh->physhim, M_PWRIND_MAP3); in wlc_phy_noise_sample_intr()
2297 status_1 = wlapi_bmac_read_shm(pi->sh->physhim, M_JSSI_0); in wlc_phy_noise_sample_intr()
2316 jssi_aux = wlapi_bmac_read_shm(pi->sh->physhim, M_JSSI_AUX); in wlc_phy_noise_sample_intr()
2351 pi->phynoise_now = pi->sh->now; in wlc_phy_noise_sample_request()
2373 wlapi_bmac_write_shm(pi->sh->physhim, M_JSSI_0, 0); in wlc_phy_noise_sample_request()
2374 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP0, 0); in wlc_phy_noise_sample_request()
2375 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP1, 0); in wlc_phy_noise_sample_request()
2376 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP2, 0); in wlc_phy_noise_sample_request()
2377 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP3, 0); in wlc_phy_noise_sample_request()
2382 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_noise_sample_request()
2386 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_noise_sample_request()
2393 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP0, 0); in wlc_phy_noise_sample_request()
2394 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP1, 0); in wlc_phy_noise_sample_request()
2395 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP2, 0); in wlc_phy_noise_sample_request()
2396 wlapi_bmac_write_shm(pi->sh->physhim, M_PWRIND_MAP3, 0); in wlc_phy_noise_sample_request()
2416 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_noise_sample_request()
2422 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_noise_sample_request()
2523 if ((pi->sh->corerev >= 11) in wlc_phy_rssi_compute()
2583 pi->sh->now++; in wlc_phy_watchdog()
2594 if (pi->phynoise_state && (pi->sh->now - pi->phynoise_now) > 5) in wlc_phy_watchdog()
2598 ((pi->sh->now - pi->phycal_txpower) >= pi->sh->fast_timer)) { in wlc_phy_watchdog()
2601 pi->phycal_txpower = pi->sh->now; in wlc_phy_watchdog()
2612 ((pi->sh->now - pi->nphy_perical_last) >= in wlc_phy_watchdog()
2613 pi->sh->glacial_timer)) in wlc_phy_watchdog()
2622 ((pi->sh->now - pi->phy_lastcal) >= in wlc_phy_watchdog()
2623 pi->sh->glacial_timer)) { in wlc_phy_watchdog()
2646 pi->sh->phy_noise_window[i] = (s8) (rssi & 0xff); in wlc_phy_BSSinit()
2649 pi->sh->phy_noise_window[i] = in wlc_phy_BSSinit()
2652 pi->sh->phy_noise_index = 0; in wlc_phy_BSSinit()
2796 pi->sh->hw_phytxchain = txchain; in wlc_phy_stf_chain_init()
2797 pi->sh->hw_phyrxchain = rxchain; in wlc_phy_stf_chain_init()
2798 pi->sh->phytxchain = txchain; in wlc_phy_stf_chain_init()
2799 pi->sh->phyrxchain = rxchain; in wlc_phy_stf_chain_init()
2800 pi->pubpi.phy_corenum = (u8)hweight8(pi->sh->phyrxchain); in wlc_phy_stf_chain_init()
2807 pi->sh->phytxchain = txchain; in wlc_phy_stf_chain_set()
2812 pi->pubpi.phy_corenum = (u8)hweight8(pi->sh->phyrxchain); in wlc_phy_stf_chain_set()
2819 *txchain = pi->sh->phytxchain; in wlc_phy_stf_chain_get()
2820 *rxchain = pi->sh->phyrxchain; in wlc_phy_stf_chain_get()
2835 wlapi_suspend_mac_and_wait(pi->sh->physhim); in wlc_phy_stf_chain_active_get()
2837 wlapi_enable_mac(pi->sh->physhim); in wlc_phy_stf_chain_active_get()
2881 if ((pi->sh->chip == BCMA_CHIP_ID_BCM4313) && in wlc_lcnphy_epa_switch()
2882 (pi->sh->boardflags & BFL_FEM)) { in wlc_lcnphy_epa_switch()
2885 txant = wlapi_bmac_get_txant(pi->sh->physhim); in wlc_lcnphy_epa_switch()