Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bb45683 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

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: default avatarJohannes 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: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 43f12d47
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1658,7 +1658,7 @@ static void adm8211_tx_raw(struct ieee80211_hw *dev, struct sk_buff *skb,
}

/* Put adm8211_tx_hdr on skb and transmit */
static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
static void adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
{
	struct adm8211_tx_hdr *txhdr;
	size_t payload_len, hdrlen;
@@ -1707,8 +1707,6 @@ static int adm8211_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
	txhdr->retry_limit = info->control.rates[0].count;

	adm8211_tx_raw(dev, skb, plcp_signal, hdrlen);

	return NETDEV_TX_OK;
}

static int adm8211_alloc_rings(struct ieee80211_hw *dev)
+3 −4
Original line number Diff line number Diff line
@@ -1728,7 +1728,7 @@ static void at76_mac80211_tx_callback(struct urb *urb)
	ieee80211_wake_queues(priv->hw);
}

static int at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
static void at76_mac80211_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
	struct at76_priv *priv = hw->priv;
	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)
	if (priv->tx_urb->status == -EINPROGRESS) {
		wiphy_err(priv->hw->wiphy,
			  "%s called while tx urb is pending\n", __func__);
		return NETDEV_TX_BUSY;
		dev_kfree_skb_any(skb);
		return;
	}

	/* 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)
				  priv->tx_urb,
				  priv->tx_urb->hcpriv, priv->tx_urb->complete);
	}

	return 0;
}

static int at76_mac80211_start(struct ieee80211_hw *hw)
+1 −1
Original line number Diff line number Diff line
@@ -224,7 +224,7 @@ void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);
int ar9170_nag_limiter(struct ar9170 *ar);

/* MAC */
int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
void ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
int ar9170_init_mac(struct ar9170 *ar);
int ar9170_set_qos(struct ar9170 *ar);
int ar9170_update_multicast(struct ar9170 *ar, const u64 mc_hast);
+2 −3
Original line number Diff line number Diff line
@@ -1475,7 +1475,7 @@ static void ar9170_tx(struct ar9170 *ar)
				     msecs_to_jiffies(AR9170_JANITOR_DELAY));
}

int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
void ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
	struct ar9170 *ar = hw->priv;
	struct ieee80211_tx_info *info;
@@ -1493,11 +1493,10 @@ int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
	skb_queue_tail(&ar->tx_pending[queue], skb);

	ar9170_tx(ar);
	return NETDEV_TX_OK;
	return;

err_free:
	dev_kfree_skb_any(skb);
	return NETDEV_TX_OK;
}

static int ar9170_op_add_interface(struct ieee80211_hw *hw,
+2 −2
Original line number Diff line number Diff line
@@ -1164,7 +1164,7 @@ struct ath5k_txq;

void set_beacon_filter(struct ieee80211_hw *hw, bool enable);
bool ath_any_vif_assoc(struct ath5k_softc *sc);
int ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
void ath5k_tx_queue(struct ieee80211_hw *hw, struct sk_buff *skb,
		    struct ath5k_txq *txq);
int ath5k_init_hw(struct ath5k_softc *sc);
int ath5k_stop_hw(struct ath5k_softc *sc);
Loading