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

Commit 57ffc589 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

mac80211: clean up get_tx_stats callback



The callback takes a ieee80211_tx_queue_stats with a contained
array of ieee80211_tx_queue_stats_data, remove the former, rename
the latter to ieee80211_tx_queue_stats and make tx_stats() take
the array directly.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 3e0d4cb1
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -306,11 +306,10 @@ static int adm8211_get_tx_stats(struct ieee80211_hw *dev,
				struct ieee80211_tx_queue_stats *stats)
{
	struct adm8211_priv *priv = dev->priv;
	struct ieee80211_tx_queue_stats_data *data = &stats->data[0];

	data->len = priv->cur_tx - priv->dirty_tx;
	data->limit = priv->tx_ring_size - 2;
	data->count = priv->dirty_tx;
	stats[0].len = priv->cur_tx - priv->dirty_tx;
	stats[0].limit = priv->tx_ring_size - 2;
	stats[0].count = priv->dirty_tx;

	return 0;
}
+4 −4
Original line number Diff line number Diff line
@@ -1335,7 +1335,7 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf,

	spin_lock_bh(&txq->lock);
	list_add_tail(&bf->list, &txq->q);
	sc->tx_stats.data[txq->qnum].len++;
	sc->tx_stats[txq->qnum].len++;
	if (txq->link == NULL) /* is this first packet? */
		ath5k_hw_put_tx_buf(ah, txq->qnum, bf->daddr);
	else /* no, so only link it */
@@ -1566,7 +1566,7 @@ ath5k_txq_drainq(struct ath5k_softc *sc, struct ath5k_txq *txq)
		ath5k_txbuf_free(sc, bf);

		spin_lock_bh(&sc->txbuflock);
		sc->tx_stats.data[txq->qnum].len--;
		sc->tx_stats[txq->qnum].len--;
		list_move_tail(&bf->list, &sc->txbuf);
		sc->txbuf_len++;
		spin_unlock_bh(&sc->txbuflock);
@@ -1979,10 +1979,10 @@ ath5k_tx_processq(struct ath5k_softc *sc, struct ath5k_txq *txq)
		}

		ieee80211_tx_status(sc->hw, skb, &txs);
		sc->tx_stats.data[txq->qnum].count++;
		sc->tx_stats[txq->qnum].count++;

		spin_lock(&sc->txbuflock);
		sc->tx_stats.data[txq->qnum].len--;
		sc->tx_stats[txq->qnum].len--;
		list_move_tail(&bf->list, &sc->txbuf);
		sc->txbuf_len++;
		spin_unlock(&sc->txbuflock);
+2 −1
Original line number Diff line number Diff line
@@ -92,7 +92,8 @@ struct ath5k_softc {
	struct pci_dev		*pdev;		/* for dma mapping */
	void __iomem		*iobase;	/* address of the device */
	struct mutex		lock;		/* dev-level lock */
	struct ieee80211_tx_queue_stats tx_stats;
	/* FIXME: how many does it really need? */
	struct ieee80211_tx_queue_stats tx_stats[16];
	struct ieee80211_low_level_stats ll_stats;
	struct ieee80211_hw	*hw;		/* IEEE 802.11 common */
	struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
+3 −5
Original line number Diff line number Diff line
@@ -1427,18 +1427,16 @@ void b43_dma_get_tx_stats(struct b43_wldev *dev,
{
	const int nr_queues = dev->wl->hw->queues;
	struct b43_dmaring *ring;
	struct ieee80211_tx_queue_stats_data *data;
	unsigned long flags;
	int i;

	for (i = 0; i < nr_queues; i++) {
		data = &(stats->data[i]);
		ring = select_ring_by_priority(dev, i);

		spin_lock_irqsave(&ring->lock, flags);
		data->len = ring->used_slots / SLOTS_PER_PACKET;
		data->limit = ring->nr_slots / SLOTS_PER_PACKET;
		data->count = ring->nr_tx_packets;
		stats[i].len = ring->used_slots / SLOTS_PER_PACKET;
		stats[i].limit = ring->nr_slots / SLOTS_PER_PACKET;
		stats[i].count = ring->nr_tx_packets;
		spin_unlock_irqrestore(&ring->lock, flags);
	}
}
+3 −5
Original line number Diff line number Diff line
@@ -611,18 +611,16 @@ void b43_pio_get_tx_stats(struct b43_wldev *dev,
{
	const int nr_queues = dev->wl->hw->queues;
	struct b43_pio_txqueue *q;
	struct ieee80211_tx_queue_stats_data *data;
	unsigned long flags;
	int i;

	for (i = 0; i < nr_queues; i++) {
		data = &(stats->data[i]);
		q = select_queue_by_priority(dev, i);

		spin_lock_irqsave(&q->lock, flags);
		data->len = B43_PIO_MAX_NR_TXPACKETS - q->free_packet_slots;
		data->limit = B43_PIO_MAX_NR_TXPACKETS;
		data->count = q->nr_tx_packets;
		stats[i].len = B43_PIO_MAX_NR_TXPACKETS - q->free_packet_slots;
		stats[i].limit = B43_PIO_MAX_NR_TXPACKETS;
		stats[i].count = q->nr_tx_packets;
		spin_unlock_irqrestore(&q->lock, flags);
	}
}
Loading