Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

mt76: move mt76x2_wait_for_bbp in mt76x02-lib module



Move mt76x2_wait_for_bbp utility routine in mt76x02_util.h
in order to be resued by mt76x0 driver. Morover rename it in
mt76x02_wait_for_txrx_idle

Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 13fd2d2a
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -66,4 +66,12 @@ static inline void mt76x02_irq_disable(struct mt76_dev *dev, u32 mask)
	mt76x02_set_irq_mask(dev, mask, 0);
}

static inline bool
mt76x02_wait_for_txrx_idle(struct mt76_dev *dev)
{
	return __mt76_poll_msec(dev, MT_MAC_STATUS,
				MT_MAC_STATUS_TX | MT_MAC_STATUS_RX,
				0, 100);
}

#endif
+0 −7
Original line number Diff line number Diff line
@@ -124,13 +124,6 @@ static inline bool mt76x2_channel_silent(struct mt76x2_dev *dev)
		chan->dfs_state != NL80211_DFS_AVAILABLE);
}

static inline bool mt76x2_wait_for_bbp(struct mt76x2_dev *dev)
{
	return mt76_poll_msec(dev, MT_MAC_STATUS,
			      MT_MAC_STATUS_TX | MT_MAC_STATUS_RX,
			      0, 100);
}

extern const struct ieee80211_ops mt76x2_ops;

struct mt76x2_dev *mt76x2_alloc_device(struct device *pdev);
+1 −1
Original line number Diff line number Diff line
@@ -209,7 +209,7 @@ int mt76x2u_init_hardware(struct mt76x2_dev *dev)

	mt76x2u_init_beacon_offsets(dev);

	if (!mt76x2_wait_for_bbp(dev))
	if (!mt76x02_wait_for_txrx_idle(&dev->mt76))
		return -ETIMEDOUT;

	/* reset wcid table */