diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2011-12-07 02:30:21 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-12-16 10:23:30 -0500 |
commit | 631b84c5c6daa18ec6c9602081b8f0dbdfd618ac (patch) | |
tree | 681ba6c3017c301cefacc1d817407f48c2c24f3a /drivers/net/wireless/iwlwifi | |
parent | 855c2ee85c6a96ecfb01188ba45ccae55b183092 (diff) |
iwlwifi: add debug in Tx path in AGG flow
This will allow us to catch bad cases in which the packets aren't in
the right place on the ring.
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/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c index 5085dae14892..bd29568177e6 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | |||
@@ -408,6 +408,7 @@ static void iwlagn_tx_queue_stop_scheduler(struct iwl_trans *trans, u16 txq_id) | |||
408 | void iwl_trans_set_wr_ptrs(struct iwl_trans *trans, | 408 | void iwl_trans_set_wr_ptrs(struct iwl_trans *trans, |
409 | int txq_id, u32 index) | 409 | int txq_id, u32 index) |
410 | { | 410 | { |
411 | IWL_DEBUG_TX_QUEUES(trans, "Q %d WrPtr: %d", txq_id, index & 0xff); | ||
411 | iwl_write_direct32(bus(trans), HBUS_TARG_WRPTR, | 412 | iwl_write_direct32(bus(trans), HBUS_TARG_WRPTR, |
412 | (index & 0xff) | (txq_id << 8)); | 413 | (index & 0xff) | (txq_id << 8)); |
413 | iwl_write_prph(bus(trans), SCD_QUEUE_RDPTR(txq_id), index); | 414 | iwl_write_prph(bus(trans), SCD_QUEUE_RDPTR(txq_id), index); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index cfa0bf6cafd1..409faea66b81 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1063,6 +1063,7 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1063 | bool is_agg = false; | 1063 | bool is_agg = false; |
1064 | __le16 fc = hdr->frame_control; | 1064 | __le16 fc = hdr->frame_control; |
1065 | u8 hdr_len = ieee80211_hdrlen(fc); | 1065 | u8 hdr_len = ieee80211_hdrlen(fc); |
1066 | u16 __maybe_unused wifi_seq; | ||
1066 | 1067 | ||
1067 | /* | 1068 | /* |
1068 | * Send this frame after DTIM -- there's a special queue | 1069 | * Send this frame after DTIM -- there's a special queue |
@@ -1093,6 +1094,18 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1093 | txq = &trans_pcie->txq[txq_id]; | 1094 | txq = &trans_pcie->txq[txq_id]; |
1094 | q = &txq->q; | 1095 | q = &txq->q; |
1095 | 1096 | ||
1097 | /* In AGG mode, the index in the ring must correspond to the WiFi | ||
1098 | * sequence number. This is a HW requirements to help the SCD to parse | ||
1099 | * the BA. | ||
1100 | * Check here that the packets are in the right place on the ring. | ||
1101 | */ | ||
1102 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1103 | wifi_seq = SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)); | ||
1104 | WARN_ONCE(is_agg && ((wifi_seq & 0xff) != q->write_ptr), | ||
1105 | "Q: %d WiFi Seq %d tfdNum %d", | ||
1106 | txq_id, wifi_seq, q->write_ptr); | ||
1107 | #endif | ||
1108 | |||
1096 | /* Set up driver data for this TFD */ | 1109 | /* Set up driver data for this TFD */ |
1097 | txq->skbs[q->write_ptr] = skb; | 1110 | txq->skbs[q->write_ptr] = skb; |
1098 | txq->cmd[q->write_ptr] = dev_cmd; | 1111 | txq->cmd[q->write_ptr] = dev_cmd; |