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: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg
2008-04-29 17:18:59 +02:00
committed by John W. Linville
parent 3e0d4cb12f
commit 57ffc589a9
13 changed files with 45 additions and 62 deletions

View File

@@ -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);

View File

@@ -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;
}
}
@@ -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);
}
@@ -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)
@@ -555,7 +554,7 @@ 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;
@@ -563,7 +562,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb,
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++;
@@ -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;
}
@@ -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 +