18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012 Realtek Corporation.*/ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#include "../wifi.h" 58c2ecf20Sopenharmony_ci#include "../core.h" 68c2ecf20Sopenharmony_ci#include "../pci.h" 78c2ecf20Sopenharmony_ci#include "reg.h" 88c2ecf20Sopenharmony_ci#include "def.h" 98c2ecf20Sopenharmony_ci#include "phy.h" 108c2ecf20Sopenharmony_ci#include "dm.h" 118c2ecf20Sopenharmony_ci#include "fw.h" 128c2ecf20Sopenharmony_ci#include "../rtl8723com/fw_common.h" 138c2ecf20Sopenharmony_ci#include "hw.h" 148c2ecf20Sopenharmony_ci#include "trx.h" 158c2ecf20Sopenharmony_ci#include "led.h" 168c2ecf20Sopenharmony_ci#include "table.h" 178c2ecf20Sopenharmony_ci#include "hal_btc.h" 188c2ecf20Sopenharmony_ci#include "../btcoexist/rtl_btc.h" 198c2ecf20Sopenharmony_ci#include "../rtl8723com/phy_common.h" 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#include <linux/vmalloc.h> 228c2ecf20Sopenharmony_ci#include <linux/module.h> 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_cistatic void rtl8723e_init_aspm_vars(struct ieee80211_hw *hw) 258c2ecf20Sopenharmony_ci{ 268c2ecf20Sopenharmony_ci struct rtl_priv *rtlpriv = rtl_priv(hw); 278c2ecf20Sopenharmony_ci struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci /*close ASPM for AMD defaultly */ 308c2ecf20Sopenharmony_ci rtlpci->const_amdpci_aspm = 0; 318c2ecf20Sopenharmony_ci 328c2ecf20Sopenharmony_ci /** 338c2ecf20Sopenharmony_ci * ASPM PS mode. 348c2ecf20Sopenharmony_ci * 0 - Disable ASPM, 358c2ecf20Sopenharmony_ci * 1 - Enable ASPM without Clock Req, 368c2ecf20Sopenharmony_ci * 2 - Enable ASPM with Clock Req, 378c2ecf20Sopenharmony_ci * 3 - Alwyas Enable ASPM with Clock Req, 388c2ecf20Sopenharmony_ci * 4 - Always Enable ASPM without Clock Req. 398c2ecf20Sopenharmony_ci * set defult to RTL8192CE:3 RTL8192E:2 408c2ecf20Sopenharmony_ci */ 418c2ecf20Sopenharmony_ci rtlpci->const_pci_aspm = 3; 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ci /*Setting for PCI-E device */ 448c2ecf20Sopenharmony_ci rtlpci->const_devicepci_aspm_setting = 0x03; 458c2ecf20Sopenharmony_ci 468c2ecf20Sopenharmony_ci /*Setting for PCI-E bridge */ 478c2ecf20Sopenharmony_ci rtlpci->const_hostpci_aspm_setting = 0x02; 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci /** 508c2ecf20Sopenharmony_ci * In Hw/Sw Radio Off situation. 518c2ecf20Sopenharmony_ci * 0 - Default, 528c2ecf20Sopenharmony_ci * 1 - From ASPM setting without low Mac Pwr, 538c2ecf20Sopenharmony_ci * 2 - From ASPM setting with low Mac Pwr, 548c2ecf20Sopenharmony_ci * 3 - Bus D3 558c2ecf20Sopenharmony_ci * set default to RTL8192CE:0 RTL8192SE:2 568c2ecf20Sopenharmony_ci */ 578c2ecf20Sopenharmony_ci rtlpci->const_hwsw_rfoff_d3 = 0; 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci /** 608c2ecf20Sopenharmony_ci * This setting works for those device with 618c2ecf20Sopenharmony_ci * backdoor ASPM setting such as EPHY setting. 628c2ecf20Sopenharmony_ci * 0 - Not support ASPM, 638c2ecf20Sopenharmony_ci * 1 - Support ASPM, 648c2ecf20Sopenharmony_ci * 2 - According to chipset. 658c2ecf20Sopenharmony_ci */ 668c2ecf20Sopenharmony_ci rtlpci->const_support_pciaspm = rtlpriv->cfg->mod_params->aspm_support; 678c2ecf20Sopenharmony_ci} 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_cistatic int rtl8723e_init_sw_vars(struct ieee80211_hw *hw) 708c2ecf20Sopenharmony_ci{ 718c2ecf20Sopenharmony_ci struct rtl_priv *rtlpriv = rtl_priv(hw); 728c2ecf20Sopenharmony_ci struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 738c2ecf20Sopenharmony_ci struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 748c2ecf20Sopenharmony_ci int err = 0; 758c2ecf20Sopenharmony_ci char *fw_name = "rtlwifi/rtl8723fw.bin"; 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci rtl8723e_bt_reg_init(hw); 788c2ecf20Sopenharmony_ci 798c2ecf20Sopenharmony_ci rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer(); 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci rtlpriv->dm.dm_initialgain_enable = true; 828c2ecf20Sopenharmony_ci rtlpriv->dm.dm_flag = 0; 838c2ecf20Sopenharmony_ci rtlpriv->dm.disable_framebursting = false; 848c2ecf20Sopenharmony_ci rtlpriv->dm.thermalvalue = 0; 858c2ecf20Sopenharmony_ci rtlpci->transmit_config = CFENDFORM | BIT(12) | BIT(13); 868c2ecf20Sopenharmony_ci 878c2ecf20Sopenharmony_ci /* compatible 5G band 88ce just 2.4G band & smsp */ 888c2ecf20Sopenharmony_ci rtlpriv->rtlhal.current_bandtype = BAND_ON_2_4G; 898c2ecf20Sopenharmony_ci rtlpriv->rtlhal.bandset = BAND_ON_2_4G; 908c2ecf20Sopenharmony_ci rtlpriv->rtlhal.macphymode = SINGLEMAC_SINGLEPHY; 918c2ecf20Sopenharmony_ci 928c2ecf20Sopenharmony_ci rtlpci->receive_config = (RCR_APPFCS | 938c2ecf20Sopenharmony_ci RCR_APP_MIC | 948c2ecf20Sopenharmony_ci RCR_APP_ICV | 958c2ecf20Sopenharmony_ci RCR_APP_PHYST_RXFF | 968c2ecf20Sopenharmony_ci RCR_HTC_LOC_CTRL | 978c2ecf20Sopenharmony_ci RCR_AMF | 988c2ecf20Sopenharmony_ci RCR_ACF | 998c2ecf20Sopenharmony_ci RCR_ADF | 1008c2ecf20Sopenharmony_ci RCR_AICV | 1018c2ecf20Sopenharmony_ci RCR_AB | 1028c2ecf20Sopenharmony_ci RCR_AM | 1038c2ecf20Sopenharmony_ci RCR_APM | 1048c2ecf20Sopenharmony_ci 0); 1058c2ecf20Sopenharmony_ci 1068c2ecf20Sopenharmony_ci rtlpci->irq_mask[0] = 1078c2ecf20Sopenharmony_ci (u32) (PHIMR_ROK | 1088c2ecf20Sopenharmony_ci PHIMR_RDU | 1098c2ecf20Sopenharmony_ci PHIMR_VODOK | 1108c2ecf20Sopenharmony_ci PHIMR_VIDOK | 1118c2ecf20Sopenharmony_ci PHIMR_BEDOK | 1128c2ecf20Sopenharmony_ci PHIMR_BKDOK | 1138c2ecf20Sopenharmony_ci PHIMR_MGNTDOK | 1148c2ecf20Sopenharmony_ci PHIMR_HIGHDOK | 1158c2ecf20Sopenharmony_ci PHIMR_C2HCMD | 1168c2ecf20Sopenharmony_ci PHIMR_HISRE_IND | 1178c2ecf20Sopenharmony_ci PHIMR_TSF_BIT32_TOGGLE | 1188c2ecf20Sopenharmony_ci PHIMR_TXBCNOK | 1198c2ecf20Sopenharmony_ci PHIMR_PSTIMEOUT | 1208c2ecf20Sopenharmony_ci 0); 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci rtlpci->irq_mask[1] = 1238c2ecf20Sopenharmony_ci (u32)(PHIMR_RXFOVW | 1248c2ecf20Sopenharmony_ci 0); 1258c2ecf20Sopenharmony_ci 1268c2ecf20Sopenharmony_ci /* for LPS & IPS */ 1278c2ecf20Sopenharmony_ci rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps; 1288c2ecf20Sopenharmony_ci rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; 1298c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; 1308c2ecf20Sopenharmony_ci rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support; 1318c2ecf20Sopenharmony_ci if (rtlpriv->cfg->mod_params->disable_watchdog) 1328c2ecf20Sopenharmony_ci pr_info("watchdog disabled\n"); 1338c2ecf20Sopenharmony_ci rtlpriv->psc.reg_fwctrl_lps = 3; 1348c2ecf20Sopenharmony_ci rtlpriv->psc.reg_max_lps_awakeintvl = 5; 1358c2ecf20Sopenharmony_ci rtl8723e_init_aspm_vars(hw); 1368c2ecf20Sopenharmony_ci 1378c2ecf20Sopenharmony_ci if (rtlpriv->psc.reg_fwctrl_lps == 1) 1388c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_psmode = FW_PS_MIN_MODE; 1398c2ecf20Sopenharmony_ci else if (rtlpriv->psc.reg_fwctrl_lps == 2) 1408c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_psmode = FW_PS_MAX_MODE; 1418c2ecf20Sopenharmony_ci else if (rtlpriv->psc.reg_fwctrl_lps == 3) 1428c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE; 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci /* for firmware buf */ 1458c2ecf20Sopenharmony_ci rtlpriv->rtlhal.pfirmware = vzalloc(0x6000); 1468c2ecf20Sopenharmony_ci if (!rtlpriv->rtlhal.pfirmware) { 1478c2ecf20Sopenharmony_ci pr_err("Can't alloc buffer for fw.\n"); 1488c2ecf20Sopenharmony_ci return 1; 1498c2ecf20Sopenharmony_ci } 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci if (IS_81XXC_VENDOR_UMC_B_CUT(rtlhal->version)) 1528c2ecf20Sopenharmony_ci fw_name = "rtlwifi/rtl8723fw_B.bin"; 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci rtlpriv->max_fw_size = 0x6000; 1558c2ecf20Sopenharmony_ci pr_info("Using firmware %s\n", fw_name); 1568c2ecf20Sopenharmony_ci err = request_firmware_nowait(THIS_MODULE, 1, fw_name, 1578c2ecf20Sopenharmony_ci rtlpriv->io.dev, GFP_KERNEL, hw, 1588c2ecf20Sopenharmony_ci rtl_fw_cb); 1598c2ecf20Sopenharmony_ci if (err) { 1608c2ecf20Sopenharmony_ci pr_err("Failed to request firmware!\n"); 1618c2ecf20Sopenharmony_ci vfree(rtlpriv->rtlhal.pfirmware); 1628c2ecf20Sopenharmony_ci rtlpriv->rtlhal.pfirmware = NULL; 1638c2ecf20Sopenharmony_ci return 1; 1648c2ecf20Sopenharmony_ci } 1658c2ecf20Sopenharmony_ci return 0; 1668c2ecf20Sopenharmony_ci} 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_cistatic void rtl8723e_deinit_sw_vars(struct ieee80211_hw *hw) 1698c2ecf20Sopenharmony_ci{ 1708c2ecf20Sopenharmony_ci struct rtl_priv *rtlpriv = rtl_priv(hw); 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ci if (rtlpriv->rtlhal.pfirmware) { 1738c2ecf20Sopenharmony_ci vfree(rtlpriv->rtlhal.pfirmware); 1748c2ecf20Sopenharmony_ci rtlpriv->rtlhal.pfirmware = NULL; 1758c2ecf20Sopenharmony_ci } 1768c2ecf20Sopenharmony_ci} 1778c2ecf20Sopenharmony_ci 1788c2ecf20Sopenharmony_ci/* get bt coexist status */ 1798c2ecf20Sopenharmony_cistatic bool rtl8723e_get_btc_status(void) 1808c2ecf20Sopenharmony_ci{ 1818c2ecf20Sopenharmony_ci return true; 1828c2ecf20Sopenharmony_ci} 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_cistatic bool is_fw_header(struct rtlwifi_firmware_header *hdr) 1858c2ecf20Sopenharmony_ci{ 1868c2ecf20Sopenharmony_ci return (le16_to_cpu(hdr->signature) & 0xfff0) == 0x2300; 1878c2ecf20Sopenharmony_ci} 1888c2ecf20Sopenharmony_ci 1898c2ecf20Sopenharmony_cistatic struct rtl_hal_ops rtl8723e_hal_ops = { 1908c2ecf20Sopenharmony_ci .init_sw_vars = rtl8723e_init_sw_vars, 1918c2ecf20Sopenharmony_ci .deinit_sw_vars = rtl8723e_deinit_sw_vars, 1928c2ecf20Sopenharmony_ci .read_eeprom_info = rtl8723e_read_eeprom_info, 1938c2ecf20Sopenharmony_ci .interrupt_recognized = rtl8723e_interrupt_recognized, 1948c2ecf20Sopenharmony_ci .hw_init = rtl8723e_hw_init, 1958c2ecf20Sopenharmony_ci .hw_disable = rtl8723e_card_disable, 1968c2ecf20Sopenharmony_ci .hw_suspend = rtl8723e_suspend, 1978c2ecf20Sopenharmony_ci .hw_resume = rtl8723e_resume, 1988c2ecf20Sopenharmony_ci .enable_interrupt = rtl8723e_enable_interrupt, 1998c2ecf20Sopenharmony_ci .disable_interrupt = rtl8723e_disable_interrupt, 2008c2ecf20Sopenharmony_ci .set_network_type = rtl8723e_set_network_type, 2018c2ecf20Sopenharmony_ci .set_chk_bssid = rtl8723e_set_check_bssid, 2028c2ecf20Sopenharmony_ci .set_qos = rtl8723e_set_qos, 2038c2ecf20Sopenharmony_ci .set_bcn_reg = rtl8723e_set_beacon_related_registers, 2048c2ecf20Sopenharmony_ci .set_bcn_intv = rtl8723e_set_beacon_interval, 2058c2ecf20Sopenharmony_ci .update_interrupt_mask = rtl8723e_update_interrupt_mask, 2068c2ecf20Sopenharmony_ci .get_hw_reg = rtl8723e_get_hw_reg, 2078c2ecf20Sopenharmony_ci .set_hw_reg = rtl8723e_set_hw_reg, 2088c2ecf20Sopenharmony_ci .update_rate_tbl = rtl8723e_update_hal_rate_tbl, 2098c2ecf20Sopenharmony_ci .fill_tx_desc = rtl8723e_tx_fill_desc, 2108c2ecf20Sopenharmony_ci .fill_tx_cmddesc = rtl8723e_tx_fill_cmddesc, 2118c2ecf20Sopenharmony_ci .query_rx_desc = rtl8723e_rx_query_desc, 2128c2ecf20Sopenharmony_ci .set_channel_access = rtl8723e_update_channel_access_setting, 2138c2ecf20Sopenharmony_ci .radio_onoff_checking = rtl8723e_gpio_radio_on_off_checking, 2148c2ecf20Sopenharmony_ci .set_bw_mode = rtl8723e_phy_set_bw_mode, 2158c2ecf20Sopenharmony_ci .switch_channel = rtl8723e_phy_sw_chnl, 2168c2ecf20Sopenharmony_ci .dm_watchdog = rtl8723e_dm_watchdog, 2178c2ecf20Sopenharmony_ci .scan_operation_backup = rtl8723e_phy_scan_operation_backup, 2188c2ecf20Sopenharmony_ci .set_rf_power_state = rtl8723e_phy_set_rf_power_state, 2198c2ecf20Sopenharmony_ci .led_control = rtl8723e_led_control, 2208c2ecf20Sopenharmony_ci .set_desc = rtl8723e_set_desc, 2218c2ecf20Sopenharmony_ci .get_desc = rtl8723e_get_desc, 2228c2ecf20Sopenharmony_ci .is_tx_desc_closed = rtl8723e_is_tx_desc_closed, 2238c2ecf20Sopenharmony_ci .tx_polling = rtl8723e_tx_polling, 2248c2ecf20Sopenharmony_ci .enable_hw_sec = rtl8723e_enable_hw_security_config, 2258c2ecf20Sopenharmony_ci .set_key = rtl8723e_set_key, 2268c2ecf20Sopenharmony_ci .init_sw_leds = rtl8723e_init_sw_leds, 2278c2ecf20Sopenharmony_ci .get_bbreg = rtl8723_phy_query_bb_reg, 2288c2ecf20Sopenharmony_ci .set_bbreg = rtl8723_phy_set_bb_reg, 2298c2ecf20Sopenharmony_ci .get_rfreg = rtl8723e_phy_query_rf_reg, 2308c2ecf20Sopenharmony_ci .set_rfreg = rtl8723e_phy_set_rf_reg, 2318c2ecf20Sopenharmony_ci .c2h_command_handle = rtl_8723e_c2h_command_handle, 2328c2ecf20Sopenharmony_ci .bt_wifi_media_status_notify = rtl_8723e_bt_wifi_media_status_notify, 2338c2ecf20Sopenharmony_ci .bt_coex_off_before_lps = 2348c2ecf20Sopenharmony_ci rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lps, 2358c2ecf20Sopenharmony_ci .get_btc_status = rtl8723e_get_btc_status, 2368c2ecf20Sopenharmony_ci .is_fw_header = is_fw_header, 2378c2ecf20Sopenharmony_ci}; 2388c2ecf20Sopenharmony_ci 2398c2ecf20Sopenharmony_cistatic struct rtl_mod_params rtl8723e_mod_params = { 2408c2ecf20Sopenharmony_ci .sw_crypto = false, 2418c2ecf20Sopenharmony_ci .inactiveps = true, 2428c2ecf20Sopenharmony_ci .swctrl_lps = true, 2438c2ecf20Sopenharmony_ci .fwctrl_lps = false, 2448c2ecf20Sopenharmony_ci .aspm_support = 1, 2458c2ecf20Sopenharmony_ci .debug_level = 0, 2468c2ecf20Sopenharmony_ci .debug_mask = 0, 2478c2ecf20Sopenharmony_ci .msi_support = false, 2488c2ecf20Sopenharmony_ci .disable_watchdog = false, 2498c2ecf20Sopenharmony_ci}; 2508c2ecf20Sopenharmony_ci 2518c2ecf20Sopenharmony_cistatic const struct rtl_hal_cfg rtl8723e_hal_cfg = { 2528c2ecf20Sopenharmony_ci .bar_id = 2, 2538c2ecf20Sopenharmony_ci .write_readback = true, 2548c2ecf20Sopenharmony_ci .name = "rtl8723e_pci", 2558c2ecf20Sopenharmony_ci .ops = &rtl8723e_hal_ops, 2568c2ecf20Sopenharmony_ci .mod_params = &rtl8723e_mod_params, 2578c2ecf20Sopenharmony_ci .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, 2588c2ecf20Sopenharmony_ci .maps[SYS_FUNC_EN] = REG_SYS_FUNC_EN, 2598c2ecf20Sopenharmony_ci .maps[SYS_CLK] = REG_SYS_CLKR, 2608c2ecf20Sopenharmony_ci .maps[MAC_RCR_AM] = AM, 2618c2ecf20Sopenharmony_ci .maps[MAC_RCR_AB] = AB, 2628c2ecf20Sopenharmony_ci .maps[MAC_RCR_ACRC32] = ACRC32, 2638c2ecf20Sopenharmony_ci .maps[MAC_RCR_ACF] = ACF, 2648c2ecf20Sopenharmony_ci .maps[MAC_RCR_AAP] = AAP, 2658c2ecf20Sopenharmony_ci .maps[MAC_HIMR] = REG_HIMR, 2668c2ecf20Sopenharmony_ci .maps[MAC_HIMRE] = REG_HIMRE, 2678c2ecf20Sopenharmony_ci .maps[EFUSE_TEST] = REG_EFUSE_TEST, 2688c2ecf20Sopenharmony_ci .maps[EFUSE_CTRL] = REG_EFUSE_CTRL, 2698c2ecf20Sopenharmony_ci .maps[EFUSE_CLK] = 0, 2708c2ecf20Sopenharmony_ci .maps[EFUSE_CLK_CTRL] = REG_EFUSE_CTRL, 2718c2ecf20Sopenharmony_ci .maps[EFUSE_PWC_EV12V] = PWC_EV12V, 2728c2ecf20Sopenharmony_ci .maps[EFUSE_FEN_ELDR] = FEN_ELDR, 2738c2ecf20Sopenharmony_ci .maps[EFUSE_LOADER_CLK_EN] = LOADER_CLK_EN, 2748c2ecf20Sopenharmony_ci .maps[EFUSE_ANA8M] = ANA8M, 2758c2ecf20Sopenharmony_ci .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE, 2768c2ecf20Sopenharmony_ci .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION, 2778c2ecf20Sopenharmony_ci .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN, 2788c2ecf20Sopenharmony_ci .maps[EFUSE_OOB_PROTECT_BYTES_LEN] = EFUSE_OOB_PROTECT_BYTES, 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci .maps[RWCAM] = REG_CAMCMD, 2818c2ecf20Sopenharmony_ci .maps[WCAMI] = REG_CAMWRITE, 2828c2ecf20Sopenharmony_ci .maps[RCAMO] = REG_CAMREAD, 2838c2ecf20Sopenharmony_ci .maps[CAMDBG] = REG_CAMDBG, 2848c2ecf20Sopenharmony_ci .maps[SECR] = REG_SECCFG, 2858c2ecf20Sopenharmony_ci .maps[SEC_CAM_NONE] = CAM_NONE, 2868c2ecf20Sopenharmony_ci .maps[SEC_CAM_WEP40] = CAM_WEP40, 2878c2ecf20Sopenharmony_ci .maps[SEC_CAM_TKIP] = CAM_TKIP, 2888c2ecf20Sopenharmony_ci .maps[SEC_CAM_AES] = CAM_AES, 2898c2ecf20Sopenharmony_ci .maps[SEC_CAM_WEP104] = CAM_WEP104, 2908c2ecf20Sopenharmony_ci 2918c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT6] = IMR_BCNDMAINT6, 2928c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT5] = IMR_BCNDMAINT5, 2938c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT4] = IMR_BCNDMAINT4, 2948c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT3] = IMR_BCNDMAINT3, 2958c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT2] = IMR_BCNDMAINT2, 2968c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT1] = IMR_BCNDMAINT1, 2978c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK8] = IMR_BCNDOK8, 2988c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK7] = IMR_BCNDOK7, 2998c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK6] = IMR_BCNDOK6, 3008c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK5] = IMR_BCNDOK5, 3018c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK4] = IMR_BCNDOK4, 3028c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK3] = IMR_BCNDOK3, 3038c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK2] = IMR_BCNDOK2, 3048c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK1] = IMR_BCNDOK1, 3058c2ecf20Sopenharmony_ci .maps[RTL_IMR_TIMEOUT2] = IMR_TIMEOUT2, 3068c2ecf20Sopenharmony_ci .maps[RTL_IMR_TIMEOUT1] = IMR_TIMEOUT1, 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci .maps[RTL_IMR_TXFOVW] = PHIMR_TXFOVW, 3098c2ecf20Sopenharmony_ci .maps[RTL_IMR_PSTIMEOUT] = PHIMR_PSTIMEOUT, 3108c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNINT] = PHIMR_BCNDMAINT0, 3118c2ecf20Sopenharmony_ci .maps[RTL_IMR_RXFOVW] = PHIMR_RXFOVW, 3128c2ecf20Sopenharmony_ci .maps[RTL_IMR_RDU] = PHIMR_RDU, 3138c2ecf20Sopenharmony_ci .maps[RTL_IMR_ATIMEND] = PHIMR_ATIMEND_E, 3148c2ecf20Sopenharmony_ci .maps[RTL_IMR_BDOK] = PHIMR_BCNDOK0, 3158c2ecf20Sopenharmony_ci .maps[RTL_IMR_MGNTDOK] = PHIMR_MGNTDOK, 3168c2ecf20Sopenharmony_ci .maps[RTL_IMR_TBDER] = PHIMR_TXBCNERR, 3178c2ecf20Sopenharmony_ci .maps[RTL_IMR_HIGHDOK] = PHIMR_HIGHDOK, 3188c2ecf20Sopenharmony_ci .maps[RTL_IMR_TBDOK] = PHIMR_TXBCNOK, 3198c2ecf20Sopenharmony_ci .maps[RTL_IMR_BKDOK] = PHIMR_BKDOK, 3208c2ecf20Sopenharmony_ci .maps[RTL_IMR_BEDOK] = PHIMR_BEDOK, 3218c2ecf20Sopenharmony_ci .maps[RTL_IMR_VIDOK] = PHIMR_VIDOK, 3228c2ecf20Sopenharmony_ci .maps[RTL_IMR_VODOK] = PHIMR_VODOK, 3238c2ecf20Sopenharmony_ci .maps[RTL_IMR_ROK] = PHIMR_ROK, 3248c2ecf20Sopenharmony_ci .maps[RTL_IBSS_INT_MASKS] = 3258c2ecf20Sopenharmony_ci (PHIMR_BCNDMAINT0 | PHIMR_TXBCNOK | PHIMR_TXBCNERR), 3268c2ecf20Sopenharmony_ci .maps[RTL_IMR_C2HCMD] = PHIMR_C2HCMD, 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ci 3298c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE1M] = DESC92C_RATE1M, 3308c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE2M] = DESC92C_RATE2M, 3318c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE5_5M] = DESC92C_RATE5_5M, 3328c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE11M] = DESC92C_RATE11M, 3338c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE6M] = DESC92C_RATE6M, 3348c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE9M] = DESC92C_RATE9M, 3358c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE12M] = DESC92C_RATE12M, 3368c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE18M] = DESC92C_RATE18M, 3378c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE24M] = DESC92C_RATE24M, 3388c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE36M] = DESC92C_RATE36M, 3398c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE48M] = DESC92C_RATE48M, 3408c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE54M] = DESC92C_RATE54M, 3418c2ecf20Sopenharmony_ci 3428c2ecf20Sopenharmony_ci .maps[RTL_RC_HT_RATEMCS7] = DESC92C_RATEMCS7, 3438c2ecf20Sopenharmony_ci .maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15, 3448c2ecf20Sopenharmony_ci}; 3458c2ecf20Sopenharmony_ci 3468c2ecf20Sopenharmony_cistatic const struct pci_device_id rtl8723e_pci_ids[] = { 3478c2ecf20Sopenharmony_ci {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8723, rtl8723e_hal_cfg)}, 3488c2ecf20Sopenharmony_ci {}, 3498c2ecf20Sopenharmony_ci}; 3508c2ecf20Sopenharmony_ci 3518c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(pci, rtl8723e_pci_ids); 3528c2ecf20Sopenharmony_ci 3538c2ecf20Sopenharmony_ciMODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); 3548c2ecf20Sopenharmony_ciMODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); 3558c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL"); 3568c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Realtek 8723E 802.11n PCI wireless"); 3578c2ecf20Sopenharmony_ciMODULE_FIRMWARE("rtlwifi/rtl8723efw.bin"); 3588c2ecf20Sopenharmony_ci 3598c2ecf20Sopenharmony_cimodule_param_named(swenc, rtl8723e_mod_params.sw_crypto, bool, 0444); 3608c2ecf20Sopenharmony_cimodule_param_named(debug_level, rtl8723e_mod_params.debug_level, int, 0644); 3618c2ecf20Sopenharmony_cimodule_param_named(debug_mask, rtl8723e_mod_params.debug_mask, ullong, 0644); 3628c2ecf20Sopenharmony_cimodule_param_named(ips, rtl8723e_mod_params.inactiveps, bool, 0444); 3638c2ecf20Sopenharmony_cimodule_param_named(swlps, rtl8723e_mod_params.swctrl_lps, bool, 0444); 3648c2ecf20Sopenharmony_cimodule_param_named(fwlps, rtl8723e_mod_params.fwctrl_lps, bool, 0444); 3658c2ecf20Sopenharmony_cimodule_param_named(msi, rtl8723e_mod_params.msi_support, bool, 0444); 3668c2ecf20Sopenharmony_cimodule_param_named(aspm, rtl8723e_mod_params.aspm_support, int, 0444); 3678c2ecf20Sopenharmony_cimodule_param_named(disable_watchdog, rtl8723e_mod_params.disable_watchdog, 3688c2ecf20Sopenharmony_ci bool, 0444); 3698c2ecf20Sopenharmony_ciMODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); 3708c2ecf20Sopenharmony_ciMODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); 3718c2ecf20Sopenharmony_ciMODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 1)\n"); 3728c2ecf20Sopenharmony_ciMODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 0)\n"); 3738c2ecf20Sopenharmony_ciMODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n"); 3748c2ecf20Sopenharmony_ciMODULE_PARM_DESC(aspm, "Set to 1 to enable ASPM (default 1)\n"); 3758c2ecf20Sopenharmony_ciMODULE_PARM_DESC(debug_level, "Set debug level (0-5) (default 0)"); 3768c2ecf20Sopenharmony_ciMODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)"); 3778c2ecf20Sopenharmony_ciMODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n"); 3788c2ecf20Sopenharmony_ci 3798c2ecf20Sopenharmony_cistatic SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_cistatic struct pci_driver rtl8723e_driver = { 3828c2ecf20Sopenharmony_ci .name = KBUILD_MODNAME, 3838c2ecf20Sopenharmony_ci .id_table = rtl8723e_pci_ids, 3848c2ecf20Sopenharmony_ci .probe = rtl_pci_probe, 3858c2ecf20Sopenharmony_ci .remove = rtl_pci_disconnect, 3868c2ecf20Sopenharmony_ci .driver.pm = &rtlwifi_pm_ops, 3878c2ecf20Sopenharmony_ci}; 3888c2ecf20Sopenharmony_ci 3898c2ecf20Sopenharmony_cimodule_pci_driver(rtl8723e_driver); 390