diff options
author | Mohamed Abbas <mohamed.abbas@intel.com> | 2008-11-07 12:58:34 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-21 11:06:07 -0500 |
commit | ada1751346b5539f393c2e9c9dc04d9e7078e53a (patch) | |
tree | 18ce5d4761ffd9c76a07c166e2cbda1af078b868 /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | 1e87d68083cd073c84edb3a71fa4365d7fc092bd (diff) |
iwlagn: 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/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 35cfa1524c35..6404093e5366 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2002,6 +2002,10 @@ static int iwl_read_ucode(struct iwl_priv *priv) | |||
2002 | return ret; | 2002 | return ret; |
2003 | } | 2003 | } |
2004 | 2004 | ||
2005 | /* temporary */ | ||
2006 | static int iwl_mac_beacon_update(struct ieee80211_hw *hw, | ||
2007 | struct sk_buff *skb); | ||
2008 | |||
2005 | /** | 2009 | /** |
2006 | * iwl_alive_start - called after REPLY_ALIVE notification received | 2010 | * iwl_alive_start - called after REPLY_ALIVE notification received |
2007 | * from protocol/runtime uCode (initialization uCode's | 2011 | * from protocol/runtime uCode (initialization uCode's |
@@ -2084,6 +2088,15 @@ static void iwl_alive_start(struct iwl_priv *priv) | |||
2084 | 2088 | ||
2085 | iwl_power_update_mode(priv, 1); | 2089 | iwl_power_update_mode(priv, 1); |
2086 | 2090 | ||
2091 | /* reassociate for ADHOC mode */ | ||
2092 | if (priv->vif && (priv->iw_mode == NL80211_IFTYPE_ADHOC)) { | ||
2093 | struct sk_buff *beacon = ieee80211_beacon_get(priv->hw, | ||
2094 | priv->vif); | ||
2095 | if (beacon) | ||
2096 | iwl_mac_beacon_update(priv->hw, beacon); | ||
2097 | } | ||
2098 | |||
2099 | |||
2087 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) | 2100 | if (test_and_clear_bit(STATUS_MODE_PENDING, &priv->status)) |
2088 | iwl_set_mode(priv, priv->iw_mode); | 2101 | iwl_set_mode(priv, priv->iw_mode); |
2089 | 2102 | ||
@@ -2930,8 +2943,6 @@ static void iwl_config_ap(struct iwl_priv *priv) | |||
2930 | * clear sta table, add BCAST sta... */ | 2943 | * clear sta table, add BCAST sta... */ |
2931 | } | 2944 | } |
2932 | 2945 | ||
2933 | /* temporary */ | ||
2934 | static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb); | ||
2935 | 2946 | ||
2936 | static int iwl_mac_config_interface(struct ieee80211_hw *hw, | 2947 | static int iwl_mac_config_interface(struct ieee80211_hw *hw, |
2937 | struct ieee80211_vif *vif, | 2948 | struct ieee80211_vif *vif, |
@@ -2953,7 +2964,9 @@ static int iwl_mac_config_interface(struct ieee80211_hw *hw, | |||
2953 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); | 2964 | struct sk_buff *beacon = ieee80211_beacon_get(hw, vif); |
2954 | if (!beacon) | 2965 | if (!beacon) |
2955 | return -ENOMEM; | 2966 | return -ENOMEM; |
2967 | mutex_lock(&priv->mutex); | ||
2956 | rc = iwl_mac_beacon_update(hw, beacon); | 2968 | rc = iwl_mac_beacon_update(hw, beacon); |
2969 | mutex_unlock(&priv->mutex); | ||
2957 | if (rc) | 2970 | if (rc) |
2958 | return rc; | 2971 | return rc; |
2959 | } | 2972 | } |
@@ -3529,18 +3542,15 @@ static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
3529 | unsigned long flags; | 3542 | unsigned long flags; |
3530 | __le64 timestamp; | 3543 | __le64 timestamp; |
3531 | 3544 | ||
3532 | mutex_lock(&priv->mutex); | ||
3533 | IWL_DEBUG_MAC80211("enter\n"); | 3545 | IWL_DEBUG_MAC80211("enter\n"); |
3534 | 3546 | ||
3535 | if (!iwl_is_ready_rf(priv)) { | 3547 | if (!iwl_is_ready_rf(priv)) { |
3536 | IWL_DEBUG_MAC80211("leave - RF not ready\n"); | 3548 | IWL_DEBUG_MAC80211("leave - RF not ready\n"); |
3537 | mutex_unlock(&priv->mutex); | ||
3538 | return -EIO; | 3549 | return -EIO; |
3539 | } | 3550 | } |
3540 | 3551 | ||
3541 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { | 3552 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { |
3542 | IWL_DEBUG_MAC80211("leave - not IBSS\n"); | 3553 | IWL_DEBUG_MAC80211("leave - not IBSS\n"); |
3543 | mutex_unlock(&priv->mutex); | ||
3544 | return -EIO; | 3554 | return -EIO; |
3545 | } | 3555 | } |
3546 | 3556 | ||
@@ -3562,7 +3572,6 @@ static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
3562 | 3572 | ||
3563 | iwl_post_associate(priv); | 3573 | iwl_post_associate(priv); |
3564 | 3574 | ||
3565 | mutex_unlock(&priv->mutex); | ||
3566 | 3575 | ||
3567 | return 0; | 3576 | return 0; |
3568 | } | 3577 | } |