diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-11-21 06:25:31 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-12-16 10:22:52 -0500 |
commit | 3c69b5954225b41cfa57338b17466816072d55a2 (patch) | |
tree | 60ff5619d3240cd39863d92fab2ef07447d7543f /drivers/net | |
parent | bc23773059ecea24cb653994686d230b6be08536 (diff) |
iwlwifi: tid_data logic move to upper layer - tx AGG alloc
The tid_data is not related to the transport layer, so move
the logic that depends on it to the upper layer.
This patch deals with tx AGG alloc.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@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-agn-tx.c | 32 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 26 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 8 |
4 files changed, 36 insertions, 34 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c index a31cdef8484f..1ec4720b3694 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c | |||
@@ -470,6 +470,8 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
470 | struct ieee80211_sta *sta, u16 tid, u16 *ssn) | 470 | struct ieee80211_sta *sta, u16 tid, u16 *ssn) |
471 | { | 471 | { |
472 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; | 472 | struct iwl_vif_priv *vif_priv = (void *)vif->drv_priv; |
473 | struct iwl_tid_data *tid_data; | ||
474 | unsigned long flags; | ||
473 | int sta_id; | 475 | int sta_id; |
474 | int ret; | 476 | int ret; |
475 | 477 | ||
@@ -493,8 +495,34 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
493 | if (ret) | 495 | if (ret) |
494 | return ret; | 496 | return ret; |
495 | 497 | ||
496 | ret = iwl_trans_tx_agg_alloc(trans(priv), vif_priv->ctx->ctxid, sta_id, | 498 | spin_lock_irqsave(&priv->shrd->sta_lock, flags); |
497 | tid, ssn); | 499 | |
500 | tid_data = &priv->shrd->tid_data[sta_id][tid]; | ||
501 | tid_data->agg.ssn = SEQ_TO_SN(tid_data->seq_number); | ||
502 | |||
503 | *ssn = tid_data->agg.ssn; | ||
504 | |||
505 | ret = iwl_trans_tx_agg_alloc(trans(priv), sta_id, tid); | ||
506 | if (ret) { | ||
507 | spin_unlock_irqrestore(&priv->shrd->sta_lock, flags); | ||
508 | return ret; | ||
509 | } | ||
510 | |||
511 | if (*ssn == tid_data->next_reclaimed) { | ||
512 | IWL_DEBUG_TX_QUEUES(priv, "Can proceed: ssn = next_recl = %d", | ||
513 | tid_data->agg.ssn); | ||
514 | tid_data->agg.state = IWL_AGG_ON; | ||
515 | iwl_start_tx_ba_trans_ready(priv, vif_priv->ctx->ctxid, sta_id, | ||
516 | tid); | ||
517 | } else { | ||
518 | IWL_DEBUG_TX_QUEUES(priv, "Can't proceed: ssn %d, " | ||
519 | "next_reclaimed = %d", | ||
520 | tid_data->agg.ssn, | ||
521 | tid_data->next_reclaimed); | ||
522 | tid_data->agg.state = IWL_EMPTYING_HW_QUEUE_ADDBA; | ||
523 | } | ||
524 | |||
525 | spin_unlock_irqrestore(&priv->shrd->sta_lock, flags); | ||
498 | 526 | ||
499 | return ret; | 527 | return ret; |
500 | } | 528 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h index 342ee2df2137..395c9f408f4f 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | |||
@@ -286,9 +286,7 @@ void iwl_trans_set_wr_ptrs(struct iwl_trans *trans, int txq_id, u32 index); | |||
286 | void iwl_trans_tx_queue_set_status(struct iwl_trans *trans, | 286 | void iwl_trans_tx_queue_set_status(struct iwl_trans *trans, |
287 | struct iwl_tx_queue *txq, | 287 | struct iwl_tx_queue *txq, |
288 | int tx_fifo_id, int scd_retry); | 288 | int tx_fifo_id, int scd_retry); |
289 | int iwl_trans_pcie_tx_agg_alloc(struct iwl_trans *trans, | 289 | int iwl_trans_pcie_tx_agg_alloc(struct iwl_trans *trans, int sta_id, int tid); |
290 | enum iwl_rxon_context_id ctx, int sta_id, | ||
291 | int tid, u16 *ssn); | ||
292 | void iwl_trans_pcie_tx_agg_setup(struct iwl_trans *trans, | 290 | void iwl_trans_pcie_tx_agg_setup(struct iwl_trans *trans, |
293 | enum iwl_rxon_context_id ctx, | 291 | enum iwl_rxon_context_id ctx, |
294 | int sta_id, int tid, int frame_limit); | 292 | int sta_id, int tid, int frame_limit); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c index 4ee5f50643f9..28be8a61ab32 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | |||
@@ -539,12 +539,9 @@ static int iwlagn_txq_ctx_activate_free(struct iwl_trans *trans) | |||
539 | } | 539 | } |
540 | 540 | ||
541 | int iwl_trans_pcie_tx_agg_alloc(struct iwl_trans *trans, | 541 | int iwl_trans_pcie_tx_agg_alloc(struct iwl_trans *trans, |
542 | enum iwl_rxon_context_id ctx, int sta_id, | 542 | int sta_id, int tid) |
543 | int tid, u16 *ssn) | ||
544 | { | 543 | { |
545 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 544 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
546 | struct iwl_tid_data *tid_data; | ||
547 | unsigned long flags; | ||
548 | int txq_id; | 545 | int txq_id; |
549 | 546 | ||
550 | txq_id = iwlagn_txq_ctx_activate_free(trans); | 547 | txq_id = iwlagn_txq_ctx_activate_free(trans); |
@@ -553,28 +550,9 @@ int iwl_trans_pcie_tx_agg_alloc(struct iwl_trans *trans, | |||
553 | return -ENXIO; | 550 | return -ENXIO; |
554 | } | 551 | } |
555 | 552 | ||
556 | spin_lock_irqsave(&trans->shrd->sta_lock, flags); | 553 | trans->shrd->tid_data[sta_id][tid].agg.txq_id = txq_id; |
557 | tid_data = &trans->shrd->tid_data[sta_id][tid]; | ||
558 | tid_data->agg.txq_id = txq_id; | ||
559 | tid_data->agg.ssn = SEQ_TO_SN(tid_data->seq_number); | ||
560 | |||
561 | *ssn = tid_data->agg.ssn; | ||
562 | iwl_set_swq_id(&trans_pcie->txq[txq_id], get_ac_from_tid(tid), txq_id); | 554 | iwl_set_swq_id(&trans_pcie->txq[txq_id], get_ac_from_tid(tid), txq_id); |
563 | 555 | ||
564 | if (*ssn == tid_data->next_reclaimed) { | ||
565 | IWL_DEBUG_TX_QUEUES(trans, "Proceed: ssn = next_recl = %d", | ||
566 | tid_data->agg.ssn); | ||
567 | tid_data->agg.state = IWL_AGG_ON; | ||
568 | iwl_start_tx_ba_trans_ready(priv(trans), ctx, sta_id, tid); | ||
569 | } else { | ||
570 | IWL_DEBUG_TX_QUEUES(trans, "Can't proceed: ssn %d, " | ||
571 | "next_recl = %d", | ||
572 | tid_data->agg.ssn, | ||
573 | tid_data->next_reclaimed); | ||
574 | tid_data->agg.state = IWL_EMPTYING_HW_QUEUE_ADDBA; | ||
575 | } | ||
576 | spin_unlock_irqrestore(&trans->shrd->sta_lock, flags); | ||
577 | |||
578 | return 0; | 556 | return 0; |
579 | } | 557 | } |
580 | 558 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 32c1deb3f7b1..134d5f2345ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -186,8 +186,7 @@ struct iwl_trans_ops { | |||
186 | int (*tx_agg_disable)(struct iwl_trans *trans, | 186 | int (*tx_agg_disable)(struct iwl_trans *trans, |
187 | int sta_id, int tid); | 187 | int sta_id, int tid); |
188 | int (*tx_agg_alloc)(struct iwl_trans *trans, | 188 | int (*tx_agg_alloc)(struct iwl_trans *trans, |
189 | enum iwl_rxon_context_id ctx, int sta_id, int tid, | 189 | int sta_id, int tid); |
190 | u16 *ssn); | ||
191 | void (*tx_agg_setup)(struct iwl_trans *trans, | 190 | void (*tx_agg_setup)(struct iwl_trans *trans, |
192 | enum iwl_rxon_context_id ctx, int sta_id, int tid, | 191 | enum iwl_rxon_context_id ctx, int sta_id, int tid, |
193 | int frame_limit); | 192 | int frame_limit); |
@@ -323,10 +322,9 @@ static inline int iwl_trans_tx_agg_disable(struct iwl_trans *trans, | |||
323 | } | 322 | } |
324 | 323 | ||
325 | static inline int iwl_trans_tx_agg_alloc(struct iwl_trans *trans, | 324 | static inline int iwl_trans_tx_agg_alloc(struct iwl_trans *trans, |
326 | enum iwl_rxon_context_id ctx, | 325 | int sta_id, int tid) |
327 | int sta_id, int tid, u16 *ssn) | ||
328 | { | 326 | { |
329 | return trans->ops->tx_agg_alloc(trans, ctx, sta_id, tid, ssn); | 327 | return trans->ops->tx_agg_alloc(trans, sta_id, tid); |
330 | } | 328 | } |
331 | 329 | ||
332 | 330 | ||