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:23:10 -0500 |
commit | 34b5321e4f8bb71fd9b2190d6aad4646486c4ba6 (patch) | |
tree | fd18cc577434df6a521d5475fa88d2ef4922313a /drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |
parent | 76bc10fcd128ad028cf77c62e179cd20dc2ffecf (diff) |
iwlwifi: tid_data logic move to upper layer - seq_number
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 the seq_number.
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/iwl-trans-pcie.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c index 801e0c90b049..06db602b41db 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | |||
@@ -1044,7 +1044,7 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) | |||
1044 | 1044 | ||
1045 | static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | 1045 | static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, |
1046 | struct iwl_device_cmd *dev_cmd, enum iwl_rxon_context_id ctx, | 1046 | struct iwl_device_cmd *dev_cmd, enum iwl_rxon_context_id ctx, |
1047 | u8 sta_id) | 1047 | u8 sta_id, u8 tid) |
1048 | { | 1048 | { |
1049 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1049 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1050 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1050 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
@@ -1061,7 +1061,6 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1061 | u16 seq_number = 0; | 1061 | u16 seq_number = 0; |
1062 | u8 wait_write_ptr = 0; | 1062 | u8 wait_write_ptr = 0; |
1063 | u8 txq_id; | 1063 | u8 txq_id; |
1064 | u8 tid = 0; | ||
1065 | bool is_agg = false; | 1064 | bool is_agg = false; |
1066 | __le16 fc = hdr->frame_control; | 1065 | __le16 fc = hdr->frame_control; |
1067 | u8 hdr_len = ieee80211_hdrlen(fc); | 1066 | u8 hdr_len = ieee80211_hdrlen(fc); |
@@ -1086,20 +1085,11 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1086 | trans_pcie->ac_to_queue[ctx][skb_get_queue_mapping(skb)]; | 1085 | trans_pcie->ac_to_queue[ctx][skb_get_queue_mapping(skb)]; |
1087 | 1086 | ||
1088 | if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc)) { | 1087 | if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc)) { |
1089 | u8 *qc = NULL; | ||
1090 | struct iwl_tid_data *tid_data; | 1088 | struct iwl_tid_data *tid_data; |
1091 | qc = ieee80211_get_qos_ctl(hdr); | ||
1092 | tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK; | ||
1093 | tid_data = &trans->shrd->tid_data[sta_id][tid]; | 1089 | tid_data = &trans->shrd->tid_data[sta_id][tid]; |
1094 | |||
1095 | if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) | 1090 | if (WARN_ON_ONCE(tid >= IWL_MAX_TID_COUNT)) |
1096 | return -1; | 1091 | return -1; |
1097 | 1092 | ||
1098 | seq_number = tid_data->seq_number; | ||
1099 | seq_number &= IEEE80211_SCTL_SEQ; | ||
1100 | hdr->seq_ctrl = hdr->seq_ctrl & | ||
1101 | cpu_to_le16(IEEE80211_SCTL_FRAG); | ||
1102 | hdr->seq_ctrl |= cpu_to_le16(seq_number); | ||
1103 | /* aggregation is on for this <sta,tid> */ | 1093 | /* aggregation is on for this <sta,tid> */ |
1104 | if (info->flags & IEEE80211_TX_CTL_AMPDU) { | 1094 | if (info->flags & IEEE80211_TX_CTL_AMPDU) { |
1105 | if (WARN_ON_ONCE(tid_data->agg.state != IWL_AGG_ON)) { | 1095 | if (WARN_ON_ONCE(tid_data->agg.state != IWL_AGG_ON)) { |
@@ -1114,12 +1104,8 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1114 | txq_id = trans_pcie->agg_txq[sta_id][tid]; | 1104 | txq_id = trans_pcie->agg_txq[sta_id][tid]; |
1115 | is_agg = true; | 1105 | is_agg = true; |
1116 | } | 1106 | } |
1117 | seq_number += 0x10; | ||
1118 | } | 1107 | } |
1119 | 1108 | ||
1120 | /* Copy MAC header from skb into command buffer */ | ||
1121 | memcpy(tx_cmd->hdr, hdr, hdr_len); | ||
1122 | |||
1123 | txq = &trans_pcie->txq[txq_id]; | 1109 | txq = &trans_pcie->txq[txq_id]; |
1124 | q = &txq->q; | 1110 | q = &txq->q; |
1125 | 1111 | ||
@@ -1222,11 +1208,6 @@ static int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb, | |||
1222 | q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); | 1208 | q->write_ptr = iwl_queue_inc_wrap(q->write_ptr, q->n_bd); |
1223 | iwl_txq_update_write_ptr(trans, txq); | 1209 | iwl_txq_update_write_ptr(trans, txq); |
1224 | 1210 | ||
1225 | if (ieee80211_is_data_qos(fc) && !ieee80211_is_qos_nullfunc(fc) && | ||
1226 | !ieee80211_has_morefrags(fc)) | ||
1227 | trans->shrd->tid_data[sta_id][tid].seq_number = | ||
1228 | seq_number; | ||
1229 | |||
1230 | /* | 1211 | /* |
1231 | * At this point the frame is "transmitted" successfully | 1212 | * At this point the frame is "transmitted" successfully |
1232 | * and we will get a TX status notification eventually, | 1213 | * and we will get a TX status notification eventually, |