static void rtl818x_handle_tx(struct net80211_device *dev) { struct rtl818x_priv *priv = dev->priv; unsigned int count = RTL818X_TX_RING_SIZE; while (count--) { struct rtl818x_tx_desc *entry = &priv->tx_ring[priv->tx_cons]; struct io_buffer *iob = priv->tx_buf[priv->tx_cons]; u32 flags = le32_to_cpu(entry->flags); int rc; if ((flags & RTL818X_TX_DESC_FLAG_OWN) || !iob) return; rc = 0; if (!(flags & RTL818X_TX_DESC_FLAG_TX_OK)) { /* our packet was not ACKed properly */ rc = EIO; } net80211_tx_complete(dev, iob, flags & 0xFF, rc); priv->tx_buf[priv->tx_cons] = NULL; priv->tx_cons = (priv->tx_cons + 1) % RTL818X_TX_RING_SIZE; } }
static inline void ath5k_txbuf_free(struct ath5k_softc *sc, struct ath5k_buf *bf) { if (!bf->iob) return; net80211_tx_complete(sc->dev, bf->iob, 0, ECANCELED); bf->iob = NULL; }
static void rtl818x_free_tx_ring(struct net80211_device *dev) { struct rtl818x_priv *priv = dev->priv; int i; for (i = 0; i < RTL818X_TX_RING_SIZE; i++) { if (priv->tx_buf[i]) net80211_tx_complete(dev, priv->tx_buf[i], 0, ECANCELED); priv->tx_buf[i] = NULL; } free_dma(priv->tx_ring, sizeof(*priv->tx_ring) * RTL818X_TX_RING_SIZE); priv->tx_ring = NULL; }