aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/p54/p54common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/p54/p54common.c')
-rw-r--r--drivers/net/wireless/p54/p54common.c24
1 files changed, 10 insertions, 14 deletions
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,
555static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb, 554static 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 +