aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-03-15 07:59:10 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-03-25 09:57:30 -0400
commit7ffef13d7a24654292c4641450f2794224b9eb5d (patch)
tree53cc37ab7f74a9b5e7dc72c7eccc77e7a50e2a74 /drivers/net
parentd103e3448a3ecb9f81babd1f6d7f5a678e213c82 (diff)
iwlagn: clean up TX aggregation code
Since the driver split, there's no need for function pointers any more for aggregation queue setup and teardown as all devices now share the same code. Simplify this. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h5
7 files changed, 7 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index e8e1c2dc8659..9631d8fa802a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -179,8 +179,6 @@ static struct iwl_lib_ops iwl1000_lib = {
179 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 179 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
180 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 180 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
181 .txq_set_sched = iwlagn_txq_set_sched, 181 .txq_set_sched = iwlagn_txq_set_sched,
182 .txq_agg_enable = iwlagn_txq_agg_enable,
183 .txq_agg_disable = iwlagn_txq_agg_disable,
184 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, 182 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
185 .txq_free_tfd = iwl_hw_txq_free_tfd, 183 .txq_free_tfd = iwl_hw_txq_free_tfd,
186 .txq_init = iwl_hw_tx_queue_init, 184 .txq_init = iwl_hw_tx_queue_init,
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index b1dbe93a88b0..55274a14af01 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -259,8 +259,6 @@ static struct iwl_lib_ops iwl2000_lib = {
259 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 259 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
260 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 260 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
261 .txq_set_sched = iwlagn_txq_set_sched, 261 .txq_set_sched = iwlagn_txq_set_sched,
262 .txq_agg_enable = iwlagn_txq_agg_enable,
263 .txq_agg_disable = iwlagn_txq_agg_disable,
264 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, 262 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
265 .txq_free_tfd = iwl_hw_txq_free_tfd, 263 .txq_free_tfd = iwl_hw_txq_free_tfd,
266 .txq_init = iwl_hw_tx_queue_init, 264 .txq_init = iwl_hw_tx_queue_init,
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 90e727b1b4c1..4064490e3b96 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -348,8 +348,6 @@ static struct iwl_lib_ops iwl5000_lib = {
348 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 348 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
349 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 349 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
350 .txq_set_sched = iwlagn_txq_set_sched, 350 .txq_set_sched = iwlagn_txq_set_sched,
351 .txq_agg_enable = iwlagn_txq_agg_enable,
352 .txq_agg_disable = iwlagn_txq_agg_disable,
353 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, 351 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
354 .txq_free_tfd = iwl_hw_txq_free_tfd, 352 .txq_free_tfd = iwl_hw_txq_free_tfd,
355 .txq_init = iwl_hw_tx_queue_init, 353 .txq_init = iwl_hw_tx_queue_init,
@@ -416,8 +414,6 @@ static struct iwl_lib_ops iwl5150_lib = {
416 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 414 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
417 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 415 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
418 .txq_set_sched = iwlagn_txq_set_sched, 416 .txq_set_sched = iwlagn_txq_set_sched,
419 .txq_agg_enable = iwlagn_txq_agg_enable,
420 .txq_agg_disable = iwlagn_txq_agg_disable,
421 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, 417 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
422 .txq_free_tfd = iwl_hw_txq_free_tfd, 418 .txq_free_tfd = iwl_hw_txq_free_tfd,
423 .txq_init = iwl_hw_tx_queue_init, 419 .txq_init = iwl_hw_tx_queue_init,
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 40e022617527..7ecfbbc9457a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -288,8 +288,6 @@ static struct iwl_lib_ops iwl6000_lib = {
288 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 288 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
289 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 289 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
290 .txq_set_sched = iwlagn_txq_set_sched, 290 .txq_set_sched = iwlagn_txq_set_sched,
291 .txq_agg_enable = iwlagn_txq_agg_enable,
292 .txq_agg_disable = iwlagn_txq_agg_disable,
293 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, 291 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
294 .txq_free_tfd = iwl_hw_txq_free_tfd, 292 .txq_free_tfd = iwl_hw_txq_free_tfd,
295 .txq_init = iwl_hw_tx_queue_init, 293 .txq_init = iwl_hw_tx_queue_init,
@@ -357,8 +355,6 @@ static struct iwl_lib_ops iwl6030_lib = {
357 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl, 355 .txq_update_byte_cnt_tbl = iwlagn_txq_update_byte_cnt_tbl,
358 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl, 356 .txq_inval_byte_cnt_tbl = iwlagn_txq_inval_byte_cnt_tbl,
359 .txq_set_sched = iwlagn_txq_set_sched, 357 .txq_set_sched = iwlagn_txq_set_sched,
360 .txq_agg_enable = iwlagn_txq_agg_enable,
361 .txq_agg_disable = iwlagn_txq_agg_disable,
362 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd, 358 .txq_attach_buf_to_tfd = iwl_hw_txq_attach_buf_to_tfd,
363 .txq_free_tfd = iwl_hw_txq_free_tfd, 359 .txq_free_tfd = iwl_hw_txq_free_tfd,
364 .txq_init = iwl_hw_tx_queue_init, 360 .txq_init = iwl_hw_tx_queue_init,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index a709d05c5868..23e5667108e2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -222,8 +222,8 @@ void iwlagn_tx_queue_set_status(struct iwl_priv *priv,
222 scd_retry ? "BA" : "AC/CMD", txq_id, tx_fifo_id); 222 scd_retry ? "BA" : "AC/CMD", txq_id, tx_fifo_id);
223} 223}
224 224
225int iwlagn_txq_agg_enable(struct iwl_priv *priv, int txq_id, 225static int iwlagn_txq_agg_enable(struct iwl_priv *priv, int txq_id,
226 int tx_fifo, int sta_id, int tid, u16 ssn_idx) 226 int tx_fifo, int sta_id, int tid, u16 ssn_idx)
227{ 227{
228 unsigned long flags; 228 unsigned long flags;
229 u16 ra_tid; 229 u16 ra_tid;
@@ -288,8 +288,8 @@ int iwlagn_txq_agg_enable(struct iwl_priv *priv, int txq_id,
288 return 0; 288 return 0;
289} 289}
290 290
291int iwlagn_txq_agg_disable(struct iwl_priv *priv, u16 txq_id, 291static int iwlagn_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
292 u16 ssn_idx, u8 tx_fifo) 292 u16 ssn_idx, u8 tx_fifo)
293{ 293{
294 if ((IWLAGN_FIRST_AMPDU_QUEUE > txq_id) || 294 if ((IWLAGN_FIRST_AMPDU_QUEUE > txq_id) ||
295 (IWLAGN_FIRST_AMPDU_QUEUE + 295 (IWLAGN_FIRST_AMPDU_QUEUE +
@@ -1037,8 +1037,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
1037 iwl_set_swq_id(&priv->txq[txq_id], get_ac_from_tid(tid), txq_id); 1037 iwl_set_swq_id(&priv->txq[txq_id], get_ac_from_tid(tid), txq_id);
1038 spin_unlock_irqrestore(&priv->sta_lock, flags); 1038 spin_unlock_irqrestore(&priv->sta_lock, flags);
1039 1039
1040 ret = priv->cfg->ops->lib->txq_agg_enable(priv, txq_id, tx_fifo, 1040 ret = iwlagn_txq_agg_enable(priv, txq_id, tx_fifo, sta_id, tid, *ssn);
1041 sta_id, tid, *ssn);
1042 if (ret) 1041 if (ret)
1043 return ret; 1042 return ret;
1044 1043
@@ -1125,8 +1124,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif,
1125 * to deactivate the uCode queue, just return "success" to allow 1124 * to deactivate the uCode queue, just return "success" to allow
1126 * mac80211 to clean up it own data. 1125 * mac80211 to clean up it own data.
1127 */ 1126 */
1128 priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, ssn, 1127 iwlagn_txq_agg_disable(priv, txq_id, ssn, tx_fifo_id);
1129 tx_fifo_id);
1130 spin_unlock_irqrestore(&priv->lock, flags); 1128 spin_unlock_irqrestore(&priv->lock, flags);
1131 1129
1132 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); 1130 ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
@@ -1155,8 +1153,7 @@ int iwlagn_txq_check_empty(struct iwl_priv *priv,
1155 u16 ssn = SEQ_TO_SN(tid_data->seq_number); 1153 u16 ssn = SEQ_TO_SN(tid_data->seq_number);
1156 int tx_fifo = get_fifo_from_tid(ctx, tid); 1154 int tx_fifo = get_fifo_from_tid(ctx, tid);
1157 IWL_DEBUG_HT(priv, "HW queue empty: continue DELBA flow\n"); 1155 IWL_DEBUG_HT(priv, "HW queue empty: continue DELBA flow\n");
1158 priv->cfg->ops->lib->txq_agg_disable(priv, txq_id, 1156 iwlagn_txq_agg_disable(priv, txq_id, ssn, tx_fifo);
1159 ssn, tx_fifo);
1160 tid_data->agg.state = IWL_AGG_OFF; 1157 tid_data->agg.state = IWL_AGG_OFF;
1161 ieee80211_stop_tx_ba_cb_irqsafe(ctx->vif, addr, tid); 1158 ieee80211_stop_tx_ba_cb_irqsafe(ctx->vif, addr, tid);
1162 } 1159 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 20f8e4188994..8d918ea36c61 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -133,10 +133,6 @@ void iwlagn_txq_update_byte_cnt_tbl(struct iwl_priv *priv,
133 u16 byte_cnt); 133 u16 byte_cnt);
134void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv, 134void iwlagn_txq_inval_byte_cnt_tbl(struct iwl_priv *priv,
135 struct iwl_tx_queue *txq); 135 struct iwl_tx_queue *txq);
136int iwlagn_txq_agg_enable(struct iwl_priv *priv, int txq_id,
137 int tx_fifo, int sta_id, int tid, u16 ssn_idx);
138int iwlagn_txq_agg_disable(struct iwl_priv *priv, u16 txq_id,
139 u16 ssn_idx, u8 tx_fifo);
140void iwlagn_txq_set_sched(struct iwl_priv *priv, u32 mask); 136void iwlagn_txq_set_sched(struct iwl_priv *priv, u32 mask);
141void iwl_free_tfds_in_queue(struct iwl_priv *priv, 137void iwl_free_tfds_in_queue(struct iwl_priv *priv,
142 int sta_id, int tid, int freed); 138 int sta_id, int tid, int freed);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index b316d833d9a2..1f4f6dd18009 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -171,11 +171,6 @@ struct iwl_lib_ops {
171 struct iwl_tx_queue *txq); 171 struct iwl_tx_queue *txq);
172 int (*txq_init)(struct iwl_priv *priv, 172 int (*txq_init)(struct iwl_priv *priv,
173 struct iwl_tx_queue *txq); 173 struct iwl_tx_queue *txq);
174 /* aggregations */
175 int (*txq_agg_enable)(struct iwl_priv *priv, int txq_id, int tx_fifo,
176 int sta_id, int tid, u16 ssn_idx);
177 int (*txq_agg_disable)(struct iwl_priv *priv, u16 txq_id, u16 ssn_idx,
178 u8 tx_fifo);
179 /* setup Rx handler */ 174 /* setup Rx handler */
180 void (*rx_handler_setup)(struct iwl_priv *priv); 175 void (*rx_handler_setup)(struct iwl_priv *priv);
181 /* setup deferred work */ 176 /* setup deferred work */