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>
This commit is contained in:

committed by
John W. Linville

parent
43f12d47f0
commit
7bb4568372
@@ -1573,7 +1573,7 @@ static void mwl8k_txq_deinit(struct ieee80211_hw *hw, int index)
|
||||
txq->txd = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
static void
|
||||
mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
|
||||
{
|
||||
struct mwl8k_priv *priv = hw->priv;
|
||||
@@ -1635,7 +1635,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
|
||||
wiphy_debug(hw->wiphy,
|
||||
"failed to dma map skb, dropping TX frame.\n");
|
||||
dev_kfree_skb(skb);
|
||||
return NETDEV_TX_OK;
|
||||
return;
|
||||
}
|
||||
|
||||
spin_lock_bh(&priv->tx_lock);
|
||||
@@ -1672,8 +1672,6 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
|
||||
mwl8k_tx_start(priv);
|
||||
|
||||
spin_unlock_bh(&priv->tx_lock);
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -3742,22 +3740,19 @@ static void mwl8k_rx_poll(unsigned long data)
|
||||
/*
|
||||
* Core driver operations.
|
||||
*/
|
||||
static int mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
|
||||
static void mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
|
||||
{
|
||||
struct mwl8k_priv *priv = hw->priv;
|
||||
int index = skb_get_queue_mapping(skb);
|
||||
int rc;
|
||||
|
||||
if (!priv->radio_on) {
|
||||
wiphy_debug(hw->wiphy,
|
||||
"dropped TX frame since radio disabled\n");
|
||||
dev_kfree_skb(skb);
|
||||
return NETDEV_TX_OK;
|
||||
return;
|
||||
}
|
||||
|
||||
rc = mwl8k_txq_xmit(hw, index, skb);
|
||||
|
||||
return rc;
|
||||
mwl8k_txq_xmit(hw, index, skb);
|
||||
}
|
||||
|
||||
static int mwl8k_start(struct ieee80211_hw *hw)
|
||||
|
Reference in New Issue
Block a user