diff options
author | Chr <chunkeey@web.de> | 2008-08-23 21:15:16 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-08-29 16:24:09 -0400 |
commit | 84df3ed30b72c3516d72bc9734d4425746b15dfc (patch) | |
tree | cff1ff63b94ddd03305d9dbdabadce230ee09f98 | |
parent | 031d10ee5a6df5aba6b4ac8bb01dd023cd5efc02 (diff) |
p54: redo queue numbering
The firmware supports 8 different queues and not only 4.
So, let's make some room for further tasks (ap/adhoc support)
in this area.
Signed-off-by: Christian Lamparter <chunkeey@web.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/p54/p54.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/p54/p54common.c | 22 |
2 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/wireless/p54/p54.h b/drivers/net/wireless/p54/p54.h index 10df07de9e52..fca8762fa069 100644 --- a/drivers/net/wireless/p54/p54.h +++ b/drivers/net/wireless/p54/p54.h | |||
@@ -66,7 +66,7 @@ struct p54_common { | |||
66 | unsigned int tx_hdr_len; | 66 | unsigned int tx_hdr_len; |
67 | void *cached_vdcf; | 67 | void *cached_vdcf; |
68 | unsigned int fw_var; | 68 | unsigned int fw_var; |
69 | struct ieee80211_tx_queue_stats tx_stats[4]; | 69 | struct ieee80211_tx_queue_stats tx_stats[8]; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb); | 72 | 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 5cd88bcb0280..17e06bbc996a 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[0].limit = 3; | 149 | priv->tx_stats[4].limit = 3; |
150 | priv->tx_stats[1].limit = 4; | 150 | priv->tx_stats[5].limit = 4; |
151 | priv->tx_stats[2].limit = 3; | 151 | priv->tx_stats[6].limit = 3; |
152 | priv->tx_stats[3].limit = 1; | 152 | priv->tx_stats[7].limit = 1; |
153 | dev->queues = 4; | 153 | dev->queues = 4; |
154 | } | 154 | } |
155 | } | 155 | } |
@@ -418,7 +418,7 @@ static void inline p54_wake_free_queues(struct ieee80211_hw *dev) | |||
418 | int i; | 418 | int i; |
419 | 419 | ||
420 | for (i = 0; i < dev->queues; i++) | 420 | for (i = 0; i < dev->queues; i++) |
421 | if (priv->tx_stats[i].len < priv->tx_stats[i].limit) | 421 | if (priv->tx_stats[i + 4].len < priv->tx_stats[i + 4].limit) |
422 | ieee80211_wake_queue(dev, i); | 422 | ieee80211_wake_queue(dev, i); |
423 | } | 423 | } |
424 | 424 | ||
@@ -463,7 +463,7 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
463 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) | 463 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) |
464 | pad = entry_data->align[0]; | 464 | pad = entry_data->align[0]; |
465 | 465 | ||
466 | priv->tx_stats[entry_data->hw_queue - 4].len--; | 466 | priv->tx_stats[entry_data->hw_queue].len--; |
467 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { | 467 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
468 | if (!(payload->status & 0x01)) | 468 | if (!(payload->status & 0x01)) |
469 | info->flags |= IEEE80211_TX_STAT_ACK; | 469 | info->flags |= IEEE80211_TX_STAT_ACK; |
@@ -606,7 +606,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
606 | u8 rate; | 606 | u8 rate; |
607 | u8 cts_rate = 0x20; | 607 | u8 cts_rate = 0x20; |
608 | 608 | ||
609 | current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)]; | 609 | current_queue = &priv->tx_stats[skb_get_queue_mapping(skb) + 4]; |
610 | if (unlikely(current_queue->len > current_queue->limit)) | 610 | if (unlikely(current_queue->len > current_queue->limit)) |
611 | return NETDEV_TX_BUSY; | 611 | return NETDEV_TX_BUSY; |
612 | current_queue->len++; | 612 | current_queue->len++; |
@@ -1037,7 +1037,7 @@ static int p54_get_tx_stats(struct ieee80211_hw *dev, | |||
1037 | { | 1037 | { |
1038 | struct p54_common *priv = dev->priv; | 1038 | struct p54_common *priv = dev->priv; |
1039 | 1039 | ||
1040 | memcpy(stats, &priv->tx_stats, sizeof(stats[0]) * dev->queues); | 1040 | memcpy(stats, &priv->tx_stats[4], sizeof(stats[0]) * dev->queues); |
1041 | 1041 | ||
1042 | return 0; | 1042 | return 0; |
1043 | } | 1043 | } |
@@ -1075,7 +1075,11 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
1075 | dev->channel_change_time = 1000; /* TODO: find actual value */ | 1075 | dev->channel_change_time = 1000; /* TODO: find actual value */ |
1076 | dev->max_signal = 127; | 1076 | dev->max_signal = 127; |
1077 | 1077 | ||
1078 | priv->tx_stats[0].limit = 5; | 1078 | priv->tx_stats[0].limit = 1; |
1079 | priv->tx_stats[1].limit = 1; | ||
1080 | priv->tx_stats[2].limit = 1; | ||
1081 | priv->tx_stats[3].limit = 1; | ||
1082 | priv->tx_stats[4].limit = 5; | ||
1079 | dev->queues = 1; | 1083 | dev->queues = 1; |
1080 | 1084 | ||
1081 | dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 + | 1085 | dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 + |