diff options
Diffstat (limited to 'drivers/net/wireless/rtlwifi/rtl8192cu/sw.c')
-rw-r--r-- | drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c index c04c3be5bd4e..82c85286ab2e 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c | |||
@@ -53,7 +53,6 @@ MODULE_FIRMWARE("rtlwifi/rtl8192cufw.bin"); | |||
53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | 53 | static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) |
54 | { | 54 | { |
55 | struct rtl_priv *rtlpriv = rtl_priv(hw); | 55 | struct rtl_priv *rtlpriv = rtl_priv(hw); |
56 | const struct firmware *firmware; | ||
57 | int err; | 56 | int err; |
58 | 57 | ||
59 | rtlpriv->dm.dm_initialgain_enable = true; | 58 | rtlpriv->dm.dm_initialgain_enable = true; |
@@ -61,29 +60,21 @@ static int rtl92cu_init_sw_vars(struct ieee80211_hw *hw) | |||
61 | rtlpriv->dm.disable_framebursting = false; | 60 | rtlpriv->dm.disable_framebursting = false; |
62 | rtlpriv->dm.thermalvalue = 0; | 61 | rtlpriv->dm.thermalvalue = 0; |
63 | rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug; | 62 | rtlpriv->dbg.global_debuglevel = rtlpriv->cfg->mod_params->debug; |
64 | rtlpriv->rtlhal.pfirmware = vmalloc(0x4000); | 63 | |
64 | /* for firmware buf */ | ||
65 | rtlpriv->rtlhal.pfirmware = vzalloc(0x4000); | ||
65 | if (!rtlpriv->rtlhal.pfirmware) { | 66 | if (!rtlpriv->rtlhal.pfirmware) { |
66 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 67 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
67 | "Can't alloc buffer for fw\n"); | 68 | "Can't alloc buffer for fw\n"); |
68 | return 1; | 69 | return 1; |
69 | } | 70 | } |
70 | /* request fw */ | 71 | |
71 | err = request_firmware(&firmware, rtlpriv->cfg->fw_name, | 72 | pr_info("Loading firmware %s\n", rtlpriv->cfg->fw_name); |
72 | rtlpriv->io.dev); | 73 | rtlpriv->max_fw_size = 0x4000; |
73 | if (err) { | 74 | err = request_firmware_nowait(THIS_MODULE, 1, |
74 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 75 | rtlpriv->cfg->fw_name, rtlpriv->io.dev, |
75 | "Failed to request firmware!\n"); | 76 | GFP_KERNEL, hw, rtl_fw_cb); |
76 | return 1; | 77 | |
77 | } | ||
78 | if (firmware->size > 0x4000) { | ||
79 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | ||
80 | "Firmware is too big!\n"); | ||
81 | release_firmware(firmware); | ||
82 | return 1; | ||
83 | } | ||
84 | memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size); | ||
85 | rtlpriv->rtlhal.fwsize = firmware->size; | ||
86 | release_firmware(firmware); | ||
87 | 78 | ||
88 | return 0; | 79 | return 0; |
89 | } | 80 | } |