diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-03-05 14:24:23 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-03-06 15:16:08 -0500 |
commit | 9451ca1a31be44f8235c3f8f998ff27fc7a8395e (patch) | |
tree | b4f0559e43ceaddaf648d38d7c730797676ff02c /drivers/net/wireless | |
parent | 40e4e6868c532b439754154d69a2837dbf9bd91e (diff) |
iwlwifi: build some station commands directly
In the powersave related functions we only need
to set a few parameters for the station command
and can otherwise leave it blank -- there's no
need to copy it from the database.
This allows us to not use the sta lock here.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-mac80211.c | 16 |
2 files changed, 15 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c index 3eb8fd4771b6..6b9af994cfa4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c | |||
@@ -1437,16 +1437,14 @@ int iwl_sta_rx_agg_stop(struct iwl_priv *priv, struct ieee80211_sta *sta, | |||
1437 | 1437 | ||
1438 | void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt) | 1438 | void iwl_sta_modify_sleep_tx_count(struct iwl_priv *priv, int sta_id, int cnt) |
1439 | { | 1439 | { |
1440 | unsigned long flags; | 1440 | struct iwl_addsta_cmd cmd = { |
1441 | 1441 | .mode = STA_CONTROL_MODIFY_MSK, | |
1442 | spin_lock_irqsave(&priv->shrd->sta_lock, flags); | 1442 | .station_flags = STA_FLG_PWR_SAVE_MSK, |
1443 | priv->stations[sta_id].sta.station_flags |= STA_FLG_PWR_SAVE_MSK; | 1443 | .station_flags_msk = STA_FLG_PWR_SAVE_MSK, |
1444 | priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK; | 1444 | .sta.sta_id = sta_id, |
1445 | priv->stations[sta_id].sta.sta.modify_mask = | 1445 | .sta.modify_mask = STA_MODIFY_SLEEP_TX_COUNT_MSK, |
1446 | STA_MODIFY_SLEEP_TX_COUNT_MSK; | 1446 | .sleep_tx_count = cpu_to_le16(cnt), |
1447 | priv->stations[sta_id].sta.sleep_tx_count = cpu_to_le16(cnt); | 1447 | }; |
1448 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | ||
1449 | iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
1450 | spin_unlock_irqrestore(&priv->shrd->sta_lock, flags); | ||
1451 | 1448 | ||
1449 | iwl_send_add_sta(priv, &cmd, CMD_ASYNC); | ||
1452 | } | 1450 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c index 03f770543d8e..9fba532d35cd 100644 --- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c +++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c | |||
@@ -1505,17 +1505,13 @@ static int iwlagn_mac_sta_remove(struct ieee80211_hw *hw, | |||
1505 | 1505 | ||
1506 | static void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id) | 1506 | static void iwl_sta_modify_ps_wake(struct iwl_priv *priv, int sta_id) |
1507 | { | 1507 | { |
1508 | unsigned long flags; | 1508 | struct iwl_addsta_cmd cmd = { |
1509 | 1509 | .mode = STA_CONTROL_MODIFY_MSK, | |
1510 | spin_lock_irqsave(&priv->shrd->sta_lock, flags); | 1510 | .station_flags_msk = STA_FLG_PWR_SAVE_MSK, |
1511 | priv->stations[sta_id].sta.station_flags &= ~STA_FLG_PWR_SAVE_MSK; | 1511 | .sta.sta_id = sta_id, |
1512 | priv->stations[sta_id].sta.station_flags_msk = STA_FLG_PWR_SAVE_MSK; | 1512 | }; |
1513 | priv->stations[sta_id].sta.sta.modify_mask = 0; | ||
1514 | priv->stations[sta_id].sta.sleep_tx_count = 0; | ||
1515 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | ||
1516 | iwl_send_add_sta(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | ||
1517 | spin_unlock_irqrestore(&priv->shrd->sta_lock, flags); | ||
1518 | 1513 | ||
1514 | iwl_send_add_sta(priv, &cmd, CMD_ASYNC); | ||
1519 | } | 1515 | } |
1520 | 1516 | ||
1521 | static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw, | 1517 | static void iwlagn_mac_sta_notify(struct ieee80211_hw *hw, |