rtlwifi: Convert to asynchronous firmware load
This patch addresses a kernel bugzilla report and two recent mail threads. The kernel bugzilla report is https://bugzilla.kernel.org/show_bug.cgi?id=42632, which reports a udev timeout on boot. The first mail thread, which was on LKML (http://lkml.indiana.edu/hypermail/ linux/kernel/1112.3/00965.html) was for a WARNING that occurs after a suspend/resume cycle for rtl8192cu. The scond mail thread (http://marc.info/?l=linux-wireless&m=132655490826766&w=2) concerned changes in udev that break drivers that delay while firmware is loaded on modprobe. This patch converts all rtlwifi-based drivers to use the asynchronous firmware loading mechanism. Drivers rtl8192ce, rtl8192cu and rtl8192de share a common callback routine. Driver rtl8192se needs different handling of the firmware, thus it has its own code. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:

committed by
John W. Linville

parent
feced2012e
commit
b0302aba81
@@ -91,9 +91,7 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
|
||||
int err;
|
||||
struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
|
||||
const struct firmware *firmware;
|
||||
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
|
||||
char *fw_name = NULL;
|
||||
|
||||
rtl8192ce_bt_reg_init(hw);
|
||||
|
||||
@@ -165,26 +163,20 @@ int rtl92c_init_sw_vars(struct ieee80211_hw *hw)
|
||||
/* request fw */
|
||||
if (IS_VENDOR_UMC_A_CUT(rtlhal->version) &&
|
||||
!IS_92C_SERIAL(rtlhal->version))
|
||||
fw_name = "rtlwifi/rtl8192cfwU.bin";
|
||||
rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU.bin";
|
||||
else if (IS_81xxC_VENDOR_UMC_B_CUT(rtlhal->version))
|
||||
fw_name = "rtlwifi/rtl8192cfwU_B.bin";
|
||||
else
|
||||
fw_name = rtlpriv->cfg->fw_name;
|
||||
err = request_firmware(&firmware, fw_name, rtlpriv->io.dev);
|
||||
rtlpriv->cfg->fw_name = "rtlwifi/rtl8192cfwU_B.bin";
|
||||
|
||||
rtlpriv->max_fw_size = 0x4000;
|
||||
pr_info("Using firmware %s\n", rtlpriv->cfg->fw_name);
|
||||
err = request_firmware_nowait(THIS_MODULE, 1, rtlpriv->cfg->fw_name,
|
||||
rtlpriv->io.dev, GFP_KERNEL, hw,
|
||||
rtl_fw_cb);
|
||||
if (err) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"Failed to request firmware!\n");
|
||||
return 1;
|
||||
}
|
||||
if (firmware->size > 0x4000) {
|
||||
RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
|
||||
"Firmware is too big!\n");
|
||||
release_firmware(firmware);
|
||||
return 1;
|
||||
}
|
||||
memcpy(rtlpriv->rtlhal.pfirmware, firmware->data, firmware->size);
|
||||
rtlpriv->rtlhal.fwsize = firmware->size;
|
||||
release_firmware(firmware);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user