mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: pass the correct hardware queue index to the tx header
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -89,7 +89,9 @@ struct mt76_queue {
|
||||
int ndesc;
|
||||
int queued;
|
||||
int buf_size;
|
||||
int buf_offset;
|
||||
|
||||
u8 buf_offset;
|
||||
u8 hw_idx;
|
||||
|
||||
dma_addr_t desc_dma;
|
||||
struct sk_buff *rx_head;
|
||||
@@ -154,7 +156,8 @@ struct mt76_driver_ops {
|
||||
u16 txwi_size;
|
||||
|
||||
int (*tx_prepare_skb)(struct mt76_dev *dev, void *txwi_ptr,
|
||||
struct sk_buff *skb, struct mt76_wcid *wcid,
|
||||
struct sk_buff *skb, struct mt76_queue *q,
|
||||
struct mt76_wcid *wcid,
|
||||
struct ieee80211_sta *sta, u32 *tx_info);
|
||||
|
||||
void (*tx_complete_skb)(struct mt76_dev *dev, struct mt76_queue *q,
|
||||
|
||||
@@ -200,8 +200,9 @@ int mt7603_wtbl_set_key(struct mt7603_dev *dev, int wcid,
|
||||
struct ieee80211_key_conf *key);
|
||||
|
||||
int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
|
||||
struct sk_buff *skb, struct mt76_wcid *wcid,
|
||||
struct ieee80211_sta *sta, u32 *tx_info);
|
||||
struct sk_buff *skb, struct mt76_queue *q,
|
||||
struct mt76_wcid *wcid, struct ieee80211_sta *sta,
|
||||
u32 *tx_info);
|
||||
|
||||
void mt7603_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q,
|
||||
struct mt76_queue_entry *e, bool flush);
|
||||
|
||||
@@ -44,6 +44,7 @@ mt7603_init_tx_queue(struct mt7603_dev *dev, struct mt76_queue *q,
|
||||
{
|
||||
int ret;
|
||||
|
||||
q->hw_idx = idx;
|
||||
q->regs = dev->mt76.regs + MT_TX_RING_BASE + idx * MT_RING_SIZE;
|
||||
q->ndesc = n_desc;
|
||||
|
||||
|
||||
+8
-6
@@ -549,8 +549,9 @@ int mt7603_wtbl_set_key(struct mt7603_dev *dev, int wcid,
|
||||
|
||||
static int
|
||||
mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
|
||||
struct sk_buff *skb, struct mt76_wcid *wcid,
|
||||
struct ieee80211_sta *sta, int pid, bool key)
|
||||
struct sk_buff *skb, struct mt76_queue *q,
|
||||
struct mt76_wcid *wcid, struct ieee80211_sta *sta,
|
||||
int pid, bool key)
|
||||
{
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
struct ieee80211_tx_rate *rate = &info->control.rates[0];
|
||||
@@ -578,7 +579,7 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
|
||||
|
||||
txwi[0] = cpu_to_le32(
|
||||
MT76_SET(MT_TXD0_TX_BYTES, skb->len + MT_TXD_SIZE) |
|
||||
MT76_SET(MT_TXD0_Q_IDX, skb_get_queue_mapping(skb))
|
||||
MT76_SET(MT_TXD0_Q_IDX, q->hw_idx)
|
||||
);
|
||||
txwi[1] = cpu_to_le32(
|
||||
MT_TXD1_LONG_FORMAT |
|
||||
@@ -643,8 +644,9 @@ mt7603_mac_write_txwi(struct mt7603_dev *dev, __le32 *txwi,
|
||||
}
|
||||
|
||||
int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
|
||||
struct sk_buff *skb, struct mt76_wcid *wcid,
|
||||
struct ieee80211_sta *sta, u32 *tx_info)
|
||||
struct sk_buff *skb, struct mt76_queue *q,
|
||||
struct mt76_wcid *wcid, struct ieee80211_sta *sta,
|
||||
u32 *tx_info)
|
||||
{
|
||||
struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76);
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
@@ -674,7 +676,7 @@ int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
|
||||
INIT_LIST_HEAD(&cb->list);
|
||||
}
|
||||
|
||||
mt7603_mac_write_txwi(dev, txwi_ptr, skb, wcid, sta, pid, key);
|
||||
mt7603_mac_write_txwi(dev, txwi_ptr, skb, q, wcid, sta, pid, key);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -205,8 +205,9 @@ void mt76x2_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
|
||||
struct sk_buff *skb);
|
||||
void mt76x2_tx_complete(struct mt76x2_dev *dev, struct sk_buff *skb);
|
||||
int mt76x2_tx_prepare_skb(struct mt76_dev *dev, void *txwi_ptr,
|
||||
struct sk_buff *skb, struct mt76_wcid *wcid,
|
||||
struct ieee80211_sta *sta, u32 *tx_info);
|
||||
struct sk_buff *skb, struct mt76_queue *q,
|
||||
struct mt76_wcid *wcid, struct ieee80211_sta *sta,
|
||||
u32 *tx_info);
|
||||
void mt76x2_tx_complete_skb(struct mt76_dev *mdev, struct mt76_queue *q,
|
||||
struct mt76_queue_entry *e, bool flush);
|
||||
|
||||
|
||||
+3
-2
@@ -59,8 +59,9 @@ void mt76x2_tx_complete(struct mt76x2_dev *dev, struct sk_buff *skb)
|
||||
}
|
||||
|
||||
int mt76x2_tx_prepare_skb(struct mt76_dev *mdev, void *txwi,
|
||||
struct sk_buff *skb, struct mt76_wcid *wcid,
|
||||
struct ieee80211_sta *sta, u32 *tx_info)
|
||||
struct sk_buff *skb, struct mt76_queue *q,
|
||||
struct mt76_wcid *wcid, struct ieee80211_sta *sta,
|
||||
u32 *tx_info)
|
||||
{
|
||||
struct mt76x2_dev *dev = container_of(mdev, struct mt76x2_dev, mt76);
|
||||
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
|
||||
@@ -107,7 +107,8 @@ int mt76_tx_queue_skb(struct mt76_dev *dev, struct mt76_queue *q,
|
||||
|
||||
dma_sync_single_for_cpu(dev->dev, t->dma_addr, sizeof(t->txwi),
|
||||
DMA_TO_DEVICE);
|
||||
ret = dev->drv->tx_prepare_skb(dev, &t->txwi, skb, wcid, sta, &tx_info);
|
||||
ret = dev->drv->tx_prepare_skb(dev, &t->txwi, skb, q, wcid, sta,
|
||||
&tx_info);
|
||||
dma_sync_single_for_device(dev->dev, t->dma_addr, sizeof(t->txwi),
|
||||
DMA_TO_DEVICE);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user