mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: unify AC to hw queue mapping
Use the same AC to hardware queue mappings for all subdrivers. Note: this change BK and BE mappings for USB drivers. Signed-off-by: Stanislaw Gruszka <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
2a20cfc1a4
commit
a69033307e
@@ -519,13 +519,7 @@ static inline int mt76_decr(int val, int size)
|
||||
return (val - 1) & (size - 1);
|
||||
}
|
||||
|
||||
/* Hardware uses mirrored order of queues with Q3
|
||||
* having the highest priority
|
||||
*/
|
||||
static inline u8 q2hwq(u8 q)
|
||||
{
|
||||
return q ^ 0x3;
|
||||
}
|
||||
u8 mt76_ac_to_hwq(u8 ac);
|
||||
|
||||
static inline struct ieee80211_txq *
|
||||
mtxq_to_txq(struct mt76_txq *mtxq)
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@ static u8 skb2q(struct sk_buff *skb)
|
||||
skb_set_queue_mapping(skb, qid);
|
||||
}
|
||||
|
||||
return q2hwq(qid);
|
||||
return mt76_ac_to_hwq(qid);
|
||||
}
|
||||
|
||||
static void mt76x0_tx_skb_remove_dma_overhead(struct sk_buff *skb,
|
||||
@@ -216,7 +216,7 @@ int mt76x0_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
u16 queue, const struct ieee80211_tx_queue_params *params)
|
||||
{
|
||||
struct mt76x0_dev *dev = hw->priv;
|
||||
u8 cw_min = 5, cw_max = 10, hw_q = q2hwq(queue);
|
||||
u8 cw_min = 5, cw_max = 10, hw_q = mt76_ac_to_hwq(queue);
|
||||
u32 val;
|
||||
|
||||
/* TODO: should we do funny things with the parameters?
|
||||
|
||||
+2
-8
@@ -102,12 +102,6 @@ mt76x2_tx_tasklet(unsigned long data)
|
||||
|
||||
int mt76x2_dma_init(struct mt76x2_dev *dev)
|
||||
{
|
||||
static const u8 wmm_queue_map[] = {
|
||||
[IEEE80211_AC_BE] = 0,
|
||||
[IEEE80211_AC_BK] = 1,
|
||||
[IEEE80211_AC_VI] = 2,
|
||||
[IEEE80211_AC_VO] = 3,
|
||||
};
|
||||
int ret;
|
||||
int i;
|
||||
struct mt76_txwi_cache __maybe_unused *t;
|
||||
@@ -125,9 +119,9 @@ int mt76x2_dma_init(struct mt76x2_dev *dev)
|
||||
|
||||
mt76_wr(dev, MT_WPDMA_RST_IDX, ~0);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(wmm_queue_map); i++) {
|
||||
for (i = 0; i < IEEE80211_NUM_ACS; i++) {
|
||||
ret = mt76x2_init_tx_queue(dev, &dev->mt76.q_tx[i],
|
||||
wmm_queue_map[i], MT_TX_RING_SIZE);
|
||||
mt76_ac_to_hwq(i), MT_TX_RING_SIZE);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -442,3 +442,19 @@ void mt76_txq_init(struct mt76_dev *dev, struct ieee80211_txq *txq)
|
||||
mtxq->hwq = &dev->q_tx[mt76_txq_get_qid(txq)];
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_txq_init);
|
||||
|
||||
u8 mt76_ac_to_hwq(u8 ac)
|
||||
{
|
||||
static const u8 wmm_queue_map[] = {
|
||||
[IEEE80211_AC_BE] = 0,
|
||||
[IEEE80211_AC_BK] = 1,
|
||||
[IEEE80211_AC_VI] = 2,
|
||||
[IEEE80211_AC_VO] = 3,
|
||||
};
|
||||
|
||||
if (WARN_ON(ac >= IEEE80211_NUM_ACS))
|
||||
return 0;
|
||||
|
||||
return wmm_queue_map[ac];
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mt76_ac_to_hwq);
|
||||
|
||||
Reference in New Issue
Block a user