diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8188ee/sw.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c b/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c index 631b6907c17d..11344121c55e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8188ee/sw.c | |||
@@ -11,10 +11,6 @@ | |||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | 13 | * |
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | 14 | * The full GNU General Public License is included in this distribution in the |
19 | * file called LICENSE. | 15 | * file called LICENSE. |
20 | * | 16 | * |
@@ -30,7 +26,6 @@ | |||
30 | #include "../wifi.h" | 26 | #include "../wifi.h" |
31 | #include "../core.h" | 27 | #include "../core.h" |
32 | #include "../pci.h" | 28 | #include "../pci.h" |
33 | #include "../base.h" | ||
34 | #include "reg.h" | 29 | #include "reg.h" |
35 | #include "def.h" | 30 | #include "def.h" |
36 | #include "phy.h" | 31 | #include "phy.h" |
@@ -122,7 +117,7 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) | |||
122 | 0); | 117 | 0); |
123 | 118 | ||
124 | rtlpci->irq_mask[0] = | 119 | rtlpci->irq_mask[0] = |
125 | (u32) (IMR_PSTIMEOUT | | 120 | (u32)(IMR_PSTIMEOUT | |
126 | IMR_HSISR_IND_ON_INT | | 121 | IMR_HSISR_IND_ON_INT | |
127 | IMR_C2HCMD | | 122 | IMR_C2HCMD | |
128 | IMR_HIGHDOK | | 123 | IMR_HIGHDOK | |
@@ -143,6 +138,8 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) | |||
143 | rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps; | 138 | rtlpriv->psc.inactiveps = rtlpriv->cfg->mod_params->inactiveps; |
144 | rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; | 139 | rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; |
145 | rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; | 140 | rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; |
141 | if (rtlpriv->cfg->mod_params->disable_watchdog) | ||
142 | pr_info("watchdog disabled\n"); | ||
146 | if (!rtlpriv->psc.inactiveps) | 143 | if (!rtlpriv->psc.inactiveps) |
147 | pr_info("rtl8188ee: Power Save off (module option)\n"); | 144 | pr_info("rtl8188ee: Power Save off (module option)\n"); |
148 | if (!rtlpriv->psc.fwctrl_lps) | 145 | if (!rtlpriv->psc.fwctrl_lps) |
@@ -162,7 +159,7 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) | |||
162 | rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE; | 159 | rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE; |
163 | 160 | ||
164 | /* for firmware buf */ | 161 | /* for firmware buf */ |
165 | rtlpriv->rtlhal.pfirmware = vmalloc(0x8000); | 162 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); |
166 | if (!rtlpriv->rtlhal.pfirmware) { | 163 | if (!rtlpriv->rtlhal.pfirmware) { |
167 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 164 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
168 | "Can't alloc buffer for fw.\n"); | 165 | "Can't alloc buffer for fw.\n"); |
@@ -199,7 +196,7 @@ int rtl88e_init_sw_vars(struct ieee80211_hw *hw) | |||
199 | init_timer(&rtlpriv->works.fast_antenna_training_timer); | 196 | init_timer(&rtlpriv->works.fast_antenna_training_timer); |
200 | setup_timer(&rtlpriv->works.fast_antenna_training_timer, | 197 | setup_timer(&rtlpriv->works.fast_antenna_training_timer, |
201 | rtl88e_dm_fast_antenna_training_callback, | 198 | rtl88e_dm_fast_antenna_training_callback, |
202 | (unsigned long)hw); | 199 | (unsigned long)hw); |
203 | return err; | 200 | return err; |
204 | } | 201 | } |
205 | 202 | ||
@@ -218,6 +215,12 @@ void rtl88e_deinit_sw_vars(struct ieee80211_hw *hw) | |||
218 | del_timer_sync(&rtlpriv->works.fast_antenna_training_timer); | 215 | del_timer_sync(&rtlpriv->works.fast_antenna_training_timer); |
219 | } | 216 | } |
220 | 217 | ||
218 | /* get bt coexist status */ | ||
219 | bool rtl88e_get_btc_status(void) | ||
220 | { | ||
221 | return false; | ||
222 | } | ||
223 | |||
221 | static struct rtl_hal_ops rtl8188ee_hal_ops = { | 224 | static struct rtl_hal_ops rtl8188ee_hal_ops = { |
222 | .init_sw_vars = rtl88e_init_sw_vars, | 225 | .init_sw_vars = rtl88e_init_sw_vars, |
223 | .deinit_sw_vars = rtl88e_deinit_sw_vars, | 226 | .deinit_sw_vars = rtl88e_deinit_sw_vars, |
@@ -246,11 +249,12 @@ static struct rtl_hal_ops rtl8188ee_hal_ops = { | |||
246 | .set_bw_mode = rtl88e_phy_set_bw_mode, | 249 | .set_bw_mode = rtl88e_phy_set_bw_mode, |
247 | .switch_channel = rtl88e_phy_sw_chnl, | 250 | .switch_channel = rtl88e_phy_sw_chnl, |
248 | .dm_watchdog = rtl88e_dm_watchdog, | 251 | .dm_watchdog = rtl88e_dm_watchdog, |
249 | .scan_operation_backup = rtl_phy_scan_operation_backup, | 252 | .scan_operation_backup = rtl88e_phy_scan_operation_backup, |
250 | .set_rf_power_state = rtl88e_phy_set_rf_power_state, | 253 | .set_rf_power_state = rtl88e_phy_set_rf_power_state, |
251 | .led_control = rtl88ee_led_control, | 254 | .led_control = rtl88ee_led_control, |
252 | .set_desc = rtl88ee_set_desc, | 255 | .set_desc = rtl88ee_set_desc, |
253 | .get_desc = rtl88ee_get_desc, | 256 | .get_desc = rtl88ee_get_desc, |
257 | .is_tx_desc_closed = rtl88ee_is_tx_desc_closed, | ||
254 | .tx_polling = rtl88ee_tx_polling, | 258 | .tx_polling = rtl88ee_tx_polling, |
255 | .enable_hw_sec = rtl88ee_enable_hw_security_config, | 259 | .enable_hw_sec = rtl88ee_enable_hw_security_config, |
256 | .set_key = rtl88ee_set_key, | 260 | .set_key = rtl88ee_set_key, |
@@ -259,14 +263,17 @@ static struct rtl_hal_ops rtl8188ee_hal_ops = { | |||
259 | .set_bbreg = rtl88e_phy_set_bb_reg, | 263 | .set_bbreg = rtl88e_phy_set_bb_reg, |
260 | .get_rfreg = rtl88e_phy_query_rf_reg, | 264 | .get_rfreg = rtl88e_phy_query_rf_reg, |
261 | .set_rfreg = rtl88e_phy_set_rf_reg, | 265 | .set_rfreg = rtl88e_phy_set_rf_reg, |
266 | .get_btc_status = rtl88e_get_btc_status, | ||
267 | .rx_command_packet = rtl88ee_rx_command_packet, | ||
268 | |||
262 | }; | 269 | }; |
263 | 270 | ||
264 | static struct rtl_mod_params rtl88ee_mod_params = { | 271 | static struct rtl_mod_params rtl88ee_mod_params = { |
265 | .sw_crypto = false, | 272 | .sw_crypto = false, |
266 | .inactiveps = true, | 273 | .inactiveps = false, |
267 | .swctrl_lps = false, | 274 | .swctrl_lps = false, |
268 | .fwctrl_lps = true, | 275 | .fwctrl_lps = false, |
269 | .msi_support = false, | 276 | .msi_support = true, |
270 | .debug = DBG_EMERG, | 277 | .debug = DBG_EMERG, |
271 | }; | 278 | }; |
272 | 279 | ||
@@ -274,6 +281,7 @@ static struct rtl_hal_cfg rtl88ee_hal_cfg = { | |||
274 | .bar_id = 2, | 281 | .bar_id = 2, |
275 | .write_readback = true, | 282 | .write_readback = true, |
276 | .name = "rtl88e_pci", | 283 | .name = "rtl88e_pci", |
284 | .fw_name = "rtlwifi/rtl8188efw.bin", | ||
277 | .ops = &rtl8188ee_hal_ops, | 285 | .ops = &rtl8188ee_hal_ops, |
278 | .mod_params = &rtl88ee_mod_params, | 286 | .mod_params = &rtl88ee_mod_params, |
279 | 287 | ||
@@ -285,6 +293,9 @@ static struct rtl_hal_cfg rtl88ee_hal_cfg = { | |||
285 | .maps[MAC_RCR_ACRC32] = ACRC32, | 293 | .maps[MAC_RCR_ACRC32] = ACRC32, |
286 | .maps[MAC_RCR_ACF] = ACF, | 294 | .maps[MAC_RCR_ACF] = ACF, |
287 | .maps[MAC_RCR_AAP] = AAP, | 295 | .maps[MAC_RCR_AAP] = AAP, |
296 | .maps[MAC_HIMR] = REG_HIMR, | ||
297 | .maps[MAC_HIMRE] = REG_HIMRE, | ||
298 | .maps[MAC_HSISR] = REG_HSISR, | ||
288 | 299 | ||
289 | .maps[EFUSE_ACCESS] = REG_EFUSE_ACCESS, | 300 | .maps[EFUSE_ACCESS] = REG_EFUSE_ACCESS, |
290 | 301 | ||
@@ -345,6 +356,7 @@ static struct rtl_hal_cfg rtl88ee_hal_cfg = { | |||
345 | .maps[RTL_IMR_VIDOK] = IMR_VIDOK, | 356 | .maps[RTL_IMR_VIDOK] = IMR_VIDOK, |
346 | .maps[RTL_IMR_VODOK] = IMR_VODOK, | 357 | .maps[RTL_IMR_VODOK] = IMR_VODOK, |
347 | .maps[RTL_IMR_ROK] = IMR_ROK, | 358 | .maps[RTL_IMR_ROK] = IMR_ROK, |
359 | .maps[RTL_IMR_HSISR_IND] = IMR_HSISR_IND_ON_INT, | ||
348 | .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNDMAINT0 | IMR_TBDOK | IMR_TBDER), | 360 | .maps[RTL_IBSS_INT_MASKS] = (IMR_BCNDMAINT0 | IMR_TBDOK | IMR_TBDER), |
349 | 361 | ||
350 | .maps[RTL_RC_CCK_RATE1M] = DESC92C_RATE1M, | 362 | .maps[RTL_RC_CCK_RATE1M] = DESC92C_RATE1M, |
@@ -364,7 +376,7 @@ static struct rtl_hal_cfg rtl88ee_hal_cfg = { | |||
364 | .maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15, | 376 | .maps[RTL_RC_HT_RATEMCS15] = DESC92C_RATEMCS15, |
365 | }; | 377 | }; |
366 | 378 | ||
367 | static const struct pci_device_id rtl88ee_pci_ids[] = { | 379 | static struct pci_device_id rtl88ee_pci_ids[] = { |
368 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8179, rtl88ee_hal_cfg)}, | 380 | {RTL_PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8179, rtl88ee_hal_cfg)}, |
369 | {}, | 381 | {}, |
370 | }; | 382 | }; |
@@ -384,12 +396,15 @@ module_param_named(ips, rtl88ee_mod_params.inactiveps, bool, 0444); | |||
384 | module_param_named(swlps, rtl88ee_mod_params.swctrl_lps, bool, 0444); | 396 | module_param_named(swlps, rtl88ee_mod_params.swctrl_lps, bool, 0444); |
385 | module_param_named(fwlps, rtl88ee_mod_params.fwctrl_lps, bool, 0444); | 397 | module_param_named(fwlps, rtl88ee_mod_params.fwctrl_lps, bool, 0444); |
386 | module_param_named(msi, rtl88ee_mod_params.msi_support, bool, 0444); | 398 | module_param_named(msi, rtl88ee_mod_params.msi_support, bool, 0444); |
399 | module_param_named(disable_watchdog, rtl88ee_mod_params.disable_watchdog, | ||
400 | bool, 0444); | ||
387 | MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); | 401 | MODULE_PARM_DESC(swenc, "Set to 1 for software crypto (default 0)\n"); |
388 | MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); | 402 | MODULE_PARM_DESC(ips, "Set to 0 to not use link power save (default 1)\n"); |
389 | MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); | 403 | MODULE_PARM_DESC(swlps, "Set to 1 to use SW control power save (default 0)\n"); |
390 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); | 404 | MODULE_PARM_DESC(fwlps, "Set to 1 to use FW control power save (default 1)\n"); |
391 | MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 0)\n"); | 405 | MODULE_PARM_DESC(msi, "Set to 1 to use MSI interrupts mode (default 1)\n"); |
392 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); | 406 | MODULE_PARM_DESC(debug, "Set debug level (0-5) (default 0)"); |
407 | MODULE_PARM_DESC(disable_watchdog, "Set to 1 to disable the watchdog (default 0)\n"); | ||
393 | 408 | ||
394 | static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); | 409 | static SIMPLE_DEV_PM_OPS(rtlwifi_pm_ops, rtl_pci_suspend, rtl_pci_resume); |
395 | 410 | ||