Lines Matching refs:rtlpriv

26 	struct rtl_priv *rtlpriv = rtl_priv(hw);  in _rtl8821ae_return_beacon_queue_skb()  local
33 spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); in _rtl8821ae_return_beacon_queue_skb()
39 rtlpriv->cfg->ops->get_desc(hw, (u8 *)entry, in _rtl8821ae_return_beacon_queue_skb()
45 spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); in _rtl8821ae_return_beacon_queue_skb()
54 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_set_bcn_ctrl_reg() local
59 rtl_write_byte(rtlpriv, REG_BCN_CTRL, (u8)rtlpci->reg_bcn_ctrl_val); in _rtl8821ae_set_bcn_ctrl_reg()
64 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_stop_tx_beacon() local
67 tmp1byte = rtl_read_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2); in _rtl8821ae_stop_tx_beacon()
68 rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, tmp1byte & (~BIT(6))); in _rtl8821ae_stop_tx_beacon()
69 rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 1, 0x64); in _rtl8821ae_stop_tx_beacon()
70 tmp1byte = rtl_read_byte(rtlpriv, REG_TBTT_PROHIBIT + 2); in _rtl8821ae_stop_tx_beacon()
72 rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 2, tmp1byte); in _rtl8821ae_stop_tx_beacon()
77 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_resume_tx_beacon() local
80 tmp1byte = rtl_read_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2); in _rtl8821ae_resume_tx_beacon()
81 rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, tmp1byte | BIT(6)); in _rtl8821ae_resume_tx_beacon()
82 rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 1, 0xff); in _rtl8821ae_resume_tx_beacon()
83 tmp1byte = rtl_read_byte(rtlpriv, REG_TBTT_PROHIBIT + 2); in _rtl8821ae_resume_tx_beacon()
85 rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 2, tmp1byte); in _rtl8821ae_resume_tx_beacon()
101 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_set_fw_clock_on() local
107 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in _rtl8821ae_set_fw_clock_on()
112 if (!rtlpriv->psc.fw_current_inpsmode) in _rtl8821ae_set_fw_clock_on()
116 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
119 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
124 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
126 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
129 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
135 rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_SET_RPWM, in _rtl8821ae_set_fw_clock_on()
139 content = rtl_read_dword(rtlpriv, isr_regaddr); in _rtl8821ae_set_fw_clock_on()
143 content = rtl_read_dword(rtlpriv, isr_regaddr); in _rtl8821ae_set_fw_clock_on()
147 rtl_write_word(rtlpriv, isr_regaddr, 0x0100); in _rtl8821ae_set_fw_clock_on()
149 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, in _rtl8821ae_set_fw_clock_on()
155 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
157 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
159 mod_timer(&rtlpriv->works.fw_clockoff_timer, in _rtl8821ae_set_fw_clock_on()
162 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
164 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
171 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_set_fw_clock_off() local
181 if (!rtlpriv->psc.fw_current_inpsmode) in _rtl8821ae_set_fw_clock_off()
185 rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RF_STATE, (u8 *)(&rtstate)); in _rtl8821ae_set_fw_clock_off()
186 if (rtstate == ERFOFF || rtlpriv->psc.inactive_pwrstate == ERFOFF) in _rtl8821ae_set_fw_clock_off()
198 mod_timer(&rtlpriv->works.fw_clockoff_timer, in _rtl8821ae_set_fw_clock_off()
205 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_off()
208 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_off()
210 rtl_write_word(rtlpriv, REG_HISR, 0x0100); in _rtl8821ae_set_fw_clock_off()
211 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SET_RPWM, in _rtl8821ae_set_fw_clock_off()
213 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_off()
215 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_off()
217 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_off()
218 mod_timer(&rtlpriv->works.fw_clockoff_timer, in _rtl8821ae_set_fw_clock_off()
234 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_fwlps_leave() local
244 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_H2C_FW_PWRMODE, in _rtl8821ae_fwlps_leave()
246 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_FW_PSMODE_STATUS, in _rtl8821ae_fwlps_leave()
250 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SET_RPWM, in _rtl8821ae_fwlps_leave()
252 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_H2C_FW_PWRMODE, in _rtl8821ae_fwlps_leave()
254 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_FW_PSMODE_STATUS, in _rtl8821ae_fwlps_leave()
261 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_fwlps_enter() local
269 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
272 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
279 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
282 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
285 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
294 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_download_rsvd_page() local
295 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_download_rsvd_page()
300 tmp_regcr = rtl_read_byte(rtlpriv, REG_CR + 1); in _rtl8821ae_download_rsvd_page()
301 rtl_write_byte(rtlpriv, REG_CR + 1, (tmp_regcr | BIT(0))); in _rtl8821ae_download_rsvd_page()
306 tmp_reg422 = rtl_read_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2); in _rtl8821ae_download_rsvd_page()
307 rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, in _rtl8821ae_download_rsvd_page()
313 bcnvalid_reg = rtl_read_byte(rtlpriv, REG_TDECTRL + 2); in _rtl8821ae_download_rsvd_page()
314 rtl_write_byte(rtlpriv, REG_TDECTRL + 2, in _rtl8821ae_download_rsvd_page()
325 bcnvalid_reg = rtl_read_byte(rtlpriv, REG_TDECTRL + 2); in _rtl8821ae_download_rsvd_page()
330 bcnvalid_reg = rtl_read_byte(rtlpriv, REG_TDECTRL + 2); in _rtl8821ae_download_rsvd_page()
336 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_download_rsvd_page()
339 rtl_write_byte(rtlpriv, REG_TDECTRL + 2, bcnvalid_reg | BIT(0)); in _rtl8821ae_download_rsvd_page()
344 rtl_write_byte(rtlpriv, REG_TDECTRL + 2, in _rtl8821ae_download_rsvd_page()
357 bcnvalid_reg = rtl_read_byte(rtlpriv, in _rtl8821ae_download_rsvd_page()
364 rtl_read_byte(rtlpriv, in _rtl8821ae_download_rsvd_page()
371 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_download_rsvd_page()
377 rtl_write_byte(rtlpriv, REG_TDECTRL + 2, BIT(0)); in _rtl8821ae_download_rsvd_page()
383 rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 2, tmp_reg422); in _rtl8821ae_download_rsvd_page()
386 tmp_regcr = rtl_read_byte(rtlpriv, REG_CR + 1); in _rtl8821ae_download_rsvd_page()
387 rtl_write_byte(rtlpriv, REG_CR + 1, (tmp_regcr & ~(BIT(0)))); in _rtl8821ae_download_rsvd_page()
393 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_get_hw_reg() local
400 *((u32 *)(val)) = rtl_read_dword(rtlpriv, REG_MACID); in rtl8821ae_get_hw_reg()
401 *((u16 *)(val+4)) = rtl_read_word(rtlpriv, REG_MACID + 4); in rtl8821ae_get_hw_reg()
404 *((u32 *)(val)) = rtl_read_dword(rtlpriv, REG_BSSID); in rtl8821ae_get_hw_reg()
405 *((u16 *)(val+4)) = rtl_read_word(rtlpriv, REG_BSSID+4); in rtl8821ae_get_hw_reg()
408 val[0] = rtl_read_byte(rtlpriv, MSR) & 0x3; in rtl8821ae_get_hw_reg()
414 *((u16 *)(val)) = rtl_read_word(rtlpriv, REG_BCN_INTERVAL); in rtl8821ae_get_hw_reg()
417 *((u16 *)(val)) = rtl_read_word(rtlpriv, REG_ATIMWND); in rtl8821ae_get_hw_reg()
429 rtlpriv->cfg->ops->get_hw_reg(hw, in rtl8821ae_get_hw_reg()
435 val_rcr = rtl_read_dword(rtlpriv, REG_RCR); in rtl8821ae_get_hw_reg()
451 *ptsf_high = rtl_read_dword(rtlpriv, (REG_TSFTR + 4)); in rtl8821ae_get_hw_reg()
452 *ptsf_low = rtl_read_dword(rtlpriv, REG_TSFTR); in rtl8821ae_get_hw_reg()
464 rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD, in rtl8821ae_get_hw_reg()
472 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_hw_reg() local
483 rtl_write_byte(rtlpriv, (REG_MACID + idx), in rtl8821ae_set_hw_reg()
491 rtl_write_word(rtlpriv, REG_RRSR, b_rate_cfg); in rtl8821ae_set_hw_reg()
496 rtl_write_byte(rtlpriv, (REG_BSSID + idx), in rtl8821ae_set_hw_reg()
502 rtl_write_byte(rtlpriv, REG_SIFS_CTX + 1, val[0]); in rtl8821ae_set_hw_reg()
503 rtl_write_byte(rtlpriv, REG_SIFS_TRX + 1, val[0]); in rtl8821ae_set_hw_reg()
505 rtl_write_byte(rtlpriv, REG_SPEC_SIFS + 1, val[0]); in rtl8821ae_set_hw_reg()
506 rtl_write_byte(rtlpriv, REG_MAC_SPEC_SIFS + 1, val[0]); in rtl8821ae_set_hw_reg()
508 rtl_write_byte(rtlpriv, REG_RESP_SIFS_OFDM + 1, val[0]); in rtl8821ae_set_hw_reg()
509 rtl_write_byte(rtlpriv, REG_RESP_SIFS_OFDM, val[0]); in rtl8821ae_set_hw_reg()
512 rtl_write_byte(rtlpriv, REG_RESP_SIFS_OFDM + 1, val[0]); in rtl8821ae_set_hw_reg()
517 rtl_dbg(rtlpriv, COMP_MLME, DBG_LOUD, in rtl8821ae_set_hw_reg()
520 rtl_write_byte(rtlpriv, REG_SLOT, val[0]); in rtl8821ae_set_hw_reg()
523 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_set_hw_reg()
532 reg_tmp = rtl_read_byte(rtlpriv, REG_TRXPTCL_CTL+2); in rtl8821ae_set_hw_reg()
535 rtl_write_byte(rtlpriv, REG_TRXPTCL_CTL + 2, in rtl8821ae_set_hw_reg()
539 rtl_write_byte(rtlpriv, in rtl8821ae_set_hw_reg()
545 rtl_write_byte(rtlpriv, REG_SECCFG, *((u8 *)val)); in rtl8821ae_set_hw_reg()
564 rtl_dbg(rtlpriv, COMP_MLME, DBG_LOUD, in rtl8821ae_set_hw_reg()
568 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, in rtl8821ae_set_hw_reg()
578 rtl_dbg(rtlpriv, COMP_MLME, DBG_LOUD, in rtl8821ae_set_hw_reg()
582 rtl_write_byte(rtlpriv, REG_AMPDU_MIN_SPACE, in rtl8821ae_set_hw_reg()
604 rtl_write_dword(rtlpriv, in rtl8821ae_set_hw_reg()
612 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_set_hw_reg()
621 u8 acm_ctrl = rtl_read_byte(rtlpriv, REG_ACMHWCTRL); in rtl8821ae_set_hw_reg()
638 rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING, in rtl8821ae_set_hw_reg()
655 rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD, in rtl8821ae_set_hw_reg()
662 rtl_dbg(rtlpriv, COMP_QOS, DBG_TRACE, in rtl8821ae_set_hw_reg()
665 rtl_write_byte(rtlpriv, REG_ACMHWCTRL, acm_ctrl); in rtl8821ae_set_hw_reg()
668 rtl_write_dword(rtlpriv, REG_RCR, ((u32 *)(val))[0]); in rtl8821ae_set_hw_reg()
674 rtl_write_word(rtlpriv, REG_RL, in rtl8821ae_set_hw_reg()
679 rtl_write_byte(rtlpriv, REG_DUAL_TSF_RST, (BIT(0) | BIT(1))); in rtl8821ae_set_hw_reg()
693 rpwm_val = rtl_read_byte(rtlpriv, REG_PCIE_HRPWM); in rtl8821ae_set_hw_reg()
697 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, in rtl8821ae_set_hw_reg()
700 rtl_write_byte(rtlpriv, REG_PCIE_HRPWM, in rtl8821ae_set_hw_reg()
728 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AID, in rtl8821ae_set_hw_reg()
740 u2btmp = rtl_read_word(rtlpriv, REG_BCN_PSR_RPT); in rtl8821ae_set_hw_reg()
742 rtl_write_word(rtlpriv, REG_BCN_PSR_RPT, (u2btmp | in rtl8821ae_set_hw_reg()
753 rtl_write_dword(rtlpriv, REG_TSFTR, in rtl8821ae_set_hw_reg()
755 rtl_write_dword(rtlpriv, REG_TSFTR + 4, in rtl8821ae_set_hw_reg()
767 rtl_dbg(rtlpriv, COMP_INIT, DBG_WARNING, in rtl8821ae_set_hw_reg()
772 rtl_write_byte(rtlpriv, REG_NAV_UPPER, in rtl8821ae_set_hw_reg()
785 rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD, in rtl8821ae_set_hw_reg()
793 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_llt_write() local
799 rtl_write_dword(rtlpriv, REG_LLT_INIT, value); in _rtl8821ae_llt_write()
802 value = rtl_read_dword(rtlpriv, REG_LLT_INIT); in _rtl8821ae_llt_write()
819 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_llt_table_init() local
830 rtl_write_byte(rtlpriv, REG_TRXFF_BNDY, txpktbuf_bndy); in _rtl8821ae_llt_table_init()
831 rtl_write_word(rtlpriv, REG_TRXFF_BNDY + 2, MAX_RX_DMA_BUFFER_SIZE - 1); in _rtl8821ae_llt_table_init()
833 rtl_write_byte(rtlpriv, REG_TDECTRL + 1, txpktbuf_bndy); in _rtl8821ae_llt_table_init()
835 rtl_write_byte(rtlpriv, REG_TXPKTBUF_BCNQ_BDNY, txpktbuf_bndy); in _rtl8821ae_llt_table_init()
836 rtl_write_byte(rtlpriv, REG_TXPKTBUF_MGQ_BDNY, txpktbuf_bndy); in _rtl8821ae_llt_table_init()
838 rtl_write_byte(rtlpriv, REG_PBP, 0x31); in _rtl8821ae_llt_table_init()
839 rtl_write_byte(rtlpriv, REG_RX_DRVINFO_SZ, 0x4); in _rtl8821ae_llt_table_init()
861 rtl_write_dword(rtlpriv, REG_RQPN, rqpn); in _rtl8821ae_llt_table_init()
863 rtl_write_byte(rtlpriv, REG_RQPN_NPQ, 0x00); in _rtl8821ae_llt_table_init()
870 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_gen_refresh_led_state() local
872 enum rtl_led_pin pin0 = rtlpriv->ledctl.sw_led0; in _rtl8821ae_gen_refresh_led_state()
875 if (rtlpriv->rtlhal.up_first_time) in _rtl8821ae_gen_refresh_led_state()
897 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_init_mac() local
905 rtl_write_byte(rtlpriv, REG_RSV_CTRL, 0x00); in _rtl8821ae_init_mac()
908 bytetmp = rtl_read_byte(rtlpriv, REG_APS_FSMCO + 1) & (~BIT(7)); in _rtl8821ae_init_mac()
909 rtl_write_byte(rtlpriv, REG_APS_FSMCO + 1, bytetmp); in _rtl8821ae_init_mac()
913 if (!rtl_hal_pwrseqcmdparsing(rtlpriv, PWR_CUT_ALL_MSK, in _rtl8821ae_init_mac()
916 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_init_mac()
922 if (!rtl_hal_pwrseqcmdparsing(rtlpriv, PWR_CUT_A_MSK, in _rtl8821ae_init_mac()
925 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_init_mac()
931 bytetmp = rtl_read_byte(rtlpriv, REG_APS_FSMCO) | BIT(4); in _rtl8821ae_init_mac()
932 rtl_write_byte(rtlpriv, REG_APS_FSMCO, bytetmp); in _rtl8821ae_init_mac()
934 bytetmp = rtl_read_byte(rtlpriv, REG_CR); in _rtl8821ae_init_mac()
936 rtl_write_byte(rtlpriv, REG_CR, bytetmp); in _rtl8821ae_init_mac()
940 rtl_write_byte(rtlpriv, REG_HWSEQ_CTRL, bytetmp); in _rtl8821ae_init_mac()
944 bytetmp = rtl_read_byte(rtlpriv, REG_SYS_CFG + 3); in _rtl8821ae_init_mac()
946 bytetmp = rtl_read_byte(rtlpriv, 0x7c); in _rtl8821ae_init_mac()
948 rtl_write_byte(rtlpriv, 0x7c, bytetmp); in _rtl8821ae_init_mac()
952 bytetmp = rtl_read_byte(rtlpriv, REG_GPIO_MUXCFG + 1); in _rtl8821ae_init_mac()
954 rtl_write_byte(rtlpriv, REG_GPIO_MUXCFG + 1, bytetmp); in _rtl8821ae_init_mac()
956 rtl_write_word(rtlpriv, REG_CR, 0x2ff); in _rtl8821ae_init_mac()
963 rtl_write_dword(rtlpriv, REG_HISR, 0xffffffff); in _rtl8821ae_init_mac()
964 rtl_write_dword(rtlpriv, REG_HISRE, 0xffffffff); in _rtl8821ae_init_mac()
967 bytetmp = rtl_read_byte(rtlpriv, REG_FWIMR + 3); in _rtl8821ae_init_mac()
968 rtl_write_byte(rtlpriv, REG_FWIMR + 3, bytetmp | BIT(6)); in _rtl8821ae_init_mac()
970 wordtmp = rtl_read_word(rtlpriv, REG_TRXDMA_CTRL); in _rtl8821ae_init_mac()
973 rtl_write_word(rtlpriv, REG_TRXDMA_CTRL, wordtmp); in _rtl8821ae_init_mac()
975 rtl_write_byte(rtlpriv, REG_FWHW_TXQ_CTRL + 1, 0x1F); in _rtl8821ae_init_mac()
976 rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config); in _rtl8821ae_init_mac()
977 rtl_write_word(rtlpriv, REG_RXFLTMAP2, 0xFFFF); in _rtl8821ae_init_mac()
979 rtl_write_dword(rtlpriv, REG_BCNQ_DESA, in _rtl8821ae_init_mac()
981 rtl_write_dword(rtlpriv, REG_MGQ_DESA, in _rtl8821ae_init_mac()
983 rtl_write_dword(rtlpriv, REG_VOQ_DESA, in _rtl8821ae_init_mac()
985 rtl_write_dword(rtlpriv, REG_VIQ_DESA, in _rtl8821ae_init_mac()
987 rtl_write_dword(rtlpriv, REG_BEQ_DESA, in _rtl8821ae_init_mac()
989 rtl_write_dword(rtlpriv, REG_BKQ_DESA, in _rtl8821ae_init_mac()
991 rtl_write_dword(rtlpriv, REG_HQ_DESA, in _rtl8821ae_init_mac()
993 rtl_write_dword(rtlpriv, REG_RX_DESA, in _rtl8821ae_init_mac()
996 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 3, 0x77); in _rtl8821ae_init_mac()
998 rtl_write_dword(rtlpriv, REG_INT_MIG, 0); in _rtl8821ae_init_mac()
1000 rtl_write_dword(rtlpriv, REG_MCUTST_1, 0); in _rtl8821ae_init_mac()
1002 rtl_write_byte(rtlpriv, REG_SECONDARY_CCA_CTRL, 0x3); in _rtl8821ae_init_mac()
1010 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_hw_configure() local
1016 rtl_write_dword(rtlpriv, REG_RRSR, reg_rrsr); in _rtl8821ae_hw_configure()
1018 rtl_write_dword(rtlpriv, REG_ARFR0 + 4, 0xfffff000); in _rtl8821ae_hw_configure()
1020 rtl_write_dword(rtlpriv, REG_ARFR1 + 4, 0x003ff000); in _rtl8821ae_hw_configure()
1022 rtl_write_dword(rtlpriv, REG_ARFR2, 0x00000015); in _rtl8821ae_hw_configure()
1023 rtl_write_dword(rtlpriv, REG_ARFR2 + 4, 0x003ff000); in _rtl8821ae_hw_configure()
1025 rtl_write_dword(rtlpriv, REG_ARFR3, 0x00000015); in _rtl8821ae_hw_configure()
1026 rtl_write_dword(rtlpriv, REG_ARFR3 + 4, 0xffcff000); in _rtl8821ae_hw_configure()
1028 rtl_write_word(rtlpriv, REG_FWHW_TXQ_CTRL, 0x1F00); in _rtl8821ae_hw_configure()
1029 rtl_write_byte(rtlpriv, REG_AMPDU_MAX_TIME, 0x70); in _rtl8821ae_hw_configure()
1032 rtl_write_word(rtlpriv, REG_RL, 0x0707); in _rtl8821ae_hw_configure()
1035 rtl_write_dword(rtlpriv, REG_DARFRC, 0x01000000); in _rtl8821ae_hw_configure()
1036 rtl_write_dword(rtlpriv, REG_DARFRC + 4, 0x07060504); in _rtl8821ae_hw_configure()
1037 rtl_write_dword(rtlpriv, REG_RARFRC, 0x01000000); in _rtl8821ae_hw_configure()
1038 rtl_write_dword(rtlpriv, REG_RARFRC + 4, 0x07060504); in _rtl8821ae_hw_configure()
1041 rtl_write_byte(rtlpriv, REG_BCN_CTRL, rtlpci->reg_bcn_ctrl_val); in _rtl8821ae_hw_configure()
1044 rtl_write_byte(rtlpriv, REG_TBTT_PROHIBIT + 1, 0xff); in _rtl8821ae_hw_configure()
1047 rtl_write_word(rtlpriv, REG_NAV_PROT_LEN, 0x0040); in _rtl8821ae_hw_configure()
1050 rtl_write_dword(rtlpriv, REG_FAST_EDCA_CTRL, 0x03086666); in _rtl8821ae_hw_configure()
1052 rtl_write_byte(rtlpriv, REG_HT_SINGLE_AMPDU, 0x80); in _rtl8821ae_hw_configure()
1053 rtl_write_byte(rtlpriv, REG_RX_PKT_LIMIT, 0x20); in _rtl8821ae_hw_configure()
1054 rtl_write_word(rtlpriv, REG_MAX_AGGR_NUM, 0x1F1F); in _rtl8821ae_hw_configure()
1057 static u16 _rtl8821ae_mdio_read(struct rtl_priv *rtlpriv, u8 addr) in _rtl8821ae_mdio_read() argument
1062 rtl_write_byte(rtlpriv, REG_MDIO_CTL, addr | BIT(6)); in _rtl8821ae_mdio_read()
1063 tmp = rtl_read_byte(rtlpriv, REG_MDIO_CTL) & BIT(6); in _rtl8821ae_mdio_read()
1067 tmp = rtl_read_byte(rtlpriv, REG_MDIO_CTL) & BIT(6); in _rtl8821ae_mdio_read()
1071 ret = rtl_read_word(rtlpriv, REG_MDIO_RDATA); in _rtl8821ae_mdio_read()
1076 static void _rtl8821ae_mdio_write(struct rtl_priv *rtlpriv, u8 addr, u16 data) in _rtl8821ae_mdio_write() argument
1080 rtl_write_word(rtlpriv, REG_MDIO_WDATA, data); in _rtl8821ae_mdio_write()
1081 rtl_write_byte(rtlpriv, REG_MDIO_CTL, addr | BIT(5)); in _rtl8821ae_mdio_write()
1082 tmp = rtl_read_byte(rtlpriv, REG_MDIO_CTL) & BIT(5); in _rtl8821ae_mdio_write()
1086 tmp = rtl_read_byte(rtlpriv, REG_MDIO_CTL) & BIT(5); in _rtl8821ae_mdio_write()
1091 static u8 _rtl8821ae_dbi_read(struct rtl_priv *rtlpriv, u16 addr) in _rtl8821ae_dbi_read() argument
1096 rtl_write_word(rtlpriv, REG_DBI_ADDR, read_addr); in _rtl8821ae_dbi_read()
1097 rtl_write_byte(rtlpriv, REG_DBI_FLAG, 0x2); in _rtl8821ae_dbi_read()
1098 tmp = rtl_read_byte(rtlpriv, REG_DBI_FLAG); in _rtl8821ae_dbi_read()
1102 tmp = rtl_read_byte(rtlpriv, REG_DBI_FLAG); in _rtl8821ae_dbi_read()
1107 ret = rtl_read_byte(rtlpriv, read_addr); in _rtl8821ae_dbi_read()
1112 static void _rtl8821ae_dbi_write(struct rtl_priv *rtlpriv, u16 addr, u8 data) in _rtl8821ae_dbi_write() argument
1118 rtl_write_byte(rtlpriv, write_addr, data); in _rtl8821ae_dbi_write()
1121 rtl_write_word(rtlpriv, REG_DBI_ADDR, write_addr); in _rtl8821ae_dbi_write()
1123 rtl_write_byte(rtlpriv, REG_DBI_FLAG, 0x1); in _rtl8821ae_dbi_write()
1125 tmp = rtl_read_byte(rtlpriv, REG_DBI_FLAG); in _rtl8821ae_dbi_write()
1129 tmp = rtl_read_byte(rtlpriv, REG_DBI_FLAG); in _rtl8821ae_dbi_write()
1136 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_enable_aspm_back_door() local
1141 if (_rtl8821ae_mdio_read(rtlpriv, 0x04) != 0x8544) in _rtl8821ae_enable_aspm_back_door()
1142 _rtl8821ae_mdio_write(rtlpriv, 0x04, 0x8544); in _rtl8821ae_enable_aspm_back_door()
1144 if (_rtl8821ae_mdio_read(rtlpriv, 0x0b) != 0x0070) in _rtl8821ae_enable_aspm_back_door()
1145 _rtl8821ae_mdio_write(rtlpriv, 0x0b, 0x0070); in _rtl8821ae_enable_aspm_back_door()
1148 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x70f); in _rtl8821ae_enable_aspm_back_door()
1149 _rtl8821ae_dbi_write(rtlpriv, 0x70f, tmp | BIT(7) | in _rtl8821ae_enable_aspm_back_door()
1152 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x719); in _rtl8821ae_enable_aspm_back_door()
1153 _rtl8821ae_dbi_write(rtlpriv, 0x719, tmp | BIT(3) | BIT(4)); in _rtl8821ae_enable_aspm_back_door()
1156 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x718); in _rtl8821ae_enable_aspm_back_door()
1157 _rtl8821ae_dbi_write(rtlpriv, 0x718, tmp|BIT(4)); in _rtl8821ae_enable_aspm_back_door()
1163 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_enable_hw_security_config() local
1167 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, in rtl8821ae_enable_hw_security_config()
1169 rtlpriv->sec.pairwise_enc_algorithm, in rtl8821ae_enable_hw_security_config()
1170 rtlpriv->sec.group_enc_algorithm); in rtl8821ae_enable_hw_security_config()
1172 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { in rtl8821ae_enable_hw_security_config()
1173 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, in rtl8821ae_enable_hw_security_config()
1180 if (rtlpriv->sec.use_defaultkey) { in rtl8821ae_enable_hw_security_config()
1187 tmp = rtl_read_byte(rtlpriv, REG_CR + 1); in rtl8821ae_enable_hw_security_config()
1188 rtl_write_byte(rtlpriv, REG_CR + 1, tmp | BIT(1)); in rtl8821ae_enable_hw_security_config()
1190 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, in rtl8821ae_enable_hw_security_config()
1193 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); in rtl8821ae_enable_hw_security_config()
1205 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_macid_initialize_mediastatus() local
1210 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_macid_initialize_mediastatus()
1213 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in rtl8821ae_macid_initialize_mediastatus()
1221 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_check_pcie_dma_hang() local
1225 tmp = rtl_read_byte(rtlpriv, REG_DBI_CTRL + 3); in _rtl8821ae_check_pcie_dma_hang()
1227 rtl_write_byte(rtlpriv, REG_DBI_CTRL + 3, (tmp | BIT(2))); in _rtl8821ae_check_pcie_dma_hang()
1233 tmp = rtl_read_byte(rtlpriv, REG_DBI_CTRL + 3); in _rtl8821ae_check_pcie_dma_hang()
1235 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_check_pcie_dma_hang()
1247 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_reset_pcie_interface_dma() local
1253 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "\n"); in _rtl8821ae_reset_pcie_interface_dma()
1256 tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL); in _rtl8821ae_reset_pcie_interface_dma()
1258 rtl_write_byte(rtlpriv, REG_RSV_CTRL, tmp); in _rtl8821ae_reset_pcie_interface_dma()
1261 tmp = rtl_read_byte(rtlpriv, REG_PMC_DBG_CTRL2); in _rtl8821ae_reset_pcie_interface_dma()
1263 rtl_write_byte(rtlpriv, REG_PMC_DBG_CTRL2, tmp); in _rtl8821ae_reset_pcie_interface_dma()
1269 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in _rtl8821ae_reset_pcie_interface_dma()
1274 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, (tmp | BIT(2))); in _rtl8821ae_reset_pcie_interface_dma()
1277 backup_pcie_dma_pause = rtl_read_byte(rtlpriv, REG_PCIE_CTRL_REG + 1); in _rtl8821ae_reset_pcie_interface_dma()
1279 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0xFF); in _rtl8821ae_reset_pcie_interface_dma()
1284 rtl_write_byte(rtlpriv, REG_CR, 0); in _rtl8821ae_reset_pcie_interface_dma()
1288 tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1); in _rtl8821ae_reset_pcie_interface_dma()
1290 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN + 1, tmp); in _rtl8821ae_reset_pcie_interface_dma()
1293 tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1); in _rtl8821ae_reset_pcie_interface_dma()
1295 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN + 1, tmp); in _rtl8821ae_reset_pcie_interface_dma()
1300 rtl_write_byte(rtlpriv, REG_CR, 0xFF); in _rtl8821ae_reset_pcie_interface_dma()
1311 tmp = rtl_read_byte(rtlpriv, REG_MAC_PHY_CTRL_NORMAL + 2); in _rtl8821ae_reset_pcie_interface_dma()
1313 rtl_write_byte(rtlpriv, REG_MAC_PHY_CTRL_NORMAL + 2, tmp); in _rtl8821ae_reset_pcie_interface_dma()
1325 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in _rtl8821ae_reset_pcie_interface_dma()
1326 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, in _rtl8821ae_reset_pcie_interface_dma()
1329 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, in _rtl8821ae_reset_pcie_interface_dma()
1336 tmp = rtl_read_byte(rtlpriv, REG_PMC_DBG_CTRL2); in _rtl8821ae_reset_pcie_interface_dma()
1338 rtl_write_byte(rtlpriv, REG_PMC_DBG_CTRL2, tmp); in _rtl8821ae_reset_pcie_interface_dma()
1345 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_get_wakeup_reason() local
1347 struct rtl_ps_ctl *ppsc = rtl_psc(rtlpriv); in _rtl8821ae_get_wakeup_reason()
1350 fw_reason = rtl_read_byte(rtlpriv, REG_MCUTST_WOWLAN); in _rtl8821ae_get_wakeup_reason()
1352 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, "WOL Read 0x1c7 = %02X\n", in _rtl8821ae_get_wakeup_reason()
1362 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1367 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1372 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1377 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1382 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1387 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1392 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1397 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1402 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1407 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1412 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1416 rtl_dbg(rtlpriv, COMP_POWER, DBG_DMESG, in _rtl8821ae_get_wakeup_reason()
1425 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_init_trx_desc_hw_address() local
1429 rtl_write_dword(rtlpriv, REG_BCNQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1431 rtl_write_dword(rtlpriv, REG_MGQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1433 rtl_write_dword(rtlpriv, REG_VOQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1435 rtl_write_dword(rtlpriv, REG_VIQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1437 rtl_write_dword(rtlpriv, REG_BEQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1439 rtl_write_dword(rtlpriv, REG_BKQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1441 rtl_write_dword(rtlpriv, REG_HQ_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1443 rtl_write_dword(rtlpriv, REG_RX_DESA, in _rtl8821ae_init_trx_desc_hw_address()
1481 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_dynamic_rqpn() local
1487 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in _rtl8821ae_dynamic_rqpn()
1490 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_dynamic_rqpn()
1496 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0xFE); in _rtl8821ae_dynamic_rqpn()
1500 tmp16 = rtl_read_word(rtlpriv, REG_TXPKT_EMPTY); in _rtl8821ae_dynamic_rqpn()
1503 tmp16 = rtl_read_word(rtlpriv, REG_TXPKT_EMPTY); in _rtl8821ae_dynamic_rqpn()
1506 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_dynamic_rqpn()
1510 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_dynamic_rqpn()
1518 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0xFF); in _rtl8821ae_dynamic_rqpn()
1523 while (rtl_read_byte(rtlpriv, REG_SCH_TXCMD) != 0) { in _rtl8821ae_dynamic_rqpn()
1527 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_dynamic_rqpn()
1538 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in _rtl8821ae_dynamic_rqpn()
1539 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, (tmp | BIT(2))); in _rtl8821ae_dynamic_rqpn()
1541 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in _rtl8821ae_dynamic_rqpn()
1546 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_dynamic_rqpn()
1552 tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN); in _rtl8821ae_dynamic_rqpn()
1554 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, tmp); in _rtl8821ae_dynamic_rqpn()
1559 rtl_write_byte(rtlpriv, REG_CR, 0x00); in _rtl8821ae_dynamic_rqpn()
1564 tmp = rtl_read_byte(rtlpriv, REG_CR + 1); in _rtl8821ae_dynamic_rqpn()
1566 rtl_write_byte(rtlpriv, REG_CR + 1, tmp); in _rtl8821ae_dynamic_rqpn()
1570 tmp = rtl_read_byte(rtlpriv, REG_DUAL_TSF_RST); in _rtl8821ae_dynamic_rqpn()
1571 rtl_write_byte(rtlpriv, REG_DUAL_TSF_RST, (tmp | BIT(5))); in _rtl8821ae_dynamic_rqpn()
1575 tmp = rtl_read_byte(rtlpriv, REG_CR + 1); in _rtl8821ae_dynamic_rqpn()
1576 rtl_write_byte(rtlpriv, REG_CR + 1, (tmp | BIT(1))); in _rtl8821ae_dynamic_rqpn()
1581 rtl_write_byte(rtlpriv, REG_CR, 0xFF); in _rtl8821ae_dynamic_rqpn()
1586 tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN); in _rtl8821ae_dynamic_rqpn()
1587 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, (tmp | BIT(0))); in _rtl8821ae_dynamic_rqpn()
1591 rtl_write_byte(rtlpriv, REG_TDECTRL + 1, (u8)boundary); in _rtl8821ae_dynamic_rqpn()
1592 rtl_write_byte(rtlpriv, REG_TXPKTBUF_BCNQ_BDNY, (u8)boundary); in _rtl8821ae_dynamic_rqpn()
1593 rtl_write_byte(rtlpriv, REG_TXPKTBUF_MGQ_BDNY, (u8)boundary); in _rtl8821ae_dynamic_rqpn()
1597 rtl_write_byte(rtlpriv, REG_TXPKTBUF_WMAC_LBK_BF_HD, in _rtl8821ae_dynamic_rqpn()
1600 rtl_write_word(rtlpriv, REG_TRXFF_BNDY, boundary); in _rtl8821ae_dynamic_rqpn()
1605 rtl_dbg(rtlpriv, COMP_INIT, DBG_WARNING, in _rtl8821ae_dynamic_rqpn()
1612 rtl_write_word(rtlpriv, REG_RQPN_NPQ, npq_rqpn_value); in _rtl8821ae_dynamic_rqpn()
1613 rtl_write_dword(rtlpriv, REG_RQPN, rqpn_val); in _rtl8821ae_dynamic_rqpn()
1617 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00); in _rtl8821ae_dynamic_rqpn()
1622 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0x00); in _rtl8821ae_dynamic_rqpn()
1623 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in _rtl8821ae_dynamic_rqpn()
1624 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, (tmp&~BIT(2))); in _rtl8821ae_dynamic_rqpn()
1626 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "End.\n"); in _rtl8821ae_dynamic_rqpn()
1632 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_simple_initialize_adapter() local
1633 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_simple_initialize_adapter()
1634 struct rtl_ps_ctl *ppsc = rtl_psc(rtlpriv); in _rtl8821ae_simple_initialize_adapter()
1659 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_enable_l1off() local
1661 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "--->\n"); in _rtl8821ae_enable_l1off()
1663 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x160); in _rtl8821ae_enable_l1off()
1665 rtl_dbg(rtlpriv, COMP_POWER | COMP_INIT, DBG_LOUD, in _rtl8821ae_enable_l1off()
1670 tmp = _rtl8821ae_mdio_read(rtlpriv, 0x1b); in _rtl8821ae_enable_l1off()
1671 _rtl8821ae_mdio_write(rtlpriv, 0x1b, (tmp | BIT(4))); in _rtl8821ae_enable_l1off()
1673 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x718); in _rtl8821ae_enable_l1off()
1674 _rtl8821ae_dbi_write(rtlpriv, 0x718, tmp | BIT(5)); in _rtl8821ae_enable_l1off()
1676 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "<---\n"); in _rtl8821ae_enable_l1off()
1682 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_enable_ltr() local
1684 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "--->\n"); in _rtl8821ae_enable_ltr()
1687 tmp = _rtl8821ae_dbi_read(rtlpriv, 0x99); in _rtl8821ae_enable_ltr()
1689 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_enable_ltr()
1695 rtl_write_dword(rtlpriv, 0x798, 0x88908890); in _rtl8821ae_enable_ltr()
1698 rtl_write_dword(rtlpriv, 0x79c, 0x883c883c); in _rtl8821ae_enable_ltr()
1700 tmp = rtl_read_byte(rtlpriv, 0x7a4); in _rtl8821ae_enable_ltr()
1701 rtl_write_byte(rtlpriv, 0x7a4, (tmp | BIT(4))); in _rtl8821ae_enable_ltr()
1703 tmp = rtl_read_byte(rtlpriv, 0x7a4); in _rtl8821ae_enable_ltr()
1704 rtl_write_byte(rtlpriv, 0x7a4, (tmp & (~BIT(0)))); in _rtl8821ae_enable_ltr()
1705 rtl_write_byte(rtlpriv, 0x7a4, (tmp | BIT(0))); in _rtl8821ae_enable_ltr()
1707 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "<---\n"); in _rtl8821ae_enable_ltr()
1712 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_wowlan_initialize_adapter() local
1713 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_wowlan_initialize_adapter()
1729 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0xFE); in _rtl8821ae_wowlan_initialize_adapter()
1730 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, "Enable PCIE Rx DMA.\n"); in _rtl8821ae_wowlan_initialize_adapter()
1735 tmp = rtl_read_byte(rtlpriv, REG_FTISR + 3); in _rtl8821ae_wowlan_initialize_adapter()
1736 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, in _rtl8821ae_wowlan_initialize_adapter()
1744 tmp = rtl_read_byte(rtlpriv, REG_HSISR + 3); in _rtl8821ae_wowlan_initialize_adapter()
1747 rtl_write_byte(rtlpriv, REG_HSISR + 3, tmp | BIT(1)); in _rtl8821ae_wowlan_initialize_adapter()
1758 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0x00); in _rtl8821ae_wowlan_initialize_adapter()
1760 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, 0x02); in _rtl8821ae_wowlan_initialize_adapter()
1762 tmp = rtl_read_byte(rtlpriv, REG_CR + 1); in _rtl8821ae_wowlan_initialize_adapter()
1763 rtl_write_byte(rtlpriv, REG_CR + 1, (tmp & (~BIT(0)))); in _rtl8821ae_wowlan_initialize_adapter()
1793 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_poweroff_adapter() local
1805 rtl_hal_pwrseqcmdparsing(rtlpriv, in _rtl8821ae_poweroff_adapter()
1812 if ((rtl_read_byte(rtlpriv, REG_MCUFWDL) & BIT(7)) && in _rtl8821ae_poweroff_adapter()
1818 u1b_tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN+1); in _rtl8821ae_poweroff_adapter()
1819 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN+1, (u1b_tmp & (~BIT(2)))); in _rtl8821ae_poweroff_adapter()
1823 rtl_write_byte(rtlpriv, REG_MCUFWDL, 0x00); in _rtl8821ae_poweroff_adapter()
1827 rtl_hal_pwrseqcmdparsing(rtlpriv, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, in _rtl8821ae_poweroff_adapter()
1831 rtl_hal_pwrseqcmdparsing(rtlpriv, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, in _rtl8821ae_poweroff_adapter()
1836 u1b_tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL + 1); in _rtl8821ae_poweroff_adapter()
1837 rtl_write_byte(rtlpriv, REG_RSV_CTRL + 1, (u1b_tmp & (~BIT(0)))); in _rtl8821ae_poweroff_adapter()
1838 u1b_tmp = rtl_read_byte(rtlpriv, REG_RSV_CTRL + 1); in _rtl8821ae_poweroff_adapter()
1839 rtl_write_byte(rtlpriv, REG_RSV_CTRL + 1, u1b_tmp | BIT(0)); in _rtl8821ae_poweroff_adapter()
1843 rtl_write_byte(rtlpriv, REG_RSV_CTRL, 0x0e); in _rtl8821ae_poweroff_adapter()
1848 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_hw_init() local
1859 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in rtl8821ae_hw_init()
1861 rtlpriv->intf_ops->disable_aspm(hw); in rtl8821ae_hw_init()
1865 tmp_u1b = rtl_read_byte(rtlpriv, REG_CR); in rtl8821ae_hw_init()
1868 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in rtl8821ae_hw_init()
1907 tmp_u1b = rtl_read_byte(rtlpriv, REG_SYS_CFG); in rtl8821ae_hw_init()
1909 rtl_write_byte(rtlpriv, REG_SYS_CFG, tmp_u1b); in rtl8821ae_hw_init()
1913 rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING, in rtl8821ae_hw_init()
1943 if (rtlpriv->phy.rf_type == RF_1T1R && in rtl8821ae_hw_init()
1961 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr); in rtl8821ae_hw_init()
1963 rtlpriv->intf_ops->enable_aspm(hw); in rtl8821ae_hw_init()
1970 rtlpriv->rtlhal.being_init_adapter = false; in rtl8821ae_hw_init()
1972 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_NAV_UPPER, (u8 *)&nav_upper); in rtl8821ae_hw_init()
1977 rtl_write_byte(rtlpriv, REG_WOW_CTRL, 0); in rtl8821ae_hw_init()
1980 tmp_u1b = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in rtl8821ae_hw_init()
1984 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, tmp_u1b); in rtl8821ae_hw_init()
1988 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0); in rtl8821ae_hw_init()
1993 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "%s() <====\n", __func__); in rtl8821ae_hw_init()
1999 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_chip_version() local
2000 struct rtl_phy *rtlphy = &rtlpriv->phy; in _rtl8821ae_read_chip_version()
2005 value32 = rtl_read_dword(rtlpriv, REG_SYS_CFG); in _rtl8821ae_read_chip_version()
2006 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2014 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2049 value32 = rtl_read_dword(rtlpriv, REG_MULTI_FUNC_CTRL); in _rtl8821ae_read_chip_version()
2055 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2059 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2063 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2067 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2071 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2075 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2079 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2083 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2087 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2091 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_chip_version()
2102 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_set_media_status() local
2103 u8 bt_msr = rtl_read_byte(rtlpriv, MSR); in _rtl8821ae_set_media_status()
2107 rtl_write_dword(rtlpriv, REG_BCN_CTRL, 0); in _rtl8821ae_set_media_status()
2108 rtl_dbg(rtlpriv, COMP_BEACON, DBG_LOUD, in _rtl8821ae_set_media_status()
2120 rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING, in _rtl8821ae_set_media_status()
2129 rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, in _rtl8821ae_set_media_status()
2134 rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, in _rtl8821ae_set_media_status()
2140 rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, in _rtl8821ae_set_media_status()
2145 rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, in _rtl8821ae_set_media_status()
2153 rtl_write_byte(rtlpriv, MSR, bt_msr); in _rtl8821ae_set_media_status()
2154 rtlpriv->cfg->ops->led_control(hw, ledaction); in _rtl8821ae_set_media_status()
2156 rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x00); in _rtl8821ae_set_media_status()
2158 rtl_write_byte(rtlpriv, REG_BCNTCFG + 1, 0x66); in _rtl8821ae_set_media_status()
2165 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_check_bssid() local
2169 if (rtlpriv->psc.rfpwr_state != ERFON) in rtl8821ae_set_check_bssid()
2174 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, in rtl8821ae_set_check_bssid()
2180 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_set_check_bssid()
2187 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_network_type() local
2189 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "%s!\n", __func__); in rtl8821ae_set_network_type()
2194 if (rtlpriv->mac80211.link_state == MAC80211_LINKED) { in rtl8821ae_set_network_type()
2207 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_qos() local
2211 rtl_write_dword(rtlpriv, REG_EDCA_BK_PARAM, 0xa44f); in rtl8821ae_set_qos()
2217 rtl_write_dword(rtlpriv, REG_EDCA_VI_PARAM, 0x5e4322); in rtl8821ae_set_qos()
2220 rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222); in rtl8821ae_set_qos()
2230 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_clear_interrupt() local
2231 u32 tmp = rtl_read_dword(rtlpriv, REG_HISR); in rtl8821ae_clear_interrupt()
2233 rtl_write_dword(rtlpriv, REG_HISR, tmp); in rtl8821ae_clear_interrupt()
2235 tmp = rtl_read_dword(rtlpriv, REG_HISRE); in rtl8821ae_clear_interrupt()
2236 rtl_write_dword(rtlpriv, REG_HISRE, tmp); in rtl8821ae_clear_interrupt()
2238 tmp = rtl_read_dword(rtlpriv, REG_HSISR); in rtl8821ae_clear_interrupt()
2239 rtl_write_dword(rtlpriv, REG_HSISR, tmp); in rtl8821ae_clear_interrupt()
2244 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_enable_interrupt() local
2250 rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF); in rtl8821ae_enable_interrupt()
2251 rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF); in rtl8821ae_enable_interrupt()
2260 rtl_write_dword(rtlpriv, REG_HSIMR, rtlpci->sys_irq_mask & 0xFFFFFFFF); in rtl8821ae_enable_interrupt()
2265 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_disable_interrupt() local
2268 rtl_write_dword(rtlpriv, REG_HIMR, IMR_DISABLED); in rtl8821ae_disable_interrupt()
2269 rtl_write_dword(rtlpriv, REG_HIMRE, IMR_DISABLED); in rtl8821ae_disable_interrupt()
2276 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_clear_pci_pme_status() local
2289 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_clear_pci_pme_status()
2296 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_clear_pci_pme_status()
2328 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, in _rtl8821ae_clear_pci_pme_status()
2332 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, in _rtl8821ae_clear_pci_pme_status()
2337 rtl_dbg(rtlpriv, COMP_INIT, DBG_WARNING, in _rtl8821ae_clear_pci_pme_status()
2344 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_card_disable() local
2345 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in rtl8821ae_card_disable()
2346 struct rtl_ps_ctl *ppsc = rtl_psc(rtlpriv); in rtl8821ae_card_disable()
2347 struct rtl_mac *mac = rtl_mac(rtlpriv); in rtl8821ae_card_disable()
2353 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in rtl8821ae_card_disable()
2360 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "Normal Power off\n"); in rtl8821ae_card_disable()
2366 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "Wowlan Supported.\n"); in rtl8821ae_card_disable()
2369 rtl_write_byte(rtlpriv, REG_MCUTST_WOWLAN, 0x0); in rtl8821ae_card_disable()
2391 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AID, NULL); in rtl8821ae_card_disable()
2408 rtl_write_byte(rtlpriv, REG_RXDMA_CONTROL, BIT(2)); in rtl8821ae_card_disable()
2410 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in rtl8821ae_card_disable()
2414 tmp = rtl_read_byte(rtlpriv, REG_RXDMA_CONTROL); in rtl8821ae_card_disable()
2416 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in rtl8821ae_card_disable()
2421 rtlpriv->intf_ops->reset_trx_ring(hw); in rtl8821ae_card_disable()
2423 rtl_write_byte(rtlpriv, REG_APS_FSMCO + 1, 0x0); in rtl8821ae_card_disable()
2426 tmp = rtl_read_byte(rtlpriv, REG_SYS_CLKR); in rtl8821ae_card_disable()
2427 rtl_write_byte(rtlpriv, REG_SYS_CLKR, tmp | BIT(3)); in rtl8821ae_card_disable()
2429 rtl_write_byte(rtlpriv, REG_RSV_CTRL, 0x20); in rtl8821ae_card_disable()
2430 rtl_write_byte(rtlpriv, REG_RSV_CTRL, 0x60); in rtl8821ae_card_disable()
2433 if (rtlpriv->rtlhal.driver_is_goingto_unload || in rtl8821ae_card_disable()
2435 rtlpriv->cfg->ops->led_control(hw, LED_CTL_POWER_OFF); in rtl8821ae_card_disable()
2443 rtl_write_byte(rtlpriv, REG_PCIE_CTRL_REG + 1, 0xff); in rtl8821ae_card_disable()
2444 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, "Stop PCIE Tx DMA.\n"); in rtl8821ae_card_disable()
2449 tmp = rtl_read_byte(rtlpriv, REG_PCIE_CTRL_REG); in rtl8821ae_card_disable()
2453 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in rtl8821ae_card_disable()
2459 tmp = rtl_read_byte(rtlpriv, REG_HSISR + 3); in rtl8821ae_card_disable()
2460 rtl_write_byte(rtlpriv, REG_HSISR + 3, tmp | BIT(1)); in rtl8821ae_card_disable()
2464 rtlpriv->phy.iqk_initialized = false; in rtl8821ae_card_disable()
2470 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_interrupt_recognized() local
2473 intvec->inta = rtl_read_dword(rtlpriv, ISR) & rtlpci->irq_mask[0]; in rtl8821ae_interrupt_recognized()
2474 rtl_write_dword(rtlpriv, ISR, intvec->inta); in rtl8821ae_interrupt_recognized()
2476 intvec->intb = rtl_read_dword(rtlpriv, REG_HISRE) & rtlpci->irq_mask[1]; in rtl8821ae_interrupt_recognized()
2477 rtl_write_dword(rtlpriv, REG_HISRE, intvec->intb); in rtl8821ae_interrupt_recognized()
2482 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_beacon_related_registers() local
2490 rtl_write_word(rtlpriv, REG_ATIMWND, atim_window); in rtl8821ae_set_beacon_related_registers()
2491 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval); in rtl8821ae_set_beacon_related_registers()
2492 rtl_write_word(rtlpriv, REG_BCNTCFG, 0x660f); in rtl8821ae_set_beacon_related_registers()
2493 rtl_write_byte(rtlpriv, REG_RXTSF_OFFSET_CCK, 0x18); in rtl8821ae_set_beacon_related_registers()
2494 rtl_write_byte(rtlpriv, REG_RXTSF_OFFSET_OFDM, 0x18); in rtl8821ae_set_beacon_related_registers()
2495 rtl_write_byte(rtlpriv, 0x606, 0x30); in rtl8821ae_set_beacon_related_registers()
2497 rtl_write_byte(rtlpriv, REG_BCN_CTRL, (u8)rtlpci->reg_bcn_ctrl_val); in rtl8821ae_set_beacon_related_registers()
2503 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_beacon_interval() local
2507 rtl_dbg(rtlpriv, COMP_BEACON, DBG_DMESG, in rtl8821ae_set_beacon_interval()
2510 rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval); in rtl8821ae_set_beacon_interval()
2517 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_update_interrupt_mask() local
2520 rtl_dbg(rtlpriv, COMP_INTR, DBG_LOUD, in rtl8821ae_update_interrupt_mask()
2589 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_power_value_fromprom() local
2592 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_power_value_fromprom()
2599 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_power_value_fromprom()
2756 struct rtl_priv *rtlpriv = rtl_priv(hw);
2826 RTPRINT(rtlpriv, FINIT, INIT_TXPOWER,
2834 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_txpower_info_from_hwpg() local
2903 RTPRINT(rtlpriv, FINIT, INIT_TXPOWER, in _rtl8821ae_read_txpower_info_from_hwpg()
2910 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_read_pa_type() local
2911 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8812ae_read_pa_type()
2950 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_read_amplifier_type() local
2951 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8812ae_read_amplifier_type()
2988 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_pa_type() local
2989 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_read_pa_type()
3020 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_rfe_type() local
3021 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); in _rtl8821ae_read_rfe_type()
3054 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_rfe_type()
3061 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8812ae_read_bt_coexist_info_from_hwpg() local
3067 rtlpriv->btcoexist.btc_info.btcoexist = 1; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3069 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3070 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8812A; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3073 rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1); in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3075 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3076 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8812A; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3077 rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3085 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_bt_coexist_info_from_hwpg() local
3090 tmpu_32 = rtl_read_dword(rtlpriv, REG_MULTI_FUNC_CTRL); in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3092 rtlpriv->btcoexist.btc_info.btcoexist = 1; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3094 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3095 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8821A; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3098 rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1); in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3100 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3101 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8821A; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3102 rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3109 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_read_adapter_info() local
3126 if (rtl_get_hwinfo(hw, rtlpriv, HWSET_MAX_SIZE, hwinfo, params)) in _rtl8821ae_read_adapter_info()
3155 if (rtlpriv->btcoexist.btc_info.btcoexist == 1) in _rtl8821ae_read_adapter_info()
3159 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_adapter_info()
3182 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_adapter_info()
3191 if (rtlpriv->btcoexist.btc_info.btcoexist == 1 && in _rtl8821ae_read_adapter_info()
3192 rtlpriv->btcoexist.btc_info.ant_num == ANT_X1) in _rtl8821ae_read_adapter_info()
3203 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, in _rtl8821ae_read_adapter_info()
3207 rtlpriv->ledctl.led_opendrain = true; in _rtl8821ae_read_adapter_info()
3258 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_read_eeprom_info() local
3260 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_read_eeprom_info()
3266 rtlpriv->dm.rfpath_rxenable[0] = true; in rtl8821ae_read_eeprom_info()
3268 rtlpriv->dm.rfpath_rxenable[0] = in rtl8821ae_read_eeprom_info()
3269 rtlpriv->dm.rfpath_rxenable[1] = true; in rtl8821ae_read_eeprom_info()
3270 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "VersionID = 0x%4x\n", in rtl8821ae_read_eeprom_info()
3273 tmp_u1b = rtl_read_byte(rtlpriv, REG_9346CR); in rtl8821ae_read_eeprom_info()
3275 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EEPROM\n"); in rtl8821ae_read_eeprom_info()
3278 rtl_dbg(rtlpriv, COMP_INIT, DBG_DMESG, "Boot from EFUSE\n"); in rtl8821ae_read_eeprom_info()
3283 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "Autoload OK\n"); in rtl8821ae_read_eeprom_info()
3296 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_update_hal_rate_table() local
3297 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_update_hal_rate_table()
3357 if ((rtlpriv->btcoexist.bt_coexistence) && in rtl8821ae_update_hal_rate_table()
3358 (rtlpriv->btcoexist.bt_coexist_type == BT_CSR_BC4) && in rtl8821ae_update_hal_rate_table()
3359 (rtlpriv->btcoexist.bt_cur_state) && in rtl8821ae_update_hal_rate_table()
3360 (rtlpriv->btcoexist.bt_ant_isolation) && in rtl8821ae_update_hal_rate_table()
3361 ((rtlpriv->btcoexist.bt_service == BT_SCO) || in rtl8821ae_update_hal_rate_table()
3362 (rtlpriv->btcoexist.bt_service == BT_BUSY))) in rtl8821ae_update_hal_rate_table()
3382 rtl_write_dword(rtlpriv, REG_ARFR0 + ratr_index * 4, ratr_value); in rtl8821ae_update_hal_rate_table()
3384 rtl_dbg(rtlpriv, COMP_RATR, DBG_DMESG, in rtl8821ae_update_hal_rate_table()
3385 "%x\n", rtl_read_dword(rtlpriv, REG_ARFR0)); in rtl8821ae_update_hal_rate_table()
3418 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_set_ra_vht_ratr_bitmap() local
3419 struct rtl_phy *rtlphy = &rtlpriv->phy; in _rtl8821ae_set_ra_vht_ratr_bitmap()
3467 struct rtl_priv *rtlpriv = rtl_priv(hw); in _rtl8821ae_get_ra_rftype() local
3468 struct rtl_phy *rtlphy = &rtlpriv->phy; in _rtl8821ae_get_ra_rftype()
3512 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_update_hal_rate_mask() local
3513 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_update_hal_rate_mask()
3530 rtl_dbg(rtlpriv, COMP_RATR, DBG_LOUD, in rtl8821ae_update_hal_rate_mask()
3681 rtl_dbg(rtlpriv, COMP_RATR, DBG_LOUD, in rtl8821ae_update_hal_rate_mask()
3698 rtl_dbg(rtlpriv, COMP_RATR, DBG_DMESG, in rtl8821ae_update_hal_rate_mask()
3712 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_update_hal_rate_tbl() local
3713 if (rtlpriv->dm.useramask) in rtl8821ae_update_hal_rate_tbl()
3723 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_update_channel_access_setting() local
3728 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, in rtl8821ae_update_channel_access_setting()
3734 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SIFS, (u8 *)&sifs_timer); in rtl8821ae_update_channel_access_setting()
3749 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_R2T_SIFS, (u8 *)&r2t_sifs); in rtl8821ae_update_channel_access_setting()
3754 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_gpio_radio_on_off_checking() local
3756 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_gpio_radio_on_off_checking()
3761 if (rtlpriv->rtlhal.being_init_adapter) in rtl8821ae_gpio_radio_on_off_checking()
3767 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3769 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3773 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3776 rtl_write_byte(rtlpriv, REG_GPIO_IO_SEL_2, in rtl8821ae_gpio_radio_on_off_checking()
3777 rtl_read_byte(rtlpriv, in rtl8821ae_gpio_radio_on_off_checking()
3780 u1tmp = rtl_read_byte(rtlpriv, REG_GPIO_PIN_CTRL_2); in rtl8821ae_gpio_radio_on_off_checking()
3788 rtl_dbg(rtlpriv, COMP_RF, DBG_DMESG, in rtl8821ae_gpio_radio_on_off_checking()
3796 rtl_dbg(rtlpriv, COMP_RF, DBG_DMESG, in rtl8821ae_gpio_radio_on_off_checking()
3805 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3807 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3812 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3814 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3825 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_set_key() local
3847 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, "clear_all\n"); in rtl8821ae_set_key()
3854 memset(rtlpriv->sec.key_buf[idx], 0, in rtl8821ae_set_key()
3856 rtlpriv->sec.key_len[idx] = 0; in rtl8821ae_set_key()
3874 rtl_dbg(rtlpriv, COMP_ERR, DBG_LOUD, in rtl8821ae_set_key()
3880 if (is_wepkey || rtlpriv->sec.use_defaultkey) { in rtl8821ae_set_key()
3903 if (rtlpriv->sec.key_len[key_index] == 0) { in rtl8821ae_set_key()
3904 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, in rtl8821ae_set_key()
3911 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, in rtl8821ae_set_key()
3914 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, in rtl8821ae_set_key()
3920 rtlpriv->sec.key_buf[key_index]); in rtl8821ae_set_key()
3922 rtl_dbg(rtlpriv, COMP_SEC, DBG_DMESG, in rtl8821ae_set_key()
3932 rtlpriv->sec.key_buf in rtl8821ae_set_key()
3939 rtlpriv->sec.key_buf[entry_id]); in rtl8821ae_set_key()
3947 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_bt_reg_init() local
3950 rtlpriv->btcoexist.reg_bt_iso = 2; in rtl8821ae_bt_reg_init()
3952 rtlpriv->btcoexist.reg_bt_sco = 3; in rtl8821ae_bt_reg_init()
3954 rtlpriv->btcoexist.reg_bt_sco = 0; in rtl8821ae_bt_reg_init()
3959 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_bt_hw_init() local
3961 if (rtlpriv->cfg->ops->get_btc_status()) in rtl8821ae_bt_hw_init()
3962 rtlpriv->btcoexist.btc_ops->btc_init_hw_config(rtlpriv); in rtl8821ae_bt_hw_init()
3977 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_allow_all_destaddr() local
3986 rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config); in rtl8821ae_allow_all_destaddr()
3988 rtl_dbg(rtlpriv, COMP_TURBO | COMP_INIT, DBG_LOUD, in rtl8821ae_allow_all_destaddr()
3998 struct rtl_priv *rtlpriv = rtl_priv(hw); in rtl8821ae_add_wowlan_pattern() local
4014 rtl_write_byte(rtlpriv, REG_PKT_BUFF_ACCESS_CTRL, RXPKT_BUF_SELECT); in rtl8821ae_add_wowlan_pattern()
4028 rtl_write_word(rtlpriv, REG_PKTBUF_DBG_CTRL, rxbuf_addr); in rtl8821ae_add_wowlan_pattern()
4040 rtl_write_dword(rtlpriv, REG_PKTBUF_DBG_DATA_L, cam); in rtl8821ae_add_wowlan_pattern()
4041 rtl_dbg(rtlpriv, COMP_POWER, DBG_TRACE, in rtl8821ae_add_wowlan_pattern()
4046 rtl_write_word(rtlpriv, REG_RXPKTBUF_CTRL, 0x0f01); in rtl8821ae_add_wowlan_pattern()
4050 rtl_write_dword(rtlpriv, REG_PKTBUF_DBG_DATA_L, cam); in rtl8821ae_add_wowlan_pattern()
4051 rtl_dbg(rtlpriv, COMP_POWER, DBG_TRACE, in rtl8821ae_add_wowlan_pattern()
4055 rtl_write_word(rtlpriv, REG_RXPKTBUF_CTRL, 0x0f01); in rtl8821ae_add_wowlan_pattern()
4059 rtl_write_dword(rtlpriv, REG_PKTBUF_DBG_DATA_H, cam); in rtl8821ae_add_wowlan_pattern()
4060 rtl_dbg(rtlpriv, COMP_POWER, DBG_TRACE, in rtl8821ae_add_wowlan_pattern()
4064 rtl_write_word(rtlpriv, REG_RXPKTBUF_CTRL, 0xf001); in rtl8821ae_add_wowlan_pattern()
4069 tmp = rtl_read_byte(rtlpriv, REG_RXPKTBUF_CTRL); in rtl8821ae_add_wowlan_pattern()
4079 rtl_write_byte(rtlpriv, REG_PKT_BUFF_ACCESS_CTRL, in rtl8821ae_add_wowlan_pattern()