xref: /linux/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/sw.c (revision 7f71507851fc7764b36a3221839607d3a45c2025)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2009-2010  Realtek Corporation.*/
3 
4 #include "../wifi.h"
5 #include "../core.h"
6 #include "../pci.h"
7 #include "reg.h"
8 #include "def.h"
9 #include "phy.h"
10 #include "dm.h"
11 #include "hw.h"
12 #include "fw.h"
13 #include "trx.h"
14 #include "led.h"
15 #include "table.h"
16 #include "../btcoexist/rtl_btc.h"
17 
18 #include <linux/vmalloc.h>
19 #include <linux/module.h>
20 
21 static void rtl8821ae_init_aspm_vars(struct ieee80211_hw *hw)
22 {
23 	struct rtl_priv *rtlpriv = rtl_priv(hw);
24 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
25 
26 	/**
27 	 * ASPM PS mode.
28 	 * 0 - Disable ASPM,
29 	 * 1 - Enable ASPM without Clock Req,
30 	 * 2 - Enable ASPM with Clock Req,
31 	 * 3 - Alwyas Enable ASPM with Clock Req,
32 	 * 4 - Always Enable ASPM without Clock Req.
33 	 * set default to RTL8192CE:3 RTL8192E:2
34 	 */
35 	rtlpci->const_pci_aspm = 3;
36 
37 	/*Setting for PCI-E device */
38 	rtlpci->const_devicepci_aspm_setting = 0x03;
39 
40 	/*Setting for PCI-E bridge */
41 	rtlpci->const_hostpci_aspm_setting = 0x02;
42 
43 	/**
44 	 * In Hw/Sw Radio Off situation.
45 	 * 0 - Default,
46 	 * 1 - From ASPM setting without low Mac Pwr,
47 	 * 2 - From ASPM setting with low Mac Pwr,
48 	 * 3 - Bus D3
49 	 * set default to RTL8192CE:0 RTL8192SE:2
50 	 */
51 	rtlpci->const_hwsw_rfoff_d3 = 0;
52 
53 	/**
54 	 * This setting works for those device with
55 	 * backdoor ASPM setting such as EPHY setting.
56 	 * 0 - Not support ASPM,
57 	 * 1 - Support ASPM,
58 	 * 2 - According to chipset.
59 	 */
60 	rtlpci->const_support_pciaspm = rtlpriv->cfg->mod_params->aspm_support;
61 }
62 
63 /*InitializeVariables8812E*/
64 static int rtl8821ae_init_sw_vars(struct ieee80211_hw *hw)
65 {
66 	int err = 0;
67 	struct rtl_priv *rtlpriv = rtl_priv(hw);
68 	struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
69 	struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
70 	struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
71 	char *fw_name, *wowlan_fw_name;
72 
73 	rtl8821ae_bt_reg_init(hw);
74 	rtlpriv->btcoexist.btc_ops = rtl_btc_get_ops_pointer();
75 
76 	rtlpriv->dm.dm_initialgain_enable = true;
77 	rtlpriv->dm.dm_flag = 0;
78 	rtlpriv->dm.disable_framebursting = false;
79 	rtlpriv->dm.thermalvalue = 0;
80 	rtlpci->transmit_config = CFENDFORM | BIT(15) | BIT(24) | BIT(25);
81 
82 	mac->ht_enable = true;
83 	mac->ht_cur_stbc = 0;
84 	mac->ht_stbc_cap = 0;
85 	mac->vht_cur_ldpc = 0;
86 	mac->vht_ldpc_cap = 0;
87 	mac->vht_cur_stbc = 0;
88 	mac->vht_stbc_cap = 0;
89 
90 	rtlpriv->rtlhal.current_bandtype = BAND_ON_2_4G;
91 	/*following 2 is for register 5G band, refer to _rtl_init_mac80211()*/
92 	rtlpriv->rtlhal.bandset = BAND_ON_BOTH;
93 	rtlpriv->rtlhal.macphymode = SINGLEMAC_SINGLEPHY;
94 
95 	rtlpci->receive_config = (RCR_APPFCS	|
96 				RCR_APP_MIC		|
97 				RCR_APP_ICV		|
98 				RCR_APP_PHYST_RXFF	|
99 				RCR_NONQOS_VHT		|
100 				RCR_HTC_LOC_CTRL	|
101 				RCR_AMF			|
102 				RCR_ACF			|
103 			/*This bit controls the PS-Poll packet filter.*/
104 				RCR_ADF			|
105 				RCR_AICV		|
106 				RCR_ACRC32		|
107 				RCR_AB			|
108 				RCR_AM			|
109 				RCR_APM			|
110 				0);
111 
112 	rtlpci->irq_mask[0] =
113 	     (u32)(IMR_PSTIMEOUT			|
114 				IMR_GTINT3		|
115 				IMR_HSISR_IND_ON_INT	|
116 				IMR_C2HCMD		|
117 				IMR_HIGHDOK		|
118 				IMR_MGNTDOK		|
119 				IMR_BKDOK		|
120 				IMR_BEDOK		|
121 				IMR_VIDOK		|
122 				IMR_VODOK		|
123 				IMR_RDU			|
124 				IMR_ROK			|
125 				0);
126 
127 	rtlpci->irq_mask[1]	=
128 		 (u32)(IMR_RXFOVW |
129 				IMR_TXFOVW |
130 				0);
131 	rtlpci->sys_irq_mask = (u32)(HSIMR_PDN_INT_EN	|
132 				      HSIMR_RON_INT_EN	|
133 				      0);
134 	/* for WOWLAN */
135 	rtlpriv->psc.wo_wlan_mode = WAKE_ON_MAGIC_PACKET |
136 				    WAKE_ON_PATTERN_MATCH;
137 
138 	/* for LPS & IPS */
139 	rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps;
140 	rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps;
141 	rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps;
142 	rtlpci->msi_support = rtlpriv->cfg->mod_params->msi_support;
143 	rtlpci->int_clear = rtlpriv->cfg->mod_params->int_clear;
144 	if (rtlpriv->cfg->mod_params->disable_watchdog)
145 		pr_info("watchdog disabled\n");
146 	rtlpriv->psc.reg_fwctrl_lps = 2;
147 	rtlpriv->psc.reg_max_lps_awakeintvl = 2;
148 
149 	/* for ASPM, you can close aspm through
150 	 * set const_support_pciaspm = 0
151 	 */
152 	rtl8821ae_init_aspm_vars(hw);
153 
154 	if (rtlpriv->psc.reg_fwctrl_lps == 1)
155 		rtlpriv->psc.fwctrl_psmode = FW_PS_MIN_MODE;
156 	else if (rtlpriv->psc.reg_fwctrl_lps == 2)
157 		rtlpriv->psc.fwctrl_psmode = FW_PS_MAX_MODE;
158 	else if (rtlpriv->psc.reg_fwctrl_lps == 3)
159 		rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE;
160 
161 	/* for firmware buf */
162 	rtlpriv->rtlhal.pfirmware = vzalloc(0x8000);
163 	if (!rtlpriv->rtlhal.pfirmware) {
164 		pr_err("Can't alloc buffer for fw.\n");
165 		return 1;
166 	}
167 	rtlpriv->rtlhal.wowlan_firmware = vzalloc(0x8000);
168 	if (!rtlpriv->rtlhal.wowlan_firmware) {
169 		pr_err("Can't alloc buffer for wowlan fw.\n");
170 		vfree(rtlpriv->rtlhal.pfirmware);
171 		rtlpriv->rtlhal.pfirmware = NULL;
172 		return 1;
173 	}
174 
175 	if (rtlhal->hw_type == HARDWARE_TYPE_RTL8812AE) {
176 		fw_name = "rtlwifi/rtl8812aefw.bin";
177 		wowlan_fw_name = "rtlwifi/rtl8812aefw_wowlan.bin";
178 	} else {
179 		fw_name = "rtlwifi/rtl8821aefw_29.bin";
180 		wowlan_fw_name = "rtlwifi/rtl8821aefw_wowlan.bin";
181 	}
182 
183 	rtlpriv->max_fw_size = 0x8000;
184 	/*load normal firmware*/
185 	pr_info("Using firmware %s\n", fw_name);
186 	err = request_firmware_nowait(THIS_MODULE, 1, fw_name,
187 				      rtlpriv->io.dev, GFP_KERNEL, hw,
188 				      rtl_fw_cb);
189 	if (err) {
190 		pr_err("Failed to request normal firmware!\n");
191 		vfree(rtlpriv->rtlhal.wowlan_firmware);
192 		vfree(rtlpriv->rtlhal.pfirmware);
193 		return 1;
194 	}
195 	/*load wowlan firmware*/
196 	pr_info("Using firmware %s\n", wowlan_fw_name);
197 	err = request_firmware_nowait(THIS_MODULE, 1,
198 				      wowlan_fw_name,
199 				      rtlpriv->io.dev, GFP_KERNEL, hw,
200 				      rtl_wowlan_fw_cb);
201 	if (err) {
202 		pr_err("Failed to request wowlan firmware!\n");
203 		vfree(rtlpriv->rtlhal.wowlan_firmware);
204 		vfree(rtlpriv->rtlhal.pfirmware);
205 		return 1;
206 	}
207 	return 0;
208 }
209 
210 static void rtl8821ae_deinit_sw_vars(struct ieee80211_hw *hw)
211 {
212 	struct rtl_priv *rtlpriv = rtl_priv(hw);
213 
214 	if (rtlpriv->rtlhal.pfirmware) {
215 		vfree(rtlpriv->rtlhal.pfirmware);
216 		rtlpriv->rtlhal.pfirmware = NULL;
217 	}
218 #if (USE_SPECIFIC_FW_TO_SUPPORT_WOWLAN == 1)
219 	if (rtlpriv->rtlhal.wowlan_firmware) {
220 		vfree(rtlpriv->rtlhal.wowlan_firmware);
221 		rtlpriv->rtlhal.wowlan_firmware = NULL;
222 	}
223 #endif
224 }
225 
226 /* get bt coexist status */
227 static bool rtl8821ae_get_btc_status(void)
228 {
229 	return true;
230 }
231 
232 static struct rtl_hal_ops rtl8821ae_hal_ops = {
233 	.init_sw_vars = rtl8821ae_init_sw_vars,
234 	.deinit_sw_vars = rtl8821ae_deinit_sw_vars,
235 	.read_eeprom_info = rtl8821ae_read_eeprom_info,
236 	.interrupt_recognized = rtl8821ae_interrupt_recognized,
237 	.hw_init = rtl8821ae_hw_init,
238 	.hw_disable = rtl8821ae_card_disable,
239 	.hw_suspend = rtl8821ae_suspend,
240 	.hw_resume = rtl8821ae_resume,
241 	.enable_interrupt = rtl8821ae_enable_interrupt,
242 	.disable_interrupt = rtl8821ae_disable_interrupt,
243 	.set_network_type = rtl8821ae_set_network_type,
244 	.set_chk_bssid = rtl8821ae_set_check_bssid,
245 	.set_qos = rtl8821ae_set_qos,
246 	.set_bcn_reg = rtl8821ae_set_beacon_related_registers,
247 	.set_bcn_intv = rtl8821ae_set_beacon_interval,
248 	.update_interrupt_mask = rtl8821ae_update_interrupt_mask,
249 	.get_hw_reg = rtl8821ae_get_hw_reg,
250 	.set_hw_reg = rtl8821ae_set_hw_reg,
251 	.update_rate_tbl = rtl8821ae_update_hal_rate_tbl,
252 	.fill_tx_desc = rtl8821ae_tx_fill_desc,
253 	.fill_tx_cmddesc = rtl8821ae_tx_fill_cmddesc,
254 	.query_rx_desc = rtl8821ae_rx_query_desc,
255 	.set_channel_access = rtl8821ae_update_channel_access_setting,
256 	.radio_onoff_checking = rtl8821ae_gpio_radio_on_off_checking,
257 	.set_bw_mode = rtl8821ae_phy_set_bw_mode,
258 	.switch_channel = rtl8821ae_phy_sw_chnl,
259 	.dm_watchdog = rtl8821ae_dm_watchdog,
260 	.scan_operation_backup = rtl8821ae_phy_scan_operation_backup,
261 	.set_rf_power_state = rtl8821ae_phy_set_rf_power_state,
262 	.led_control = rtl8821ae_led_control,
263 	.set_desc = rtl8821ae_set_desc,
264 	.get_desc = rtl8821ae_get_desc,
265 	.is_tx_desc_closed = rtl8821ae_is_tx_desc_closed,
266 	.tx_polling = rtl8821ae_tx_polling,
267 	.enable_hw_sec = rtl8821ae_enable_hw_security_config,
268 	.set_key = rtl8821ae_set_key,
269 	.get_bbreg = rtl8821ae_phy_query_bb_reg,
270 	.set_bbreg = rtl8821ae_phy_set_bb_reg,
271 	.get_rfreg = rtl8821ae_phy_query_rf_reg,
272 	.set_rfreg = rtl8821ae_phy_set_rf_reg,
273 	.fill_h2c_cmd = rtl8821ae_fill_h2c_cmd,
274 	.get_btc_status = rtl8821ae_get_btc_status,
275 	.c2h_ra_report_handler = rtl8821ae_c2h_ra_report_handler,
276 	.add_wowlan_pattern = rtl8821ae_add_wowlan_pattern,
277 };
278 
279 static struct rtl_mod_params rtl8821ae_mod_params = {
280 	.sw_crypto = false,
281 	.inactiveps = true,
282 	.swctrl_lps = false,
283 	.fwctrl_lps = true,
284 	.msi_support = true,
285 	.aspm_support = 1,
286 	.int_clear = true,
287 	.debug_level = 0,
288 	.debug_mask = 0,
289 	.disable_watchdog = 0,
290 };
291 
292 static const struct rtl_hal_cfg rtl8821ae_hal_cfg = {
293 	.bar_id = 2,
294 	.write_readback = true,
295 	.name = "rtl8821ae_pci",
296 	.alt_fw_name = "rtlwifi/rtl8821aefw.bin",
297 	.ops = &rtl8821ae_hal_ops,
298 	.mod_params = &rtl8821ae_mod_params,
299 	.spec_ver = RTL_SPEC_SUPPORT_VHT,
300 	.maps[SYS_ISO_CTRL] = REG_SYS_ISO_CTRL,
301 	.maps[SYS_FUNC_EN] = REG_SYS_FUNC_EN,
302 	.maps[SYS_CLK] = REG_SYS_CLKR,
303 	.maps[MAC_RCR_AM] = AM,
304 	.maps[MAC_RCR_AB] = AB,
305 	.maps[MAC_RCR_ACRC32] = ACRC32,
306 	.maps[MAC_RCR_ACF] = ACF,
307 	.maps[MAC_RCR_AAP] = AAP,
308 	.maps[MAC_HIMR] = REG_HIMR,
309 	.maps[MAC_HIMRE] = REG_HIMRE,
310 
311 	.maps[EFUSE_ACCESS] = REG_EFUSE_ACCESS,
312 
313 	.maps[EFUSE_TEST] = REG_EFUSE_TEST,
314 	.maps[EFUSE_CTRL] = REG_EFUSE_CTRL,
315 	.maps[EFUSE_CLK] = 0,
316 	.maps[EFUSE_CLK_CTRL] = REG_EFUSE_CTRL,
317 	.maps[EFUSE_PWC_EV12V] = PWC_EV12V,
318 	.maps[EFUSE_FEN_ELDR] = FEN_ELDR,
319 	.maps[EFUSE_LOADER_CLK_EN] = LOADER_CLK_EN,
320 	.maps[EFUSE_ANA8M] = ANA8M,
321 	.maps[EFUSE_HWSET_MAX_SIZE] = HWSET_MAX_SIZE,
322 	.maps[EFUSE_MAX_SECTION_MAP] = EFUSE_MAX_SECTION,
323 	.maps[EFUSE_REAL_CONTENT_SIZE] = EFUSE_REAL_CONTENT_LEN,
324 	.maps[EFUSE_OOB_PROTECT_BYTES_LEN] = EFUSE_OOB_PROTECT_BYTES,
325 
326 	.maps[RWCAM] = REG_CAMCMD,
327 	.maps[WCAMI] = REG_CAMWRITE,
328 	.maps[RCAMO] = REG_CAMREAD,
329 	.maps[CAMDBG] = REG_CAMDBG,
330 	.maps[SECR] = REG_SECCFG,
331 	.maps[SEC_CAM_NONE] = CAM_NONE,
332 	.maps[SEC_CAM_WEP40] = CAM_WEP40,
333 	.maps[SEC_CAM_TKIP] = CAM_TKIP,
334 	.maps[SEC_CAM_AES] = CAM_AES,
335 	.maps[SEC_CAM_WEP104] = CAM_WEP104,
336 
337 	.maps[RTL_IMR_BCNDMAINT6] = IMR_BCNDMAINT6,
338 	.maps[RTL_IMR_BCNDMAINT5] = IMR_BCNDMAINT5,
339 	.maps[RTL_IMR_BCNDMAINT4] = IMR_BCNDMAINT4,
340 	.maps[RTL_IMR_BCNDMAINT3] = IMR_BCNDMAINT3,
341 	.maps[RTL_IMR_BCNDMAINT2] = IMR_BCNDMAINT2,
342 	.maps[RTL_IMR_BCNDMAINT1] = IMR_BCNDMAINT1,
343 /*	.maps[RTL_IMR_BCNDOK8] = IMR_BCNDOK8,     */   /*need check*/
344 	.maps[RTL_IMR_BCNDOK7] = IMR_BCNDOK7,
345 	.maps[RTL_IMR_BCNDOK6] = IMR_BCNDOK6,
346 	.maps[RTL_IMR_BCNDOK5] = IMR_BCNDOK5,
347 	.maps[RTL_IMR_BCNDOK4] = IMR_BCNDOK4,
348 	.maps[RTL_IMR_BCNDOK3] = IMR_BCNDOK3,
349 	.maps[RTL_IMR_BCNDOK2] = IMR_BCNDOK2,
350 	.maps[RTL_IMR_BCNDOK1] = IMR_BCNDOK1,
351 /*	.maps[RTL_IMR_TIMEOUT2] = IMR_TIMEOUT2,*/
352 /*	.maps[RTL_IMR_TIMEOUT1] = IMR_TIMEOUT1,*/
353 
354 	.maps[RTL_IMR_TXFOVW] = IMR_TXFOVW,
355 	.maps[RTL_IMR_PSTIMEOUT] = IMR_PSTIMEOUT,
356 	.maps[RTL_IMR_BCNINT] = IMR_BCNDMAINT0,
357 	.maps[RTL_IMR_RXFOVW] = IMR_RXFOVW,
358 	.maps[RTL_IMR_RDU] = IMR_RDU,
359 	.maps[RTL_IMR_ATIMEND] = IMR_ATIMEND,
360 	.maps[RTL_IMR_BDOK] = IMR_BCNDOK0,
361 	.maps[RTL_IMR_MGNTDOK] = IMR_MGNTDOK,
362 	.maps[RTL_IMR_TBDER] = IMR_TBDER,
363 	.maps[RTL_IMR_HIGHDOK] = IMR_HIGHDOK,
364 	.maps[RTL_IMR_TBDOK] = IMR_TBDOK,
365 	.maps[RTL_IMR_BKDOK] = IMR_BKDOK,
366 	.maps[RTL_IMR_BEDOK] = IMR_BEDOK,
367 	.maps[RTL_IMR_VIDOK] = IMR_VIDOK,
368 	.maps[RTL_IMR_VODOK] = IMR_VODOK,
369 	.maps[RTL_IMR_ROK] = IMR_ROK,
370 	.maps[RTL_IBSS_INT_MASKS] = (IMR_BCNDMAINT0 | IMR_TBDOK | IMR_TBDER),
371 
372 	.maps[RTL_RC_CCK_RATE1M] = DESC_RATE1M,
373 	.maps[RTL_RC_CCK_RATE2M] =  DESC_RATE2M,
374 	.maps[RTL_RC_CCK_RATE5_5M] =  DESC_RATE5_5M,
375 	.maps[RTL_RC_CCK_RATE11M] =  DESC_RATE11M,
376 	.maps[RTL_RC_OFDM_RATE6M] =  DESC_RATE6M,
377 	.maps[RTL_RC_OFDM_RATE9M] =  DESC_RATE9M,
378 	.maps[RTL_RC_OFDM_RATE12M] =  DESC_RATE12M,
379 	.maps[RTL_RC_OFDM_RATE18M] =  DESC_RATE18M,
380 	.maps[RTL_RC_OFDM_RATE24M] =  DESC_RATE24M,
381 	.maps[RTL_RC_OFDM_RATE36M] =  DESC_RATE36M,
382 	.maps[RTL_RC_OFDM_RATE48M] =  DESC_RATE48M,
383 	.maps[RTL_RC_OFDM_RATE54M] =  DESC_RATE54M,
384 
385 	.maps[RTL_RC_HT_RATEMCS7] =  DESC_RATEMCS7,
386 	.maps[RTL_RC_HT_RATEMCS15] =  DESC_RATEMCS15,
387 
388 	/*VHT hightest rate*/
389 	.maps[RTL_RC_VHT_RATE_1SS_MCS7] = DESC_RATEVHT1SS_MCS7,
390 	.maps[RTL_RC_VHT_RATE_1SS_MCS8] = DESC_RATEVHT1SS_MCS8,
391 	.maps[RTL_RC_VHT_RATE_1SS_MCS9] = DESC_RATEVHT1SS_MCS9,
392 	.maps[RTL_RC_VHT_RATE_2SS_MCS7] = DESC_RATEVHT2SS_MCS7,
393 	.maps[RTL_RC_VHT_RATE_2SS_MCS8] = DESC_RATEVHT2SS_MCS8,
394 	.maps[RTL_RC_VHT_RATE_2SS_MCS9] = DESC_RATEVHT2SS_MCS9,
395 };
396 
397 static const struct pci_device_id rtl8821ae_pci_ids[] = {
398 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8812, rtl8821ae_hal_cfg)},
399 	{RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8821, rtl8821ae_hal_cfg)},
400 	{},
401 };
402 
403 MODULE_DEVICE_TABLE(pci, rtl8821ae_pci_ids);
404 
405 MODULE_AUTHOR("Realtek WlanFAE	<wlanfae@realtek.com>");
406 MODULE_LICENSE("GPL");
407 MODULE_DESCRIPTION("Realtek 8821ae 802.11ac PCI wireless");
408 MODULE_FIRMWARE("rtlwifi/rtl8821aefw.bin");
409 MODULE_FIRMWARE("rtlwifi/rtl8821aefw_29.bin");
410 MODULE_FIRMWARE("rtlwifi/rtl8821aefw_wowlan.bin");
411 MODULE_FIRMWARE("rtlwifi/rtl8812aefw.bin");
412 MODULE_FIRMWARE("rtlwifi/rtl8812aefw_wowlan.bin");
413 
414 module_param_named(swenc, rtl8821ae_mod_params.sw_crypto, bool, 0444);
415 module_param_named(debug_level, rtl8821ae_mod_params.debug_level, int, 0644);
416 module_param_named(debug_mask, rtl8821ae_mod_params.debug_mask, ullong, 0644);
417 module_param_named(ips, rtl8821ae_mod_params.inactiveps, bool, 0444);
418 module_param_named(swlps, rtl8821ae_mod_params.swctrl_lps, bool, 0444);
419 module_param_named(fwlps, rtl8821ae_mod_params.fwctrl_lps, bool, 0444);
420 module_param_named(msi, rtl8821ae_mod_params.msi_support, bool, 0444);
421 module_param_named(aspm, rtl8821ae_mod_params.aspm_support, int, 0444);
422 module_param_named(disable_watchdog, rtl8821ae_mod_params.disable_watchdog,
423 		   bool, 0444);
424 module_param_named(int_clear, rtl8821ae_mod_params.int_clear, bool, 0444);
425 MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n");
426 MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n");
427 MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n");
428 MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n");
429 MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n");
430 MODULE_PARM_DESC(aspm, "Set to 1 to enable ASPM (default 1)\n");
431 MODULE_PARM_DESC(debug_level, "Set debug level (0-5) (default 0)");
432 MODULE_PARM_DESC(debug_mask, "Set debug mask (default 0)");
433 MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n");
434 MODULE_PARM_DESC(int_clear, "Set to 0 to disable interrupt clear before set (default 1)\n");
435 
436 static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume);
437 
438 static struct pci_driver rtl8821ae_driver = {
439 	.name = KBUILD_MODNAME,
440 	.id_table = rtl8821ae_pci_ids,
441 	.probe = rtl_pci_probe,
442 	.remove = rtl_pci_disconnect,
443 	.driver.pm = &rtlwifi_pm_ops,
444 };
445 
446 module_pci_driver(rtl8821ae_driver);
447