Lines Matching refs:up

333 	nmea_start,		/* start up driver */
348 * must be in a state that permits 'nmea_shutdown()' to clean up all
359 nmea_unit * const up = emalloc_zero(sizeof(*up));
395 pp->unitptr = (caddr_t)up;
401 memset(&up->last_reftime, 0xFF, sizeof(up->last_reftime));
402 memset(&up->last_gpsdate, 0x00, sizeof(up->last_gpsdate));
404 up->cksum_type[NMEA_GPRMC] = CHECK_CSVALID;
406 up->ppsapi_fd = -1;
408 ZERO(up->tally);
448 nmea_unit * const up = (nmea_unit *)pp->unitptr;
452 if (up != NULL) {
454 if (up->ppsapi_lit)
455 time_pps_destroy(up->atom.handle);
456 ppsdev_close(pp->io.fd, up->ppsapi_fd);
458 free(up);
481 nmea_unit * const up = (nmea_unit *)pp->unitptr;
500 /* Light up the PPSAPI interface if not yet attempted. */
501 if ((CLK_FLAG1 & pp->sloppyclockflag) && !up->ppsapi_tried) {
503 up->ppsapi_tried = TRUE;
511 up->ppsapi_fd = ppsdev_reopen(
513 pp->io.fd, up->ppsapi_fd,
520 if (refclock_ppsapi(up->ppsapi_fd, &up->atom)) {
522 up->ppsapi_lit = refclock_params(
523 pp->sloppyclockflag, &up->atom);
524 if (!up->ppsapi_lit) {
526 time_pps_destroy(up->atom.handle);
539 if ( !(CLK_FLAG1 & pp->sloppyclockflag) && up->ppsapi_tried) {
541 if (up->ppsapi_lit)
542 time_pps_destroy(up->atom.handle);
543 up->atom.handle = 0;
547 up->ppsapi_gate = FALSE;
548 up->ppsapi_lit = FALSE;
549 up->ppsapi_tried = FALSE;
578 nmea_unit * const up = (nmea_unit *)pp->unitptr;
590 if (up->rcvtout) {
591 --up->rcvtout;
596 up->lb_buf[0] = '\0';
597 up->lb_len = 0;
600 if (up->hold_gpsdate && (--up->hold_gpsdate < DATE_HLIM))
601 up->type_gpsdate = DTYP_NONE;
631 nmea_unit * const up = (nmea_unit*)pp->unitptr;
666 checkres = field_init(&rdata, up->lb_buf, up->lb_len);
671 refnumtoa(&peer->srcadr), up->lb_buf));
680 refnumtoa(&peer->srcadr), up->lb_len,
681 up->lb_buf));
684 up->tally.total++;
716 (int)(strchr(up->lb_buf, ',') - up->lb_buf),
717 up->lb_buf);
723 up->tally.filtered++;
740 * checksum. ('up->cksum_type[NMEA_GPRMC]' is set in
744 if (up->cksum_type[sentence] <= (u_char)checkres) {
745 up->cksum_type[sentence] = (u_char)checkres;
748 refnumtoa(&peer->srcadr), up->lb_buf));
750 up->tally.malformed++;
760 if (!up->gps_time) {
764 up->gps_time = 1;
767 if (up->gps_time) {
768 up->tally.filtered++;
774 refnumtoa(&peer->srcadr), up->lb_len, up->lb_buf));
788 if (up->type_gpsdate <= DTYP_Y2D) {
815 if (up->type_gpsdate <= DTYP_Y4D) {
826 if (up->type_gpsdate <= DTYP_Y4D) {
835 if (up->type_gpsdate <= DTYP_W10B) {
849 if (up->type_gpsdate <= DTYP_WEXT) {
868 up->tally.rejected++;
873 up->tally.malformed++;
878 up->tally.malformed++;
885 refclock_save_lcode(pp, up->lb_buf, up->lb_len);
894 if (up->ppsapi_lit && pp->leap != LEAP_NOTINSYNC)
896 &up->atom, &rd_timestamp,
910 up->last_gpsdate = gpsntp_from_gpscal_ex(
914 up->last_gpsdate = gpsntp_from_gpscal_ex(
918 up->last_gpsdate = gpsntp_from_calendar_ex(
922 up->type_gpsdate = rc_dtyp;
923 up->hold_gpsdate = DATE_HOLD;
926 if (up->hold_gpsdate) { /* time of day, based */
928 &date, tofs, &up->last_gpsdate, warp);
955 if (L_ISEQU(&up->last_reftime, &rd_reftime)) {
957 up->tally.filtered++;
960 up->last_reftime = rd_reftime;
963 refnumtoa(&peer->srcadr), up->lb_buf));
966 up->tally.accepted++;
967 refclock_save_lcode(pp, up->lb_buf, up->lb_len);
975 up->ppsapi_gate = TRUE;
982 up->tally.pps_used++;
995 up->rcvtout = 2;
1034 nmea_unit * const up = (nmea_unit*)pp->unitptr;
1040 if (up->lb_len >= sizeof(up->lb_buf))
1041 up->lb_len = 0;
1043 /* pick up last assembly position; leave room for NUL */
1044 dp = up->lb_buf + up->lb_len;
1045 de = up->lb_buf + sizeof(up->lb_buf) - 1;
1046 /* set up input range */
1056 if (dp == up->lb_buf) {
1060 dp = up->lb_buf;
1063 up->lb_len = (int)(dp - up->lb_buf);
1064 dp = up->lb_buf;
1072 up->lb_len = (int)(dp - up->lb_buf);
1093 nmea_unit * const up = (nmea_unit *)pp->unitptr;
1104 if (!up->ppsapi_gate) {
1108 up->ppsapi_gate = FALSE;
1120 memset(&up->last_gpsdate, 0, sizeof(up->last_gpsdate));
1141 up->tally.total, up->tally.accepted,
1142 up->tally.rejected, up->tally.malformed,
1143 up->tally.filtered, up->tally.pps_used);
1147 ZERO(up->tally);
1215 * set up a field record, check syntax and verify checksum