10000 wifi: ath9k: Add PTP patch from wifi-ptp project by 6by9 · Pull Request #6882 · raspberrypi/linux · GitHub
[go: up one dir, main page]

Skip to content

wifi: ath9k: Add PTP patch from wifi-ptp project #6882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: rpi-6.12.y
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wireless: ath9k: Fix up PTP patches based on updated understanding
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 committed Jun 12, 2025
commit 8b8afcd251e0bb5f3b8c96a7b81c4f04527aea72
18 changes: 2 additions & 16 deletions drivers/net/wireless/ath/ath9k/ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,15 @@
#include <linux/ptp_clock_kernel.h>

static int ath9k_phc_adjfine(struct ptp_clock_info *ptp, long scaled_ppm) {
#if 0
struct ath_softc *sc = container_of(ptp, struct ath_softc, ptp_clock_info);
unsigned long flags;
int neg_adj = 0;
u32 mult, diff;
u64 adj;

if (scaled_ppm < 0) {
neg_adj = -1;
scaled_ppm = -scaled_ppm;
}
mult = sc->cc_mult;
adj = mult;
adj *= scaled_ppm;
diff = div_u64(adj, 1000000000ULL);

spin_lock_irqsave(&sc->systim_lock, flags);
timecounter_read(&sc->tc);
sc->cc.mult = neg_adj ? mult - diff : mult + diff;
sc->cc.mult = adjust_by_scaled_ppm(sc->cc_mult, scaled_ppm);
spin_unlock_irqrestore(&sc->systim_lock, flags);

ath_warn(ath9k_hw_common(sc->sc_ah), "phc adjust adj=%llu freq=%u\n", adj, diff);
#endif
ath_dbg(ath9k_hw_common(sc->sc_ah), CONFIG, "phc adjust scaled_ppm=%ld\n", scaled_ppm);

return 0;
}
Expand Down
Loading
0