aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-02-24 08:42:06 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-25 15:32:34 -0500
commit7bb4568372856688bc070917265bce0b88bb7d4d (patch)
treee3ca3e7d233944bbc271c650c8b037c3a6652d98
parent43f12d47f0580e04e26c14c03cb19cea9687854e (diff)
mac80211: make tx() operation return void
The return value of the tx operation is commonly misused by drivers, leading to errors. All drivers will drop frames if they fail to TX the frame, and they must also properly manage the queues (if they didn't, mac80211 would already warn). Removing the ability for drivers to return a BUSY value also allows significant cleanups of the TX TX handling code in mac80211. Note that this also fixes a bug in ath9k_htc, the old "return -1" there was wrong. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Tested-by: Sedat Dilek <sedat.dilek@googlemail.com> [ath5k] Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> [rt2x00] Acked-by: Larry Finger <Larry.Finger@lwfinger.net> [b43, rtl8187, rtlwifi] Acked-by: Luciano Coelho <coelho@ti.com> [wl12xx] Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/adm8211.c4
-rw-r--r--drivers/net/wireless/at76c50x-usb.c7
-rw-r--r--drivers/net/wireless/ath/ar9170/ar9170.h2
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c5
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h4
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c5
-rw-r--r--drivers/net/wireless/ath/ath5k/mac80211-ops.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_main.c7
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c6
-rw-r--r--drivers/net/wireless/ath/carl9170/carl9170.h2
-rw-r--r--drivers/net/wireless/ath/carl9170/tx.c5
-rw-r--r--drivers/net/wireless/b43/main.c6
-rw-r--r--drivers/net/wireless/b43legacy/main.c5
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c3
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h2
-rw-r--r--drivers/net/wireless/libertas_tf/main.c3
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c5
-rw-r--r--drivers/net/wireless/mwl8k.c15
-rw-r--r--drivers/net/wireless/p54/lmac.h2
-rw-r--r--drivers/net/wireless/p54/main.c2
-rw-r--r--drivers/net/wireless/p54/txrx.c11
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00mac.c5
-rw-r--r--drivers/net/wireless/rtl818x/rtl8180/dev.c8
-rw-r--r--drivers/net/wireless/rtl818x/rtl8187/dev.c6
-rw-r--r--drivers/net/wireless/rtlwifi/core.c5
-rw-r--r--drivers/net/wireless/wl1251/main.c4
-rw-r--r--drivers/net/wireless/wl12xx/main.c4
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c5
-rw-r--r--drivers/staging/brcm80211/sys/wl_mac80211.c28
-rw-r--r--drivers/staging/winbond/wbusb.c7
-rw-r--r--include/net/mac80211.h2
-rw-r--r--net/mac80211/driver-ops.h4
-rw-r--r--net/mac80211/tx.c164
37 files changed, 122 insertions, 237 deletions
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index f9aa1bc0a947..afe2cbc6cb24 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1658,7 +1658,7 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
1658} 1658}
1659 1659
1660/* Put adm8211_tx_hdr on skb and transmit */ 1660/* Put adm8211_tx_hdr on skb and transmit */
1661static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 1661static void adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
1662{ 1662{
1663 struct adm8211_tx_hdr *txhdr; 1663 struct adm8211_tx_hdr *txhdr;
1664 size_t payload_len, hdrlen; 1664 size_t payload_len, hdrlen;
@@ -1707,8 +1707,6 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
1707 txhdr->retry_limit = info->control.rates[0].count; 1707 txhdr->retry_limit = info->control.rates[0].count;
1708 1708
1709 adm8211_tx_raw(dev, skb, plcp_signal, hdrlen); 1709 adm8211_tx_raw(dev, skb, plcp_signal, hdrlen);
1710
1711 return NETDEV_TX_OK;
1712} 1710}
1713 1711
1714static int adm8211_alloc_rings(struct ieee80211_hw *dev) 1712static int adm8211_alloc_rings(struct ieee80211_hw *dev)
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 1476314afa8a..10b4393d7fe0 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1728,7 +1728,7 @@ static void at76_mac80211_tx_callback(struct urb *urb)
1728 ieee80211_wake_queues(priv->hw); 1728 ieee80211_wake_queues(priv->hw);
1729} 1729}
1730 1730
1731static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1731static void at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1732{ 1732{
1733 struct at76_priv *priv = hw->priv; 1733 struct at76_priv *priv = hw->priv;
1734 struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer; 1734 struct at76_tx_buffer *tx_buffer = priv->bulk_out_buffer;
@@ -1741,7 +1741,8 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1741 if (priv->tx_urb->status == -EINPROGRESS) { 1741 if (priv->tx_urb->status == -EINPROGRESS) {
1742 wiphy_err(priv->hw->wiphy, 1742 wiphy_err(priv->hw->wiphy,
1743 "%s called while tx urb is pending\n", __func__); 1743 "%s called while tx urb is pending\n", __func__);
1744 return NETDEV_TX_BUSY; 1744 dev_kfree_skb_any(skb);
1745 return;
1745 } 1746 }
1746 1747
1747 /* The following code lines are important when the device is going to 1748 /* The following code lines are important when the device is going to
@@ -1795,8 +1796,6 @@ static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1795 priv->tx_urb, 1796 priv->tx_urb,
1796 priv->tx_urb->hcpriv, priv->tx_urb->complete); 1797 priv->tx_urb->hcpriv, priv->tx_urb->complete);
1797 } 1798 }
1798
1799 return 0;
1800} 1799}
1801 1800
1802static int at76_mac80211_start(struct ieee80211_hw *hw) 1801static int at76_mac80211_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/ath/ar9170/ar9170.h b/drivers/net/wireless/ath/ar9170/ar9170.h
index 4f845f80c098..371e4ce49528 100644
--- a/drivers/net/wireless/ath/ar9170/ar9170.h
+++ b/drivers/net/wireless/ath/ar9170/ar9170.h
@@ -224,7 +224,7 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);
224int ar9170_nag_limiter(struct ar9170 *ar); 224int ar9170_nag_limiter(struct ar9170 *ar);
225 225
226/* MAC */ 226/* MAC */
227int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 227void ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
228int ar9170_init_mac(struct ar9170 *ar); 228int ar9170_init_mac(struct ar9170 *ar);
229int ar9170_set_qos(struct ar9170 *ar); 229int ar9170_set_qos(struct ar9170 *ar);
230int ar9170_update_multicast(struct ar9170 *ar, const u64 mc_hast); 230int ar9170_update_multicast(struct ar9170 *ar, const u64 mc_hast);
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index a9111e1161fd..b761fec0d721 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -1475,7 +1475,7 @@ static void ar9170_tx(struct ar9170 *ar)
1475 msecs_to_jiffies(AR9170_JANITOR_DELAY)); 1475 msecs_to_jiffies(AR9170_JANITOR_DELAY));
1476} 1476}
1477 1477
1478int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1478void ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1479{ 1479{
1480 struct ar9170 *ar = hw->priv; 1480 struct ar9170 *ar = hw->priv;
1481 struct ieee80211_tx_info *info; 1481 struct ieee80211_tx_info *info;
@@ -1493,11 +1493,10 @@ int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1493 skb_queue_tail(&ar->tx_pending[queue], skb); 1493 skb_queue_tail(&ar->tx_pending[queue], skb);
1494 1494
1495 ar9170_tx(ar); 1495 ar9170_tx(ar);
1496 return NETDEV_TX_OK; 1496 return;
1497 1497
1498err_free: 1498err_free:
1499 dev_kfree_skb_any(skb); 1499 dev_kfree_skb_any(skb);
1500 return NETDEV_TX_OK;
1501} 1500}
1502 1501
1503static int ar9170_op_add_interface(struct ieee80211_hw *hw, 1502static int ar9170_op_add_interface(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 70abb61e9eff..0ee54eb333de 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1164,8 +1164,8 @@ struct ath5k_txq;
1164 1164
1165void set_beacon_filter(struct ieee80211_hw *hw, bool enable); 1165void set_beacon_filter(struct ieee80211_hw *hw, bool enable);
1166bool ath_any_vif_assoc(struct ath5k_softc *sc); 1166bool ath_any_vif_assoc(struct ath5k_softc *sc);
1167int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, 1167void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
1168 struct ath5k_txq *txq); 1168 struct ath5k_txq *txq);
1169int ath5k_init_hw(struct ath5k_softc *sc); 1169int ath5k_init_hw(struct ath5k_softc *sc);
1170int ath5k_stop_hw(struct ath5k_softc *sc); 1170int ath5k_stop_hw(struct ath5k_softc *sc);
1171void ath5k_mode_setup(struct ath5k_softc *sc, struct ieee80211_vif *vif); 1171void ath5k_mode_setup(struct ath5k_softc *sc, struct ieee80211_vif *vif);
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 80d9cf0c4cd2..91411e9b4b68 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1518,7 +1518,7 @@ unlock:
1518* TX Handling * 1518* TX Handling *
1519\*************/ 1519\*************/
1520 1520
1521int 1521void
1522ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb, 1522ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
1523 struct ath5k_txq *txq) 1523 struct ath5k_txq *txq)
1524{ 1524{
@@ -1567,11 +1567,10 @@ ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
1567 spin_unlock_irqrestore(&sc->txbuflock, flags); 1567 spin_unlock_irqrestore(&sc->txbuflock, flags);
1568 goto drop_packet; 1568 goto drop_packet;
1569 } 1569 }
1570 return NETDEV_TX_OK; 1570 return;
1571 1571
1572drop_packet: 1572drop_packet:
1573 dev_kfree_skb_any(skb); 1573 dev_kfree_skb_any(skb);
1574 return NETDEV_TX_OK;
1575} 1574}
1576 1575
1577static void 1576static void
diff --git a/drivers/net/wireless/ath/ath5k/mac80211-ops.c b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
index a60a726a140c..1fbe3c0b9f08 100644
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
@@ -52,7 +52,7 @@ extern int ath5k_modparam_nohwcrypt;
52* Mac80211 functions * 52* Mac80211 functions *
53\********************/ 53\********************/
54 54
55static int 55static void
56ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 56ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
57{ 57{
58 struct ath5k_softc *sc = hw->priv; 58 struct ath5k_softc *sc = hw->priv;
@@ -60,10 +60,10 @@ ath5k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
60 60
61 if (WARN_ON(qnum >= sc->ah->ah_capabilities.cap_queues.q_tx_num)) { 61 if (WARN_ON(qnum >= sc->ah->ah_capabilities.cap_queues.q_tx_num)) {
62 dev_kfree_skb_any(skb); 62 dev_kfree_skb_any(skb);
63 return 0; 63 return;
64 } 64 }
65 65
66 return ath5k_tx_queue(hw, skb, &sc->txqs[qnum]); 66 ath5k_tx_queue(hw, skb, &sc->txqs[qnum]);
67} 67}
68 68
69 69
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index 7367d6c1c649..71adab34006c 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -1036,7 +1036,7 @@ set_timer:
1036/* mac80211 Callbacks */ 1036/* mac80211 Callbacks */
1037/**********************/ 1037/**********************/
1038 1038
1039static int ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1039static void ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1040{ 1040{
1041 struct ieee80211_hdr *hdr; 1041 struct ieee80211_hdr *hdr;
1042 struct ath9k_htc_priv *priv = hw->priv; 1042 struct ath9k_htc_priv *priv = hw->priv;
@@ -1049,7 +1049,7 @@ static int ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1049 padsize = padpos & 3; 1049 padsize = padpos & 3;
1050 if (padsize && skb->len > padpos) { 1050 if (padsize && skb->len > padpos) {
1051 if (skb_headroom(skb) < padsize) 1051 if (skb_headroom(skb) < padsize)
1052 return -1; 1052 goto fail_tx;
1053 skb_push(skb, padsize); 1053 skb_push(skb, padsize);
1054 memmove(skb->data, skb->data + padsize, padpos); 1054 memmove(skb->data, skb->data + padsize, padpos);
1055 } 1055 }
@@ -1070,11 +1070,10 @@ static int ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1070 goto fail_tx; 1070 goto fail_tx;
1071 } 1071 }
1072 1072
1073 return 0; 1073 return;
1074 1074
1075fail_tx: 1075fail_tx:
1076 dev_kfree_skb_any(skb); 1076 dev_kfree_skb_any(skb);
1077 return 0;
1078} 1077}
1079 1078
1080static int ath9k_htc_start(struct ieee80211_hw *hw) 1079static int ath9k_htc_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index a71550049d84..39a72ae80970 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1142,8 +1142,7 @@ mutex_unlock:
1142 return r; 1142 return r;
1143} 1143}
1144 1144
1145static int ath9k_tx(struct ieee80211_hw *hw, 1145static void ath9k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1146 struct sk_buff *skb)
1147{ 1146{
1148 struct ath_softc *sc = hw->priv; 1147 struct ath_softc *sc = hw->priv;
1149 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 1148 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -1200,10 +1199,9 @@ static int ath9k_tx(struct ieee80211_hw *hw,
1200 goto exit; 1199 goto exit;
1201 } 1200 }
1202 1201
1203 return 0; 1202 return;
1204exit: 1203exit:
1205 dev_kfree_skb_any(skb); 1204 dev_kfree_skb_any(skb);
1206 return 0;
1207} 1205}
1208 1206
1209static void ath9k_stop(struct ieee80211_hw *hw) 1207static void ath9k_stop(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h
index 420d437f9580..c6a5fae634a0 100644
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -534,7 +534,7 @@ void carl9170_rx(struct ar9170 *ar, void *buf, unsigned int len);
534void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len); 534void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);
535 535
536/* TX */ 536/* TX */
537int carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 537void carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
538void carl9170_tx_janitor(struct work_struct *work); 538void carl9170_tx_janitor(struct work_struct *work);
539void carl9170_tx_process_status(struct ar9170 *ar, 539void carl9170_tx_process_status(struct ar9170 *ar,
540 const struct carl9170_rsp *cmd); 540 const struct carl9170_rsp *cmd);
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index 6f41e21d3a1c..0ef70b6fc512 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -1339,7 +1339,7 @@ err_unlock_rcu:
1339 return false; 1339 return false;
1340} 1340}
1341 1341
1342int carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1342void carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1343{ 1343{
1344 struct ar9170 *ar = hw->priv; 1344 struct ar9170 *ar = hw->priv;
1345 struct ieee80211_tx_info *info; 1345 struct ieee80211_tx_info *info;
@@ -1373,12 +1373,11 @@ int carl9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1373 } 1373 }
1374 1374
1375 carl9170_tx(ar); 1375 carl9170_tx(ar);
1376 return NETDEV_TX_OK; 1376 return;
1377 1377
1378err_free: 1378err_free:
1379 ar->tx_dropped++; 1379 ar->tx_dropped++;
1380 dev_kfree_skb_any(skb); 1380 dev_kfree_skb_any(skb);
1381 return NETDEV_TX_OK;
1382} 1381}
1383 1382
1384void carl9170_tx_scheduler(struct ar9170 *ar) 1383void carl9170_tx_scheduler(struct ar9170 *ar)
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 22bc9f17f634..57eb5b649730 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3203,7 +3203,7 @@ static void b43_tx_work(struct work_struct *work)
3203 mutex_unlock(&wl->mutex); 3203 mutex_unlock(&wl->mutex);
3204} 3204}
3205 3205
3206static int b43_op_tx(struct ieee80211_hw *hw, 3206static void b43_op_tx(struct ieee80211_hw *hw,
3207 struct sk_buff *skb) 3207 struct sk_buff *skb)
3208{ 3208{
3209 struct b43_wl *wl = hw_to_b43_wl(hw); 3209 struct b43_wl *wl = hw_to_b43_wl(hw);
@@ -3211,14 +3211,12 @@ static int b43_op_tx(struct ieee80211_hw *hw,
3211 if (unlikely(skb->len < 2 + 2 + 6)) { 3211 if (unlikely(skb->len < 2 + 2 + 6)) {
3212 /* Too short, this can't be a valid frame. */ 3212 /* Too short, this can't be a valid frame. */
3213 dev_kfree_skb_any(skb); 3213 dev_kfree_skb_any(skb);
3214 return NETDEV_TX_OK; 3214 return;
3215 } 3215 }
3216 B43_WARN_ON(skb_shinfo(skb)->nr_frags); 3216 B43_WARN_ON(skb_shinfo(skb)->nr_frags);
3217 3217
3218 skb_queue_tail(&wl->tx_queue, skb); 3218 skb_queue_tail(&wl->tx_queue, skb);
3219 ieee80211_queue_work(wl->hw, &wl->tx_work); 3219 ieee80211_queue_work(wl->hw, &wl->tx_work);
3220
3221 return NETDEV_TX_OK;
3222} 3220}
3223 3221
3224static void b43_qos_params_upload(struct b43_wldev *dev, 3222static void b43_qos_params_upload(struct b43_wldev *dev,
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 1f11e1670bf0..c7fd73e3ad76 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -2442,8 +2442,8 @@ static int b43legacy_rng_init(struct b43legacy_wl *wl)
2442 return err; 2442 return err;
2443} 2443}
2444 2444
2445static int b43legacy_op_tx(struct ieee80211_hw *hw, 2445static void b43legacy_op_tx(struct ieee80211_hw *hw,
2446 struct sk_buff *skb) 2446 struct sk_buff *skb)
2447{ 2447{
2448 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw); 2448 struct b43legacy_wl *wl = hw_to_b43legacy_wl(hw);
2449 struct b43legacy_wldev *dev = wl->current_dev; 2449 struct b43legacy_wldev *dev = wl->current_dev;
@@ -2466,7 +2466,6 @@ out:
2466 /* Drop the packet. */ 2466 /* Drop the packet. */
2467 dev_kfree_skb_any(skb); 2467 dev_kfree_skb_any(skb);
2468 } 2468 }
2469 return NETDEV_TX_OK;
2470} 2469}
2471 2470
2472static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue, 2471static int b43legacy_op_conf_tx(struct ieee80211_hw *hw, u16 queue,
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965.h b/drivers/net/wireless/iwlegacy/iwl-4965.h
index 79e206770f71..01f8163daf16 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965.h
+++ b/drivers/net/wireless/iwlegacy/iwl-4965.h
@@ -253,7 +253,7 @@ void iwl4965_eeprom_release_semaphore(struct iwl_priv *priv);
253int iwl4965_eeprom_check_version(struct iwl_priv *priv); 253int iwl4965_eeprom_check_version(struct iwl_priv *priv);
254 254
255/* mac80211 handlers (for 4965) */ 255/* mac80211 handlers (for 4965) */
256int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 256void iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
257int iwl4965_mac_start(struct ieee80211_hw *hw); 257int iwl4965_mac_start(struct ieee80211_hw *hw);
258void iwl4965_mac_stop(struct ieee80211_hw *hw); 258void iwl4965_mac_stop(struct ieee80211_hw *hw);
259void iwl4965_configure_filter(struct ieee80211_hw *hw, 259void iwl4965_configure_filter(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index ef94d161b783..a6af9817efce 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -3170,7 +3170,7 @@ static void iwl3945_mac_stop(struct ieee80211_hw *hw)
3170 IWL_DEBUG_MAC80211(priv, "leave\n"); 3170 IWL_DEBUG_MAC80211(priv, "leave\n");
3171} 3171}
3172 3172
3173static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 3173static void iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3174{ 3174{
3175 struct iwl_priv *priv = hw->priv; 3175 struct iwl_priv *priv = hw->priv;
3176 3176
@@ -3183,7 +3183,6 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3183 dev_kfree_skb_any(skb); 3183 dev_kfree_skb_any(skb);
3184 3184
3185 IWL_DEBUG_MAC80211(priv, "leave\n"); 3185 IWL_DEBUG_MAC80211(priv, "leave\n");
3186 return NETDEV_TX_OK;
3187} 3186}
3188 3187
3189void iwl3945_config_ap(struct iwl_priv *priv) 3188void iwl3945_config_ap(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index c0e07685059a..4d53d0ff5fc7 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -2631,7 +2631,7 @@ void iwl4965_mac_stop(struct ieee80211_hw *hw)
2631 IWL_DEBUG_MAC80211(priv, "leave\n"); 2631 IWL_DEBUG_MAC80211(priv, "leave\n");
2632} 2632}
2633 2633
2634int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 2634void iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2635{ 2635{
2636 struct iwl_priv *priv = hw->priv; 2636 struct iwl_priv *priv = hw->priv;
2637 2637
@@ -2644,7 +2644,6 @@ int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
2644 dev_kfree_skb_any(skb); 2644 dev_kfree_skb_any(skb);
2645 2645
2646 IWL_DEBUG_MACDUMP(priv, "leave\n"); 2646 IWL_DEBUG_MACDUMP(priv, "leave\n");
2647 return NETDEV_TX_OK;
2648} 2647}
2649 2648
2650void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw, 2649void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index d08fa938501a..8cdbd8c4027f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3330,7 +3330,7 @@ void iwlagn_mac_stop(struct ieee80211_hw *hw)
3330 IWL_DEBUG_MAC80211(priv, "leave\n"); 3330 IWL_DEBUG_MAC80211(priv, "leave\n");
3331} 3331}
3332 3332
3333int iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 3333void iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3334{ 3334{
3335 struct iwl_priv *priv = hw->priv; 3335 struct iwl_priv *priv = hw->priv;
3336 3336
@@ -3343,7 +3343,6 @@ int iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3343 dev_kfree_skb_any(skb); 3343 dev_kfree_skb_any(skb);
3344 3344
3345 IWL_DEBUG_MACDUMP(priv, "leave\n"); 3345 IWL_DEBUG_MACDUMP(priv, "leave\n");
3346 return NETDEV_TX_OK;
3347} 3346}
3348 3347
3349void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw, 3348void iwlagn_mac_update_tkip_key(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index d00e1ea50a8d..88c7210dfb91 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -356,7 +356,7 @@ iwlagn_remove_notification(struct iwl_priv *priv,
356 struct iwl_notification_wait *wait_entry); 356 struct iwl_notification_wait *wait_entry);
357 357
358/* mac80211 handlers (for 4965) */ 358/* mac80211 handlers (for 4965) */
359int iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 359void iwlagn_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
360int iwlagn_mac_start(struct ieee80211_hw *hw); 360int iwlagn_mac_start(struct ieee80211_hw *hw);
361void iwlagn_mac_stop(struct ieee80211_hw *hw); 361void iwlagn_mac_stop(struct ieee80211_hw *hw);
362void iwlagn_configure_filter(struct ieee80211_hw *hw, 362void iwlagn_configure_filter(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index 9278b3c8ee30..d4005081f1df 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -225,7 +225,7 @@ static void lbtf_free_adapter(struct lbtf_private *priv)
225 lbtf_deb_leave(LBTF_DEB_MAIN); 225 lbtf_deb_leave(LBTF_DEB_MAIN);
226} 226}
227 227
228static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 228static void lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
229{ 229{
230 struct lbtf_private *priv = hw->priv; 230 struct lbtf_private *priv = hw->priv;
231 231
@@ -236,7 +236,6 @@ static int lbtf_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
236 * there are no buffered multicast frames to send 236 * there are no buffered multicast frames to send
237 */ 237 */
238 ieee80211_stop_queues(priv->hw); 238 ieee80211_stop_queues(priv->hw);
239 return NETDEV_TX_OK;
240} 239}
241 240
242static void lbtf_tx_work(struct work_struct *work) 241static void lbtf_tx_work(struct work_struct *work)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 5d39b2840584..56f439d58013 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -541,7 +541,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
541} 541}
542 542
543 543
544static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 544static void mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
545{ 545{
546 bool ack; 546 bool ack;
547 struct ieee80211_tx_info *txi; 547 struct ieee80211_tx_info *txi;
@@ -551,7 +551,7 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
551 if (skb->len < 10) { 551 if (skb->len < 10) {
552 /* Should not happen; just a sanity check for addr1 use */ 552 /* Should not happen; just a sanity check for addr1 use */
553 dev_kfree_skb(skb); 553 dev_kfree_skb(skb);
554 return NETDEV_TX_OK; 554 return;
555 } 555 }
556 556
557 ack = mac80211_hwsim_tx_frame(hw, skb); 557 ack = mac80211_hwsim_tx_frame(hw, skb);
@@ -571,7 +571,6 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
571 if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK) && ack) 571 if (!(txi->flags & IEEE80211_TX_CTL_NO_ACK) && ack)
572 txi->flags |= IEEE80211_TX_STAT_ACK; 572 txi->flags |= IEEE80211_TX_STAT_ACK;
573 ieee80211_tx_status_irqsafe(hw, skb); 573 ieee80211_tx_status_irqsafe(hw, skb);
574 return NETDEV_TX_OK;
575} 574}
576 575
577 576
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 03f2584aed12..df5959f36d0b 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1573,7 +1573,7 @@ static void mwl8k_txq_deinit(struct ieee80211_hw *hw, int index)
1573 txq->txd = NULL; 1573 txq->txd = NULL;
1574} 1574}
1575 1575
1576static int 1576static void
1577mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb) 1577mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
1578{ 1578{
1579 struct mwl8k_priv *priv = hw->priv; 1579 struct mwl8k_priv *priv = hw->priv;
@@ -1635,7 +1635,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
1635 wiphy_debug(hw->wiphy, 1635 wiphy_debug(hw->wiphy,
1636 "failed to dma map skb, dropping TX frame.\n"); 1636 "failed to dma map skb, dropping TX frame.\n");
1637 dev_kfree_skb(skb); 1637 dev_kfree_skb(skb);
1638 return NETDEV_TX_OK; 1638 return;
1639 } 1639 }
1640 1640
1641 spin_lock_bh(&priv->tx_lock); 1641 spin_lock_bh(&priv->tx_lock);
@@ -1672,8 +1672,6 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
1672 mwl8k_tx_start(priv); 1672 mwl8k_tx_start(priv);
1673 1673
1674 spin_unlock_bh(&priv->tx_lock); 1674 spin_unlock_bh(&priv->tx_lock);
1675
1676 return NETDEV_TX_OK;
1677} 1675}
1678 1676
1679 1677
@@ -3742,22 +3740,19 @@ static void mwl8k_rx_poll(unsigned long data)
3742/* 3740/*
3743 * Core driver operations. 3741 * Core driver operations.
3744 */ 3742 */
3745static int mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 3743static void mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3746{ 3744{
3747 struct mwl8k_priv *priv = hw->priv; 3745 struct mwl8k_priv *priv = hw->priv;
3748 int index = skb_get_queue_mapping(skb); 3746 int index = skb_get_queue_mapping(skb);
3749 int rc;
3750 3747
3751 if (!priv->radio_on) { 3748 if (!priv->radio_on) {
3752 wiphy_debug(hw->wiphy, 3749 wiphy_debug(hw->wiphy,
3753 "dropped TX frame since radio disabled\n"); 3750 "dropped TX frame since radio disabled\n");
3754 dev_kfree_skb(skb); 3751 dev_kfree_skb(skb);
3755 return NETDEV_TX_OK; 3752 return;
3756 } 3753 }
3757 3754
3758 rc = mwl8k_txq_xmit(hw, index, skb); 3755 mwl8k_txq_xmit(hw, index, skb);
3759
3760 return rc;
3761} 3756}
3762 3757
3763static int mwl8k_start(struct ieee80211_hw *hw) 3758static int mwl8k_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/p54/lmac.h b/drivers/net/wireless/p54/lmac.h
index 5ca117e6f95b..eb581abc1079 100644
--- a/drivers/net/wireless/p54/lmac.h
+++ b/drivers/net/wireless/p54/lmac.h
@@ -526,7 +526,7 @@ 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 */
529int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb); 529void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb);
530int p54_tx_cancel(struct p54_common *priv, __le32 req_id); 530int p54_tx_cancel(struct p54_common *priv, __le32 req_id);
531void p54_tx(struct p54_common *priv, struct sk_buff *skb); 531void p54_tx(struct p54_common *priv, struct sk_buff *skb);
532 532
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index d7a92af24dd5..356e6bb443a6 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -157,7 +157,7 @@ static int p54_beacon_update(struct p54_common *priv,
157 * to cancel the old beacon template by hand, instead the firmware 157 * to cancel the old beacon template by hand, instead the firmware
158 * will release the previous one through the feedback mechanism. 158 * will release the previous one through the feedback mechanism.
159 */ 159 */
160 WARN_ON(p54_tx_80211(priv->hw, beacon)); 160 p54_tx_80211(priv->hw, beacon);
161 priv->tsf_high32 = 0; 161 priv->tsf_high32 = 0;
162 priv->tsf_low32 = 0; 162 priv->tsf_low32 = 0;
163 163
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index a408ff333920..7834c26c2954 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -696,7 +696,7 @@ static u8 p54_convert_algo(u32 cipher)
696 } 696 }
697} 697}
698 698
699int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb) 699void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
700{ 700{
701 struct p54_common *priv = dev->priv; 701 struct p54_common *priv = dev->priv;
702 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 702 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -717,12 +717,8 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
717 &hdr_flags, &aid, &burst_allowed); 717 &hdr_flags, &aid, &burst_allowed);
718 718
719 if (p54_tx_qos_accounting_alloc(priv, skb, queue)) { 719 if (p54_tx_qos_accounting_alloc(priv, skb, queue)) {
720 if (!IS_QOS_QUEUE(queue)) { 720 dev_kfree_skb_any(skb);
721 dev_kfree_skb_any(skb); 721 return;
722 return NETDEV_TX_OK;
723 } else {
724 return NETDEV_TX_BUSY;
725 }
726 } 722 }
727 723
728 padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3; 724 padding = (unsigned long)(skb->data - (sizeof(*hdr) + sizeof(*txhdr))) & 3;
@@ -865,5 +861,4 @@ int p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
865 p54info->extra_len = extra_len; 861 p54info->extra_len = extra_len;
866 862
867 p54_tx(priv, skb); 863 p54_tx(priv, skb);
868 return NETDEV_TX_OK;
869} 864}
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 1df432c1f2c7..19453d23e90d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -1185,7 +1185,7 @@ void rt2x00lib_rxdone(struct queue_entry *entry);
1185/* 1185/*
1186 * mac80211 handlers. 1186 * mac80211 handlers.
1187 */ 1187 */
1188int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 1188void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
1189int rt2x00mac_start(struct ieee80211_hw *hw); 1189int rt2x00mac_start(struct ieee80211_hw *hw);
1190void rt2x00mac_stop(struct ieee80211_hw *hw); 1190void rt2x00mac_stop(struct ieee80211_hw *hw);
1191int rt2x00mac_add_interface(struct ieee80211_hw *hw, 1191int rt2x00mac_add_interface(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 1b3edef9e3d2..c2c35838c2f3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -99,7 +99,7 @@ static int rt2x00mac_tx_rts_cts(struct rt2x00_dev *rt2x00dev,
99 return retval; 99 return retval;
100} 100}
101 101
102int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 102void rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
103{ 103{
104 struct rt2x00_dev *rt2x00dev = hw->priv; 104 struct rt2x00_dev *rt2x00dev = hw->priv;
105 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 105 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
@@ -155,12 +155,11 @@ int rt2x00mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
155 if (rt2x00queue_threshold(queue)) 155 if (rt2x00queue_threshold(queue))
156 rt2x00queue_pause_queue(queue); 156 rt2x00queue_pause_queue(queue);
157 157
158 return NETDEV_TX_OK; 158 return;
159 159
160 exit_fail: 160 exit_fail:
161 ieee80211_stop_queue(rt2x00dev->hw, qid); 161 ieee80211_stop_queue(rt2x00dev->hw, qid);
162 dev_kfree_skb_any(skb); 162 dev_kfree_skb_any(skb);
163 return NETDEV_TX_OK;
164} 163}
165EXPORT_SYMBOL_GPL(rt2x00mac_tx); 164EXPORT_SYMBOL_GPL(rt2x00mac_tx);
166 165
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index b85debb4f7b1..80db5cabc9b9 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -240,7 +240,7 @@ static irqreturn_t rtl8180_interrupt(int irq, void *dev_id)
240 return IRQ_HANDLED; 240 return IRQ_HANDLED;
241} 241}
242 242
243static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 243static void rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
244{ 244{
245 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 245 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
246 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 246 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
@@ -321,8 +321,6 @@ static int rtl8180_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
321 spin_unlock_irqrestore(&priv->lock, flags); 321 spin_unlock_irqrestore(&priv->lock, flags);
322 322
323 rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4))); 323 rtl818x_iowrite8(priv, &priv->map->TX_DMA_POLLING, (1 << (prio + 4)));
324
325 return 0;
326} 324}
327 325
328void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam) 326void rtl8180_set_anaparam(struct rtl8180_priv *priv, u32 anaparam)
@@ -687,7 +685,6 @@ static void rtl8180_beacon_work(struct work_struct *work)
687 struct ieee80211_hw *dev = vif_priv->dev; 685 struct ieee80211_hw *dev = vif_priv->dev;
688 struct ieee80211_mgmt *mgmt; 686 struct ieee80211_mgmt *mgmt;
689 struct sk_buff *skb; 687 struct sk_buff *skb;
690 int err = 0;
691 688
692 /* don't overflow the tx ring */ 689 /* don't overflow the tx ring */
693 if (ieee80211_queue_stopped(dev, 0)) 690 if (ieee80211_queue_stopped(dev, 0))
@@ -708,8 +705,7 @@ static void rtl8180_beacon_work(struct work_struct *work)
708 /* TODO: use actual beacon queue */ 705 /* TODO: use actual beacon queue */
709 skb_set_queue_mapping(skb, 0); 706 skb_set_queue_mapping(skb, 0);
710 707
711 err = rtl8180_tx(dev, skb); 708 rtl8180_tx(dev, skb);
712 WARN_ON(err);
713 709
714resched: 710resched:
715 /* 711 /*
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 1f5df12cb156..c5a5e788f25f 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -227,7 +227,7 @@ static void rtl8187_tx_cb(struct urb *urb)
227 } 227 }
228} 228}
229 229
230static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 230static void rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
231{ 231{
232 struct rtl8187_priv *priv = dev->priv; 232 struct rtl8187_priv *priv = dev->priv;
233 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 233 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -241,7 +241,7 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
241 urb = usb_alloc_urb(0, GFP_ATOMIC); 241 urb = usb_alloc_urb(0, GFP_ATOMIC);
242 if (!urb) { 242 if (!urb) {
243 kfree_skb(skb); 243 kfree_skb(skb);
244 return NETDEV_TX_OK; 244 return;
245 } 245 }
246 246
247 flags = skb->len; 247 flags = skb->len;
@@ -309,8 +309,6 @@ static int rtl8187_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
309 kfree_skb(skb); 309 kfree_skb(skb);
310 } 310 }
311 usb_free_urb(urb); 311 usb_free_urb(urb);
312
313 return NETDEV_TX_OK;
314} 312}
315 313
316static void rtl8187_rx_cb(struct urb *urb) 314static void rtl8187_rx_cb(struct urb *urb)
diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index b0996bf8a214..059ab036b01d 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -82,7 +82,7 @@ static void rtl_op_stop(struct ieee80211_hw *hw)
82 mutex_unlock(&rtlpriv->locks.conf_mutex); 82 mutex_unlock(&rtlpriv->locks.conf_mutex);
83} 83}
84 84
85static int rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 85static void rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
86{ 86{
87 struct rtl_priv *rtlpriv = rtl_priv(hw); 87 struct rtl_priv *rtlpriv = rtl_priv(hw);
88 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); 88 struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
@@ -97,11 +97,10 @@ static int rtl_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
97 97
98 rtlpriv->intf_ops->adapter_tx(hw, skb); 98 rtlpriv->intf_ops->adapter_tx(hw, skb);
99 99
100 return NETDEV_TX_OK; 100 return;
101 101
102err_free: 102err_free:
103 dev_kfree_skb_any(skb); 103 dev_kfree_skb_any(skb);
104 return NETDEV_TX_OK;
105} 104}
106 105
107static int rtl_op_add_interface(struct ieee80211_hw *hw, 106static int rtl_op_add_interface(struct ieee80211_hw *hw,
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 5a1c13878eaf..12c9e635a6d6 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -375,7 +375,7 @@ out:
375 mutex_unlock(&wl->mutex); 375 mutex_unlock(&wl->mutex);
376} 376}
377 377
378static int wl1251_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 378static void wl1251_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
379{ 379{
380 struct wl1251 *wl = hw->priv; 380 struct wl1251 *wl = hw->priv;
381 unsigned long flags; 381 unsigned long flags;
@@ -401,8 +401,6 @@ static int wl1251_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
401 wl->tx_queue_stopped = true; 401 wl->tx_queue_stopped = true;
402 spin_unlock_irqrestore(&wl->wl_lock, flags); 402 spin_unlock_irqrestore(&wl->wl_lock, flags);
403 } 403 }
404
405 return NETDEV_TX_OK;
406} 404}
407 405
408static int wl1251_op_start(struct ieee80211_hw *hw) 406static int wl1251_op_start(struct ieee80211_hw *hw)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 95aa19ae84e5..947491a1d9cc 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1034,7 +1034,7 @@ int wl1271_plt_stop(struct wl1271 *wl)
1034 return ret; 1034 return ret;
1035} 1035}
1036 1036
1037static int wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 1037static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1038{ 1038{
1039 struct wl1271 *wl = hw->priv; 1039 struct wl1271 *wl = hw->priv;
1040 unsigned long flags; 1040 unsigned long flags;
@@ -1073,8 +1073,6 @@ static int wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
1073 1073
1074 if (!test_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags)) 1074 if (!test_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags))
1075 ieee80211_queue_work(wl->hw, &wl->tx_work); 1075 ieee80211_queue_work(wl->hw, &wl->tx_work);
1076
1077 return NETDEV_TX_OK;
1078} 1076}
1079 1077
1080static struct notifier_block wl1271_dev_notifier = { 1078static struct notifier_block wl1271_dev_notifier = {
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 74a269ebbeb9..5037c8b2b415 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -850,7 +850,7 @@ static int fill_ctrlset(struct zd_mac *mac,
850 * control block of the skbuff will be initialized. If necessary the incoming 850 * control block of the skbuff will be initialized. If necessary the incoming
851 * mac80211 queues will be stopped. 851 * mac80211 queues will be stopped.
852 */ 852 */
853static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 853static void zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
854{ 854{
855 struct zd_mac *mac = zd_hw_mac(hw); 855 struct zd_mac *mac = zd_hw_mac(hw);
856 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 856 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -865,11 +865,10 @@ static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
865 r = zd_usb_tx(&mac->chip.usb, skb); 865 r = zd_usb_tx(&mac->chip.usb, skb);
866 if (r) 866 if (r)
867 goto fail; 867 goto fail;
868 return 0; 868 return;
869 869
870fail: 870fail:
871 dev_kfree_skb(skb); 871 dev_kfree_skb(skb);
872 return 0;
873} 872}
874 873
875/** 874/**
diff --git a/drivers/staging/brcm80211/sys/wl_mac80211.c b/drivers/staging/brcm80211/sys/wl_mac80211.c
index bdd629d72a75..c83bdcc640a5 100644
--- a/drivers/staging/brcm80211/sys/wl_mac80211.c
+++ b/drivers/staging/brcm80211/sys/wl_mac80211.c
@@ -104,9 +104,6 @@ static int wl_request_fw(struct wl_info *wl, struct pci_dev *pdev);
104static void wl_release_fw(struct wl_info *wl); 104static void wl_release_fw(struct wl_info *wl);
105 105
106/* local prototypes */ 106/* local prototypes */
107static int wl_start(struct sk_buff *skb, struct wl_info *wl);
108static int wl_start_int(struct wl_info *wl, struct ieee80211_hw *hw,
109 struct sk_buff *skb);
110static void wl_dpc(unsigned long data); 107static void wl_dpc(unsigned long data);
111 108
112MODULE_AUTHOR("Broadcom Corporation"); 109MODULE_AUTHOR("Broadcom Corporation");
@@ -135,7 +132,6 @@ module_param(phymsglevel, int, 0);
135 132
136#define HW_TO_WL(hw) (hw->priv) 133#define HW_TO_WL(hw) (hw->priv)
137#define WL_TO_HW(wl) (wl->pub->ieee_hw) 134#define WL_TO_HW(wl) (wl->pub->ieee_hw)
138static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
139static int wl_ops_start(struct ieee80211_hw *hw); 135static int wl_ops_start(struct ieee80211_hw *hw);
140static void wl_ops_stop(struct ieee80211_hw *hw); 136static void wl_ops_stop(struct ieee80211_hw *hw);
141static int wl_ops_add_interface(struct ieee80211_hw *hw, 137static int wl_ops_add_interface(struct ieee80211_hw *hw,
@@ -173,20 +169,18 @@ static int wl_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
173 enum ieee80211_ampdu_mlme_action action, 169 enum ieee80211_ampdu_mlme_action action,
174 struct ieee80211_sta *sta, u16 tid, u16 *ssn); 170 struct ieee80211_sta *sta, u16 tid, u16 *ssn);
175 171
176static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 172static void wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
177{ 173{
178 int status;
179 struct wl_info *wl = hw->priv; 174 struct wl_info *wl = hw->priv;
180 WL_LOCK(wl); 175 WL_LOCK(wl);
181 if (!wl->pub->up) { 176 if (!wl->pub->up) {
182 WL_ERROR("ops->tx called while down\n"); 177 WL_ERROR("ops->tx called while down\n");
183 status = -ENETDOWN; 178 kfree_skb(skb);
184 goto done; 179 goto done;
185 } 180 }
186 status = wl_start(skb, wl); 181 wlc_sendpkt_mac80211(wl->wlc, skb, hw);
187 done: 182 done:
188 WL_UNLOCK(wl); 183 WL_UNLOCK(wl);
189 return status;
190} 184}
191 185
192static int wl_ops_start(struct ieee80211_hw *hw) 186static int wl_ops_start(struct ieee80211_hw *hw)
@@ -1316,22 +1310,6 @@ void wl_free(struct wl_info *wl)
1316 osl_detach(osh); 1310 osl_detach(osh);
1317} 1311}
1318 1312
1319/* transmit a packet */
1320static int BCMFASTPATH wl_start(struct sk_buff *skb, struct wl_info *wl)
1321{
1322 if (!wl)
1323 return -ENETDOWN;
1324
1325 return wl_start_int(wl, WL_TO_HW(wl), skb);
1326}
1327
1328static int BCMFASTPATH
1329wl_start_int(struct wl_info *wl, struct ieee80211_hw *hw, struct sk_buff *skb)
1330{
1331 wlc_sendpkt_mac80211(wl->wlc, skb, hw);
1332 return NETDEV_TX_OK;
1333}
1334
1335void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state, 1313void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state,
1336 int prio) 1314 int prio)
1337{ 1315{
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c
index 2163d60c2eaf..3724e1e67ec2 100644
--- a/drivers/staging/winbond/wbusb.c
+++ b/drivers/staging/winbond/wbusb.c
@@ -118,13 +118,14 @@ static void wbsoft_configure_filter(struct ieee80211_hw *dev,
118 *total_flags = new_flags; 118 *total_flags = new_flags;
119} 119}
120 120
121static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 121static void wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
122{ 122{
123 struct wbsoft_priv *priv = dev->priv; 123 struct wbsoft_priv *priv = dev->priv;
124 124
125 if (priv->sMlmeFrame.IsInUsed != PACKET_FREE_TO_USE) { 125 if (priv->sMlmeFrame.IsInUsed != PACKET_FREE_TO_USE) {
126 priv->sMlmeFrame.wNumTxMMPDUDiscarded++; 126 priv->sMlmeFrame.wNumTxMMPDUDiscarded++;
127 return NETDEV_TX_BUSY; 127 kfree_skb(skb);
128 return;
128 } 129 }
129 130
130 priv->sMlmeFrame.IsInUsed = PACKET_COME_FROM_MLME; 131 priv->sMlmeFrame.IsInUsed = PACKET_COME_FROM_MLME;
@@ -140,8 +141,6 @@ static int wbsoft_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
140 */ 141 */
141 142
142 Mds_Tx(priv); 143 Mds_Tx(priv);
143
144 return NETDEV_TX_OK;
145} 144}
146 145
147static int wbsoft_start(struct ieee80211_hw *dev) 146static int wbsoft_start(struct ieee80211_hw *dev)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index a13c8d8fca5c..96cc7ed35169 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1801,7 +1801,7 @@ enum ieee80211_ampdu_mlme_action {
1801 * aborted before it expires. This callback may sleep. 1801 * aborted before it expires. This callback may sleep.
1802 */ 1802 */
1803struct ieee80211_ops { 1803struct ieee80211_ops {
1804 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1804 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
1805 int (*start)(struct ieee80211_hw *hw); 1805 int (*start)(struct ieee80211_hw *hw);
1806 void (*stop)(struct ieee80211_hw *hw); 1806 void (*stop)(struct ieee80211_hw *hw);
1807 int (*add_interface)(struct ieee80211_hw *hw, 1807 int (*add_interface)(struct ieee80211_hw *hw,
diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 78af32d4bc58..32f05c1abbaf 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -5,9 +5,9 @@
5#include "ieee80211_i.h" 5#include "ieee80211_i.h"
6#include "driver-trace.h" 6#include "driver-trace.h"
7 7
8static inline int drv_tx(struct ieee80211_local *local, struct sk_buff *skb) 8static inline void drv_tx(struct ieee80211_local *local, struct sk_buff *skb)
9{ 9{
10 return local->ops->tx(&local->hw, skb); 10 local->ops->tx(&local->hw, skb);
11} 11}
12 12
13static inline int drv_start(struct ieee80211_local *local) 13static inline int drv_start(struct ieee80211_local *local)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 34edf7f22b0e..081dcaf6577b 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -33,10 +33,6 @@
33#include "wme.h" 33#include "wme.h"
34#include "rate.h" 34#include "rate.h"
35 35
36#define IEEE80211_TX_OK 0
37#define IEEE80211_TX_AGAIN 1
38#define IEEE80211_TX_PENDING 2
39
40/* misc utils */ 36/* misc utils */
41 37
42static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, int group_addr, 38static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, int group_addr,
@@ -1285,16 +1281,17 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
1285 return TX_CONTINUE; 1281 return TX_CONTINUE;
1286} 1282}
1287 1283
1288static int __ieee80211_tx(struct ieee80211_local *local, 1284/*
1289 struct sk_buff **skbp, 1285 * Returns false if the frame couldn't be transmitted but was queued instead.
1290 struct sta_info *sta, 1286 */
1291 bool txpending) 1287static bool __ieee80211_tx(struct ieee80211_local *local, struct sk_buff **skbp,
1288 struct sta_info *sta, bool txpending)
1292{ 1289{
1293 struct sk_buff *skb = *skbp, *next; 1290 struct sk_buff *skb = *skbp, *next;
1294 struct ieee80211_tx_info *info; 1291 struct ieee80211_tx_info *info;
1295 struct ieee80211_sub_if_data *sdata; 1292 struct ieee80211_sub_if_data *sdata;
1296 unsigned long flags; 1293 unsigned long flags;
1297 int ret, len; 1294 int len;
1298 bool fragm = false; 1295 bool fragm = false;
1299 1296
1300 while (skb) { 1297 while (skb) {
@@ -1302,13 +1299,37 @@ static int __ieee80211_tx(struct ieee80211_local *local,
1302 __le16 fc; 1299 __le16 fc;
1303 1300
1304 spin_lock_irqsave(&local->queue_stop_reason_lock, flags); 1301 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
1305 ret = IEEE80211_TX_OK;
1306 if (local->queue_stop_reasons[q] || 1302 if (local->queue_stop_reasons[q] ||
1307 (!txpending && !skb_queue_empty(&local->pending[q]))) 1303 (!txpending && !skb_queue_empty(&local->pending[q]))) {
1308 ret = IEEE80211_TX_PENDING; 1304 /*
1305 * Since queue is stopped, queue up frames for later
1306 * transmission from the tx-pending tasklet when the
1307 * queue is woken again.
1308 */
1309
1310 do {
1311 next = skb->next;
1312 skb->next = NULL;
1313 /*
1314 * NB: If txpending is true, next must already
1315 * be NULL since we must've gone through this
1316 * loop before already; therefore we can just
1317 * queue the frame to the head without worrying
1318 * about reordering of fragments.
1319 */
1320 if (unlikely(txpending))
1321 __skb_queue_head(&local->pending[q],
1322 skb);
1323 else
1324 __skb_queue_tail(&local->pending[q],
1325 skb);
1326 } while ((skb = next));
1327
1328 spin_unlock_irqrestore(&local->queue_stop_reason_lock,
1329 flags);
1330 return false;
1331 }
1309 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); 1332 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags);
1310 if (ret != IEEE80211_TX_OK)
1311 return ret;
1312 1333
1313 info = IEEE80211_SKB_CB(skb); 1334 info = IEEE80211_SKB_CB(skb);
1314 1335
@@ -1343,15 +1364,7 @@ static int __ieee80211_tx(struct ieee80211_local *local,
1343 info->control.sta = NULL; 1364 info->control.sta = NULL;
1344 1365
1345 fc = ((struct ieee80211_hdr *)skb->data)->frame_control; 1366 fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
1346 ret = drv_tx(local, skb); 1367 drv_tx(local, skb);
1347 if (WARN_ON(ret != NETDEV_TX_OK && skb->len != len)) {
1348 dev_kfree_skb(skb);
1349 ret = NETDEV_TX_OK;
1350 }
1351 if (ret != NETDEV_TX_OK) {
1352 info->control.vif = &sdata->vif;
1353 return IEEE80211_TX_AGAIN;
1354 }
1355 1368
1356 ieee80211_tpt_led_trig_tx(local, fc, len); 1369 ieee80211_tpt_led_trig_tx(local, fc, len);
1357 *skbp = skb = next; 1370 *skbp = skb = next;
@@ -1359,7 +1372,7 @@ static int __ieee80211_tx(struct ieee80211_local *local,
1359 fragm = true; 1372 fragm = true;
1360 } 1373 }
1361 1374
1362 return IEEE80211_TX_OK; 1375 return true;
1363} 1376}
1364 1377
1365/* 1378/*
@@ -1419,23 +1432,24 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx)
1419 return 0; 1432 return 0;
1420} 1433}
1421 1434
1422static void ieee80211_tx(struct ieee80211_sub_if_data *sdata, 1435/*
1436 * Returns false if the frame couldn't be transmitted but was queued instead.
1437 */
1438static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
1423 struct sk_buff *skb, bool txpending) 1439 struct sk_buff *skb, bool txpending)
1424{ 1440{
1425 struct ieee80211_local *local = sdata->local; 1441 struct ieee80211_local *local = sdata->local;
1426 struct ieee80211_tx_data tx; 1442 struct ieee80211_tx_data tx;
1427 ieee80211_tx_result res_prepare; 1443 ieee80211_tx_result res_prepare;
1428 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1444 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1429 struct sk_buff *next;
1430 unsigned long flags;
1431 int ret, retries;
1432 u16 queue; 1445 u16 queue;
1446 bool result = true;
1433 1447
1434 queue = skb_get_queue_mapping(skb); 1448 queue = skb_get_queue_mapping(skb);
1435 1449
1436 if (unlikely(skb->len < 10)) { 1450 if (unlikely(skb->len < 10)) {
1437 dev_kfree_skb(skb); 1451 dev_kfree_skb(skb);
1438 return; 1452 return true;
1439 } 1453 }
1440 1454
1441 rcu_read_lock(); 1455 rcu_read_lock();
@@ -1445,85 +1459,19 @@ static void ieee80211_tx(struct ieee80211_sub_if_data *sdata,
1445 1459
1446 if (unlikely(res_prepare == TX_DROP)) { 1460 if (unlikely(res_prepare == TX_DROP)) {
1447 dev_kfree_skb(skb); 1461 dev_kfree_skb(skb);
1448 rcu_read_unlock(); 1462 goto out;
1449 return;
1450 } else if (unlikely(res_prepare == TX_QUEUED)) { 1463 } else if (unlikely(res_prepare == TX_QUEUED)) {
1451 rcu_read_unlock(); 1464 goto out;
1452 return;
1453 } 1465 }
1454 1466
1455 tx.channel = local->hw.conf.channel; 1467 tx.channel = local->hw.conf.channel;
1456 info->band = tx.channel->band; 1468 info->band = tx.channel->band;
1457 1469
1458 if (invoke_tx_handlers(&tx)) 1470 if (!invoke_tx_handlers(&tx))
1459 goto out; 1471 result = __ieee80211_tx(local, &tx.skb, tx.sta, txpending);
1460
1461 retries = 0;
1462 retry:
1463 ret = __ieee80211_tx(local, &tx.skb, tx.sta, txpending);
1464 switch (ret) {
1465 case IEEE80211_TX_OK:
1466 break;
1467 case IEEE80211_TX_AGAIN:
1468 /*
1469 * Since there are no fragmented frames on A-MPDU
1470 * queues, there's no reason for a driver to reject
1471 * a frame there, warn and drop it.
1472 */
1473 if (WARN_ON(info->flags & IEEE80211_TX_CTL_AMPDU))
1474 goto drop;
1475 /* fall through */
1476 case IEEE80211_TX_PENDING:
1477 skb = tx.skb;
1478
1479 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
1480
1481 if (local->queue_stop_reasons[queue] ||
1482 !skb_queue_empty(&local->pending[queue])) {
1483 /*
1484 * if queue is stopped, queue up frames for later
1485 * transmission from the tasklet
1486 */
1487 do {
1488 next = skb->next;
1489 skb->next = NULL;
1490 if (unlikely(txpending))
1491 __skb_queue_head(&local->pending[queue],
1492 skb);
1493 else
1494 __skb_queue_tail(&local->pending[queue],
1495 skb);
1496 } while ((skb = next));
1497
1498 spin_unlock_irqrestore(&local->queue_stop_reason_lock,
1499 flags);
1500 } else {
1501 /*
1502 * otherwise retry, but this is a race condition or
1503 * a driver bug (which we warn about if it persists)
1504 */
1505 spin_unlock_irqrestore(&local->queue_stop_reason_lock,
1506 flags);
1507
1508 retries++;
1509 if (WARN(retries > 10, "tx refused but queue active\n"))
1510 goto drop;
1511 goto retry;
1512 }
1513 }
1514 out: 1472 out:
1515 rcu_read_unlock(); 1473 rcu_read_unlock();
1516 return; 1474 return result;
1517
1518 drop:
1519 rcu_read_unlock();
1520
1521 skb = tx.skb;
1522 while (skb) {
1523 next = skb->next;
1524 dev_kfree_skb(skb);
1525 skb = next;
1526 }
1527} 1475}
1528 1476
1529/* device xmit handlers */ 1477/* device xmit handlers */
@@ -2070,6 +2018,11 @@ void ieee80211_clear_tx_pending(struct ieee80211_local *local)
2070 skb_queue_purge(&local->pending[i]); 2018 skb_queue_purge(&local->pending[i]);
2071} 2019}
2072 2020
2021/*
2022 * Returns false if the frame couldn't be transmitted but was queued instead,
2023 * which in this case means re-queued -- take as an indication to stop sending
2024 * more pending frames.
2025 */
2073static bool ieee80211_tx_pending_skb(struct ieee80211_local *local, 2026static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
2074 struct sk_buff *skb) 2027 struct sk_buff *skb)
2075{ 2028{
@@ -2077,20 +2030,17 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
2077 struct ieee80211_sub_if_data *sdata; 2030 struct ieee80211_sub_if_data *sdata;
2078 struct sta_info *sta; 2031 struct sta_info *sta;
2079 struct ieee80211_hdr *hdr; 2032 struct ieee80211_hdr *hdr;
2080 int ret; 2033 bool result;
2081 bool result = true;
2082 2034
2083 sdata = vif_to_sdata(info->control.vif); 2035 sdata = vif_to_sdata(info->control.vif);
2084 2036
2085 if (info->flags & IEEE80211_TX_INTFL_NEED_TXPROCESSING) { 2037 if (info->flags & IEEE80211_TX_INTFL_NEED_TXPROCESSING) {
2086 ieee80211_tx(sdata, skb, true); 2038 result = ieee80211_tx(sdata, skb, true);
2087 } else { 2039 } else {
2088 hdr = (struct ieee80211_hdr *)skb->data; 2040 hdr = (struct ieee80211_hdr *)skb->data;
2089 sta = sta_info_get(sdata, hdr->addr1); 2041 sta = sta_info_get(sdata, hdr->addr1);
2090 2042
2091 ret = __ieee80211_tx(local, &skb, sta, true); 2043 result = __ieee80211_tx(local, &skb, sta, true);
2092 if (ret != IEEE80211_TX_OK)
2093 result = false;
2094 } 2044 }
2095 2045
2096 return result; 2046 return result;
@@ -2132,8 +2082,6 @@ void ieee80211_tx_pending(unsigned long data)
2132 flags); 2082 flags);
2133 2083
2134 txok = ieee80211_tx_pending_skb(local, skb); 2084 txok = ieee80211_tx_pending_skb(local, skb);
2135 if (!txok)
2136 __skb_queue_head(&local->pending[i], skb);
2137 spin_lock_irqsave(&local->queue_stop_reason_lock, 2085 spin_lock_irqsave(&local->queue_stop_reason_lock,
2138 flags); 2086 flags);
2139 if (!txok) 2087 if (!txok)