diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-02-15 13:25:00 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-03-06 10:35:44 -0500 |
commit | 9a886586c82aa02cb49f8c85e961595716884545 (patch) | |
tree | 915cc9035a0172d93a421025ba1e8bdf871a1502 /drivers/net/wireless/iwlwifi/dvm/tx.c | |
parent | b56cf720833c4a9d7e6ed96cc9f5c1a1091ff3bc (diff) |
wireless: move sequence number arithmetic to ieee80211.h
Move the sequence number arithmetic code from mac80211 to
ieee80211.h so others can use it. Also rename the functions
from _seq to _sn, they operate on the sequence number, not
the sequence_control field.
Also move macros to convert the sequence control to/from
the sequence number value from various drivers.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/dvm/tx.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/dvm/tx.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c index 6aec2df3bb27..d499a0366fa6 100644 --- a/drivers/net/wireless/iwlwifi/dvm/tx.c +++ b/drivers/net/wireless/iwlwifi/dvm/tx.c | |||
@@ -418,7 +418,8 @@ int iwlagn_tx_skb(struct iwl_priv *priv, | |||
418 | " Tx flags = 0x%08x, agg.state = %d", | 418 | " Tx flags = 0x%08x, agg.state = %d", |
419 | info->flags, tid_data->agg.state); | 419 | info->flags, tid_data->agg.state); |
420 | IWL_ERR(priv, "sta_id = %d, tid = %d seq_num = %d", | 420 | IWL_ERR(priv, "sta_id = %d, tid = %d seq_num = %d", |
421 | sta_id, tid, SEQ_TO_SN(tid_data->seq_number)); | 421 | sta_id, tid, |
422 | IEEE80211_SEQ_TO_SN(tid_data->seq_number)); | ||
422 | goto drop_unlock_sta; | 423 | goto drop_unlock_sta; |
423 | } | 424 | } |
424 | 425 | ||
@@ -569,7 +570,7 @@ int iwlagn_tx_agg_stop(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
569 | return 0; | 570 | return 0; |
570 | } | 571 | } |
571 | 572 | ||
572 | tid_data->agg.ssn = SEQ_TO_SN(tid_data->seq_number); | 573 | tid_data->agg.ssn = IEEE80211_SEQ_TO_SN(tid_data->seq_number); |
573 | 574 | ||
574 | /* There are still packets for this RA / TID in the HW */ | 575 | /* There are still packets for this RA / TID in the HW */ |
575 | if (!test_bit(txq_id, priv->agg_q_alloc)) { | 576 | if (!test_bit(txq_id, priv->agg_q_alloc)) { |
@@ -651,7 +652,7 @@ int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, | |||
651 | 652 | ||
652 | spin_lock_bh(&priv->sta_lock); | 653 | spin_lock_bh(&priv->sta_lock); |
653 | tid_data = &priv->tid_data[sta_id][tid]; | 654 | tid_data = &priv->tid_data[sta_id][tid]; |
654 | tid_data->agg.ssn = SEQ_TO_SN(tid_data->seq_number); | 655 | tid_data->agg.ssn = IEEE80211_SEQ_TO_SN(tid_data->seq_number); |
655 | tid_data->agg.txq_id = txq_id; | 656 | tid_data->agg.txq_id = txq_id; |
656 | 657 | ||
657 | *ssn = tid_data->agg.ssn; | 658 | *ssn = tid_data->agg.ssn; |
@@ -911,7 +912,7 @@ static void iwlagn_count_agg_tx_err_status(struct iwl_priv *priv, u16 status) | |||
911 | static inline u32 iwlagn_get_scd_ssn(struct iwlagn_tx_resp *tx_resp) | 912 | static inline u32 iwlagn_get_scd_ssn(struct iwlagn_tx_resp *tx_resp) |
912 | { | 913 | { |
913 | return le32_to_cpup((__le32 *)&tx_resp->status + | 914 | return le32_to_cpup((__le32 *)&tx_resp->status + |
914 | tx_resp->frame_count) & MAX_SN; | 915 | tx_resp->frame_count) & IEEE80211_MAX_SN; |
915 | } | 916 | } |
916 | 917 | ||
917 | static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, | 918 | static void iwl_rx_reply_tx_agg(struct iwl_priv *priv, |
@@ -1148,7 +1149,7 @@ int iwlagn_rx_reply_tx(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, | |||
1148 | 1149 | ||
1149 | if (tx_resp->frame_count == 1) { | 1150 | if (tx_resp->frame_count == 1) { |
1150 | u16 next_reclaimed = le16_to_cpu(tx_resp->seq_ctl); | 1151 | u16 next_reclaimed = le16_to_cpu(tx_resp->seq_ctl); |
1151 | next_reclaimed = SEQ_TO_SN(next_reclaimed + 0x10); | 1152 | next_reclaimed = IEEE80211_SEQ_TO_SN(next_reclaimed + 0x10); |
1152 | 1153 | ||
1153 | if (is_agg) { | 1154 | if (is_agg) { |
1154 | /* If this is an aggregation queue, we can rely on the | 1155 | /* If this is an aggregation queue, we can rely on the |