iwl3945: delay mode setting
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>
Wed, 8 Apr 2009 18:26:38 +0000 (11:26 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 22 Apr 2009 20:54:42 +0000 (16:54 -0400)
Delay mode setting till uCode is ready.

Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl3945-base.c

index e96a726dc5c94827c1bf44826875ca6a4663b4b8..0ad89fb90d05bcda2e39cc97d2b4859f417a20e7 100644 (file)
@@ -2758,6 +2758,9 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
                        iwl_mac_beacon_update(priv->hw, beacon);
        }
 
+       if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status))
+               iwl3945_set_mode(priv, priv->iw_mode);
+
        return;
 
  restart:
@@ -3497,8 +3500,8 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
                memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
        }
 
-       if (iwl_is_ready(priv))
-               iwl3945_set_mode(priv, conf->type);
+       if (iwl3945_set_mode(priv, conf->type) == -EAGAIN)
+               set_bit(STATUS_MODE_PENDING, &priv->status);
 
        mutex_unlock(&priv->mutex);