Lines Matching full:txc

200 static inline void pps_fill_timex(struct ntp_data *ntpdata, struct __kernel_timex *txc)  in pps_fill_timex()  argument
202 txc->ppsfreq = shift_right((ntpdata->pps_freq >> PPM_SCALE_INV_SHIFT) * in pps_fill_timex()
204 txc->jitter = ntpdata->pps_jitter; in pps_fill_timex()
206 txc->jitter = ntpdata->pps_jitter / NSEC_PER_USEC; in pps_fill_timex()
207 txc->shift = ntpdata->pps_shift; in pps_fill_timex()
208 txc->stabil = ntpdata->pps_stabil; in pps_fill_timex()
209 txc->jitcnt = ntpdata->pps_jitcnt; in pps_fill_timex()
210 txc->calcnt = ntpdata->pps_calcnt; in pps_fill_timex()
211 txc->errcnt = ntpdata->pps_errcnt; in pps_fill_timex()
212 txc->stbcnt = ntpdata->pps_stbcnt; in pps_fill_timex()
232 static inline void pps_fill_timex(struct ntp_data *ntpdata, struct __kernel_timex *txc) in pps_fill_timex() argument
235 txc->ppsfreq = 0; in pps_fill_timex()
236 txc->jitter = 0; in pps_fill_timex()
237 txc->shift = 0; in pps_fill_timex()
238 txc->stabil = 0; in pps_fill_timex()
239 txc->jitcnt = 0; in pps_fill_timex()
240 txc->calcnt = 0; in pps_fill_timex()
241 txc->errcnt = 0; in pps_fill_timex()
242 txc->stbcnt = 0; in pps_fill_timex()
696 * Propagate a new txc->status value into the NTP state:
698 static inline void process_adj_status(struct ntp_data *ntpdata, const struct __kernel_timex *txc) in process_adj_status() argument
700 if ((ntpdata->time_status & STA_PLL) && !(txc->status & STA_PLL)) { in process_adj_status()
712 if (!(ntpdata->time_status & STA_PLL) && (txc->status & STA_PLL)) in process_adj_status()
717 ntpdata->time_status |= txc->status & ~STA_RONLY; in process_adj_status()
720 …atic inline void process_adjtimex_modes(struct ntp_data *ntpdata, const struct __kernel_timex *txc, in process_adjtimex_modes() argument
723 if (txc->modes & ADJ_STATUS) in process_adjtimex_modes()
724 process_adj_status(ntpdata, txc); in process_adjtimex_modes()
726 if (txc->modes & ADJ_NANO) in process_adjtimex_modes()
729 if (txc->modes & ADJ_MICRO) in process_adjtimex_modes()
732 if (txc->modes & ADJ_FREQUENCY) { in process_adjtimex_modes()
733 ntpdata->time_freq = txc->freq * PPM_SCALE; in process_adjtimex_modes()
740 if (txc->modes & ADJ_MAXERROR) in process_adjtimex_modes()
741 ntpdata->time_maxerror = clamp(txc->maxerror, 0, NTP_PHASE_LIMIT); in process_adjtimex_modes()
743 if (txc->modes & ADJ_ESTERROR) in process_adjtimex_modes()
744 ntpdata->time_esterror = clamp(txc->esterror, 0, NTP_PHASE_LIMIT); in process_adjtimex_modes()
746 if (txc->modes & ADJ_TIMECONST) { in process_adjtimex_modes()
747 ntpdata->time_constant = clamp(txc->constant, 0, MAXTC); in process_adjtimex_modes()
753 if (txc->modes & ADJ_TAI && txc->constant >= 0 && txc->constant <= MAX_TAI_OFFSET) in process_adjtimex_modes()
754 *time_tai = txc->constant; in process_adjtimex_modes()
756 if (txc->modes & ADJ_OFFSET) in process_adjtimex_modes()
757 ntp_update_offset(ntpdata, txc->offset); in process_adjtimex_modes()
759 if (txc->modes & ADJ_TICK) in process_adjtimex_modes()
760 ntpdata->tick_usec = txc->tick; in process_adjtimex_modes()
762 if (txc->modes & (ADJ_TICK|ADJ_FREQUENCY|ADJ_OFFSET)) in process_adjtimex_modes()
770 int ntp_adjtimex(unsigned int tkid, struct __kernel_timex *txc, const struct timespec64 *ts, in ntp_adjtimex() argument
776 if (txc->modes & ADJ_ADJTIME) { in ntp_adjtimex()
779 if (!(txc->modes & ADJ_OFFSET_READONLY)) { in ntp_adjtimex()
781 ntpdata->time_adjust = txc->offset; in ntp_adjtimex()
787 txc->offset = save_adjust; in ntp_adjtimex()
790 if (txc->modes) { in ntp_adjtimex()
797 process_adjtimex_modes(ntpdata, txc, time_tai); in ntp_adjtimex()
806 txc->offset = shift_right(ntpdata->time_offset * NTP_INTERVAL_FREQ, NTP_SCALE_SHIFT); in ntp_adjtimex()
808 txc->offset = div_s64(txc->offset, NSEC_PER_USEC); in ntp_adjtimex()
815 txc->freq = shift_right((ntpdata->time_freq >> PPM_SCALE_INV_SHIFT) * in ntp_adjtimex()
817 txc->maxerror = ntpdata->time_maxerror; in ntp_adjtimex()
818 txc->esterror = ntpdata->time_esterror; in ntp_adjtimex()
819 txc->status = ntpdata->time_status; in ntp_adjtimex()
820 txc->constant = ntpdata->time_constant; in ntp_adjtimex()
821 txc->precision = 1; in ntp_adjtimex()
822 txc->tolerance = MAXFREQ_SCALED / PPM_SCALE; in ntp_adjtimex()
823 txc->tick = ntpdata->tick_usec; in ntp_adjtimex()
824 txc->tai = *time_tai; in ntp_adjtimex()
827 pps_fill_timex(ntpdata, txc); in ntp_adjtimex()
829 txc->time.tv_sec = ts->tv_sec; in ntp_adjtimex()
830 txc->time.tv_usec = ts->tv_nsec; in ntp_adjtimex()
832 txc->time.tv_usec = ts->tv_nsec / NSEC_PER_USEC; in ntp_adjtimex()
838 txc->tai++; in ntp_adjtimex()
839 txc->time.tv_sec--; in ntp_adjtimex()
843 txc->tai--; in ntp_adjtimex()
844 txc->time.tv_sec++; in ntp_adjtimex()