Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102506
b: refs/heads/master
c: 57ffc58
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed May 7, 2008
1 parent e67fd8e commit 6f8c1c8
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 63 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3e0d4cb12f6fd97193a455b49125398b2231c87c
refs/heads/master: 57ffc589a92424f9def74fe0d49b2f7763ff07fd
7 changes: 3 additions & 4 deletions trunk/drivers/net/wireless/adm8211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/net/wireless/ath5k/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/wireless/ath5k/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/b43/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/b43/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/b43legacy/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,18 +1455,16 @@ void b43legacy_dma_get_tx_stats(struct b43legacy_wldev *dev,
{
const int nr_queues = dev->wl->hw->queues;
struct b43legacy_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 = priority_to_txring(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);
}
}
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/net/wireless/b43legacy/pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,13 +525,11 @@ void b43legacy_pio_get_tx_stats(struct b43legacy_wldev *dev,
{
struct b43legacy_pio *pio = &dev->pio;
struct b43legacy_pioqueue *queue;
struct ieee80211_tx_queue_stats_data *data;

queue = pio->queue1;
data = &(stats->data[0]);
data->len = B43legacy_PIO_MAXTXPACKETS - queue->nr_txfree;
data->limit = B43legacy_PIO_MAXTXPACKETS;
data->count = queue->nr_tx_packets;
stats[0].len = B43legacy_PIO_MAXTXPACKETS - queue->nr_txfree;
stats[0].limit = B43legacy_PIO_MAXTXPACKETS;
stats[0].count = queue->nr_tx_packets;
}

static void pio_rx_error(struct b43legacy_pioqueue *queue,
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -7217,9 +7217,9 @@ static int iwl3945_mac_get_tx_stats(struct ieee80211_hw *hw,
q = &txq->q;
avail = iwl3945_queue_space(q);

stats->data[i].len = q->n_window - avail;
stats->data[i].limit = q->n_window - q->high_mark;
stats->data[i].count = q->n_window;
stats[i].len = q->n_window - avail;
stats[i].limit = q->n_window - q->high_mark;
stats[i].count = q->n_window;

}
spin_unlock_irqrestore(&priv->lock, flags);
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6420,9 +6420,9 @@ static int iwl4965_mac_get_tx_stats(struct ieee80211_hw *hw,
q = &txq->q;
avail = iwl4965_queue_space(q);

stats->data[i].len = q->n_window - avail;
stats->data[i].limit = q->n_window - q->high_mark;
stats->data[i].count = q->n_window;
stats[i].len = q->n_window - avail;
stats[i].limit = q->n_window - q->high_mark;
stats[i].count = q->n_window;

}
spin_unlock_irqrestore(&priv->lock, flags);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/p54/p54.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ struct p54_common {
unsigned int tx_hdr_len;
void *cached_vdcf;
unsigned int fw_var;
struct ieee80211_tx_queue_stats tx_stats;
struct ieee80211_tx_queue_stats tx_stats[4];
};

int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb);
Expand Down
24 changes: 10 additions & 14 deletions trunk/drivers/net/wireless/p54/p54common.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)

if (priv->fw_var >= 0x300) {
/* Firmware supports QoS, use it! */
priv->tx_stats.data[0].limit = 3;
priv->tx_stats.data[1].limit = 4;
priv->tx_stats.data[2].limit = 3;
priv->tx_stats.data[3].limit = 1;
priv->tx_stats[0].limit = 3;
priv->tx_stats[1].limit = 4;
priv->tx_stats[2].limit = 3;
priv->tx_stats[3].limit = 1;
dev->queues = 4;
}
}
Expand Down Expand Up @@ -379,7 +379,7 @@ static void inline p54_wake_free_queues(struct ieee80211_hw *dev)
* But, what if some are full? */

for (i = 0; i < dev->queues; i++)
if (priv->tx_stats.data[i].len < priv->tx_stats.data[i].limit)
if (priv->tx_stats[i].len < priv->tx_stats[i].limit)
ieee80211_wake_queue(dev, i);
}

