Merge remote-tracking branch 'lsk/v3.10/topic/arm64-dma' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rtlwifi / core.c
index 2201b5cee08f5187b167a77c287f80e6ec0455c0..e2301970c85e4b9724bd3444b23226d7c064839c 100644 (file)
@@ -46,10 +46,20 @@ void rtl_fw_cb(const struct firmware *firmware, void *context)
                         "Firmware callback routine entered!\n");
        complete(&rtlpriv->firmware_loading_complete);
        if (!firmware) {
+               if (rtlpriv->cfg->alt_fw_name) {
+                       err = request_firmware(&firmware,
+                                              rtlpriv->cfg->alt_fw_name,
+                                              rtlpriv->io.dev);
+                       pr_info("Loading alternative firmware %s\n",
+                               rtlpriv->cfg->alt_fw_name);
+                       if (!err)
+                               goto found_alt;
+               }
                pr_err("Firmware %s not available\n", rtlpriv->cfg->fw_name);
                rtlpriv->max_fw_size = 0;
                return;
        }
+found_alt:
        if (firmware->size > rtlpriv->max_fw_size) {
                RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
                         "Firmware is too big!\n");
@@ -184,6 +194,7 @@ static int rtl_op_add_interface(struct ieee80211_hw *hw,
                                        rtlpriv->cfg->maps
                                        [RTL_IBSS_INT_MASKS]);
                }
+               mac->link_state = MAC80211_LINKED;
                break;
        case NL80211_IFTYPE_ADHOC:
                RT_TRACE(rtlpriv, COMP_MAC80211, DBG_LOUD,
@@ -370,7 +381,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
        }
 
        if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
-               struct ieee80211_channel *channel = hw->conf.channel;
+               struct ieee80211_channel *channel = hw->conf.chandef.chan;
                u8 wide_chan = (u8) channel->hw_value;
 
                if (mac->act_scanning)
@@ -392,7 +403,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
                 *info for cisco1253 bw20, so we modify
                 *it here based on UPPER & LOWER
                 */
-               switch (hw->conf.channel_type) {
+               switch (cfg80211_get_chandef_type(&hw->conf.chandef)) {
                case NL80211_CHAN_HT20:
                case NL80211_CHAN_NO_HT:
                        /* SC */
@@ -450,7 +461,7 @@ static int rtl_op_config(struct ieee80211_hw *hw, u32 changed)
                rtlpriv->cfg->ops->switch_channel(hw);
                rtlpriv->cfg->ops->set_channel_access(hw);
                rtlpriv->cfg->ops->set_bw_mode(hw,
-                                              hw->conf.channel_type);
+                               cfg80211_get_chandef_type(&hw->conf.chandef));
        }
 
        mutex_unlock(&rtlpriv->locks.conf_mutex);