Lines Matching +full:pcie +full:- +full:mac
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009-2010 Realtek Corporation.*/
28 struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[BEACON_QUEUE]; in _rtl8821ae_return_beacon_queue_skb()
33 spin_lock_irqsave(&rtlpriv->locks.irq_th_lock, flags); in _rtl8821ae_return_beacon_queue_skb()
34 while (skb_queue_len(&ring->queue)) { in _rtl8821ae_return_beacon_queue_skb()
35 struct rtl_tx_desc *entry = &ring->desc[ring->idx]; in _rtl8821ae_return_beacon_queue_skb()
36 struct sk_buff *skb = __skb_dequeue(&ring->queue); in _rtl8821ae_return_beacon_queue_skb()
38 dma_unmap_single(&rtlpci->pdev->dev, in _rtl8821ae_return_beacon_queue_skb()
39 rtlpriv->cfg->ops->get_desc(hw, (u8 *)entry, in _rtl8821ae_return_beacon_queue_skb()
41 skb->len, DMA_TO_DEVICE); in _rtl8821ae_return_beacon_queue_skb()
43 ring->idx = (ring->idx + 1) % ring->entries; in _rtl8821ae_return_beacon_queue_skb()
45 spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); in _rtl8821ae_return_beacon_queue_skb()
56 rtlpci->reg_bcn_ctrl_val |= set_bits; in _rtl8821ae_set_bcn_ctrl_reg()
57 rtlpci->reg_bcn_ctrl_val &= ~clear_bits; in _rtl8821ae_set_bcn_ctrl_reg()
59 rtl_write_byte(rtlpriv, REG_BCN_CTRL, (u8)rtlpci->reg_bcn_ctrl_val); in _rtl8821ae_set_bcn_ctrl_reg()
107 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in _rtl8821ae_set_fw_clock_on()
110 if (!rtlhal->fw_ready) 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()
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()
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()
128 rtlhal->fw_clk_change_in_progress = false; in _rtl8821ae_set_fw_clock_on()
129 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
134 if (IS_IN_LOW_POWER_STATE_8821AE(rtlhal->fw_ps_state)) { in _rtl8821ae_set_fw_clock_on()
135 rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_SET_RPWM, in _rtl8821ae_set_fw_clock_on()
148 rtlhal->fw_ps_state = FW_PS_STATE_RF_ON_8821AE; in _rtl8821ae_set_fw_clock_on()
150 "Receive CPWM INT!!! Set rtlhal->FwPSState = %X\n", in _rtl8821ae_set_fw_clock_on()
151 rtlhal->fw_ps_state); in _rtl8821ae_set_fw_clock_on()
155 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
156 rtlhal->fw_clk_change_in_progress = false; 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()
163 rtlhal->fw_clk_change_in_progress = false; in _rtl8821ae_set_fw_clock_on()
164 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_on()
179 if (!rtlhal->fw_ready) in _rtl8821ae_set_fw_clock_off()
181 if (!rtlpriv->psc.fw_current_inpsmode) in _rtl8821ae_set_fw_clock_off()
183 if (!rtlhal->allow_sw_to_change_hwclc) 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()
190 ring = &rtlpci->tx_ring[queue]; in _rtl8821ae_set_fw_clock_off()
191 if (skb_queue_len(&ring->queue)) { in _rtl8821ae_set_fw_clock_off()
198 mod_timer(&rtlpriv->works.fw_clockoff_timer, in _rtl8821ae_set_fw_clock_off()
203 if (FW_PS_STATE(rtlhal->fw_ps_state) != in _rtl8821ae_set_fw_clock_off()
205 spin_lock_bh(&rtlpriv->locks.fw_ps_lock); 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()
208 spin_unlock_bh(&rtlpriv->locks.fw_ps_lock); in _rtl8821ae_set_fw_clock_off()
209 rtlhal->fw_ps_state = FW_PS_STATE(rpwm_val); 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()
214 rtlhal->fw_clk_change_in_progress = false; 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()
240 if (ppsc->low_power_enable) { in _rtl8821ae_fwlps_leave()
243 rtlhal->allow_sw_to_change_hwclc = false; in _rtl8821ae_fwlps_leave()
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()
267 if (ppsc->low_power_enable) { in _rtl8821ae_fwlps_enter()
269 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
272 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
274 (u8 *)(&ppsc->fwctrl_psmode)); in _rtl8821ae_fwlps_enter()
275 rtlhal->allow_sw_to_change_hwclc = true; 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()
284 (u8 *)(&ppsc->fwctrl_psmode)); in _rtl8821ae_fwlps_enter()
285 rtlpriv->cfg->ops->set_hw_reg(hw, in _rtl8821ae_fwlps_enter()
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()
396 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_get_hw_reg() local
411 *((u8 *)(val)) = mac->slot_time; in rtl8821ae_get_hw_reg()
420 *((u32 *)(val)) = rtlpci->receive_config; in rtl8821ae_get_hw_reg()
423 *((enum rf_pwrstate *)(val)) = ppsc->rfpwr_state; in rtl8821ae_get_hw_reg()
429 rtlpriv->cfg->ops->get_hw_reg(hw, in rtl8821ae_get_hw_reg()
444 *((bool *)(val)) = ppsc->fw_current_inpsmode; in rtl8821ae_get_hw_reg()
458 if (ppsc->wo_wlan_mode) in rtl8821ae_get_hw_reg()
474 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_set_hw_reg() local
523 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_set_hw_reg()
553 mac->min_space_cfg = ((mac->min_space_cfg & in rtl8821ae_set_hw_reg()
561 mac->min_space_cfg); in rtl8821ae_set_hw_reg()
564 mac->min_space_cfg); in rtl8821ae_set_hw_reg()
571 mac->min_space_cfg |= (density_to_set << 3); in rtl8821ae_set_hw_reg()
575 mac->min_space_cfg); in rtl8821ae_set_hw_reg()
578 mac->min_space_cfg); in rtl8821ae_set_hw_reg()
584 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in rtl8821ae_set_hw_reg()
587 (0x2000 << (*((u8 *)val))) - 1; in rtl8821ae_set_hw_reg()
590 } else if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in rtl8821ae_set_hw_reg()
593 (0x2000 << (*((u8 *)val))) - 1; in rtl8821ae_set_hw_reg()
606 if (rtlpci->acm_method != EACMWAY2_SW) in rtl8821ae_set_hw_reg()
607 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_set_hw_reg()
614 (union aci_aifsn *)(&mac->ac[0].aifs); in rtl8821ae_set_hw_reg()
615 u8 acm = p_aci_aifsn->f.acm; in rtl8821ae_set_hw_reg()
619 acm_ctrl | ((rtlpci->acm_method == 2) ? 0x0 : 0x1); in rtl8821ae_set_hw_reg()
664 rtlpci->receive_config = ((u32 *)(val))[0]; in rtl8821ae_set_hw_reg()
677 rtlefuse->efuse_usedbytes = *((u16 *)val); in rtl8821ae_set_hw_reg()
680 rtlefuse->efuse_usedpercentage = *((u8 *)val); in rtl8821ae_set_hw_reg()
704 ppsc->fw_current_inpsmode = *((bool *)val); in rtl8821ae_set_hw_reg()
723 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AID, in rtl8821ae_set_hw_reg()
738 mac->assoc_id)); in rtl8821ae_set_hw_reg()
749 (u32)(mac->tsf & 0xffffffff)); in rtl8821ae_set_hw_reg()
751 (u32)((mac->tsf >> 32) & 0xffffffff)); in rtl8821ae_set_hw_reg()
769 HAL_92C_NAV_UPPER_UNIT - 1) / in rtl8821ae_set_hw_reg()
826 rtl_write_word(rtlpriv, REG_TRXFF_BNDY + 2, MAX_RX_DMA_BUFFER_SIZE - 1); in _rtl8821ae_llt_table_init()
836 for (i = 0; i < (txpktbuf_bndy - 1); i++) { in _rtl8821ae_llt_table_init()
842 status = _rtl8821ae_llt_write(hw, (txpktbuf_bndy - 1), 0xFF); in _rtl8821ae_llt_table_init()
867 enum rtl_led_pin pin0 = rtlpriv->ledctl.sw_led0; in _rtl8821ae_gen_refresh_led_state()
870 if (rtlpriv->rtlhal.up_first_time) in _rtl8821ae_gen_refresh_led_state()
873 if (ppsc->rfoff_reason == RF_CHANGE_BY_IPS) in _rtl8821ae_gen_refresh_led_state()
874 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_gen_refresh_led_state()
878 else if (ppsc->rfoff_reason == RF_CHANGE_BY_INIT) 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()
898 bool mac_func_enable = rtlhal->mac_func_enable; in _rtl8821ae_init_mac()
902 /*Auto Power Down to CHIP-off State*/ in _rtl8821ae_init_mac()
906 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_init_mac()
912 "init 8812 MAC Fail as power on failure\n"); in _rtl8821ae_init_mac()
921 "init 8821 MAC Fail as power on failure\n"); in _rtl8821ae_init_mac()
938 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_init_mac()
971 rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config); in _rtl8821ae_init_mac()
975 rtlpci->tx_ring[BEACON_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
977 rtlpci->tx_ring[MGNT_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
979 rtlpci->tx_ring[VO_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
981 rtlpci->tx_ring[VI_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
983 rtlpci->tx_ring[BE_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
985 rtlpci->tx_ring[BK_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
987 rtlpci->tx_ring[HIGH_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
989 rtlpci->rx_ring[RX_MPDU_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_mac()
1035 rtlpci->reg_bcn_ctrl_val = 0x1d; in _rtl8821ae_hw_configure()
1036 rtl_write_byte(rtlpriv, REG_BCN_CTRL, rtlpci->reg_bcn_ctrl_val); in _rtl8821ae_hw_configure()
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()
1164 rtlpriv->sec.pairwise_enc_algorithm, in rtl8821ae_enable_hw_security_config()
1165 rtlpriv->sec.group_enc_algorithm); in rtl8821ae_enable_hw_security_config()
1167 if (rtlpriv->cfg->mod_params->sw_crypto || rtlpriv->sec.use_sw_sec) { in rtl8821ae_enable_hw_security_config()
1175 if (rtlpriv->sec.use_defaultkey) { in rtl8821ae_enable_hw_security_config()
1186 "The SECR-value %x\n", sec_reg_value); in rtl8821ae_enable_hw_security_config()
1188 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_WPA_CONFIG, &sec_reg_value); in rtl8821ae_enable_hw_security_config()
1191 /* Static MacID Mapping (cf. Used in MacIdDoStaticMapping) ---------- */
1196 /* ----------------------------------------------------------- */
1205 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_macid_initialize_mediastatus()
1231 "CheckPcieDMAHang8821AE(): true! Reset PCIE DMA!\n"); in _rtl8821ae_check_pcie_dma_hang()
1254 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_reset_pcie_interface_dma()
1282 /* 4. Reset PCIe DMA. 0x3[0] = 0 */ in _rtl8821ae_reset_pcie_interface_dma()
1287 /* 5. Enable PCIe DMA. 0x3[0] = 1 */ in _rtl8821ae_reset_pcie_interface_dma()
1299 * because MAC function is reset.*/ in _rtl8821ae_reset_pcie_interface_dma()
1302 /* 7. Restore PCIe autoload down bit */ in _rtl8821ae_reset_pcie_interface_dma()
1304 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_reset_pcie_interface_dma()
1311 /* In MAC power on state, BB and RF may be in ON state, in _rtl8821ae_reset_pcie_interface_dma()
1328 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_reset_pcie_interface_dma()
1350 ppsc->wakeup_reason = 0; in _rtl8821ae_get_wakeup_reason()
1352 rtlhal->last_suspend_sec = ktime_get_real_seconds(); in _rtl8821ae_get_wakeup_reason()
1356 ppsc->wakeup_reason = WOL_REASON_PTK_UPDATE; in _rtl8821ae_get_wakeup_reason()
1361 ppsc->wakeup_reason = WOL_REASON_GTK_UPDATE; in _rtl8821ae_get_wakeup_reason()
1366 ppsc->wakeup_reason = WOL_REASON_DISASSOC; in _rtl8821ae_get_wakeup_reason()
1371 ppsc->wakeup_reason = WOL_REASON_DEAUTH; in _rtl8821ae_get_wakeup_reason()
1376 ppsc->wakeup_reason = WOL_REASON_AP_LOST; in _rtl8821ae_get_wakeup_reason()
1381 ppsc->wakeup_reason = WOL_REASON_MAGIC_PKT; in _rtl8821ae_get_wakeup_reason()
1386 ppsc->wakeup_reason = WOL_REASON_UNICAST_PKT; in _rtl8821ae_get_wakeup_reason()
1391 ppsc->wakeup_reason = WOL_REASON_PATTERN_PKT; in _rtl8821ae_get_wakeup_reason()
1396 ppsc->wakeup_reason = WOL_REASON_RTD3_SSID_MATCH; in _rtl8821ae_get_wakeup_reason()
1401 ppsc->wakeup_reason = WOL_REASON_REALWOW_V2_WAKEUPPKT; in _rtl8821ae_get_wakeup_reason()
1406 ppsc->wakeup_reason = WOL_REASON_REALWOW_V2_ACKLOST; in _rtl8821ae_get_wakeup_reason()
1425 rtlpci->tx_ring[BEACON_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1427 rtlpci->tx_ring[MGNT_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1429 rtlpci->tx_ring[VO_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1431 rtlpci->tx_ring[VI_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1433 rtlpci->tx_ring[BE_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1435 rtlpci->tx_ring[BK_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1437 rtlpci->tx_ring[HIGH_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1439 rtlpci->rx_ring[RX_MPDU_QUEUE].dma & DMA_BIT_MASK(32)); in _rtl8821ae_init_trx_desc_hw_address()
1449 for (i = 0 ; i < (txpktbuf_bndy - 1) ; i++) { in _rtl8821ae_init_llt_table()
1455 status = _rtl8821ae_llt_write(hw, (txpktbuf_bndy - 1), 0xFF); in _rtl8821ae_init_llt_table()
1482 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in _rtl8821ae_dynamic_rqpn()
1489 /* stop PCIe DMA in _rtl8821ae_dynamic_rqpn()
1551 /* Reset TRX MAC in _rtl8821ae_dynamic_rqpn()
1557 /* Disable MAC Security Engine in _rtl8821ae_dynamic_rqpn()
1563 /* To avoid DD-Tim Circuit hang in _rtl8821ae_dynamic_rqpn()
1568 /* Enable MAC Security Engine in _rtl8821ae_dynamic_rqpn()
1573 /* Enable TRX MAC in _rtl8821ae_dynamic_rqpn()
1614 /* enable PCIE DMA in _rtl8821ae_dynamic_rqpn()
1632 /* Re-download normal Fw. */ in _rtl8821ae_simple_initialize_adapter()
1636 /* Re-Initialize LLT table. */ in _rtl8821ae_simple_initialize_adapter()
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()
1648 ppsc->rfpwr_state = ERFON; in _rtl8821ae_simple_initialize_adapter()
1656 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "--->\n"); in _rtl8821ae_enable_l1off()
1671 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "<---\n"); in _rtl8821ae_enable_l1off()
1679 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "--->\n"); in _rtl8821ae_enable_ltr()
1685 "<---0x99(%#x) return!!\n", tmp); in _rtl8821ae_enable_ltr()
1702 rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD, "<---\n"); in _rtl8821ae_enable_ltr()
1715 /* Patch Pcie Rx DMA hang after S3/S4 several times. in _rtl8821ae_wowlan_initialize_adapter()
1723 /* Release Pcie Interface Rx DMA to allow wake packet DMA. */ in _rtl8821ae_wowlan_initialize_adapter()
1725 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, "Enable PCIE Rx DMA.\n"); in _rtl8821ae_wowlan_initialize_adapter()
1738 if (rtlhal->hw_rof_enable) { in _rtl8821ae_wowlan_initialize_adapter()
1752 /* Release Pcie Interface Tx DMA. */ in _rtl8821ae_wowlan_initialize_adapter()
1754 /* Release Pcie RX DMA */ in _rtl8821ae_wowlan_initialize_adapter()
1792 rtlhal->mac_func_enable = false; in _rtl8821ae_poweroff_adapter()
1794 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_poweroff_adapter()
1795 /* Combo (PCIe + USB) Card and PCIe-MF Card */ in _rtl8821ae_poweroff_adapter()
1808 rtlhal->fw_ready) { in _rtl8821ae_poweroff_adapter()
1820 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) { in _rtl8821ae_poweroff_adapter()
1845 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_hw_init() local
1853 rtlhal->being_init_adapter = true; in rtl8821ae_hw_init()
1854 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in rtl8821ae_hw_init()
1856 rtlpriv->intf_ops->disable_aspm(hw); in rtl8821ae_hw_init()
1862 rtlhal->mac_func_enable = true; in rtl8821ae_hw_init()
1864 "MAC has already power on.\n"); 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()
1886 /* Reset MAC/BB/RF status if it is not powered off in rtl8821ae_hw_init()
1888 * from interface and MAC status mismatch. in rtl8821ae_hw_init()
1890 if (rtlhal->mac_func_enable) { in rtl8821ae_hw_init()
1892 rtlhal->mac_func_enable = false; in rtl8821ae_hw_init()
1897 pr_err("Init MAC failed\n"); in rtl8821ae_hw_init()
1911 rtlhal->fw_ready = false; in rtl8821ae_hw_init()
1914 rtlhal->fw_ready = true; in rtl8821ae_hw_init()
1916 ppsc->fw_current_inpsmode = false; 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()
1923 if(rtlhal->AMPDUBurstMode) in rtl8821ae_hw_init()
1931 rtlpci->receive_config = rtl_read_dword(rtlpriv, REG_RCR); in rtl8821ae_hw_init()
1932 rtlpci->receive_config &= ~(RCR_ACRC32 | RCR_AICV); in rtl8821ae_hw_init()
1933 rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config);*/ in rtl8821ae_hw_init()
1938 if (rtlpriv->phy.rf_type == RF_1T1R && 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()
1954 ppsc->rfpwr_state = ERFON; in rtl8821ae_hw_init()
1956 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr); in rtl8821ae_hw_init()
1958 rtlpriv->intf_ops->enable_aspm(hw); 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()
1967 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_NAV_UPPER, (u8 *)&nav_upper); in rtl8821ae_hw_init()
1982 /* Release Tx/Rx PCIE DMA if*/ in rtl8821ae_hw_init()
1995 struct rtl_phy *rtlphy = &rtlpriv->phy; in _rtl8821ae_read_chip_version()
2004 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) in _rtl8821ae_read_chip_version()
2005 rtlphy->rf_type = RF_2T2R; in _rtl8821ae_read_chip_version()
2006 else if (rtlhal->hw_type == HARDWARE_TYPE_RTL8821AE) in _rtl8821ae_read_chip_version()
2007 rtlphy->rf_type = RF_1T1R; in _rtl8821ae_read_chip_version()
2010 "RF_Type is %x!!\n", rtlphy->rf_type); in _rtl8821ae_read_chip_version()
2013 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_read_chip_version()
2014 if (rtlphy->rf_type == RF_2T2R) in _rtl8821ae_read_chip_version()
2021 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_read_chip_version()
2024 if (rtlphy->rf_type == RF_2T2R) 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()
2149 rtlpriv->cfg->ops->led_control(hw, ledaction); in _rtl8821ae_set_media_status()
2162 u32 reg_rcr = rtlpci->receive_config; in rtl8821ae_set_check_bssid()
2164 if (rtlpriv->psc.rfpwr_state != ERFON) in rtl8821ae_set_check_bssid()
2169 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_RCR, in rtl8821ae_set_check_bssid()
2175 rtlpriv->cfg->ops->set_hw_reg(hw, in rtl8821ae_set_check_bssid()
2187 return -EOPNOTSUPP; in rtl8821ae_set_network_type()
2189 if (rtlpriv->mac80211.link_state == MAC80211_LINKED) { in rtl8821ae_set_network_type()
2242 if (rtlpci->int_clear) in rtl8821ae_enable_interrupt()
2245 rtl_write_dword(rtlpriv, REG_HIMR, rtlpci->irq_mask[0] & 0xFFFFFFFF); in rtl8821ae_enable_interrupt()
2246 rtl_write_dword(rtlpriv, REG_HIMRE, rtlpci->irq_mask[1] & 0xFFFFFFFF); in rtl8821ae_enable_interrupt()
2247 rtlpci->irq_enabled = true; in rtl8821ae_enable_interrupt()
2255 rtl_write_dword(rtlpriv, REG_HSIMR, rtlpci->sys_irq_mask & 0xFFFFFFFF); in rtl8821ae_enable_interrupt()
2265 rtlpci->irq_enabled = false; in rtl8821ae_disable_interrupt()
2266 /*synchronize_irq(rtlpci->pdev->irq);*/ in rtl8821ae_disable_interrupt()
2273 struct pci_dev *pdev = rtlpci->pdev; in _rtl8821ae_clear_pci_pme_status()
2302 struct rtl_mac *mac = rtl_mac(rtlpriv); in rtl8821ae_card_disable() local
2308 rtlpriv->cfg->ops->get_hw_reg(hw, HAL_DEF_WOWLAN, in rtl8821ae_card_disable()
2313 if (!(support_remote_wakeup && mac->opmode == NL80211_IFTYPE_STATION) in rtl8821ae_card_disable()
2314 || !rtlhal->enter_pnp_sleep) { in rtl8821ae_card_disable()
2316 mac->link_state = MAC80211_NOLINK; in rtl8821ae_card_disable()
2333 rtlhal->re_init_llt_table = true; in rtl8821ae_card_disable()
2343 printk("mac->link_state = %d\n", mac->link_state); in rtl8821ae_card_disable()
2344 if (mac->link_state >= MAC80211_LINKED && in rtl8821ae_card_disable()
2345 mac->opmode == NL80211_IFTYPE_STATION) { in rtl8821ae_card_disable()
2346 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_AID, NULL); in rtl8821ae_card_disable()
2376 rtlpriv->intf_ops->reset_trx_ring(hw); in rtl8821ae_card_disable()
2388 if (rtlpriv->rtlhal.driver_is_goingto_unload || in rtl8821ae_card_disable()
2389 ppsc->rfoff_reason > RF_CHANGE_BY_PS) in rtl8821ae_card_disable()
2390 rtlpriv->cfg->ops->led_control(hw, LED_CTL_POWER_OFF); in rtl8821ae_card_disable()
2392 if (support_remote_wakeup && rtlhal->enter_pnp_sleep) { in rtl8821ae_card_disable()
2397 /* Stop Pcie Interface Tx DMA. */ in rtl8821ae_card_disable()
2399 rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD, "Stop PCIE Tx DMA.\n"); in rtl8821ae_card_disable()
2412 if (rtlhal->hw_rof_enable) { in rtl8821ae_card_disable()
2419 rtlpriv->phy.iqk_initialized = false; in rtl8821ae_card_disable()
2428 intvec->inta = rtl_read_dword(rtlpriv, ISR) & rtlpci->irq_mask[0]; in rtl8821ae_interrupt_recognized()
2429 rtl_write_dword(rtlpriv, ISR, intvec->inta); in rtl8821ae_interrupt_recognized()
2431 intvec->intb = rtl_read_dword(rtlpriv, REG_HISRE) & rtlpci->irq_mask[1]; in rtl8821ae_interrupt_recognized()
2432 rtl_write_dword(rtlpriv, REG_HISRE, intvec->intb); in rtl8821ae_interrupt_recognized()
2438 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_set_beacon_related_registers() local
2442 bcn_interval = mac->beacon_interval; in rtl8821ae_set_beacon_related_registers()
2451 rtlpci->reg_bcn_ctrl_val |= BIT(3); in rtl8821ae_set_beacon_related_registers()
2452 rtl_write_byte(rtlpriv, REG_BCN_CTRL, (u8)rtlpci->reg_bcn_ctrl_val); in rtl8821ae_set_beacon_related_registers()
2459 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_set_beacon_interval() local
2460 u16 bcn_interval = mac->beacon_interval; in rtl8821ae_set_beacon_interval()
2479 rtlpci->irq_mask[0] |= add_msr; in rtl8821ae_update_interrupt_mask()
2481 rtlpci->irq_mask[0] &= (~rm_msr); in rtl8821ae_update_interrupt_mask()
2559 pwrinfo24g->index_cck_base[rfpath][group] = 0x2D; in _rtl8821ae_read_power_value_fromprom()
2560 pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D; in _rtl8821ae_read_power_value_fromprom()
2564 pwrinfo24g->bw20_diff[rfpath][0] = 0x02; in _rtl8821ae_read_power_value_fromprom()
2565 pwrinfo24g->ofdm_diff[rfpath][0] = 0x04; in _rtl8821ae_read_power_value_fromprom()
2567 pwrinfo24g->bw20_diff[rfpath][txcount] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2568 pwrinfo24g->bw40_diff[rfpath][txcount] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2569 pwrinfo24g->cck_diff[rfpath][txcount] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2570 pwrinfo24g->ofdm_diff[rfpath][txcount] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2575 pwrinfo5g->index_bw40_base[rfpath][group] = 0x2A; in _rtl8821ae_read_power_value_fromprom()
2579 pwrinfo5g->ofdm_diff[rfpath][0] = 0x04; in _rtl8821ae_read_power_value_fromprom()
2580 pwrinfo5g->bw20_diff[rfpath][0] = 0x00; in _rtl8821ae_read_power_value_fromprom()
2581 pwrinfo5g->bw80_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2582 pwrinfo5g->bw160_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2584 pwrinfo5g->ofdm_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2585 pwrinfo5g->bw20_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2586 pwrinfo5g->bw40_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2587 pwrinfo5g->bw80_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2588 pwrinfo5g->bw160_diff[rfpath][0] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2595 rtl_priv(hw)->efuse.txpwr_fromeprom = true; in _rtl8821ae_read_power_value_fromprom()
2600 pwrinfo24g->index_cck_base[rfpath][group] = hwinfo[eeaddr++]; in _rtl8821ae_read_power_value_fromprom()
2601 if (pwrinfo24g->index_cck_base[rfpath][group] == 0xFF) in _rtl8821ae_read_power_value_fromprom()
2602 pwrinfo24g->index_cck_base[rfpath][group] = 0x2D; in _rtl8821ae_read_power_value_fromprom()
2604 for (group = 0 ; group < MAX_CHNL_GROUP_24G - 1; group++) { in _rtl8821ae_read_power_value_fromprom()
2605 pwrinfo24g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++]; in _rtl8821ae_read_power_value_fromprom()
2606 if (pwrinfo24g->index_bw40_base[rfpath][group] == 0xFF) in _rtl8821ae_read_power_value_fromprom()
2607 pwrinfo24g->index_bw40_base[rfpath][group] = 0x2D; in _rtl8821ae_read_power_value_fromprom()
2611 pwrinfo24g->bw40_diff[rfpath][txcount] = 0; in _rtl8821ae_read_power_value_fromprom()
2613 pwrinfo24g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2614 if (pwrinfo24g->bw20_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2615 pwrinfo24g->bw20_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2617 pwrinfo24g->ofdm_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2618 if (pwrinfo24g->ofdm_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2619 pwrinfo24g->ofdm_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2621 pwrinfo24g->cck_diff[rfpath][txcount] = 0; in _rtl8821ae_read_power_value_fromprom()
2624 pwrinfo24g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2625 if (pwrinfo24g->bw40_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2626 pwrinfo24g->bw40_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2628 pwrinfo24g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2629 if (pwrinfo24g->bw20_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2630 pwrinfo24g->bw20_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2634 pwrinfo24g->ofdm_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2635 if (pwrinfo24g->ofdm_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2636 pwrinfo24g->ofdm_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2638 pwrinfo24g->cck_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2639 if (pwrinfo24g->cck_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2640 pwrinfo24g->cck_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2648 pwrinfo5g->index_bw40_base[rfpath][group] = hwinfo[eeaddr++]; in _rtl8821ae_read_power_value_fromprom()
2649 if (pwrinfo5g->index_bw40_base[rfpath][group] == 0xFF) in _rtl8821ae_read_power_value_fromprom()
2650 pwrinfo5g->index_bw40_base[rfpath][group] = 0xFE; in _rtl8821ae_read_power_value_fromprom()
2655 pwrinfo5g->bw40_diff[rfpath][txcount] = 0; in _rtl8821ae_read_power_value_fromprom()
2657 pwrinfo5g->bw20_diff[rfpath][0] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2658 if (pwrinfo5g->bw20_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2659 pwrinfo5g->bw20_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2661 pwrinfo5g->ofdm_diff[rfpath][0] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2662 if (pwrinfo5g->ofdm_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2663 pwrinfo5g->ofdm_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2667 pwrinfo5g->bw40_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2668 if (pwrinfo5g->bw40_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2669 pwrinfo5g->bw40_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2671 pwrinfo5g->bw20_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2672 if (pwrinfo5g->bw20_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2673 pwrinfo5g->bw20_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2679 pwrinfo5g->ofdm_diff[rfpath][1] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2680 pwrinfo5g->ofdm_diff[rfpath][2] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2684 pwrinfo5g->ofdm_diff[rfpath][3] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2689 if (pwrinfo5g->ofdm_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2690 pwrinfo5g->ofdm_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2693 pwrinfo5g->bw80_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0xf0) >> 4; in _rtl8821ae_read_power_value_fromprom()
2695 if (pwrinfo5g->bw80_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2696 pwrinfo5g->bw80_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2698 pwrinfo5g->bw160_diff[rfpath][txcount] = (hwinfo[eeaddr] & 0x0f); in _rtl8821ae_read_power_value_fromprom()
2699 if (pwrinfo5g->bw160_diff[rfpath][txcount] & BIT(3)) in _rtl8821ae_read_power_value_fromprom()
2700 pwrinfo5g->bw160_diff[rfpath][txcount] |= 0xF0; in _rtl8821ae_read_power_value_fromprom()
2725 if (i == CHANNEL_MAX_NUMBER_2G - 1) {
2726 rtlefuse->txpwrlevel_cck[rf_path][i] =
2728 rtlefuse->txpwrlevel_ht40_1s[rf_path][i] =
2731 rtlefuse->txpwrlevel_cck[rf_path][i] =
2733 rtlefuse->txpwrlevel_ht40_1s[rf_path][i] =
2740 rtlefuse->txpwr_5g_bw40base[rf_path][i] =
2749 rtlefuse->txpwr_5g_bw80base[rf_path][i] = (upper + lower) / 2;
2752 rtlefuse->txpwr_cckdiff[rf_path][i] =
2754 rtlefuse->txpwr_legacyhtdiff[rf_path][i] =
2756 rtlefuse->txpwr_ht20diff[rf_path][i] =
2758 rtlefuse->txpwr_ht40diff[rf_path][i] =
2761 rtlefuse->txpwr_5g_ofdmdiff[rf_path][i] =
2763 rtlefuse->txpwr_5g_bw20diff[rf_path][i] =
2765 rtlefuse->txpwr_5g_bw40diff[rf_path][i] =
2767 rtlefuse->txpwr_5g_bw80diff[rf_path][i] =
2773 rtlefuse->eeprom_regulatory =
2776 rtlefuse->eeprom_regulatory = 0;
2778 rtlefuse->eeprom_regulatory = 0;
2782 "eeprom_regulatory = 0x%x\n", rtlefuse->eeprom_regulatory);
2803 if (i == CHANNEL_MAX_NUMBER_2G - 1) { in _rtl8821ae_read_txpower_info_from_hwpg()
2804 rtlefuse->txpwrlevel_cck[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2806 rtlefuse->txpwrlevel_ht40_1s[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2809 rtlefuse->txpwrlevel_cck[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2811 rtlefuse->txpwrlevel_ht40_1s[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2818 rtlefuse->txpwr_5g_bw40base[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2827 rtlefuse->txpwr_5g_bw80base[rf_path][i] = (upper + lower) / 2; in _rtl8821ae_read_txpower_info_from_hwpg()
2830 rtlefuse->txpwr_cckdiff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2832 rtlefuse->txpwr_legacyhtdiff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2834 rtlefuse->txpwr_ht20diff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2836 rtlefuse->txpwr_ht40diff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2839 rtlefuse->txpwr_5g_ofdmdiff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2841 rtlefuse->txpwr_5g_bw20diff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2843 rtlefuse->txpwr_5g_bw40diff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2845 rtlefuse->txpwr_5g_bw80diff[rf_path][i] = in _rtl8821ae_read_txpower_info_from_hwpg()
2851 rtlefuse->eeprom_regulatory = hwinfo[EEPROM_RF_BOARD_OPTION] & 0x07; in _rtl8821ae_read_txpower_info_from_hwpg()
2853 rtlefuse->eeprom_regulatory = 0; in _rtl8821ae_read_txpower_info_from_hwpg()
2855 rtlefuse->eeprom_regulatory = 0; in _rtl8821ae_read_txpower_info_from_hwpg()
2859 "eeprom_regulatory = 0x%x\n", rtlefuse->eeprom_regulatory); in _rtl8821ae_read_txpower_info_from_hwpg()
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()
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()
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()
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()
3022 rtlpriv->btcoexist.btc_info.btcoexist = 1; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3024 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3025 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8812A; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3028 rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1); in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3030 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3031 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8812A; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3032 rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; in _rtl8812ae_read_bt_coexist_info_from_hwpg()
3047 rtlpriv->btcoexist.btc_info.btcoexist = 1; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3049 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3050 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8821A; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3053 rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1); in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3055 rtlpriv->btcoexist.btc_info.btcoexist = 0; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3056 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8821A; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3057 rtlpriv->btcoexist.btc_info.ant_num = ANT_X2; in _rtl8821ae_read_bt_coexist_info_from_hwpg()
3086 _rtl8821ae_read_txpower_info_from_hwpg(hw, rtlefuse->autoload_failflag, in _rtl8821ae_read_adapter_info()
3089 if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) { in _rtl8821ae_read_adapter_info()
3091 rtlefuse->autoload_failflag); in _rtl8821ae_read_adapter_info()
3093 rtlefuse->autoload_failflag, hwinfo); in _rtl8821ae_read_adapter_info()
3095 _rtl8821ae_read_pa_type(hw, hwinfo, rtlefuse->autoload_failflag); in _rtl8821ae_read_adapter_info()
3097 rtlefuse->autoload_failflag, hwinfo); in _rtl8821ae_read_adapter_info()
3100 _rtl8821ae_read_rfe_type(hw, hwinfo, rtlefuse->autoload_failflag); in _rtl8821ae_read_adapter_info()
3102 rtlefuse->board_type = ODM_BOARD_DEFAULT; in _rtl8821ae_read_adapter_info()
3103 if (rtlhal->external_lna_2g != 0) in _rtl8821ae_read_adapter_info()
3104 rtlefuse->board_type |= ODM_BOARD_EXT_LNA; in _rtl8821ae_read_adapter_info()
3105 if (rtlhal->external_lna_5g != 0) in _rtl8821ae_read_adapter_info()
3106 rtlefuse->board_type |= ODM_BOARD_EXT_LNA_5G; in _rtl8821ae_read_adapter_info()
3107 if (rtlhal->external_pa_2g != 0) in _rtl8821ae_read_adapter_info()
3108 rtlefuse->board_type |= ODM_BOARD_EXT_PA; in _rtl8821ae_read_adapter_info()
3109 if (rtlhal->external_pa_5g != 0) in _rtl8821ae_read_adapter_info()
3110 rtlefuse->board_type |= ODM_BOARD_EXT_PA_5G; in _rtl8821ae_read_adapter_info()
3112 if (rtlpriv->btcoexist.btc_info.btcoexist == 1) in _rtl8821ae_read_adapter_info()
3113 rtlefuse->board_type |= ODM_BOARD_BT; in _rtl8821ae_read_adapter_info()
3115 rtlhal->board_type = rtlefuse->board_type; in _rtl8821ae_read_adapter_info()
3117 "board_type = 0x%x\n", rtlefuse->board_type); in _rtl8821ae_read_adapter_info()
3119 rtlefuse->eeprom_channelplan = *(u8 *)&hwinfo[EEPROM_CHANNELPLAN]; in _rtl8821ae_read_adapter_info()
3120 if (rtlefuse->eeprom_channelplan == 0xff) in _rtl8821ae_read_adapter_info()
3121 rtlefuse->eeprom_channelplan = 0x7F; in _rtl8821ae_read_adapter_info()
3124 rtlefuse->channel_plan = rtlefuse->eeprom_channelplan; in _rtl8821ae_read_adapter_info()
3127 rtlefuse->crystalcap = hwinfo[EEPROM_XTAL_8821AE]; in _rtl8821ae_read_adapter_info()
3128 if (rtlefuse->crystalcap == 0xFF) in _rtl8821ae_read_adapter_info()
3129 rtlefuse->crystalcap = 0x20; in _rtl8821ae_read_adapter_info()
3131 rtlefuse->eeprom_thermalmeter = *(u8 *)&hwinfo[EEPROM_THERMAL_METER]; in _rtl8821ae_read_adapter_info()
3132 if ((rtlefuse->eeprom_thermalmeter == 0xff) || in _rtl8821ae_read_adapter_info()
3133 rtlefuse->autoload_failflag) { in _rtl8821ae_read_adapter_info()
3134 rtlefuse->apk_thermalmeterignore = true; in _rtl8821ae_read_adapter_info()
3135 rtlefuse->eeprom_thermalmeter = 0xff; in _rtl8821ae_read_adapter_info()
3138 rtlefuse->thermalmeter[0] = rtlefuse->eeprom_thermalmeter; in _rtl8821ae_read_adapter_info()
3140 "thermalmeter = 0x%x\n", rtlefuse->eeprom_thermalmeter); in _rtl8821ae_read_adapter_info()
3142 if (!rtlefuse->autoload_failflag) { in _rtl8821ae_read_adapter_info()
3143 rtlefuse->antenna_div_cfg = in _rtl8821ae_read_adapter_info()
3146 rtlefuse->antenna_div_cfg = 0; in _rtl8821ae_read_adapter_info()
3148 if (rtlpriv->btcoexist.btc_info.btcoexist == 1 && in _rtl8821ae_read_adapter_info()
3149 rtlpriv->btcoexist.btc_info.ant_num == ANT_X1) in _rtl8821ae_read_adapter_info()
3150 rtlefuse->antenna_div_cfg = 0; in _rtl8821ae_read_adapter_info()
3152 rtlefuse->antenna_div_type = hwinfo[EEPROM_RF_ANTENNA_OPT_88E]; in _rtl8821ae_read_adapter_info()
3153 if (rtlefuse->antenna_div_type == 0xff) in _rtl8821ae_read_adapter_info()
3154 rtlefuse->antenna_div_type = FIXED_HW_ANTDIV; in _rtl8821ae_read_adapter_info()
3156 rtlefuse->antenna_div_cfg = 0; in _rtl8821ae_read_adapter_info()
3157 rtlefuse->antenna_div_type = 0; in _rtl8821ae_read_adapter_info()
3162 rtlefuse->antenna_div_cfg, rtlefuse->antenna_div_type); in _rtl8821ae_read_adapter_info()
3164 rtlpriv->ledctl.led_opendrain = true; in _rtl8821ae_read_adapter_info()
3166 if (rtlhal->oem_id == RT_CID_DEFAULT) { in _rtl8821ae_read_adapter_info()
3167 switch (rtlefuse->eeprom_oemid) { in _rtl8821ae_read_adapter_info()
3171 rtlhal->oem_id = RT_CID_TOSHIBA; in _rtl8821ae_read_adapter_info()
3174 rtlhal->oem_id = RT_CID_CCX; in _rtl8821ae_read_adapter_info()
3177 rtlhal->oem_id = RT_CID_819X_QMI; in _rtl8821ae_read_adapter_info()
3195 rtlpriv->ledctl.led_opendrain = true;
3196 switch (rtlhal->oem_id) {
3198 rtlpriv->ledctl.led_opendrain = true;
3210 "RT Customized ID: 0x%02X\n", rtlhal->oem_id);
3217 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_read_eeprom_info()
3221 rtlhal->version = _rtl8821ae_read_chip_version(hw); in rtl8821ae_read_eeprom_info()
3223 rtlpriv->dm.rfpath_rxenable[0] = true; in rtl8821ae_read_eeprom_info()
3225 rtlpriv->dm.rfpath_rxenable[0] = in rtl8821ae_read_eeprom_info()
3226 rtlpriv->dm.rfpath_rxenable[1] = true; in rtl8821ae_read_eeprom_info()
3228 rtlhal->version); in rtl8821ae_read_eeprom_info()
3233 rtlefuse->epromtype = EEPROM_93C46; in rtl8821ae_read_eeprom_info()
3236 rtlefuse->epromtype = EEPROM_BOOT_EFUSE; in rtl8821ae_read_eeprom_info()
3241 rtlefuse->autoload_failflag = false; in rtl8821ae_read_eeprom_info()
3254 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_update_hal_rate_table()
3255 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_update_hal_rate_table() local
3259 u8 b_nmode = mac->ht_enable; in rtl8821ae_update_hal_rate_table()
3263 u8 curtxbw_40mhz = mac->bw_40; in rtl8821ae_update_hal_rate_table()
3264 u8 b_curshortgi_40mhz = (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? in rtl8821ae_update_hal_rate_table()
3266 u8 b_curshortgi_20mhz = (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? in rtl8821ae_update_hal_rate_table()
3268 enum wireless_mode wirelessmode = mac->mode; in rtl8821ae_update_hal_rate_table()
3270 if (rtlhal->current_bandtype == BAND_ON_5G) in rtl8821ae_update_hal_rate_table()
3271 ratr_value = sta->deflink.supp_rates[1] << 4; in rtl8821ae_update_hal_rate_table()
3273 ratr_value = sta->deflink.supp_rates[0]; in rtl8821ae_update_hal_rate_table()
3274 if (mac->opmode == NL80211_IFTYPE_ADHOC) in rtl8821ae_update_hal_rate_table()
3276 ratr_value |= (sta->deflink.ht_cap.mcs.rx_mask[1] << 20 | in rtl8821ae_update_hal_rate_table()
3277 sta->deflink.ht_cap.mcs.rx_mask[0] << 12); in rtl8821ae_update_hal_rate_table()
3306 if (rtlphy->rf_type == RF_1T2R) in rtl8821ae_update_hal_rate_table()
3314 if ((rtlpriv->btcoexist.bt_coexistence) && in rtl8821ae_update_hal_rate_table()
3315 (rtlpriv->btcoexist.bt_coexist_type == BT_CSR_BC4) && in rtl8821ae_update_hal_rate_table()
3316 (rtlpriv->btcoexist.bt_cur_state) && in rtl8821ae_update_hal_rate_table()
3317 (rtlpriv->btcoexist.bt_ant_isolation) && in rtl8821ae_update_hal_rate_table()
3318 ((rtlpriv->btcoexist.bt_service == BT_SCO) || in rtl8821ae_update_hal_rate_table()
3319 (rtlpriv->btcoexist.bt_service == BT_BUSY))) in rtl8821ae_update_hal_rate_table()
3330 for (shortgi_rate = 15; shortgi_rate > 0; shortgi_rate--) { in rtl8821ae_update_hal_rate_table()
3376 struct rtl_phy *rtlphy = &rtlpriv->phy; in _rtl8821ae_set_ra_vht_ratr_bitmap()
3379 if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40 in _rtl8821ae_set_ra_vht_ratr_bitmap()
3380 || rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_80) in _rtl8821ae_set_ra_vht_ratr_bitmap()
3384 if (rtlphy->rf_type == RF_1T1R) in _rtl8821ae_set_ra_vht_ratr_bitmap()
3425 struct rtl_phy *rtlphy = &rtlpriv->phy; in _rtl8821ae_get_ra_rftype()
3428 if (rtlphy->rf_type == RF_1T1R) in _rtl8821ae_get_ra_rftype()
3448 u8 b_curshortgi_40mhz = (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40) ? in _rtl8821ae_get_ra_shortgi()
3450 u8 b_curshortgi_20mhz = (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20) ? in _rtl8821ae_get_ra_shortgi()
3453 b_curshortgi_80mhz = (sta->deflink.vht_cap.cap & in _rtl8821ae_get_ra_shortgi()
3470 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_update_hal_rate_mask()
3471 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_update_hal_rate_mask() local
3476 u8 curtxbw_40mhz = (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) in rtl8821ae_update_hal_rate_mask()
3484 sta_entry = (struct rtl_sta_info *)sta->drv_priv; in rtl8821ae_update_hal_rate_mask()
3485 wirelessmode = sta_entry->wireless_mode; in rtl8821ae_update_hal_rate_mask()
3489 if (mac->opmode == NL80211_IFTYPE_STATION || in rtl8821ae_update_hal_rate_mask()
3490 mac->opmode == NL80211_IFTYPE_MESH_POINT) { in rtl8821ae_update_hal_rate_mask()
3491 curtxbw_40mhz = mac->bw_40; in rtl8821ae_update_hal_rate_mask()
3492 } else if (mac->opmode == NL80211_IFTYPE_AP || in rtl8821ae_update_hal_rate_mask()
3493 mac->opmode == NL80211_IFTYPE_ADHOC) in rtl8821ae_update_hal_rate_mask()
3494 macid = sta->aid + 1; in rtl8821ae_update_hal_rate_mask()
3498 ratr_bitmap = sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 4; in rtl8821ae_update_hal_rate_mask()
3500 ratr_bitmap = sta->deflink.supp_rates[NL80211_BAND_2GHZ]; in rtl8821ae_update_hal_rate_mask()
3502 if (mac->opmode == NL80211_IFTYPE_ADHOC) in rtl8821ae_update_hal_rate_mask()
3507 ratr_bitmap |= (sta->deflink.ht_cap.mcs.rx_mask[1] << 20 | in rtl8821ae_update_hal_rate_mask()
3508 sta->deflink.ht_cap.mcs.rx_mask[0] << 12); in rtl8821ae_update_hal_rate_mask()
3513 sta->deflink.vht_cap.vht_mcs.rx_mcs_map) << 12; in rtl8821ae_update_hal_rate_mask()
3518 /*mac id owner*/ in rtl8821ae_update_hal_rate_mask()
3607 if (rssi_level == 1) /*add by Gary for ac-series*/ in rtl8821ae_update_hal_rate_mask()
3634 sta_entry->ratr_index = ratr_index; in rtl8821ae_update_hal_rate_mask()
3646 rate_mask[2] = rtlphy->current_chan_bw | ((!update_bw) << 3) in rtl8821ae_update_hal_rate_mask()
3670 if (rtlpriv->dm.useramask) in rtl8821ae_update_hal_rate_tbl()
3681 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_update_channel_access_setting() local
3682 u16 wireless_mode = mac->mode; in rtl8821ae_update_channel_access_setting()
3685 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SLOT_TIME, in rtl8821ae_update_channel_access_setting()
3686 (u8 *)&mac->slot_time); in rtl8821ae_update_channel_access_setting()
3691 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_SIFS, (u8 *)&sifs_timer); in rtl8821ae_update_channel_access_setting()
3696 (mac->vht_ldpc_cap & LDPC_VHT_ENABLE_RX) && in rtl8821ae_update_channel_access_setting()
3697 (mac->vht_stbc_cap & STBC_VHT_ENABLE_RX)) { in rtl8821ae_update_channel_access_setting()
3698 if (mac->vendor == PEER_ATH) in rtl8821ae_update_channel_access_setting()
3706 rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_R2T_SIFS, (u8 *)&r2t_sifs); in rtl8821ae_update_channel_access_setting()
3713 struct rtl_phy *rtlphy = &rtlpriv->phy; in rtl8821ae_gpio_radio_on_off_checking()
3718 if (rtlpriv->rtlhal.being_init_adapter) in rtl8821ae_gpio_radio_on_off_checking()
3721 if (ppsc->swrf_processing) in rtl8821ae_gpio_radio_on_off_checking()
3724 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3725 if (ppsc->rfchange_inprogress) { in rtl8821ae_gpio_radio_on_off_checking()
3726 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3729 ppsc->rfchange_inprogress = true; in rtl8821ae_gpio_radio_on_off_checking()
3730 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3739 if (rtlphy->polarity_ctl) in rtl8821ae_gpio_radio_on_off_checking()
3744 if ((ppsc->hwradiooff) && (e_rfpowerstate_toset == ERFON)) { in rtl8821ae_gpio_radio_on_off_checking()
3746 "GPIOChangeRF - HW Radio ON, RF ON\n"); in rtl8821ae_gpio_radio_on_off_checking()
3749 ppsc->hwradiooff = false; in rtl8821ae_gpio_radio_on_off_checking()
3751 } else if ((!ppsc->hwradiooff) in rtl8821ae_gpio_radio_on_off_checking()
3754 "GPIOChangeRF - HW Radio OFF, RF OFF\n"); in rtl8821ae_gpio_radio_on_off_checking()
3757 ppsc->hwradiooff = true; in rtl8821ae_gpio_radio_on_off_checking()
3762 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3763 ppsc->rfchange_inprogress = false; in rtl8821ae_gpio_radio_on_off_checking()
3764 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3766 if (ppsc->reg_rfps_level & RT_RF_OFF_LEVL_HALT_NIC) in rtl8821ae_gpio_radio_on_off_checking()
3769 spin_lock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3770 ppsc->rfchange_inprogress = false; in rtl8821ae_gpio_radio_on_off_checking()
3771 spin_unlock(&rtlpriv->locks.rf_ps_lock); in rtl8821ae_gpio_radio_on_off_checking()
3775 return !ppsc->hwradiooff; in rtl8821ae_gpio_radio_on_off_checking()
3783 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); in rtl8821ae_set_key() local
3811 memset(rtlpriv->sec.key_buf[idx], 0, in rtl8821ae_set_key()
3813 rtlpriv->sec.key_len[idx] = 0; in rtl8821ae_set_key()
3837 if (is_wepkey || rtlpriv->sec.use_defaultkey) { in rtl8821ae_set_key()
3845 if (mac->opmode == NL80211_IFTYPE_AP) { in rtl8821ae_set_key()
3860 if (rtlpriv->sec.key_len[key_index] == 0) { in rtl8821ae_set_key()
3864 if (mac->opmode == NL80211_IFTYPE_AP) in rtl8821ae_set_key()
3877 rtlpriv->sec.key_buf[key_index]); in rtl8821ae_set_key()
3882 if (mac->opmode == NL80211_IFTYPE_ADHOC) { in rtl8821ae_set_key()
3884 rtlefuse->dev_addr, in rtl8821ae_set_key()
3889 rtlpriv->sec.key_buf in rtl8821ae_set_key()
3896 rtlpriv->sec.key_buf[entry_id]); in rtl8821ae_set_key()
3907 rtlpriv->btcoexist.reg_bt_iso = 2; in rtl8821ae_bt_reg_init()
3908 /* 0:Idle, 1:None-SCO, 2:SCO, 3:From Counter. */ in rtl8821ae_bt_reg_init()
3909 rtlpriv->btcoexist.reg_bt_sco = 3; in rtl8821ae_bt_reg_init()
3910 /* 0:Disable BT control A-MPDU, 1:Enable BT control A-MPDU. */ in rtl8821ae_bt_reg_init()
3911 rtlpriv->btcoexist.reg_bt_sco = 0; in rtl8821ae_bt_reg_init()
3918 if (rtlpriv->cfg->ops->get_btc_status()) in rtl8821ae_bt_hw_init()
3919 rtlpriv->btcoexist.btc_ops->btc_init_hw_config(rtlpriv); in rtl8821ae_bt_hw_init()
3938 rtlpci->receive_config |= RCR_AAP; in rtl8821ae_allow_all_destaddr()
3940 rtlpci->receive_config &= ~RCR_AAP; in rtl8821ae_allow_all_destaddr()
3943 rtl_write_dword(rtlpriv, REG_RCR, rtlpci->receive_config); in rtl8821ae_allow_all_destaddr()
3947 rtlpci->receive_config, write_into_reg); in rtl8821ae_allow_all_destaddr()
3988 cam = BIT(31) | rtl_pattern->crc; in rtl8821ae_add_wowlan_pattern()
3990 if (rtl_pattern->type == UNICAST_PATTERN) in rtl8821ae_add_wowlan_pattern()
3992 else if (rtl_pattern->type == MULTICAST_PATTERN) in rtl8821ae_add_wowlan_pattern()
3994 else if (rtl_pattern->type == BROADCAST_PATTERN) in rtl8821ae_add_wowlan_pattern()
4005 cam = rtl_pattern->mask[addr - 2]; in rtl8821ae_add_wowlan_pattern()
4014 cam = rtl_pattern->mask[addr - 2]; in rtl8821ae_add_wowlan_pattern()