aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-05-15 06:55:29 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-05-21 21:48:11 -0400
commite039fa4a4195ac4ee895e6f3d1334beed63256fe (patch)
treecfd0762d73df96b73052378be7b157c4ac6e7035 /drivers/net/wireless/iwlwifi
parente24549485f859be6518929bb1c9c0257d79f033d (diff)
mac80211: move TX info into skb->cb
This patch converts mac80211 and all drivers to have transmit information and status in skb->cb rather than allocating extra memory for it and copying all the data around. To make it fit, a union is used where only data that is necessary for all steps is kept outside of the union. A number of fixes were done by Ivo, as well as the rt2x00 part of this patch. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-rs.c49
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c28
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c40
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c48
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c52
10 files changed, 121 insertions, 143 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index f3ca02fe9619..10c64bdb314c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -445,8 +445,7 @@ static int rs_adjust_next_rate(struct iwl3945_priv *priv, int rate)
445 */ 445 */
446static void rs_tx_status(void *priv_rate, 446static void rs_tx_status(void *priv_rate,
447 struct net_device *dev, 447 struct net_device *dev,
448 struct sk_buff *skb, 448 struct sk_buff *skb)
449 struct ieee80211_tx_status *tx_resp)
450{ 449{
451 u8 retries, current_count; 450 u8 retries, current_count;
452 int scale_rate_index, first_index, last_index; 451 int scale_rate_index, first_index, last_index;
@@ -457,14 +456,15 @@ static void rs_tx_status(void *priv_rate,
457 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 456 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
458 struct iwl3945_rs_sta *rs_sta; 457 struct iwl3945_rs_sta *rs_sta;
459 struct ieee80211_supported_band *sband; 458 struct ieee80211_supported_band *sband;
459 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
460 460
461 IWL_DEBUG_RATE("enter\n"); 461 IWL_DEBUG_RATE("enter\n");
462 462
463 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 463 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
464 464
465 465
466 retries = tx_resp->retry_count; 466 retries = info->status.retry_count;
467 first_index = sband->bitrates[tx_resp->control.tx_rate_idx].hw_value; 467 first_index = sband->bitrates[info->tx_rate_idx].hw_value;
468 if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) { 468 if ((first_index < 0) || (first_index >= IWL_RATE_COUNT)) {
469 IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index); 469 IWL_DEBUG_RATE("leave: Rate out of bounds: %d\n", first_index);
470 return; 470 return;
@@ -525,11 +525,11 @@ static void rs_tx_status(void *priv_rate,
525 /* Update the last index window with success/failure based on ACK */ 525 /* Update the last index window with success/failure based on ACK */
526 IWL_DEBUG_RATE("Update rate %d with %s.\n", 526 IWL_DEBUG_RATE("Update rate %d with %s.\n",
527 last_index, 527 last_index,
528 (tx_resp->flags & IEEE80211_TX_STATUS_ACK) ? 528 (info->flags & IEEE80211_TX_STAT_ACK) ?
529 "success" : "failure"); 529 "success" : "failure");
530 iwl3945_collect_tx_data(rs_sta, 530 iwl3945_collect_tx_data(rs_sta,
531 &rs_sta->win[last_index], 531 &rs_sta->win[last_index],
532 tx_resp->flags & IEEE80211_TX_STATUS_ACK, 1); 532 info->flags & IEEE80211_TX_STAT_ACK, 1);
533 533
534 /* We updated the rate scale window -- if its been more than 534 /* We updated the rate scale window -- if its been more than
535 * flush_time since the last run, schedule the flush 535 * flush_time since the last run, schedule the flush
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index f8e691f88ab3..0ba6889dfd41 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -283,8 +283,7 @@ static void iwl3945_tx_queue_reclaim(struct iwl3945_priv *priv,
283 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) { 283 q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
284 284
285 tx_info = &txq->txb[txq->q.read_ptr]; 285 tx_info = &txq->txb[txq->q.read_ptr];
286 ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0], 286 ieee80211_tx_status_irqsafe(priv->hw, tx_info->skb[0]);
287 &tx_info->status);
288 tx_info->skb[0] = NULL; 287 tx_info->skb[0] = NULL;
289 iwl3945_hw_txq_free_tfd(priv, txq); 288 iwl3945_hw_txq_free_tfd(priv, txq);
290 } 289 }
@@ -306,7 +305,7 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv,
306 int txq_id = SEQ_TO_QUEUE(sequence); 305 int txq_id = SEQ_TO_QUEUE(sequence);
307 int index = SEQ_TO_INDEX(sequence); 306 int index = SEQ_TO_INDEX(sequence);
308 struct iwl3945_tx_queue *txq = &priv->txq[txq_id]; 307 struct iwl3945_tx_queue *txq = &priv->txq[txq_id];
309 struct ieee80211_tx_status *tx_status; 308 struct ieee80211_tx_info *info;
310 struct iwl3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; 309 struct iwl3945_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
311 u32 status = le32_to_cpu(tx_resp->status); 310 u32 status = le32_to_cpu(tx_resp->status);
312 int rate_idx; 311 int rate_idx;
@@ -319,21 +318,22 @@ static void iwl3945_rx_reply_tx(struct iwl3945_priv *priv,
319 return; 318 return;
320 } 319 }
321 320
322 tx_status = &(txq->txb[txq->q.read_ptr].status); 321 info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
322 memset(&info->status, 0, sizeof(info->status));
323 323
324 tx_status->retry_count = tx_resp->failure_frame; 324 info->status.retry_count = tx_resp->failure_frame;
325 /* tx_status->rts_retry_count = tx_resp->failure_rts; */ 325 /* tx_status->rts_retry_count = tx_resp->failure_rts; */
326 tx_status->flags = ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ? 326 info->flags |= ((status & TX_STATUS_MSK) == TX_STATUS_SUCCESS) ?
327 IEEE80211_TX_STATUS_ACK : 0; 327 IEEE80211_TX_STAT_ACK : 0;
328 328
329 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n", 329 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) plcp rate %d retries %d\n",
330 txq_id, iwl3945_get_tx_fail_reason(status), status, 330 txq_id, iwl3945_get_tx_fail_reason(status), status,
331 tx_resp->rate, tx_resp->failure_frame); 331 tx_resp->rate, tx_resp->failure_frame);
332 332
333 rate_idx = iwl3945_hwrate_to_plcp_idx(tx_resp->rate); 333 rate_idx = iwl3945_hwrate_to_plcp_idx(tx_resp->rate);
334 if (tx_status->control.band == IEEE80211_BAND_5GHZ) 334 if (info->band == IEEE80211_BAND_5GHZ)
335 rate_idx -= IWL_FIRST_OFDM_RATE; 335 rate_idx -= IWL_FIRST_OFDM_RATE;
336 tx_status->control.tx_rate_idx = rate_idx; 336 info->tx_rate_idx = rate_idx;
337 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index); 337 IWL_DEBUG_TX_REPLY("Tx queue reclaim %d\n", index);
338 iwl3945_tx_queue_reclaim(priv, txq_id, index); 338 iwl3945_tx_queue_reclaim(priv, txq_id, index);
339 339
@@ -960,11 +960,11 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
960*/ 960*/
961void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, 961void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
962 struct iwl3945_cmd *cmd, 962 struct iwl3945_cmd *cmd,
963 struct ieee80211_tx_control *ctrl, 963 struct ieee80211_tx_info *info,
964 struct ieee80211_hdr *hdr, int sta_id, int tx_id) 964 struct ieee80211_hdr *hdr, int sta_id, int tx_id)
965{ 965{
966 unsigned long flags; 966 unsigned long flags;
967 u16 hw_value = ieee80211_get_tx_rate(priv->hw, ctrl)->hw_value; 967 u16 hw_value = ieee80211_get_tx_rate(priv->hw, info)->hw_value;
968 u16 rate_index = min(hw_value & 0xffff, IWL_RATE_COUNT - 1); 968 u16 rate_index = min(hw_value & 0xffff, IWL_RATE_COUNT - 1);
969 u16 rate_mask; 969 u16 rate_mask;
970 int rate; 970 int rate;
@@ -977,7 +977,7 @@ void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
977 tx_flags = cmd->cmd.tx.tx_flags; 977 tx_flags = cmd->cmd.tx.tx_flags;
978 978
979 /* We need to figure out how to get the sta->supp_rates while 979 /* We need to figure out how to get the sta->supp_rates while
980 * in this running context; perhaps encoding into ctrl->tx_rate? */ 980 * in this running context */
981 rate_mask = IWL_RATES_MASK; 981 rate_mask = IWL_RATES_MASK;
982 982
983 spin_lock_irqsave(&priv->sta_lock, flags); 983 spin_lock_irqsave(&priv->sta_lock, flags);
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 9fdc1405e853..835c5b4320e9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -124,7 +124,6 @@ int iwl3945_x2_queue_used(const struct iwl3945_queue *q, int i);
124 124
125/* One for each TFD */ 125/* One for each TFD */
126struct iwl3945_tx_info { 126struct iwl3945_tx_info {
127 struct ieee80211_tx_status status;
128 struct sk_buff *skb[MAX_NUM_OF_TBS]; 127 struct sk_buff *skb[MAX_NUM_OF_TBS];
129}; 128};
130 129
@@ -645,7 +644,7 @@ extern unsigned int iwl3945_hw_get_beacon_cmd(struct iwl3945_priv *priv,
645extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv); 644extern int iwl3945_hw_get_rx_read(struct iwl3945_priv *priv);
646extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv, 645extern void iwl3945_hw_build_tx_cmd_rate(struct iwl3945_priv *priv,
647 struct iwl3945_cmd *cmd, 646 struct iwl3945_cmd *cmd,
648 struct ieee80211_tx_control *ctrl, 647 struct ieee80211_tx_info *info,
649 struct ieee80211_hdr *hdr, 648 struct ieee80211_hdr *hdr,
650 int sta_id, int tx_id); 649 int sta_id, int tx_id);
651extern int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv); 650extern int iwl3945_hw_reg_send_txpower(struct iwl3945_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index 7993a1d83025..f28b3cc272df 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -785,8 +785,7 @@ out:
785 * mac80211 sends us Tx status 785 * mac80211 sends us Tx status
786 */ 786 */
787static void rs_tx_status(void *priv_rate, struct net_device *dev, 787static void rs_tx_status(void *priv_rate, struct net_device *dev,
788 struct sk_buff *skb, 788 struct sk_buff *skb)
789 struct ieee80211_tx_status *tx_resp)
790{ 789{
791 int status; 790 int status;
792 u8 retries; 791 u8 retries;
@@ -798,6 +797,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
798 struct iwl_priv *priv = (struct iwl_priv *)priv_rate; 797 struct iwl_priv *priv = (struct iwl_priv *)priv_rate;
799 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); 798 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
800 struct ieee80211_hw *hw = local_to_hw(local); 799 struct ieee80211_hw *hw = local_to_hw(local);
800 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
801 struct iwl4965_rate_scale_data *window = NULL; 801 struct iwl4965_rate_scale_data *window = NULL;
802 struct iwl4965_rate_scale_data *search_win = NULL; 802 struct iwl4965_rate_scale_data *search_win = NULL;
803 u32 tx_rate; 803 u32 tx_rate;
@@ -813,11 +813,11 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
813 return; 813 return;
814 814
815 /* This packet was aggregated but doesn't carry rate scale info */ 815 /* This packet was aggregated but doesn't carry rate scale info */
816 if ((tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) && 816 if ((info->flags & IEEE80211_TX_CTL_AMPDU) &&
817 !(tx_resp->flags & IEEE80211_TX_STATUS_AMPDU)) 817 !(info->flags & IEEE80211_TX_STAT_AMPDU))
818 return; 818 return;
819 819
820 retries = tx_resp->retry_count; 820 retries = info->status.retry_count;
821 821
822 if (retries > 15) 822 if (retries > 15)
823 retries = 15; 823 retries = 15;
@@ -862,20 +862,20 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
862 if (priv->band == IEEE80211_BAND_5GHZ) 862 if (priv->band == IEEE80211_BAND_5GHZ)
863 rs_index -= IWL_FIRST_OFDM_RATE; 863 rs_index -= IWL_FIRST_OFDM_RATE;
864 864
865 if ((tx_resp->control.tx_rate_idx < 0) || 865 if ((info->tx_rate_idx < 0) ||
866 (tbl_type.is_SGI ^ 866 (tbl_type.is_SGI ^
867 !!(tx_resp->control.flags & IEEE80211_TXCTL_SHORT_GI)) || 867 !!(info->flags & IEEE80211_TX_CTL_SHORT_GI)) ||
868 (tbl_type.is_fat ^ 868 (tbl_type.is_fat ^
869 !!(tx_resp->control.flags & IEEE80211_TXCTL_40_MHZ_WIDTH)) || 869 !!(info->flags & IEEE80211_TX_CTL_40_MHZ_WIDTH)) ||
870 (tbl_type.is_dup ^ 870 (tbl_type.is_dup ^
871 !!(tx_resp->control.flags & IEEE80211_TXCTL_DUP_DATA)) || 871 !!(info->flags & IEEE80211_TX_CTL_DUP_DATA)) ||
872 (tbl_type.ant_type ^ tx_resp->control.antenna_sel_tx) || 872 (tbl_type.ant_type ^ info->antenna_sel_tx) ||
873 (!!(tx_rate & RATE_MCS_HT_MSK) ^ 873 (!!(tx_rate & RATE_MCS_HT_MSK) ^
874 !!(tx_resp->control.flags & IEEE80211_TXCTL_OFDM_HT)) || 874 !!(info->flags & IEEE80211_TX_CTL_OFDM_HT)) ||
875 (!!(tx_rate & RATE_MCS_GF_MSK) ^ 875 (!!(tx_rate & RATE_MCS_GF_MSK) ^
876 !!(tx_resp->control.flags & IEEE80211_TXCTL_GREEN_FIELD)) || 876 !!(info->flags & IEEE80211_TX_CTL_GREEN_FIELD)) ||
877 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate != 877 (hw->wiphy->bands[priv->band]->bitrates[rs_index].bitrate !=
878 hw->wiphy->bands[tx_resp->control.band]->bitrates[tx_resp->control.tx_rate_idx].bitrate)) { 878 hw->wiphy->bands[info->band]->bitrates[info->tx_rate_idx].bitrate)) {
879 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate); 879 IWL_DEBUG_RATE("initial rate does not match 0x%x\n", tx_rate);
880 goto out; 880 goto out;
881 } 881 }
@@ -929,10 +929,7 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
929 rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index); 929 rs_get_tbl_info_from_mcs(tx_rate, priv->band, &tbl_type, &rs_index);
930 930
931 /* Update frame history window with "success" if Tx got ACKed ... */ 931 /* Update frame history window with "success" if Tx got ACKed ... */
932 if (tx_resp->flags & IEEE80211_TX_STATUS_ACK) 932 status = !!(info->flags & IEEE80211_TX_STAT_ACK);
933 status = 1;
934 else
935 status = 0;
936 933
937 /* If type matches "search" table, 934 /* If type matches "search" table,
938 * add final tx status to "search" history */ 935 * add final tx status to "search" history */
@@ -943,10 +940,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
943 tpt = search_tbl->expected_tpt[rs_index]; 940 tpt = search_tbl->expected_tpt[rs_index];
944 else 941 else
945 tpt = 0; 942 tpt = 0;
946 if (tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) 943 if (info->flags & IEEE80211_TX_CTL_AMPDU)
947 rs_collect_tx_data(search_win, rs_index, tpt, 944 rs_collect_tx_data(search_win, rs_index, tpt,
948 tx_resp->ampdu_ack_len, 945 info->status.ampdu_ack_len,
949 tx_resp->ampdu_ack_map); 946 info->status.ampdu_ack_map);
950 else 947 else
951 rs_collect_tx_data(search_win, rs_index, tpt, 948 rs_collect_tx_data(search_win, rs_index, tpt,
952 1, status); 949 1, status);
@@ -959,10 +956,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
959 tpt = curr_tbl->expected_tpt[rs_index]; 956 tpt = curr_tbl->expected_tpt[rs_index];
960 else 957 else
961 tpt = 0; 958 tpt = 0;
962 if (tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) 959 if (info->flags & IEEE80211_TX_CTL_AMPDU)
963 rs_collect_tx_data(window, rs_index, tpt, 960 rs_collect_tx_data(window, rs_index, tpt,
964 tx_resp->ampdu_ack_len, 961 info->status.ampdu_ack_len,
965 tx_resp->ampdu_ack_map); 962 info->status.ampdu_ack_map);
966 else 963 else
967 rs_collect_tx_data(window, rs_index, tpt, 964 rs_collect_tx_data(window, rs_index, tpt,
968 1, status); 965 1, status);
@@ -971,10 +968,10 @@ static void rs_tx_status(void *priv_rate, struct net_device *dev,
971 /* If not searching for new mode, increment success/failed counter 968 /* If not searching for new mode, increment success/failed counter
972 * ... these help determine when to start searching again */ 969 * ... these help determine when to start searching again */
973 if (lq_sta->stay_in_tbl) { 970 if (lq_sta->stay_in_tbl) {
974 if (tx_resp->control.flags & IEEE80211_TXCTL_AMPDU) { 971 if (info->flags & IEEE80211_TX_CTL_AMPDU) {
975 lq_sta->total_success += tx_resp->ampdu_ack_map; 972 lq_sta->total_success += info->status.ampdu_ack_map;
976 lq_sta->total_failed += 973 lq_sta->total_failed +=
977 (tx_resp->ampdu_ack_len - tx_resp->ampdu_ack_map); 974 (info->status.ampdu_ack_len - info->status.ampdu_ack_map);
978 } else { 975 } else {
979 if (status) 976 if (status)
980 lq_sta->total_success++; 977 lq_sta->total_success++;
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index fb670b5cfebb..ca9ca92bb7fd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -357,22 +357,22 @@ int iwl4965_hwrate_to_plcp_idx(u32 rate_n_flags)
357 * translate ucode response to mac80211 tx status control values 357 * translate ucode response to mac80211 tx status control values
358 */ 358 */
359void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags, 359void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, u32 rate_n_flags,
360 struct ieee80211_tx_control *control) 360 struct ieee80211_tx_info *control)
361{ 361{
362 int rate_index; 362 int rate_index;
363 363
364 control->antenna_sel_tx = 364 control->antenna_sel_tx =
365 ((rate_n_flags & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS); 365 ((rate_n_flags & RATE_MCS_ANT_ABC_MSK) >> RATE_MCS_ANT_POS);
366 if (rate_n_flags & RATE_MCS_HT_MSK) 366 if (rate_n_flags & RATE_MCS_HT_MSK)
367 control->flags |= IEEE80211_TXCTL_OFDM_HT; 367 control->flags |= IEEE80211_TX_CTL_OFDM_HT;
368 if (rate_n_flags & RATE_MCS_GF_MSK) 368 if (rate_n_flags & RATE_MCS_GF_MSK)
369 control->flags |= IEEE80211_TXCTL_GREEN_FIELD; 369 control->flags |= IEEE80211_TX_CTL_GREEN_FIELD;
370 if (rate_n_flags & RATE_MCS_FAT_MSK) 370 if (rate_n_flags & RATE_MCS_FAT_MSK)
371 control->flags |= IEEE80211_TXCTL_40_MHZ_WIDTH; 371 control->flags |= IEEE80211_TX_CTL_40_MHZ_WIDTH;
372 if (rate_n_flags & RATE_MCS_DUP_MSK) 372 if (rate_n_flags & RATE_MCS_DUP_MSK)
373 control->flags |= IEEE80211_TXCTL_DUP_DATA; 373 control->flags |= IEEE80211_TX_CTL_DUP_DATA;
374 if (rate_n_flags & RATE_MCS_SGI_MSK) 374 if (rate_n_flags & RATE_MCS_SGI_MSK)
375 control->flags |= IEEE80211_TXCTL_SHORT_GI; 375 control->flags |= IEEE80211_TX_CTL_SHORT_GI;
376 rate_index = iwl4965_hwrate_to_plcp_idx(rate_n_flags); 376 rate_index = iwl4965_hwrate_to_plcp_idx(rate_n_flags);
377 if (control->band == IEEE80211_BAND_5GHZ) 377 if (control->band == IEEE80211_BAND_5GHZ)
378 rate_index -= IWL_FIRST_OFDM_RATE; 378 rate_index -= IWL_FIRST_OFDM_RATE;
@@ -3007,7 +3007,7 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv,
3007 u16 scd_flow = le16_to_cpu(ba_resp->scd_flow); 3007 u16 scd_flow = le16_to_cpu(ba_resp->scd_flow);
3008 u64 bitmap; 3008 u64 bitmap;
3009 int successes = 0; 3009 int successes = 0;
3010 struct ieee80211_tx_status *tx_status; 3010 struct ieee80211_tx_info *info;
3011 3011
3012 if (unlikely(!agg->wait_for_ba)) { 3012 if (unlikely(!agg->wait_for_ba)) {
3013 IWL_ERROR("Received BA when not expected\n"); 3013 IWL_ERROR("Received BA when not expected\n");
@@ -3045,13 +3045,13 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv,
3045 agg->start_idx + i); 3045 agg->start_idx + i);
3046 } 3046 }
3047 3047
3048 tx_status = &priv->txq[scd_flow].txb[agg->start_idx].status; 3048 info = IEEE80211_SKB_CB(priv->txq[scd_flow].txb[agg->start_idx].skb[0]);
3049 tx_status->flags = IEEE80211_TX_STATUS_ACK; 3049 memset(&info->status, 0, sizeof(info->status));
3050 tx_status->flags |= IEEE80211_TX_STATUS_AMPDU; 3050 info->flags = IEEE80211_TX_STAT_ACK;
3051 tx_status->ampdu_ack_map = successes; 3051 info->flags |= IEEE80211_TX_STAT_AMPDU;
3052 tx_status->ampdu_ack_len = agg->frame_count; 3052 info->status.ampdu_ack_map = successes;
3053 iwl4965_hwrate_to_tx_control(priv, agg->rate_n_flags, 3053 info->status.ampdu_ack_len = agg->frame_count;
3054 &tx_status->control); 3054 iwl4965_hwrate_to_tx_control(priv, agg->rate_n_flags, info);
3055 3055
3056 IWL_DEBUG_TX_REPLY("Bitmap %llx\n", (unsigned long long)bitmap); 3056 IWL_DEBUG_TX_REPLY("Bitmap %llx\n", (unsigned long long)bitmap);
3057 3057
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index a8d062f7b87a..ad7422eadab2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -207,8 +207,7 @@ void iwl_rx_allocate(struct iwl_priv *priv);
207* TX 207* TX
208******************************************************/ 208******************************************************/
209int iwl_txq_ctx_reset(struct iwl_priv *priv); 209int iwl_txq_ctx_reset(struct iwl_priv *priv);
210int iwl_tx_skb(struct iwl_priv *priv, 210int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb);
211 struct sk_buff *skb, struct ieee80211_tx_control *ctl);
212/* FIXME: remove when free Tx is fully merged into iwlcore */ 211/* FIXME: remove when free Tx is fully merged into iwlcore */
213int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq); 212int iwl_hw_txq_free_tfd(struct iwl_priv *priv, struct iwl_tx_queue *txq);
214void iwl_hw_txq_ctx_free(struct iwl_priv *priv); 213void iwl_hw_txq_ctx_free(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 820542bac443..f7fd8ea61779 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -119,7 +119,6 @@ struct iwl_queue {
119 119
120/* One for each TFD */ 120/* One for each TFD */
121struct iwl_tx_info { 121struct iwl_tx_info {
122 struct ieee80211_tx_status status;
123 struct sk_buff *skb[MAX_NUM_OF_TBS]; 122 struct sk_buff *skb[MAX_NUM_OF_TBS];
124}; 123};
125 124
@@ -693,7 +692,7 @@ extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
693 struct iwl_frame *frame, u8 rate); 692 struct iwl_frame *frame, u8 rate);
694extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv, 693extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,
695 struct iwl_cmd *cmd, 694 struct iwl_cmd *cmd,
696 struct ieee80211_tx_control *ctrl, 695 struct ieee80211_tx_info *info,
697 struct ieee80211_hdr *hdr, 696 struct ieee80211_hdr *hdr,
698 int sta_id, int tx_id); 697 int sta_id, int tx_id);
699extern int iwl4965_hw_reg_send_txpower(struct iwl_priv *priv); 698extern int iwl4965_hw_reg_send_txpower(struct iwl_priv *priv);
@@ -749,7 +748,7 @@ extern void iwl4965_update_rate_scaling(struct iwl_priv *priv, u8 mode);
749extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv); 748extern void iwl4965_rf_kill_ct_config(struct iwl_priv *priv);
750extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv, 749extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv,
751 u32 rate_n_flags, 750 u32 rate_n_flags,
752 struct ieee80211_tx_control *control); 751 struct ieee80211_tx_info *info);
753 752
754#ifdef CONFIG_IWL4965_HT 753#ifdef CONFIG_IWL4965_HT
755extern void iwl4965_init_ht_hw_capab(const struct iwl_priv *priv, 754extern void iwl4965_init_ht_hw_capab(const struct iwl_priv *priv,
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 4b5149c8c32e..a61293ba3f6b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -502,7 +502,7 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv)
502 */ 502 */
503static void iwl_tx_cmd_build_basic(struct iwl_priv *priv, 503static void iwl_tx_cmd_build_basic(struct iwl_priv *priv,
504 struct iwl_tx_cmd *tx_cmd, 504 struct iwl_tx_cmd *tx_cmd,
505 struct ieee80211_tx_control *ctrl, 505 struct ieee80211_tx_info *info,
506 struct ieee80211_hdr *hdr, 506 struct ieee80211_hdr *hdr,
507 int is_unicast, u8 std_id) 507 int is_unicast, u8 std_id)
508{ 508{
@@ -510,7 +510,7 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv,
510 __le32 tx_flags = tx_cmd->tx_flags; 510 __le32 tx_flags = tx_cmd->tx_flags;
511 511
512 tx_cmd->stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 512 tx_cmd->stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
513 if (!(ctrl->flags & IEEE80211_TXCTL_NO_ACK)) { 513 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
514 tx_flags |= TX_CMD_FLG_ACK_MSK; 514 tx_flags |= TX_CMD_FLG_ACK_MSK;
515 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) 515 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)
516 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 516 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
@@ -538,10 +538,10 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv,
538 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 538 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
539 } 539 }
540 540
541 if (ctrl->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 541 if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
542 tx_flags |= TX_CMD_FLG_RTS_MSK; 542 tx_flags |= TX_CMD_FLG_RTS_MSK;
543 tx_flags &= ~TX_CMD_FLG_CTS_MSK; 543 tx_flags &= ~TX_CMD_FLG_CTS_MSK;
544 } else if (ctrl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { 544 } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) {
545 tx_flags &= ~TX_CMD_FLG_RTS_MSK; 545 tx_flags &= ~TX_CMD_FLG_RTS_MSK;
546 tx_flags |= TX_CMD_FLG_CTS_MSK; 546 tx_flags |= TX_CMD_FLG_CTS_MSK;
547 } 547 }
@@ -570,7 +570,7 @@ static void iwl_tx_cmd_build_basic(struct iwl_priv *priv,
570 570
571static void iwl_tx_cmd_build_rate(struct iwl_priv *priv, 571static void iwl_tx_cmd_build_rate(struct iwl_priv *priv,
572 struct iwl_tx_cmd *tx_cmd, 572 struct iwl_tx_cmd *tx_cmd,
573 struct ieee80211_tx_control *ctrl, 573 struct ieee80211_tx_info *info,
574 u16 fc, int sta_id, 574 u16 fc, int sta_id,
575 int is_hcca) 575 int is_hcca)
576{ 576{
@@ -580,7 +580,7 @@ static void iwl_tx_cmd_build_rate(struct iwl_priv *priv,
580 u16 rate_flags = 0; 580 u16 rate_flags = 0;
581 int rate_idx; 581 int rate_idx;
582 582
583 rate_idx = min(ieee80211_get_tx_rate(priv->hw, ctrl)->hw_value & 0xffff, 583 rate_idx = min(ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xffff,
584 IWL_RATE_COUNT - 1); 584 IWL_RATE_COUNT - 1);
585 585
586 rate_plcp = iwl_rates[rate_idx].plcp; 586 rate_plcp = iwl_rates[rate_idx].plcp;
@@ -637,18 +637,18 @@ static void iwl_tx_cmd_build_rate(struct iwl_priv *priv,
637} 637}
638 638
639static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv, 639static void iwl_tx_cmd_build_hwcrypto(struct iwl_priv *priv,
640 struct ieee80211_tx_control *ctl, 640 struct ieee80211_tx_info *info,
641 struct iwl_tx_cmd *tx_cmd, 641 struct iwl_tx_cmd *tx_cmd,
642 struct sk_buff *skb_frag, 642 struct sk_buff *skb_frag,
643 int sta_id) 643 int sta_id)
644{ 644{
645 struct ieee80211_key_conf *keyconf = ctl->hw_key; 645 struct ieee80211_key_conf *keyconf = info->control.hw_key;
646 646
647 switch (keyconf->alg) { 647 switch (keyconf->alg) {
648 case ALG_CCMP: 648 case ALG_CCMP:
649 tx_cmd->sec_ctl = TX_CMD_SEC_CCM; 649 tx_cmd->sec_ctl = TX_CMD_SEC_CCM;
650 memcpy(tx_cmd->key, keyconf->key, keyconf->keylen); 650 memcpy(tx_cmd->key, keyconf->key, keyconf->keylen);
651 if (ctl->flags & IEEE80211_TXCTL_AMPDU) 651 if (info->flags & IEEE80211_TX_CTL_AMPDU)
652 tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK; 652 tx_cmd->tx_flags |= TX_CMD_FLG_AGG_CCMP_MSK;
653 IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n"); 653 IWL_DEBUG_TX("tx_cmd with aes hwcrypto\n");
654 break; 654 break;
@@ -690,13 +690,13 @@ static void iwl_update_tx_stats(struct iwl_priv *priv, u16 fc, u16 len)
690/* 690/*
691 * start REPLY_TX command process 691 * start REPLY_TX command process
692 */ 692 */
693int iwl_tx_skb(struct iwl_priv *priv, 693int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
694 struct sk_buff *skb, struct ieee80211_tx_control *ctl)
695{ 694{
696 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 695 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
696 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
697 struct iwl_tfd_frame *tfd; 697 struct iwl_tfd_frame *tfd;
698 u32 *control_flags; 698 u32 *control_flags;
699 int txq_id = ctl->queue; 699 int txq_id = info->queue;
700 struct iwl_tx_queue *txq = NULL; 700 struct iwl_tx_queue *txq = NULL;
701 struct iwl_queue *q = NULL; 701 struct iwl_queue *q = NULL;
702 dma_addr_t phys_addr; 702 dma_addr_t phys_addr;
@@ -726,7 +726,7 @@ int iwl_tx_skb(struct iwl_priv *priv,
726 goto drop_unlock; 726 goto drop_unlock;
727 } 727 }
728 728
729 if ((ieee80211_get_tx_rate(priv->hw, ctl)->hw_value & 0xFF) == 729 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) ==
730 IWL_INVALID_RATE) { 730 IWL_INVALID_RATE) {
731 IWL_ERROR("ERROR: No TX rate available.\n"); 731 IWL_ERROR("ERROR: No TX rate available.\n");
732 goto drop_unlock; 732 goto drop_unlock;
@@ -782,7 +782,7 @@ int iwl_tx_skb(struct iwl_priv *priv,
782 seq_number += 0x10; 782 seq_number += 0x10;
783#ifdef CONFIG_IWL4965_HT 783#ifdef CONFIG_IWL4965_HT
784 /* aggregation is on for this <sta,tid> */ 784 /* aggregation is on for this <sta,tid> */
785 if (ctl->flags & IEEE80211_TXCTL_AMPDU) 785 if (info->flags & IEEE80211_TX_CTL_AMPDU)
786 txq_id = priv->stations[sta_id].tid[tid].agg.txq_id; 786 txq_id = priv->stations[sta_id].tid[tid].agg.txq_id;
787 priv->stations[sta_id].tid[tid].tfds_in_queue++; 787 priv->stations[sta_id].tid[tid].tfds_in_queue++;
788#endif /* CONFIG_IWL4965_HT */ 788#endif /* CONFIG_IWL4965_HT */
@@ -803,8 +803,6 @@ int iwl_tx_skb(struct iwl_priv *priv,
803 /* Set up driver data for this TFD */ 803 /* Set up driver data for this TFD */
804 memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info)); 804 memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl_tx_info));
805 txq->txb[q->write_ptr].skb[0] = skb; 805 txq->txb[q->write_ptr].skb[0] = skb;
806 memcpy(&(txq->txb[q->write_ptr].status.control),
807 ctl, sizeof(struct ieee80211_tx_control));
808 806
809 /* Set up first empty entry in queue's array of Tx/cmd buffers */ 807 /* Set up first empty entry in queue's array of Tx/cmd buffers */
810 out_cmd = &txq->cmd[idx]; 808 out_cmd = &txq->cmd[idx];
@@ -854,8 +852,8 @@ int iwl_tx_skb(struct iwl_priv *priv,
854 * first entry */ 852 * first entry */
855 iwl_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len); 853 iwl_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len);
856 854
857 if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) 855 if (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT))
858 iwl_tx_cmd_build_hwcrypto(priv, ctl, tx_cmd, skb, sta_id); 856 iwl_tx_cmd_build_hwcrypto(priv, info, tx_cmd, skb, sta_id);
859 857
860 /* Set up TFD's 2nd entry to point directly to remainder of skb, 858 /* Set up TFD's 2nd entry to point directly to remainder of skb,
861 * if any (802.11 null frames have no payload). */ 859 * if any (802.11 null frames have no payload). */
@@ -874,10 +872,10 @@ int iwl_tx_skb(struct iwl_priv *priv,
874 len = (u16)skb->len; 872 len = (u16)skb->len;
875 tx_cmd->len = cpu_to_le16(len); 873 tx_cmd->len = cpu_to_le16(len);
876 /* TODO need this for burst mode later on */ 874 /* TODO need this for burst mode later on */
877 iwl_tx_cmd_build_basic(priv, tx_cmd, ctl, hdr, unicast, sta_id); 875 iwl_tx_cmd_build_basic(priv, tx_cmd, info, hdr, unicast, sta_id);
878 876
879 /* set is_hcca to 0; it probably will never be implemented */ 877 /* set is_hcca to 0; it probably will never be implemented */
880 iwl_tx_cmd_build_rate(priv, tx_cmd, ctl, fc, sta_id, 0); 878 iwl_tx_cmd_build_rate(priv, tx_cmd, info, fc, sta_id, 0);
881 879
882 iwl_update_tx_stats(priv, fc, len); 880 iwl_update_tx_stats(priv, fc, len);
883 881
@@ -919,7 +917,7 @@ int iwl_tx_skb(struct iwl_priv *priv,
919 spin_unlock_irqrestore(&priv->lock, flags); 917 spin_unlock_irqrestore(&priv->lock, flags);
920 } 918 }
921 919
922 ieee80211_stop_queue(priv->hw, ctl->queue); 920 ieee80211_stop_queue(priv->hw, info->queue);
923 } 921 }
924 922
925 return 0; 923 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index a28b4c9f6524..a740a1817d16 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2376,13 +2376,13 @@ static int iwl3945_set_mode(struct iwl3945_priv *priv, int mode)
2376} 2376}
2377 2377
2378static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv, 2378static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2379 struct ieee80211_tx_control *ctl, 2379 struct ieee80211_tx_info *info,
2380 struct iwl3945_cmd *cmd, 2380 struct iwl3945_cmd *cmd,
2381 struct sk_buff *skb_frag, 2381 struct sk_buff *skb_frag,
2382 int last_frag) 2382 int last_frag)
2383{ 2383{
2384 struct iwl3945_hw_key *keyinfo = 2384 struct iwl3945_hw_key *keyinfo =
2385 &priv->stations[ctl->hw_key->hw_key_idx].keyinfo; 2385 &priv->stations[info->control.hw_key->hw_key_idx].keyinfo;
2386 2386
2387 switch (keyinfo->alg) { 2387 switch (keyinfo->alg) {
2388 case ALG_CCMP: 2388 case ALG_CCMP:
@@ -2405,7 +2405,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2405 2405
2406 case ALG_WEP: 2406 case ALG_WEP:
2407 cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP | 2407 cmd->cmd.tx.sec_ctl = TX_CMD_SEC_WEP |
2408 (ctl->hw_key->hw_key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT; 2408 (info->control.hw_key->hw_key_idx & TX_CMD_SEC_MSK) << TX_CMD_SEC_SHIFT;
2409 2409
2410 if (keyinfo->keylen == 13) 2410 if (keyinfo->keylen == 13)
2411 cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128; 2411 cmd->cmd.tx.sec_ctl |= TX_CMD_SEC_KEY128;
@@ -2413,7 +2413,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2413 memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen); 2413 memcpy(&cmd->cmd.tx.key[3], keyinfo->key, keyinfo->keylen);
2414 2414
2415 IWL_DEBUG_TX("Configuring packet for WEP encryption " 2415 IWL_DEBUG_TX("Configuring packet for WEP encryption "
2416 "with key %d\n", ctl->hw_key->hw_key_idx); 2416 "with key %d\n", info->control.hw_key->hw_key_idx);
2417 break; 2417 break;
2418 2418
2419 default: 2419 default:
@@ -2427,7 +2427,7 @@ static void iwl3945_build_tx_cmd_hwcrypto(struct iwl3945_priv *priv,
2427 */ 2427 */
2428static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv, 2428static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
2429 struct iwl3945_cmd *cmd, 2429 struct iwl3945_cmd *cmd,
2430 struct ieee80211_tx_control *ctrl, 2430 struct ieee80211_tx_info *info,
2431 struct ieee80211_hdr *hdr, 2431 struct ieee80211_hdr *hdr,
2432 int is_unicast, u8 std_id) 2432 int is_unicast, u8 std_id)
2433{ 2433{
@@ -2435,7 +2435,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
2435 __le32 tx_flags = cmd->cmd.tx.tx_flags; 2435 __le32 tx_flags = cmd->cmd.tx.tx_flags;
2436 2436
2437 cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 2437 cmd->cmd.tx.stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
2438 if (!(ctrl->flags & IEEE80211_TXCTL_NO_ACK)) { 2438 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
2439 tx_flags |= TX_CMD_FLG_ACK_MSK; 2439 tx_flags |= TX_CMD_FLG_ACK_MSK;
2440 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT) 2440 if ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)
2441 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 2441 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
@@ -2459,10 +2459,10 @@ static void iwl3945_build_tx_cmd_basic(struct iwl3945_priv *priv,
2459 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 2459 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
2460 } 2460 }
2461 2461
2462 if (ctrl->flags & IEEE80211_TXCTL_USE_RTS_CTS) { 2462 if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) {
2463 tx_flags |= TX_CMD_FLG_RTS_MSK; 2463 tx_flags |= TX_CMD_FLG_RTS_MSK;
2464 tx_flags &= ~TX_CMD_FLG_CTS_MSK; 2464 tx_flags &= ~TX_CMD_FLG_CTS_MSK;
2465 } else if (ctrl->flags & IEEE80211_TXCTL_USE_CTS_PROTECT) { 2465 } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) {
2466 tx_flags &= ~TX_CMD_FLG_RTS_MSK; 2466 tx_flags &= ~TX_CMD_FLG_RTS_MSK;
2467 tx_flags |= TX_CMD_FLG_CTS_MSK; 2467 tx_flags |= TX_CMD_FLG_CTS_MSK;
2468 } 2468 }
@@ -2546,13 +2546,13 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2546/* 2546/*
2547 * start REPLY_TX command process 2547 * start REPLY_TX command process
2548 */ 2548 */
2549static int iwl3945_tx_skb(struct iwl3945_priv *priv, 2549static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
2550 struct sk_buff *skb, struct ieee80211_tx_control *ctl)
2551{ 2550{
2552 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 2551 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2552 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
2553 struct iwl3945_tfd_frame *tfd; 2553 struct iwl3945_tfd_frame *tfd;
2554 u32 *control_flags; 2554 u32 *control_flags;
2555 int txq_id = ctl->queue; 2555 int txq_id = info->queue;
2556 struct iwl3945_tx_queue *txq = NULL; 2556 struct iwl3945_tx_queue *txq = NULL;
2557 struct iwl3945_queue *q = NULL; 2557 struct iwl3945_queue *q = NULL;
2558 dma_addr_t phys_addr; 2558 dma_addr_t phys_addr;
@@ -2581,7 +2581,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2581 goto drop_unlock; 2581 goto drop_unlock;
2582 } 2582 }
2583 2583
2584 if ((ieee80211_get_tx_rate(priv->hw, ctl)->hw_value & 0xFF) == IWL_INVALID_RATE) { 2584 if ((ieee80211_get_tx_rate(priv->hw, info)->hw_value & 0xFF) == IWL_INVALID_RATE) {
2585 IWL_ERROR("ERROR: No TX rate available.\n"); 2585 IWL_ERROR("ERROR: No TX rate available.\n");
2586 goto drop_unlock; 2586 goto drop_unlock;
2587 } 2587 }
@@ -2650,8 +2650,6 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2650 /* Set up driver data for this TFD */ 2650 /* Set up driver data for this TFD */
2651 memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl3945_tx_info)); 2651 memset(&(txq->txb[q->write_ptr]), 0, sizeof(struct iwl3945_tx_info));
2652 txq->txb[q->write_ptr].skb[0] = skb; 2652 txq->txb[q->write_ptr].skb[0] = skb;
2653 memcpy(&(txq->txb[q->write_ptr].status.control),
2654 ctl, sizeof(struct ieee80211_tx_control));
2655 2653
2656 /* Init first empty entry in queue's array of Tx/cmd buffers */ 2654 /* Init first empty entry in queue's array of Tx/cmd buffers */
2657 out_cmd = &txq->cmd[idx]; 2655 out_cmd = &txq->cmd[idx];
@@ -2700,8 +2698,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2700 * first entry */ 2698 * first entry */
2701 iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len); 2699 iwl3945_hw_txq_attach_buf_to_tfd(priv, tfd, txcmd_phys, len);
2702 2700
2703 if (!(ctl->flags & IEEE80211_TXCTL_DO_NOT_ENCRYPT)) 2701 if (!(info->flags & IEEE80211_TX_CTL_DO_NOT_ENCRYPT))
2704 iwl3945_build_tx_cmd_hwcrypto(priv, ctl, out_cmd, skb, 0); 2702 iwl3945_build_tx_cmd_hwcrypto(priv, info, out_cmd, skb, 0);
2705 2703
2706 /* Set up TFD's 2nd entry to point directly to remainder of skb, 2704 /* Set up TFD's 2nd entry to point directly to remainder of skb,
2707 * if any (802.11 null frames have no payload). */ 2705 * if any (802.11 null frames have no payload). */
@@ -2726,10 +2724,10 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2726 out_cmd->cmd.tx.len = cpu_to_le16(len); 2724 out_cmd->cmd.tx.len = cpu_to_le16(len);
2727 2725
2728 /* TODO need this for burst mode later on */ 2726 /* TODO need this for burst mode later on */
2729 iwl3945_build_tx_cmd_basic(priv, out_cmd, ctl, hdr, unicast, sta_id); 2727 iwl3945_build_tx_cmd_basic(priv, out_cmd, info, hdr, unicast, sta_id);
2730 2728
2731 /* set is_hcca to 0; it probably will never be implemented */ 2729 /* set is_hcca to 0; it probably will never be implemented */
2732 iwl3945_hw_build_tx_cmd_rate(priv, out_cmd, ctl, hdr, sta_id, 0); 2730 iwl3945_hw_build_tx_cmd_rate(priv, out_cmd, info, hdr, sta_id, 0);
2733 2731
2734 out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_A_MSK; 2732 out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_A_MSK;
2735 out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_B_MSK; 2733 out_cmd->cmd.tx.tx_flags &= ~TX_CMD_FLG_ANT_B_MSK;
@@ -2767,7 +2765,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv,
2767 spin_unlock_irqrestore(&priv->lock, flags); 2765 spin_unlock_irqrestore(&priv->lock, flags);
2768 } 2766 }
2769 2767
2770 ieee80211_stop_queue(priv->hw, ctl->queue); 2768 ieee80211_stop_queue(priv->hw, info->queue);
2771 } 2769 }
2772 2770
2773 return 0; 2771 return 0;
@@ -3230,7 +3228,7 @@ static void iwl3945_bg_beacon_update(struct work_struct *work)
3230 struct sk_buff *beacon; 3228 struct sk_buff *beacon;
3231 3229
3232 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ 3230 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
3233 beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); 3231 beacon = ieee80211_beacon_get(priv->hw, priv->vif);
3234 3232
3235 if (!beacon) { 3233 if (!beacon) {
3236 IWL_ERROR("update beacon failed\n"); 3234 IWL_ERROR("update beacon failed\n");
@@ -6681,8 +6679,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
6681 IWL_DEBUG_MAC80211("leave\n"); 6679 IWL_DEBUG_MAC80211("leave\n");
6682} 6680}
6683 6681
6684static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, 6682static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
6685 struct ieee80211_tx_control *ctl)
6686{ 6683{
6687 struct iwl3945_priv *priv = hw->priv; 6684 struct iwl3945_priv *priv = hw->priv;
6688 6685
@@ -6694,9 +6691,9 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
6694 } 6691 }
6695 6692
6696 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 6693 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
6697 ieee80211_get_tx_rate(hw, ctl)->bitrate); 6694 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
6698 6695
6699 if (iwl3945_tx_skb(priv, skb, ctl)) 6696 if (iwl3945_tx_skb(priv, skb))
6700 dev_kfree_skb_any(skb); 6697 dev_kfree_skb_any(skb);
6701 6698
6702 IWL_DEBUG_MAC80211("leave\n"); 6699 IWL_DEBUG_MAC80211("leave\n");
@@ -7333,8 +7330,7 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
7333 7330
7334} 7331}
7335 7332
7336static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, 7333static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
7337 struct ieee80211_tx_control *control)
7338{ 7334{
7339 struct iwl3945_priv *priv = hw->priv; 7335 struct iwl3945_priv *priv = hw->priv;
7340 unsigned long flags; 7336 unsigned long flags;
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 1fad6227aa51..07c52b69d1e2 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -1606,17 +1606,7 @@ static int iwl4965_get_measurement(struct iwl_priv *priv,
1606static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv, 1606static void iwl4965_txstatus_to_ieee(struct iwl_priv *priv,
1607 struct iwl_tx_info *tx_sta) 1607 struct iwl_tx_info *tx_sta)
1608{ 1608{
1609 1609 ieee80211_tx_status_irqsafe(priv->hw, tx_sta->skb[0]);
1610 tx_sta->status.ack_signal = 0;
1611 tx_sta->status.excessive_retries = 0;
1612
1613 if (in_interrupt())
1614 ieee80211_tx_status_irqsafe(priv->hw,
1615 tx_sta->skb[0], &(tx_sta->status));
1616 else
1617 ieee80211_tx_status(priv->hw,
1618 tx_sta->skb[0], &(tx_sta->status));
1619
1620 tx_sta->skb[0] = NULL; 1610 tx_sta->skb[0] = NULL;
1621} 1611}
1622 1612
@@ -1710,7 +1700,7 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
1710{ 1700{
1711 u16 status; 1701 u16 status;
1712 struct agg_tx_status *frame_status = &tx_resp->status; 1702 struct agg_tx_status *frame_status = &tx_resp->status;
1713 struct ieee80211_tx_status *tx_status = NULL; 1703 struct ieee80211_tx_info *info = NULL;
1714 struct ieee80211_hdr *hdr = NULL; 1704 struct ieee80211_hdr *hdr = NULL;
1715 int i, sh; 1705 int i, sh;
1716 int txq_id, idx; 1706 int txq_id, idx;
@@ -1736,14 +1726,14 @@ static int iwl4965_tx_status_reply_tx(struct iwl_priv *priv,
1736 IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n", 1726 IWL_DEBUG_TX_REPLY("FrameCnt = %d, StartIdx=%d idx=%d\n",
1737 agg->frame_count, agg->start_idx, idx); 1727 agg->frame_count, agg->start_idx, idx);
1738 1728
1739 tx_status = &(priv->txq[txq_id].txb[idx].status); 1729 info = IEEE80211_SKB_CB(priv->txq[txq_id].txb[idx].skb[0]);
1740 tx_status->retry_count = tx_resp->failure_frame; 1730 info->status.retry_count = tx_resp->failure_frame;
1741 tx_status->control.flags &= ~IEEE80211_TXCTL_AMPDU; 1731 info->flags &= ~IEEE80211_TX_CTL_AMPDU;
1742 tx_status->flags = iwl4965_is_tx_success(status)? 1732 info->flags |= iwl4965_is_tx_success(status)?
1743 IEEE80211_TX_STATUS_ACK : 0; 1733 IEEE80211_TX_STAT_ACK : 0;
1744 iwl4965_hwrate_to_tx_control(priv, 1734 iwl4965_hwrate_to_tx_control(priv,
1745 le32_to_cpu(tx_resp->rate_n_flags), 1735 le32_to_cpu(tx_resp->rate_n_flags),
1746 &tx_status->control); 1736 info);
1747 /* FIXME: code repetition end */ 1737 /* FIXME: code repetition end */
1748 1738
1749 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n", 1739 IWL_DEBUG_TX_REPLY("1 Frame 0x%x failure :%d\n",
@@ -1830,7 +1820,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
1830 int txq_id = SEQ_TO_QUEUE(sequence); 1820 int txq_id = SEQ_TO_QUEUE(sequence);
1831 int index = SEQ_TO_INDEX(sequence); 1821 int index = SEQ_TO_INDEX(sequence);
1832 struct iwl_tx_queue *txq = &priv->txq[txq_id]; 1822 struct iwl_tx_queue *txq = &priv->txq[txq_id];
1833 struct ieee80211_tx_status *tx_status; 1823 struct ieee80211_tx_info *info;
1834 struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; 1824 struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
1835 u32 status = le32_to_cpu(tx_resp->status); 1825 u32 status = le32_to_cpu(tx_resp->status);
1836#ifdef CONFIG_IWL4965_HT 1826#ifdef CONFIG_IWL4965_HT
@@ -1848,6 +1838,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
1848 return; 1838 return;
1849 } 1839 }
1850 1840
1841 info = IEEE80211_SKB_CB(txq->txb[txq->q.read_ptr].skb[0]);
1842 memset(&info->status, 0, sizeof(info->status));
1843
1851#ifdef CONFIG_IWL4965_HT 1844#ifdef CONFIG_IWL4965_HT
1852 hdr = iwl4965_tx_queue_get_hdr(priv, txq_id, index); 1845 hdr = iwl4965_tx_queue_get_hdr(priv, txq_id, index);
1853 fc = le16_to_cpu(hdr->frame_control); 1846 fc = le16_to_cpu(hdr->frame_control);
@@ -1902,13 +1895,12 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
1902 } 1895 }
1903 } else { 1896 } else {
1904#endif /* CONFIG_IWL4965_HT */ 1897#endif /* CONFIG_IWL4965_HT */
1905 tx_status = &(txq->txb[txq->q.read_ptr].status);
1906 1898
1907 tx_status->retry_count = tx_resp->failure_frame; 1899 info->status.retry_count = tx_resp->failure_frame;
1908 tx_status->flags = 1900 info->flags |=
1909 iwl4965_is_tx_success(status) ? IEEE80211_TX_STATUS_ACK : 0; 1901 iwl4965_is_tx_success(status) ? IEEE80211_TX_STAT_ACK : 0;
1910 iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags), 1902 iwl4965_hwrate_to_tx_control(priv, le32_to_cpu(tx_resp->rate_n_flags),
1911 &tx_status->control); 1903 info);
1912 1904
1913 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x " 1905 IWL_DEBUG_TX("Tx queue %d Status %s (0x%08x) rate_n_flags 0x%x "
1914 "retries %d\n", txq_id, iwl4965_get_tx_fail_reason(status), 1906 "retries %d\n", txq_id, iwl4965_get_tx_fail_reason(status),
@@ -2053,7 +2045,7 @@ static void iwl4965_bg_beacon_update(struct work_struct *work)
2053 struct sk_buff *beacon; 2045 struct sk_buff *beacon;
2054 2046
2055 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */ 2047 /* Pull updated AP beacon from mac80211. will fail if not in AP mode */
2056 beacon = ieee80211_beacon_get(priv->hw, priv->vif, NULL); 2048 beacon = ieee80211_beacon_get(priv->hw, priv->vif);
2057 2049
2058 if (!beacon) { 2050 if (!beacon) {
2059 IWL_ERROR("update beacon failed\n"); 2051 IWL_ERROR("update beacon failed\n");
@@ -4268,8 +4260,7 @@ static void iwl4965_mac_stop(struct ieee80211_hw *hw)
4268 IWL_DEBUG_MAC80211("leave\n"); 4260 IWL_DEBUG_MAC80211("leave\n");
4269} 4261}
4270 4262
4271static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb, 4263static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
4272 struct ieee80211_tx_control *ctl)
4273{ 4264{
4274 struct iwl_priv *priv = hw->priv; 4265 struct iwl_priv *priv = hw->priv;
4275 4266
@@ -4281,9 +4272,9 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
4281 } 4272 }
4282 4273
4283 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 4274 IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
4284 ieee80211_get_tx_rate(hw, ctl)->bitrate); 4275 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
4285 4276
4286 if (iwl_tx_skb(priv, skb, ctl)) 4277 if (iwl_tx_skb(priv, skb))
4287 dev_kfree_skb_any(skb); 4278 dev_kfree_skb_any(skb);
4288 4279
4289 IWL_DEBUG_MAC80211("leave\n"); 4280 IWL_DEBUG_MAC80211("leave\n");
@@ -5065,8 +5056,7 @@ static void iwl4965_mac_reset_tsf(struct ieee80211_hw *hw)
5065 IWL_DEBUG_MAC80211("leave\n"); 5056 IWL_DEBUG_MAC80211("leave\n");
5066} 5057}
5067 5058
5068static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb, 5059static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
5069 struct ieee80211_tx_control *control)
5070{ 5060{
5071 struct iwl_priv *priv = hw->priv; 5061 struct iwl_priv *priv = hw->priv;
5072 unsigned long flags; 5062 unsigned long flags;