Lines Matching full:up
191 mx4200_start, /* start up driver */
211 register struct mx4200unit *up; in mx4200_start() local
227 up = emalloc_zero(sizeof(*up)); in mx4200_start()
236 free(up); in mx4200_start()
239 pp->unitptr = up; in mx4200_start()
262 register struct mx4200unit *up; in mx4200_shutdown() local
266 up = pp->unitptr; in mx4200_shutdown()
269 if (NULL != up) in mx4200_shutdown()
270 free(up); in mx4200_shutdown()
284 register struct mx4200unit *up; in mx4200_config() local
289 up = pp->unitptr; in mx4200_config()
298 up->sloppyclockflag = pp->sloppyclockflag; in mx4200_config()
300 up->moving = 1; /* Receiver on mobile platform */ in mx4200_config()
303 up->moving = 0; /* Static Installation */ in mx4200_config()
305 up->pollcnt = 2; in mx4200_config()
306 up->polled = 0; in mx4200_config()
307 up->known = 0; in mx4200_config()
308 up->avg_lat = 0.0; in mx4200_config()
309 up->avg_lon = 0.0; in mx4200_config()
310 up->avg_alt = 0.0; in mx4200_config()
311 up->central_meridian = NOT_INITIALIZED; in mx4200_config()
312 up->N_fixes = 0.0; in mx4200_config()
313 up->last_leap = 0; /* LEAP_NOWARNING */ in mx4200_config()
314 up->clamp_time = current_time + (AVGING_TIME * 60 * 60); in mx4200_config()
315 up->log_time = current_time + SLEEPTIME; in mx4200_config()
317 if (time_pps_create(pp->io.fd, &up->pps_h) < 0) { in mx4200_config()
323 if (time_pps_getcap(up->pps_h, &mode) < 0) { in mx4200_config()
329 if (time_pps_getparams(up->pps_h, &up->pps_p) < 0) { in mx4200_config()
339 up->pps_p.mode = PPS_CAPTUREASSERT | PPS_TSFMT_TSPEC; in mx4200_config()
340 up->pps_p.mode &= mode; /* only set what is legal */ in mx4200_config()
342 if (time_pps_setparams(up->pps_h, &up->pps_p) < 0) { in mx4200_config()
349 if (time_pps_kcbind(up->pps_h, PPS_KC_HARDPPS, PPS_CAPTUREASSERT, in mx4200_config()
423 up->moving = 1; /* Receiver on mobile platform */ in mx4200_config()
425 up->moving = 0; /* Static Installation */ in mx4200_config()
427 up->pollcnt = 2; in mx4200_config()
428 if (up->moving) { in mx4200_config()
449 if (up->moving) { in mx4200_config()
482 register struct mx4200unit *up; in mx4200_ref() local
489 up = pp->unitptr; in mx4200_ref()
492 if (up->moving) return; in mx4200_ref()
495 * Set up to output status information in the near future in mx4200_ref()
497 up->log_time = current_time + SLEEPTIME; in mx4200_ref()
549 if (up->central_meridian != NOT_INITIALIZED) { in mx4200_ref()
550 up->avg_lon += up->central_meridian; in mx4200_ref()
551 if (up->avg_lon < -180.0) up->avg_lon += 360.0; in mx4200_ref()
552 if (up->avg_lon > 180.0) up->avg_lon -= 360.0; in mx4200_ref()
555 if (up->avg_lat >= 0.0) { in mx4200_ref()
556 lat = up->avg_lat; in mx4200_ref()
559 lat = up->avg_lat * (-1.0); in mx4200_ref()
562 if (up->avg_lon >= 0.0) { in mx4200_ref()
563 lon = up->avg_lon; in mx4200_ref()
566 lon = up->avg_lon * (-1.0); in mx4200_ref()
569 alt = up->avg_alt; in mx4200_ref()
603 register struct mx4200unit *up; in mx4200_poll() local
607 up = pp->unitptr; in mx4200_poll()
618 if (up->pollcnt > 0) { in mx4200_poll()
619 up->pollcnt--; in mx4200_poll()
636 up->polled = 1; in mx4200_poll()
642 if ((up->log_time > 0) && (current_time > up->log_time)) { in mx4200_poll()
643 up->log_time = 0; in mx4200_poll()
664 register struct mx4200unit *up; in mx4200_receive() local
676 up = pp->unitptr; in mx4200_receive()
683 (up->sloppyclockflag & CLK_FLAG2)) { in mx4200_receive()
684 up->sloppyclockflag = pp->sloppyclockflag; in mx4200_receive()
690 up->sloppyclockflag = pp->sloppyclockflag; in mx4200_receive()
703 up->pollcnt = 2; in mx4200_receive()
792 if (!up->known) { in mx4200_receive()
802 up->N_fixes, up->avg_lat, up->avg_lon, up->avg_alt); in mx4200_receive()
807 if (current_time > up->clamp_time) { in mx4200_receive()
808 up->known++; in mx4200_receive()
871 if (!up->polled) in mx4200_receive()
892 up->polled = 0; in mx4200_receive()
952 struct mx4200unit *up; in mx4200_parse_t() local
960 up = pp->unitptr; in mx4200_parse_t()
1080 if (leapsec_warn != up->last_leap ) { in mx4200_parse_t()
1083 up->last_leap, leapsec_warn, pp->leap); in mx4200_parse_t()
1085 up->last_leap = leapsec_warn; in mx4200_parse_t()
1234 struct mx4200unit *up; in mx4200_parse_p() local
1240 up = pp->unitptr; in mx4200_parse_p()
1243 if (up->moving) return ("mobile platform - no pos!"); in mx4200_parse_p()
1300 if (up->central_meridian == NOT_INITIALIZED) { in mx4200_parse_p()
1301 up->central_meridian = lon; in mx4200_parse_p()
1304 up->central_meridian); in mx4200_parse_p()
1306 lon -= up->central_meridian; in mx4200_parse_p()
1314 up->avg_lon = (up->N_fixes * up->avg_lon) + lon; in mx4200_parse_p()
1315 up->avg_lat = (up->N_fixes * up->avg_lat) + lat; in mx4200_parse_p()
1316 up->avg_alt = (up->N_fixes * up->avg_alt) + alt; in mx4200_parse_p()
1318 up->N_fixes += 1.0; in mx4200_parse_p()
1320 up->avg_lon /= up->N_fixes; in mx4200_parse_p()
1321 up->avg_lat /= up->N_fixes; in mx4200_parse_p()
1322 up->avg_alt /= up->N_fixes; in mx4200_parse_p()
1326 up->N_fixes, lat, lon, alt, up->central_meridian); in mx4200_parse_p()
1455 struct mx4200unit *up; in mx4200_parse_s() local
1459 up = pp->unitptr; in mx4200_parse_s()
1499 struct mx4200unit *up; in mx4200_pps() local
1504 up = pp->unitptr; in mx4200_pps()
1509 temp_serial = up->pps_i.assert_sequence; in mx4200_pps()
1512 if (time_pps_fetch(up->pps_h, PPS_TSFMT_TSPEC, &(up->pps_i), in mx4200_pps()
1516 (unsigned long)up->pps_i.assert_sequence); in mx4200_pps()
1520 if (temp_serial == up->pps_i.assert_sequence) { in mx4200_pps()
1523 (unsigned long)up->pps_i.assert_sequence); in mx4200_pps()
1530 if (up->lastserial + 1 != up->pps_i.assert_sequence && in mx4200_pps()
1531 up->lastserial != 0) { in mx4200_pps()
1532 if (up->pps_i.assert_sequence == up->lastserial) { in mx4200_pps()
1536 up->pps_i.assert_sequence - up->lastserial - 1UL); in mx4200_pps()
1540 up->lastserial = up->pps_i.assert_sequence; in mx4200_pps()
1546 pp->lastrec.l_ui = up->pps_i.assert_timestamp.tv_sec + in mx4200_pps()
1548 pp->lastrec.l_uf = ((double)(up->pps_i.assert_timestamp.tv_nsec) * in mx4200_pps()
1563 struct mx4200unit *up; in mx4200_debug() local
1569 up = pp->unitptr; in mx4200_debug()
1597 struct mx4200unit *up; local
1606 up = pp->unitptr;