Commit 6247c3b0 authored by Kalle Valo's avatar Kalle Valo
Browse files

Merge tag 'mt76-for-kvalo-2020-06-07' of https://github.com/nbd168/wireless

mt76 patches for 5.8

* tx queueing fixes for mt7615/22/63
* locking fix

# gpg: Signature made Sun 07 Jun 2020 06:17:47 PM EEST using DSA key ID 02A76EF5
# gpg: Good signature from "Felix Fietkau <nbd@nbd.name>"
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 75D1 1A7D 91A7 710F 4900  42EF D77D 141D 02A7 6EF5
parents ea0cca61 7f883143
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;
+2 −0
Original line number Diff line number Diff line
@@ -642,8 +642,10 @@ mt7603_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
{
	struct mt7603_dev *dev = hw->priv;

	mutex_lock(&dev->mt76.mutex);
	dev->coverage_class = max_t(s16, coverage_class, 0);
	mt7603_mac_set_timing(dev);
	mutex_unlock(&dev->mt76.mutex);
}

static void mt7603_tx(struct ieee80211_hw *hw,
+5 −4
Original line number Diff line number Diff line
@@ -234,10 +234,11 @@ mt7615_queues_acq(struct seq_file *s, void *data)
	int i;

	for (i = 0; i < 16; i++) {
		int j, acs = i / 4, index = i % 4;
		int j, wmm_idx = i % MT7615_MAX_WMM_SETS;
		int acs = i / MT7615_MAX_WMM_SETS;
		u32 ctrl, val, qlen = 0;

		val = mt76_rr(dev, MT_PLE_AC_QEMPTY(acs, index));
		val = mt76_rr(dev, MT_PLE_AC_QEMPTY(acs, wmm_idx));
		ctrl = BIT(31) | BIT(15) | (acs << 8);

		for (j = 0; j < 32; j++) {
@@ -245,11 +246,11 @@ mt7615_queues_acq(struct seq_file *s, void *data)
				continue;

			mt76_wr(dev, MT_PLE_FL_Q0_CTRL,
				ctrl | (j + (index << 5)));
				ctrl | (j + (wmm_idx << 5)));
			qlen += mt76_get_field(dev, MT_PLE_FL_Q3_CTRL,
					       GENMASK(11, 0));
		}
		seq_printf(s, "AC%d%d: queued=%d\n", acs, index, qlen);
		seq_printf(s, "AC%d%d: queued=%d\n", wmm_idx, acs, qlen);
	}

	return 0;
+5 −4
Original line number Diff line number Diff line
@@ -36,10 +36,10 @@ static int
mt7622_init_tx_queues_multi(struct mt7615_dev *dev)
{
	static const u8 wmm_queue_map[] = {
		MT7622_TXQ_AC0,
		MT7622_TXQ_AC1,
		MT7622_TXQ_AC2,
		MT7622_TXQ_AC3,
		[IEEE80211_AC_BK] = MT7622_TXQ_AC0,
		[IEEE80211_AC_BE] = MT7622_TXQ_AC1,
		[IEEE80211_AC_VI] = MT7622_TXQ_AC2,
		[IEEE80211_AC_VO] = MT7622_TXQ_AC3,
	};
	int ret;
	int i;
@@ -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 +
			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) |
Loading