Commit 9bdf5eca authored by Mohamed Abbas's avatar Mohamed Abbas Committed by John W. Linville
Browse files

iwl3945: fix resume for ADHOC network

 ieee80211_notify_mac only reconnect BSS networks. Since IBSS does
 not need any auth or assoc steps we can just resume to the same
 condition before suspend. This patch will reestablish the ad-hoc
 network once it comes back from resume.

http://www.intellinuxwireless.org/bugzilla/show_bug.cgi?id=1774

Signed-off-by: default avatarMohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: default avatarReinette Chatre <reinette.chatre@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ada17513
...@@ -5601,6 +5601,10 @@ static void iwl3945_init_alive_start(struct iwl3945_priv *priv) ...@@ -5601,6 +5601,10 @@ static void iwl3945_init_alive_start(struct iwl3945_priv *priv)
} }
/* temporary */
static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw,
struct sk_buff *skb);
/** /**
* iwl3945_alive_start - called after REPLY_ALIVE notification received * iwl3945_alive_start - called after REPLY_ALIVE notification received
* from protocol/runtime uCode (initialization uCode's * from protocol/runtime uCode (initialization uCode's
...@@ -5704,6 +5708,14 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) ...@@ -5704,6 +5708,14 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv)
if (priv->error_recovering) if (priv->error_recovering)
iwl3945_error_recovery(priv); iwl3945_error_recovery(priv);
/* reassociate for ADHOC mode */
if (priv->vif && (priv->iw_mode == NL80211_IFTYPE_ADHOC)) {
struct sk_buff *beacon = ieee80211_beacon_get(priv->hw,
priv->vif);
if (beacon)
iwl3945_mac_beacon_update(priv->hw, beacon);
}
return; return;
restart: restart:
...@@ -6710,9 +6722,6 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv) ...@@ -6710,9 +6722,6 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv)
* clear sta table, add BCAST sta... */ * clear sta table, add BCAST sta... */
} }
/* temporary */
static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb);
static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
struct ieee80211_vif *vif, struct ieee80211_vif *vif,
struct ieee80211_if_conf *conf) struct ieee80211_if_conf *conf)
...@@ -6734,7 +6743,9 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, ...@@ -6734,7 +6743,9 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); struct sk_buff *beacon = ieee80211_beacon_get(hw, vif);
if (!beacon) if (!beacon)
return -ENOMEM; return -ENOMEM;
mutex_lock(&priv->mutex);
rc = iwl3945_mac_beacon_update(hw, beacon); rc = iwl3945_mac_beacon_update(hw, beacon);
mutex_unlock(&priv->mutex);
if (rc) if (rc)
return rc; return rc;
} }
...@@ -7188,18 +7199,15 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk ...@@ -7188,18 +7199,15 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
struct iwl3945_priv *priv = hw->priv; struct iwl3945_priv *priv = hw->priv;
unsigned long flags; unsigned long flags;
mutex_lock(&priv->mutex);
IWL_DEBUG_MAC80211("enter\n"); IWL_DEBUG_MAC80211("enter\n");
if (!iwl3945_is_ready_rf(priv)) { if (!iwl3945_is_ready_rf(priv)) {
IWL_DEBUG_MAC80211("leave - RF not ready\n"); IWL_DEBUG_MAC80211("leave - RF not ready\n");
mutex_unlock(&priv->mutex);
return -EIO; return -EIO;
} }
if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
IWL_DEBUG_MAC80211("leave - not IBSS\n"); IWL_DEBUG_MAC80211("leave - not IBSS\n");
mutex_unlock(&priv->mutex);
return -EIO; return -EIO;
} }
...@@ -7219,7 +7227,6 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk ...@@ -7219,7 +7227,6 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk
iwl3945_post_associate(priv); iwl3945_post_associate(priv);
mutex_unlock(&priv->mutex);
return 0; return 0;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment