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

Commit 02edab5b authored by Janusz Dziedzic's avatar Janusz Dziedzic Committed by Kalle Valo
Browse files

ath9k: MCC, print time elapsed between events



This is useful for MCC debugging and bug fixing.

Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent a64d876e
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -981,6 +981,7 @@ struct ath_softc {
	struct ath_offchannel offchannel;
	struct ath_offchannel offchannel;
	struct ath_chanctx *next_chan;
	struct ath_chanctx *next_chan;
	struct completion go_beacon;
	struct completion go_beacon;
	struct timespec last_event_time;
#endif
#endif


	unsigned long driver_data;
	unsigned long driver_data;
+17 −2
Original line number Original line Diff line number Diff line
@@ -226,6 +226,20 @@ static const char *chanctx_state_string(enum ath_chanctx_state state)
	}
	}
}
}


static const u32 chanctx_event_delta(struct ath_softc *sc)
{
	u64 ms;
	struct timespec ts, *old;

	getrawmonotonic(&ts);
	old = &sc->last_event_time;
	ms = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
	ms -= old->tv_sec * 1000 + old->tv_nsec / 1000000;
	sc->last_event_time = ts;

	return (u32)ms;
}

void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
{
{
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
	struct ath_common *common = ath9k_hw_common(sc->sc_ah);
@@ -489,10 +503,11 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,


	spin_lock_bh(&sc->chan_lock);
	spin_lock_bh(&sc->chan_lock);


	ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s\n",
	ath_dbg(common, CHAN_CTX, "cur_chan: %d MHz, event: %s, state: %s, delta: %u ms\n",
		sc->cur_chan->chandef.center_freq1,
		sc->cur_chan->chandef.center_freq1,
		chanctx_event_string(ev),
		chanctx_event_string(ev),
		chanctx_state_string(sc->sched.state));
		chanctx_state_string(sc->sched.state),
		chanctx_event_delta(sc));


	switch (ev) {
	switch (ev) {
	case ATH_CHANCTX_EVENT_BEACON_PREPARE:
	case ATH_CHANCTX_EVENT_BEACON_PREPARE: