diff options
author | Ron Rindjunsky <ron.rindjunsky@intel.com> | 2008-04-17 19:03:37 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:11 -0400 |
commit | fe07aa7acd9ec221d4440a38ffc9a58776cb34bc (patch) | |
tree | cdf55a19b3f5e4204bc78c81effb5873116eba44 /drivers/net/wireless/iwlwifi | |
parent | 3ec47732a0be038f15a0b8d852a4e4ff9c5b0196 (diff) |
iwlwifi: arranging aggregation actions
This patch makes some renaming of the ampdu_action functions inside
iwlwifi, and adds checks for correct station id in Rx flows
Signed-off-by: Ron Rindjunsky <ron.rindjunsky@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index ddcd1b232549..890dfa44c1e9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -4063,10 +4063,15 @@ void iwl4965_set_ht_add_station(struct iwl_priv *priv, u8 index, | |||
4063 | return; | 4063 | return; |
4064 | } | 4064 | } |
4065 | 4065 | ||
4066 | static void iwl4965_sta_modify_add_ba_tid(struct iwl_priv *priv, | 4066 | static int iwl4965_rx_agg_start(struct iwl_priv *priv, |
4067 | int sta_id, int tid, u16 ssn) | 4067 | const u8 *addr, int tid, u16 ssn) |
4068 | { | 4068 | { |
4069 | unsigned long flags; | 4069 | unsigned long flags; |
4070 | int sta_id; | ||
4071 | |||
4072 | sta_id = iwl_find_station(priv, addr); | ||
4073 | if (sta_id == IWL_INVALID_STATION) | ||
4074 | return -ENXIO; | ||
4070 | 4075 | ||
4071 | spin_lock_irqsave(&priv->sta_lock, flags); | 4076 | spin_lock_irqsave(&priv->sta_lock, flags); |
4072 | priv->stations[sta_id].sta.station_flags_msk = 0; | 4077 | priv->stations[sta_id].sta.station_flags_msk = 0; |
@@ -4076,13 +4081,19 @@ static void iwl4965_sta_modify_add_ba_tid(struct iwl_priv *priv, | |||
4076 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 4081 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
4077 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 4082 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
4078 | 4083 | ||
4079 | iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | 4084 | return iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, |
4085 | CMD_ASYNC); | ||
4080 | } | 4086 | } |
4081 | 4087 | ||
4082 | static void iwl4965_sta_modify_del_ba_tid(struct iwl_priv *priv, | 4088 | static int iwl4965_rx_agg_stop(struct iwl_priv *priv, |
4083 | int sta_id, int tid) | 4089 | const u8 *addr, int tid) |
4084 | { | 4090 | { |
4085 | unsigned long flags; | 4091 | unsigned long flags; |
4092 | int sta_id; | ||
4093 | |||
4094 | sta_id = iwl_find_station(priv, addr); | ||
4095 | if (sta_id == IWL_INVALID_STATION) | ||
4096 | return -ENXIO; | ||
4086 | 4097 | ||
4087 | spin_lock_irqsave(&priv->sta_lock, flags); | 4098 | spin_lock_irqsave(&priv->sta_lock, flags); |
4088 | priv->stations[sta_id].sta.station_flags_msk = 0; | 4099 | priv->stations[sta_id].sta.station_flags_msk = 0; |
@@ -4091,7 +4102,8 @@ static void iwl4965_sta_modify_del_ba_tid(struct iwl_priv *priv, | |||
4091 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 4102 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
4092 | spin_unlock_irqrestore(&priv->sta_lock, flags); | 4103 | spin_unlock_irqrestore(&priv->sta_lock, flags); |
4093 | 4104 | ||
4094 | iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, CMD_ASYNC); | 4105 | return iwl4965_send_add_station(priv, &priv->stations[sta_id].sta, |
4106 | CMD_ASYNC); | ||
4095 | } | 4107 | } |
4096 | 4108 | ||
4097 | /* | 4109 | /* |
@@ -4110,8 +4122,8 @@ static int iwl4965_txq_ctx_activate_free(struct iwl_priv *priv) | |||
4110 | return -1; | 4122 | return -1; |
4111 | } | 4123 | } |
4112 | 4124 | ||
4113 | static int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, const u8 *da, | 4125 | static int iwl4965_tx_agg_start(struct ieee80211_hw *hw, const u8 *ra, |
4114 | u16 tid, u16 *start_seq_num) | 4126 | u16 tid, u16 *start_seq_num) |
4115 | { | 4127 | { |
4116 | struct iwl_priv *priv = hw->priv; | 4128 | struct iwl_priv *priv = hw->priv; |
4117 | int sta_id; | 4129 | int sta_id; |
@@ -4128,10 +4140,10 @@ static int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, const u8 *da, | |||
4128 | else | 4140 | else |
4129 | return -EINVAL; | 4141 | return -EINVAL; |
4130 | 4142 | ||
4131 | IWL_WARNING("%s on da = %s tid = %d\n", | 4143 | IWL_WARNING("%s on ra = %s tid = %d\n", |
4132 | __func__, print_mac(mac, da), tid); | 4144 | __func__, print_mac(mac, ra), tid); |
4133 | 4145 | ||
4134 | sta_id = iwl_find_station(priv, da); | 4146 | sta_id = iwl_find_station(priv, ra); |
4135 | if (sta_id == IWL_INVALID_STATION) | 4147 | if (sta_id == IWL_INVALID_STATION) |
4136 | return -ENXIO; | 4148 | return -ENXIO; |
4137 | 4149 | ||
@@ -4160,7 +4172,7 @@ static int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, const u8 *da, | |||
4160 | if (tid_data->tfds_in_queue == 0) { | 4172 | if (tid_data->tfds_in_queue == 0) { |
4161 | printk(KERN_ERR "HW queue is empty\n"); | 4173 | printk(KERN_ERR "HW queue is empty\n"); |
4162 | tid_data->agg.state = IWL_AGG_ON; | 4174 | tid_data->agg.state = IWL_AGG_ON; |
4163 | ieee80211_start_tx_ba_cb_irqsafe(hw, da, tid); | 4175 | ieee80211_start_tx_ba_cb_irqsafe(hw, ra, tid); |
4164 | } else { | 4176 | } else { |
4165 | IWL_DEBUG_HT("HW queue is NOT empty: %d packets in HW queue\n", | 4177 | IWL_DEBUG_HT("HW queue is NOT empty: %d packets in HW queue\n", |
4166 | tid_data->tfds_in_queue); | 4178 | tid_data->tfds_in_queue); |
@@ -4169,10 +4181,8 @@ static int iwl4965_mac_ht_tx_agg_start(struct ieee80211_hw *hw, const u8 *da, | |||
4169 | return ret; | 4181 | return ret; |
4170 | } | 4182 | } |
4171 | 4183 | ||
4172 | static int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, const u8 *da, | 4184 | static int iwl4965_tx_agg_stop(struct ieee80211_hw *hw, const u8 *ra, u16 tid) |
4173 | u16 tid) | ||
4174 | { | 4185 | { |
4175 | |||
4176 | struct iwl_priv *priv = hw->priv; | 4186 | struct iwl_priv *priv = hw->priv; |
4177 | int tx_fifo_id, txq_id, sta_id, ssn = -1; | 4187 | int tx_fifo_id, txq_id, sta_id, ssn = -1; |
4178 | struct iwl4965_tid_data *tid_data; | 4188 | struct iwl4965_tid_data *tid_data; |
@@ -4180,8 +4190,8 @@ static int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, const u8 *da, | |||
4180 | unsigned long flags; | 4190 | unsigned long flags; |
4181 | DECLARE_MAC_BUF(mac); | 4191 | DECLARE_MAC_BUF(mac); |
4182 | 4192 | ||
4183 | if (!da) { | 4193 | if (!ra) { |
4184 | IWL_ERROR("da = NULL\n"); | 4194 | IWL_ERROR("ra = NULL\n"); |
4185 | return -EINVAL; | 4195 | return -EINVAL; |
4186 | } | 4196 | } |
4187 | 4197 | ||
@@ -4190,7 +4200,7 @@ static int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, const u8 *da, | |||
4190 | else | 4200 | else |
4191 | return -EINVAL; | 4201 | return -EINVAL; |
4192 | 4202 | ||
4193 | sta_id = iwl_find_station(priv, da); | 4203 | sta_id = iwl_find_station(priv, ra); |
4194 | 4204 | ||
4195 | if (sta_id == IWL_INVALID_STATION) | 4205 | if (sta_id == IWL_INVALID_STATION) |
4196 | return -ENXIO; | 4206 | return -ENXIO; |
@@ -4212,7 +4222,7 @@ static int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, const u8 *da, | |||
4212 | return 0; | 4222 | return 0; |
4213 | } | 4223 | } |
4214 | 4224 | ||
4215 | IWL_DEBUG_HT("HW queue empty\n");; | 4225 | IWL_DEBUG_HT("HW queue is empty\n"); |
4216 | priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF; | 4226 | priv->stations[sta_id].tid[tid].agg.state = IWL_AGG_OFF; |
4217 | 4227 | ||
4218 | spin_lock_irqsave(&priv->lock, flags); | 4228 | spin_lock_irqsave(&priv->lock, flags); |
@@ -4222,10 +4232,7 @@ static int iwl4965_mac_ht_tx_agg_stop(struct ieee80211_hw *hw, const u8 *da, | |||
4222 | if (ret) | 4232 | if (ret) |
4223 | return ret; | 4233 | return ret; |
4224 | 4234 | ||
4225 | ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, da, tid); | 4235 | ieee80211_stop_tx_ba_cb_irqsafe(priv->hw, ra, tid); |
4226 | |||
4227 | IWL_DEBUG_INFO("iwl4965_mac_ht_tx_agg_stop on da=%s tid=%d\n", | ||
4228 | print_mac(mac, da), tid); | ||
4229 | 4236 | ||
4230 | return 0; | 4237 | return 0; |
4231 | } | 4238 | } |
@@ -4235,27 +4242,24 @@ int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw, | |||
4235 | const u8 *addr, u16 tid, u16 *ssn) | 4242 | const u8 *addr, u16 tid, u16 *ssn) |
4236 | { | 4243 | { |
4237 | struct iwl_priv *priv = hw->priv; | 4244 | struct iwl_priv *priv = hw->priv; |
4238 | int sta_id; | ||
4239 | DECLARE_MAC_BUF(mac); | 4245 | DECLARE_MAC_BUF(mac); |
4240 | 4246 | ||
4241 | IWL_DEBUG_HT("A-MPDU action on da=%s tid=%d ", | 4247 | IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n", |
4242 | print_mac(mac, addr), tid); | 4248 | print_mac(mac, addr), tid); |
4243 | sta_id = iwl_find_station(priv, addr); | 4249 | |
4244 | switch (action) { | 4250 | switch (action) { |
4245 | case IEEE80211_AMPDU_RX_START: | 4251 | case IEEE80211_AMPDU_RX_START: |
4246 | IWL_DEBUG_HT("start Rx\n"); | 4252 | IWL_DEBUG_HT("start Rx\n"); |
4247 | iwl4965_sta_modify_add_ba_tid(priv, sta_id, tid, *ssn); | 4253 | return iwl4965_rx_agg_start(priv, addr, tid, *ssn); |
4248 | break; | ||
4249 | case IEEE80211_AMPDU_RX_STOP: | 4254 | case IEEE80211_AMPDU_RX_STOP: |
4250 | IWL_DEBUG_HT("stop Rx\n"); | 4255 | IWL_DEBUG_HT("stop Rx\n"); |
4251 | iwl4965_sta_modify_del_ba_tid(priv, sta_id, tid); | 4256 | return iwl4965_rx_agg_stop(priv, addr, tid); |
4252 | break; | ||
4253 | case IEEE80211_AMPDU_TX_START: | 4257 | case IEEE80211_AMPDU_TX_START: |
4254 | IWL_DEBUG_HT("start Tx\n"); | 4258 | IWL_DEBUG_HT("start Tx\n"); |
4255 | return iwl4965_mac_ht_tx_agg_start(hw, addr, tid, ssn); | 4259 | return iwl4965_tx_agg_start(hw, addr, tid, ssn); |
4256 | case IEEE80211_AMPDU_TX_STOP: | 4260 | case IEEE80211_AMPDU_TX_STOP: |
4257 | IWL_DEBUG_HT("stop Tx\n"); | 4261 | IWL_DEBUG_HT("stop Tx\n"); |
4258 | return iwl4965_mac_ht_tx_agg_stop(hw, addr, tid); | 4262 | return iwl4965_tx_agg_stop(hw, addr, tid); |
4259 | default: | 4263 | default: |
4260 | IWL_DEBUG_HT("unknown\n"); | 4264 | IWL_DEBUG_HT("unknown\n"); |
4261 | return -EINVAL; | 4265 | return -EINVAL; |