Lines Matching refs:nsec

153 static u64 mlxsw_sp1_ptp_ns2cycles(const struct timecounter *tc, u64 nsec)
155 u64 cycles = (u64) nsec;
164 mlxsw_sp1_ptp_phc_settime(struct mlxsw_sp1_ptp_clock *clock, u64 nsec)
172 next_sec = div_u64(nsec, NSEC_PER_SEC) + 1;
209 u64 nsec;
213 nsec = timecounter_read(&clock->tc);
216 return mlxsw_sp1_ptp_phc_settime(clock, nsec);
224 u64 cycles, nsec;
228 nsec = timecounter_cyc2time(&clock->tc, cycles);
231 *ts = ns_to_timespec64(nsec);
240 u64 nsec = timespec64_to_ns(ts);
243 timecounter_init(&clock->tc, &clock->cycles, nsec);
244 nsec = timecounter_read(&clock->tc);
247 return mlxsw_sp1_ptp_phc_settime(clock, nsec);
276 u64 overflow_cycles, nsec, frac = 0;
305 nsec = cyclecounter_cyc2ns(&clock->cycles, overflow_cycles, 0, &frac);
306 clock->overflow_period = nsecs_to_jiffies(nsec);
360 mlxsw_sp2_ptp_phc_settime(struct mlxsw_sp_ptp_clock *clock, u64 nsec)
366 sec = div_u64_rem(nsec, NSEC_PER_SEC, &nsec_rem);
395 u64 nsec;
397 nsec = mlxsw_sp2_ptp_read_utc(clock, NULL);
398 nsec += delta;
400 return mlxsw_sp2_ptp_phc_settime(clock, nsec);
415 u64 nsec;
417 nsec = mlxsw_sp2_ptp_read_utc(clock, sts);
418 *ts = ns_to_timespec64(nsec);
428 u64 nsec = timespec64_to_ns(ts);
430 return mlxsw_sp2_ptp_phc_settime(clock, nsec);
621 u64 nsec;
624 nsec = timecounter_cyc2time(&clock->tc, timestamp);
627 hwtstamps.hwtstamp = ns_to_ktime(nsec);
1412 u64 ts_sec, ts_nsec, nsec;
1414 WARN_ON_ONCE(!cb->cqe_ts.sec && !cb->cqe_ts.nsec);
1424 ts_nsec = cb->cqe_ts.nsec;
1426 nsec = ts_sec * NSEC_PER_SEC + ts_nsec;
1428 hwtstamps->hwtstamp = ns_to_ktime(nsec);