mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 07:51:16 -04:00
mt76: mt7615: report TSF information
This adds a get_tsf() callback for ibss. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
@@ -633,6 +633,26 @@ mt7615_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
IEEE80211_STA_NOTEXIST);
|
||||
}
|
||||
|
||||
static u64
|
||||
mt7615_get_tsf(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
||||
{
|
||||
struct mt7615_dev *dev = mt7615_hw_dev(hw);
|
||||
union {
|
||||
u64 t64;
|
||||
u32 t32[2];
|
||||
} tsf;
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
mt76_set(dev, MT_LPON_T0CR, MT_LPON_T0CR_MODE); /* TSF read */
|
||||
tsf.t32[0] = mt76_rr(dev, MT_LPON_UTTR0);
|
||||
tsf.t32[1] = mt76_rr(dev, MT_LPON_UTTR1);
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
return tsf.t64;
|
||||
}
|
||||
|
||||
static void
|
||||
mt7615_set_coverage_class(struct ieee80211_hw *hw, s16 coverage_class)
|
||||
{
|
||||
@@ -690,6 +710,7 @@ const struct ieee80211_ops mt7615_ops = {
|
||||
.release_buffered_frames = mt76_release_buffered_frames,
|
||||
.get_txpower = mt76_get_txpower,
|
||||
.channel_switch_beacon = mt7615_channel_switch_beacon,
|
||||
.get_tsf = mt7615_get_tsf,
|
||||
.get_survey = mt76_get_survey,
|
||||
.get_antenna = mt76_get_antenna,
|
||||
.set_antenna = mt7615_set_antenna,
|
||||
|
||||
Reference in New Issue
Block a user