aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-08-24 12:25:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-08-24 12:25:30 -0400
commitf20b6213f193f455a62ef9299ceca11f5531dff8 (patch)
tree737a14af45038252fc0e3863d62dde09432cd779 /drivers/net/wireless
parente6e94e392fddb8845bdd2e199f55ebf7d76cb58d (diff)
parenta4881cc45a3fab4488e16c4934e149cfa620f1a9 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/adm8211.c4
-rw-r--r--drivers/net/wireless/at76c50x-usb.c4
-rw-r--r--drivers/net/wireless/ath/ath5k/mac80211-ops.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_beacon.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c35
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_txrx.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c5
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c9
-rw-r--r--drivers/net/wireless/ath/carl9170/carl9170.h5
-rw-r--r--drivers/net/wireless/ath/carl9170/rx.c15
-rw-r--r--drivers/net/wireless/ath/carl9170/tx.c16
-rw-r--r--drivers/net/wireless/b43/main.c3
-rw-r--r--drivers/net/wireless/b43legacy/main.c1
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c6
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c12
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c26
-rw-r--r--drivers/net/wireless/iwlegacy/4965.h8
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/agn.h13
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/debugfs.c56
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/mac80211.c8
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/main.c24
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/sta.c2
-rw-r--r--drivers/net/wireless/iwlwifi/dvm/tx.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.c141
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.h6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-op-mode.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h12
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/drv.c6
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/internal.h1
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c16
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c28
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/tx.c26
-rw-r--r--drivers/net/wireless/libertas_tf/main.c4
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c8
-rw-r--r--drivers/net/wireless/mwl8k.c17
-rw-r--r--drivers/net/wireless/p54/lmac.h4
-rw-r--r--drivers/net/wireless/p54/main.c2
-rw-r--r--drivers/net/wireless/p54/txrx.c15
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c20
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c6
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c6
-rw-r--r--drivers/net/wireless/rtlwifi/base.c3
-rw-r--r--drivers/net/wireless/rtlwifi/core.c8
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c16
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.c5
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192ce/trx.h1
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.c5
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192cu/trx.h4
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.c5
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192de/trx.h1
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.c5
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192se/trx.h1
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c15
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h13
-rw-r--r--drivers/net/wireless/ti/wl1251/main.c4
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c6
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.c61
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.h4
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c6
64 files changed, 523 insertions, 250 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 689a71c1af71..154a4965be4f 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1661,7 +1661,9 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
1661} 1661}
1662 1662
1663/* Put adm8211_tx_hdr on skb and transmit */ 1663/* Put adm8211_tx_hdr on skb and transmit */
1664static void adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 1664static void adm8211_tx(struct ieee80211_hw *dev,
1665 struct ieee80211_tx_control *control,
1666 struct sk_buff *skb)
1665{ 1667{
1666 struct adm8211_tx_hdr *txhdr; 1668 struct adm8211_tx_hdr *txhdr;
1667 size_t payload_len, hdrlen; 1669 size_t payload_len, hdrlen;
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 88b8d64c90f1..e361afed99ff 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1726,7 +1726,9 @@ static void at76_mac80211_tx_callback(struct urb *urb)
1726 ieee80211_wake_queues(priv->hw); 1726 ieee80211_wake_queues(priv->hw);
1727} 1727}
1728 1728
1729static void at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1729static void at76_mac80211_tx(struct ieee80211_hw *hw,
1730 struct ieee80211_tx_control *control,
1731 struct sk_buff *skb)
1730{ 1732{
1731 struct at76_priv *priv = hw->priv; 1733 struct at76_priv *priv = hw->priv;
1732 struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer; 1734 struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index 384e67af73bc..df61a09adb6d 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -55,7 +55,8 @@
55\********************/ 55\********************/
56 56
57static void 57static void
58ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 58ath5k_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
59 struct sk_buff *skb)
59{ 60{
60 struct ath5k_hw *ah = hw->priv; 61 struct ath5k_hw *ah = hw->priv;
61 u16 qnum = skb_get_queue_mapping(skb); 62 u16 qnum = skb_get_queue_mapping(skb);
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index b09285c36c4a..7373e4b92c92 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -280,6 +280,7 @@ struct ath_tx_control {
280 struct ath_txq *txq; 280 struct ath_txq *txq;
281 struct ath_node *an; 281 struct ath_node *an;
282 u8 paprd; 282 u8 paprd;
283 struct ieee80211_sta *sta;
283}; 284};
284 285
285#define ATH_TX_ERROR 0x01 286#define ATH_TX_ERROR 0x01
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h
index 936e920fb88e..b30596fcf73a 100644
--- a/drivers/net/wireless/ath/ath9k/htc.h
+++ b/drivers/net/wireless/ath/ath9k/htc.h
@@ -542,6 +542,7 @@ void ath9k_htc_stop_ani(struct ath9k_htc_priv *priv);
542 542
543int ath9k_tx_init(struct ath9k_htc_priv *priv); 543int ath9k_tx_init(struct ath9k_htc_priv *priv);
544int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, 544int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
545 struct ieee80211_sta *sta,
545 struct sk_buff *skb, u8 slot, bool is_cab); 546 struct sk_buff *skb, u8 slot, bool is_cab);
546void ath9k_tx_cleanup(struct ath9k_htc_priv *priv); 547void ath9k_tx_cleanup(struct ath9k_htc_priv *priv);
547bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype); 548bool ath9k_htc_txq_setup(struct ath9k_htc_priv *priv, int subtype);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
index 77d541feb910..f42d2eb6af99 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
@@ -326,7 +326,7 @@ static void ath9k_htc_send_buffered(struct ath9k_htc_priv *priv,
326 goto next; 326 goto next;
327 } 327 }
328 328
329 ret = ath9k_htc_tx_start(priv, skb, tx_slot, true); 329 ret = ath9k_htc_tx_start(priv, NULL, skb, tx_slot, true);
330 if (ret != 0) { 330 if (ret != 0) {
331 ath9k_htc_tx_clear_slot(priv, tx_slot); 331 ath9k_htc_tx_clear_slot(priv, tx_slot);
332 dev_kfree_skb_any(skb); 332 dev_kfree_skb_any(skb);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index c785129692ff..c32f6e3ffb18 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -856,7 +856,9 @@ set_timer:
856/* mac80211 Callbacks */ 856/* mac80211 Callbacks */
857/**********************/ 857/**********************/
858 858
859static void ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 859static void ath9k_htc_tx(struct ieee80211_hw *hw,
860 struct ieee80211_tx_control *control,
861 struct sk_buff *skb)
860{ 862{
861 struct ieee80211_hdr *hdr; 863 struct ieee80211_hdr *hdr;
862 struct ath9k_htc_priv *priv = hw->priv; 864 struct ath9k_htc_priv *priv = hw->priv;
@@ -883,7 +885,7 @@ static void ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
883 goto fail_tx; 885 goto fail_tx;
884 } 886 }
885 887
886 ret = ath9k_htc_tx_start(priv, skb, slot, false); 888 ret = ath9k_htc_tx_start(priv, control->sta, skb, slot, false);
887 if (ret != 0) { 889 if (ret != 0) {
888 ath_dbg(common, XMIT, "Tx failed\n"); 890 ath_dbg(common, XMIT, "Tx failed\n");
889 goto clear_slot; 891 goto clear_slot;
@@ -1331,6 +1333,34 @@ static int ath9k_htc_sta_remove(struct ieee80211_hw *hw,
1331 return ret; 1333 return ret;
1332} 1334}
1333 1335
1336static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
1337 struct ieee80211_vif *vif,
1338 struct ieee80211_sta *sta, u32 changed)
1339{
1340 struct ath9k_htc_priv *priv = hw->priv;
1341 struct ath_common *common = ath9k_hw_common(priv->ah);
1342 struct ath9k_htc_target_rate trate;
1343
1344 mutex_lock(&priv->mutex);
1345 ath9k_htc_ps_wakeup(priv);
1346
1347 if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) {
1348 memset(&trate, 0, sizeof(struct ath9k_htc_target_rate));
1349 ath9k_htc_setup_rate(priv, sta, &trate);
1350 if (!ath9k_htc_send_rate_cmd(priv, &trate))
1351 ath_dbg(common, CONFIG,
1352 "Supported rates for sta: %pM updated, rate caps: 0x%X\n",
1353 sta->addr, be32_to_cpu(trate.capflags));
1354 else
1355 ath_dbg(common, CONFIG,
1356 "Unable to update supported rates for sta: %pM\n",
1357 sta->addr);
1358 }
1359
1360 ath9k_htc_ps_restore(priv);
1361 mutex_unlock(&priv->mutex);
1362}
1363
1334static int ath9k_htc_conf_tx(struct ieee80211_hw *hw, 1364static int ath9k_htc_conf_tx(struct ieee80211_hw *hw,
1335 struct ieee80211_vif *vif, u16 queue, 1365 struct ieee80211_vif *vif, u16 queue,
1336 const struct ieee80211_tx_queue_params *params) 1366 const struct ieee80211_tx_queue_params *params)
@@ -1758,6 +1788,7 @@ struct ieee80211_ops ath9k_htc_ops = {
1758 .sta_add = ath9k_htc_sta_add, 1788 .sta_add = ath9k_htc_sta_add,
1759 .sta_remove = ath9k_htc_sta_remove, 1789 .sta_remove = ath9k_htc_sta_remove,
1760 .conf_tx = ath9k_htc_conf_tx, 1790 .conf_tx = ath9k_htc_conf_tx,
1791 .sta_rc_update = ath9k_htc_sta_rc_update,
1761 .bss_info_changed = ath9k_htc_bss_info_changed, 1792 .bss_info_changed = ath9k_htc_bss_info_changed,
1762 .set_key = ath9k_htc_set_key, 1793 .set_key = ath9k_htc_set_key,
1763 .get_tsf = ath9k_htc_get_tsf, 1794 .get_tsf = ath9k_htc_get_tsf,
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 47e61d0da33b..06cdcb772d78 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -333,12 +333,12 @@ static void ath9k_htc_tx_data(struct ath9k_htc_priv *priv,
333} 333}
334 334
335int ath9k_htc_tx_start(struct ath9k_htc_priv *priv, 335int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
336 struct ieee80211_sta *sta,
336 struct sk_buff *skb, 337 struct sk_buff *skb,
337 u8 slot, bool is_cab) 338 u8 slot, bool is_cab)
338{ 339{
339 struct ieee80211_hdr *hdr; 340 struct ieee80211_hdr *hdr;
340 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 341 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
341 struct ieee80211_sta *sta = tx_info->control.sta;
342 struct ieee80211_vif *vif = tx_info->control.vif; 342 struct ieee80211_vif *vif = tx_info->control.vif;
343 struct ath9k_htc_sta *ista; 343 struct ath9k_htc_sta *ista;
344 struct ath9k_htc_vif *avp = NULL; 344 struct ath9k_htc_vif *avp = NULL;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index a22df749b8db..8a2b04d5922f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -696,7 +696,9 @@ mutex_unlock:
696 return r; 696 return r;
697} 697}
698 698
699static void ath9k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 699static void ath9k_tx(struct ieee80211_hw *hw,
700 struct ieee80211_tx_control *control,
701 struct sk_buff *skb)
700{ 702{
701 struct ath_softc *sc = hw->priv; 703 struct ath_softc *sc = hw->priv;
702 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 704 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -756,6 +758,7 @@ static void ath9k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
756 758
757 memset(&txctl, 0, sizeof(struct ath_tx_control)); 759 memset(&txctl, 0, sizeof(struct ath_tx_control));
758 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)]; 760 txctl.txq = sc->tx.txq_map[skb_get_queue_mapping(skb)];
761 txctl.sta = control->sta;
759 762
760 ath_dbg(common, XMIT, "transmitting packet, skb: %p\n", skb); 763 ath_dbg(common, XMIT, "transmitting packet, skb: %p\n", skb);
761 764
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 2c9da6b2ecb1..ef91f6cc2d79 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1773,11 +1773,12 @@ static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
1773 TX_STAT_INC(txq->axq_qnum, queued); 1773 TX_STAT_INC(txq->axq_qnum, queued);
1774} 1774}
1775 1775
1776static void setup_frame_info(struct ieee80211_hw *hw, struct sk_buff *skb, 1776static void setup_frame_info(struct ieee80211_hw *hw,
1777 struct ieee80211_sta *sta,
1778 struct sk_buff *skb,
1777 int framelen) 1779 int framelen)
1778{ 1780{
1779 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 1781 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
1780 struct ieee80211_sta *sta = tx_info->control.sta;
1781 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key; 1782 struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
1782 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1783 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1783 const struct ieee80211_rate *rate; 1784 const struct ieee80211_rate *rate;
@@ -1935,7 +1936,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
1935{ 1936{
1936 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 1937 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
1937 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1938 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1938 struct ieee80211_sta *sta = info->control.sta; 1939 struct ieee80211_sta *sta = txctl->sta;
1939 struct ieee80211_vif *vif = info->control.vif; 1940 struct ieee80211_vif *vif = info->control.vif;
1940 struct ath_softc *sc = hw->priv; 1941 struct ath_softc *sc = hw->priv;
1941 struct ath_txq *txq = txctl->txq; 1942 struct ath_txq *txq = txctl->txq;
@@ -1979,7 +1980,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
1979 !ieee80211_is_data(hdr->frame_control)) 1980 !ieee80211_is_data(hdr->frame_control))
1980 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT; 1981 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
1981 1982
1982 setup_frame_info(hw, skb, frmlen); 1983 setup_frame_info(hw, sta, skb, frmlen);
1983 1984
1984 /* 1985 /*
1985 * At this point, the vif, hw_key and sta pointers in the tx control 1986 * At this point, the vif, hw_key and sta pointers in the tx control
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h
index 376be11161c0..2aa4a59c72c8 100644
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -425,6 +425,7 @@ struct ar9170 {
425 bool rx_has_plcp; 425 bool rx_has_plcp;
426 struct sk_buff *rx_failover; 426 struct sk_buff *rx_failover;
427 int rx_failover_missing; 427 int rx_failover_missing;
428 u32 ampdu_ref;
428 429
429 /* FIFO for collecting outstanding BlockAckRequest */ 430 /* FIFO for collecting outstanding BlockAckRequest */
430 struct list_head bar_list[__AR9170_NUM_TXQ]; 431 struct list_head bar_list[__AR9170_NUM_TXQ];
@@ -577,7 +578,9 @@ void carl9170_rx(struct ar9170 *ar, void *buf, unsigned int len);
577void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len); 578void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);
578 579
579/* TX */ 580/* TX */
580void carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 581void carl9170_op_tx(struct ieee80211_hw *hw,
582 struct ieee80211_tx_control *control,
583 struct sk_buff *skb);
581void carl9170_tx_janitor(struct work_struct *work); 584void carl9170_tx_janitor(struct work_struct *work);
582void carl9170_tx_process_status(struct ar9170 *ar, 585void carl9170_tx_process_status(struct ar9170 *ar,
583 const struct carl9170_rsp *cmd); 586 const struct carl9170_rsp *cmd);
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index b813f43061f5..a0b723078547 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -624,7 +624,8 @@ static void carl9170_ba_check(struct ar9170 *ar, void *data, unsigned int len)
624#undef TID_CHECK 624#undef TID_CHECK
625} 625}
626 626
627static bool carl9170_ampdu_check(struct ar9170 *ar, u8 *buf, u8 ms) 627static bool carl9170_ampdu_check(struct ar9170 *ar, u8 *buf, u8 ms,
628 struct ieee80211_rx_status *rx_status)
628{ 629{
629 __le16 fc; 630 __le16 fc;
630 631
@@ -637,6 +638,9 @@ static bool carl9170_ampdu_check(struct ar9170 *ar, u8 *buf, u8 ms)
637 return true; 638 return true;
638 } 639 }
639 640
641 rx_status->flag |= RX_FLAG_AMPDU_DETAILS | RX_FLAG_AMPDU_LAST_KNOWN;
642 rx_status->ampdu_reference = ar->ampdu_ref;
643
640 /* 644 /*
641 * "802.11n - 7.4a.3 A-MPDU contents" describes in which contexts 645 * "802.11n - 7.4a.3 A-MPDU contents" describes in which contexts
642 * certain frame types can be part of an aMPDU. 646 * certain frame types can be part of an aMPDU.
@@ -685,12 +689,15 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
685 if (unlikely(len < sizeof(*mac))) 689 if (unlikely(len < sizeof(*mac)))
686 goto drop; 690 goto drop;
687 691
692 memset(&status, 0, sizeof(status));
693
688 mpdu_len = len - sizeof(*mac); 694 mpdu_len = len - sizeof(*mac);
689 695
690 mac = (void *)(buf + mpdu_len); 696 mac = (void *)(buf + mpdu_len);
691 mac_status = mac->status; 697 mac_status = mac->status;
692 switch (mac_status & AR9170_RX_STATUS_MPDU) { 698 switch (mac_status & AR9170_RX_STATUS_MPDU) {
693 case AR9170_RX_STATUS_MPDU_FIRST: 699 case AR9170_RX_STATUS_MPDU_FIRST:
700 ar->ampdu_ref++;
694 /* Aggregated MPDUs start with an PLCP header */ 701 /* Aggregated MPDUs start with an PLCP header */
695 if (likely(mpdu_len >= sizeof(struct ar9170_rx_head))) { 702 if (likely(mpdu_len >= sizeof(struct ar9170_rx_head))) {
696 head = (void *) buf; 703 head = (void *) buf;
@@ -721,12 +728,13 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
721 break; 728 break;
722 729
723 case AR9170_RX_STATUS_MPDU_LAST: 730 case AR9170_RX_STATUS_MPDU_LAST:
731 status.flag |= RX_FLAG_AMPDU_IS_LAST;
732
724 /* 733 /*
725 * The last frame of an A-MPDU has an extra tail 734 * The last frame of an A-MPDU has an extra tail
726 * which does contain the phy status of the whole 735 * which does contain the phy status of the whole
727 * aggregate. 736 * aggregate.
728 */ 737 */
729
730 if (likely(mpdu_len >= sizeof(struct ar9170_rx_phystatus))) { 738 if (likely(mpdu_len >= sizeof(struct ar9170_rx_phystatus))) {
731 mpdu_len -= sizeof(struct ar9170_rx_phystatus); 739 mpdu_len -= sizeof(struct ar9170_rx_phystatus);
732 phy = (void *)(buf + mpdu_len); 740 phy = (void *)(buf + mpdu_len);
@@ -774,11 +782,10 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
774 if (unlikely(mpdu_len < (2 + 2 + ETH_ALEN + FCS_LEN))) 782 if (unlikely(mpdu_len < (2 + 2 + ETH_ALEN + FCS_LEN)))
775 goto drop; 783 goto drop;
776 784
777 memset(&status, 0, sizeof(status));
778 if (unlikely(carl9170_rx_mac_status(ar, head, mac, &status))) 785 if (unlikely(carl9170_rx_mac_status(ar, head, mac, &status)))
779 goto drop; 786 goto drop;
780 787
781 if (!carl9170_ampdu_check(ar, buf, mac_status)) 788 if (!carl9170_ampdu_check(ar, buf, mac_status, &status))
782 goto drop; 789 goto drop;
783 790
784 if (phy) 791 if (phy)
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index 6a8681407a1d..84377cf580e0 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -867,14 +867,15 @@ static bool carl9170_tx_cts_check(struct ar9170 *ar,
867 return false; 867 return false;
868} 868}
869 869
870static int carl9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb) 870static int carl9170_tx_prepare(struct ar9170 *ar,
871 struct ieee80211_sta *sta,
872 struct sk_buff *skb)
871{ 873{
872 struct ieee80211_hdr *hdr; 874 struct ieee80211_hdr *hdr;
873 struct _carl9170_tx_superframe *txc; 875 struct _carl9170_tx_superframe *txc;
874 struct carl9170_vif_info *cvif; 876 struct carl9170_vif_info *cvif;
875 struct ieee80211_tx_info *info; 877 struct ieee80211_tx_info *info;
876 struct ieee80211_tx_rate *txrate; 878 struct ieee80211_tx_rate *txrate;
877 struct ieee80211_sta *sta;
878 struct carl9170_tx_info *arinfo; 879 struct carl9170_tx_info *arinfo;
879 unsigned int hw_queue; 880 unsigned int hw_queue;
880 int i; 881 int i;
@@ -910,8 +911,6 @@ static int carl9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb)
910 else 911 else
911 cvif = NULL; 912 cvif = NULL;
912 913
913 sta = info->control.sta;
914
915 txc = (void *)skb_push(skb, sizeof(*txc)); 914 txc = (void *)skb_push(skb, sizeof(*txc));
916 memset(txc, 0, sizeof(*txc)); 915 memset(txc, 0, sizeof(*txc));
917 916
@@ -1457,20 +1456,21 @@ err_unlock_rcu:
1457 return false; 1456 return false;
1458} 1457}
1459 1458
1460void carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1459void carl9170_op_tx(struct ieee80211_hw *hw,
1460 struct ieee80211_tx_control *control,
1461 struct sk_buff *skb)
1461{ 1462{
1462 struct ar9170 *ar = hw->priv; 1463 struct ar9170 *ar = hw->priv;
1463 struct ieee80211_tx_info *info; 1464 struct ieee80211_tx_info *info;
1464 struct ieee80211_sta *sta; 1465 struct ieee80211_sta *sta = control->sta;
1465 bool run; 1466 bool run;
1466 1467
1467 if (unlikely(!IS_STARTED(ar))) 1468 if (unlikely(!IS_STARTED(ar)))
1468 goto err_free; 1469 goto err_free;
1469 1470
1470 info = IEEE80211_SKB_CB(skb); 1471 info = IEEE80211_SKB_CB(skb);
1471 sta = info->control.sta;
1472 1472
1473 if (unlikely(carl9170_tx_prepare(ar, skb))) 1473 if (unlikely(carl9170_tx_prepare(ar, sta, skb)))
1474 goto err_free; 1474 goto err_free;
1475 1475
1476 carl9170_tx_accounting(ar, skb); 1476 carl9170_tx_accounting(ar, skb);
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index d97a95b1addb..73730e94e0ac 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3412,7 +3412,8 @@ static void b43_tx_work(struct work_struct *work)
3412} 3412}
3413 3413
3414static void b43_op_tx(struct ieee80211_hw *hw, 3414static void b43_op_tx(struct ieee80211_hw *hw,
3415 struct sk_buff *skb) 3415 struct ieee80211_tx_control *control,
3416 struct sk_buff *skb)
3416{ 3417{
3417 struct b43_wl *wl = hw_to_b43_wl(hw); 3418 struct b43_wl *wl = hw_to_b43_wl(hw);
3418 3419
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 3ea1a85d38d1..291cdf654088 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2492,6 +2492,7 @@ static void b43legacy_tx_work(struct work_struct *work)
2492} 2492}
2493 2493
2494static void b43legacy_op_tx(struct ieee80211_hw *hw, 2494static void b43legacy_op_tx(struct ieee80211_hw *hw,
2495 struct ieee80211_tx_control *control,
2495 struct sk_buff *skb) 2496 struct sk_buff *skb)
2496{ 2497{
2497 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 2498 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index 1c70defba6c3..513e172832e1 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -267,7 +267,9 @@ static void brcms_set_basic_rate(struct brcm_rateset *rs, u16 rate, bool is_br)
267 } 267 }
268} 268}
269 269
270static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 270static void brcms_ops_tx(struct ieee80211_hw *hw,
271 struct ieee80211_tx_control *control,
272 struct sk_buff *skb)
271{ 273{
272 struct brcms_info *wl = hw->priv; 274 struct brcms_info *wl = hw->priv;
273 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 275 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
@@ -279,7 +281,7 @@ static void brcms_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
279 goto done; 281 goto done;
280 } 282 }
281 brcms_c_sendpkt_mac80211(wl->wlc, skb, hw); 283 brcms_c_sendpkt_mac80211(wl->wlc, skb, hw);
282 tx_info->rate_driver_data[0] = tx_info->control.sta; 284 tx_info->rate_driver_data[0] = control->sta;
283 done: 285 done:
284 spin_unlock_bh(&wl->lock); 286 spin_unlock_bh(&wl->lock);
285} 287}
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index faec40467208..e252acb9c862 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -460,7 +460,9 @@ il3945_build_tx_cmd_basic(struct il_priv *il, struct il_device_cmd *cmd,
460 * start C_TX command process 460 * start C_TX command process
461 */ 461 */
462static int 462static int
463il3945_tx_skb(struct il_priv *il, struct sk_buff *skb) 463il3945_tx_skb(struct il_priv *il,
464 struct ieee80211_sta *sta,
465 struct sk_buff *skb)
464{ 466{
465 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 467 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
466 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 468 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -512,7 +514,7 @@ il3945_tx_skb(struct il_priv *il, struct sk_buff *skb)
512 hdr_len = ieee80211_hdrlen(fc); 514 hdr_len = ieee80211_hdrlen(fc);
513 515
514 /* Find idx into station table for destination station */ 516 /* Find idx into station table for destination station */
515 sta_id = il_sta_id_or_broadcast(il, info->control.sta); 517 sta_id = il_sta_id_or_broadcast(il, sta);
516 if (sta_id == IL_INVALID_STATION) { 518 if (sta_id == IL_INVALID_STATION) {
517 D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1); 519 D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1);
518 goto drop; 520 goto drop;
@@ -2859,7 +2861,9 @@ il3945_mac_stop(struct ieee80211_hw *hw)
2859} 2861}
2860 2862
2861static void 2863static void
2862il3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 2864il3945_mac_tx(struct ieee80211_hw *hw,
2865 struct ieee80211_tx_control *control,
2866 struct sk_buff *skb)
2863{ 2867{
2864 struct il_priv *il = hw->priv; 2868 struct il_priv *il = hw->priv;
2865 2869
@@ -2868,7 +2872,7 @@ il3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2868 D_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 2872 D_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
2869 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 2873 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
2870 2874
2871 if (il3945_tx_skb(il, skb)) 2875 if (il3945_tx_skb(il, control->sta, skb))
2872 dev_kfree_skb_any(skb); 2876 dev_kfree_skb_any(skb);
2873 2877
2874 D_MAC80211("leave\n"); 2878 D_MAC80211("leave\n");
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 34f61a0581a2..eac4dc8bc879 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1526,8 +1526,11 @@ il4965_tx_cmd_build_basic(struct il_priv *il, struct sk_buff *skb,
1526} 1526}
1527 1527
1528static void 1528static void
1529il4965_tx_cmd_build_rate(struct il_priv *il, struct il_tx_cmd *tx_cmd, 1529il4965_tx_cmd_build_rate(struct il_priv *il,
1530 struct ieee80211_tx_info *info, __le16 fc) 1530 struct il_tx_cmd *tx_cmd,
1531 struct ieee80211_tx_info *info,
1532 struct ieee80211_sta *sta,
1533 __le16 fc)
1531{ 1534{
1532 const u8 rts_retry_limit = 60; 1535 const u8 rts_retry_limit = 60;
1533 u32 rate_flags; 1536 u32 rate_flags;
@@ -1561,9 +1564,7 @@ il4965_tx_cmd_build_rate(struct il_priv *il, struct il_tx_cmd *tx_cmd,
1561 rate_idx = info->control.rates[0].idx; 1564 rate_idx = info->control.rates[0].idx;
1562 if ((info->control.rates[0].flags & IEEE80211_TX_RC_MCS) || rate_idx < 0 1565 if ((info->control.rates[0].flags & IEEE80211_TX_RC_MCS) || rate_idx < 0
1563 || rate_idx > RATE_COUNT_LEGACY) 1566 || rate_idx > RATE_COUNT_LEGACY)
1564 rate_idx = 1567 rate_idx = rate_lowest_index(&il->bands[info->band], sta);
1565 rate_lowest_index(&il->bands[info->band],
1566 info->control.sta);
1567 /* For 5 GHZ band, remap mac80211 rate indices into driver indices */ 1568 /* For 5 GHZ band, remap mac80211 rate indices into driver indices */
1568 if (info->band == IEEE80211_BAND_5GHZ) 1569 if (info->band == IEEE80211_BAND_5GHZ)
1569 rate_idx += IL_FIRST_OFDM_RATE; 1570 rate_idx += IL_FIRST_OFDM_RATE;
@@ -1630,11 +1631,12 @@ il4965_tx_cmd_build_hwcrypto(struct il_priv *il, struct ieee80211_tx_info *info,
1630 * start C_TX command process 1631 * start C_TX command process
1631 */ 1632 */
1632int 1633int
1633il4965_tx_skb(struct il_priv *il, struct sk_buff *skb) 1634il4965_tx_skb(struct il_priv *il,
1635 struct ieee80211_sta *sta,
1636 struct sk_buff *skb)
1634{ 1637{
1635 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1638 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1636 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1639 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1637 struct ieee80211_sta *sta = info->control.sta;
1638 struct il_station_priv *sta_priv = NULL; 1640 struct il_station_priv *sta_priv = NULL;
1639 struct il_tx_queue *txq; 1641 struct il_tx_queue *txq;
1640 struct il_queue *q; 1642 struct il_queue *q;
@@ -1680,7 +1682,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
1680 sta_id = il->hw_params.bcast_id; 1682 sta_id = il->hw_params.bcast_id;
1681 else { 1683 else {
1682 /* Find idx into station table for destination station */ 1684 /* Find idx into station table for destination station */
1683 sta_id = il_sta_id_or_broadcast(il, info->control.sta); 1685 sta_id = il_sta_id_or_broadcast(il, sta);
1684 1686
1685 if (sta_id == IL_INVALID_STATION) { 1687 if (sta_id == IL_INVALID_STATION) {
1686 D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1); 1688 D_DROP("Dropping - INVALID STATION: %pM\n", hdr->addr1);
@@ -1786,7 +1788,7 @@ il4965_tx_skb(struct il_priv *il, struct sk_buff *skb)
1786 /* TODO need this for burst mode later on */ 1788 /* TODO need this for burst mode later on */
1787 il4965_tx_cmd_build_basic(il, skb, tx_cmd, info, hdr, sta_id); 1789 il4965_tx_cmd_build_basic(il, skb, tx_cmd, info, hdr, sta_id);
1788 1790
1789 il4965_tx_cmd_build_rate(il, tx_cmd, info, fc); 1791 il4965_tx_cmd_build_rate(il, tx_cmd, info, sta, fc);
1790 1792
1791 il_update_stats(il, true, fc, len); 1793 il_update_stats(il, true, fc, len);
1792 /* 1794 /*
@@ -5828,7 +5830,9 @@ il4965_mac_stop(struct ieee80211_hw *hw)
5828} 5830}
5829 5831
5830void 5832void
5831il4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 5833il4965_mac_tx(struct ieee80211_hw *hw,
5834 struct ieee80211_tx_control *control,
5835 struct sk_buff *skb)
5832{ 5836{
5833 struct il_priv *il = hw->priv; 5837 struct il_priv *il = hw->priv;
5834 5838
@@ -5837,7 +5841,7 @@ il4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
5837 D_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 5841 D_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
5838 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 5842 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
5839 5843
5840 if (il4965_tx_skb(il, skb)) 5844 if (il4965_tx_skb(il, control->sta, skb))
5841 dev_kfree_skb_any(skb); 5845 dev_kfree_skb_any(skb);
5842 5846
5843 D_MACDUMP("leave\n"); 5847 D_MACDUMP("leave\n");
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index 1db677689cfe..2d092f328547 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -78,7 +78,9 @@ int il4965_hw_txq_attach_buf_to_tfd(struct il_priv *il, struct il_tx_queue *txq,
78int il4965_hw_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq); 78int il4965_hw_tx_queue_init(struct il_priv *il, struct il_tx_queue *txq);
79void il4965_hwrate_to_tx_control(struct il_priv *il, u32 rate_n_flags, 79void il4965_hwrate_to_tx_control(struct il_priv *il, u32 rate_n_flags,
80 struct ieee80211_tx_info *info); 80 struct ieee80211_tx_info *info);
81int il4965_tx_skb(struct il_priv *il, struct sk_buff *skb); 81int il4965_tx_skb(struct il_priv *il,
82 struct ieee80211_sta *sta,
83 struct sk_buff *skb);
82int il4965_tx_agg_start(struct il_priv *il, struct ieee80211_vif *vif, 84int il4965_tx_agg_start(struct il_priv *il, struct ieee80211_vif *vif,
83 struct ieee80211_sta *sta, u16 tid, u16 * ssn); 85 struct ieee80211_sta *sta, u16 tid, u16 * ssn);
84int il4965_tx_agg_stop(struct il_priv *il, struct ieee80211_vif *vif, 86int il4965_tx_agg_stop(struct il_priv *il, struct ieee80211_vif *vif,
@@ -163,7 +165,9 @@ void il4965_eeprom_release_semaphore(struct il_priv *il);
163int il4965_eeprom_check_version(struct il_priv *il); 165int il4965_eeprom_check_version(struct il_priv *il);
164 166
165/* mac80211 handlers (for 4965) */ 167/* mac80211 handlers (for 4965) */
166void il4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 168void il4965_mac_tx(struct ieee80211_hw *hw,
169 struct ieee80211_tx_control *control,
170 struct sk_buff *skb);
167int il4965_mac_start(struct ieee80211_hw *hw); 171int il4965_mac_start(struct ieee80211_hw *hw);
168void il4965_mac_stop(struct ieee80211_hw *hw); 172void il4965_mac_stop(struct ieee80211_hw *hw);
169void il4965_configure_filter(struct ieee80211_hw *hw, 173void il4965_configure_filter(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/iwlwifi/dvm/agn.h b/drivers/net/wireless/iwlwifi/dvm/agn.h
index 9bb16bdf6d26..75e12f29d9eb 100644
--- a/drivers/net/wireless/iwlwifi/dvm/agn.h
+++ b/drivers/net/wireless/iwlwifi/dvm/agn.h
@@ -201,7 +201,9 @@ void iwl_chswitch_done(struct iwl_priv *priv, bool is_success);
201 201
202 202
203/* tx */ 203/* tx */
204int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb); 204int iwlagn_tx_skb(struct iwl_priv *priv,
205 struct ieee80211_sta *sta,
206 struct sk_buff *skb);
205int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif, 207int iwlagn_tx_agg_start(struct iwl_priv *priv, struct ieee80211_vif *vif,
206 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 208 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
207int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif, 209int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif,
@@ -485,16 +487,13 @@ static inline void iwl_dvm_set_pmi(struct iwl_priv *priv, bool state)
485} 487}
486 488
487#ifdef CONFIG_IWLWIFI_DEBUGFS 489#ifdef CONFIG_IWLWIFI_DEBUGFS
488int iwl_dbgfs_register(struct iwl_priv *priv, const char *name); 490int iwl_dbgfs_register(struct iwl_priv *priv, struct dentry *dbgfs_dir);
489void iwl_dbgfs_unregister(struct iwl_priv *priv);
490#else 491#else
491static inline int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) 492static inline int iwl_dbgfs_register(struct iwl_priv *priv,
493 struct dentry *dbgfs_dir)
492{ 494{
493 return 0; 495 return 0;
494} 496}
495static inline void iwl_dbgfs_unregister(struct iwl_priv *priv)
496{
497}
498#endif /* CONFIG_IWLWIFI_DEBUGFS */ 497#endif /* CONFIG_IWLWIFI_DEBUGFS */
499 498
500#ifdef CONFIG_IWLWIFI_DEBUG 499#ifdef CONFIG_IWLWIFI_DEBUG
diff --git a/drivers/net/wireless/iwlwifi/dvm/debugfs.c b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
index 46782f1102ac..ce826bc5f111 100644
--- a/drivers/net/wireless/iwlwifi/dvm/debugfs.c
+++ b/drivers/net/wireless/iwlwifi/dvm/debugfs.c
@@ -2349,24 +2349,19 @@ DEBUGFS_READ_WRITE_FILE_OPS(calib_disabled);
2349 * Create the debugfs files and directories 2349 * Create the debugfs files and directories
2350 * 2350 *
2351 */ 2351 */
2352int iwl_dbgfs_register(struct iwl_priv *priv, const char *name) 2352int iwl_dbgfs_register(struct iwl_priv *priv, struct dentry *dbgfs_dir)
2353{ 2353{
2354 struct dentry *phyd = priv->hw->wiphy->debugfsdir; 2354 struct dentry *dir_data, *dir_rf, *dir_debug;
2355 struct dentry *dir_drv, *dir_data, *dir_rf, *dir_debug;
2356 2355
2357 dir_drv = debugfs_create_dir(name, phyd); 2356 priv->debugfs_dir = dbgfs_dir;
2358 if (!dir_drv)
2359 return -ENOMEM;
2360
2361 priv->debugfs_dir = dir_drv;
2362 2357
2363 dir_data = debugfs_create_dir("data", dir_drv); 2358 dir_data = debugfs_create_dir("data", dbgfs_dir);
2364 if (!dir_data) 2359 if (!dir_data)
2365 goto err; 2360 goto err;
2366 dir_rf = debugfs_create_dir("rf", dir_drv); 2361 dir_rf = debugfs_create_dir("rf", dbgfs_dir);
2367 if (!dir_rf) 2362 if (!dir_rf)
2368 goto err; 2363 goto err;
2369 dir_debug = debugfs_create_dir("debug", dir_drv); 2364 dir_debug = debugfs_create_dir("debug", dbgfs_dir);
2370 if (!dir_debug) 2365 if (!dir_debug)
2371 goto err; 2366 goto err;
2372 2367
@@ -2412,25 +2407,30 @@ int iwl_dbgfs_register(struct iwl_priv *priv, const char *name)
2412 /* Calibrations disabled/enabled status*/ 2407 /* Calibrations disabled/enabled status*/
2413 DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IWUSR | S_IRUSR); 2408 DEBUGFS_ADD_FILE(calib_disabled, dir_rf, S_IWUSR | S_IRUSR);
2414 2409
2415 if (iwl_trans_dbgfs_register(priv->trans, dir_debug)) 2410 /*
2416 goto err; 2411 * Create a symlink with mac80211. This is not very robust, as it does
2412 * not remove the symlink created. The implicit assumption is that
2413 * when the opmode exits, mac80211 will also exit, and will remove
2414 * this symlink as part of its cleanup.
2415 */
2416 if (priv->mac80211_registered) {
2417 char buf[100];
2418 struct dentry *mac80211_dir, *dev_dir, *root_dir;
2419
2420 dev_dir = dbgfs_dir->d_parent;
2421 root_dir = dev_dir->d_parent;
2422 mac80211_dir = priv->hw->wiphy->debugfsdir;
2423
2424 snprintf(buf, 100, "../../%s/%s", root_dir->d_name.name,
2425 dev_dir->d_name.name);
2426
2427 if (!debugfs_create_symlink("iwlwifi", mac80211_dir, buf))
2428 goto err;
2429 }
2430
2417 return 0; 2431 return 0;
2418 2432
2419err: 2433err:
2420 IWL_ERR(priv, "Can't create the debugfs directory\n"); 2434 IWL_ERR(priv, "failed to create the dvm debugfs entries\n");
2421 iwl_dbgfs_unregister(priv);
2422 return -ENOMEM; 2435 return -ENOMEM;
2423} 2436}
2424
2425/**
2426 * Remove the debugfs files and directories
2427 *
2428 */
2429void iwl_dbgfs_unregister(struct iwl_priv *priv)
2430{
2431 if (!priv->debugfs_dir)
2432 return;
2433
2434 debugfs_remove_recursive(priv->debugfs_dir);
2435 priv->debugfs_dir = NULL;
2436}
diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
index a5f7bce96325..ff8162d4c454 100644
--- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
@@ -195,7 +195,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
195 ARRAY_SIZE(iwlagn_iface_combinations_dualmode); 195 ARRAY_SIZE(iwlagn_iface_combinations_dualmode);
196 } 196 }
197 197
198 hw->wiphy->max_remain_on_channel_duration = 1000; 198 hw->wiphy->max_remain_on_channel_duration = 500;
199 199
200 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY | 200 hw->wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY |
201 WIPHY_FLAG_DISABLE_BEACON_HINTS | 201 WIPHY_FLAG_DISABLE_BEACON_HINTS |
@@ -511,14 +511,16 @@ static void iwlagn_mac_set_wakeup(struct ieee80211_hw *hw, bool enabled)
511} 511}
512#endif 512#endif
513 513
514static void iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 514static void iwlagn_mac_tx(struct ieee80211_hw *hw,
515 struct ieee80211_tx_control *control,
516 struct sk_buff *skb)
515{ 517{
516 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw); 518 struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
517 519
518 IWL_DEBUG_TX(priv, "dev->xmit(%d bytes) at rate 0x%02x\n", skb->len, 520 IWL_DEBUG_TX(priv, "dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
519 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate); 521 ieee80211_get_tx_rate(hw, IEEE80211_SKB_CB(skb))->bitrate);
520 522
521 if (iwlagn_tx_skb(priv, skb)) 523 if (iwlagn_tx_skb(priv, control->sta, skb))
522 dev_kfree_skb_any(skb); 524 dev_kfree_skb_any(skb);
523} 525}
524 526
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index 84d3db5aa506..7ff3f1430678 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -862,7 +862,8 @@ void iwl_down(struct iwl_priv *priv)
862 * No race since we hold the mutex here and a new one 862 * No race since we hold the mutex here and a new one
863 * can't come in at this time. 863 * can't come in at this time.
864 */ 864 */
865 ieee80211_remain_on_channel_expired(priv->hw); 865 if (priv->ucode_loaded && priv->cur_ucode != IWL_UCODE_INIT)
866 ieee80211_remain_on_channel_expired(priv->hw);
866 867
867 exit_pending = 868 exit_pending =
868 test_and_set_bit(STATUS_EXIT_PENDING, &priv->status); 869 test_and_set_bit(STATUS_EXIT_PENDING, &priv->status);
@@ -994,7 +995,11 @@ static void iwl_bg_restart(struct work_struct *data)
994 iwlagn_prepare_restart(priv); 995 iwlagn_prepare_restart(priv);
995 mutex_unlock(&priv->mutex); 996 mutex_unlock(&priv->mutex);
996 iwl_cancel_deferred_work(priv); 997 iwl_cancel_deferred_work(priv);
997 ieee80211_restart_hw(priv->hw); 998 if (priv->mac80211_registered)
999 ieee80211_restart_hw(priv->hw);
1000 else
1001 IWL_ERR(priv,
1002 "Cannot request restart before registrating with mac80211");
998 } else { 1003 } else {
999 WARN_ON(1); 1004 WARN_ON(1);
1000 } 1005 }
@@ -1222,7 +1227,8 @@ static int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
1222 1227
1223static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, 1228static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1224 const struct iwl_cfg *cfg, 1229 const struct iwl_cfg *cfg,
1225 const struct iwl_fw *fw) 1230 const struct iwl_fw *fw,
1231 struct dentry *dbgfs_dir)
1226{ 1232{
1227 struct iwl_priv *priv; 1233 struct iwl_priv *priv;
1228 struct ieee80211_hw *hw; 1234 struct ieee80211_hw *hw;
@@ -1466,13 +1472,17 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1466 if (iwlagn_mac_setup_register(priv, &fw->ucode_capa)) 1472 if (iwlagn_mac_setup_register(priv, &fw->ucode_capa))
1467 goto out_destroy_workqueue; 1473 goto out_destroy_workqueue;
1468 1474
1469 if (iwl_dbgfs_register(priv, DRV_NAME)) 1475 if (iwl_dbgfs_register(priv, dbgfs_dir))
1470 IWL_ERR(priv, 1476 goto out_mac80211_unregister;
1471 "failed to create debugfs files. Ignoring error\n");
1472 1477
1473 return op_mode; 1478 return op_mode;
1474 1479
1480out_mac80211_unregister:
1481 iwlagn_mac_unregister(priv);
1475out_destroy_workqueue: 1482out_destroy_workqueue:
1483 iwl_tt_exit(priv);
1484 iwl_testmode_free(priv);
1485 iwl_cancel_deferred_work(priv);
1476 destroy_workqueue(priv->workqueue); 1486 destroy_workqueue(priv->workqueue);
1477 priv->workqueue = NULL; 1487 priv->workqueue = NULL;
1478 iwl_uninit_drv(priv); 1488 iwl_uninit_drv(priv);
@@ -1493,8 +1503,6 @@ static void iwl_op_mode_dvm_stop(struct iwl_op_mode *op_mode)
1493 1503
1494 IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n"); 1504 IWL_DEBUG_INFO(priv, "*** UNLOAD DRIVER ***\n");
1495 1505
1496 iwl_dbgfs_unregister(priv);
1497
1498 iwl_testmode_free(priv); 1506 iwl_testmode_free(priv);
1499 iwlagn_mac_unregister(priv); 1507 iwlagn_mac_unregister(priv);
1500 1508
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c
index b29b798f7550..fe36a38f3505 100644
--- a/drivers/net/wireless/iwlwifi/dvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/dvm/sta.c
@@ -150,7 +150,7 @@ int iwl_send_add_sta(struct iwl_priv *priv,
150 sta_id, sta->sta.addr, flags & CMD_ASYNC ? "a" : ""); 150 sta_id, sta->sta.addr, flags & CMD_ASYNC ? "a" : "");
151 151
152 if (!(flags & CMD_ASYNC)) { 152 if (!(flags & CMD_ASYNC)) {
153 cmd.flags |= CMD_WANT_SKB; 153 cmd.flags |= CMD_WANT_SKB | CMD_WANT_HCMD;
154 might_sleep(); 154 might_sleep();
155 } 155 }
156 156
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index 5971a23aa47d..f5ca73a89870 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -127,6 +127,7 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv,
127static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv, 127static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
128 struct iwl_tx_cmd *tx_cmd, 128 struct iwl_tx_cmd *tx_cmd,
129 struct ieee80211_tx_info *info, 129 struct ieee80211_tx_info *info,
130 struct ieee80211_sta *sta,
130 __le16 fc) 131 __le16 fc)
131{ 132{
132 u32 rate_flags; 133 u32 rate_flags;
@@ -187,8 +188,7 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
187 if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS || 188 if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS ||
188 (rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY)) 189 (rate_idx < 0) || (rate_idx > IWL_RATE_COUNT_LEGACY))
189 rate_idx = rate_lowest_index( 190 rate_idx = rate_lowest_index(
190 &priv->eeprom_data->bands[info->band], 191 &priv->eeprom_data->bands[info->band], sta);
191 info->control.sta);
192 /* For 5 GHZ band, remap mac80211 rate indices into driver indices */ 192 /* For 5 GHZ band, remap mac80211 rate indices into driver indices */
193 if (info->band == IEEE80211_BAND_5GHZ) 193 if (info->band == IEEE80211_BAND_5GHZ)
194 rate_idx += IWL_FIRST_OFDM_RATE; 194 rate_idx += IWL_FIRST_OFDM_RATE;
@@ -291,7 +291,9 @@ static int iwl_sta_id_or_broadcast(struct iwl_rxon_context *context,
291/* 291/*
292 * start REPLY_TX command process 292 * start REPLY_TX command process
293 */ 293 */
294int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb) 294int iwlagn_tx_skb(struct iwl_priv *priv,
295 struct ieee80211_sta *sta,
296 struct sk_buff *skb)
295{ 297{
296 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 298 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
297 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 299 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -345,7 +347,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
345 sta_id = ctx->bcast_sta_id; 347 sta_id = ctx->bcast_sta_id;
346 else { 348 else {
347 /* Find index into station table for destination station */ 349 /* Find index into station table for destination station */
348 sta_id = iwl_sta_id_or_broadcast(ctx, info->control.sta); 350 sta_id = iwl_sta_id_or_broadcast(ctx, sta);
349 if (sta_id == IWL_INVALID_STATION) { 351 if (sta_id == IWL_INVALID_STATION) {
350 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n", 352 IWL_DEBUG_DROP(priv, "Dropping - INVALID STATION: %pM\n",
351 hdr->addr1); 353 hdr->addr1);
@@ -355,8 +357,8 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
355 357
356 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id); 358 IWL_DEBUG_TX(priv, "station Id %d\n", sta_id);
357 359
358 if (info->control.sta) 360 if (sta)
359 sta_priv = (void *)info->control.sta->drv_priv; 361 sta_priv = (void *)sta->drv_priv;
360 362
361 if (sta_priv && sta_priv->asleep && 363 if (sta_priv && sta_priv->asleep &&
362 (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)) { 364 (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)) {
@@ -397,7 +399,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
397 /* TODO need this for burst mode later on */ 399 /* TODO need this for burst mode later on */
398 iwlagn_tx_cmd_build_basic(priv, skb, tx_cmd, info, hdr, sta_id); 400 iwlagn_tx_cmd_build_basic(priv, skb, tx_cmd, info, hdr, sta_id);
399 401
400 iwlagn_tx_cmd_build_rate(priv, tx_cmd, info, fc); 402 iwlagn_tx_cmd_build_rate(priv, tx_cmd, info, sta, fc);
401 403
402 memset(&info->status, 0, sizeof(info->status)); 404 memset(&info->status, 0, sizeof(info->status));
403 405
@@ -431,7 +433,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
431 * only. Check this here. 433 * only. Check this here.
432 */ 434 */
433 if (WARN_ONCE(tid_data->agg.state != IWL_AGG_ON && 435 if (WARN_ONCE(tid_data->agg.state != IWL_AGG_ON &&
434 tid_data->agg.state != IWL_AGG_OFF, 436 tid_data->agg.state != IWL_AGG_OFF,
435 "Tx while agg.state = %d", tid_data->agg.state)) 437 "Tx while agg.state = %d", tid_data->agg.state))
436 goto drop_unlock_sta; 438 goto drop_unlock_sta;
437 439
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index cc41cfaedfbd..48d6d44c16d0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -101,6 +101,10 @@ MODULE_VERSION(DRV_VERSION);
101MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); 101MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR);
102MODULE_LICENSE("GPL"); 102MODULE_LICENSE("GPL");
103 103
104#ifdef CONFIG_IWLWIFI_DEBUGFS
105static struct dentry *iwl_dbgfs_root;
106#endif
107
104/** 108/**
105 * struct iwl_drv - drv common data 109 * struct iwl_drv - drv common data
106 * @list: list of drv structures using this opmode 110 * @list: list of drv structures using this opmode
@@ -126,6 +130,12 @@ struct iwl_drv {
126 char firmware_name[25]; /* name of firmware file to load */ 130 char firmware_name[25]; /* name of firmware file to load */
127 131
128 struct completion request_firmware_complete; 132 struct completion request_firmware_complete;
133
134#ifdef CONFIG_IWLWIFI_DEBUGFS
135 struct dentry *dbgfs_drv;
136 struct dentry *dbgfs_trans;
137 struct dentry *dbgfs_op_mode;
138#endif
129}; 139};
130 140
131#define DVM_OP_MODE 0 141#define DVM_OP_MODE 0
@@ -194,7 +204,8 @@ static int iwl_alloc_fw_desc(struct iwl_drv *drv, struct fw_desc *desc,
194 return 0; 204 return 0;
195} 205}
196 206
197static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context); 207static void iwl_req_fw_callback(const struct firmware *ucode_raw,
208 void *context);
198 209
199#define UCODE_EXPERIMENTAL_INDEX 100 210#define UCODE_EXPERIMENTAL_INDEX 100
200#define UCODE_EXPERIMENTAL_TAG "exp" 211#define UCODE_EXPERIMENTAL_TAG "exp"
@@ -231,7 +242,7 @@ static int iwl_request_firmware(struct iwl_drv *drv, bool first)
231 242
232 return request_firmware_nowait(THIS_MODULE, 1, drv->firmware_name, 243 return request_firmware_nowait(THIS_MODULE, 1, drv->firmware_name,
233 drv->trans->dev, 244 drv->trans->dev,
234 GFP_KERNEL, drv, iwl_ucode_callback); 245 GFP_KERNEL, drv, iwl_req_fw_callback);
235} 246}
236 247
237struct fw_img_parsing { 248struct fw_img_parsing {
@@ -759,13 +770,57 @@ static int validate_sec_sizes(struct iwl_drv *drv,
759 return 0; 770 return 0;
760} 771}
761 772
773static struct iwl_op_mode *
774_iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op)
775{
776 const struct iwl_op_mode_ops *ops = op->ops;
777 struct dentry *dbgfs_dir = NULL;
778 struct iwl_op_mode *op_mode = NULL;
779
780#ifdef CONFIG_IWLWIFI_DEBUGFS
781 drv->dbgfs_op_mode = debugfs_create_dir(op->name,
782 drv->dbgfs_drv);
783 if (!drv->dbgfs_op_mode) {
784 IWL_ERR(drv,
785 "failed to create opmode debugfs directory\n");
786 return op_mode;
787 }
788 dbgfs_dir = drv->dbgfs_op_mode;
789#endif
790
791 op_mode = ops->start(drv->trans, drv->cfg, &drv->fw, dbgfs_dir);
792
793#ifdef CONFIG_IWLWIFI_DEBUGFS
794 if (!op_mode) {
795 debugfs_remove_recursive(drv->dbgfs_op_mode);
796 drv->dbgfs_op_mode = NULL;
797 }
798#endif
799
800 return op_mode;
801}
802
803static void _iwl_op_mode_stop(struct iwl_drv *drv)
804{
805 /* op_mode can be NULL if its start failed */
806 if (drv->op_mode) {
807 iwl_op_mode_stop(drv->op_mode);
808 drv->op_mode = NULL;
809
810#ifdef CONFIG_IWLWIFI_DEBUGFS
811 debugfs_remove_recursive(drv->dbgfs_op_mode);
812 drv->dbgfs_op_mode = NULL;
813#endif
814 }
815}
816
762/** 817/**
763 * iwl_ucode_callback - callback when firmware was loaded 818 * iwl_req_fw_callback - callback when firmware was loaded
764 * 819 *
765 * If loaded successfully, copies the firmware into buffers 820 * If loaded successfully, copies the firmware into buffers
766 * for the card to fetch (via DMA). 821 * for the card to fetch (via DMA).
767 */ 822 */
768static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) 823static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
769{ 824{
770 struct iwl_drv *drv = context; 825 struct iwl_drv *drv = context;
771 struct iwl_fw *fw = &drv->fw; 826 struct iwl_fw *fw = &drv->fw;
@@ -908,8 +963,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
908 list_add_tail(&drv->list, &op->drv); 963 list_add_tail(&drv->list, &op->drv);
909 964
910 if (op->ops) { 965 if (op->ops) {
911 const struct iwl_op_mode_ops *ops = op->ops; 966 drv->op_mode = _iwl_op_mode_start(drv, op);
912 drv->op_mode = ops->start(drv->trans, drv->cfg, &drv->fw);
913 967
914 if (!drv->op_mode) { 968 if (!drv->op_mode) {
915 mutex_unlock(&iwlwifi_opmode_table_mtx); 969 mutex_unlock(&iwlwifi_opmode_table_mtx);
@@ -969,24 +1023,51 @@ struct iwl_drv *iwl_drv_start(struct iwl_trans *trans,
969 init_completion(&drv->request_firmware_complete); 1023 init_completion(&drv->request_firmware_complete);
970 INIT_LIST_HEAD(&drv->list); 1024 INIT_LIST_HEAD(&drv->list);
971 1025
1026#ifdef CONFIG_IWLWIFI_DEBUGFS
1027 /* Create the device debugfs entries. */
1028 drv->dbgfs_drv = debugfs_create_dir(dev_name(trans->dev),
1029 iwl_dbgfs_root);
1030
1031 if (!drv->dbgfs_drv) {
1032 IWL_ERR(drv, "failed to create debugfs directory\n");
1033 goto err_free_drv;
1034 }
1035
1036 /* Create transport layer debugfs dir */
1037 drv->trans->dbgfs_dir = debugfs_create_dir("trans", drv->dbgfs_drv);
1038
1039 if (!drv->trans->dbgfs_dir) {
1040 IWL_ERR(drv, "failed to create transport debugfs directory\n");
1041 goto err_free_dbgfs;
1042 }
1043#endif
1044
972 ret = iwl_request_firmware(drv, true); 1045 ret = iwl_request_firmware(drv, true);
973 1046
974 if (ret) { 1047 if (ret) {
975 IWL_ERR(trans, "Couldn't request the fw\n"); 1048 IWL_ERR(trans, "Couldn't request the fw\n");
976 kfree(drv); 1049 goto err_fw;
977 drv = NULL;
978 } 1050 }
979 1051
980 return drv; 1052 return drv;
1053
1054err_fw:
1055#ifdef CONFIG_IWLWIFI_DEBUGFS
1056err_free_dbgfs:
1057 debugfs_remove_recursive(drv->dbgfs_drv);
1058err_free_drv:
1059#endif
1060 kfree(drv);
1061 drv = NULL;
1062
1063 return drv;
981} 1064}
982 1065
983void iwl_drv_stop(struct iwl_drv *drv) 1066void iwl_drv_stop(struct iwl_drv *drv)
984{ 1067{
985 wait_for_completion(&drv->request_firmware_complete); 1068 wait_for_completion(&drv->request_firmware_complete);
986 1069
987 /* op_mode can be NULL if its start failed */ 1070 _iwl_op_mode_stop(drv);
988 if (drv->op_mode)
989 iwl_op_mode_stop(drv->op_mode);
990 1071
991 iwl_dealloc_ucode(drv); 1072 iwl_dealloc_ucode(drv);
992 1073
@@ -1000,6 +1081,10 @@ void iwl_drv_stop(struct iwl_drv *drv)
1000 list_del(&drv->list); 1081 list_del(&drv->list);
1001 mutex_unlock(&iwlwifi_opmode_table_mtx); 1082 mutex_unlock(&iwlwifi_opmode_table_mtx);
1002 1083
1084#ifdef CONFIG_IWLWIFI_DEBUGFS
1085 debugfs_remove_recursive(drv->dbgfs_drv);
1086#endif
1087
1003 kfree(drv); 1088 kfree(drv);
1004} 1089}
1005 1090
@@ -1022,15 +1107,18 @@ int iwl_opmode_register(const char *name, const struct iwl_op_mode_ops *ops)
1022{ 1107{
1023 int i; 1108 int i;
1024 struct iwl_drv *drv; 1109 struct iwl_drv *drv;
1110 struct iwlwifi_opmode_table *op;
1025 1111
1026 mutex_lock(&iwlwifi_opmode_table_mtx); 1112 mutex_lock(&iwlwifi_opmode_table_mtx);
1027 for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++) { 1113 for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++) {
1028 if (strcmp(iwlwifi_opmode_table[i].name, name)) 1114 op = &iwlwifi_opmode_table[i];
1115 if (strcmp(op->name, name))
1029 continue; 1116 continue;
1030 iwlwifi_opmode_table[i].ops = ops; 1117 op->ops = ops;
1031 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list) 1118 /* TODO: need to handle exceptional case */
1032 drv->op_mode = ops->start(drv->trans, drv->cfg, 1119 list_for_each_entry(drv, &op->drv, list)
1033 &drv->fw); 1120 drv->op_mode = _iwl_op_mode_start(drv, op);
1121
1034 mutex_unlock(&iwlwifi_opmode_table_mtx); 1122 mutex_unlock(&iwlwifi_opmode_table_mtx);
1035 return 0; 1123 return 0;
1036 } 1124 }
@@ -1051,12 +1139,9 @@ void iwl_opmode_deregister(const char *name)
1051 iwlwifi_opmode_table[i].ops = NULL; 1139 iwlwifi_opmode_table[i].ops = NULL;
1052 1140
1053 /* call the stop routine for all devices */ 1141 /* call the stop routine for all devices */
1054 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list) { 1142 list_for_each_entry(drv, &iwlwifi_opmode_table[i].drv, list)
1055 if (drv->op_mode) { 1143 _iwl_op_mode_stop(drv);
1056 iwl_op_mode_stop(drv->op_mode); 1144
1057 drv->op_mode = NULL;
1058 }
1059 }
1060 mutex_unlock(&iwlwifi_opmode_table_mtx); 1145 mutex_unlock(&iwlwifi_opmode_table_mtx);
1061 return; 1146 return;
1062 } 1147 }
@@ -1076,6 +1161,14 @@ static int __init iwl_drv_init(void)
1076 pr_info(DRV_DESCRIPTION ", " DRV_VERSION "\n"); 1161 pr_info(DRV_DESCRIPTION ", " DRV_VERSION "\n");
1077 pr_info(DRV_COPYRIGHT "\n"); 1162 pr_info(DRV_COPYRIGHT "\n");
1078 1163
1164#ifdef CONFIG_IWLWIFI_DEBUGFS
1165 /* Create the root of iwlwifi debugfs subsystem. */
1166 iwl_dbgfs_root = debugfs_create_dir(DRV_NAME, NULL);
1167
1168 if (!iwl_dbgfs_root)
1169 return -EFAULT;
1170#endif
1171
1079 return iwl_pci_register_driver(); 1172 return iwl_pci_register_driver();
1080} 1173}
1081module_init(iwl_drv_init); 1174module_init(iwl_drv_init);
@@ -1083,6 +1176,10 @@ module_init(iwl_drv_init);
1083static void __exit iwl_drv_exit(void) 1176static void __exit iwl_drv_exit(void)
1084{ 1177{
1085 iwl_pci_unregister_driver(); 1178 iwl_pci_unregister_driver();
1179
1180#ifdef CONFIG_IWLWIFI_DEBUGFS
1181 debugfs_remove_recursive(iwl_dbgfs_root);
1182#endif
1086} 1183}
1087module_exit(iwl_drv_exit); 1184module_exit(iwl_drv_exit);
1088 1185
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.h b/drivers/net/wireless/iwlwifi/iwl-drv.h
index 2cbf137b25bf..285de5f68c05 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.h
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.h
@@ -90,9 +90,9 @@
90 * 4) The bus specific component configures the bus 90 * 4) The bus specific component configures the bus
91 * 5) The bus specific component calls to the drv bus agnostic part 91 * 5) The bus specific component calls to the drv bus agnostic part
92 * (iwl_drv_start) 92 * (iwl_drv_start)
93 * 6) iwl_drv_start fetches the fw ASYNC, iwl_ucode_callback 93 * 6) iwl_drv_start fetches the fw ASYNC, iwl_req_fw_callback
94 * 7) iwl_ucode_callback parses the fw file 94 * 7) iwl_req_fw_callback parses the fw file
95 * 8) iwl_ucode_callback starts the wifi implementation to matches the fw 95 * 8) iwl_req_fw_callback starts the wifi implementation to matches the fw
96 */ 96 */
97 97
98struct iwl_drv; 98struct iwl_drv;
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
index 64886f95664f..c8d9b9517468 100644
--- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h
+++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
@@ -134,7 +134,8 @@ struct iwl_cfg;
134struct iwl_op_mode_ops { 134struct iwl_op_mode_ops {
135 struct iwl_op_mode *(*start)(struct iwl_trans *trans, 135 struct iwl_op_mode *(*start)(struct iwl_trans *trans,
136 const struct iwl_cfg *cfg, 136 const struct iwl_cfg *cfg,
137 const struct iwl_fw *fw); 137 const struct iwl_fw *fw,
138 struct dentry *dbgfs_dir);
138 void (*stop)(struct iwl_op_mode *op_mode); 139 void (*stop)(struct iwl_op_mode *op_mode);
139 int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb, 140 int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,
140 struct iwl_device_cmd *cmd); 141 struct iwl_device_cmd *cmd);
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 92576a3e84ef..ff1154232885 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -184,14 +184,20 @@ struct iwl_rx_packet {
184 * @CMD_SYNC: The caller will be stalled until the fw responds to the command 184 * @CMD_SYNC: The caller will be stalled until the fw responds to the command
185 * @CMD_ASYNC: Return right away and don't want for the response 185 * @CMD_ASYNC: Return right away and don't want for the response
186 * @CMD_WANT_SKB: valid only with CMD_SYNC. The caller needs the buffer of the 186 * @CMD_WANT_SKB: valid only with CMD_SYNC. The caller needs the buffer of the
187 * response. 187 * response. The caller needs to call iwl_free_resp when done.
188 * @CMD_WANT_HCMD: The caller needs to get the HCMD that was sent in the
189 * response handler. Chunks flagged by %IWL_HCMD_DFL_NOCOPY won't be
190 * copied. The pointer passed to the response handler is in the transport
191 * ownership and don't need to be freed by the op_mode. This also means
192 * that the pointer is invalidated after the op_mode's handler returns.
188 * @CMD_ON_DEMAND: This command is sent by the test mode pipe. 193 * @CMD_ON_DEMAND: This command is sent by the test mode pipe.
189 */ 194 */
190enum CMD_MODE { 195enum CMD_MODE {
191 CMD_SYNC = 0, 196 CMD_SYNC = 0,
192 CMD_ASYNC = BIT(0), 197 CMD_ASYNC = BIT(0),
193 CMD_WANT_SKB = BIT(1), 198 CMD_WANT_SKB = BIT(1),
194 CMD_ON_DEMAND = BIT(2), 199 CMD_WANT_HCMD = BIT(2),
200 CMD_ON_DEMAND = BIT(3),
195}; 201};
196 202
197#define DEF_CMD_PAYLOAD_SIZE 320 203#define DEF_CMD_PAYLOAD_SIZE 320
@@ -460,6 +466,8 @@ struct iwl_trans {
460 size_t dev_cmd_headroom; 466 size_t dev_cmd_headroom;
461 char dev_cmd_pool_name[50]; 467 char dev_cmd_pool_name[50];
462 468
469 struct dentry *dbgfs_dir;
470
463 /* pointer to trans specific struct */ 471 /* pointer to trans specific struct */
464 /*Ensure that this pointer will always be aligned to sizeof pointer */ 472 /*Ensure that this pointer will always be aligned to sizeof pointer */
465 char trans_specific[0] __aligned(sizeof(void *)); 473 char trans_specific[0] __aligned(sizeof(void *));
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c
index f4c3500b68c6..89bfb43f4946 100644
--- a/drivers/net/wireless/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/iwlwifi/pcie/drv.c
@@ -282,8 +282,14 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
282 if (!trans_pcie->drv) 282 if (!trans_pcie->drv)
283 goto out_free_trans; 283 goto out_free_trans;
284 284
285 /* register transport layer debugfs here */
286 if (iwl_trans_dbgfs_register(iwl_trans, iwl_trans->dbgfs_dir))
287 goto out_free_drv;
288
285 return 0; 289 return 0;
286 290
291out_free_drv:
292 iwl_drv_stop(trans_pcie->drv);
287out_free_trans: 293out_free_trans:
288 iwl_trans_pcie_free(iwl_trans); 294 iwl_trans_pcie_free(iwl_trans);
289 pci_set_drvdata(pdev, NULL); 295 pci_set_drvdata(pdev, NULL);
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index d9694c58208c..3ef8d5adc991 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -184,6 +184,7 @@ struct iwl_queue {
184 184
185struct iwl_pcie_tx_queue_entry { 185struct iwl_pcie_tx_queue_entry {
186 struct iwl_device_cmd *cmd; 186 struct iwl_device_cmd *cmd;
187 struct iwl_device_cmd *copy_cmd;
187 struct sk_buff *skb; 188 struct sk_buff *skb;
188 struct iwl_cmd_meta meta; 189 struct iwl_cmd_meta meta;
189}; 190};
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index 39a6ca1f009c..d80604a2bb1a 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -421,13 +421,23 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
421 index = SEQ_TO_INDEX(sequence); 421 index = SEQ_TO_INDEX(sequence);
422 cmd_index = get_cmd_index(&txq->q, index); 422 cmd_index = get_cmd_index(&txq->q, index);
423 423
424 if (reclaim) 424 if (reclaim) {
425 cmd = txq->entries[cmd_index].cmd; 425 struct iwl_pcie_tx_queue_entry *ent;
426 else 426 ent = &txq->entries[cmd_index];
427 cmd = ent->copy_cmd;
428 WARN_ON_ONCE(!cmd && ent->meta.flags & CMD_WANT_HCMD);
429 } else {
427 cmd = NULL; 430 cmd = NULL;
431 }
428 432
429 err = iwl_op_mode_rx(trans->op_mode, &rxcb, cmd); 433 err = iwl_op_mode_rx(trans->op_mode, &rxcb, cmd);
430 434
435 if (reclaim) {
436 /* The original command isn't needed any more */
437 kfree(txq->entries[cmd_index].copy_cmd);
438 txq->entries[cmd_index].copy_cmd = NULL;
439 }
440
431 /* 441 /*
432 * After here, we should always check rxcb._page_stolen, 442 * After here, we should always check rxcb._page_stolen,
433 * if it is true then one of the handlers took the page. 443 * if it is true then one of the handlers took the page.
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 939c2f78df58..38f51b04217e 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -492,10 +492,11 @@ static void iwl_tx_queue_free(struct iwl_trans *trans, int txq_id)
492 iwl_tx_queue_unmap(trans, txq_id); 492 iwl_tx_queue_unmap(trans, txq_id);
493 493
494 /* De-alloc array of command/tx buffers */ 494 /* De-alloc array of command/tx buffers */
495
496 if (txq_id == trans_pcie->cmd_queue) 495 if (txq_id == trans_pcie->cmd_queue)
497 for (i = 0; i < txq->q.n_window; i++) 496 for (i = 0; i < txq->q.n_window; i++) {
498 kfree(txq->entries[i].cmd); 497 kfree(txq->entries[i].cmd);
498 kfree(txq->entries[i].copy_cmd);
499 }
499 500
500 /* De-alloc circular buffer of TFDs */ 501 /* De-alloc circular buffer of TFDs */
501 if (txq->q.n_bd) { 502 if (txq->q.n_bd) {
@@ -896,6 +897,7 @@ static int iwl_set_hw_ready(struct iwl_trans *trans)
896static int iwl_prepare_card_hw(struct iwl_trans *trans) 897static int iwl_prepare_card_hw(struct iwl_trans *trans)
897{ 898{
898 int ret; 899 int ret;
900 int t = 0;
899 901
900 IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); 902 IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n");
901 903
@@ -908,17 +910,15 @@ static int iwl_prepare_card_hw(struct iwl_trans *trans)
908 iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG, 910 iwl_set_bit(trans, CSR_HW_IF_CONFIG_REG,
909 CSR_HW_IF_CONFIG_REG_PREPARE); 911 CSR_HW_IF_CONFIG_REG_PREPARE);
910 912
911 ret = iwl_poll_bit(trans, CSR_HW_IF_CONFIG_REG, 913 do {
912 ~CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 914 ret = iwl_set_hw_ready(trans);
913 CSR_HW_IF_CONFIG_REG_BIT_NIC_PREPARE_DONE, 150000); 915 if (ret >= 0)
916 return 0;
914 917
915 if (ret < 0) 918 usleep_range(200, 1000);
916 return ret; 919 t += 200;
920 } while (t < 150000);
917 921
918 /* HW should be ready by now, check again. */
919 ret = iwl_set_hw_ready(trans);
920 if (ret >= 0)
921 return 0;
922 return ret; 922 return ret;
923} 923}
924 924
@@ -1769,7 +1769,7 @@ void iwl_dump_csr(struct iwl_trans *trans)
1769#define DEBUGFS_ADD_FILE(name, parent, mode) do { \ 1769#define DEBUGFS_ADD_FILE(name, parent, mode) do { \
1770 if (!debugfs_create_file(#name, mode, parent, trans, \ 1770 if (!debugfs_create_file(#name, mode, parent, trans, \
1771 &iwl_dbgfs_##name##_ops)) \ 1771 &iwl_dbgfs_##name##_ops)) \
1772 return -ENOMEM; \ 1772 goto err; \
1773} while (0) 1773} while (0)
1774 1774
1775/* file operation */ 1775/* file operation */
@@ -2033,6 +2033,10 @@ static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans,
2033 DEBUGFS_ADD_FILE(fh_reg, dir, S_IRUSR); 2033 DEBUGFS_ADD_FILE(fh_reg, dir, S_IRUSR);
2034 DEBUGFS_ADD_FILE(fw_restart, dir, S_IWUSR); 2034 DEBUGFS_ADD_FILE(fw_restart, dir, S_IWUSR);
2035 return 0; 2035 return 0;
2036
2037err:
2038 IWL_ERR(trans, "failed to create the trans debugfs entry\n");
2039 return -ENOMEM;
2036} 2040}
2037#else 2041#else
2038static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans, 2042static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans,
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
index 6baf8deef519..392d2bc5e357 100644
--- a/drivers/net/wireless/iwlwifi/pcie/tx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
@@ -521,7 +521,7 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
521 u16 copy_size, cmd_size; 521 u16 copy_size, cmd_size;
522 bool had_nocopy = false; 522 bool had_nocopy = false;
523 int i; 523 int i;
524 u8 *cmd_dest; 524 u32 cmd_pos;
525#ifdef CONFIG_IWLWIFI_DEVICE_TRACING 525#ifdef CONFIG_IWLWIFI_DEVICE_TRACING
526 const void *trace_bufs[IWL_MAX_CMD_TFDS + 1] = {}; 526 const void *trace_bufs[IWL_MAX_CMD_TFDS + 1] = {};
527 int trace_lens[IWL_MAX_CMD_TFDS + 1] = {}; 527 int trace_lens[IWL_MAX_CMD_TFDS + 1] = {};
@@ -584,15 +584,31 @@ static int iwl_enqueue_hcmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd)
584 INDEX_TO_SEQ(q->write_ptr)); 584 INDEX_TO_SEQ(q->write_ptr));
585 585
586 /* and copy the data that needs to be copied */ 586 /* and copy the data that needs to be copied */
587 587 cmd_pos = offsetof(struct iwl_device_cmd, payload);
588 cmd_dest = out_cmd->payload;
589 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) { 588 for (i = 0; i < IWL_MAX_CMD_TFDS; i++) {
590 if (!cmd->len[i]) 589 if (!cmd->len[i])
591 continue; 590 continue;
592 if (cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY) 591 if (cmd->dataflags[i] & IWL_HCMD_DFL_NOCOPY)
593 break; 592 break;
594 memcpy(cmd_dest, cmd->data[i], cmd->len[i]); 593 memcpy((u8 *)out_cmd + cmd_pos, cmd->data[i], cmd->len[i]);
595 cmd_dest += cmd->len[i]; 594 cmd_pos += cmd->len[i];
595 }
596
597 WARN_ON_ONCE(txq->entries[idx].copy_cmd);
598
599 /*
600 * since out_cmd will be the source address of the FH, it will write
601 * the retry count there. So when the user needs to receivce the HCMD
602 * that corresponds to the response in the response handler, it needs
603 * to set CMD_WANT_HCMD.
604 */
605 if (cmd->flags & CMD_WANT_HCMD) {
606 txq->entries[idx].copy_cmd =
607 kmemdup(out_cmd, cmd_pos, GFP_ATOMIC);
608 if (unlikely(!txq->entries[idx].copy_cmd)) {
609 idx = -ENOMEM;
610 goto out;
611 }
596 } 612 }
597 613
598 IWL_DEBUG_HC(trans, 614 IWL_DEBUG_HC(trans,
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index a03457292c88..7001856241e6 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -227,7 +227,9 @@ static void lbtf_free_adapter(struct lbtf_private *priv)
227 lbtf_deb_leave(LBTF_DEB_MAIN); 227 lbtf_deb_leave(LBTF_DEB_MAIN);
228} 228}
229 229
230static void lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 230static void lbtf_op_tx(struct ieee80211_hw *hw,
231 struct ieee80211_tx_control *control,
232 struct sk_buff *skb)
231{ 233{
232 struct lbtf_private *priv = hw->priv; 234 struct lbtf_private *priv = hw->priv;
233 235
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 00838395778c..72b0456e41bf 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -709,7 +709,9 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
709 return ack; 709 return ack;
710} 710}
711 711
712static void mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 712static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
713 struct ieee80211_tx_control *control,
714 struct sk_buff *skb)
713{ 715{
714 bool ack; 716 bool ack;
715 struct ieee80211_tx_info *txi; 717 struct ieee80211_tx_info *txi;
@@ -1727,6 +1729,7 @@ static const struct ieee80211_iface_limit hwsim_if_limits[] = {
1727#endif 1729#endif
1728 BIT(NL80211_IFTYPE_AP) | 1730 BIT(NL80211_IFTYPE_AP) |
1729 BIT(NL80211_IFTYPE_P2P_GO) }, 1731 BIT(NL80211_IFTYPE_P2P_GO) },
1732 { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) },
1730}; 1733};
1731 1734
1732static const struct ieee80211_iface_combination hwsim_if_comb = { 1735static const struct ieee80211_iface_combination hwsim_if_comb = {
@@ -1813,7 +1816,8 @@ static int __init init_mac80211_hwsim(void)
1813 BIT(NL80211_IFTYPE_P2P_CLIENT) | 1816 BIT(NL80211_IFTYPE_P2P_CLIENT) |
1814 BIT(NL80211_IFTYPE_P2P_GO) | 1817 BIT(NL80211_IFTYPE_P2P_GO) |
1815 BIT(NL80211_IFTYPE_ADHOC) | 1818 BIT(NL80211_IFTYPE_ADHOC) |
1816 BIT(NL80211_IFTYPE_MESH_POINT); 1819 BIT(NL80211_IFTYPE_MESH_POINT) |
1820 BIT(NL80211_IFTYPE_P2P_DEVICE);
1817 1821
1818 hw->flags = IEEE80211_HW_MFP_CAPABLE | 1822 hw->flags = IEEE80211_HW_MFP_CAPABLE |
1819 IEEE80211_HW_SIGNAL_DBM | 1823 IEEE80211_HW_SIGNAL_DBM |
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 224e03ade145..5099e5375cb3 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1830,12 +1830,14 @@ static inline void mwl8k_tx_count_packet(struct ieee80211_sta *sta, u8 tid)
1830} 1830}
1831 1831
1832static void 1832static void
1833mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) 1833mwl8k_txq_xmit(struct ieee80211_hw *hw,
1834 int index,
1835 struct ieee80211_sta *sta,
1836 struct sk_buff *skb)
1834{ 1837{
1835 struct mwl8k_priv *priv = hw->priv; 1838 struct mwl8k_priv *priv = hw->priv;
1836 struct ieee80211_tx_info *tx_info; 1839 struct ieee80211_tx_info *tx_info;
1837 struct mwl8k_vif *mwl8k_vif; 1840 struct mwl8k_vif *mwl8k_vif;
1838 struct ieee80211_sta *sta;
1839 struct ieee80211_hdr *wh; 1841 struct ieee80211_hdr *wh;
1840 struct mwl8k_tx_queue *txq; 1842 struct mwl8k_tx_queue *txq;
1841 struct mwl8k_tx_desc *tx; 1843 struct mwl8k_tx_desc *tx;
@@ -1867,7 +1869,6 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
1867 wh = &((struct mwl8k_dma_data *)skb->data)->wh; 1869 wh = &((struct mwl8k_dma_data *)skb->data)->wh;
1868 1870
1869 tx_info = IEEE80211_SKB_CB(skb); 1871 tx_info = IEEE80211_SKB_CB(skb);
1870 sta = tx_info->control.sta;
1871 mwl8k_vif = MWL8K_VIF(tx_info->control.vif); 1872 mwl8k_vif = MWL8K_VIF(tx_info->control.vif);
1872 1873
1873 if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { 1874 if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
@@ -2019,8 +2020,8 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
2019 tx->pkt_phys_addr = cpu_to_le32(dma); 2020 tx->pkt_phys_addr = cpu_to_le32(dma);
2020 tx->pkt_len = cpu_to_le16(skb->len); 2021 tx->pkt_len = cpu_to_le16(skb->len);
2021 tx->rate_info = 0; 2022 tx->rate_info = 0;
2022 if (!priv->ap_fw && tx_info->control.sta != NULL) 2023 if (!priv->ap_fw && sta != NULL)
2023 tx->peer_id = MWL8K_STA(tx_info->control.sta)->peer_id; 2024 tx->peer_id = MWL8K_STA(sta)->peer_id;
2024 else 2025 else
2025 tx->peer_id = 0; 2026 tx->peer_id = 0;
2026 2027
@@ -4364,7 +4365,9 @@ static void mwl8k_rx_poll(unsigned long data)
4364/* 4365/*
4365 * Core driver operations. 4366 * Core driver operations.
4366 */ 4367 */
4367static void mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 4368static void mwl8k_tx(struct ieee80211_hw *hw,
4369 struct ieee80211_tx_control *control,
4370 struct sk_buff *skb)
4368{ 4371{
4369 struct mwl8k_priv *priv = hw->priv; 4372 struct mwl8k_priv *priv = hw->priv;
4370 int index = skb_get_queue_mapping(skb); 4373 int index = skb_get_queue_mapping(skb);
@@ -4376,7 +4379,7 @@ static void mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
4376 return; 4379 return;
4377 } 4380 }
4378 4381
4379 mwl8k_txq_xmit(hw, index, skb); 4382 mwl8k_txq_xmit(hw, index, control->sta, skb);
4380} 4383}
4381 4384
4382static int mwl8k_start(struct ieee80211_hw *hw) 4385static int mwl8k_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/p54/lmac.h b/drivers/net/wireless/p54/lmac.h
index 3d8d622bec55..de1d46bf97df 100644
--- a/drivers/net/wireless/p54/lmac.h
+++ b/drivers/net/wireless/p54/lmac.h
@@ -526,7 +526,9 @@ int p54_init_leds(struct p54_common *priv);
526void p54_unregister_leds(struct p54_common *priv); 526void p54_unregister_leds(struct p54_common *priv);
527 527
528/* xmit functions */ 528/* xmit functions */
529void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb); 529void p54_tx_80211(struct ieee80211_hw *dev,
530 struct ieee80211_tx_control *control,
531 struct sk_buff *skb);
530int p54_tx_cancel(struct p54_common *priv, __le32 req_id); 532int p54_tx_cancel(struct p54_common *priv, __le32 req_id);
531void p54_tx(struct p54_common *priv, struct sk_buff *skb); 533void p54_tx(struct p54_common *priv, struct sk_buff *skb);
532 534
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 7cffea795ad2..5e91ad06dd5d 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -158,7 +158,7 @@ static int p54_beacon_update(struct p54_common *priv,
158 * to cancel the old beacon template by hand, instead the firmware 158 * to cancel the old beacon template by hand, instead the firmware
159 * will release the previous one through the feedback mechanism. 159 * will release the previous one through the feedback mechanism.
160 */ 160 */
161 p54_tx_80211(priv->hw, beacon); 161 p54_tx_80211(priv->hw, NULL, beacon);
162 priv->tsf_high32 = 0; 162 priv->tsf_high32 = 0;
163 priv->tsf_low32 = 0; 163 priv->tsf_low32 = 0;
164 164
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index f38786e02623..5861e13a6fd8 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -676,8 +676,9 @@ int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb)
676EXPORT_SYMBOL_GPL(p54_rx); 676EXPORT_SYMBOL_GPL(p54_rx);
677 677
678static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb, 678static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
679 struct ieee80211_tx_info *info, u8 *queue, 679 struct ieee80211_tx_info *info,
680 u32 *extra_len, u16 *flags, u16 *aid, 680 struct ieee80211_sta *sta,
681 u8 *queue, u32 *extra_len, u16 *flags, u16 *aid,
681 bool *burst_possible) 682 bool *burst_possible)
682{ 683{
683 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 684 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -746,8 +747,8 @@ static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
746 } 747 }
747 } 748 }
748 749
749 if (info->control.sta) 750 if (sta)
750 *aid = info->control.sta->aid; 751 *aid = sta->aid;
751 break; 752 break;
752 } 753 }
753} 754}
@@ -767,7 +768,9 @@ static u8 p54_convert_algo(u32 cipher)
767 } 768 }
768} 769}
769 770
770void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb) 771void p54_tx_80211(struct ieee80211_hw *dev,
772 struct ieee80211_tx_control *control,
773 struct sk_buff *skb)
771{ 774{
772 struct p54_common *priv = dev->priv; 775 struct p54_common *priv = dev->priv;
773 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 776 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -784,7 +787,7 @@ void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
784 u8 nrates = 0, nremaining = 8; 787 u8 nrates = 0, nremaining = 8;
785 bool burst_allowed = false; 788 bool burst_allowed = false;
786 789
787 p54_tx_80211_header(priv, skb, info, &queue, &extra_len, 790 p54_tx_80211_header(priv, skb, info, control->sta, &queue, &extra_len,
788 &hdr_flags, &aid, &burst_allowed); 791 &hdr_flags, &aid, &burst_allowed);
789 792
790 if (p54_tx_qos_accounting_alloc(priv, skb, queue)) { 793 if (p54_tx_qos_accounting_alloc(priv, skb, queue)) {
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 8afb546c2b2d..f991e8bedc70 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1287,7 +1287,9 @@ void rt2x00lib_rxdone(struct queue_entry *entry, gfp_t gfp);
1287/* 1287/*
1288 * mac80211 handlers. 1288 * mac80211 handlers.
1289 */ 1289 */
1290void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 1290void rt2x00mac_tx(struct ieee80211_hw *hw,
1291 struct ieee80211_tx_control *control,
1292 struct sk_buff *skb);
1291int rt2x00mac_start(struct ieee80211_hw *hw); 1293int rt2x00mac_start(struct ieee80211_hw *hw);
1292void rt2x00mac_stop(struct ieee80211_hw *hw); 1294void rt2x00mac_stop(struct ieee80211_hw *hw);
1293int rt2x00mac_add_interface(struct ieee80211_hw *hw, 1295int rt2x00mac_add_interface(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index a6b88bd4a1a5..a59048ffa092 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -194,7 +194,7 @@ static void rt2x00lib_bc_buffer_iter(void *data, u8 *mac,
194 */ 194 */
195 skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif); 195 skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
196 while (skb) { 196 while (skb) {
197 rt2x00mac_tx(rt2x00dev->hw, skb); 197 rt2x00mac_tx(rt2x00dev->hw, NULL, skb);
198 skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif); 198 skb = ieee80211_get_buffered_bc(rt2x00dev->hw, vif);
199 } 199 }
200} 200}
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 4ff26c2159bf..c3d0f2f87b69 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -99,7 +99,9 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
99 return retval; 99 return retval;
100} 100}
101 101
102void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 102void rt2x00mac_tx(struct ieee80211_hw *hw,
103 struct ieee80211_tx_control *control,
104 struct sk_buff *skb)
103{ 105{
104 struct rt2x00_dev *rt2x00dev = hw->priv; 106 struct rt2x00_dev *rt2x00dev = hw->priv;
105 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 107 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index f7e74a0a7759..e488b944a034 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -315,6 +315,7 @@ static void rt2x00queue_create_tx_descriptor_plcp(struct rt2x00_dev *rt2x00dev,
315static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev, 315static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
316 struct sk_buff *skb, 316 struct sk_buff *skb,
317 struct txentry_desc *txdesc, 317 struct txentry_desc *txdesc,
318 struct ieee80211_sta *sta,
318 const struct rt2x00_rate *hwrate) 319 const struct rt2x00_rate *hwrate)
319{ 320{
320 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 321 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
@@ -322,11 +323,11 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
322 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 323 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
323 struct rt2x00_sta *sta_priv = NULL; 324 struct rt2x00_sta *sta_priv = NULL;
324 325
325 if (tx_info->control.sta) { 326 if (sta) {
326 txdesc->u.ht.mpdu_density = 327 txdesc->u.ht.mpdu_density =
327 tx_info->control.sta->ht_cap.ampdu_density; 328 sta->ht_cap.ampdu_density;
328 329
329 sta_priv = sta_to_rt2x00_sta(tx_info->control.sta); 330 sta_priv = sta_to_rt2x00_sta(sta);
330 txdesc->u.ht.wcid = sta_priv->wcid; 331 txdesc->u.ht.wcid = sta_priv->wcid;
331 } 332 }
332 333
@@ -341,8 +342,8 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
341 * MIMO PS should be set to 1 for STA's using dynamic SM PS 342 * MIMO PS should be set to 1 for STA's using dynamic SM PS
342 * when using more then one tx stream (>MCS7). 343 * when using more then one tx stream (>MCS7).
343 */ 344 */
344 if (tx_info->control.sta && txdesc->u.ht.mcs > 7 && 345 if (sta && txdesc->u.ht.mcs > 7 &&
345 ((tx_info->control.sta->ht_cap.cap & 346 ((sta->ht_cap.cap &
346 IEEE80211_HT_CAP_SM_PS) >> 347 IEEE80211_HT_CAP_SM_PS) >>
347 IEEE80211_HT_CAP_SM_PS_SHIFT) == 348 IEEE80211_HT_CAP_SM_PS_SHIFT) ==
348 WLAN_HT_CAP_SM_PS_DYNAMIC) 349 WLAN_HT_CAP_SM_PS_DYNAMIC)
@@ -409,7 +410,8 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
409 410
410static void rt2x00queue_create_tx_descriptor(struct rt2x00_dev *rt2x00dev, 411static void rt2x00queue_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
411 struct sk_buff *skb, 412 struct sk_buff *skb,
412 struct txentry_desc *txdesc) 413 struct txentry_desc *txdesc,
414 struct ieee80211_sta *sta)
413{ 415{
414 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 416 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
415 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 417 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -503,7 +505,7 @@ static void rt2x00queue_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
503 505
504 if (test_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags)) 506 if (test_bit(REQUIRE_HT_TX_DESC, &rt2x00dev->cap_flags))
505 rt2x00queue_create_tx_descriptor_ht(rt2x00dev, skb, txdesc, 507 rt2x00queue_create_tx_descriptor_ht(rt2x00dev, skb, txdesc,
506 hwrate); 508 sta, hwrate);
507 else 509 else
508 rt2x00queue_create_tx_descriptor_plcp(rt2x00dev, skb, txdesc, 510 rt2x00queue_create_tx_descriptor_plcp(rt2x00dev, skb, txdesc,
509 hwrate); 511 hwrate);
@@ -595,7 +597,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
595 * after that we are free to use the skb->cb array 597 * after that we are free to use the skb->cb array
596 * for our information. 598 * for our information.
597 */ 599 */
598 rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc); 600 rt2x00queue_create_tx_descriptor(queue->rt2x00dev, skb, &txdesc, NULL);
599 601
600 /* 602 /*
601 * All information is retrieved from the skb->cb array, 603 * All information is retrieved from the skb->cb array,
@@ -740,7 +742,7 @@ int rt2x00queue_update_beacon_locked(struct rt2x00_dev *rt2x00dev,
740 * after that we are free to use the skb->cb array 742 * after that we are free to use the skb->cb array
741 * for our information. 743 * for our information.
742 */ 744 */
743 rt2x00queue_create_tx_descriptor(rt2x00dev, intf->beacon->skb, &txdesc); 745 rt2x00queue_create_tx_descriptor(rt2x00dev, intf->beacon->skb, &txdesc, NULL);
744 746
745 /* 747 /*
746 * Fill in skb descriptor 748 * Fill in skb descriptor
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index aceaf689f737..021d83e1b1d3 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -244,7 +244,9 @@ static irqreturn_t rtl8180_interrupt(int irq, void *dev_id)
244 return IRQ_HANDLED; 244 return IRQ_HANDLED;
245} 245}
246 246
247static void rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 247static void rtl8180_tx(struct ieee80211_hw *dev,
248 struct ieee80211_tx_control *control,
249 struct sk_buff *skb)
248{ 250{
249 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 251 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
250 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 252 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -710,7 +712,7 @@ static void rtl8180_beacon_work(struct work_struct *work)
710 /* TODO: use actual beacon queue */ 712 /* TODO: use actual beacon queue */
711 skb_set_queue_mapping(skb, 0); 713 skb_set_queue_mapping(skb, 0);
712 714
713 rtl8180_tx(dev, skb); 715 rtl8180_tx(dev, NULL, skb);
714 716
715resched: 717resched:
716 /* 718 /*
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 533024095c43..7811b6315973 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -228,7 +228,9 @@ static void rtl8187_tx_cb(struct urb *urb)
228 } 228 }
229} 229}
230 230
231static void rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 231static void rtl8187_tx(struct ieee80211_hw *dev,
232 struct ieee80211_tx_control *control,
233 struct sk_buff *skb)
232{ 234{
233 struct rtl8187_priv *priv = dev->priv; 235 struct rtl8187_priv *priv = dev->priv;
234 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 236 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -1076,7 +1078,7 @@ static void rtl8187_beacon_work(struct work_struct *work)
1076 /* TODO: use actual beacon queue */ 1078 /* TODO: use actual beacon queue */
1077 skb_set_queue_mapping(skb, 0); 1079 skb_set_queue_mapping(skb, 0);
1078 1080
1079 rtl8187_tx(dev, skb); 1081 rtl8187_tx(dev, NULL, skb);
1080 1082
1081resched: 1083resched:
1082 /* 1084 /*
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 942e56b77b60..59381fe8ed06 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -1341,9 +1341,8 @@ int rtl_send_smps_action(struct ieee80211_hw *hw,
1341 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0); 1341 rtlpriv->cfg->ops->update_rate_tbl(hw, sta, 0);
1342 1342
1343 info->control.rates[0].idx = 0; 1343 info->control.rates[0].idx = 0;
1344 info->control.sta = sta;
1345 info->band = hw->conf.channel->band; 1344 info->band = hw->conf.channel->band;
1346 rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc); 1345 rtlpriv->intf_ops->adapter_tx(hw, sta, skb, &tcb_desc);
1347 } 1346 }
1348err_free: 1347err_free:
1349 return 0; 1348 return 0;
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index a18ad2a98938..a7c0e52869ba 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -124,7 +124,9 @@ static void rtl_op_stop(struct ieee80211_hw *hw)
124 mutex_unlock(&rtlpriv->locks.conf_mutex); 124 mutex_unlock(&rtlpriv->locks.conf_mutex);
125} 125}
126 126
127static void rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 127static void rtl_op_tx(struct ieee80211_hw *hw,
128 struct ieee80211_tx_control *control,
129 struct sk_buff *skb)
128{ 130{
129 struct rtl_priv *rtlpriv = rtl_priv(hw); 131 struct rtl_priv *rtlpriv = rtl_priv(hw);
130 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 132 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -138,8 +140,8 @@ static void rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
138 if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status)) 140 if (!test_bit(RTL_STATUS_INTERFACE_START, &rtlpriv->status))
139 goto err_free; 141 goto err_free;
140 142
141 if (!rtlpriv->intf_ops->waitq_insert(hw, skb)) 143 if (!rtlpriv->intf_ops->waitq_insert(hw, control->sta, skb))
142 rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc); 144 rtlpriv->intf_ops->adapter_tx(hw, control->sta, skb, &tcb_desc);
143 145
144 return; 146 return;
145 147
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 80f75d3ba84a..aad9d44c0a51 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -504,7 +504,7 @@ static void _rtl_pci_tx_chk_waitq(struct ieee80211_hw *hw)
504 _rtl_update_earlymode_info(hw, skb, 504 _rtl_update_earlymode_info(hw, skb,
505 &tcb_desc, tid); 505 &tcb_desc, tid);
506 506
507 rtlpriv->intf_ops->adapter_tx(hw, skb, &tcb_desc); 507 rtlpriv->intf_ops->adapter_tx(hw, NULL, skb, &tcb_desc);
508 } 508 }
509 } 509 }
510} 510}
@@ -929,7 +929,7 @@ static void _rtl_pci_prepare_bcn_tasklet(struct ieee80211_hw *hw)
929 info = IEEE80211_SKB_CB(pskb); 929 info = IEEE80211_SKB_CB(pskb);
930 pdesc = &ring->desc[0]; 930 pdesc = &ring->desc[0];
931 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc, 931 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *) pdesc,
932 info, pskb, BEACON_QUEUE, &tcb_desc); 932 info, NULL, pskb, BEACON_QUEUE, &tcb_desc);
933 933
934 __skb_queue_tail(&ring->queue, pskb); 934 __skb_queue_tail(&ring->queue, pskb);
935 935
@@ -1305,11 +1305,10 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw)
1305} 1305}
1306 1306
1307static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw, 1307static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw,
1308 struct ieee80211_sta *sta,
1308 struct sk_buff *skb) 1309 struct sk_buff *skb)
1309{ 1310{
1310 struct rtl_priv *rtlpriv = rtl_priv(hw); 1311 struct rtl_priv *rtlpriv = rtl_priv(hw);
1311 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1312 struct ieee80211_sta *sta = info->control.sta;
1313 struct rtl_sta_info *sta_entry = NULL; 1312 struct rtl_sta_info *sta_entry = NULL;
1314 u8 tid = rtl_get_tid(skb); 1313 u8 tid = rtl_get_tid(skb);
1315 1314
@@ -1337,13 +1336,14 @@ static bool rtl_pci_tx_chk_waitq_insert(struct ieee80211_hw *hw,
1337 return true; 1336 return true;
1338} 1337}
1339 1338
1340static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb, 1339static int rtl_pci_tx(struct ieee80211_hw *hw,
1341 struct rtl_tcb_desc *ptcb_desc) 1340 struct ieee80211_sta *sta,
1341 struct sk_buff *skb,
1342 struct rtl_tcb_desc *ptcb_desc)
1342{ 1343{
1343 struct rtl_priv *rtlpriv = rtl_priv(hw); 1344 struct rtl_priv *rtlpriv = rtl_priv(hw);
1344 struct rtl_sta_info *sta_entry = NULL; 1345 struct rtl_sta_info *sta_entry = NULL;
1345 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1346 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1346 struct ieee80211_sta *sta = info->control.sta;
1347 struct rtl8192_tx_ring *ring; 1347 struct rtl8192_tx_ring *ring;
1348 struct rtl_tx_desc *pdesc; 1348 struct rtl_tx_desc *pdesc;
1349 u8 idx; 1349 u8 idx;
@@ -1418,7 +1418,7 @@ static int rtl_pci_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
1418 rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX); 1418 rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX);
1419 1419
1420 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *)pdesc, 1420 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *)pdesc,
1421 info, skb, hw_queue, ptcb_desc); 1421 info, sta, skb, hw_queue, ptcb_desc);
1422 1422
1423 __skb_queue_tail(&ring->queue, skb); 1423 __skb_queue_tail(&ring->queue, skb);
1424 1424
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 52166640f167..390d6d4fcaa0 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -596,7 +596,9 @@ bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
596 596
597void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, 597void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
598 struct ieee80211_hdr *hdr, u8 *pdesc_tx, 598 struct ieee80211_hdr *hdr, u8 *pdesc_tx,
599 struct ieee80211_tx_info *info, struct sk_buff *skb, 599 struct ieee80211_tx_info *info,
600 struct ieee80211_sta *sta,
601 struct sk_buff *skb,
600 u8 hw_queue, struct rtl_tcb_desc *tcb_desc) 602 u8 hw_queue, struct rtl_tcb_desc *tcb_desc)
601{ 603{
602 struct rtl_priv *rtlpriv = rtl_priv(hw); 604 struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -604,7 +606,6 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
604 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 606 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
605 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 607 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
606 bool defaultadapter = true; 608 bool defaultadapter = true;
607 struct ieee80211_sta *sta;
608 u8 *pdesc = pdesc_tx; 609 u8 *pdesc = pdesc_tx;
609 u16 seq_number; 610 u16 seq_number;
610 __le16 fc = hdr->frame_control; 611 __le16 fc = hdr->frame_control;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
index c4adb9777365..a7cdd514cb2e 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.h
@@ -713,6 +713,7 @@ struct rx_desc_92c {
713void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw, 713void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
714 struct ieee80211_hdr *hdr, 714 struct ieee80211_hdr *hdr,
715 u8 *pdesc, struct ieee80211_tx_info *info, 715 u8 *pdesc, struct ieee80211_tx_info *info,
716 struct ieee80211_sta *sta,
716 struct sk_buff *skb, u8 hw_queue, 717 struct sk_buff *skb, u8 hw_queue,
717 struct rtl_tcb_desc *ptcb_desc); 718 struct rtl_tcb_desc *ptcb_desc);
718bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw, 719bool rtl92ce_rx_query_desc(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 2e6eb356a93e..27863d773790 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -496,7 +496,9 @@ static void _rtl_tx_desc_checksum(u8 *txdesc)
496 496
497void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, 497void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
498 struct ieee80211_hdr *hdr, u8 *pdesc_tx, 498 struct ieee80211_hdr *hdr, u8 *pdesc_tx,
499 struct ieee80211_tx_info *info, struct sk_buff *skb, 499 struct ieee80211_tx_info *info,
500 struct ieee80211_sta *sta,
501 struct sk_buff *skb,
500 u8 queue_index, 502 u8 queue_index,
501 struct rtl_tcb_desc *tcb_desc) 503 struct rtl_tcb_desc *tcb_desc)
502{ 504{
@@ -504,7 +506,6 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
504 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 506 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
505 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 507 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
506 bool defaultadapter = true; 508 bool defaultadapter = true;
507 struct ieee80211_sta *sta = info->control.sta = info->control.sta;
508 u8 *qc = ieee80211_get_qos_ctl(hdr); 509 u8 *qc = ieee80211_get_qos_ctl(hdr);
509 u8 tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK; 510 u8 tid = qc[0] & IEEE80211_QOS_CTL_TID_MASK;
510 u16 seq_number; 511 u16 seq_number;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h
index 332b06e78b00..725c53accc58 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.h
@@ -420,7 +420,9 @@ struct sk_buff *rtl8192c_tx_aggregate_hdl(struct ieee80211_hw *,
420 struct sk_buff_head *); 420 struct sk_buff_head *);
421void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw, 421void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
422 struct ieee80211_hdr *hdr, u8 *pdesc_tx, 422 struct ieee80211_hdr *hdr, u8 *pdesc_tx,
423 struct ieee80211_tx_info *info, struct sk_buff *skb, 423 struct ieee80211_tx_info *info,
424 struct ieee80211_sta *sta,
425 struct sk_buff *skb,
424 u8 queue_index, 426 u8 queue_index,
425 struct rtl_tcb_desc *tcb_desc); 427 struct rtl_tcb_desc *tcb_desc);
426void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc, 428void rtl92cu_fill_fake_txdesc(struct ieee80211_hw *hw, u8 * pDesc,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
index f80690d82c11..4686f340b9d6 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.c
@@ -551,7 +551,9 @@ static void _rtl92de_insert_emcontent(struct rtl_tcb_desc *ptcb_desc,
551 551
552void rtl92de_tx_fill_desc(struct ieee80211_hw *hw, 552void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
553 struct ieee80211_hdr *hdr, u8 *pdesc_tx, 553 struct ieee80211_hdr *hdr, u8 *pdesc_tx,
554 struct ieee80211_tx_info *info, struct sk_buff *skb, 554 struct ieee80211_tx_info *info,
555 struct ieee80211_sta *sta,
556 struct sk_buff *skb,
555 u8 hw_queue, struct rtl_tcb_desc *ptcb_desc) 557 u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
556{ 558{
557 struct rtl_priv *rtlpriv = rtl_priv(hw); 559 struct rtl_priv *rtlpriv = rtl_priv(hw);
@@ -559,7 +561,6 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
559 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 561 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
560 struct rtl_hal *rtlhal = rtl_hal(rtlpriv); 562 struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
561 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); 563 struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw));
562 struct ieee80211_sta *sta = info->control.sta;
563 u8 *pdesc = pdesc_tx; 564 u8 *pdesc = pdesc_tx;
564 u16 seq_number; 565 u16 seq_number;
565 __le16 fc = hdr->frame_control; 566 __le16 fc = hdr->frame_control;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
index 057a52431b00..c1b5dfb79d53 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192de/trx.h
@@ -730,6 +730,7 @@ struct rx_desc_92d {
730void rtl92de_tx_fill_desc(struct ieee80211_hw *hw, 730void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
731 struct ieee80211_hdr *hdr, 731 struct ieee80211_hdr *hdr,
732 u8 *pdesc, struct ieee80211_tx_info *info, 732 u8 *pdesc, struct ieee80211_tx_info *info,
733 struct ieee80211_sta *sta,
733 struct sk_buff *skb, u8 hw_queue, 734 struct sk_buff *skb, u8 hw_queue,
734 struct rtl_tcb_desc *ptcb_desc); 735 struct rtl_tcb_desc *ptcb_desc);
735bool rtl92de_rx_query_desc(struct ieee80211_hw *hw, 736bool rtl92de_rx_query_desc(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
index 36d1cb3aef8a..28c53fb12aeb 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.c
@@ -591,14 +591,15 @@ bool rtl92se_rx_query_desc(struct ieee80211_hw *hw, struct rtl_stats *stats,
591 591
592void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, 592void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
593 struct ieee80211_hdr *hdr, u8 *pdesc_tx, 593 struct ieee80211_hdr *hdr, u8 *pdesc_tx,
594 struct ieee80211_tx_info *info, struct sk_buff *skb, 594 struct ieee80211_tx_info *info,
595 struct ieee80211_sta *sta,
596 struct sk_buff *skb,
595 u8 hw_queue, struct rtl_tcb_desc *ptcb_desc) 597 u8 hw_queue, struct rtl_tcb_desc *ptcb_desc)
596{ 598{
597 struct rtl_priv *rtlpriv = rtl_priv(hw); 599 struct rtl_priv *rtlpriv = rtl_priv(hw);
598 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 600 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
599 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw)); 601 struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
600 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 602 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
601 struct ieee80211_sta *sta = info->control.sta;
602 u8 *pdesc = pdesc_tx; 603 u8 *pdesc = pdesc_tx;
603 u16 seq_number; 604 u16 seq_number;
604 __le16 fc = hdr->frame_control; 605 __le16 fc = hdr->frame_control;
diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/trx.h b/drivers/net/wireless/rtlwifi/rtl8192se/trx.h
index 011e7b0695f2..64dd66f287c1 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192se/trx.h
+++ b/drivers/net/wireless/rtlwifi/rtl8192se/trx.h
@@ -31,6 +31,7 @@
31 31
32void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr, 32void rtl92se_tx_fill_desc(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
33 u8 *pdesc, struct ieee80211_tx_info *info, 33 u8 *pdesc, struct ieee80211_tx_info *info,
34 struct ieee80211_sta *sta,
34 struct sk_buff *skb, u8 hw_queue, 35 struct sk_buff *skb, u8 hw_queue,
35 struct rtl_tcb_desc *ptcb_desc); 36 struct rtl_tcb_desc *ptcb_desc);
36void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, bool firstseg, 37void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, bool firstseg,
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index aa970fc18a21..914046903cfd 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -848,8 +848,10 @@ static void _rtl_usb_transmit(struct ieee80211_hw *hw, struct sk_buff *skb,
848 _rtl_submit_tx_urb(hw, _urb); 848 _rtl_submit_tx_urb(hw, _urb);
849} 849}
850 850
851static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb, 851static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw,
852 u16 hw_queue) 852 struct ieee80211_sta *sta,
853 struct sk_buff *skb,
854 u16 hw_queue)
853{ 855{
854 struct rtl_priv *rtlpriv = rtl_priv(hw); 856 struct rtl_priv *rtlpriv = rtl_priv(hw);
855 struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); 857 struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
@@ -891,7 +893,7 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb,
891 seq_number += 1; 893 seq_number += 1;
892 seq_number <<= 4; 894 seq_number <<= 4;
893 } 895 }
894 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *)pdesc, info, skb, 896 rtlpriv->cfg->ops->fill_tx_desc(hw, hdr, (u8 *)pdesc, info, sta, skb,
895 hw_queue, &tcb_desc); 897 hw_queue, &tcb_desc);
896 if (!ieee80211_has_morefrags(hdr->frame_control)) { 898 if (!ieee80211_has_morefrags(hdr->frame_control)) {
897 if (qc) 899 if (qc)
@@ -901,7 +903,9 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw, struct sk_buff *skb,
901 rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX); 903 rtlpriv->cfg->ops->led_control(hw, LED_CTL_TX);
902} 904}
903 905
904static int rtl_usb_tx(struct ieee80211_hw *hw, struct sk_buff *skb, 906static int rtl_usb_tx(struct ieee80211_hw *hw,
907 struct ieee80211_sta *sta,
908 struct sk_buff *skb,
905 struct rtl_tcb_desc *dummy) 909 struct rtl_tcb_desc *dummy)
906{ 910{
907 struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); 911 struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw));
@@ -913,7 +917,7 @@ static int rtl_usb_tx(struct ieee80211_hw *hw, struct sk_buff *skb,
913 if (unlikely(is_hal_stop(rtlhal))) 917 if (unlikely(is_hal_stop(rtlhal)))
914 goto err_free; 918 goto err_free;
915 hw_queue = rtlusb->usb_mq_to_hwq(fc, skb_get_queue_mapping(skb)); 919 hw_queue = rtlusb->usb_mq_to_hwq(fc, skb_get_queue_mapping(skb));
916 _rtl_usb_tx_preprocess(hw, skb, hw_queue); 920 _rtl_usb_tx_preprocess(hw, sta, skb, hw_queue);
917 _rtl_usb_transmit(hw, skb, hw_queue); 921 _rtl_usb_transmit(hw, skb, hw_queue);
918 return NETDEV_TX_OK; 922 return NETDEV_TX_OK;
919 923
@@ -923,6 +927,7 @@ err_free:
923} 927}
924 928
925static bool rtl_usb_tx_chk_waitq_insert(struct ieee80211_hw *hw, 929static bool rtl_usb_tx_chk_waitq_insert(struct ieee80211_hw *hw,
930 struct ieee80211_sta *sta,
926 struct sk_buff *skb) 931 struct sk_buff *skb)
927{ 932{
928 return false; 933 return false;
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index cdaa21f29710..40153e7bf702 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -122,7 +122,7 @@ enum rt_eeprom_type {
122 EEPROM_BOOT_EFUSE, 122 EEPROM_BOOT_EFUSE,
123}; 123};
124 124
125enum rtl_status { 125enum ttl_status {
126 RTL_STATUS_INTERFACE_START = 0, 126 RTL_STATUS_INTERFACE_START = 0,
127}; 127};
128 128
@@ -1418,6 +1418,7 @@ struct rtl_hal_ops {
1418 void (*fill_tx_desc) (struct ieee80211_hw *hw, 1418 void (*fill_tx_desc) (struct ieee80211_hw *hw,
1419 struct ieee80211_hdr *hdr, u8 *pdesc_tx, 1419 struct ieee80211_hdr *hdr, u8 *pdesc_tx,
1420 struct ieee80211_tx_info *info, 1420 struct ieee80211_tx_info *info,
1421 struct ieee80211_sta *sta,
1421 struct sk_buff *skb, u8 hw_queue, 1422 struct sk_buff *skb, u8 hw_queue,
1422 struct rtl_tcb_desc *ptcb_desc); 1423 struct rtl_tcb_desc *ptcb_desc);
1423 void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 *pDesc, 1424 void (*fill_fake_txdesc) (struct ieee80211_hw *hw, u8 *pDesc,
@@ -1475,11 +1476,15 @@ struct rtl_intf_ops {
1475 int (*adapter_start) (struct ieee80211_hw *hw); 1476 int (*adapter_start) (struct ieee80211_hw *hw);
1476 void (*adapter_stop) (struct ieee80211_hw *hw); 1477 void (*adapter_stop) (struct ieee80211_hw *hw);
1477 1478
1478 int (*adapter_tx) (struct ieee80211_hw *hw, struct sk_buff *skb, 1479 int (*adapter_tx) (struct ieee80211_hw *hw,
1479 struct rtl_tcb_desc *ptcb_desc); 1480 struct ieee80211_sta *sta,
1481 struct sk_buff *skb,
1482 struct rtl_tcb_desc *ptcb_desc);
1480 void (*flush)(struct ieee80211_hw *hw, bool drop); 1483 void (*flush)(struct ieee80211_hw *hw, bool drop);
1481 int (*reset_trx_ring) (struct ieee80211_hw *hw); 1484 int (*reset_trx_ring) (struct ieee80211_hw *hw);
1482 bool (*waitq_insert) (struct ieee80211_hw *hw, struct sk_buff *skb); 1485 bool (*waitq_insert) (struct ieee80211_hw *hw,
1486 struct ieee80211_sta *sta,
1487 struct sk_buff *skb);
1483 1488
1484 /*pci */ 1489 /*pci */
1485 void (*disable_aspm) (struct ieee80211_hw *hw); 1490 void (*disable_aspm) (struct ieee80211_hw *hw);
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 3118c425bcf1..441cbccbd381 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -354,7 +354,9 @@ out:
354 return ret; 354 return ret;
355} 355}
356 356
357static void wl1251_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 357static void wl1251_op_tx(struct ieee80211_hw *hw,
358 struct ieee80211_tx_control *control,
359 struct sk_buff *skb)
358{ 360{
359 struct wl1251 *wl = hw->priv; 361 struct wl1251 *wl = hw->priv;
360 unsigned long flags; 362 unsigned long flags;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 72548609f711..ff830cf50c70 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1181,7 +1181,9 @@ out:
1181 return ret; 1181 return ret;
1182} 1182}
1183 1183
1184static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1184static void wl1271_op_tx(struct ieee80211_hw *hw,
1185 struct ieee80211_tx_control *control,
1186 struct sk_buff *skb)
1185{ 1187{
1186 struct wl1271 *wl = hw->priv; 1188 struct wl1271 *wl = hw->priv;
1187 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1189 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -1197,7 +1199,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1197 mapping = skb_get_queue_mapping(skb); 1199 mapping = skb_get_queue_mapping(skb);
1198 q = wl1271_tx_get_queue(mapping); 1200 q = wl1271_tx_get_queue(mapping);
1199 1201
1200 hlid = wl12xx_tx_get_hlid(wl, wlvif, skb); 1202 hlid = wl12xx_tx_get_hlid(wl, wlvif, skb, control->sta);
1201 1203
1202 spin_lock_irqsave(&wl->wl_lock, flags); 1204 spin_lock_irqsave(&wl->wl_lock, flags);
1203 1205
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index f0081f746482..1a2f31c289c5 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -130,16 +130,13 @@ bool wl12xx_is_dummy_packet(struct wl1271 *wl, struct sk_buff *skb)
130} 130}
131EXPORT_SYMBOL(wl12xx_is_dummy_packet); 131EXPORT_SYMBOL(wl12xx_is_dummy_packet);
132 132
133u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif, 133static u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
134 struct sk_buff *skb) 134 struct sk_buff *skb, struct ieee80211_sta *sta)
135{ 135{
136 struct ieee80211_tx_info *control = IEEE80211_SKB_CB(skb); 136 if (sta) {
137
138 if (control->control.sta) {
139 struct wl1271_station *wl_sta; 137 struct wl1271_station *wl_sta;
140 138
141 wl_sta = (struct wl1271_station *) 139 wl_sta = (struct wl1271_station *)sta->drv_priv;
142 control->control.sta->drv_priv;
143 return wl_sta->hlid; 140 return wl_sta->hlid;
144 } else { 141 } else {
145 struct ieee80211_hdr *hdr; 142 struct ieee80211_hdr *hdr;
@@ -156,7 +153,7 @@ u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
156} 153}
157 154
158u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif, 155u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
159 struct sk_buff *skb) 156 struct sk_buff *skb, struct ieee80211_sta *sta)
160{ 157{
161 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 158 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
162 159
@@ -164,7 +161,7 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
164 return wl->system_hlid; 161 return wl->system_hlid;
165 162
166 if (wlvif->bss_type == BSS_TYPE_AP_BSS) 163 if (wlvif->bss_type == BSS_TYPE_AP_BSS)
167 return wl12xx_tx_get_hlid_ap(wl, wlvif, skb); 164 return wl12xx_tx_get_hlid_ap(wl, wlvif, skb, sta);
168 165
169 if ((test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) || 166 if ((test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags) ||
170 test_bit(WLVIF_FLAG_IBSS_JOINED, &wlvif->flags)) && 167 test_bit(WLVIF_FLAG_IBSS_JOINED, &wlvif->flags)) &&
@@ -344,13 +341,12 @@ static void wl1271_tx_fill_hdr(struct wl1271 *wl, struct wl12xx_vif *wlvif,
344 341
345/* caller must hold wl->mutex */ 342/* caller must hold wl->mutex */
346static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif, 343static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif,
347 struct sk_buff *skb, u32 buf_offset) 344 struct sk_buff *skb, u32 buf_offset, u8 hlid)
348{ 345{
349 struct ieee80211_tx_info *info; 346 struct ieee80211_tx_info *info;
350 u32 extra = 0; 347 u32 extra = 0;
351 int ret = 0; 348 int ret = 0;
352 u32 total_len; 349 u32 total_len;
353 u8 hlid;
354 bool is_dummy; 350 bool is_dummy;
355 bool is_gem = false; 351 bool is_gem = false;
356 352
@@ -359,9 +355,13 @@ static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif,
359 return -EINVAL; 355 return -EINVAL;
360 } 356 }
361 357
358 if (hlid == WL12XX_INVALID_LINK_ID) {
359 wl1271_error("invalid hlid. dropping skb 0x%p", skb);
360 return -EINVAL;
361 }
362
362 info = IEEE80211_SKB_CB(skb); 363 info = IEEE80211_SKB_CB(skb);
363 364
364 /* TODO: handle dummy packets on multi-vifs */
365 is_dummy = wl12xx_is_dummy_packet(wl, skb); 365 is_dummy = wl12xx_is_dummy_packet(wl, skb);
366 366
367 if ((wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) && 367 if ((wl->quirks & WLCORE_QUIRK_TKIP_HEADER_SPACE) &&
@@ -386,11 +386,6 @@ static int wl1271_prepare_tx_frame(struct wl1271 *wl, struct wl12xx_vif *wlvif,
386 386
387 is_gem = (cipher == WL1271_CIPHER_SUITE_GEM); 387 is_gem = (cipher == WL1271_CIPHER_SUITE_GEM);
388 } 388 }
389 hlid = wl12xx_tx_get_hlid(wl, wlvif, skb);
390 if (hlid == WL12XX_INVALID_LINK_ID) {
391 wl1271_error("invalid hlid. dropping skb 0x%p", skb);
392 return -EINVAL;
393 }
394 389
395 ret = wl1271_tx_allocate(wl, wlvif, skb, extra, buf_offset, hlid, 390 ret = wl1271_tx_allocate(wl, wlvif, skb, extra, buf_offset, hlid,
396 is_gem); 391 is_gem);
@@ -517,7 +512,8 @@ static struct sk_buff *wl12xx_lnk_skb_dequeue(struct wl1271 *wl,
517} 512}
518 513
519static struct sk_buff *wl12xx_vif_skb_dequeue(struct wl1271 *wl, 514static struct sk_buff *wl12xx_vif_skb_dequeue(struct wl1271 *wl,
520 struct wl12xx_vif *wlvif) 515 struct wl12xx_vif *wlvif,
516 u8 *hlid)
521{ 517{
522 struct sk_buff *skb = NULL; 518 struct sk_buff *skb = NULL;
523 int i, h, start_hlid; 519 int i, h, start_hlid;
@@ -544,10 +540,11 @@ static struct sk_buff *wl12xx_vif_skb_dequeue(struct wl1271 *wl,
544 if (!skb) 540 if (!skb)
545 wlvif->last_tx_hlid = 0; 541 wlvif->last_tx_hlid = 0;
546 542
543 *hlid = wlvif->last_tx_hlid;
547 return skb; 544 return skb;
548} 545}
549 546
550static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl) 547static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl, u8 *hlid)
551{ 548{
552 unsigned long flags; 549 unsigned long flags;
553 struct wl12xx_vif *wlvif = wl->last_wlvif; 550 struct wl12xx_vif *wlvif = wl->last_wlvif;
@@ -556,7 +553,7 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
556 /* continue from last wlvif (round robin) */ 553 /* continue from last wlvif (round robin) */
557 if (wlvif) { 554 if (wlvif) {
558 wl12xx_for_each_wlvif_continue(wl, wlvif) { 555 wl12xx_for_each_wlvif_continue(wl, wlvif) {
559 skb = wl12xx_vif_skb_dequeue(wl, wlvif); 556 skb = wl12xx_vif_skb_dequeue(wl, wlvif, hlid);
560 if (skb) { 557 if (skb) {
561 wl->last_wlvif = wlvif; 558 wl->last_wlvif = wlvif;
562 break; 559 break;
@@ -565,13 +562,15 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
565 } 562 }
566 563
567 /* dequeue from the system HLID before the restarting wlvif list */ 564 /* dequeue from the system HLID before the restarting wlvif list */
568 if (!skb) 565 if (!skb) {
569 skb = wl12xx_lnk_skb_dequeue(wl, &wl->links[wl->system_hlid]); 566 skb = wl12xx_lnk_skb_dequeue(wl, &wl->links[wl->system_hlid]);
567 *hlid = wl->system_hlid;
568 }
570 569
571 /* do a new pass over the wlvif list */ 570 /* do a new pass over the wlvif list */
572 if (!skb) { 571 if (!skb) {
573 wl12xx_for_each_wlvif(wl, wlvif) { 572 wl12xx_for_each_wlvif(wl, wlvif) {
574 skb = wl12xx_vif_skb_dequeue(wl, wlvif); 573 skb = wl12xx_vif_skb_dequeue(wl, wlvif, hlid);
575 if (skb) { 574 if (skb) {
576 wl->last_wlvif = wlvif; 575 wl->last_wlvif = wlvif;
577 break; 576 break;
@@ -591,6 +590,7 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
591 int q; 590 int q;
592 591
593 skb = wl->dummy_packet; 592 skb = wl->dummy_packet;
593 *hlid = wl->system_hlid;
594 q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 594 q = wl1271_tx_get_queue(skb_get_queue_mapping(skb));
595 spin_lock_irqsave(&wl->wl_lock, flags); 595 spin_lock_irqsave(&wl->wl_lock, flags);
596 WARN_ON_ONCE(wl->tx_queue_count[q] <= 0); 596 WARN_ON_ONCE(wl->tx_queue_count[q] <= 0);
@@ -602,7 +602,7 @@ static struct sk_buff *wl1271_skb_dequeue(struct wl1271 *wl)
602} 602}
603 603
604static void wl1271_skb_queue_head(struct wl1271 *wl, struct wl12xx_vif *wlvif, 604static void wl1271_skb_queue_head(struct wl1271 *wl, struct wl12xx_vif *wlvif,
605 struct sk_buff *skb) 605 struct sk_buff *skb, u8 hlid)
606{ 606{
607 unsigned long flags; 607 unsigned long flags;
608 int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb)); 608 int q = wl1271_tx_get_queue(skb_get_queue_mapping(skb));
@@ -610,7 +610,6 @@ static void wl1271_skb_queue_head(struct wl1271 *wl, struct wl12xx_vif *wlvif,
610 if (wl12xx_is_dummy_packet(wl, skb)) { 610 if (wl12xx_is_dummy_packet(wl, skb)) {
611 set_bit(WL1271_FLAG_DUMMY_PACKET_PENDING, &wl->flags); 611 set_bit(WL1271_FLAG_DUMMY_PACKET_PENDING, &wl->flags);
612 } else { 612 } else {
613 u8 hlid = wl12xx_tx_get_hlid(wl, wlvif, skb);
614 skb_queue_head(&wl->links[hlid].tx_queue[q], skb); 613 skb_queue_head(&wl->links[hlid].tx_queue[q], skb);
615 614
616 /* make sure we dequeue the same packet next time */ 615 /* make sure we dequeue the same packet next time */
@@ -686,26 +685,30 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
686 unsigned long active_hlids[BITS_TO_LONGS(WL12XX_MAX_LINKS)] = {0}; 685 unsigned long active_hlids[BITS_TO_LONGS(WL12XX_MAX_LINKS)] = {0};
687 int ret = 0; 686 int ret = 0;
688 int bus_ret = 0; 687 int bus_ret = 0;
688 u8 hlid;
689 689
690 if (unlikely(wl->state == WL1271_STATE_OFF)) 690 if (unlikely(wl->state == WL1271_STATE_OFF))
691 return 0; 691 return 0;
692 692
693 while ((skb = wl1271_skb_dequeue(wl))) { 693 while ((skb = wl1271_skb_dequeue(wl, &hlid))) {
694 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 694 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
695 bool has_data = false; 695 bool has_data = false;
696 696
697 wlvif = NULL; 697 wlvif = NULL;
698 if (!wl12xx_is_dummy_packet(wl, skb) && info->control.vif) 698 if (!wl12xx_is_dummy_packet(wl, skb) && info->control.vif)
699 wlvif = wl12xx_vif_to_data(info->control.vif); 699 wlvif = wl12xx_vif_to_data(info->control.vif);
700 else
701 hlid = wl->system_hlid;
700 702
701 has_data = wlvif && wl1271_tx_is_data_present(skb); 703 has_data = wlvif && wl1271_tx_is_data_present(skb);
702 ret = wl1271_prepare_tx_frame(wl, wlvif, skb, buf_offset); 704 ret = wl1271_prepare_tx_frame(wl, wlvif, skb, buf_offset,
705 hlid);
703 if (ret == -EAGAIN) { 706 if (ret == -EAGAIN) {
704 /* 707 /*
705 * Aggregation buffer is full. 708 * Aggregation buffer is full.
706 * Flush buffer and try again. 709 * Flush buffer and try again.
707 */ 710 */
708 wl1271_skb_queue_head(wl, wlvif, skb); 711 wl1271_skb_queue_head(wl, wlvif, skb, hlid);
709 712
710 buf_offset = wlcore_hw_pre_pkt_send(wl, buf_offset, 713 buf_offset = wlcore_hw_pre_pkt_send(wl, buf_offset,
711 last_len); 714 last_len);
@@ -722,7 +725,7 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
722 * Firmware buffer is full. 725 * Firmware buffer is full.
723 * Queue back last skb, and stop aggregating. 726 * Queue back last skb, and stop aggregating.
724 */ 727 */
725 wl1271_skb_queue_head(wl, wlvif, skb); 728 wl1271_skb_queue_head(wl, wlvif, skb, hlid);
726 /* No work left, avoid scheduling redundant tx work */ 729 /* No work left, avoid scheduling redundant tx work */
727 set_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags); 730 set_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags);
728 goto out_ack; 731 goto out_ack;
@@ -732,7 +735,7 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
732 * fw still expects dummy packet, 735 * fw still expects dummy packet,
733 * so re-enqueue it 736 * so re-enqueue it
734 */ 737 */
735 wl1271_skb_queue_head(wl, wlvif, skb); 738 wl1271_skb_queue_head(wl, wlvif, skb, hlid);
736 else 739 else
737 ieee80211_free_txskb(wl->hw, skb); 740 ieee80211_free_txskb(wl->hw, skb);
738 goto out_ack; 741 goto out_ack;
diff --git a/drivers/net/wireless/ti/wlcore/tx.h b/drivers/net/wireless/ti/wlcore/tx.h
index 1e939b016155..349520d8b724 100644
--- a/drivers/net/wireless/ti/wlcore/tx.h
+++ b/drivers/net/wireless/ti/wlcore/tx.h
@@ -243,10 +243,8 @@ u8 wlcore_rate_to_idx(struct wl1271 *wl, u8 rate, enum ieee80211_band band);
243u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set, 243u32 wl1271_tx_enabled_rates_get(struct wl1271 *wl, u32 rate_set,
244 enum ieee80211_band rate_band); 244 enum ieee80211_band rate_band);
245u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set); 245u32 wl1271_tx_min_rate_get(struct wl1271 *wl, u32 rate_set);
246u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
247 struct sk_buff *skb);
248u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif, 246u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
249 struct sk_buff *skb); 247 struct sk_buff *skb, struct ieee80211_sta *sta);
250void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid); 248void wl1271_tx_reset_link_queues(struct wl1271 *wl, u8 hlid);
251void wl1271_handle_tx_low_watermark(struct wl1271 *wl); 249void wl1271_handle_tx_low_watermark(struct wl1271 *wl);
252bool wl12xx_is_dummy_packet(struct wl1271 *wl, struct sk_buff *skb); 250bool wl12xx_is_dummy_packet(struct wl1271 *wl, struct sk_buff *skb);
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index c9e2660e1263..459880104758 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -937,7 +937,9 @@ static int fill_ctrlset(struct zd_mac *mac,
937 * control block of the skbuff will be initialized. If necessary the incoming 937 * control block of the skbuff will be initialized. If necessary the incoming
938 * mac80211 queues will be stopped. 938 * mac80211 queues will be stopped.
939 */ 939 */
940static void zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 940static void zd_op_tx(struct ieee80211_hw *hw,
941 struct ieee80211_tx_control *control,
942 struct sk_buff *skb)
941{ 943{
942 struct zd_mac *mac = zd_hw_mac(hw); 944 struct zd_mac *mac = zd_hw_mac(hw);
943 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 945 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -1176,7 +1178,7 @@ static void zd_beacon_done(struct zd_mac *mac)
1176 skb = ieee80211_get_buffered_bc(mac->hw, mac->vif); 1178 skb = ieee80211_get_buffered_bc(mac->hw, mac->vif);
1177 if (!skb) 1179 if (!skb)
1178 break; 1180 break;
1179 zd_op_tx(mac->hw, skb); 1181 zd_op_tx(mac->hw, NULL, skb);
1180 } 1182 }
1181 1183
1182 /* 1184 /*