]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
rtlwifi: Convert to asynchronous firmware load
[mv-sheeva.git] / drivers / net / wireless / rtlwifi / rtl8192c / fw_common.c
index e9e9c26d49639a2c4e3d38aa084f84d5bcce18f3..c20b3c30f62ed7bfdeef57cebef888228ec07d9f 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
  *
- * Copyright(c) 2009-2010  Realtek Corporation.
+ * Copyright(c) 2009-2012  Realtek Corporation.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of version 2 of the GNU General Public License as
  *
  *****************************************************************************/
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/firmware.h>
-#include <linux/export.h>
 #include "../wifi.h"
 #include "../pci.h"
 #include "../base.h"
 #include "../rtl8192ce/reg.h"
 #include "../rtl8192ce/def.h"
 #include "fw_common.h"
+#include <linux/export.h>
 
 static void _rtl92c_enable_fw_download(struct ieee80211_hw *hw, bool enable)
 {
@@ -260,10 +257,9 @@ int rtl92c_download_fw(struct ieee80211_hw *hw)
        u32 fwsize;
        enum version_8192c version = rtlhal->version;
 
-       if (!rtlhal->pfirmware)
+       if (rtlpriv->max_fw_size == 0 || !rtlhal->pfirmware)
                return 1;
 
-       pr_info("Loading firmware file %s\n", rtlpriv->cfg->fw_name);
        pfwheader = (struct rtl92c_firmware_header *)rtlhal->pfirmware;
        pfwdata = (u8 *) rtlhal->pfirmware;
        fwsize = rtlhal->fwsize;
@@ -515,15 +511,8 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
 void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
                         u8 element_id, u32 cmd_len, u8 *p_cmdbuffer)
 {
-       struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
        u32 tmp_cmdbuf[2];
 
-       if (rtlhal->fw_ready == false) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
-               return;
-       }
-
        memset(tmp_cmdbuf, 0, 8);
        memcpy(tmp_cmdbuf, p_cmdbuffer, cmd_len);
        _rtl92c_fill_h2c_command(hw, element_id, cmd_len, (u8 *)&tmp_cmdbuf);