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 "../base.h" 88c2ecf20Sopenharmony_ci#include "reg.h" 98c2ecf20Sopenharmony_ci#include "def.h" 108c2ecf20Sopenharmony_ci#include "phy.h" 118c2ecf20Sopenharmony_ci#include "dm.h" 128c2ecf20Sopenharmony_ci#include "../rtl8192c/dm_common.h" 138c2ecf20Sopenharmony_ci#include "../rtl8192c/fw_common.h" 148c2ecf20Sopenharmony_ci#include "../rtl8192c/phy_common.h" 158c2ecf20Sopenharmony_ci#include "hw.h" 168c2ecf20Sopenharmony_ci#include "rf.h" 178c2ecf20Sopenharmony_ci#include "trx.h" 188c2ecf20Sopenharmony_ci#include "led.h" 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ci#include <linux/module.h> 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_cistatic void rtl92c_init_aspm_vars(struct ieee80211_hw *hw) 238c2ecf20Sopenharmony_ci{ 248c2ecf20Sopenharmony_ci struct rtl_priv *rtlpriv = rtl_priv(hw); 258c2ecf20Sopenharmony_ci struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci /*close ASPM for AMD defaultly */ 288c2ecf20Sopenharmony_ci rtlpci->const_amdpci_aspm = 0; 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci /* 318c2ecf20Sopenharmony_ci * ASPM PS mode. 328c2ecf20Sopenharmony_ci * 0 - Disable ASPM, 338c2ecf20Sopenharmony_ci * 1 - Enable ASPM without Clock Req, 348c2ecf20Sopenharmony_ci * 2 - Enable ASPM with Clock Req, 358c2ecf20Sopenharmony_ci * 3 - Alwyas Enable ASPM with Clock Req, 368c2ecf20Sopenharmony_ci * 4 - Always Enable ASPM without Clock Req. 378c2ecf20Sopenharmony_ci * set defult to RTL8192CE:3 RTL8192E:2 388c2ecf20Sopenharmony_ci * */ 398c2ecf20Sopenharmony_ci rtlpci->const_pci_aspm = 3; 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci /*Setting for PCI-E device */ 428c2ecf20Sopenharmony_ci rtlpci->const_devicepci_aspm_setting = 0x03; 438c2ecf20Sopenharmony_ci 448c2ecf20Sopenharmony_ci /*Setting for PCI-E bridge */ 458c2ecf20Sopenharmony_ci rtlpci->const_hostpci_aspm_setting = 0x02; 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci /* 488c2ecf20Sopenharmony_ci * In Hw/Sw Radio Off situation. 498c2ecf20Sopenharmony_ci * 0 - Default, 508c2ecf20Sopenharmony_ci * 1 - From ASPM setting without low Mac Pwr, 518c2ecf20Sopenharmony_ci * 2 - From ASPM setting with low Mac Pwr, 528c2ecf20Sopenharmony_ci * 3 - Bus D3 538c2ecf20Sopenharmony_ci * set default to RTL8192CE:0 RTL8192SE:2 548c2ecf20Sopenharmony_ci */ 558c2ecf20Sopenharmony_ci rtlpci->const_hwsw_rfoff_d3 = 0; 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci /* 588c2ecf20Sopenharmony_ci * This setting works for those device with 598c2ecf20Sopenharmony_ci * backdoor ASPM setting such as EPHY setting. 608c2ecf20Sopenharmony_ci * 0 - Not support ASPM, 618c2ecf20Sopenharmony_ci * 1 - Support ASPM, 628c2ecf20Sopenharmony_ci * 2 - According to chipset. 638c2ecf20Sopenharmony_ci */ 648c2ecf20Sopenharmony_ci rtlpci->const_support_pciaspm = rtlpriv->cfg->mod_params->aspm_support; 658c2ecf20Sopenharmony_ci} 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_cistatic int rtl92c_init_sw_vars(struct ieee80211_hw *hw) 688c2ecf20Sopenharmony_ci{ 698c2ecf20Sopenharmony_ci int err; 708c2ecf20Sopenharmony_ci struct rtl_priv *rtlpriv = rtl_priv(hw); 718c2ecf20Sopenharmony_ci struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 728c2ecf20Sopenharmony_ci struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 738c2ecf20Sopenharmony_ci char *fw_name; 748c2ecf20Sopenharmony_ci 758c2ecf20Sopenharmony_ci rtl8192ce_bt_reg_init(hw); 768c2ecf20Sopenharmony_ci 778c2ecf20Sopenharmony_ci rtlpriv->dm.dm_initialgain_enable = true; 788c2ecf20Sopenharmony_ci rtlpriv->dm.dm_flag = 0; 798c2ecf20Sopenharmony_ci rtlpriv->dm.disable_framebursting = false; 808c2ecf20Sopenharmony_ci rtlpriv->dm.thermalvalue = 0; 818c2ecf20Sopenharmony_ci rtlpci->transmit_config = CFENDFORM | BIT(12) | BIT(13); 828c2ecf20Sopenharmony_ci 838c2ecf20Sopenharmony_ci /* compatible 5G band 88ce just 2.4G band & smsp */ 848c2ecf20Sopenharmony_ci rtlpriv->rtlhal.current_bandtype = BAND_ON_2_4G; 858c2ecf20Sopenharmony_ci rtlpriv->rtlhal.bandset = BAND_ON_2_4G; 868c2ecf20Sopenharmony_ci rtlpriv->rtlhal.macphymode = SINGLEMAC_SINGLEPHY; 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci rtlpci->receive_config = (RCR_APPFCS | 898c2ecf20Sopenharmony_ci RCR_AMF | 908c2ecf20Sopenharmony_ci RCR_ADF | 918c2ecf20Sopenharmony_ci RCR_APP_MIC | 928c2ecf20Sopenharmony_ci RCR_APP_ICV | 938c2ecf20Sopenharmony_ci RCR_AICV | 948c2ecf20Sopenharmony_ci RCR_ACRC32 | 958c2ecf20Sopenharmony_ci RCR_AB | 968c2ecf20Sopenharmony_ci RCR_AM | 978c2ecf20Sopenharmony_ci RCR_APM | 988c2ecf20Sopenharmony_ci RCR_APP_PHYST_RXFF | RCR_HTC_LOC_CTRL | 0); 998c2ecf20Sopenharmony_ci 1008c2ecf20Sopenharmony_ci rtlpci->irq_mask[0] = 1018c2ecf20Sopenharmony_ci (u32) (IMR_ROK | 1028c2ecf20Sopenharmony_ci IMR_VODOK | 1038c2ecf20Sopenharmony_ci IMR_VIDOK | 1048c2ecf20Sopenharmony_ci IMR_BEDOK | 1058c2ecf20Sopenharmony_ci IMR_BKDOK | 1068c2ecf20Sopenharmony_ci IMR_MGNTDOK | 1078c2ecf20Sopenharmony_ci IMR_HIGHDOK | IMR_BDOK | IMR_RDU | IMR_RXFOVW | 0); 1088c2ecf20Sopenharmony_ci 1098c2ecf20Sopenharmony_ci rtlpci->irq_mask[1] = (u32) (IMR_CPWM | IMR_C2HCMD | 0); 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ci /* for LPS & IPS */ 1128c2ecf20Sopenharmony_ci rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps; 1138c2ecf20Sopenharmony_ci rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; 1148c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; 1158c2ecf20Sopenharmony_ci if (!rtlpriv->psc.inactiveps) 1168c2ecf20Sopenharmony_ci pr_info("rtl8192ce: Power Save off (module option)\n"); 1178c2ecf20Sopenharmony_ci if (!rtlpriv->psc.fwctrl_lps) 1188c2ecf20Sopenharmony_ci pr_info("rtl8192ce: FW Power Save off (module option)\n"); 1198c2ecf20Sopenharmony_ci rtlpriv->psc.reg_fwctrl_lps = 3; 1208c2ecf20Sopenharmony_ci rtlpriv->psc.reg_max_lps_awakeintvl = 5; 1218c2ecf20Sopenharmony_ci /* for ASPM, you can close aspm through 1228c2ecf20Sopenharmony_ci * set const_support_pciaspm = 0 */ 1238c2ecf20Sopenharmony_ci rtl92c_init_aspm_vars(hw); 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci if (rtlpriv->psc.reg_fwctrl_lps == 1) 1268c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_psmode = FW_PS_MIN_MODE; 1278c2ecf20Sopenharmony_ci else if (rtlpriv->psc.reg_fwctrl_lps == 2) 1288c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_psmode = FW_PS_MAX_MODE; 1298c2ecf20Sopenharmony_ci else if (rtlpriv->psc.reg_fwctrl_lps == 3) 1308c2ecf20Sopenharmony_ci rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE; 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci /* for firmware buf */ 1338c2ecf20Sopenharmony_ci rtlpriv->rtlhal.pfirmware = vzalloc(0x4000); 1348c2ecf20Sopenharmony_ci if (!rtlpriv->rtlhal.pfirmware) { 1358c2ecf20Sopenharmony_ci pr_err("Can't alloc buffer for fw\n"); 1368c2ecf20Sopenharmony_ci return 1; 1378c2ecf20Sopenharmony_ci } 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ci /* request fw */ 1408c2ecf20Sopenharmony_ci if (IS_VENDOR_UMC_A_CUT(rtlhal->version) && 1418c2ecf20Sopenharmony_ci !IS_92C_SERIAL(rtlhal->version)) 1428c2ecf20Sopenharmony_ci fw_name = "rtlwifi/rtl8192cfwU.bin"; 1438c2ecf20Sopenharmony_ci else if (IS_81XXC_VENDOR_UMC_B_CUT(rtlhal->version)) 1448c2ecf20Sopenharmony_ci fw_name = "rtlwifi/rtl8192cfwU_B.bin"; 1458c2ecf20Sopenharmony_ci else 1468c2ecf20Sopenharmony_ci fw_name = "rtlwifi/rtl8192cfw.bin"; 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_ci rtlpriv->max_fw_size = 0x4000; 1498c2ecf20Sopenharmony_ci pr_info("Using firmware %s\n", fw_name); 1508c2ecf20Sopenharmony_ci err = request_firmware_nowait(THIS_MODULE, 1, fw_name, 1518c2ecf20Sopenharmony_ci rtlpriv->io.dev, GFP_KERNEL, hw, 1528c2ecf20Sopenharmony_ci rtl_fw_cb); 1538c2ecf20Sopenharmony_ci if (err) { 1548c2ecf20Sopenharmony_ci pr_err("Failed to request firmware!\n"); 1558c2ecf20Sopenharmony_ci vfree(rtlpriv->rtlhal.pfirmware); 1568c2ecf20Sopenharmony_ci rtlpriv->rtlhal.pfirmware = NULL; 1578c2ecf20Sopenharmony_ci return 1; 1588c2ecf20Sopenharmony_ci } 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci return 0; 1618c2ecf20Sopenharmony_ci} 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_cistatic void rtl92c_deinit_sw_vars(struct ieee80211_hw *hw) 1648c2ecf20Sopenharmony_ci{ 1658c2ecf20Sopenharmony_ci struct rtl_priv *rtlpriv = rtl_priv(hw); 1668c2ecf20Sopenharmony_ci 1678c2ecf20Sopenharmony_ci if (rtlpriv->rtlhal.pfirmware) { 1688c2ecf20Sopenharmony_ci vfree(rtlpriv->rtlhal.pfirmware); 1698c2ecf20Sopenharmony_ci rtlpriv->rtlhal.pfirmware = NULL; 1708c2ecf20Sopenharmony_ci } 1718c2ecf20Sopenharmony_ci} 1728c2ecf20Sopenharmony_ci 1738c2ecf20Sopenharmony_cistatic struct rtl_hal_ops rtl8192ce_hal_ops = { 1748c2ecf20Sopenharmony_ci .init_sw_vars = rtl92c_init_sw_vars, 1758c2ecf20Sopenharmony_ci .deinit_sw_vars = rtl92c_deinit_sw_vars, 1768c2ecf20Sopenharmony_ci .read_eeprom_info = rtl92ce_read_eeprom_info, 1778c2ecf20Sopenharmony_ci .interrupt_recognized = rtl92ce_interrupt_recognized, 1788c2ecf20Sopenharmony_ci .hw_init = rtl92ce_hw_init, 1798c2ecf20Sopenharmony_ci .hw_disable = rtl92ce_card_disable, 1808c2ecf20Sopenharmony_ci .hw_suspend = rtl92ce_suspend, 1818c2ecf20Sopenharmony_ci .hw_resume = rtl92ce_resume, 1828c2ecf20Sopenharmony_ci .enable_interrupt = rtl92ce_enable_interrupt, 1838c2ecf20Sopenharmony_ci .disable_interrupt = rtl92ce_disable_interrupt, 1848c2ecf20Sopenharmony_ci .set_network_type = rtl92ce_set_network_type, 1858c2ecf20Sopenharmony_ci .set_chk_bssid = rtl92ce_set_check_bssid, 1868c2ecf20Sopenharmony_ci .set_qos = rtl92ce_set_qos, 1878c2ecf20Sopenharmony_ci .set_bcn_reg = rtl92ce_set_beacon_related_registers, 1888c2ecf20Sopenharmony_ci .set_bcn_intv = rtl92ce_set_beacon_interval, 1898c2ecf20Sopenharmony_ci .update_interrupt_mask = rtl92ce_update_interrupt_mask, 1908c2ecf20Sopenharmony_ci .get_hw_reg = rtl92ce_get_hw_reg, 1918c2ecf20Sopenharmony_ci .set_hw_reg = rtl92ce_set_hw_reg, 1928c2ecf20Sopenharmony_ci .update_rate_tbl = rtl92ce_update_hal_rate_tbl, 1938c2ecf20Sopenharmony_ci .fill_tx_desc = rtl92ce_tx_fill_desc, 1948c2ecf20Sopenharmony_ci .fill_tx_cmddesc = rtl92ce_tx_fill_cmddesc, 1958c2ecf20Sopenharmony_ci .query_rx_desc = rtl92ce_rx_query_desc, 1968c2ecf20Sopenharmony_ci .set_channel_access = rtl92ce_update_channel_access_setting, 1978c2ecf20Sopenharmony_ci .radio_onoff_checking = rtl92ce_gpio_radio_on_off_checking, 1988c2ecf20Sopenharmony_ci .set_bw_mode = rtl92c_phy_set_bw_mode, 1998c2ecf20Sopenharmony_ci .switch_channel = rtl92c_phy_sw_chnl, 2008c2ecf20Sopenharmony_ci .dm_watchdog = rtl92c_dm_watchdog, 2018c2ecf20Sopenharmony_ci .scan_operation_backup = rtl_phy_scan_operation_backup, 2028c2ecf20Sopenharmony_ci .set_rf_power_state = rtl92c_phy_set_rf_power_state, 2038c2ecf20Sopenharmony_ci .led_control = rtl92ce_led_control, 2048c2ecf20Sopenharmony_ci .set_desc = rtl92ce_set_desc, 2058c2ecf20Sopenharmony_ci .get_desc = rtl92ce_get_desc, 2068c2ecf20Sopenharmony_ci .is_tx_desc_closed = rtl92ce_is_tx_desc_closed, 2078c2ecf20Sopenharmony_ci .tx_polling = rtl92ce_tx_polling, 2088c2ecf20Sopenharmony_ci .enable_hw_sec = rtl92ce_enable_hw_security_config, 2098c2ecf20Sopenharmony_ci .set_key = rtl92ce_set_key, 2108c2ecf20Sopenharmony_ci .init_sw_leds = rtl92ce_init_sw_leds, 2118c2ecf20Sopenharmony_ci .get_bbreg = rtl92c_phy_query_bb_reg, 2128c2ecf20Sopenharmony_ci .set_bbreg = rtl92c_phy_set_bb_reg, 2138c2ecf20Sopenharmony_ci .set_rfreg = rtl92ce_phy_set_rf_reg, 2148c2ecf20Sopenharmony_ci .get_rfreg = rtl92c_phy_query_rf_reg, 2158c2ecf20Sopenharmony_ci .phy_rf6052_config = rtl92ce_phy_rf6052_config, 2168c2ecf20Sopenharmony_ci .phy_rf6052_set_cck_txpower = rtl92ce_phy_rf6052_set_cck_txpower, 2178c2ecf20Sopenharmony_ci .phy_rf6052_set_ofdm_txpower = rtl92ce_phy_rf6052_set_ofdm_txpower, 2188c2ecf20Sopenharmony_ci .config_bb_with_headerfile = _rtl92ce_phy_config_bb_with_headerfile, 2198c2ecf20Sopenharmony_ci .config_bb_with_pgheaderfile = _rtl92ce_phy_config_bb_with_pgheaderfile, 2208c2ecf20Sopenharmony_ci .phy_lc_calibrate = _rtl92ce_phy_lc_calibrate, 2218c2ecf20Sopenharmony_ci .phy_set_bw_mode_callback = rtl92ce_phy_set_bw_mode_callback, 2228c2ecf20Sopenharmony_ci .dm_dynamic_txpower = rtl92ce_dm_dynamic_txpower, 2238c2ecf20Sopenharmony_ci .get_btc_status = rtl_btc_status_false, 2248c2ecf20Sopenharmony_ci}; 2258c2ecf20Sopenharmony_ci 2268c2ecf20Sopenharmony_cistatic struct rtl_mod_params rtl92ce_mod_params = { 2278c2ecf20Sopenharmony_ci .sw_crypto = false, 2288c2ecf20Sopenharmony_ci .inactiveps = true, 2298c2ecf20Sopenharmony_ci .swctrl_lps = false, 2308c2ecf20Sopenharmony_ci .fwctrl_lps = true, 2318c2ecf20Sopenharmony_ci .aspm_support = 1, 2328c2ecf20Sopenharmony_ci .debug_level = 0, 2338c2ecf20Sopenharmony_ci .debug_mask = 0, 2348c2ecf20Sopenharmony_ci}; 2358c2ecf20Sopenharmony_ci 2368c2ecf20Sopenharmony_cistatic const struct rtl_hal_cfg rtl92ce_hal_cfg = { 2378c2ecf20Sopenharmony_ci .bar_id = 2, 2388c2ecf20Sopenharmony_ci .write_readback = true, 2398c2ecf20Sopenharmony_ci .name = "rtl92c_pci", 2408c2ecf20Sopenharmony_ci .ops = &rtl8192ce_hal_ops, 2418c2ecf20Sopenharmony_ci .mod_params = &rtl92ce_mod_params, 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci .maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL, 2448c2ecf20Sopenharmony_ci .maps[SYS_FUNC_EN] = REG_SYS_FUNC_EN, 2458c2ecf20Sopenharmony_ci .maps[SYS_CLK] = REG_SYS_CLKR, 2468c2ecf20Sopenharmony_ci .maps[MAC_RCR_AM] = AM, 2478c2ecf20Sopenharmony_ci .maps[MAC_RCR_AB] = AB, 2488c2ecf20Sopenharmony_ci .maps[MAC_RCR_ACRC32] = ACRC32, 2498c2ecf20Sopenharmony_ci .maps[MAC_RCR_ACF] = ACF, 2508c2ecf20Sopenharmony_ci .maps[MAC_RCR_AAP] = AAP, 2518c2ecf20Sopenharmony_ci .maps[MAC_HIMR] = REG_HIMR, 2528c2ecf20Sopenharmony_ci .maps[MAC_HIMRE] = REG_HIMRE, 2538c2ecf20Sopenharmony_ci 2548c2ecf20Sopenharmony_ci .maps[EFUSE_TEST] = REG_EFUSE_TEST, 2558c2ecf20Sopenharmony_ci .maps[EFUSE_CTRL] = REG_EFUSE_CTRL, 2568c2ecf20Sopenharmony_ci .maps[EFUSE_CLK] = 0, 2578c2ecf20Sopenharmony_ci .maps[EFUSE_CLK_CTRL] = REG_EFUSE_CTRL, 2588c2ecf20Sopenharmony_ci .maps[EFUSE_PWC_EV12V] = PWC_EV12V, 2598c2ecf20Sopenharmony_ci .maps[EFUSE_FEN_ELDR] = FEN_ELDR, 2608c2ecf20Sopenharmony_ci .maps[EFUSE_LOADER_CLK_EN] = LOADER_CLK_EN, 2618c2ecf20Sopenharmony_ci .maps[EFUSE_ANA8M] = EFUSE_ANA8M, 2628c2ecf20Sopenharmony_ci .maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE, 2638c2ecf20Sopenharmony_ci .maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION, 2648c2ecf20Sopenharmony_ci .maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN, 2658c2ecf20Sopenharmony_ci .maps[EFUSE_OOB_PROTECT_BYTES_LEN] = EFUSE_OOB_PROTECT_BYTES, 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci .maps[RWCAM] = REG_CAMCMD, 2688c2ecf20Sopenharmony_ci .maps[WCAMI] = REG_CAMWRITE, 2698c2ecf20Sopenharmony_ci .maps[RCAMO] = REG_CAMREAD, 2708c2ecf20Sopenharmony_ci .maps[CAMDBG] = REG_CAMDBG, 2718c2ecf20Sopenharmony_ci .maps[SECR] = REG_SECCFG, 2728c2ecf20Sopenharmony_ci .maps[SEC_CAM_NONE] = CAM_NONE, 2738c2ecf20Sopenharmony_ci .maps[SEC_CAM_WEP40] = CAM_WEP40, 2748c2ecf20Sopenharmony_ci .maps[SEC_CAM_TKIP] = CAM_TKIP, 2758c2ecf20Sopenharmony_ci .maps[SEC_CAM_AES] = CAM_AES, 2768c2ecf20Sopenharmony_ci .maps[SEC_CAM_WEP104] = CAM_WEP104, 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT6] = IMR_BCNDMAINT6, 2798c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT5] = IMR_BCNDMAINT5, 2808c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT4] = IMR_BCNDMAINT4, 2818c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT3] = IMR_BCNDMAINT3, 2828c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT2] = IMR_BCNDMAINT2, 2838c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDMAINT1] = IMR_BCNDMAINT1, 2848c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK8] = IMR_BCNDOK8, 2858c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK7] = IMR_BCNDOK7, 2868c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK6] = IMR_BCNDOK6, 2878c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK5] = IMR_BCNDOK5, 2888c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK4] = IMR_BCNDOK4, 2898c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK3] = IMR_BCNDOK3, 2908c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK2] = IMR_BCNDOK2, 2918c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNDOK1] = IMR_BCNDOK1, 2928c2ecf20Sopenharmony_ci .maps[RTL_IMR_TIMEOUT2] = IMR_TIMEOUT2, 2938c2ecf20Sopenharmony_ci .maps[RTL_IMR_TIMEOUT1] = IMR_TIMEOUT1, 2948c2ecf20Sopenharmony_ci 2958c2ecf20Sopenharmony_ci .maps[RTL_IMR_TXFOVW] = IMR_TXFOVW, 2968c2ecf20Sopenharmony_ci .maps[RTL_IMR_PSTIMEOUT] = IMR_PSTIMEOUT, 2978c2ecf20Sopenharmony_ci .maps[RTL_IMR_BCNINT] = IMR_BCNINT, 2988c2ecf20Sopenharmony_ci .maps[RTL_IMR_RXFOVW] = IMR_RXFOVW, 2998c2ecf20Sopenharmony_ci .maps[RTL_IMR_RDU] = IMR_RDU, 3008c2ecf20Sopenharmony_ci .maps[RTL_IMR_ATIMEND] = IMR_ATIMEND, 3018c2ecf20Sopenharmony_ci .maps[RTL_IMR_BDOK] = IMR_BDOK, 3028c2ecf20Sopenharmony_ci .maps[RTL_IMR_MGNTDOK] = IMR_MGNTDOK, 3038c2ecf20Sopenharmony_ci .maps[RTL_IMR_TBDER] = IMR_TBDER, 3048c2ecf20Sopenharmony_ci .maps[RTL_IMR_HIGHDOK] = IMR_HIGHDOK, 3058c2ecf20Sopenharmony_ci .maps[RTL_IMR_TBDOK] = IMR_TBDOK, 3068c2ecf20Sopenharmony_ci .maps[RTL_IMR_BKDOK] = IMR_BKDOK, 3078c2ecf20Sopenharmony_ci .maps[RTL_IMR_BEDOK] = IMR_BEDOK, 3088c2ecf20Sopenharmony_ci .maps[RTL_IMR_VIDOK] = IMR_VIDOK, 3098c2ecf20Sopenharmony_ci .maps[RTL_IMR_VODOK] = IMR_VODOK, 3108c2ecf20Sopenharmony_ci .maps[RTL_IMR_ROK] = IMR_ROK, 3118c2ecf20Sopenharmony_ci .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNINT | IMR_TBDOK | IMR_TBDER), 3128c2ecf20Sopenharmony_ci 3138c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE1M] = DESC_RATE1M, 3148c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE2M] = DESC_RATE2M, 3158c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE5_5M] = DESC_RATE5_5M, 3168c2ecf20Sopenharmony_ci .maps[RTL_RC_CCK_RATE11M] = DESC_RATE11M, 3178c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE6M] = DESC_RATE6M, 3188c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE9M] = DESC_RATE9M, 3198c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE12M] = DESC_RATE12M, 3208c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE18M] = DESC_RATE18M, 3218c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE24M] = DESC_RATE24M, 3228c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE36M] = DESC_RATE36M, 3238c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE48M] = DESC_RATE48M, 3248c2ecf20Sopenharmony_ci .maps[RTL_RC_OFDM_RATE54M] = DESC_RATE54M, 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_ci .maps[RTL_RC_HT_RATEMCS7] = DESC_RATEMCS7, 3278c2ecf20Sopenharmony_ci .maps[RTL_RC_HT_RATEMCS15] = DESC_RATEMCS15, 3288c2ecf20Sopenharmony_ci}; 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_cistatic const struct pci_device_id rtl92ce_pci_ids[] = { 3318c2ecf20Sopenharmony_ci {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8191, rtl92ce_hal_cfg)}, 3328c2ecf20Sopenharmony_ci {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8178, rtl92ce_hal_cfg)}, 3338c2ecf20Sopenharmony_ci {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8177, rtl92ce_hal_cfg)}, 3348c2ecf20Sopenharmony_ci {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8176, rtl92ce_hal_cfg)}, 3358c2ecf20Sopenharmony_ci {}, 3368c2ecf20Sopenharmony_ci}; 3378c2ecf20Sopenharmony_ci 3388c2ecf20Sopenharmony_ciMODULE_DEVICE_TABLE(pci, rtl92ce_pci_ids); 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_ciMODULE_AUTHOR("lizhaoming <chaoming_li@realsil.com.cn>"); 3418c2ecf20Sopenharmony_ciMODULE_AUTHOR("Realtek WlanFAE <wlanfae@realtek.com>"); 3428c2ecf20Sopenharmony_ciMODULE_AUTHOR("Larry Finger <Larry.Finger@lwfinger.net>"); 3438c2ecf20Sopenharmony_ciMODULE_LICENSE("GPL"); 3448c2ecf20Sopenharmony_ciMODULE_DESCRIPTION("Realtek 8192C/8188C 802.11n PCI wireless"); 3458c2ecf20Sopenharmony_ciMODULE_FIRMWARE("rtlwifi/rtl8192cfw.bin"); 3468c2ecf20Sopenharmony_ciMODULE_FIRMWARE("rtlwifi/rtl8192cfwU.bin"); 3478c2ecf20Sopenharmony_ciMODULE_FIRMWARE("rtlwifi/rtl8192cfwU_B.bin"); 3488c2ecf20Sopenharmony_ci 3498c2ecf20Sopenharmony_cimodule_param_named(swenc, rtl92ce_mod_params.sw_crypto, bool, 0444); 3508c2ecf20Sopenharmony_cimodule_param_named(debug_level, rtl92ce_mod_params.debug_level, int, 0644); 3518c2ecf20Sopenharmony_cimodule_param_named(debug_mask, rtl92ce_mod_params.debug_mask, ullong, 0644); 3528c2ecf20Sopenharmony_cimodule_param_named(ips, rtl92ce_mod_params.inactiveps, bool, 0444); 3538c2ecf20Sopenharmony_cimodule_param_named(swlps, rtl92ce_mod_params.swctrl_lps, bool, 0444); 3548c2ecf20Sopenharmony_cimodule_param_named(fwlps, rtl92ce_mod_params.fwctrl_lps, bool, 0444); 3558c2ecf20Sopenharmony_cimodule_param_named(aspm, rtl92ce_mod_params.aspm_support, int, 0444); 3568c2ecf20Sopenharmony_ciMODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); 3578c2ecf20Sopenharmony_ciMODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); 3588c2ecf20Sopenharmony_ciMODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); 3598c2ecf20Sopenharmony_ciMODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); 3608c2ecf20Sopenharmony_ciMODULE_PARM_DESC(aspm, "Set to 1 to enable ASPM (default 1)\n"); 3618c2ecf20Sopenharmony_ciMODULE_PARM_DESC(debug_level, "Set debug level (0-5) (default 0)"); 3628c2ecf20Sopenharmony_ciMODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)"); 3638c2ecf20Sopenharmony_ci 3648c2ecf20Sopenharmony_cistatic SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); 3658c2ecf20Sopenharmony_ci 3668c2ecf20Sopenharmony_cistatic struct pci_driver rtl92ce_driver = { 3678c2ecf20Sopenharmony_ci .name = KBUILD_MODNAME, 3688c2ecf20Sopenharmony_ci .id_table = rtl92ce_pci_ids, 3698c2ecf20Sopenharmony_ci .probe = rtl_pci_probe, 3708c2ecf20Sopenharmony_ci .remove = rtl_pci_disconnect, 3718c2ecf20Sopenharmony_ci .driver.pm = &rtlwifi_pm_ops, 3728c2ecf20Sopenharmony_ci}; 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_cimodule_pci_driver(rtl92ce_driver); 375