Expand Down Expand Up @@ -417,8 +417,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb)
memcpy(&status.control, range->control,
sizeof(status.control));
kfree(range->control);
priv->tx_stats.data[status.control.queue].len--;

priv->tx_stats[status.control.queue].len--;
entry_hdr = (struct p54_control_hdr *) entry->data;
entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data;
if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0)
Expand Down Expand Up @@ -555,15 +554,15 @@ static void p54_assign_address(struct ieee80211_hw *dev, struct sk_buff *skb,
static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
struct ieee80211_tx_control *control)
{
struct ieee80211_tx_queue_stats_data *current_queue;
struct ieee80211_tx_queue_stats *current_queue;
struct p54_common *priv = dev->priv;
struct p54_control_hdr *hdr;
struct p54_tx_control_allocdata *txhdr;
struct ieee80211_tx_control *control_copy;
size_t padding, len;
u8 rate;

current_queue = &priv->tx_stats.data[control->queue];
current_queue = &priv->tx_stats[control->queue];
if (unlikely(current_queue->len > current_queue->limit))
return NETDEV_TX_BUSY;
current_queue->len++;
Expand Down Expand Up @@ -967,11 +966,8 @@ static int p54_get_tx_stats(struct ieee80211_hw *dev,
struct ieee80211_tx_queue_stats *stats)
{
struct p54_common *priv = dev->priv;
unsigned int i;

for (i = 0; i < dev->queues; i++)
memcpy(&stats->data[i], &priv->tx_stats.data[i],
sizeof(stats->data[i]));
memcpy(stats, &priv->tx_stats, sizeof(stats[0]) * dev->queues);

return 0;
}
Expand Down Expand Up @@ -1008,7 +1004,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
dev->channel_change_time = 1000; /* TODO: find actual value */
dev->max_rssi = 127;

priv->tx_stats.data[0].limit = 5;
priv->tx_stats[0].limit = 5;
dev->queues = 1;

dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 +
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,9 @@ int rt2x00mac_get_tx_stats(struct ieee80211_hw *hw,
unsigned int i;

for (i = 0; i < hw->queues; i++) {
stats->data[i].len = rt2x00dev->tx[i].length;
stats->data[i].limit = rt2x00dev->tx[i].limit;
stats->data[i].count = rt2x00dev->tx[i].count;
stats[i].len = rt2x00dev->tx[i].length;
stats[i].limit = rt2x00dev->tx[i].limit;
stats[i].count = rt2x00dev->tx[i].count;
}

return 0;
Expand Down
13 changes: 4 additions & 9 deletions trunk/include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ struct ieee80211_tx_queue_params {
};

/**
* struct ieee80211_tx_queue_stats_data - transmit queue statistics
* struct ieee80211_tx_queue_stats - transmit queue statistics
*
* @len: number of packets in queue
* @limit: queue length limit
* @count: number of frames sent
*/
struct ieee80211_tx_queue_stats_data {
struct ieee80211_tx_queue_stats {
unsigned int len;
unsigned int limit;
unsigned int count;
Expand Down Expand Up @@ -165,10 +165,6 @@ enum ieee80211_tx_queue {
NUM_TX_DATA_QUEUES_AMPDU = 16
};

struct ieee80211_tx_queue_stats {
struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
};

struct ieee80211_low_level_stats {
unsigned int dot11ACKFailureCount;
unsigned int dot11RTSFailureCount;
Expand Down Expand Up @@ -1083,9 +1079,8 @@ enum ieee80211_ampdu_mlme_action {
* @get_tx_stats: Get statistics of the current TX queue status. This is used
* to get number of currently queued packets (queue length), maximum queue
* size (limit), and total number of packets sent using each TX queue
* (count). This information is used for WMM to find out which TX
* queues have room for more packets and by hostapd to provide
* statistics about the current queueing state to external programs.
* (count). The 'stats' pointer points to an array that has hw->queues +
* hw->ampdu_queues items.
*
* @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
* this is only used for IBSS mode debugging and, as such, is not a
Expand Down

0 comments on commit 6f8c1c8

Please sign in to comment.