mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-28 11:18:45 +07:00
mt76: overwrite qid for non-bufferable mgmt frames
Overwrite hw queue id for non-bufferable management frames if the hw support always txq (altxq) in order to be in sync with mac txwi code Fixes:cdad487405
("mt76: mt7615: add dma and tx queue initialization for MT7622") Fixes:f40ac0f3d3
("mt76: mt7615: introduce mt7663e support") Suggested-by: Felix Fietkau <nbd@nbd.name> Tested-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
a07292ee14
commit
7f88314321
@ -301,6 +301,7 @@ struct mt76_hw_cap {
|
||||
#define MT_DRV_TX_ALIGNED4_SKBS BIT(1)
|
||||
#define MT_DRV_SW_RX_AIRTIME BIT(2)
|
||||
#define MT_DRV_RX_DMA_HDR BIT(3)
|
||||
#define MT_DRV_HW_MGMT_TXQ BIT(4)
|
||||
|
||||
struct mt76_driver_ops {
|
||||
u32 drv_flags;
|
||||
|
@ -100,6 +100,7 @@ mt7615_tx_cleanup(struct mt7615_dev *dev)
|
||||
int i;
|
||||
|
||||
mt76_queue_tx_cleanup(dev, MT_TXQ_MCU, false);
|
||||
mt76_queue_tx_cleanup(dev, MT_TXQ_PSD, false);
|
||||
if (is_mt7615(&dev->mt76)) {
|
||||
mt76_queue_tx_cleanup(dev, MT_TXQ_BE, false);
|
||||
} else {
|
||||
|
@ -526,22 +526,16 @@ int mt7615_mac_write_txwi(struct mt7615_dev *dev, __le32 *txwi,
|
||||
fc_type = (le16_to_cpu(fc) & IEEE80211_FCTL_FTYPE) >> 2;
|
||||
fc_stype = (le16_to_cpu(fc) & IEEE80211_FCTL_STYPE) >> 4;
|
||||
|
||||
if (ieee80211_is_data(fc) || ieee80211_is_bufferable_mmpdu(fc)) {
|
||||
if (beacon) {
|
||||
p_fmt = MT_TX_TYPE_FW;
|
||||
q_idx = ext_phy ? MT_LMAC_BCN1 : MT_LMAC_BCN0;
|
||||
} else if (skb_get_queue_mapping(skb) >= MT_TXQ_PSD) {
|
||||
p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
|
||||
q_idx = ext_phy ? MT_LMAC_ALTX1 : MT_LMAC_ALTX0;
|
||||
} else {
|
||||
p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
|
||||
q_idx = wmm_idx * MT7615_MAX_WMM_SETS +
|
||||
mt7615_lmac_mapping(dev, skb_get_queue_mapping(skb));
|
||||
p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
|
||||
} else if (beacon) {
|
||||
if (ext_phy)
|
||||
q_idx = MT_LMAC_BCN1;
|
||||
else
|
||||
q_idx = MT_LMAC_BCN0;
|
||||
p_fmt = MT_TX_TYPE_FW;
|
||||
} else {
|
||||
if (ext_phy)
|
||||
q_idx = MT_LMAC_ALTX1;
|
||||
else
|
||||
q_idx = MT_LMAC_ALTX0;
|
||||
p_fmt = is_usb ? MT_TX_TYPE_SF : MT_TX_TYPE_CT;
|
||||
}
|
||||
|
||||
val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + sz_txd) |
|
||||
|
@ -146,7 +146,7 @@ int mt7615_mmio_probe(struct device *pdev, void __iomem *mem_base,
|
||||
static const struct mt76_driver_ops drv_ops = {
|
||||
/* txwi_size = txd size + txp size */
|
||||
.txwi_size = MT_TXD_SIZE + sizeof(struct mt7615_txp_common),
|
||||
.drv_flags = MT_DRV_TXWI_NO_FREE,
|
||||
.drv_flags = MT_DRV_TXWI_NO_FREE | MT_DRV_HW_MGMT_TXQ,
|
||||
.survey_flags = SURVEY_INFO_TIME_TX |
|
||||
SURVEY_INFO_TIME_RX |
|
||||
SURVEY_INFO_TIME_BSS_RX,
|
||||
|
@ -270,7 +270,7 @@ static int mt7663u_probe(struct usb_interface *usb_intf,
|
||||
{
|
||||
static const struct mt76_driver_ops drv_ops = {
|
||||
.txwi_size = MT_USB_TXD_SIZE,
|
||||
.drv_flags = MT_DRV_RX_DMA_HDR,
|
||||
.drv_flags = MT_DRV_RX_DMA_HDR | MT_DRV_HW_MGMT_TXQ,
|
||||
.tx_prepare_skb = mt7663u_tx_prepare_skb,
|
||||
.tx_complete_skb = mt7663u_tx_complete_skb,
|
||||
.tx_status_data = mt7663u_tx_status_data,
|
||||
|
@ -264,6 +264,13 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
|
||||
skb_set_queue_mapping(skb, qid);
|
||||
}
|
||||
|
||||
if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) &&
|
||||
!ieee80211_is_data(hdr->frame_control) &&
|
||||
!ieee80211_is_bufferable_mmpdu(hdr->frame_control)) {
|
||||
qid = MT_TXQ_PSD;
|
||||
skb_set_queue_mapping(skb, qid);
|
||||
}
|
||||
|
||||
if (!(wcid->tx_info & MT_WCID_TX_INFO_SET))
|
||||
ieee80211_get_tx_rates(info->control.vif, sta, skb,
|
||||
info->control.rates, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user