mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: usb: store usb endpoint in mt76_queue
Store usb endpoint in mt76_queue structure and rework q2ep routine. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
027bab6a88
commit
e8909c610c
@@ -873,9 +873,8 @@ mt76u_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
mt76u_fill_bulk_urb(dev, USB_DIR_OUT, q2ep(q->hw_idx),
|
||||
q->entry[idx].urb, mt76u_complete_tx,
|
||||
&q->entry[idx]);
|
||||
mt76u_fill_bulk_urb(dev, USB_DIR_OUT, q->ep, q->entry[idx].urb,
|
||||
mt76u_complete_tx, &q->entry[idx]);
|
||||
|
||||
q->head = (q->head + 1) % q->ndesc;
|
||||
q->entry[idx].skb = tx_info.skb;
|
||||
@@ -907,9 +906,13 @@ static void mt76u_tx_kick(struct mt76_dev *dev, struct mt76_queue *q)
|
||||
}
|
||||
}
|
||||
|
||||
static u8 mt76u_ac_to_hwq(struct mt76_dev *dev, u8 ac)
|
||||
static void
|
||||
mt76u_ac_to_hwq(struct mt76_dev *dev, struct mt76_queue *q, u8 qid)
|
||||
{
|
||||
if (mt76_chip(dev) == 0x7663) {
|
||||
u8 ac = qid < IEEE80211_NUM_ACS ? qid : IEEE80211_AC_BE;
|
||||
|
||||
switch (mt76_chip(dev)) {
|
||||
case 0x7663: {
|
||||
static const u8 lmac_queue_map[] = {
|
||||
/* ac to lmac mapping */
|
||||
[IEEE80211_AC_BK] = 0,
|
||||
@@ -918,13 +921,20 @@ static u8 mt76u_ac_to_hwq(struct mt76_dev *dev, u8 ac)
|
||||
[IEEE80211_AC_VO] = 4,
|
||||
};
|
||||
|
||||
if (WARN_ON(ac >= ARRAY_SIZE(lmac_queue_map)))
|
||||
return 1; /* BE */
|
||||
|
||||
return lmac_queue_map[ac];
|
||||
q->hw_idx = lmac_queue_map[ac];
|
||||
q->ep = q->hw_idx + 1;
|
||||
break;
|
||||
}
|
||||
case 0x7961:
|
||||
case 0x7925:
|
||||
q->hw_idx = mt76_ac_to_hwq(ac);
|
||||
q->ep = qid == MT_TXQ_PSD ? MT_EP_OUT_HCCA : q->hw_idx + 1;
|
||||
break;
|
||||
default:
|
||||
q->hw_idx = mt76_ac_to_hwq(ac);
|
||||
q->ep = q->hw_idx + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
return mt76_ac_to_hwq(ac);
|
||||
}
|
||||
|
||||
static int mt76u_alloc_tx(struct mt76_dev *dev)
|
||||
@@ -940,8 +950,7 @@ static int mt76u_alloc_tx(struct mt76_dev *dev)
|
||||
return -ENOMEM;
|
||||
|
||||
spin_lock_init(&q->lock);
|
||||
q->hw_idx = mt76u_ac_to_hwq(dev, i);
|
||||
|
||||
mt76u_ac_to_hwq(dev, q, i);
|
||||
dev->phy.q_tx[i] = q;
|
||||
|
||||
q->entry = devm_kcalloc(dev->dev,
|
||||
|
||||
Reference in New Issue
Block a user