diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-28 12:28:39 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-06-14 13:51:16 -0400 |
commit | da5ae1cfff4cc5b9392eab59b227ad907626d7aa (patch) | |
tree | 67776b88a0f37dc2c0f2b839076279d1ecd78239 /drivers/net/wireless/iwlwifi/iwl3945-base.c | |
parent | b054b747a694927879c94dd11af54d04346aed7d (diff) |
iwlwifi: serialize station management actions
We are seeing some race conditions between incoming station management
requests (station add/remove) and the internal unassoc RXON command that
modifies station table. Modify these flows to require the mutex to be held
and thus serializing them.
This fixes http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2207
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 6c353cacc8d6..a27872de4106 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3437,10 +3437,13 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw, | |||
3437 | bool is_ap = vif->type == NL80211_IFTYPE_STATION; | 3437 | bool is_ap = vif->type == NL80211_IFTYPE_STATION; |
3438 | u8 sta_id; | 3438 | u8 sta_id; |
3439 | 3439 | ||
3440 | sta_priv->common.sta_id = IWL_INVALID_STATION; | ||
3441 | |||
3442 | IWL_DEBUG_INFO(priv, "received request to add station %pM\n", | 3440 | IWL_DEBUG_INFO(priv, "received request to add station %pM\n", |
3443 | sta->addr); | 3441 | sta->addr); |
3442 | mutex_lock(&priv->mutex); | ||
3443 | IWL_DEBUG_INFO(priv, "proceeding to add station %pM\n", | ||
3444 | sta->addr); | ||
3445 | sta_priv->common.sta_id = IWL_INVALID_STATION; | ||
3446 | |||
3444 | 3447 | ||
3445 | ret = iwl_add_station_common(priv, sta->addr, is_ap, &sta->ht_cap, | 3448 | ret = iwl_add_station_common(priv, sta->addr, is_ap, &sta->ht_cap, |
3446 | &sta_id); | 3449 | &sta_id); |
@@ -3448,6 +3451,7 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw, | |||
3448 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", | 3451 | IWL_ERR(priv, "Unable to add station %pM (%d)\n", |
3449 | sta->addr, ret); | 3452 | sta->addr, ret); |
3450 | /* Should we return success if return code is EEXIST ? */ | 3453 | /* Should we return success if return code is EEXIST ? */ |
3454 | mutex_unlock(&priv->mutex); | ||
3451 | return ret; | 3455 | return ret; |
3452 | } | 3456 | } |
3453 | 3457 | ||
@@ -3457,6 +3461,7 @@ static int iwl3945_mac_sta_add(struct ieee80211_hw *hw, | |||
3457 | IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", | 3461 | IWL_DEBUG_INFO(priv, "Initializing rate scaling for station %pM\n", |
3458 | sta->addr); | 3462 | sta->addr); |
3459 | iwl3945_rs_rate_init(priv, sta, sta_id); | 3463 | iwl3945_rs_rate_init(priv, sta, sta_id); |
3464 | mutex_unlock(&priv->mutex); | ||
3460 | 3465 | ||
3461 | return 0; | 3466 | return 0; |
3462 | } | 3467 | } |