diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-04-29 11:18:59 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-05-07 15:02:26 -0400 |
commit | 57ffc589a92424f9def74fe0d49b2f7763ff07fd (patch) | |
tree | 2ec3f60cac2e5757206dee219e7b3a60ded13004 /drivers/net/wireless/p54 | |
parent | 3e0d4cb12f6fd97193a455b49125398b2231c87c (diff) |
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>
Diffstat (limited to 'drivers/net/wireless/p54')
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 24 |
2 files changed, 11 insertions, 15 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index 06d2c67f4c81..c6f27b9022f9 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -64,7 +64,7 @@ struct p54_common { | |||
64 | unsigned int tx_hdr_len; | 64 | unsigned int tx_hdr_len; |
65 | void *cached_vdcf; | 65 | void *cached_vdcf; |
66 | unsigned int fw_var; | 66 | unsigned int fw_var; |
67 | struct ieee80211_tx_queue_stats tx_stats; | 67 | struct ieee80211_tx_queue_stats tx_stats[4]; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb); | 70 | int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb); |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 63f9badf3f52..59a26978f877 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -146,10 +146,10 @@ void p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw) | |||
146 | 146 | ||
147 | if (priv->fw_var >= 0x300) { | 147 | if (priv->fw_var >= 0x300) { |
148 | /* Firmware supports QoS, use it! */ | 148 | /* Firmware supports QoS, use it! */ |
149 | priv->tx_stats.data[0].limit = 3; | 149 | priv->tx_stats[0].limit = 3; |
150 | priv->tx_stats.data[1].limit = 4; | 150 | priv->tx_stats[1].limit = 4; |
151 | priv->tx_stats.data[2].limit = 3; | 151 | priv->tx_stats[2].limit = 3; |
152 | priv->tx_stats.data[3].limit = 1; | 152 | priv->tx_stats[3].limit = 1; |
153 | dev->queues = 4; | 153 | dev->queues = 4; |
154 | } | 154 | } |
155 | } | 155 | } |
@@ -379,7 +379,7 @@ static void inline p54_wake_free_queues(struct ieee80211_hw *dev) | |||
379 | * But, what if some are full? */ | 379 | * But, what if some are full? */ |
380 | 380 | ||
381 | for (i = 0; i < dev->queues; i++) | 381 | for (i = 0; i < dev->queues; i++) |
382 | if (priv->tx_stats.data[i].len < priv->tx_stats.data[i].limit) | 382 | if (priv->tx_stats[i].len < priv->tx_stats[i].limit) |
383 | ieee80211_wake_queue(dev, i); | 383 | ieee80211_wake_queue(dev, i); |
384 | } | 384 | } |
385 | 385 | ||
@@ -417,8 +417,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
417 | memcpy(&status.control, range->control, | 417 | memcpy(&status.control, range->control, |
418 | sizeof(status.control)); | 418 | sizeof(status.control)); |
419 | kfree(range->control); | 419 | kfree(range->control); |
420 | priv->tx_stats.data[status.control.queue].len--; | 420 | priv->tx_stats[status.control.queue].len--; |
421 | |||
422 | entry_hdr = (struct p54_control_hdr *) entry->data; | 421 | entry_hdr = (struct p54_control_hdr *) entry->data; |
423 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; | 422 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; |
424 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) | 423 | 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, | |||
555 | static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | 554 | static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb, |
556 | struct ieee80211_tx_control *control) | 555 | struct ieee80211_tx_control *control) |
557 | { | 556 | { |
558 | struct ieee80211_tx_queue_stats_data *current_queue; | 557 | struct ieee80211_tx_queue_stats *current_queue; |
559 | struct p54_common *priv = dev->priv; | 558 | struct p54_common *priv = dev->priv; |
560 | struct p54_control_hdr *hdr; | 559 | struct p54_control_hdr *hdr; |
561 | struct p54_tx_control_allocdata *txhdr; | 560 | struct p54_tx_control_allocdata *txhdr; |
@@ -563,7 +562,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb, | |||
563 | size_t padding, len; | 562 | size_t padding, len; |
564 | u8 rate; | 563 | u8 rate; |
565 | 564 | ||
566 | current_queue = &priv->tx_stats.data[control->queue]; | 565 | current_queue = &priv->tx_stats[control->queue]; |
567 | if (unlikely(current_queue->len > current_queue->limit)) | 566 | if (unlikely(current_queue->len > current_queue->limit)) |
568 | return NETDEV_TX_BUSY; | 567 | return NETDEV_TX_BUSY; |
569 | current_queue->len++; | 568 | current_queue->len++; |
@@ -967,11 +966,8 @@ static int p54_get_tx_stats(struct ieee80211_hw *dev, | |||
967 | struct ieee80211_tx_queue_stats *stats) | 966 | struct ieee80211_tx_queue_stats *stats) |
968 | { | 967 | { |
969 | struct p54_common *priv = dev->priv; | 968 | struct p54_common *priv = dev->priv; |
970 | unsigned int i; | ||
971 | 969 | ||
972 | for (i = 0; i < dev->queues; i++) | 970 | memcpy(stats, &priv->tx_stats, sizeof(stats[0]) * dev->queues); |
973 | memcpy(&stats->data[i], &priv->tx_stats.data[i], | ||
974 | sizeof(stats->data[i])); | ||
975 | 971 | ||
976 | return 0; | 972 | return 0; |
977 | } | 973 | } |
@@ -1008,7 +1004,7 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
1008 | dev->channel_change_time = 1000; /* TODO: find actual value */ | 1004 | dev->channel_change_time = 1000; /* TODO: find actual value */ |
1009 | dev->max_rssi = 127; | 1005 | dev->max_rssi = 127; |
1010 | 1006 | ||
1011 | priv->tx_stats.data[0].limit = 5; | 1007 | priv->tx_stats[0].limit = 5; |
1012 | dev->queues = 1; | 1008 | dev->queues = 1; |
1013 | 1009 | ||
1014 | dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 + | 1010 | dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 + |