Lines Matching full:peer
314 static int jjy_start (int, struct peer *);
315 static int jjy_start_tristate_jjy01 (int, struct peer *, struct jjyunit *);
316 static int jjy_start_cdex_jst2000 (int, struct peer *, struct jjyunit *);
317 static int jjy_start_echokeisokuki_lt2000 (int, struct peer *, struct jjyunit *);
318 static int jjy_start_citizentic_jjy200 (int, struct peer *, struct jjyunit *);
319 static int jjy_start_tristate_gpsclock01 (int, struct peer *, struct jjyunit *);
320 static int jjy_start_seiko_tsys_tdc_300 (int, struct peer *, struct jjyunit *);
321 static int jjy_start_telephone (int, struct peer *, struct jjyunit *);
323 static void jjy_shutdown (int, struct peer *);
325 static void jjy_poll (int, struct peer *);
326 static void jjy_poll_tristate_jjy01 (int, struct peer *);
327 static void jjy_poll_cdex_jst2000 (int, struct peer *);
328 static void jjy_poll_echokeisokuki_lt2000 (int, struct peer *);
329 static void jjy_poll_citizentic_jjy200 (int, struct peer *);
330 static void jjy_poll_tristate_gpsclock01 (int, struct peer *);
331 static void jjy_poll_seiko_tsys_tdc_300 (int, struct peer *);
332 static void jjy_poll_telephone (int, struct peer *);
343 static void jjy_timer (int, struct peer *);
344 static void jjy_timer_telephone (int, struct peer *);
346 static void jjy_synctime ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
347 static void jjy_write_clockstats ( struct peer *, int, const char* ) ;
355 static void modem_connect ( int, struct peer * ) ;
356 static void modem_disconnect ( int, struct peer * ) ;
358 static void modem_timer ( int, struct peer * );
450 jjy_start ( int unit, struct peer *peer ) in jjy_start() argument
462 ntoa(&peer->srcadr), peer->ttl, DEVICE, unit ) ; in jjy_start()
487 snprintf( sLog, sizeof(sLog), "mode=%d dev=%s", peer->ttl, sDeviceName ) ; in jjy_start()
488 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ; in jjy_start()
491 * peer->ttl is a mode number specified by "127.127.40.X mode N" in the ntp.conf in jjy_start()
493 switch ( peer->ttl ) { in jjy_start()
496 rc = jjy_start_tristate_jjy01 ( unit, peer, up ) ; in jjy_start()
499 rc = jjy_start_cdex_jst2000 ( unit, peer, up ) ; in jjy_start()
502 rc = jjy_start_echokeisokuki_lt2000 ( unit, peer, up ) ; in jjy_start()
505 rc = jjy_start_citizentic_jjy200 ( unit, peer, up ) ; in jjy_start()
508 rc = jjy_start_tristate_gpsclock01 ( unit, peer, up ) ; in jjy_start()
511 rc = jjy_start_seiko_tsys_tdc_300 ( unit, peer, up ) ; in jjy_start()
514 rc = jjy_start_telephone ( unit, peer, up ) ; in jjy_start()
517 if ( 101 <= peer->ttl && peer->ttl <= 180 ) { in jjy_start()
518 rc = jjy_start_telephone ( unit, peer, up ) ; in jjy_start()
521 ntoa(&peer->srcadr), peer->ttl ) ; in jjy_start()
529 ntoa(&peer->srcadr), peer->ttl ) ; in jjy_start()
535 fd = refclock_open ( &peer->srcadr, sDeviceName, up->linespeed, up->linediscipline ) ; in jjy_start()
544 pp = peer->procptr ; in jjy_start()
549 pp->io.srcclock = peer ; in jjy_start()
561 peer->precision = PRECISION ; in jjy_start()
563 snprintf( sLog, sizeof(sLog), "minpoll=%d maxpoll=%d", peer->minpoll, peer->maxpoll ) ; in jjy_start()
564 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ; in jjy_start()
574 jjy_shutdown ( int unit, struct peer *peer ) in jjy_shutdown() argument
582 pp = peer->procptr ; in jjy_shutdown()
591 snprintf( sLog, sizeof(sLog), "JJY stopped. unit=%d mode=%d", unit, peer->ttl ) ; in jjy_shutdown()
592 record_clock_stats( &peer->srcadr, sLog ) ; in jjy_shutdown()
608 struct peer *peer; in jjy_receive() local
619 peer = rbufp->recv_peer ; in jjy_receive()
620 pp = peer->procptr ; in jjy_receive()
767 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_RECEIVE, sLogText ) ; in jjy_receive()
895 jjy_poll ( int unit, struct peer *peer ) in jjy_poll() argument
903 pp = peer->procptr; in jjy_poll()
907 …jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, "Ignore polling because of error during ini… in jjy_poll()
915 refclock_report ( peer, CEVNT_TIMEOUT ) ; in jjy_poll()
920 sReach[0] = peer->reach & 0x80 ? '1' : '0' ; in jjy_poll()
921 sReach[1] = peer->reach & 0x40 ? '1' : '0' ; in jjy_poll()
922 sReach[2] = peer->reach & 0x20 ? '1' : '0' ; in jjy_poll()
923 sReach[3] = peer->reach & 0x10 ? '1' : '0' ; in jjy_poll()
924 sReach[4] = peer->reach & 0x08 ? '1' : '0' ; in jjy_poll()
925 sReach[5] = peer->reach & 0x04 ? '1' : '0' ; in jjy_poll()
926 sReach[6] = peer->reach & 0x02 ? '1' : '0' ; in jjy_poll()
931 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ATTENTION, sLog ) ; in jjy_poll()
943 jjy_poll_tristate_jjy01 ( unit, peer ) ; in jjy_poll()
947 jjy_poll_cdex_jst2000 ( unit, peer ) ; in jjy_poll()
951 jjy_poll_echokeisokuki_lt2000 ( unit, peer ) ; in jjy_poll()
955 jjy_poll_citizentic_jjy200 ( unit, peer ) ; in jjy_poll()
959 jjy_poll_tristate_gpsclock01 ( unit, peer ) ; in jjy_poll()
963 jjy_poll_seiko_tsys_tdc_300 ( unit, peer ) ; in jjy_poll()
967 jjy_poll_telephone ( unit, peer ) ; in jjy_poll()
981 jjy_timer ( int unit, struct peer *peer ) in jjy_timer() argument
993 pp = peer->procptr ; in jjy_timer()
1008 jjy_timer_telephone ( unit, peer ) ; in jjy_timer()
1022 jjy_synctime ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in jjy_synctime() argument
1054 refclock_report( peer, CEVNT_BADTIME ) ; in jjy_synctime()
1060 refclock_receive( peer ) ; in jjy_synctime()
1071 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ATTENTION, sLog ) ; in jjy_synctime()
1076 switch ( peer->status ) { in jjy_synctime()
1083 case 6 : cStatus = '*' ; pStatus = "Sys.Peer" ; break ; in jjy_synctime()
1084 case 7 : cStatus = 'o' ; pStatus = "PPS.Peer" ; break ; in jjy_synctime()
1090 peer->status, cStatus, pStatus, peer->offset * 1000, peer->jitter * 1000 ) ; in jjy_synctime()
1091 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, sLog ) ; in jjy_synctime()
1157 jjy_start_tristate_jjy01 ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_tristate_jjy01() argument
1160 …jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: Tristate Ltd. TS-JJY01, TS-JJY02" … in jjy_start_tristate_jjy01()
1180 struct peer *peer; in jjy_receive_tristate_jjy01() local
1194 peer = rbufp->recv_peer ; in jjy_receive_tristate_jjy01()
1195 pp = peer->procptr ; in jjy_receive_tristate_jjy01()
1214 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1226 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1246 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1260 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1273 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1302 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1320 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1331 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1356 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, sLog ) ; in jjy_receive_tristate_jjy01()
1361 jjy_synctime( peer, pp, up ) ; in jjy_receive_tristate_jjy01()
1367 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, sLog ) ; in jjy_receive_tristate_jjy01()
1373 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_jjy01()
1394 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_receive_tristate_jjy01()
1397 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in jjy_receive_tristate_jjy01()
1406 jjy_poll_tristate_jjy01 ( int unit, struct peer *peer ) in jjy_poll_tristate_jjy01() argument
1418 pp = peer->procptr; in jjy_poll_tristate_jjy01()
1449 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_poll_tristate_jjy01()
1452 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in jjy_poll_tristate_jjy01()
1480 jjy_start_cdex_jst2000 ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_cdex_jst2000() argument
1483 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: C-DEX Co. Ltd. JST2000" ) ; in jjy_start_cdex_jst2000()
1506 struct peer *peer ; in jjy_receive_cdex_jst2000() local
1514 peer = rbufp->recv_peer ; in jjy_receive_cdex_jst2000()
1515 pp = peer->procptr ; in jjy_receive_cdex_jst2000()
1534 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_cdex_jst2000()
1551 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_cdex_jst2000()
1570 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_cdex_jst2000()
1578 jjy_synctime( peer, pp, up ) ; in jjy_receive_cdex_jst2000()
1587 jjy_poll_cdex_jst2000 ( int unit, struct peer *peer ) in jjy_poll_cdex_jst2000() argument
1593 pp = peer->procptr ; in jjy_poll_cdex_jst2000()
1608 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_poll_cdex_jst2000()
1611 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, "\0051J\003" ) ; in jjy_poll_cdex_jst2000()
1646 jjy_start_echokeisokuki_lt2000 ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_echokeisokuki_lt2000() argument
1649 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: Echo Keisokuki Co. Ltd. LT2000" ) ; in jjy_start_echokeisokuki_lt2000()
1669 struct peer *peer; in jjy_receive_echokeisokuki_lt2000() local
1678 peer = rbufp->recv_peer ; in jjy_receive_echokeisokuki_lt2000()
1679 pp = peer->procptr ; in jjy_receive_echokeisokuki_lt2000()
1703 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_echokeisokuki_lt2000()
1723 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_echokeisokuki_lt2000()
1749 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_echokeisokuki_lt2000()
1784 jjy_synctime( peer, pp, up ) ; in jjy_receive_echokeisokuki_lt2000()
1794 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_receive_echokeisokuki_lt2000()
1797 …jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, ECHOKEISOKUKI_LT2000_COMMAND_REQUEST_SEND ) ; in jjy_receive_echokeisokuki_lt2000()
1808 jjy_poll_echokeisokuki_lt2000 ( int unit, struct peer *peer ) in jjy_poll_echokeisokuki_lt2000() argument
1816 pp = peer->procptr ; in jjy_poll_echokeisokuki_lt2000()
1837 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_poll_echokeisokuki_lt2000()
1840 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, sCmd ) ; in jjy_poll_echokeisokuki_lt2000()
1861 jjy_start_citizentic_jjy200 ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_citizentic_jjy200() argument
1864 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: CITIZEN T.I.C CO. LTD. JJY200" ) ; in jjy_start_citizentic_jjy200()
1882 struct peer *peer; in jjy_receive_citizentic_jjy200() local
1892 peer = rbufp->recv_peer ; in jjy_receive_citizentic_jjy200()
1893 pp = peer->procptr ; in jjy_receive_citizentic_jjy200()
1921 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_citizentic_jjy200()
1945 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_citizentic_jjy200()
1954 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_WARNING, sLog ) ; in jjy_receive_citizentic_jjy200()
1961 jjy_synctime( peer, pp, up ) ; in jjy_receive_citizentic_jjy200()
1970 jjy_poll_citizentic_jjy200 ( int unit, struct peer *peer ) in jjy_poll_citizentic_jjy200() argument
1976 pp = peer->procptr ; in jjy_poll_citizentic_jjy200()
2042 jjy_start_tristate_gpsclock01 ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_tristate_gpsclock01() argument
2045 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: Tristate Ltd. TS-GPS01" ) ; in jjy_start_tristate_gpsclock01()
2066 struct peer *peer; in jjy_receive_tristate_gpsclock01() local
2078 peer = rbufp->recv_peer ; in jjy_receive_tristate_gpsclock01()
2079 pp = peer->procptr ; in jjy_receive_tristate_gpsclock01()
2135 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2146 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2165 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2178 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2191 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2214 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2225 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2237 jjy_synctime( peer, pp, up ) ; in jjy_receive_tristate_gpsclock01()
2243 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, sLog ) ; in jjy_receive_tristate_gpsclock01()
2249 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_tristate_gpsclock01()
2258 jjy_synctime( peer, pp, up ) ; in jjy_receive_tristate_gpsclock01()
2277 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_receive_tristate_gpsclock01()
2280 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in jjy_receive_tristate_gpsclock01()
2289 jjy_poll_tristate_gpsclock01 ( int unit, struct peer *peer ) in jjy_poll_tristate_gpsclock01() argument
2301 pp = peer->procptr ; in jjy_poll_tristate_gpsclock01()
2329 refclock_report ( peer, CEVNT_FAULT ) ; in jjy_poll_tristate_gpsclock01()
2332 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in jjy_poll_tristate_gpsclock01()
2363 jjy_start_seiko_tsys_tdc_300 ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_seiko_tsys_tdc_300() argument
2366 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: SEIKO TIME SYSTEMS TDC-300" ) ; in jjy_start_seiko_tsys_tdc_300()
2387 struct peer *peer; in jjy_receive_seiko_tsys_tdc_300() local
2399 peer = rbufp->recv_peer ; in jjy_receive_seiko_tsys_tdc_300()
2400 pp = peer->procptr ; in jjy_receive_seiko_tsys_tdc_300()
2442 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_seiko_tsys_tdc_300()
2476 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_seiko_tsys_tdc_300()
2497 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_seiko_tsys_tdc_300()
2510 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_seiko_tsys_tdc_300()
2521 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_seiko_tsys_tdc_300()
2532 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in jjy_receive_seiko_tsys_tdc_300()
2541 jjy_synctime( peer, pp, up ) ; in jjy_receive_seiko_tsys_tdc_300()
2550 jjy_poll_seiko_tsys_tdc_300 ( int unit, struct peer *peer ) in jjy_poll_seiko_tsys_tdc_300() argument
2556 pp = peer->procptr ; in jjy_poll_seiko_tsys_tdc_300()
2612 static void teljjy_control ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2614 static int teljjy_idle_ignore ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2615 static int teljjy_idle_dialout ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2616 static int teljjy_dial_ignore ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2617 static int teljjy_dial_login ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2618 static int teljjy_dial_disc ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2619 static int teljjy_login_ignore ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2620 static int teljjy_login_disc ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2621 static int teljjy_login_conn ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2622 static int teljjy_login_login ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2623 static int teljjy_login_silent ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2624 static int teljjy_login_error ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2625 static int teljjy_conn_ignore ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2626 static int teljjy_conn_disc ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2627 static int teljjy_conn_send ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2628 static int teljjy_conn_data ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2629 static int teljjy_conn_silent ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2630 static int teljjy_conn_error ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2631 static int teljjy_bye_ignore ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2632 static int teljjy_bye_disc ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2633 static int teljjy_bye_modem ( struct peer *peer, struct refclockproc *, struct jjyunit * ) ;
2635 static int ( *pTeljjyHandler [ ] [ 5 ] ) ( struct peer *, struct refclockproc *, struct jjyunit *) =
2737 jjy_start_telephone ( int unit, struct peer *peer, struct jjyunit *up ) in jjy_start_telephone() argument
2745 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, "Refclock: Telephone JJY" ) ; in jjy_start_telephone()
2826 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ; in jjy_start_telephone()
2828 if ( peer->minpoll < 8 ) { in jjy_start_telephone()
2830 int oldminpoll = peer->minpoll ; in jjy_start_telephone()
2831 peer->minpoll = 8 ; in jjy_start_telephone()
2832 if ( peer->ppoll < peer->minpoll ) { in jjy_start_telephone()
2833 peer->ppoll = peer->minpoll ; in jjy_start_telephone()
2835 if ( peer->maxpoll < peer->minpoll ) { in jjy_start_telephone()
2836 peer->maxpoll = peer->minpoll ; in jjy_start_telephone()
2838 snprintf( sLog, sizeof(sLog), "minpoll=%d -> %d", oldminpoll, peer->minpoll ) ; in jjy_start_telephone()
2839 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_JJY, sLog ) ; in jjy_start_telephone()
2855 struct peer *peer; in jjy_receive_telephone() local
2862 peer = rbufp->recv_peer ; in jjy_receive_telephone()
2863 pp = peer->procptr ; in jjy_receive_telephone()
2880 teljjy_control ( peer, pp, up ) ; in jjy_receive_telephone()
2883 teljjy_control ( peer, pp, up ) ; in jjy_receive_telephone()
2905 teljjy_control ( peer, pp, up ) ; in jjy_receive_telephone()
2914 jjy_poll_telephone ( int unit, struct peer *peer ) in jjy_poll_telephone() argument
2923 pp = peer->procptr ; in jjy_poll_telephone()
2935 teljjy_control ( peer, pp, up ) ; in jjy_poll_telephone()
2942 jjy_timer_telephone ( int unit, struct peer *peer ) in jjy_timer_telephone() argument
2952 pp = peer->procptr ; in jjy_timer_telephone()
2961 teljjy_control ( peer, pp, up ) ; in jjy_timer_telephone()
2969 teljjy_control ( peer, pp, up ) ; in jjy_timer_telephone()
2977 modem_timer ( unit, peer ) ; in jjy_timer_telephone()
2983 teljjy_control ( peer, pp, up ) ; in jjy_timer_telephone()
2986 teljjy_control ( peer, pp, up ) ; in jjy_timer_telephone()
2997 teljjy_control ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_control() argument
3005 rc = (*pTeljjyHandler[up->iClockEvent][up->iClockState])( peer, pp, up ) ; in teljjy_control()
3037 teljjy_control ( peer, pp, up ) ; in teljjy_control()
3047 teljjy_setDelay ( struct peer *peer, struct jjyunit *up ) in teljjy_setDelay() argument
3071 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_WARNING, sLog ) ; in teljjy_setDelay()
3074 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, sLog ) ; in teljjy_setDelay()
3082 teljjy_getDelay ( struct peer *peer, struct jjyunit *up ) in teljjy_getDelay() argument
3160 iPercent = ( peer->ttl - 100 ) ; in teljjy_getDelay()
3170 teljjy_idle_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_idle_ignore() argument
3181 teljjy_idle_dialout ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_idle_dialout() argument
3186 modem_connect ( peer->refclkunit, peer ) ; in teljjy_idle_dialout()
3194 teljjy_dial_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_dial_ignore() argument
3205 teljjy_dial_login ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_dial_login() argument
3216 teljjy_dial_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_dial_disc() argument
3227 teljjy_login_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_login_ignore() argument
3238 teljjy_login_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_login_disc() argument
3249 teljjy_login_conn ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_login_conn() argument
3270 teljjy_login_login ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_login_login() argument
3284 refclock_report( peer, CEVNT_FAULT ) ; in teljjy_login_login()
3287 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in teljjy_login_login()
3295 teljjy_login_silent ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_login_silent() argument
3301 refclock_report( peer, CEVNT_FAULT ) ; in teljjy_login_silent()
3304 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, "\r" ) ; in teljjy_login_silent()
3314 teljjy_login_error ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_login_error() argument
3325 teljjy_conn_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_conn_ignore() argument
3336 teljjy_conn_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_conn_disc() argument
3347 teljjy_conn_send ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_conn_send() argument
3362 if ( up->iClockCommandSeq == 0 && peer->ttl == 100 ) { in teljjy_conn_send()
3367 } else if ( up->iClockCommandSeq == 0 && peer->ttl != 100 ) { in teljjy_conn_send()
3375 } else if ( up->iClockCommandSeq > 0 && peer->ttl != 100 in teljjy_conn_send()
3386 teljjy_setDelay( peer, up ) ; in teljjy_conn_send()
3400 refclock_report( peer, CEVNT_FAULT ) ; in teljjy_conn_send()
3413 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_BUG, sLog ) ; in teljjy_conn_send()
3422 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in teljjy_conn_send()
3444 teljjy_conn_data ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_conn_data() argument
3469 teljjy_setDelay( peer, up ) ; in teljjy_conn_data()
3477 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, JJY_CLOCKSTATS_MESSAGE_ECHOBACK ) ; in teljjy_conn_data()
3490 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in teljjy_conn_data()
3505 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in teljjy_conn_data()
3519 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in teljjy_conn_data()
3534 if ( peer->ttl == 100 ) { in teljjy_conn_data()
3539 up->msecond = teljjy_getDelay( peer, up ) ; in teljjy_conn_data()
3552 jjy_synctime( peer, pp, up ) ; in teljjy_conn_data()
3554 if ( peer->ttl != 100 ) { in teljjy_conn_data()
3559 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_INFORMATION, sLog ) ; in teljjy_conn_data()
3564 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in teljjy_conn_data()
3577 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_WARNING, sLog ) ; in teljjy_conn_data()
3585 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_ERROR, sLog ) ; in teljjy_conn_data()
3595 teljjy_conn_silent ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_conn_silent() argument
3614 return teljjy_conn_send( peer, pp, up ) ; in teljjy_conn_silent()
3620 refclock_report( peer, CEVNT_FAULT ) ; in teljjy_conn_silent()
3623 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in teljjy_conn_silent()
3633 teljjy_conn_error ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_conn_error() argument
3644 teljjy_bye_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_bye_ignore() argument
3655 teljjy_bye_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_bye_disc() argument
3666 teljjy_bye_modem ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in teljjy_bye_modem() argument
3671 modem_disconnect ( peer->refclkunit, peer ) ; in teljjy_bye_modem()
3714 static void modem_control ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3716 static int modem_disc_ignore ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3717 static int modem_disc_init ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3718 static int modem_init_ignore ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3719 static int modem_init_start ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3720 static int modem_init_disc ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3721 static int modem_init_resp00 ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3722 static int modem_init_resp04 ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3723 static int modem_dial_ignore ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3724 static int modem_dial_dialout ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3725 static int modem_dial_escape ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3726 static int modem_dial_connect ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3727 static int modem_dial_disc ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3728 static int modem_conn_ignore ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3729 static int modem_conn_escape ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3730 static int modem_esc_ignore ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3731 static int modem_esc_escape ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3732 static int modem_esc_data ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3733 static int modem_esc_silent ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3734 static int modem_esc_disc ( struct peer *, struct refclockproc *, struct jjyunit * ) ;
3736 static int ( *pModemHandler [ ] [ 5 ] ) ( struct peer *, struct refclockproc *, struct jjyunit * ) =
3843 modem_connect ( int unit, struct peer *peer ) in modem_connect() argument
3848 pp = peer->procptr ; in modem_connect()
3855 modem_control ( peer, pp, up ) ; in modem_connect()
3862 modem_disconnect ( int unit, struct peer *peer ) in modem_disconnect() argument
3867 pp = peer->procptr ; in modem_disconnect()
3874 modem_control ( peer, pp, up ) ; in modem_disconnect()
3884 struct peer *peer; in modem_receive() local
3894 peer = rbufp->recv_peer ; in modem_receive()
3895 pp = peer->procptr ; in modem_receive()
3929 modem_control ( peer, pp, up ) ; in modem_receive()
3938 modem_timer ( int unit, struct peer *peer ) in modem_timer() argument
3944 pp = peer->procptr ; in modem_timer()
3953 modem_control ( peer, pp, up ) ; in modem_timer()
3961 modem_control ( peer, pp, up ) ; in modem_timer()
3970 modem_control ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_control() argument
3978 rc = (*pModemHandler[up->iModemEvent][up->iModemState])( peer, pp, up ) ; in modem_control()
4000 modem_control ( peer, pp, up ) ; in modem_control()
4009 modem_disc_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_disc_ignore() argument
4020 modem_disc_init ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_disc_init() argument
4031 modem_init_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_init_ignore() argument
4042 modem_init_start ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_init_start() argument
4055 return modem_init_resp00( peer, pp, up ) ; in modem_init_start()
4061 modem_init_resp00 ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_init_resp00() argument
4156 refclock_report( peer, CEVNT_FAULT ) ; in modem_init_resp00()
4159 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in modem_init_resp00()
4169 modem_init_resp04 ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_init_resp04() argument
4174 return modem_init_resp00( peer, pp, up ) ; in modem_init_resp04()
4180 modem_init_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_init_disc() argument
4196 modem_dial_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_dial_ignore() argument
4207 modem_dial_dialout ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_dial_dialout() argument
4231 refclock_report( peer, CEVNT_FAULT ) ; in modem_dial_dialout()
4234 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, sCmd ) ; in modem_dial_dialout()
4242 modem_dial_escape ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_dial_escape() argument
4252 return modem_conn_escape( peer, pp, up ) ; in modem_dial_escape()
4258 modem_dial_connect ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_dial_connect() argument
4269 modem_dial_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_dial_disc() argument
4279 modem_esc_disc( peer, pp, up ) ; in modem_dial_disc()
4287 modem_conn_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_conn_ignore() argument
4298 modem_conn_escape ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_conn_escape() argument
4309 modem_esc_ignore ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_esc_ignore() argument
4320 modem_esc_escape ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_esc_escape() argument
4334 refclock_report( peer, CEVNT_FAULT ) ; in modem_esc_escape()
4337 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in modem_esc_escape()
4345 modem_esc_data ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_esc_data() argument
4358 modem_esc_silent ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_esc_silent() argument
4371 modem_esc_escape( peer, pp, up ) ; in modem_esc_silent()
4381 return modem_esc_disc( peer, pp, up ) ; in modem_esc_silent()
4386 modem_esc_disc ( struct peer *peer, struct refclockproc *pp, struct jjyunit *up ) in modem_esc_disc() argument
4400 refclock_report( peer, CEVNT_FAULT ) ; in modem_esc_disc()
4403 jjy_write_clockstats( peer, JJY_CLOCKSTATS_MARK_SEND, pCmd ) ; in modem_esc_disc()
4418 jjy_write_clockstats ( struct peer *peer, int iMark, const char *pData ) in jjy_write_clockstats() argument
4465 record_clock_stats( &peer->srcadr, sLog ) ; in jjy_write_clockstats()