Lines Matching refs:txc
193 static inline void pps_fill_timex(struct __kernel_timex *txc) in pps_fill_timex() argument
195 txc->ppsfreq = shift_right((pps_freq >> PPM_SCALE_INV_SHIFT) * in pps_fill_timex()
197 txc->jitter = pps_jitter; in pps_fill_timex()
199 txc->jitter = pps_jitter / NSEC_PER_USEC; in pps_fill_timex()
200 txc->shift = pps_shift; in pps_fill_timex()
201 txc->stabil = pps_stabil; in pps_fill_timex()
202 txc->jitcnt = pps_jitcnt; in pps_fill_timex()
203 txc->calcnt = pps_calcnt; in pps_fill_timex()
204 txc->errcnt = pps_errcnt; in pps_fill_timex()
205 txc->stbcnt = pps_stbcnt; in pps_fill_timex()
225 static inline void pps_fill_timex(struct __kernel_timex *txc) in pps_fill_timex() argument
228 txc->ppsfreq = 0; in pps_fill_timex()
229 txc->jitter = 0; in pps_fill_timex()
230 txc->shift = 0; in pps_fill_timex()
231 txc->stabil = 0; in pps_fill_timex()
232 txc->jitcnt = 0; in pps_fill_timex()
233 txc->calcnt = 0; in pps_fill_timex()
234 txc->errcnt = 0; in pps_fill_timex()
235 txc->stbcnt = 0; in pps_fill_timex()
686 static inline void process_adj_status(const struct __kernel_timex *txc) in process_adj_status() argument
688 if ((time_status & STA_PLL) && !(txc->status & STA_PLL)) { in process_adj_status()
700 if (!(time_status & STA_PLL) && (txc->status & STA_PLL)) in process_adj_status()
705 time_status |= txc->status & ~STA_RONLY; in process_adj_status()
709 static inline void process_adjtimex_modes(const struct __kernel_timex *txc, in process_adjtimex_modes() argument
712 if (txc->modes & ADJ_STATUS) in process_adjtimex_modes()
713 process_adj_status(txc); in process_adjtimex_modes()
715 if (txc->modes & ADJ_NANO) in process_adjtimex_modes()
718 if (txc->modes & ADJ_MICRO) in process_adjtimex_modes()
721 if (txc->modes & ADJ_FREQUENCY) { in process_adjtimex_modes()
722 time_freq = txc->freq * PPM_SCALE; in process_adjtimex_modes()
729 if (txc->modes & ADJ_MAXERROR) in process_adjtimex_modes()
730 time_maxerror = txc->maxerror; in process_adjtimex_modes()
732 if (txc->modes & ADJ_ESTERROR) in process_adjtimex_modes()
733 time_esterror = txc->esterror; in process_adjtimex_modes()
735 if (txc->modes & ADJ_TIMECONST) { in process_adjtimex_modes()
736 time_constant = txc->constant; in process_adjtimex_modes()
743 if (txc->modes & ADJ_TAI && in process_adjtimex_modes()
744 txc->constant >= 0 && txc->constant <= MAX_TAI_OFFSET) in process_adjtimex_modes()
745 *time_tai = txc->constant; in process_adjtimex_modes()
747 if (txc->modes & ADJ_OFFSET) in process_adjtimex_modes()
748 ntp_update_offset(txc->offset); in process_adjtimex_modes()
750 if (txc->modes & ADJ_TICK) in process_adjtimex_modes()
751 tick_usec = txc->tick; in process_adjtimex_modes()
753 if (txc->modes & (ADJ_TICK|ADJ_FREQUENCY|ADJ_OFFSET)) in process_adjtimex_modes()
762 int __do_adjtimex(struct __kernel_timex *txc, const struct timespec64 *ts, in __do_adjtimex() argument
767 if (txc->modes & ADJ_ADJTIME) { in __do_adjtimex()
770 if (!(txc->modes & ADJ_OFFSET_READONLY)) { in __do_adjtimex()
772 time_adjust = txc->offset; in __do_adjtimex()
778 txc->offset = save_adjust; in __do_adjtimex()
781 if (txc->modes) { in __do_adjtimex()
788 process_adjtimex_modes(txc, time_tai); in __do_adjtimex()
797 txc->offset = shift_right(time_offset * NTP_INTERVAL_FREQ, in __do_adjtimex()
800 txc->offset = (u32)txc->offset / NSEC_PER_USEC; in __do_adjtimex()
808 txc->freq = shift_right((time_freq >> PPM_SCALE_INV_SHIFT) * in __do_adjtimex()
810 txc->maxerror = time_maxerror; in __do_adjtimex()
811 txc->esterror = time_esterror; in __do_adjtimex()
812 txc->status = time_status; in __do_adjtimex()
813 txc->constant = time_constant; in __do_adjtimex()
814 txc->precision = 1; in __do_adjtimex()
815 txc->tolerance = MAXFREQ_SCALED / PPM_SCALE; in __do_adjtimex()
816 txc->tick = tick_usec; in __do_adjtimex()
817 txc->tai = *time_tai; in __do_adjtimex()
820 pps_fill_timex(txc); in __do_adjtimex()
822 txc->time.tv_sec = ts->tv_sec; in __do_adjtimex()
823 txc->time.tv_usec = ts->tv_nsec; in __do_adjtimex()
825 txc->time.tv_usec = ts->tv_nsec / NSEC_PER_USEC; in __do_adjtimex()
831 txc->tai++; in __do_adjtimex()
832 txc->time.tv_sec--; in __do_adjtimex()
836 txc->tai--; in __do_adjtimex()
837 txc->time.tv_sec++; in __do_adjtimex()