diff options
author | Mohamed Abbas <mohamed.abbas@intel.com> | 2008-11-07 12:58:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-21 11:06:07 -0500 |
commit | 9bdf5ecabf1cd2fb012f87d9742590fdd8290da0 (patch) | |
tree | 6ba0f1dd1e9f349cb64e76e1f0013d140f4eca69 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | ada1751346b5539f393c2e9c9dc04d9e7078e53a (diff) |
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: Mohamed Abbas <mohamed.abbas@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index a3ec4d0467a2..0f992d0f69ad 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -5601,6 +5601,10 @@ static void iwl3945_init_alive_start(struct iwl3945_priv *priv) | |||
5601 | } | 5601 | } |
5602 | 5602 | ||
5603 | 5603 | ||
5604 | /* temporary */ | ||
5605 | static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, | ||
5606 | struct sk_buff *skb); | ||
5607 | |||
5604 | /** | 5608 | /** |
5605 | * iwl3945_alive_start - called after REPLY_ALIVE notification received | 5609 | * iwl3945_alive_start - called after REPLY_ALIVE notification received |
5606 | * from protocol/runtime uCode (initialization uCode's | 5610 | * from protocol/runtime uCode (initialization uCode's |
@@ -5704,6 +5708,14 @@ static void iwl3945_alive_start(struct iwl3945_priv *priv) | |||
5704 | if (priv->error_recovering) | 5708 | if (priv->error_recovering) |
5705 | iwl3945_error_recovery(priv); | 5709 | iwl3945_error_recovery(priv); |
5706 | 5710 | ||
5711 | /* reassociate for ADHOC mode */ | ||
5712 | if (priv->vif && (priv->iw_mode == NL80211_IFTYPE_ADHOC)) { | ||
5713 | struct sk_buff *beacon = ieee80211_beacon_get(priv->hw, | ||
5714 | priv->vif); | ||
5715 | if (beacon) | ||
5716 | iwl3945_mac_beacon_update(priv->hw, beacon); | ||
5717 | } | ||
5718 | |||
5707 | return; | 5719 | return; |
5708 | 5720 | ||
5709 | restart: | 5721 | restart: |
@@ -6710,9 +6722,6 @@ static void iwl3945_config_ap(struct iwl3945_priv *priv) | |||
6710 | * clear sta table, add BCAST sta... */ | 6722 | * clear sta table, add BCAST sta... */ |
6711 | } | 6723 | } |
6712 | 6724 | ||
6713 | /* temporary */ | ||
6714 | static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb); | ||
6715 | |||
6716 | static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | 6725 | static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, |
6717 | struct ieee80211_vif *vif, | 6726 | struct ieee80211_vif *vif, |
6718 | struct ieee80211_if_conf *conf) | 6727 | struct ieee80211_if_conf *conf) |
@@ -6734,7 +6743,9 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw, | |||
6734 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | 6743 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); |
6735 | if (!beacon) | 6744 | if (!beacon) |
6736 | return -ENOMEM; | 6745 | return -ENOMEM; |
6746 | mutex_lock(&priv->mutex); | ||
6737 | rc = iwl3945_mac_beacon_update(hw, beacon); | 6747 | rc = iwl3945_mac_beacon_update(hw, beacon); |
6748 | mutex_unlock(&priv->mutex); | ||
6738 | if (rc) | 6749 | if (rc) |
6739 | return rc; | 6750 | return rc; |
6740 | } | 6751 | } |
@@ -7188,18 +7199,15 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
7188 | struct iwl3945_priv *priv = hw->priv; | 7199 | struct iwl3945_priv *priv = hw->priv; |
7189 | unsigned long flags; | 7200 | unsigned long flags; |
7190 | 7201 | ||
7191 | mutex_lock(&priv->mutex); | ||
7192 | IWL_DEBUG_MAC80211("enter\n"); | 7202 | IWL_DEBUG_MAC80211("enter\n"); |
7193 | 7203 | ||
7194 | if (!iwl3945_is_ready_rf(priv)) { | 7204 | if (!iwl3945_is_ready_rf(priv)) { |
7195 | IWL_DEBUG_MAC80211("leave - RF not ready\n"); | 7205 | IWL_DEBUG_MAC80211("leave - RF not ready\n"); |
7196 | mutex_unlock(&priv->mutex); | ||
7197 | return -EIO; | 7206 | return -EIO; |
7198 | } | 7207 | } |
7199 | 7208 | ||
7200 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { | 7209 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { |
7201 | IWL_DEBUG_MAC80211("leave - not IBSS\n"); | 7210 | IWL_DEBUG_MAC80211("leave - not IBSS\n"); |
7202 | mutex_unlock(&priv->mutex); | ||
7203 | return -EIO; | 7211 | return -EIO; |
7204 | } | 7212 | } |
7205 | 7213 | ||
@@ -7219,7 +7227,6 @@ static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk | |||
7219 | 7227 | ||
7220 | iwl3945_post_associate(priv); | 7228 | iwl3945_post_associate(priv); |
7221 | 7229 | ||
7222 | mutex_unlock(&priv->mutex); | ||
7223 | 7230 | ||
7224 | return 0; | 7231 | return 0; |
7225 | } | 7232 | } |