Commit 5300e5e2 authored by Johannes Berg's avatar Johannes Berg
Browse files

Merge tag 'mt76-fixes-2025-07-07' of https://github.com/nbd168/wireless



Felix Fietkau says:
===================
mt76 fixes for 6.16
===================

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parents 737bb912 eb8352ee
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1224,6 +1224,16 @@ static inline int mt76_wed_dma_setup(struct mt76_dev *dev, struct mt76_queue *q,
#define mt76_dereference(p, dev) \
	rcu_dereference_protected(p, lockdep_is_held(&(dev)->mutex))

static inline struct mt76_wcid *
__mt76_wcid_ptr(struct mt76_dev *dev, u16 idx)
{
	if (idx >= ARRAY_SIZE(dev->wcid))
		return NULL;
	return rcu_dereference(dev->wcid[idx]);
}

#define mt76_wcid_ptr(dev, idx) __mt76_wcid_ptr(&(dev)->mt76, idx)

struct mt76_dev *mt76_alloc_device(struct device *pdev, unsigned int size,
				   const struct ieee80211_ops *ops,
				   const struct mt76_driver_ops *drv_ops);
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ mt7603_rx_loopback_skb(struct mt7603_dev *dev, struct sk_buff *skb)
	if (idx >= MT7603_WTBL_STA - 1)
		goto free;

	wcid = rcu_dereference(dev->mt76.wcid[idx]);
	wcid = mt76_wcid_ptr(dev, idx);
	if (!wcid)
		goto free;

+2 −8
Original line number Diff line number Diff line
@@ -487,10 +487,7 @@ mt7603_rx_get_wcid(struct mt7603_dev *dev, u8 idx, bool unicast)
	struct mt7603_sta *sta;
	struct mt76_wcid *wcid;

	if (idx >= MT7603_WTBL_SIZE)
		return NULL;

	wcid = rcu_dereference(dev->mt76.wcid[idx]);
	wcid = mt76_wcid_ptr(dev, idx);
	if (unicast || !wcid)
		return wcid;

@@ -1266,12 +1263,9 @@ void mt7603_mac_add_txs(struct mt7603_dev *dev, void *data)
	if (pid == MT_PACKET_ID_NO_ACK)
		return;

	if (wcidx >= MT7603_WTBL_SIZE)
		return;

	rcu_read_lock();

	wcid = rcu_dereference(dev->mt76.wcid[wcidx]);
	wcid = mt76_wcid_ptr(dev, wcidx);
	if (!wcid)
		goto out;

+2 −5
Original line number Diff line number Diff line
@@ -90,10 +90,7 @@ static struct mt76_wcid *mt7615_rx_get_wcid(struct mt7615_dev *dev,
	struct mt7615_sta *sta;
	struct mt76_wcid *wcid;

	if (idx >= MT7615_WTBL_SIZE)
		return NULL;

	wcid = rcu_dereference(dev->mt76.wcid[idx]);
	wcid = mt76_wcid_ptr(dev, idx);
	if (unicast || !wcid)
		return wcid;

@@ -1504,7 +1501,7 @@ static void mt7615_mac_add_txs(struct mt7615_dev *dev, void *data)

	rcu_read_lock();

	wcid = rcu_dereference(dev->mt76.wcid[wcidx]);
	wcid = mt76_wcid_ptr(dev, wcidx);
	if (!wcid)
		goto out;

+1 −1
Original line number Diff line number Diff line
@@ -1172,7 +1172,7 @@ void mt76_connac2_txwi_free(struct mt76_dev *dev, struct mt76_txwi_cache *t,
		wcid_idx = wcid->idx;
	} else {
		wcid_idx = le32_get_bits(txwi[1], MT_TXD1_WLAN_IDX);
		wcid = rcu_dereference(dev->wcid[wcid_idx]);
		wcid = __mt76_wcid_ptr(dev, wcid_idx);

		if (wcid && wcid->sta) {
			sta = container_of((void *)wcid, struct ieee80211_sta,
Loading