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