diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192de/sw.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192de/sw.c | 57 |
1 files changed, 25 insertions, 32 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c index 7911c9c87085..4898c502974d 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/sw.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Copyright(c) 2009-2010 Realtek Corporation. | 3 | * Copyright(c) 2009-2012 Realtek Corporation. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms of version 2 of the GNU General Public License as | 6 | * under the terms of version 2 of the GNU General Public License as |
@@ -27,11 +27,6 @@ | |||
27 | * | 27 | * |
28 | *****************************************************************************/ | 28 | *****************************************************************************/ |
29 | 29 | ||
30 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
31 | |||
32 | #include <linux/vmalloc.h> | ||
33 | #include <linux/module.h> | ||
34 | |||
35 | #include "../wifi.h" | 30 | #include "../wifi.h" |
36 | #include "../core.h" | 31 | #include "../core.h" |
37 | #include "../pci.h" | 32 | #include "../pci.h" |
@@ -44,6 +39,8 @@ | |||
44 | #include "trx.h" | 39 | #include "trx.h" |
45 | #include "led.h" | 40 | #include "led.h" |
46 | 41 | ||
42 | #include <linux/module.h> | ||
43 | |||
47 | static void rtl92d_init_aspm_vars(struct ieee80211_hw *hw) | 44 | static void rtl92d_init_aspm_vars(struct ieee80211_hw *hw) |
48 | { | 45 | { |
49 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 46 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
@@ -94,7 +91,6 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
94 | u8 tid; | 91 | u8 tid; |
95 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 92 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
96 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); | 93 | struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); |
97 | const struct firmware *firmware; | ||
98 | static int header_print; | 94 | static int header_print; |
99 | 95 | ||
100 | rtlpriv->dm.dm_initialgain_enable = true; | 96 | rtlpriv->dm.dm_initialgain_enable = true; |
@@ -154,9 +150,9 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
154 | rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; | 150 | rtlpriv->psc.swctrl_lps = rtlpriv->cfg->mod_params->swctrl_lps; |
155 | rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; | 151 | rtlpriv->psc.fwctrl_lps = rtlpriv->cfg->mod_params->fwctrl_lps; |
156 | if (!rtlpriv->psc.inactiveps) | 152 | if (!rtlpriv->psc.inactiveps) |
157 | pr_info("rtl8192ce: Power Save off (module option)\n"); | 153 | pr_info("Power Save off (module option)\n"); |
158 | if (!rtlpriv->psc.fwctrl_lps) | 154 | if (!rtlpriv->psc.fwctrl_lps) |
159 | pr_info("rtl8192ce: FW Power Save off (module option)\n"); | 155 | pr_info("FW Power Save off (module option)\n"); |
160 | rtlpriv->psc.reg_fwctrl_lps = 3; | 156 | rtlpriv->psc.reg_fwctrl_lps = 3; |
161 | rtlpriv->psc.reg_max_lps_awakeintvl = 5; | 157 | rtlpriv->psc.reg_max_lps_awakeintvl = 5; |
162 | /* for ASPM, you can close aspm through | 158 | /* for ASPM, you can close aspm through |
@@ -170,41 +166,38 @@ static int rtl92d_init_sw_vars(struct ieee80211_hw *hw) | |||
170 | else if (rtlpriv->psc.reg_fwctrl_lps == 3) | 166 | else if (rtlpriv->psc.reg_fwctrl_lps == 3) |
171 | rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE; | 167 | rtlpriv->psc.fwctrl_psmode = FW_PS_DTIM_MODE; |
172 | 168 | ||
169 | /* for early mode */ | ||
170 | rtlpriv->rtlhal.earlymode_enable = true; | ||
171 | for (tid = 0; tid < 8; tid++) | ||
172 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); | ||
173 | |||
174 | /* Only load firmware for first MAC */ | ||
175 | if (header_print) | ||
176 | return 0; | ||
177 | |||
173 | /* for firmware buf */ | 178 | /* for firmware buf */ |
174 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); | 179 | rtlpriv->rtlhal.pfirmware = vzalloc(0x8000); |
175 | if (!rtlpriv->rtlhal.pfirmware) { | 180 | if (!rtlpriv->rtlhal.pfirmware) { |
176 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 181 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
177 | ("Can't alloc buffer for fw.\n")); | 182 | "Can't alloc buffer for fw\n"); |
178 | return 1; | 183 | return 1; |
179 | } | 184 | } |
180 | 185 | ||
181 | if (!header_print) { | 186 | rtlpriv->max_fw_size = 0x8000; |
182 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); | 187 | pr_info("Driver for Realtek RTL8192DE WLAN interface\n"); |
183 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); | 188 | pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name); |
184 | header_print++; | 189 | header_print++; |
185 | } | 190 | |
186 | /* request fw */ | 191 | /* request fw */ |
187 | err = request_firmware(&firmware, rtlpriv->cfg->fw_name, | 192 | err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name, |
188 | rtlpriv->io.dev); | 193 | rtlpriv->io.dev, GFP_KERNEL, hw, |
194 | rtl_fw_cb); | ||
189 | if (err) { | 195 | if (err) { |
190 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 196 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
191 | ("Failed to request firmware!\n")); | 197 | "Failed to request firmware!\n"); |
192 | return 1; | ||
193 | } | ||
194 | if (firmware->size > 0x8000) { | ||
195 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
196 | ("Firmware is too big!\n")); | ||
197 | release_firmware(firmware); | ||
198 | return 1; | 198 | return 1; |
199 | } | 199 | } |
200 | memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); | ||
201 | rtlpriv->rtlhal.fwsize = firmware->size; | ||
202 | release_firmware(firmware); | ||
203 | 200 | ||
204 | /* for early mode */ | ||
205 | rtlpriv->rtlhal.earlymode_enable = true; | ||
206 | for (tid = 0; tid < 8; tid++) | ||
207 | skb_queue_head_init(&rtlpriv->mac80211.skb_waitq[tid]); | ||
208 | return 0; | 201 | return 0; |
209 | } | 202 | } |
210 | 203 | ||
@@ -424,7 +417,7 @@ static int __init rtl92de_module_init(void) | |||
424 | 417 | ||
425 | ret = pci_register_driver(&rtl92de_driver); | 418 | ret = pci_register_driver(&rtl92de_driver); |
426 | if (ret) | 419 | if (ret) |
427 | RT_ASSERT(false, (": No device found\n")); | 420 | RT_ASSERT(false, "No device found\n"); |
428 | return ret; | 421 | return ret; |
429 | } | 422 | } |
430 | 423 | ||