aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@web.de>2008-12-21 14:54:34 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-01-29 15:58:43 -0500
commita15bd00543a859a72546e4b09342b70e79e9ef1e (patch)
tree36c908af74b8584e2cdd9691604a026a71e63ab6 /drivers
parent0ea9c00c9d4e6309637a2defe18d26b6cda0fdc0 (diff)
p54: label queues with their corresponding names
This patch introduce new shiny named labels for our 8 (4 - on old firmware) queues. Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/p54/p54common.c50
-rw-r--r--drivers/net/wireless/p54/p54common.h19
2 files changed, 41 insertions, 28 deletions
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 34561e6e816b..3298cb464f72 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -239,11 +239,11 @@ int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw)
239 239
240 if (priv->fw_var >= 0x300) { 240 if (priv->fw_var >= 0x300) {
241 /* Firmware supports QoS, use it! */ 241 /* Firmware supports QoS, use it! */
242 priv->tx_stats[4].limit = 3; /* AC_VO */ 242 priv->tx_stats[P54_QUEUE_AC_VO].limit = 3;
243 priv->tx_stats[5].limit = 4; /* AC_VI */ 243 priv->tx_stats[P54_QUEUE_AC_VI].limit = 4;
244 priv->tx_stats[6].limit = 3; /* AC_BE */ 244 priv->tx_stats[P54_QUEUE_AC_BE].limit = 3;
245 priv->tx_stats[7].limit = 2; /* AC_BK */ 245 priv->tx_stats[P54_QUEUE_AC_BK].limit = 2;
246 dev->queues = 4; 246 dev->queues = P54_QUEUE_AC_NUM;
247 } 247 }
248 248
249 if (!modparam_nohwcrypt) 249 if (!modparam_nohwcrypt)
@@ -655,7 +655,8 @@ static void inline p54_wake_free_queues(struct ieee80211_hw *dev)
655 return ; 655 return ;
656 656
657 for (i = 0; i < dev->queues; i++) 657 for (i = 0; i < dev->queues; i++)
658 if (priv->tx_stats[i + 4].len < priv->tx_stats[i + 4].limit) 658 if (priv->tx_stats[i + P54_QUEUE_DATA].len <
659 priv->tx_stats[i + P54_QUEUE_DATA].limit)
659 ieee80211_wake_queue(dev, i); 660 ieee80211_wake_queue(dev, i);
660} 661}
661 662
@@ -1244,22 +1245,22 @@ static int p54_tx_fill(struct ieee80211_hw *dev, struct sk_buff *skb,
1244 if (unlikely(ieee80211_is_mgmt(hdr->frame_control))) { 1245 if (unlikely(ieee80211_is_mgmt(hdr->frame_control))) {
1245 if (ieee80211_is_beacon(hdr->frame_control)) { 1246 if (ieee80211_is_beacon(hdr->frame_control)) {
1246 *aid = 0; 1247 *aid = 0;
1247 *queue = 0; 1248 *queue = P54_QUEUE_BEACON;
1248 *extra_len = IEEE80211_MAX_TIM_LEN; 1249 *extra_len = IEEE80211_MAX_TIM_LEN;
1249 *flags = P54_HDR_FLAG_DATA_OUT_TIMESTAMP; 1250 *flags = P54_HDR_FLAG_DATA_OUT_TIMESTAMP;
1250 return 0; 1251 return 0;
1251 } else if (ieee80211_is_probe_resp(hdr->frame_control)) { 1252 } else if (ieee80211_is_probe_resp(hdr->frame_control)) {
1252 *aid = 0; 1253 *aid = 0;
1253 *queue = 2; 1254 *queue = P54_QUEUE_MGMT;
1254 *flags = P54_HDR_FLAG_DATA_OUT_TIMESTAMP | 1255 *flags = P54_HDR_FLAG_DATA_OUT_TIMESTAMP |
1255 P54_HDR_FLAG_DATA_OUT_NOCANCEL; 1256 P54_HDR_FLAG_DATA_OUT_NOCANCEL;
1256 return 0; 1257 return 0;
1257 } else { 1258 } else {
1258 *queue = 2; 1259 *queue = P54_QUEUE_MGMT;
1259 ret = 0; 1260 ret = 0;
1260 } 1261 }
1261 } else { 1262 } else {
1262 *queue += 4; 1263 *queue += P54_QUEUE_DATA;
1263 ret = 1; 1264 ret = 1;
1264 } 1265 }
1265 1266
@@ -1272,7 +1273,7 @@ static int p54_tx_fill(struct ieee80211_hw *dev, struct sk_buff *skb,
1272 case NL80211_IFTYPE_MESH_POINT: 1273 case NL80211_IFTYPE_MESH_POINT:
1273 if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { 1274 if (info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) {
1274 *aid = 0; 1275 *aid = 0;
1275 *queue = 3; 1276 *queue = P54_QUEUE_CAB;
1276 return 0; 1277 return 0;
1277 } 1278 }
1278 if (info->control.sta) 1279 if (info->control.sta)
@@ -1300,7 +1301,7 @@ static u8 p54_convert_algo(enum ieee80211_key_alg alg)
1300static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) 1301static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
1301{ 1302{
1302 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1303 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1303 struct ieee80211_tx_queue_stats *current_queue = NULL; 1304 struct ieee80211_tx_queue_stats *current_queue;
1304 struct p54_common *priv = dev->priv; 1305 struct p54_common *priv = dev->priv;
1305 struct p54_hdr *hdr; 1306 struct p54_hdr *hdr;
1306 struct p54_tx_data *txhdr; 1307 struct p54_tx_data *txhdr;
@@ -1443,10 +1444,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
1443 } 1444 }
1444 txhdr->crypt_offset = crypt_offset; 1445 txhdr->crypt_offset = crypt_offset;
1445 txhdr->hw_queue = queue; 1446 txhdr->hw_queue = queue;
1446 if (current_queue) 1447 txhdr->backlog = current_queue->len;
1447 txhdr->backlog = current_queue->len;
1448 else
1449 txhdr->backlog = 0;
1450 memset(txhdr->durations, 0, sizeof(txhdr->durations)); 1448 memset(txhdr->durations, 0, sizeof(txhdr->durations));
1451 txhdr->tx_antenna = (info->antenna_sel_tx == 0) ? 1449 txhdr->tx_antenna = (info->antenna_sel_tx == 0) ?
1452 2 : info->antenna_sel_tx - 1; 1450 2 : info->antenna_sel_tx - 1;
@@ -1468,10 +1466,8 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
1468 1466
1469 err: 1467 err:
1470 skb_pull(skb, sizeof(*hdr) + sizeof(*txhdr) + padding); 1468 skb_pull(skb, sizeof(*hdr) + sizeof(*txhdr) + padding);
1471 if (current_queue) { 1469 current_queue->len--;
1472 current_queue->len--; 1470 current_queue->count--;
1473 current_queue->count--;
1474 }
1475 return NETDEV_TX_BUSY; 1471 return NETDEV_TX_BUSY;
1476} 1472}
1477 1473
@@ -2019,8 +2015,8 @@ static int p54_get_tx_stats(struct ieee80211_hw *dev,
2019{ 2015{
2020 struct p54_common *priv = dev->priv; 2016 struct p54_common *priv = dev->priv;
2021 2017
2022 memcpy(stats, &priv->tx_stats[4], sizeof(stats[0]) * dev->queues); 2018 memcpy(stats, &priv->tx_stats[P54_QUEUE_DATA],
2023 2019 sizeof(stats[0]) * dev->queues);
2024 return 0; 2020 return 0;
2025} 2021}
2026 2022
@@ -2181,11 +2177,11 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len)
2181 BIT(NL80211_IFTYPE_MESH_POINT); 2177 BIT(NL80211_IFTYPE_MESH_POINT);
2182 2178
2183 dev->channel_change_time = 1000; /* TODO: find actual value */ 2179 dev->channel_change_time = 1000; /* TODO: find actual value */
2184 priv->tx_stats[0].limit = 1; /* Beacon queue */ 2180 priv->tx_stats[P54_QUEUE_BEACON].limit = 1;
2185 priv->tx_stats[1].limit = 1; /* Probe queue for HW scan */ 2181 priv->tx_stats[P54_QUEUE_FWSCAN].limit = 1;
2186 priv->tx_stats[2].limit = 3; /* queue for MLMEs */ 2182 priv->tx_stats[P54_QUEUE_MGMT].limit = 3;
2187 priv->tx_stats[3].limit = 3; /* Broadcast / MC queue */ 2183 priv->tx_stats[P54_QUEUE_CAB].limit = 3;
2188 priv->tx_stats[4].limit = 5; /* Data */ 2184 priv->tx_stats[P54_QUEUE_DATA].limit = 5;
2189 dev->queues = 1; 2185 dev->queues = 1;
2190 priv->noise = -94; 2186 priv->noise = -94;
2191 /* 2187 /*
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h
index f5729de83fe1..514f660d0be9 100644
--- a/drivers/net/wireless/p54/p54common.h
+++ b/drivers/net/wireless/p54/p54common.h
@@ -329,7 +329,7 @@ struct p54_frame_sent {
329 u8 padding; 329 u8 padding;
330} __attribute__ ((packed)); 330} __attribute__ ((packed));
331 331
332enum p54_tx_data_crypt { 332enum p54_tx_data_crypt {
333 P54_CRYPTO_NONE = 0, 333 P54_CRYPTO_NONE = 0,
334 P54_CRYPTO_WEP, 334 P54_CRYPTO_WEP,
335 P54_CRYPTO_TKIP, 335 P54_CRYPTO_TKIP,
@@ -340,6 +340,23 @@ enum p54_tx_data_crypt {
340 P54_CRYPTO_AESCCMP 340 P54_CRYPTO_AESCCMP
341}; 341};
342 342
343enum p54_tx_data_queue {
344 P54_QUEUE_BEACON = 0,
345 P54_QUEUE_FWSCAN = 1,
346 P54_QUEUE_MGMT = 2,
347 P54_QUEUE_CAB = 3,
348 P54_QUEUE_DATA = 4,
349
350 P54_QUEUE_AC_NUM = 4,
351 P54_QUEUE_AC_VO = 4,
352 P54_QUEUE_AC_VI = 5,
353 P54_QUEUE_AC_BE = 6,
354 P54_QUEUE_AC_BK = 7,
355
356 /* keep last */
357 P54_QUEUE_NUM = 8,
358};
359
343struct p54_tx_data { 360struct p54_tx_data {
344 u8 rateset[8]; 361 u8 rateset[8];
345 u8 rts_rate_idx; 362 u8 rts_rate_idx;