Lines Matching refs:rtlhal
102 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_set_fw_clock_on() local
110 if (!rtlhal->fw_ready) in _rtl8821ae_set_fw_clock_on()
117 if (rtlhal->fw_clk_change_in_progress) { in _rtl8821ae_set_fw_clock_on()
118 while (rtlhal->fw_clk_change_in_progress) { in _rtl8821ae_set_fw_clock_on()
128 rtlhal->fw_clk_change_in_progress = false; in _rtl8821ae_set_fw_clock_on()
134 if (IS_IN_LOW_POWER_STATE_8821AE(rtlhal->fw_ps_state)) { in _rtl8821ae_set_fw_clock_on()
148 rtlhal->fw_ps_state = FW_PS_STATE_RF_ON_8821AE; in _rtl8821ae_set_fw_clock_on()
151 rtlhal->fw_ps_state); in _rtl8821ae_set_fw_clock_on()
156 rtlhal->fw_clk_change_in_progress = false; in _rtl8821ae_set_fw_clock_on()
163 rtlhal->fw_clk_change_in_progress = false; in _rtl8821ae_set_fw_clock_on()
172 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_set_fw_clock_off() local
179 if (!rtlhal->fw_ready) in _rtl8821ae_set_fw_clock_off()
183 if (!rtlhal->allow_sw_to_change_hwclc) in _rtl8821ae_set_fw_clock_off()
203 if (FW_PS_STATE(rtlhal->fw_ps_state) != in _rtl8821ae_set_fw_clock_off()
206 if (!rtlhal->fw_clk_change_in_progress) { in _rtl8821ae_set_fw_clock_off()
207 rtlhal->fw_clk_change_in_progress = true; in _rtl8821ae_set_fw_clock_off()
209 rtlhal->fw_ps_state = FW_PS_STATE(rpwm_val); in _rtl8821ae_set_fw_clock_off()
214 rtlhal->fw_clk_change_in_progress = false; in _rtl8821ae_set_fw_clock_off()
236 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_fwlps_leave() local
243 rtlhal->allow_sw_to_change_hwclc = false; in _rtl8821ae_fwlps_leave()
263 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_fwlps_enter() local
275 rtlhal->allow_sw_to_change_hwclc = true; in _rtl8821ae_fwlps_enter()
295 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_download_rsvd_page() local
318 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_download_rsvd_page()
338 if (bcnvalid_reg & BIT(0) && rtlhal->enter_pnp_sleep) { in _rtl8821ae_download_rsvd_page()
349 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_download_rsvd_page()
385 if (!rtlhal->enter_pnp_sleep) { in _rtl8821ae_download_rsvd_page()
477 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_set_hw_reg() local
584 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in rtl8821ae_set_hw_reg()
590 } else if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in rtl8821ae_set_hw_reg()
868 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_gen_refresh_led_state() local
870 if (rtlpriv->rtlhal.up_first_time) in _rtl8821ae_gen_refresh_led_state()
874 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_gen_refresh_led_state()
879 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_gen_refresh_led_state()
884 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_gen_refresh_led_state()
894 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_init_mac() local
898 bool mac_func_enable = rtlhal->mac_func_enable; in _rtl8821ae_init_mac()
906 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_init_mac()
938 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_init_mac()
1132 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_enable_aspm_back_door() local
1135 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_enable_aspm_back_door()
1150 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_enable_aspm_back_door()
1243 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_reset_pcie_interface_dma() local
1254 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_reset_pcie_interface_dma()
1304 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_reset_pcie_interface_dma()
1328 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_reset_pcie_interface_dma()
1341 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_get_wakeup_reason() local
1352 rtlhal->last_suspend_sec = ktime_get_real_seconds(); in _rtl8821ae_get_wakeup_reason()
1628 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_simple_initialize_adapter() local
1637 if (rtlhal->re_init_llt_table) { in _rtl8821ae_simple_initialize_adapter()
1640 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_simple_initialize_adapter()
1645 rtlhal->re_init_llt_table = false; in _rtl8821ae_simple_initialize_adapter()
1708 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_wowlan_initialize_adapter() local
1738 if (rtlhal->hw_rof_enable) { in _rtl8821ae_wowlan_initialize_adapter()
1789 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_poweroff_adapter() local
1792 rtlhal->mac_func_enable = false; in _rtl8821ae_poweroff_adapter()
1794 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_poweroff_adapter()
1808 rtlhal->fw_ready) { in _rtl8821ae_poweroff_adapter()
1820 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_poweroff_adapter()
1844 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_hw_init() local
1853 rtlhal->being_init_adapter = true; in rtl8821ae_hw_init()
1862 rtlhal->mac_func_enable = true; in rtl8821ae_hw_init()
1866 rtlhal->mac_func_enable = false; in rtl8821ae_hw_init()
1867 rtlhal->fw_ps_state = FW_PS_STATE_ALL_ON_8821AE; in rtl8821ae_hw_init()
1871 rtlhal->wake_from_pnp_sleep && in rtl8821ae_hw_init()
1872 rtlhal->mac_func_enable) { in rtl8821ae_hw_init()
1874 rtlhal->being_init_adapter = false; in rtl8821ae_hw_init()
1881 rtlhal->mac_func_enable, in rtl8821ae_hw_init()
1883 rtlhal->mac_func_enable = false; in rtl8821ae_hw_init()
1890 if (rtlhal->mac_func_enable) { in rtl8821ae_hw_init()
1892 rtlhal->mac_func_enable = false; in rtl8821ae_hw_init()
1911 rtlhal->fw_ready = false; in rtl8821ae_hw_init()
1914 rtlhal->fw_ready = true; in rtl8821ae_hw_init()
1917 rtlhal->fw_ps_state = FW_PS_STATE_ALL_ON_8821AE; in rtl8821ae_hw_init()
1918 rtlhal->fw_clk_change_in_progress = false; in rtl8821ae_hw_init()
1919 rtlhal->allow_sw_to_change_hwclc = false; in rtl8821ae_hw_init()
1920 rtlhal->last_hmeboxnum = 0; in rtl8821ae_hw_init()
1939 rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in rtl8821ae_hw_init()
1948 rtlhal->mac_func_enable = true; in rtl8821ae_hw_init()
1960 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE && in rtl8821ae_hw_init()
1961 (rtlhal->rfe_type == 1 || rtlhal->rfe_type == 5)) in rtl8821ae_hw_init()
1965 rtlpriv->rtlhal.being_init_adapter = false; in rtl8821ae_hw_init()
1996 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_read_chip_version() local
2004 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_read_chip_version()
2006 else if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) in _rtl8821ae_read_chip_version()
2013 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_read_chip_version()
2021 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_read_chip_version()
2034 } else if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_read_chip_version()
2042 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_read_chip_version()
2045 rtlhal->hw_rof_enable = ((value32 & WL_HWROF_EN) ? 1 : 0); in _rtl8821ae_read_chip_version()
2300 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in rtl8821ae_card_disable() local
2314 || !rtlhal->enter_pnp_sleep) { in rtl8821ae_card_disable()
2333 rtlhal->re_init_llt_table = true; in rtl8821ae_card_disable()
2388 if (rtlpriv->rtlhal.driver_is_goingto_unload || in rtl8821ae_card_disable()
2392 if (support_remote_wakeup && rtlhal->enter_pnp_sleep) { in rtl8821ae_card_disable()
2412 if (rtlhal->hw_rof_enable) { in rtl8821ae_card_disable()
2866 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8812ae_read_pa_type() local
2869 rtlhal->pa_type_2g = hwinfo[0XBC]; in _rtl8812ae_read_pa_type()
2870 rtlhal->lna_type_2g = hwinfo[0XBD]; in _rtl8812ae_read_pa_type()
2871 if (rtlhal->pa_type_2g == 0xFF && rtlhal->lna_type_2g == 0xFF) { in _rtl8812ae_read_pa_type()
2872 rtlhal->pa_type_2g = 0; in _rtl8812ae_read_pa_type()
2873 rtlhal->lna_type_2g = 0; in _rtl8812ae_read_pa_type()
2875 rtlhal->external_pa_2g = ((rtlhal->pa_type_2g & BIT(5)) && in _rtl8812ae_read_pa_type()
2876 (rtlhal->pa_type_2g & BIT(4))) ? in _rtl8812ae_read_pa_type()
2878 rtlhal->external_lna_2g = ((rtlhal->lna_type_2g & BIT(7)) && in _rtl8812ae_read_pa_type()
2879 (rtlhal->lna_type_2g & BIT(3))) ? in _rtl8812ae_read_pa_type()
2882 rtlhal->pa_type_5g = hwinfo[0XBC]; in _rtl8812ae_read_pa_type()
2883 rtlhal->lna_type_5g = hwinfo[0XBF]; in _rtl8812ae_read_pa_type()
2884 if (rtlhal->pa_type_5g == 0xFF && rtlhal->lna_type_5g == 0xFF) { in _rtl8812ae_read_pa_type()
2885 rtlhal->pa_type_5g = 0; in _rtl8812ae_read_pa_type()
2886 rtlhal->lna_type_5g = 0; in _rtl8812ae_read_pa_type()
2888 rtlhal->external_pa_5g = ((rtlhal->pa_type_5g & BIT(1)) && in _rtl8812ae_read_pa_type()
2889 (rtlhal->pa_type_5g & BIT(0))) ? in _rtl8812ae_read_pa_type()
2891 rtlhal->external_lna_5g = ((rtlhal->lna_type_5g & BIT(7)) && in _rtl8812ae_read_pa_type()
2892 (rtlhal->lna_type_5g & BIT(3))) ? in _rtl8812ae_read_pa_type()
2895 rtlhal->external_pa_2g = 0; in _rtl8812ae_read_pa_type()
2896 rtlhal->external_lna_2g = 0; in _rtl8812ae_read_pa_type()
2897 rtlhal->external_pa_5g = 0; in _rtl8812ae_read_pa_type()
2898 rtlhal->external_lna_5g = 0; in _rtl8812ae_read_pa_type()
2906 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8812ae_read_amplifier_type() local
2924 if ((rtlhal->pa_type_2g & (BIT(5) | BIT(4))) == (BIT(5) | BIT(4))) in _rtl8812ae_read_amplifier_type()
2925 rtlhal->type_gpa = ext_type_pa_2g_b << 2 | ext_type_pa_2g_a; in _rtl8812ae_read_amplifier_type()
2928 if ((rtlhal->pa_type_5g & (BIT(1) | BIT(0))) == (BIT(1) | BIT(0))) in _rtl8812ae_read_amplifier_type()
2929 rtlhal->type_apa = ext_type_pa_5g_b << 2 | ext_type_pa_5g_a; in _rtl8812ae_read_amplifier_type()
2932 if ((rtlhal->lna_type_2g & (BIT(7) | BIT(3))) == (BIT(7) | BIT(3))) in _rtl8812ae_read_amplifier_type()
2933 rtlhal->type_glna = ext_type_lna_2g_b << 2 | ext_type_lna_2g_a; in _rtl8812ae_read_amplifier_type()
2936 if ((rtlhal->lna_type_5g & (BIT(7) | BIT(3))) == (BIT(7) | BIT(3))) in _rtl8812ae_read_amplifier_type()
2937 rtlhal->type_alna = ext_type_lna_5g_b << 2 | ext_type_lna_5g_a; in _rtl8812ae_read_amplifier_type()
2944 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_read_pa_type() local
2947 rtlhal->pa_type_2g = hwinfo[0XBC]; in _rtl8821ae_read_pa_type()
2948 rtlhal->lna_type_2g = hwinfo[0XBD]; in _rtl8821ae_read_pa_type()
2949 if (rtlhal->pa_type_2g == 0xFF && rtlhal->lna_type_2g == 0xFF) { in _rtl8821ae_read_pa_type()
2950 rtlhal->pa_type_2g = 0; in _rtl8821ae_read_pa_type()
2951 rtlhal->lna_type_2g = 0; in _rtl8821ae_read_pa_type()
2953 rtlhal->external_pa_2g = (rtlhal->pa_type_2g & BIT(5)) ? 1 : 0; in _rtl8821ae_read_pa_type()
2954 rtlhal->external_lna_2g = (rtlhal->lna_type_2g & BIT(7)) ? 1 : 0; in _rtl8821ae_read_pa_type()
2956 rtlhal->pa_type_5g = hwinfo[0XBC]; in _rtl8821ae_read_pa_type()
2957 rtlhal->lna_type_5g = hwinfo[0XBF]; in _rtl8821ae_read_pa_type()
2958 if (rtlhal->pa_type_5g == 0xFF && rtlhal->lna_type_5g == 0xFF) { in _rtl8821ae_read_pa_type()
2959 rtlhal->pa_type_5g = 0; in _rtl8821ae_read_pa_type()
2960 rtlhal->lna_type_5g = 0; in _rtl8821ae_read_pa_type()
2962 rtlhal->external_pa_5g = (rtlhal->pa_type_5g & BIT(1)) ? 1 : 0; in _rtl8821ae_read_pa_type()
2963 rtlhal->external_lna_5g = (rtlhal->lna_type_5g & BIT(7)) ? 1 : 0; in _rtl8821ae_read_pa_type()
2965 rtlhal->external_pa_2g = 0; in _rtl8821ae_read_pa_type()
2966 rtlhal->external_lna_2g = 0; in _rtl8821ae_read_pa_type()
2967 rtlhal->external_pa_5g = 0; in _rtl8821ae_read_pa_type()
2968 rtlhal->external_lna_5g = 0; in _rtl8821ae_read_pa_type()
2976 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_read_rfe_type() local
2980 if (rtlhal->external_lna_5g) { in _rtl8821ae_read_rfe_type()
2981 if (rtlhal->external_pa_5g) { in _rtl8821ae_read_rfe_type()
2982 if (rtlhal->external_lna_2g && in _rtl8821ae_read_rfe_type()
2983 rtlhal->external_pa_2g) in _rtl8821ae_read_rfe_type()
2984 rtlhal->rfe_type = 3; in _rtl8821ae_read_rfe_type()
2986 rtlhal->rfe_type = 0; in _rtl8821ae_read_rfe_type()
2988 rtlhal->rfe_type = 2; in _rtl8821ae_read_rfe_type()
2991 rtlhal->rfe_type = 4; in _rtl8821ae_read_rfe_type()
2994 rtlhal->rfe_type = hwinfo[EEPROM_RFE_OPTION] & 0x3F; in _rtl8821ae_read_rfe_type()
2996 if (rtlhal->rfe_type == 4 && in _rtl8821ae_read_rfe_type()
2997 (rtlhal->external_pa_5g || in _rtl8821ae_read_rfe_type()
2998 rtlhal->external_pa_2g || in _rtl8821ae_read_rfe_type()
2999 rtlhal->external_lna_5g || in _rtl8821ae_read_rfe_type()
3000 rtlhal->external_lna_2g)) { in _rtl8821ae_read_rfe_type()
3001 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_read_rfe_type()
3002 rtlhal->rfe_type = 2; in _rtl8821ae_read_rfe_type()
3006 rtlhal->rfe_type = 0x04; in _rtl8821ae_read_rfe_type()
3010 "RFE Type: 0x%2x\n", rtlhal->rfe_type); in _rtl8821ae_read_rfe_type()
3066 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in _rtl8821ae_read_adapter_info() local
3087 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_read_adapter_info()
3101 if (rtlhal->external_lna_2g != 0) in _rtl8821ae_read_adapter_info()
3103 if (rtlhal->external_lna_5g != 0) in _rtl8821ae_read_adapter_info()
3105 if (rtlhal->external_pa_2g != 0) in _rtl8821ae_read_adapter_info()
3107 if (rtlhal->external_pa_5g != 0) in _rtl8821ae_read_adapter_info()
3113 rtlhal->board_type = rtlefuse->board_type; in _rtl8821ae_read_adapter_info()
3164 if (rtlhal->oem_id == RT_CID_DEFAULT) { in _rtl8821ae_read_adapter_info()
3169 rtlhal->oem_id = RT_CID_TOSHIBA; in _rtl8821ae_read_adapter_info()
3172 rtlhal->oem_id = RT_CID_CCX; in _rtl8821ae_read_adapter_info()
3175 rtlhal->oem_id = RT_CID_819X_QMI; in _rtl8821ae_read_adapter_info()
3216 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_read_eeprom_info() local
3219 rtlhal->version = _rtl8821ae_read_chip_version(hw); in rtl8821ae_read_eeprom_info()
3226 rtlhal->version); in rtl8821ae_read_eeprom_info()
3254 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); in rtl8821ae_update_hal_rate_table() local
3268 if (rtlhal->current_bandtype == BAND_ON_5G) in rtl8821ae_update_hal_rate_table()
3716 if (rtlpriv->rtlhal.being_init_adapter) in rtl8821ae_gpio_radio_on_off_checking()