Commit 7f883143 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau
Browse files

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: cdad4874 ("mt76: mt7615: add dma and tx queue initialization for MT7622")
Fixes: f40ac0f3 ("mt76: mt7615: introduce mt7663e support")
Suggested-by: default avatarFelix Fietkau <nbd@nbd.name>
Tested-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarLorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent a07292ee
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -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 {
+7 −13
Original line number Diff line number Diff line
@@ -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)) {
		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;
	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 {
		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;
		q_idx = wmm_idx * MT7615_MAX_WMM_SETS +
			mt7615_lmac_mapping(dev, skb_get_queue_mapping(skb));
	}

	val = FIELD_PREP(MT_TXD0_TX_BYTES, skb->len + sz_txd) |
+1 −1
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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,
Loading