CVS commit: src/sys/netinet6

2021-08-10 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Aug 10 06:29:56 UTC 2021

Modified Files:
src/sys/netinet6: in6_src.c

Log Message:
PR kern/56348
MTU discovery fails with IPv6 sockets bound to IPv4 mapped address

pick up the IPv4 route for IPv4 mapped IPv6 address to get the correct
MTU and not any unrelated/inappropriate MTU from IPv6 routes. IPv4 mapped
IPv6 addresses are always handled by the IPv4 stack and MTU discovery
is solely handled with the IPv4 routing table.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/netinet6/in6_src.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/in6_src.c
diff -u src/sys/netinet6/in6_src.c:1.87 src/sys/netinet6/in6_src.c:1.88
--- src/sys/netinet6/in6_src.c:1.87	Fri Aug 28 06:32:24 2020
+++ src/sys/netinet6/in6_src.c	Tue Aug 10 06:29:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: in6_src.c,v 1.87 2020/08/28 06:32:24 ozaki-r Exp $	*/
+/*	$NetBSD: in6_src.c,v 1.88 2021/08/10 06:29:56 kardel Exp $	*/
 /*	$KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $	*/
 
 /*
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.87 2020/08/28 06:32:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.88 2021/08/10 06:29:56 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -612,6 +612,7 @@ in6_selectroute(struct sockaddr_in6 *dst
 	struct rtentry *rt = NULL;
 	union {
 		struct sockaddr		dst;
+		struct sockaddr_in	dst4;
 		struct sockaddr_in6	dst6;
 	} u;
 
@@ -679,9 +680,17 @@ in6_selectroute(struct sockaddr_in6 *dst
 	 * Use a cached route if it exists and is valid, else try to allocate
 	 * a new one.  Note that we should check the address family of the
 	 * cached destination, in case of sharing the cache with IPv4.
+	 *
+	 * for V4 mapped addresses we want to pick up the v4 route
+	 * see PR kern/56348
 	 */
-	u.dst6 = *dstsock;
-	u.dst6.sin6_scope_id = 0;
+	if (IN6_IS_ADDR_V4MAPPED(>sin6_addr)) {
+		in6_sin6_2_sin(, dstsock);
+	} else {
+		u.dst6 = *dstsock;
+		u.dst6.sin6_scope_id = 0;
+	}
+
 	rt = rtcache_lookup1(*ro, , 1);
 
 	if (rt == NULL)



CVS commit: src/external/cddl/osnet/sys/sys

2021-07-18 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jul 18 07:22:22 UTC 2021

Modified Files:
src/external/cddl/osnet/sys/sys: vnode.h

Log Message:
PR kern/56316: vn_open doesn't follow symlinks

remove setting of O_NOFOLLOW. restores ZFS being able
to open devices via symlinks again.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/cddl/osnet/sys/sys/vnode.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/sys/sys/vnode.h
diff -u src/external/cddl/osnet/sys/sys/vnode.h:1.19 src/external/cddl/osnet/sys/sys/vnode.h:1.20
--- src/external/cddl/osnet/sys/sys/vnode.h:1.19	Tue Jun 29 22:40:53 2021
+++ src/external/cddl/osnet/sys/sys/vnode.h	Sun Jul 18 07:22:22 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: vnode.h,v 1.19 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: vnode.h,v 1.20 2021/07/18 07:22:22 kardel Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -246,8 +246,6 @@ zfs_vn_open(const char *pnamep, enum uio
 	ASSERT(crwhy == CRCREAT);
 	ASSERT(umask == 0);
 
-	filemode |= O_NOFOLLOW;
-
 	pb = pathbuf_create(pnamep);
 	error = vn_open(NULL, pb, 0, filemode, createmode, vpp, NULL, NULL);
 	if (error == 0) {



CVS commit: src/external/bsd/ntp/dist/ntpd

2021-02-18 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Feb 18 15:13:38 UTC 2021

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_timer.c

Log Message:
PR bin/55973:

fix routing message triggered one shot interface update.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_timer.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_timer.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.10
--- src/external/bsd/ntp/dist/ntpd/ntp_timer.c:1.9	Sun Jan  3 15:33:05 2021
+++ src/external/bsd/ntp/dist/ntpd/ntp_timer.c	Thu Feb 18 15:13:37 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_timer.c,v 1.9 2021/01/03 15:33:05 roy Exp $	*/
+/*	$NetBSD: ntp_timer.c,v 1.10 2021/02/18 15:13:37 kardel Exp $	*/
 
 /*
  * ntp_timer.c - event timer support routines
@@ -428,6 +428,8 @@ timer(void)
 		if (interface_interval)
 			timer_interfacetimeout(current_time +
 			interface_interval);
+		else
+			timer_interfacetimeout(0);
 		DPRINTF(2, ("timer: interface update\n"));
 		interface_update(NULL, NULL);
 	}



CVS commit: src/sys/dev/ic

2020-12-04 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Dec  4 23:03:11 UTC 2020

Modified Files:
src/sys/dev/ic: nvme.c

Log Message:
PR kern/55839:
handle multiple nvme_rescan()s correctly by doing the
name-space identify only once per nsid.

fixes issue where modloading triggers multiple
rescans.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/nvme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.52 src/sys/dev/ic/nvme.c:1.53
--- src/sys/dev/ic/nvme.c:1.52	Tue Nov 10 07:39:12 2020
+++ src/sys/dev/ic/nvme.c	Fri Dec  4 23:03:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.52 2020/11/10 07:39:12 rin Exp $	*/
+/*	$NetBSD: nvme.c,v 1.53 2020/12/04 23:03:11 kardel Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.52 2020/11/10 07:39:12 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.53 2020/12/04 23:03:11 kardel Exp $");
 
 #include 
 #include 
@@ -628,6 +628,12 @@ nvme_ns_identify(struct nvme_softc *sc, 
 
 	KASSERT(nsid > 0);
 
+	ns = nvme_ns_get(sc, nsid);
+	KASSERT(ns);
+
+	if (ns->ident != NULL)
+		return 0;
+
 	ccb = nvme_ccb_get(sc->sc_admin_q, false);
 	KASSERT(ccb != NULL); /* it's a bug if we don't have spare ccb here */
 
@@ -665,9 +671,6 @@ nvme_ns_identify(struct nvme_softc *sc, 
 	/* Convert data to host endian */
 	nvme_identify_namespace_swapbytes(identify);
 
-	ns = nvme_ns_get(sc, nsid);
-	KASSERT(ns);
-	KASSERT(ns->ident == NULL);
 	ns->ident = identify;
 
 done:



CVS commit: src/crypto/dist/ipsec-tools/src/racoon

2020-11-25 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Nov 25 10:57:11 UTC 2020

Modified Files:
src/crypto/dist/ipsec-tools/src/racoon: grabmyaddr.c

Log Message:
Fix address advancing for i386 and other 32-bit platforms.
Makes racoon grok IPv6 addresses again on these platforms.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 \
src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c
diff -u src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.37 src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.38
--- src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c:1.37	Sat May 19 20:14:56 2018
+++ src/crypto/dist/ipsec-tools/src/racoon/grabmyaddr.c	Wed Nov 25 10:57:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: grabmyaddr.c,v 1.37 2018/05/19 20:14:56 maxv Exp $	*/
+/*	$NetBSD: grabmyaddr.c,v 1.38 2020/11/25 10:57:11 kardel Exp $	*/
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
  * Copyright (C) 2008 Timo Teras .
@@ -683,10 +683,14 @@ kernel_sync()
 
 #elif defined(USE_ROUTE)
 
+#ifdef RT_ROUNDUP
+#define SAROUNDUP(X)   RT_ROUNDUP(((struct sockaddr *)(X))->sa_len)
+#else
 #define ROUNDUP(a) \
   ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
-
 #define SAROUNDUP(X)   ROUNDUP(((struct sockaddr *)(X))->sa_len)
+#endif
+
 
 static size_t
 parse_address(caddr_t start, caddr_t end, struct sockaddr_storage *dest)



CVS commit: src/sys/netinet

2020-11-12 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Nov 12 13:13:45 UTC 2020

Modified Files:
src/sys/netinet: ip_mroute.c

Log Message:
PR kern/55779:

restore non-desctructive guarantee of ip_mforward() mbuf
argument. This avoids generation invalid UDP checksums
on multicast packets in ip_output().

XXX the root cause of the misguided fix in 2008 should be
XXX investigated


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/netinet/ip_mroute.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/ip_mroute.c
diff -u src/sys/netinet/ip_mroute.c:1.163 src/sys/netinet/ip_mroute.c:1.164
--- src/sys/netinet/ip_mroute.c:1.163	Fri Sep 14 05:09:51 2018
+++ src/sys/netinet/ip_mroute.c	Thu Nov 12 13:13:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_mroute.c,v 1.163 2018/09/14 05:09:51 maxv Exp $	*/
+/*	$NetBSD: ip_mroute.c,v 1.164 2020/11/12 13:13:45 kardel Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -93,7 +93,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.163 2018/09/14 05:09:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_mroute.c,v 1.164 2020/11/12 13:13:45 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -225,6 +225,8 @@ static int tbf_dq_sel(struct vif *, stru
 static void tbf_send_packet(struct vif *, struct mbuf *);
 static void tbf_update_tokens(struct vif *);
 static int priority(struct vif *, struct ip *);
+static int ip_mforward_real(struct mbuf *, struct ifnet *);
+
 
 /*
  * Bandwidth monitoring
@@ -1268,6 +1270,34 @@ socket_send(struct socket *s, struct mbu
 int
 ip_mforward(struct mbuf *m, struct ifnet *ifp)
 {
+	int rc;
+	/*
+	 * save csum_flags to uphold the 
+	 * "unscathed" guarantee.
+	 * ip_output() relies on that and
+	 * without it we send out
+	 * multicast packets with an invalid
+	 * checksum
+	 *
+	 * see PR kern/55779
+	 */
+	int csum_flags = m->m_pkthdr.csum_flags;
+
+	/*
+	 * Temporarily clear any in-bound checksum flags for this packet.
+	 */
+	m->m_pkthdr.csum_flags = 0;
+
+	rc = ip_mforward_real(m, ifp);
+
+	m->m_pkthdr.csum_flags = csum_flags;
+
+	return rc;
+}
+
+static int
+ip_mforward_real(struct mbuf *m, struct ifnet *ifp)
+{
 	struct ip *ip = mtod(m, struct ip *);
 	struct mfc *rt;
 	static int srctun = 0;
@@ -1305,11 +1335,6 @@ ip_mforward(struct mbuf *m, struct ifnet
 	}
 
 	/*
-	 * Clear any in-bound checksum flags for this packet.
-	 */
-	m->m_pkthdr.csum_flags = 0;
-
-	/*
 	 * Don't forward a packet with time-to-live of zero or one,
 	 * or a packet destined to a local-only group.
 	 */



CVS commit: src/external/cddl/osnet/dist/uts/common/fs/zfs

2020-10-09 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Oct  9 08:18:01 UTC 2020

Modified Files:
src/external/cddl/osnet/dist/uts/common/fs/zfs: dmu_tx.c

Log Message:
PR kern/55705:
don't attempt to sleep for negative time, we are late anyway - avoids 
DIAGNOSTIC panic


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c
diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c:1.5 src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c:1.6
--- src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c:1.5	Mon Mar  9 15:37:46 2020
+++ src/external/cddl/osnet/dist/uts/common/fs/zfs/dmu_tx.c	Fri Oct  9 08:18:01 2020
@@ -1153,6 +1153,9 @@ dmu_tx_delay(dmu_tx_t *tx, uint64_t dirt
 #ifdef __NetBSD__
 	int timo = (wakeup - now) * hz / 10;
 
+	if (timo < 0)
+		return;
+
 	if (timo == 0)
 		timo = 1;
 	kpause("dmu_tx_delay", false, timo, NULL);



CVS commit: src/sys/dev/ic

2020-09-22 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Sep 22 11:53:10 UTC 2020

Modified Files:
src/sys/dev/ic: ld_nvme.c nvme.c

Log Message:
PR kern/55674:
move name space availability check from ld_nvme.c:ld_nvme_attach()
to nvme.c:nvme_rescan().
this avoids allocation of ld(4) instances for every possible
name space, even if it is not usable. it also reduces the device
node flood generated from that strategy.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/ic/ld_nvme.c
cvs rdiff -u -r1.49 -r1.50 src/sys/dev/ic/nvme.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/ld_nvme.c
diff -u src/sys/dev/ic/ld_nvme.c:1.23 src/sys/dev/ic/ld_nvme.c:1.24
--- src/sys/dev/ic/ld_nvme.c:1.23	Tue Oct  1 10:59:49 2019
+++ src/sys/dev/ic/ld_nvme.c	Tue Sep 22 11:53:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ld_nvme.c,v 1.23 2019/10/01 10:59:49 mlelstv Exp $	*/
+/*	$NetBSD: ld_nvme.c,v 1.24 2020/09/22 11:53:10 kardel Exp $	*/
 
 /*-
  * Copyright (C) 2016 NONAKA Kimihiro 
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.23 2019/10/01 10:59:49 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.24 2020/09/22 11:53:10 kardel Exp $");
 
 #include 
 #include 
@@ -86,7 +86,6 @@ ld_nvme_attach(device_t parent, device_t
 	struct nvme_attach_args *naa = aux;
 	struct nvme_namespace *ns;
 	struct nvm_namespace_format *f;
-	int error;
 
 	ld->sc_dv = self;
 	sc->sc_nvme = nsc;
@@ -95,28 +94,11 @@ ld_nvme_attach(device_t parent, device_t
 	aprint_naive("\n");
 	aprint_normal("\n");
 
-	error = nvme_ns_identify(sc->sc_nvme, sc->sc_nsid);
-	if (error) {
-		aprint_error_dev(self, "couldn't identify namespace\n");
-		return;
-	}
-
 	ns = nvme_ns_get(sc->sc_nvme, sc->sc_nsid);
 	KASSERT(ns);
-	f = >ident->lbaf[NVME_ID_NS_FLBAS(ns->ident->flbas)];
 
-	/*
-	 * NVME1.0e 6.11 Identify command
-	 *
-	 * LBADS values smaller than 9 are not supported, a value
-	 * of zero means that the format is not used.
-	 */
-	if (f->lbads < 9) {
-		if (f->lbads > 0)
-			aprint_error_dev(self,
-			"unsupported logical data size %u\n", f->lbads);
-		return;
-	}
+	f = >ident->lbaf[NVME_ID_NS_FLBAS(ns->ident->flbas)];
+	KASSERT(f->lbads >= 9); /* only valid LBS data sizes allowed here */
 
 	ld->sc_secsize = 1 << f->lbads;
 	ld->sc_secperunit = ns->ident->nsze;

Index: src/sys/dev/ic/nvme.c
diff -u src/sys/dev/ic/nvme.c:1.49 src/sys/dev/ic/nvme.c:1.50
--- src/sys/dev/ic/nvme.c:1.49	Tue Jul 28 15:59:19 2020
+++ src/sys/dev/ic/nvme.c	Tue Sep 22 11:53:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: nvme.c,v 1.49 2020/07/28 15:59:19 jdolecek Exp $	*/
+/*	$NetBSD: nvme.c,v 1.50 2020/09/22 11:53:10 kardel Exp $	*/
 /*	$OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.49 2020/07/28 15:59:19 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.50 2020/09/22 11:53:10 kardel Exp $");
 
 #include 
 #include 
@@ -471,23 +471,52 @@ nvme_rescan(device_t self, const char *a
 {
 	struct nvme_softc *sc = device_private(self);
 	struct nvme_attach_args naa;
+	struct nvm_namespace_format *f;
+	struct nvme_namespace *ns;
 	uint64_t cap;
 	int ioq_entries = nvme_ioq_size;
 	int i;
+	int error;
 
 	cap = nvme_read8(sc, NVME_CAP);
 	if (ioq_entries > NVME_CAP_MQES(cap))
 		ioq_entries = NVME_CAP_MQES(cap);
 
-	for (i = 0; i < sc->sc_nn; i++) {
-		if (sc->sc_namespaces[i].dev)
+	for (i = 1; i <= sc->sc_nn; i++) {
+		if (sc->sc_namespaces[i - 1].dev)
+			continue;
+
+		/* identify to check for availability */
+		error = nvme_ns_identify(sc, i);
+		if (error) {
+			aprint_error_dev(self, "couldn't identify namespace #%d\n", i);
+			continue;
+		}
+
+		ns = nvme_ns_get(sc, i);
+		KASSERT(ns);
+
+		f = >ident->lbaf[NVME_ID_NS_FLBAS(ns->ident->flbas)];
+
+		/*
+		 * NVME1.0e 6.11 Identify command
+		 *
+		 * LBADS values smaller than 9 are not supported, a value
+		 * of zero means that the format is not used.
+		 */
+		if (f->lbads < 9) {
+			if (f->lbads > 0)
+aprint_error_dev(self,
+		 "unsupported logical data size %u\n", f->lbads);
 			continue;
+		}
+
 		memset(, 0, sizeof(naa));
-		naa.naa_nsid = i + 1;
+		naa.naa_nsid = i;
 		naa.naa_qentries = (ioq_entries - 1) * sc->sc_nq;
 		naa.naa_maxphys = sc->sc_mdts;
 		naa.naa_typename = sc->sc_modelname;
-		sc->sc_namespaces[i].dev = config_found(sc->sc_dev, ,
+		sc->sc_namespaces[i - 1].dev = config_found(sc->sc_dev, ,
 		nvme_print);
 	}
 	return 0;



CVS commit: src/sys/netinet

2020-09-11 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Sep 11 09:08:47 UTC 2020

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
PR/kern 55567

fix the data-only fast path. RCV.UP and SND.WL1 could be left behind
on long sequences of data only packets. pull them along to avoid relative
sequence wraps.

consistent with FreeBSD

addresses second failure mode of PR/kern 55567.

pullup to netbsd-8
pullup to netbsd-9


To generate a diff of this commit:
cvs rdiff -u -r1.419 -r1.420 src/sys/netinet/tcp_input.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.419 src/sys/netinet/tcp_input.c:1.420
--- src/sys/netinet/tcp_input.c:1.419	Wed Sep  2 15:08:46 2020
+++ src/sys/netinet/tcp_input.c	Fri Sep 11 09:08:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.420 2020/09/11 09:08:47 kardel Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.420 2020/09/11 09:08:47 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1949,13 +1949,25 @@ after_listen:
 			 * we have enough buffer space to take it.
 			 */
 			tp->rcv_nxt += tlen;
+
+			/*
+			 * Pull rcv_up up to prevent seq wrap relative to
+			 * rcv_nxt.
+			 */
+			tp->rcv_up = tp->rcv_nxt;
+
+			/*
+			 * Pull snd_wl1 up to prevent seq wrap relative to
+			 * th_seq.
+			 */
+			tp->snd_wl1 = th->th_seq;
+
 			tcps = TCP_STAT_GETREF();
 			tcps[TCP_STAT_PREDDAT]++;
 			tcps[TCP_STAT_RCVPACK]++;
 			tcps[TCP_STAT_RCVBYTE] += tlen;
 			TCP_STAT_PUTREF();
 			nd6_hint(tp);
-
 		/*
 		 * Automatic sizing enables the performance of large buffers
 		 * and most of the efficiency of small ones by only allocating



CVS commit: src/external/bsd/ntp/dist/ntpd

2020-09-03 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Sep  3 07:26:41 UTC 2020

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
remove unneeded newline in quotes variable string - keeps ntpq happy


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.22 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.23
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.22	Mon May 25 20:47:25 2020
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Thu Sep  3 07:26:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.22 2020/05/25 20:47:25 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.23 2020/09/03 07:26:41 kardel Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -4287,7 +4287,7 @@ mk_utcinfo(
 	}
 	else
 	{
-		snprintf( t, size, "UTC offset parameter: %is, no leap second announced.\n", dtls );
+		snprintf( t, size, "UTC offset parameter: %is, no leap second announced.", dtls );
 	}
 
 }



CVS commit: src/sys/netinet

2020-09-02 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Sep  2 15:08:46 UTC 2020

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
Fix fast path for uni directional transfers
pure ACK case:

drag snd_wl2 along so only newer
ACKs can update the window size.
also avoids the state where snd_wl2
is eventually larger than th_ack and thus
blocking the window update mechanism and
the connection gets stuck for a lng
time in the zero sized send window state.

see PR/kern 55567

ok thorpej@, also found in FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.418 -r1.419 src/sys/netinet/tcp_input.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.418 src/sys/netinet/tcp_input.c:1.419
--- src/sys/netinet/tcp_input.c:1.418	Mon Jul  6 18:49:12 2020
+++ src/sys/netinet/tcp_input.c	Wed Sep  2 15:08:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.418 2020/07/06 18:49:12 christos Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.418 2020/07/06 18:49:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.419 2020/09/02 15:08:46 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1897,6 +1897,19 @@ after_listen:
 tp->snd_fack = tp->snd_una;
 if (SEQ_LT(tp->snd_high, tp->snd_una))
 	tp->snd_high = tp->snd_una;
+/*
+ * drag snd_wl2 along so only newer
+ * ACKs can update the window size.
+ * also avoids the state where snd_wl2
+ * is eventually larger than th_ack and thus
+ * blocking the window update mechanism and
+ * the connection gets stuck for a lng
+ * time in the zero sized send window state.
+ *
+ * see PR/kern 55567
+ */
+tp->snd_wl2 = tp->snd_una;
+
 m_freem(m);
 
 /*



CVS commit: src/sys/dev/mii

2020-08-27 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Aug 27 10:10:23 UTC 2020

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
Move mii_phy_statusmsg(sc) back to its original position. Fixes
deafness bug on macppc reported and tested by martin@
Thanks !


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/mii/mii_physubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.93 src/sys/dev/mii/mii_physubr.c:1.94
--- src/sys/dev/mii/mii_physubr.c:1.93	Mon Aug 24 12:46:04 2020
+++ src/sys/dev/mii/mii_physubr.c	Thu Aug 27 10:10:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.94 2020/08/27 10:10:23 kardel Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.94 2020/08/27 10:10:23 kardel Exp $");
 
 #include 
 #include 
@@ -451,10 +451,10 @@ mii_phy_update(struct mii_softc *sc, int
 	if (sc->mii_media_active != mii_media_active ||
 	sc->mii_media_status != mii_media_status ||
 	cmd == MII_MEDIACHG) {
+		mii_phy_statusmsg(sc);
 		(*mii->mii_statchg)(mii->mii_ifp);
 		sc->mii_media_active = mii_media_active;
 		sc->mii_media_status = mii_media_status;
-		mii_phy_statusmsg(sc);
 	}
 }
 



CVS commit: src/sys/dev/mii

2020-08-24 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Aug 24 12:46:04 UTC 2020

Modified Files:
src/sys/dev/mii: mii_physubr.c

Log Message:
Keep the change check invariant intact. The previous code could miss
status updates by picking up a new status different from the tested
status. This left addresses in the DETACHED state although the
link status is already UP again.

addresses PR/kern 55538


To generate a diff of this commit:
cvs rdiff -u -r1.92 -r1.93 src/sys/dev/mii/mii_physubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.92 src/sys/dev/mii/mii_physubr.c:1.93
--- src/sys/dev/mii/mii_physubr.c:1.92	Mon Aug 24 04:23:41 2020
+++ src/sys/dev/mii/mii_physubr.c	Mon Aug 24 12:46:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.92 2020/08/24 04:23:41 msaitoh Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.92 2020/08/24 04:23:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.93 2020/08/24 12:46:04 kardel Exp $");
 
 #include 
 #include 
@@ -440,16 +440,21 @@ void
 mii_phy_update(struct mii_softc *sc, int cmd)
 {
 	struct mii_data *mii = sc->mii_pdata;
+	u_int mii_media_active;
+	int   mii_media_status;
 
 	KASSERT(mii_locked(mii));
 
-	if (sc->mii_media_active != mii->mii_media_active ||
-	sc->mii_media_status != mii->mii_media_status ||
+	mii_media_active = mii->mii_media_active;
+	mii_media_status = mii->mii_media_status;
+
+	if (sc->mii_media_active != mii_media_active ||
+	sc->mii_media_status != mii_media_status ||
 	cmd == MII_MEDIACHG) {
-		mii_phy_statusmsg(sc);
 		(*mii->mii_statchg)(mii->mii_ifp);
-		sc->mii_media_active = mii->mii_media_active;
-		sc->mii_media_status = mii->mii_media_status;
+		sc->mii_media_active = mii_media_active;
+		sc->mii_media_status = mii_media_status;
+		mii_phy_statusmsg(sc);
 	}
 }
 



CVS commit: src/sys

2020-08-04 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Aug  4 13:20:45 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_spi.c
src/sys/dev/spi: spi.c spivar.h

Log Message:
Use mutex for lwp/interrupt coordination. using splX() simply does not work
on multiprocessor systems.

fixes PR kern/55506


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcm2835_spi.c
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/spi/spi.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/spi/spivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/broadcom/bcm2835_spi.c
diff -u src/sys/arch/arm/broadcom/bcm2835_spi.c:1.6 src/sys/arch/arm/broadcom/bcm2835_spi.c:1.7
--- src/sys/arch/arm/broadcom/bcm2835_spi.c:1.6	Tue Aug 13 17:03:10 2019
+++ src/sys/arch/arm/broadcom/bcm2835_spi.c	Tue Aug  4 13:20:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_spi.c,v 1.6 2019/08/13 17:03:10 tnn Exp $	*/
+/*	$NetBSD: bcm2835_spi.c,v 1.7 2020/08/04 13:20:45 kardel Exp $	*/
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.6 2019/08/13 17:03:10 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_spi.c,v 1.7 2020/08/04 13:20:45 kardel Exp $");
 
 #include 
 #include 
@@ -53,6 +53,7 @@ struct bcmspi_softc {
 	bus_space_handle_t	sc_ioh;
 	void			*sc_intrh;
 	struct spi_controller	sc_spi;
+	kmutex_tsc_mutex;
 	SIMPLEQ_HEAD(,spi_transfer) sc_q;
 	struct spi_transfer	*sc_transfer;
 	struct spi_chunk	*sc_wchunk;
@@ -131,6 +132,7 @@ bcmspi_attach(device_t parent, device_t 
 	aprint_normal_dev(self, "interrupting on %s\n", intrstr);
 
 	sc->sc_spi.sct_cookie = sc;
+	mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_VM);
 	sc->sc_spi.sct_configure = bcmspi_configure;
 	sc->sc_spi.sct_transfer = bcmspi_transfer;
 	sc->sc_spi.sct_nslaves = 3;
@@ -189,14 +191,13 @@ static int
 bcmspi_transfer(void *cookie, struct spi_transfer *st)
 {
 	struct bcmspi_softc * const sc = cookie;
-	int s;
 
-	s = splbio();
+	mutex_enter(>sc_mutex);
 	spi_transq_enqueue(>sc_q, st);
 	if (sc->sc_running == false) {
 		bcmspi_start(sc);
 	}
-	splx(s);
+	mutex_exit(>sc_mutex);
 	return 0;
 }
 
@@ -226,13 +227,13 @@ bcmspi_start(struct bcmspi_softc * const
 		if (!cold)
 			return;
 
-		int s = splbio();
 		for (;;) {
+		mutex_exit(>sc_mutex);
 			bcmspi_intr(sc);
+			mutex_enter(>sc_mutex);
 			if (ISSET(st->st_flags, SPI_F_DONE))
 break;
 		}
-		splx(s);
 	}
 
 	sc->sc_running = false;
@@ -291,6 +292,7 @@ bcmspi_intr(void *cookie)
 	struct spi_transfer *st;
 	uint32_t cs;
 
+	mutex_enter(>sc_mutex);
 	cs = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SPI_CS);
 	if (ISSET(cs, SPI_CS_DONE)) {
 		if (sc->sc_wchunk != NULL) {
@@ -314,5 +316,6 @@ bcmspi_intr(void *cookie)
 	}
 
 end:
+	mutex_exit(>sc_mutex);
 	return ISSET(cs, SPI_CS_DONE|SPI_CS_RXR);
 }

Index: src/sys/dev/spi/spi.c
diff -u src/sys/dev/spi/spi.c:1.14 src/sys/dev/spi/spi.c:1.15
--- src/sys/dev/spi/spi.c:1.14	Thu Jun 11 02:39:30 2020
+++ src/sys/dev/spi/spi.c	Tue Aug  4 13:20:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: spi.c,v 1.14 2020/06/11 02:39:30 thorpej Exp $ */
+/* $NetBSD: spi.c,v 1.15 2020/08/04 13:20:45 kardel Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.14 2020/06/11 02:39:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spi.c,v 1.15 2020/08/04 13:20:45 kardel Exp $");
 
 #include "locators.h"
 
@@ -287,7 +287,7 @@ spi_attach(device_t parent, device_t sel
 	aprint_naive(": SPI bus\n");
 	aprint_normal(": SPI bus\n");
 
-	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_BIO);
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_VM);
 	cv_init(>sc_cv, "spictl");
 
 	sc->sc_controller = *sba->sba_controller;
@@ -463,7 +463,7 @@ void
 spi_transfer_init(struct spi_transfer *st)
 {
 
-	mutex_init(>st_lock, MUTEX_DEFAULT, IPL_BIO);
+	mutex_init(>st_lock, MUTEX_DEFAULT, IPL_VM);
 	cv_init(>st_cv, "spixfr");
 
 	st->st_flags = 0;

Index: src/sys/dev/spi/spivar.h
diff -u src/sys/dev/spi/spivar.h:1.9 src/sys/dev/spi/spivar.h:1.10
--- src/sys/dev/spi/spivar.h:1.9	Wed Nov 27 07:26:08 2019
+++ src/sys/dev/spi/spivar.h	Tue Aug  4 13:20:45 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: spivar.h,v 1.9 2019/11/27 07:26:08 hkenken Exp $ */
+/* $NetBSD: spivar.h,v 1.10 2020/08/04 13:20:45 kardel Exp $ */
 
 /*-
  * Copyright (c) 2006 Urbana-Champaign Independent Media Center.
@@ -111,7 +111,7 @@ struct spi_chunk {
 struct spi_transfer {
 	struct spi_chunk *st_chunks;		/* chained bufs */
 	SIMPLEQ_ENTRY(spi_transfer) st_chain;	/* chain of submitted jobs */
-	int		st_flags;
+	volatile int	st_flags;
 	int		st_errno;
 	int		st_slave;
 	void		*st_private;



CVS commit: src/sys/net

2020-01-16 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Jan 16 13:16:59 UTC 2020

Modified Files:
src/sys/net: if_ethersubr.c

Log Message:
use the CARP interface for arp/nd instead of the carp parent interface.
this provides the correct source mac address for the packets.

there are routers out there that cache the source mac during
nd and then subsequently bypass/miss packet filters on carp
interfaces as they send to the parent interface mac instead of the
correct carp interface mac.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 src/sys/net/if_ethersubr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if_ethersubr.c
diff -u src/sys/net/if_ethersubr.c:1.280 src/sys/net/if_ethersubr.c:1.281
--- src/sys/net/if_ethersubr.c:1.280	Wed Oct 16 18:29:49 2019
+++ src/sys/net/if_ethersubr.c	Thu Jan 16 13:16:59 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ethersubr.c,v 1.280 2019/10/16 18:29:49 christos Exp $	*/
+/*	$NetBSD: if_ethersubr.c,v 1.281 2020/01/16 13:16:59 kardel Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.280 2019/10/16 18:29:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.281 2020/01/16 13:16:59 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -243,7 +243,7 @@ ether_output(struct ifnet * const ifp0, 
 		} else if (m->m_flags & M_MCAST) {
 			ETHER_MAP_IP_MULTICAST((dst)->sin_addr, edst);
 		} else {
-			error = arpresolve(ifp, rt, m, dst, edst, sizeof(edst));
+			error = arpresolve(ifp0, rt, m, dst, edst, sizeof(edst));
 			if (error)
 return (error == EWOULDBLOCK) ? 0 : error;
 		}
@@ -292,7 +292,7 @@ ether_output(struct ifnet * const ifp0, 
 			ETHER_MAP_IPV6_MULTICAST((dst)->sin6_addr,
 			edst);
 		} else {
-			error = nd6_resolve(ifp, rt, m, dst, edst,
+			error = nd6_resolve(ifp0, rt, m, dst, edst,
 			sizeof(edst));
 			if (error)
 return (error == EWOULDBLOCK) ? 0 : error;



CVS commit: src

2020-01-16 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Jan 16 12:56:40 UTC 2020

Modified Files:
src/share/man/man4: carp.4
src/sys/netinet: ip_carp.c ip_carp.h

Log Message:
Provide SIOCGIFMEDIA ioctl to deliver link status.
Add link0 (IFF_LINK0) flag to map INIT state to LINK_STATE_DOWN
instead of LINK_STATE_UNKNOWN. This allows routing software to
suppress routes to the interface of the carp interface when in
init state (e. g. link down in the parent interface).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/share/man/man4/carp.4
cvs rdiff -u -r1.104 -r1.105 src/sys/netinet/ip_carp.c
cvs rdiff -u -r1.10 -r1.11 src/sys/netinet/ip_carp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man4/carp.4
diff -u src/share/man/man4/carp.4:1.6 src/share/man/man4/carp.4:1.7
--- src/share/man/man4/carp.4:1.6	Wed Apr 10 00:18:39 2019
+++ src/share/man/man4/carp.4	Thu Jan 16 12:56:39 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: carp.4,v 1.6 2019/04/10 00:18:39 sevan Exp $
+.\"	$NetBSD: carp.4,v 1.7 2020/01/16 12:56:39 kardel Exp $
 .\"	$OpenBSD: carp.4,v 1.19 2005/08/09 09:52:12 jmc Exp $
 .\"
 .\" Copyright (c) 2003, Ryan McBride.  All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd April 10, 2019
+.Dd January 16, 2020
 .Dt CARP 4
 .Os
 .Sh NAME
@@ -76,6 +76,20 @@ or through the
 .Dv SIOCSVH
 ioctl.
 .Pp
+Setting the
+.Cm link0
+parameter will cause the carp interface to report
+.Dv LINK_STATE_DOWN
+in non
+.Dv MASTER/BACKUP
+mode instead of
+.Dv LINK_STATE_UNKNOWN
+as link status.
+This prevents routing software to announce routes for the carp
+interface when in
+.Dv INIT
+mode.
+.Pp
 Additionally, there are a number of global parameters which can be set using
 .Xr sysctl 8 :
 .Bl -tag -width xx

Index: src/sys/netinet/ip_carp.c
diff -u src/sys/netinet/ip_carp.c:1.104 src/sys/netinet/ip_carp.c:1.105
--- src/sys/netinet/ip_carp.c:1.104	Sun Nov 10 21:16:38 2019
+++ src/sys/netinet/ip_carp.c	Thu Jan 16 12:56:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_carp.c,v 1.104 2019/11/10 21:16:38 chs Exp $	*/
+/*	$NetBSD: ip_carp.c,v 1.105 2020/01/16 12:56:40 kardel Exp $	*/
 /*	$OpenBSD: ip_carp.c,v 1.113 2005/11/04 08:11:54 mcbride Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.104 2019/11/10 21:16:38 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 1.105 2020/01/16 12:56:40 kardel Exp $");
 
 /*
  * TODO:
@@ -67,6 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip_carp.c,v 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -122,6 +123,7 @@ struct carp_softc {
 #define	sc_carpdev	sc_ac.ec_if.if_carpdev
 	int ah_cookie;
 	int lh_cookie;
+	struct ifmedia  sc_im;	/* ifmedia for link status */
 	struct ip_moptions sc_imo;
 #ifdef INET6
 	struct ip6_moptions sc_im6o;
@@ -233,6 +235,9 @@ static int	carp_clone_destroy(struct ifn
 static int	carp_ether_addmulti(struct carp_softc *, struct ifreq *);
 static int	carp_ether_delmulti(struct carp_softc *, struct ifreq *);
 static void	carp_ether_purgemulti(struct carp_softc *);
+static int  carp_mediachange(struct ifnet *ifp);
+static void	carp_mediastatus(struct ifnet *ifp, struct ifmediareq *imr);
+static void	carp_update_link_state(struct carp_softc *sc);
 
 static void	sysctl_net_inet_carp_setup(struct sysctllog **);
 
@@ -893,6 +898,8 @@ carp_clone_create(struct if_clone *ifc, 
 
 		return rv;
 	}
+	ifmedia_init(>sc_im, 0, carp_mediachange, carp_mediastatus);
+	sc->sc_im.ifm_media = IFM_CARP;
 	ether_ifattach(ifp, NULL);
 	carp_set_enaddr(sc);
 	/* Overwrite ethernet defaults */
@@ -908,6 +915,7 @@ carp_clone_destroy(struct ifnet *ifp)
 {
 	struct carp_softc *sc = ifp->if_softc;
 
+	ifmedia_delete_instance(>sc_im, IFM_INST_ANY);
 	carpdetach(ifp->if_softc);
 	ether_ifdetach(ifp);
 	if_detach(ifp);
@@ -2069,6 +2077,7 @@ carp_ioctl(struct ifnet *ifp, u_long cmd
 			sc->sc_if.if_flags |= IFF_UP;
 			carp_setrun(sc, 0);
 		}
+		carp_update_link_state(sc);
 		break;
 
 	case SIOCSVH:
@@ -2174,6 +2183,10 @@ carp_ioctl(struct ifnet *ifp, u_long cmd
 			error = 0;
 		break;
 
+case SIOCGIFMEDIA:
+		error = ifmedia_ioctl(ifp, ifr, >sc_im, cmd);
+		break;
+
 	default:
 		error = ether_ioctl(ifp, cmd, data);
 	}
@@ -2209,11 +,32 @@ carp_output(struct ifnet *ifp, struct mb
 	}
 }
 
+static int
+carp_mediachange(struct ifnet *ifp)
+{
+return (0);
+}
+
+static void
+carp_mediastatus(struct ifnet *ifp, struct ifmediareq *imr)
+{
+switch (ifp->if_link_state) {
+case LINK_STATE_UP:
+imr->ifm_status = IFM_AVALID | IFM_ACTIVE;
+break;
+case LINK_STATE_DOWN:
+imr->ifm_status = IFM_AVALID;
+break;
+default:
+imr->ifm_status = 0;
+break;
+ 

CVS commit: src/sys/ufs/ffs

2019-04-14 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Apr 14 15:55:24 UTC 2019

Modified Files:
src/sys/ufs/ffs: ffs_alloc.c

Log Message:
PR/53990, PR/52380, PR/52102: UFS2 cylinder group inode allocation botch

Fix rare allocation botch in ffs_nodealloccg().

Conditions:
   a) less than
#_of_initialized_inodes(cg->cg_initediblk)
- inodes_per_filesystem_block
  are allocated in the cylinder group
   b) cg->cg_irotor points to a uninterupted run of
  allocated inodes in the inode bitmap up to the
  end of dynamically initialized inodes
  (cg->cg_initediblk)

In this case the next inode after this run was returned
without initializing the respective inode block. As the
block is not initialized these inodes could trigger panics
on inode consistency due to old (uninitialized) disk data.

In very rare cases data loss could occur when
the uninitialized inode block is initialized via the
normal mechanism.
Further conditions to occur after the above:
   c) no panic
   d) no (forced) fsck
   e) and more than cg->cg_initediblk - inodes_per_filesystem_block
  allocated inodes.

Fix:
Always insure allocation always in initialized inode range
extending the initialized inode range as needed.

Add KASSERTMSG() safeguards.

ok hannken@


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/ufs/ffs/ffs_alloc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ffs/ffs_alloc.c
diff -u src/sys/ufs/ffs/ffs_alloc.c:1.163 src/sys/ufs/ffs/ffs_alloc.c:1.164
--- src/sys/ufs/ffs/ffs_alloc.c:1.163	Mon Dec 10 20:48:34 2018
+++ src/sys/ufs/ffs/ffs_alloc.c	Sun Apr 14 15:55:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_alloc.c,v 1.163 2018/12/10 20:48:34 jdolecek Exp $	*/
+/*	$NetBSD: ffs_alloc.c,v 1.164 2019/04/14 15:55:24 kardel Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.163 2018/12/10 20:48:34 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_alloc.c,v 1.164 2019/04/14 15:55:24 kardel Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -1259,7 +1259,7 @@ ffs_nodealloccg(struct inode *ip, int cg
 	struct buf *bp, *ibp;
 	u_int8_t *inosused;
 	int error, start, len, loc, map, i;
-	int32_t initediblk;
+	int32_t initediblk, maxiblk, irotor;
 	daddr_t nalloc;
 	struct ufs2_dinode *dp2;
 	const int needswap = UFS_FSNEEDSWAP(fs);
@@ -1271,7 +1271,13 @@ ffs_nodealloccg(struct inode *ip, int cg
 		return (0);
 	mutex_exit(>um_lock);
 	ibp = NULL;
-	initediblk = -1;
+	if (fs->fs_magic == FS_UFS2_MAGIC) {
+		initediblk = -1;
+	} else {
+		initediblk = fs->fs_ipg;
+	}
+	maxiblk = initediblk;
+
 retry:
 	error = bread(ip->i_devvp, FFS_FSBTODB(fs, cgtod(fs, cg)),
 		(int)fs->fs_cgsize, B_MODIFY, );
@@ -1291,7 +1297,8 @@ retry:
 	 * Check to see if we need to initialize more inodes.
 	 */
 	if (fs->fs_magic == FS_UFS2_MAGIC && ibp == NULL) {
-		initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+	initediblk = ufs_rw32(cgp->cg_initediblk, needswap);
+		maxiblk = initediblk;
 		nalloc = fs->fs_ipg - ufs_rw32(cgp->cg_cs.cs_nifree, needswap);
 		if (nalloc + FFS_INOPB(fs) > initediblk &&
 		initediblk < ufs_rw32(cgp->cg_niblk, needswap)) {
@@ -1307,6 +1314,9 @@ retry:
 			FFS_NOBLK, fs->fs_bsize, false, );
 			if (error)
 goto fail;
+
+			maxiblk += FFS_INOPB(fs);
+			
 			goto retry;
 		}
 	}
@@ -1316,14 +1326,22 @@ retry:
 	(fs->fs_old_flags & FS_FLAGS_UPDATED))
 		cgp->cg_time = ufs_rw64(time_second, needswap);
 	inosused = cg_inosused(cgp, needswap);
+	
 	if (ipref) {
 		ipref %= fs->fs_ipg;
-		if (isclr(inosused, ipref))
+		/* safeguard to stay in (to be) allocated range */
+		if (ipref < maxiblk && isclr(inosused, ipref))
 			goto gotit;
 	}
-	start = ufs_rw32(cgp->cg_irotor, needswap) / NBBY;
-	len = howmany(fs->fs_ipg - ufs_rw32(cgp->cg_irotor, needswap),
-		NBBY);
+
+	irotor = ufs_rw32(cgp->cg_irotor, needswap); 
+
+	KASSERTMSG(irotor < initediblk, "%s: allocation botch: cg=%d, irotor %d"
+		   " out of bounds, initediblk=%d",
+		   __func__, cg, irotor, initediblk);
+
+	start = irotor / NBBY;
+	len = howmany(maxiblk - irotor, NBBY);
 	loc = skpc(0xff, len, [start]);
 	if (loc == 0) {
 		len = start + 1;
@@ -1341,9 +1359,17 @@ retry:
 	if (map == 0) {
 		panic("%s: block not in map: fs=%s", __func__, fs->fs_fsmnt);
 	}
+	
 	ipref = i * NBBY + ffs(map) - 1;
+
 	cgp->cg_irotor = ufs_rw32(ipref, needswap);
+
 gotit:
+	KASSERTMSG(ipref < maxiblk, "%s: allocation botch: cg=%d attempt to "
+		   "allocate inode index %d beyond max allocated index %d"
+		   " of %d inodes/cg",
+		   __func__, cg, (int)ipref, maxiblk, cgp->cg_niblk);
+
 	UFS_WAPBL_REGISTER_INODE(ip->i_ump->um_mountp, cg * fs->fs_ipg + ipref,
 	mode);
 	/*



CVS commit: src/sys/dev

2019-03-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Mar 28 10:44:29 UTC 2019

Modified Files:
src/sys/dev/scsipi: scsi_spc.h scsiconf.c scsipi_base.c scsipiconf.c
scsipiconf.h
src/sys/dev/usb: umass_scsipi.c

Log Message:
Add reading of supported opcodes and their timeouts
at attachment time. Though this information is optional,
it allows to override our fixed timeouts with device
provided timeouts. These timeouts will override the
hardcoded values if the device provided timeouts
exceed the hardcoded values and are less than a day.

Using the device provided timeouts avoids premature
device resets and unreliable operation due to
inadequate timeouts.

Due to the limited implementations of USB
umass devices this feature is disabled for all
umass attached devices.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/scsipi/scsi_spc.h
cvs rdiff -u -r1.283 -r1.284 src/sys/dev/scsipi/scsiconf.c
cvs rdiff -u -r1.181 -r1.182 src/sys/dev/scsipi/scsipi_base.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/scsipi/scsipiconf.c
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/scsipi/scsipiconf.h
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/umass_scsipi.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/scsi_spc.h
diff -u src/sys/dev/scsipi/scsi_spc.h:1.5 src/sys/dev/scsipi/scsi_spc.h:1.6
--- src/sys/dev/scsipi/scsi_spc.h:1.5	Sat Feb  6 23:13:59 2010
+++ src/sys/dev/scsipi/scsi_spc.h	Thu Mar 28 10:44:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsi_spc.h,v 1.5 2010/02/06 23:13:59 cegger Exp $	*/
+/*	$NetBSD: scsi_spc.h,v 1.6 2019/03/28 10:44:29 kardel Exp $	*/
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -406,6 +406,70 @@ struct scsi_reserve_release_10_idparam {
  */
 
 /*
+ * MAINTENANCE_IN[REPORT SUPPORTED OPERATION CODES]
+ */
+#define SCSI_MAINTENANCE_IN		0xA3
+
+struct scsi_repsuppopcode {
+	u_int8_t opcode;
+	u_int8_t svcaction;
+#define RSOC_REPORT_SUPPORTED_OPCODES	0x0C
+
+	u_int8_t repoption;
+#define RSOC_ALL   0x00 /* report all */
+#define RSOC_ONE   0x01 /* report one */
+#define RSOC_ONESACD   0x02 /* report one or CHECK CONDITION */
+#define RSOC_ONESA 0x03 /* report one mark presense in data */
+#define RSOC_RCTD  0x80 /* report timeouts */
+
+	u_int8_t reqopcode;
+	u_int8_t reqsvcaction[2];
+	u_int8_t alloclen[4];
+	u_int8_t _res0;
+	u_int8_t control;
+};
+
+struct scsi_repsupopcode_all_commands_descriptor {
+u_int8_t opcode;
+u_int8_t _res0;
+u_int8_t serviceaction[2];
+u_int8_t _res1;
+u_int8_t flags;
+#define RSOC_ACD_CTDP 0x02/* timeouts present */
+#define RSOC_ACD_SERVACTV 0x01/* service action valid */
+u_int8_t cdblen[2];
+};
+
+struct scsi_repsupopcode_one_command_descriptor {
+u_int8_t _res0;
+u_int8_t support;
+#define RSOC_OCD_CTDP  0x80 /* timeouts present */
+#define RSOC_OCD_SUP_NOT_AVAIL 0x00 /* not available */
+#define RSOC_OCD_SUP_NOT_SUPP  0x01 /* not supported */
+#define RSOC_OCD_SUP_SUPP_STD  0x03 /* supported - standard */
+#define RSOC_OCD_SUP_SUPP_VENDOR   0x05 /* supported - vendor */
+#define RSOC_OCD_SUP   0x07 /* mask for support field */
+
+u_int8_t cdblen[2];
+/*
+	 * u_int8_t usage[0...]- cdblen bytes
+	 * usage data
+	 */
+	/*
+	 * scsi_repsupopcode_timeouts_descriptor
+	 * if  RSOC_OCD_CTDP is set
+	 */
+};
+
+struct scsi_repsupopcode_timeouts_descriptor {
+u_int8_t descriptor_length[2];
+u_int8_t _res0;
+u_int8_t cmd_specific;
+u_int8_t nom_process_timeout[4];
+u_int8_t cmd_process_timeout[4];
+};
+
+/*
  * REQUEST SENSE
  */
 

Index: src/sys/dev/scsipi/scsiconf.c
diff -u src/sys/dev/scsipi/scsiconf.c:1.283 src/sys/dev/scsipi/scsiconf.c:1.284
--- src/sys/dev/scsipi/scsiconf.c:1.283	Sat Jan 12 13:59:53 2019
+++ src/sys/dev/scsipi/scsiconf.c	Thu Mar 28 10:44:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsiconf.c,v 1.283 2019/01/12 13:59:53 tsutsui Exp $	*/
+/*	$NetBSD: scsiconf.c,v 1.284 2019/03/28 10:44:29 kardel Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.283 2019/01/12 13:59:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.284 2019/03/28 10:44:29 kardel Exp $");
 
 #include 
 #include 
@@ -500,9 +500,11 @@ scsibusprint(void *aux, const char *pnp)
 	strnvisx(revision, sizeof(revision), inqbuf->revision, 4,
 	VIS_TRIM|VIS_SAFE|VIS_OCTAL);
 
-	aprint_normal(" target %d lun %d: <%s, %s, %s> %s %s",
-	target, lun, vendor, product, revision, dtype,
-	inqbuf->removable ? "removable" : "fixed");
+	aprint_normal(" target %d lun %d: <%s, %s, %s> %s %s%s",
+		  target, lun, vendor, product, revision, dtype,
+		  inqbuf->removable ? "removable" : "fixed",
+		  

CVS commit: src/sys/dev/pci

2019-03-11 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Mar 11 14:35:22 UTC 2019

Modified Files:
src/sys/dev/pci: mpii.c

Log Message:
PR/54045

fix mpii to adhere to physio diagnostic invariant that
fully processed data must not post an error:
1) verify expected scspi state via KASSERT() instead of just
   setting the variables.
2) set xs->resid only in known good conditions
3) insure setting errors in all error paths and refrain
   from clearing xs->resid in error paths.

While there do some cosmectic clean up:
1) extend and relocate some debug output
2) mpii HBAs can also manage non-disk devices like tapes etc,
   so log that physical "devices" instead of physical "disks" are
   attached or detached.

Tested with NEOSeries FlexStor II and luckily a broken tape drive 8-(

mpii0 at pci1 dev 0 function 0: vendor 1000 product 00ab (rev. 0x01)
mpii0: interrupting at irq 11
mpii0: HBA 9400-8i8e, firmware 3.0.4.0, MPI 2.6
mpii0: physical device inserted in slot 9
mpii0: physical device inserted in slot 13
mpii0: physical device inserted in slot 16
st0 at scsibus0 target 9 lun 0:  tape removable
st0: density code 92, variable blocks, write-enabled
ch0 at scsibus0 target 9 lun 1:  changer removable
ch0: 23 slots, 2 drives, 1 picker, 1 portal
st0: tagged queueing
ch0: tagged queueing
st1 at scsibus0 target 13 lun 0:  tape removable
st1: density code 92, variable blocks, write-enabled
st1: tagged queueing
ses0 at scsibus0 target 16 lun 0:  enclosure services fixed

Note: pullup-8


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.21 src/sys/dev/pci/mpii.c:1.22
--- src/sys/dev/pci/mpii.c:1.21	Sun Feb  3 03:19:27 2019
+++ src/sys/dev/pci/mpii.c	Mon Mar 11 14:35:22 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.21 2019/02/03 03:19:27 mrg Exp $ */
+/* $NetBSD: mpii.c,v 1.22 2019/03/11 14:35:22 kardel Exp $ */
 /*	$OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $	*/
 /*
  * Copyright (c) 2010, 2012 Mike Belopuhov
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.21 2019/02/03 03:19:27 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.22 2019/03/11 14:35:22 kardel Exp $");
 
 #include "bio.h"
 
@@ -1921,7 +1921,7 @@ mpii_event_sas(struct mpii_softc *sc, st
 free(dev, M_DEVBUF);
 break;
 			}
-			printf("%s: physical disk inserted in slot %d\n",
+			printf("%s: physical device inserted in slot %d\n",
 			DEVNAME(sc), dev->slot);
 			mutex_exit(>sc_devs_mtx);
 			break;
@@ -1995,7 +1995,7 @@ mpii_event_sas_work(struct work *wq, voi
 }
 
 printf(
-"%s: physical disk removed from slot %d\n",
+"%s: physical device removed from slot %d\n",
 DEVNAME(sc), dev->slot);
 mpii_remove_dev(sc, dev);
 mutex_exit(>sc_devs_mtx);
@@ -3022,8 +3022,8 @@ mpii_scsipi_request(struct scsipi_channe
 		scsipi_done(xs);
 		return;
 	}
-	DNPRINTF(MPII_D_CMD, "%s: ccb_smid: %d xs->xs_control: 0x%x\n",
-	DEVNAME(sc), ccb->ccb_smid, xs->xs_control);
+	DNPRINTF(MPII_D_CMD, "%s: ccb_smid: %d xs->cmd->opcode: 0x%02x xs->xs_control: 0x%x\n",
+	DEVNAME(sc), ccb->ccb_smid, xs->cmd->opcode, xs->xs_control);
 
 	ccb->ccb_cookie = xs;
 	ccb->ccb_done = mpii_scsi_cmd_done;
@@ -3221,13 +3221,14 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
 
 		bus_dmamap_unload(sc->sc_dmat, dmap);
 	}
-
-	xs->error = XS_NOERROR;
-	xs->resid = 0;
-
+	
+	KASSERT(xs->error == XS_NOERROR);
+	KASSERT(xs->resid == xs->datalen);
+	KASSERT(xs->status == SCSI_OK);
+	
 	if (ccb->ccb_rcb == NULL) {
 		/* no scsi error, we're ok so drop out early */
-		xs->status = SCSI_OK;
+		xs->resid = 0;
 		goto done;
 	}
 
@@ -3278,9 +3279,11 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
 	case MPII_IOCSTATUS_SCSI_RECOVERED_ERROR:
 		switch (sie->scsi_status) {
 		case MPII_SCSIIO_STATUS_GOOD:
+			xs->resid = 0;
 			break;
 
 		case MPII_SCSIIO_STATUS_CHECK_COND:
+			xs->resid = 0;
 			xs->error = XS_SENSE;
 			break;
 
@@ -3319,12 +3322,14 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
 	if (sie->scsi_state & MPII_SCSIIO_STATE_AUTOSENSE_VALID)
 		memcpy(>sense, sense, sizeof(xs->sense));
 
-	DNPRINTF(MPII_D_CMD, "%s:  xs err: %d status: %#x\n", DEVNAME(sc),
-	xs->error, xs->status);
-
 	mpii_push_reply(sc, ccb->ccb_rcb);
-done:
+
+ done:
 	mpii_put_ccb(sc, ccb);
+
+	DNPRINTF(MPII_D_CMD, "%s: xs err: %d status: %#x len: %d resid: %d\n",
+		 DEVNAME(sc), xs->error, xs->status, xs->datalen, xs->resid);
+
 	scsipi_done(xs);
 }
 



CVS commit: src/sys/dev/scsipi

2019-02-12 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Feb 12 13:49:13 UTC 2019

Modified Files:
src/sys/dev/scsipi: files.scsipi

Log Message:
 Fix, but disable the commented SUN compatibility in st.c to write
 final file marks by opening and immediately closing the device
 in O_WRONLY mode. That code has not been working since around 1998.
 It can now be enabled with options ST_SUNCOMPAT.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/dev/scsipi/files.scsipi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/files.scsipi
diff -u src/sys/dev/scsipi/files.scsipi:1.41 src/sys/dev/scsipi/files.scsipi:1.42
--- src/sys/dev/scsipi/files.scsipi:1.41	Sun Dec 11 12:23:50 2005
+++ src/sys/dev/scsipi/files.scsipi	Tue Feb 12 13:49:13 2019
@@ -1,11 +1,12 @@
-#	$NetBSD: files.scsipi,v 1.41 2005/12/11 12:23:50 christos Exp $
+#	$NetBSD: files.scsipi,v 1.42 2019/02/12 13:49:13 kardel Exp $
 #
 # Config file and device description for machine-independent SCSI code.
 # Included by ports that need it.  Ports that use it must provide
 # their own "major" declarations for the appropriate devices.
 
 defflag	opt_scsi.h		SCSIVERBOSE ST_ENABLE_EARLYWARN
-SES_ENABLE_PASSTHROUGH SCSI_OLD_NOINQUIRY
+ST_SUNCOMPAT SES_ENABLE_PASSTHROUGH
+SCSI_OLD_NOINQUIRY
 defparam opt_scsi.h		ST_MOUNT_DELAY SDRETRIES SD_IO_TIMEOUT
 
 defflag	opt_scsipi_debug.h	SCSIPI_DEBUG



CVS commit: src/sys/dev/scsipi

2019-02-12 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Feb 12 13:43:40 UTC 2019

Modified Files:
src/sys/dev/scsipi: st.c

Log Message:
Fix PR kern/53949:

Fix inconsistent/incomplete file mark handling to conform again
to mtio(4) at close(2) time. This was necessary as the PREVENT/ALLOW
bracket was reduced from a whole mount session to cover only the
open(2)/close(2) time on ~2002-03-22. The rationale was to allow
robots and humans to change the media during a mount session.

Unfortunately this lead to file marks being written to potentially other
media at the beginning on drives that used the two file marks as EOM
pattern. In order for that to happen the media had to be removed after
data and at most one file mark had been written before removal.

The mount error message has been clarified and a warning about
potential data/file mark lossage on UNIT ATTENTION
during an active mount session with unfinished file marks has been
added.

While there, fix, but disable the commented SUN compatibility to write
final file marks by opening and immediately closing the device
in O_WRONLY mode. That code has not been working since around 1998.
It can now be enabled with options ST_SUNCOMPAT.

Additionally debug output coverage has been extended.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/sys/dev/scsipi/st.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/st.c
diff -u src/sys/dev/scsipi/st.c:1.235 src/sys/dev/scsipi/st.c:1.236
--- src/sys/dev/scsipi/st.c:1.235	Sun Feb  3 03:19:28 2019
+++ src/sys/dev/scsipi/st.c	Tue Feb 12 13:43:40 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: st.c,v 1.235 2019/02/03 03:19:28 mrg Exp $ */
+/*	$NetBSD: st.c,v 1.236 2019/02/12 13:43:40 kardel Exp $ */
 
 /*-
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.235 2019/02/03 03:19:28 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.236 2019/02/12 13:43:40 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_scsi.h"
@@ -615,8 +615,30 @@ stopen(dev_t dev, int flags, int mode, s
 		 */
 		if ((st->flags & ST_MOUNTED) || ST_MOUNT_DELAY == 0 ||
 		(st->mt_key != SKEY_NOT_READY)) {
-			device_printf(st->sc_dev, "mount error (key=%d)\n",
-st->mt_key);
+			device_printf(st->sc_dev,
+  "mount error (sense key=%d) - "
+  "terminating mount session\n",
+  st->mt_key);
+			/*
+			 * the following should not trigger unless
+			 * something serious happened while the device
+			 * was open (PREVENT MEDIUM REMOVAL in effect)
+			 */
+			if (st->flags & ST_WRITTEN &&
+			st->mt_key == SKEY_UNIT_ATTENTION) {
+/*
+ * device / media state may have changed
+ * refrain from writing missing file marks
+ * onto potentially newly inserted/formatted
+ * media (e. g. emergency EJECT/RESET/etc.)
+ */
+st->flags &= ~(ST_WRITTEN|ST_FM_WRITTEN);
+
+device_printf(st->sc_dev,
+"CAUTION: file marks/data may be missing"
+" - ASC = 0x%02x, ASCQ = 0x%02x\n",
+	  st->asc, st->ascq);
+			}
 			goto bad;
 		}
 
@@ -727,15 +749,30 @@ stclose(dev_t dev, int flags, int mode, 
 	 */
 
 	stxx = st->flags & (ST_WRITTEN | ST_FM_WRITTEN);
-	if (((flags & FWRITE) && stxx == ST_WRITTEN) ||
-	((flags & O_ACCMODE) == FWRITE && stxx == 0)) {
-		int nm;
+	if ((flags & FWRITE) != 0) {
+		int nm = 0;
+#ifdef ST_SUNCOMPAT
+		/*
+		 * on request only
+		 * original compat code has not been working
+		 * since ~1998
+		 */
+		if ((flags & O_ACCMODE) == FWRITE && (stxx == 0)) {
+			st->flags |= ST_WRITTEN;
+			SC_DEBUG(st->sc_periph, SCSIPI_DB3,
+ ("SUN compatibility: write FM(s) at close\n"));
+	}
+#endif
 		error = st_check_eod(st, FALSE, , 0);
+		SC_DEBUG(st->sc_periph, SCSIPI_DB3,
+			 ("wrote %d FM(s) at close error=%d\n", nm, error));
 	}
 
 	/* Allow robots to eject tape if needed.  */
-	scsipi_prevent(periph, SPAMR_ALLOW,
-	XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
+	if (!(st->quirks & ST_Q_NOPREVENT)) {
+		scsipi_prevent(periph, SPAMR_ALLOW,
+		XS_CTL_IGNORE_ILLEGAL_REQUEST | XS_CTL_IGNORE_NOT_READY);
+	}
 
 	switch (STMODE(dev)) {
 	case NORMAL_MODE:
@@ -769,18 +806,28 @@ stclose(dev_t dev, int flags, int mode, 
 			 * If both statements are true, then we backspace
 			 * one filemark.
 			 */
+			stxx &= ~ST_FM_WRITTEN;
 			stxx |= (st->flags & ST_2FM_AT_EOD);
 			if ((flags & FWRITE) != 0 &&
 			(stxx == (ST_2FM_AT_EOD|ST_WRITTEN))) {
 error = st_space(st, -1, SP_FILEMARKS, 0);
+SC_DEBUG(st->sc_periph, SCSIPI_DB3, ("st_space(-1) error=%d\n", error));
+			} else {
+SC_DEBUG(st->sc_periph, SCSIPI_DB3, ("no backspacing - flags = 0x%x, stxx=0x%x, st->flags=0x%x\n", flags, stxx, st->flags));
 			}
+		} else {
+			SC_DEBUG(st->sc_periph, SCSIPI_DB3, ("error %d from 

CVS commit: src/sys/dev/pci

2018-12-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Dec 28 15:06:07 UTC 2018

Modified Files:
src/sys/dev/pci: mpii.c

Log Message:
fix LUN handling (byte order issue)

now ch0 on a NEOSeries FlexStor II is detected again on LUN 1
this is a regression introduced in 1.15 update and 1.8.10.3 pullup

Tested with NEOSeries FlexStor II:
mpii0 at pci1 dev 0 function 0: vendor 1000 product 00ab (rev. 0x01)
mpii0: interrupting at irq 11
mpii0: HBA 9400-8i8e, firmware 3.0.4.0, MPI 2.6
mpii0: physical disk inserted in slot 9
mpii0: physical disk inserted in slot 13
mpii0: physical disk inserted in slot 16
st0 at scsibus0 target 9 lun 0:  tape removable
st0: drive empty
st0: tagged queueing
st1 at scsibus0 target 13 lun 0:  tape removable
st1: drive empty
ch0 at scsibus0 target 13 lun 1:  changer removable
ch0: 23 slots, 2 drives, 1 picker, 1 portal
st1: tagged queueing
ch0: tagged queueing
ses0 at scsibus0 target 16 lun 0:  enclosure services fixed
ses0: SCSI-3 SES Device


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.18 src/sys/dev/pci/mpii.c:1.19
--- src/sys/dev/pci/mpii.c:1.18	Wed Dec  5 10:38:22 2018
+++ src/sys/dev/pci/mpii.c	Fri Dec 28 15:06:07 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.18 2018/12/05 10:38:22 bouyer Exp $ */
+/* $NetBSD: mpii.c,v 1.19 2018/12/28 15:06:07 kardel Exp $ */
 /*	$OpenBSD: mpii.c,v 1.115 2018/08/14 05:22:21 jmatthew Exp $	*/
 /*
  * Copyright (c) 2010, 2012 Mike Belopuhov
@@ -20,7 +20,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.18 2018/12/05 10:38:22 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mpii.c,v 1.19 2018/12/28 15:06:07 kardel Exp $");
 
 #include "bio.h"
 
@@ -3036,7 +3036,7 @@ mpii_scsipi_request(struct scsipi_channe
 	io->sgl_offset0 = sizeof(struct mpii_msg_scsi_io) / 4;
 	io->io_flags = htole16(xs->cmdlen);
 	io->dev_handle = htole16(ccb->ccb_dev_handle);
-	io->lun[0] = htole16(periph->periph_lun);
+	io->lun[0] = htobe16(periph->periph_lun);
 
 	switch (xs->xs_control & (XS_CTL_DATA_IN | XS_CTL_DATA_OUT)) {
 	case XS_CTL_DATA_IN:



CVS commit: src/sys/arch/x86/pci

2018-01-27 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Jan 27 21:24:30 UTC 2018

Modified Files:
src/sys/arch/x86/pci: amdsmn.c

Log Message:
rescan amdsmnbus instead of amdsmn (fixes panic)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/pci/amdsmn.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/pci/amdsmn.c
diff -u src/sys/arch/x86/pci/amdsmn.c:1.2 src/sys/arch/x86/pci/amdsmn.c:1.3
--- src/sys/arch/x86/pci/amdsmn.c:1.2	Thu Jan 25 23:37:33 2018
+++ src/sys/arch/x86/pci/amdsmn.c	Sat Jan 27 21:24:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdsmn.c,v 1.2 2018/01/25 23:37:33 pgoyette Exp $	*/
+/*	$NetBSD: amdsmn.c,v 1.3 2018/01/27 21:24:30 kardel Exp $	*/
 
 /*-
  * Copyright (c) 2017 Conrad Meyer 
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.2 2018/01/25 23:37:33 pgoyette Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdsmn.c,v 1.3 2018/01/27 21:24:30 kardel Exp $ ");
 
 /*
  * Driver for the AMD Family 17h CPU System Management Network.
@@ -101,7 +101,7 @@ amdsmn_attach(device_t parent, device_t 
 	sc->pc = pa->pa_pc;
 	sc->pcitag = pa->pa_tag;
 	aprint_normal(": AMD Family 17h System Management Network\n");
-	amdsmn_rescan(self, "amdsmn", );
+	amdsmn_rescan(self, "amdsmnbus", );
 }
 
 static int



CVS commit: src/sbin/raidctl

2017-11-20 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Nov 20 18:37:56 UTC 2017

Modified Files:
src/sbin/raidctl: raidctl.8 rf_configure.c

Log Message:
support NAME= syntax for disks and spares


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/sbin/raidctl/raidctl.8
cvs rdiff -u -r1.26 -r1.27 src/sbin/raidctl/rf_configure.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/raidctl/raidctl.8
diff -u src/sbin/raidctl/raidctl.8:1.72 src/sbin/raidctl/raidctl.8:1.73
--- src/sbin/raidctl/raidctl.8:1.72	Mon Jul  3 21:33:42 2017
+++ src/sbin/raidctl/raidctl.8	Mon Nov 20 18:37:56 2017
@@ -1,4 +1,4 @@
-.\" $NetBSD: raidctl.8,v 1.72 2017/07/03 21:33:42 wiz Exp $
+.\" $NetBSD: raidctl.8,v 1.73 2017/11/20 18:37:56 kardel Exp $
 .\"
 .\" Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -388,6 +388,7 @@ START disks
 .Ed
 .Pp
 specifies the three component disks to be used in the RAID device.
+Disk wedges may also be specified with the NAME= syntax.
 If any of the specified drives cannot be found when the RAID device is
 configured, then they will be marked as
 .Sq failed ,

Index: src/sbin/raidctl/rf_configure.c
diff -u src/sbin/raidctl/rf_configure.c:1.26 src/sbin/raidctl/rf_configure.c:1.27
--- src/sbin/raidctl/rf_configure.c:1.26	Wed Mar  9 19:53:32 2016
+++ src/sbin/raidctl/rf_configure.c	Mon Nov 20 18:37:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: rf_configure.c,v 1.26 2016/03/09 19:53:32 christos Exp $	*/
+/*	$NetBSD: rf_configure.c,v 1.27 2017/11/20 18:37:56 kardel Exp $	*/
 
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
@@ -49,7 +49,7 @@
 #include 
 
 #ifndef lint
-__RCSID("$NetBSD: rf_configure.c,v 1.26 2016/03/09 19:53:32 christos Exp $");
+__RCSID("$NetBSD: rf_configure.c,v 1.27 2017/11/20 18:37:56 kardel Exp $");
 #endif
 
 
@@ -58,6 +58,7 @@ __RCSID("$NetBSD: rf_configure.c,v 1.26 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -72,6 +73,7 @@ char   *rf_find_white(char *p);
 #define RF_ERRORMSG(s)printf((s))
 #define RF_ERRORMSG1(s,a) printf((s),(a))
 #define RF_ERRORMSG2(s,a,b)   printf((s),(a),(b))
+#define RF_ERRORMSG3(s,a,b,c) printf((s),(a),(b),(c))
 
 int distSpareYes = 1;
 int distSpareNo = 0;
@@ -231,12 +233,25 @@ rf_MakeConfig(char *configname, RF_Confi
 	}
 	for (r = 0; r < cfgPtr->numRow; r++) {
 		for (c = 0; c < cfgPtr->numCol; c++) {
+			char b1[80];
+			const char *b;
+
 			if (rf_get_next_nonblank_line(
-			>devnames[r][c][0], 50, fp, NULL)) {
+			buf, sizeof(buf), fp, NULL)) {
 RF_ERRORMSG2("Config file error: unable to get device file for disk at row %d col %d\n", r, c);
 retcode = -1;
 goto out;
 			}
+
+		b = getfsspecname(b1, sizeof(b1), buf);
+if (b == NULL) {
+RF_ERRORMSG3(
+"Config file error: warning: unable to get device file for disk at row %d col %d: %s\n",
+r, c, b1);
+b = buf;
+			} 
+
+			strncpy(>devnames[r][c][0], b, 50);
 		}
 	}
 
@@ -245,12 +260,23 @@ rf_MakeConfig(char *configname, RF_Confi
 	if (rf_search_file_for_start_of("spare", buf, 256, fp))
 		cfgPtr->numSpare = 0;
 	for (c = 0; c < cfgPtr->numSpare; c++) {
-		if (rf_get_next_nonblank_line(>spare_names[c][0],
-		256, fp, NULL)) {
+		char b1[80];
+		const char *b;
+
+		if (rf_get_next_nonblank_line(buf,
+		sizeof(buf), fp, NULL)) {
 			RF_ERRORMSG1("Config file error: unable to get device file for spare disk %d\n", c);
 			retcode = -1;
 			goto out;
 		}
+
+		b = getfsspecname(b1, sizeof(b1), buf);
+		if (b == NULL) {
+			RF_ERRORMSG2("Config file error: warning: unable to get device file for spare disk %d: %s\n", c, b);
+			b = buf;
+		}
+
+	strncpy(>spare_names[r][0], b, 50);
 	}
 
 	/* scan the file for the block related to layout */



CVS commit: src/sys/netinet6

2017-05-13 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat May 13 20:13:27 UTC 2017

Modified Files:
src/sys/netinet6: mld6.c

Log Message:
avoid a double ifa_release() and thus a panic
when e. g. running ifmcstat
CVS: --
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/netinet6/mld6.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netinet6/mld6.c
diff -u src/sys/netinet6/mld6.c:1.88 src/sys/netinet6/mld6.c:1.89
--- src/sys/netinet6/mld6.c:1.88	Thu Mar  2 09:48:20 2017
+++ src/sys/netinet6/mld6.c	Sat May 13 20:13:26 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: mld6.c,v 1.88 2017/03/02 09:48:20 ozaki-r Exp $	*/
+/*	$NetBSD: mld6.c,v 1.89 2017/05/13 20:13:26 kardel Exp $	*/
 /*	$KAME: mld6.c,v 1.25 2001/01/16 14:14:18 itojun Exp $	*/
 
 /*
@@ -102,7 +102,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.88 2017/03/02 09:48:20 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mld6.c,v 1.89 2017/05/13 20:13:26 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1062,7 +1062,6 @@ in6_multicast_sysctl(SYSCTLFN_ARGS)
 		}
 
 		s = pserialize_read_enter();
-		ifa_release(ifa, _ia);
 
 		break;
 	}



CVS commit: src/sys/dev/pci

2017-03-08 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Mar  8 08:00:09 UTC 2017

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
PR kern/52039: use same safeguard as for the 82578


To generate a diff of this commit:
cvs rdiff -u -r1.496 -r1.497 src/sys/dev/pci/if_wm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.496 src/sys/dev/pci/if_wm.c:1.497
--- src/sys/dev/pci/if_wm.c:1.496	Fri Mar  3 16:48:55 2017
+++ src/sys/dev/pci/if_wm.c	Wed Mar  8 08:00:09 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.496 2017/03/03 16:48:55 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.497 2017/03/08 08:00:09 kardel Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.496 2017/03/03 16:48:55 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.497 2017/03/08 08:00:09 kardel Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -13178,7 +13178,7 @@ wm_enable_wakeup(struct wm_softc *sc)
 
 			/* Assume that the PHY is copper */
 			child = LIST_FIRST(>sc_mii.mii_phys);
-			if (child->mii_mpd_rev <= 2)
+			if ((child != NULL) && (child->mii_mpd_rev <= 2))
 sc->sc_mii.mii_writereg(sc->sc_dev, 1,
 (768 << 5) | 25, 0x0444); /* magic num */
 		}



CVS commit: src/sys/dev/scsipi

2016-09-17 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Sep 17 18:53:13 UTC 2016

Modified Files:
src/sys/dev/scsipi: scsipi_verbose.c

Log Message:
ASC/ASCQ table updated from http://www.t10.org/lists/asc-num.txt 2016-07-30


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/scsipi/scsipi_verbose.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/scsipi_verbose.c
diff -u src/sys/dev/scsipi/scsipi_verbose.c:1.32 src/sys/dev/scsipi/scsipi_verbose.c:1.33
--- src/sys/dev/scsipi/scsipi_verbose.c:1.32	Sun Jul 25 13:49:58 2010
+++ src/sys/dev/scsipi/scsipi_verbose.c	Sat Sep 17 18:53:13 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsipi_verbose.c,v 1.32 2010/07/25 13:49:58 pgoyette Exp $	*/
+/*	$NetBSD: scsipi_verbose.c,v 1.33 2016/09/17 18:53:13 kardel Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scsipi_verbose.c,v 1.32 2010/07/25 13:49:58 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsipi_verbose.c,v 1.33 2016/09/17 18:53:13 kardel Exp $");
 
 #include 
 #include 
@@ -87,26 +87,32 @@ static const struct {
 { 0x00, 0x04, "Beginning-Of-Partition/Medium Detected" },
 { 0x00, 0x05, "End-Of-Data Detected" },
 { 0x00, 0x06, "I/O Process Terminated" },
+{ 0x00, 0x07, "Programmable Early Warning Detected" },
 { 0x00, 0x11, "Audio Play Operation In Progress" },
 { 0x00, 0x12, "Audio Play Operation Paused" },
 { 0x00, 0x13, "Audio Play Operation Successfully Completed" },
-{ 0x00, 0x14, "Audio Play Operation Stopped Due to Error" },
+{ 0x00, 0x14, "Audio Play Operation Stopped Due To Error" },
 { 0x00, 0x15, "No Current Audio Status To Return" },
 { 0x00, 0x16, "Operation In Progress" },
 { 0x00, 0x17, "Cleaning Requested" },
 { 0x00, 0x18, "Erase Operation In Progress" },
 { 0x00, 0x19, "Locate Operation In Progress" },
 { 0x00, 0x1A, "Rewind Operation In Progress" },
-{ 0x00, 0x1B, "Set Capacity Operation In Progess" },
+{ 0x00, 0x1B, "Set Capacity Operation In Progress" },
 { 0x00, 0x1C, "Verify Operation In Progress" },
+{ 0x00, 0x1D, "ATA Pass Through Information Available" },
+{ 0x00, 0x1E, "Conflicting SA Creation Request" },
+{ 0x00, 0x1F, "Logical Unit Transitioning To Another Power Condition" },
+{ 0x00, 0x20, "Extended Copy Information Available" },
+{ 0x00, 0x21, "Atomic Command Aborted Due To ACA" },
 { 0x01, 0x00, "No Index/Sector Signal" },
 { 0x02, 0x00, "No Seek Complete" },
 { 0x03, 0x00, "Peripheral Device Write Fault" },
 { 0x03, 0x01, "No Write Current" },
 { 0x03, 0x02, "Excessive Write Errors" },
 { 0x04, 0x00, "Logical Unit Not Ready, Cause Not Reportable" },
-{ 0x04, 0x01, "Logical Unit Is in Process Of Becoming Ready" },
-{ 0x04, 0x02, "Logical Unit Not Ready, Initialization Command Required" },
+{ 0x04, 0x01, "Logical Unit Is In Process Of Becoming Ready" },
+{ 0x04, 0x02, "Logical Unit Not Ready, Initializing Command Required" },
 { 0x04, 0x03, "Logical Unit Not Ready, Manual Intervention Required" },
 { 0x04, 0x04, "Logical Unit Not Ready, Format In Progress" },
 { 0x04, 0x05, "Logical Unit Not Ready, Rebuild In Progress" },
@@ -118,28 +124,64 @@ static const struct {
 "Transition" },
 { 0x04, 0x0B, "Logical Unit Not Accessible, Target Port In Standby State" },
 { 0x04, 0x0C, "Logical Unit Not Accessible, Target Port In Unavailable State" },
+{ 0x04, 0x0D, "Logical Unit Not Ready, Structure Check Required" },
+{ 0x04, 0x0E, "Logical Unit Not Ready, Security Session In Progress" },
 { 0x04, 0x10, "Logical Unit Not Ready, Auxiliary Memory Not Accessible" },
-{ 0x04, 0x11, "Logical Unit Not Ready, Notify (Enable_Spinup) Required" },
+{ 0x04, 0x11, "Logical Unit Not Ready, Notify (Enable Spinup) Required" },
+{ 0x04, 0x12, "Logical Unit Not Ready, Offline" },
+{ 0x04, 0x13, "Logical Unit Not Ready, SA Creation In Progress" },
+{ 0x04, 0x14, "Logical Unit Not Ready, Space Allocation In Progress" },
+{ 0x04, 0x15, "Logical Unit Not Ready, Robotics Disabled" },
+{ 0x04, 0x16, "Logical Unit Not Ready, Configuration Required" },
+{ 0x04, 0x17, "Logical Unit Not Ready, Calibration Required" },
+{ 0x04, 0x18, "Logical Unit Not Ready, A Door Is Open" },
+{ 0x04, 0x19, "Logical Unit Not Ready, Operating In Sequential Mode" },
+{ 0x04, 0x1A, "Logical Unit Not Ready, Start Stop Unit Command In Progress" },
+{ 0x04, 0x1B, "Logical Unit Not Ready, Sanitize In Progress" },
+{ 0x04, 0x1C, "Logical Unit Not Ready, Additional Power Use Not Yet Granted" },
+{ 0x04, 0x1D, "Logical Unit Not Ready, Configuration In Progress" },
+{ 0x04, 0x1E, "Logical Unit Not Ready, Microcode Activation Required" },
+{ 0x04, 0x1F, "Logical Unit Not Ready, Microcode Download Required" },
+{ 0x04, 0x20, "Logical Unit Not Ready, Logical Unit Reset Required" },
+{ 0x04, 0x21, "Logical Unit Not Ready, Hard Reset Required" },
+{ 0x04, 0x22, "Logical Unit Not Ready, Power Cycle Required" },
+{ 0x04, 0x23, 

CVS commit: src/sys/dev/i2c

2016-07-03 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jul  3 12:26:55 UTC 2016

Modified Files:
src/sys/dev/i2c: hytp14.c hytp14var.h

Log Message:
convert device polling from callout to kthread.
Solves:
- hung initialization on A20 (bananapi)
- allows iic_exec() implementations to use condvars


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/i2c/hytp14.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/hytp14var.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/hytp14.c
diff -u src/sys/dev/i2c/hytp14.c:1.6 src/sys/dev/i2c/hytp14.c:1.7
--- src/sys/dev/i2c/hytp14.c:1.6	Fri Sep 18 17:21:43 2015
+++ src/sys/dev/i2c/hytp14.c	Sun Jul  3 12:26:55 2016
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * Copyright (c) 2014,2016 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -37,7 +37,7 @@
  */ 
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.6 2015/09/18 17:21:43 phx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1.7 2016/07/03 12:26:55 kardel Exp $");
 
 #include 
 #include 
@@ -45,6 +45,9 @@ __KERNEL_RCSID(0, "$NetBSD: hytp14.c,v 1
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -59,9 +62,11 @@ static int hytp14_refresh_sensor(struct 
 static void hytp14_refresh(struct sysmon_envsys *, envsys_data_t *);
 static void hytp14_refresh_humidity(struct hytp14_sc *, envsys_data_t *);
 static void hytp14_refresh_temp(struct hytp14_sc *, envsys_data_t *);
+static void hytp14_thread(void *);
 static int sysctl_hytp14_interval(SYSCTLFN_ARGS);
 
-/*#define HYT_DEBUG 3*/
+/* #define HYT_DEBUG 3 */
+
 #ifdef HYT_DEBUG
 volatile int hythygtemp_debug = HYT_DEBUG;
 
@@ -115,7 +120,7 @@ hytp14_attach(device_t parent, device_t 
 	const struct sysctlnode *rnode, *node;
 	struct hytp14_sc *sc;
 	struct i2c_attach_args *ia;
-	int i;
+	int i, rv;
 
 	ia = aux;
 	sc = device_private(self);
@@ -123,6 +128,12 @@ hytp14_attach(device_t parent, device_t 
 	sc->sc_dev = self;
 	sc->sc_tag = ia->ia_tag;
 	sc->sc_addr = ia->ia_addr;
+
+	mutex_init(>sc_mutex, MUTEX_DEFAULT, IPL_NONE);
+	cv_init(>sc_condvar, "hytcv");
+
+	sc->sc_state = HYTP14_THR_INIT;
+	
 	sc->sc_valid = ENVSYS_SINVALID;
 	sc->sc_numsensors = __arraycount(hytp14_sensors);
 
@@ -180,15 +191,18 @@ hytp14_attach(device_t parent, device_t 
 		sysctl_hytp14_interval, 0, (void *)sc, 0,
 		CTL_HW, rnode->sysctl_num, CTL_CREATE, CTL_EOL);
 
-	aprint_normal(": HYT-221/271/939 humidity and temperature sensor\n");
 
-	/* set up callout for the default measurement interval */
+	/* set up the default measurement interval for worker thread */
 	sc->sc_mrinterval = HYTP14_MR_INTERVAL;
-	callout_init(>sc_mrcallout, 0);
-	callout_setfunc(>sc_mrcallout, hytp14_measurement_request, sc);
 
-	/* issue initial measurement request */
-	hytp14_measurement_request(sc);
+	/* create worker kthread */
+	rv = kthread_create(PRI_NONE, KTHREAD_MUSTJOIN, NULL,
+			hytp14_thread, sc, >sc_thread,
+			"%s", device_xname(sc->sc_dev));
+	if (rv)
+	  aprint_error_dev(self, "unable to create intr thread\n");
+
+	aprint_normal(": HYT-221/271/939 humidity and temperature sensor\n");
 }
 
 static int
@@ -203,14 +217,65 @@ hytp14_detach(device_t self, int flags)
 		sc->sc_sme = NULL;
 	}
 
-	/* stop our measurement requests */
-	callout_stop(>sc_mrcallout);
-	callout_destroy(>sc_mrcallout);
-
+	/* stop measurement thread */
+	mutex_enter(>sc_mutex);
+	sc->sc_state = HYTP14_THR_STOP;
+	cv_signal(>sc_condvar);
+	mutex_exit(>sc_mutex);
+
+	/* await thread completion */
+	kthread_join(sc->sc_thread);
+
+	/* cleanup */
+	cv_destroy(>sc_condvar);
+	mutex_destroy(>sc_mutex);
+	
 	return 0;
 }
 
 static void
+hytp14_thread(void *aux)
+{
+	struct hytp14_sc *sc = aux;
+	int rv;
+	
+	mutex_enter(>sc_mutex);
+
+	DPRINTF(2, ("%s(%s): thread start - state=%d\n",
+		__func__, device_xname(sc->sc_dev),
+		sc->sc_state));
+	
+	while (sc->sc_state != HYTP14_THR_STOP) {
+		sc->sc_state = HYTP14_THR_RUN;
+
+		DPRINTF(2, ("%s(%s): waiting %d seconds\n",
+			__func__, device_xname(sc->sc_dev),
+sc->sc_mrinterval));
+		
+		rv = cv_timedwait(>sc_condvar, >sc_mutex, hz * sc->sc_mrinterval);
+
+		if (rv == EWOULDBLOCK) {
+			/* timeout - run measurement */
+			DPRINTF(2, ("%s(%s): timeout -> measurement\n",
+__func__, device_xname(sc->sc_dev)));
+
+			hytp14_measurement_request(sc);
+		} else {
+			DPRINTF(2, ("%s(%s): condvar signalled - state=%d\n",
+__func__, device_xname(sc->sc_dev),
+sc->sc_state));
+		}
+	}
+	
+	mutex_exit(>sc_mutex);
+
+	DPRINTF(2, ("%s(%s): thread exit\n",
+		__func__, device_xname(sc->sc_dev)));
+
+	kthread_exit(0);
+}
+
+static void
 hytp14_measurement_request(void *aux)
 {
 	uint8_t buf[I2C_EXEC_MAX_BUFLEN];
@@ -267,9 +332,6 @@ 

CVS commit: src/sys/fs/tmpfs

2016-03-12 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Mar 12 10:51:01 UTC 2016

Modified Files:
src/sys/fs/tmpfs: tmpfs_vnops.c

Log Message:
do no access uninitialized variables in KASSERTs - fixes build


To generate a diff of this commit:
cvs rdiff -u -r1.124 -r1.125 src/sys/fs/tmpfs/tmpfs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/tmpfs/tmpfs_vnops.c
diff -u src/sys/fs/tmpfs/tmpfs_vnops.c:1.124 src/sys/fs/tmpfs/tmpfs_vnops.c:1.125
--- src/sys/fs/tmpfs/tmpfs_vnops.c:1.124	Sat Mar 12 08:51:13 2016
+++ src/sys/fs/tmpfs/tmpfs_vnops.c	Sat Mar 12 10:51:00 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_vnops.c,v 1.124 2016/03/12 08:51:13 joerg Exp $	*/
+/*	$NetBSD: tmpfs_vnops.c,v 1.125 2016/03/12 10:51:00 kardel Exp $	*/
 
 /*
  * Copyright (c) 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.124 2016/03/12 08:51:13 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_vnops.c,v 1.125 2016/03/12 10:51:00 kardel Exp $");
 
 #include 
 #include 
@@ -572,14 +572,14 @@ tmpfs_write(void *v)
 
 	KASSERT(VOP_ISLOCKED(vp));
 
+	node = VP_TO_TMPFS_NODE(vp);
+	oldsize = node->tn_size;
+
 	if ((vp->v_mount->mnt_flag & MNT_RDONLY) != 0) {
 		error = EROFS;
 		goto out;
 	}
 
-	node = VP_TO_TMPFS_NODE(vp);
-	oldsize = node->tn_size;
-
 	if (uio->uio_offset < 0 || vp->v_type != VREG) {
 		error = EINVAL;
 		goto out;



CVS commit: src/external/bsd/ntp/scripts

2015-07-10 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Jul 10 21:27:49 UTC 2015

Modified Files:
src/external/bsd/ntp/scripts: mkver

Log Message:
update imported version to reality


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/scripts/mkver

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/scripts/mkver
diff -u src/external/bsd/ntp/scripts/mkver:1.6 src/external/bsd/ntp/scripts/mkver:1.7
--- src/external/bsd/ntp/scripts/mkver:1.6	Tue Apr  7 17:34:21 2015
+++ src/external/bsd/ntp/scripts/mkver	Fri Jul 10 21:27:49 2015
@@ -3,7 +3,7 @@ PROG=${1-UNKNOWN}
 
 ConfStr=$PROG
 
-ConfStr=$ConfStr 4.2.8p2
+ConfStr=$ConfStr 4.2.8p3
 
 case $CSET in
  '') ;;



CVS commit: src/external/bsd/ntp/dist/ntpd

2015-07-10 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Jul 10 21:31:19 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_control.c

Log Message:
backport fix for bug 2867 -  ntpd with autokey active crashed by 'ntpq -crv'


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/bsd/ntp/dist/ntpd/ntp_control.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.12 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.13
--- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.12	Fri Jul 10 14:20:32 2015
+++ src/external/bsd/ntp/dist/ntpd/ntp_control.c	Fri Jul 10 21:31:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_control.c,v 1.12 2015/07/10 14:20:32 christos Exp $	*/
+/*	$NetBSD: ntp_control.c,v 1.13 2015/07/10 21:31:19 kardel Exp $	*/
 
 /*
  * ntp_control.c - respond to mode 6 control messages and send async
@@ -422,10 +422,10 @@ static const struct ctl_var sys_var[] = 
 	{ CS_TIMER_XMTS,	RO, timer_xmts },	/* 87 */
 	{ CS_FUZZ,		RO, fuzz },		/* 88 */
 	{ CS_WANDER_THRESH,	RO, clk_wander_threshold }, /* 89 */
-#ifdef LEAP_SMEAR
+
 	{ CS_LEAPSMEARINTV,	RO, leapsmearinterval },/* 90 */
 	{ CS_LEAPSMEAROFFS,	RO, leapsmearoffset },  /* 91 */
-#endif	 /* LEAP_SMEAR */
+
 #ifdef AUTOKEY
 	{ CS_FLAGS,	RO, flags },		/* 1 + CS_MAX_NOAUTOKEY */
 	{ CS_HOST,	RO, host },		/* 2 + CS_MAX_NOAUTOKEY */
@@ -2404,6 +2404,9 @@ ctl_putsys(
 			ntohl(hostval.tstamp));
 		break;
 #endif	/* AUTOKEY */
+
+	default:
+		break;
 	}
 }
 



CVS commit: src/external/bsd/ntp/dist/ntpq

2015-06-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 28 15:37:37 UTC 2015

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq-subs.c

Log Message:
fix ifstats command by relaxing invalid sanity check - ntp bug #2860


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq-subs.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.9 src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.10
--- src/external/bsd/ntp/dist/ntpq/ntpq-subs.c:1.9	Tue Apr  7 17:34:19 2015
+++ src/external/bsd/ntp/dist/ntpq/ntpq-subs.c	Sun Jun 28 15:37:37 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq-subs.c,v 1.9 2015/04/07 17:34:19 christos Exp $	*/
+/*	$NetBSD: ntpq-subs.c,v 1.10 2015/06/28 15:37:37 kardel Exp $	*/
 
 /*
  * ntpq-subs.c - subroutines which are called to perform ntpq commands.
@@ -3101,7 +3101,7 @@ validate_ifnum(
 {
 	if (prow-ifnum == ifnum)
 		return;
-	if (prow-ifnum + 1 == ifnum) {
+	if (prow-ifnum + 1 = ifnum) {
 		if (*pfields  IFSTATS_FIELDS)
 			fprintf(fp, Warning: incomplete row with %d (of %d) fields,
 *pfields, IFSTATS_FIELDS);



CVS commit: src/sys/dev/i2c

2014-06-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 29 09:06:05 UTC 2014

Modified Files:
src/sys/dev/i2c: hytp14reg.h

Log Message:
remove artifacts inspired by misleading documentation
fix address caculation macros
fix typoes


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/hytp14reg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/hytp14reg.h
diff -u src/sys/dev/i2c/hytp14reg.h:1.1 src/sys/dev/i2c/hytp14reg.h:1.2
--- src/sys/dev/i2c/hytp14reg.h:1.1	Sun May 18 11:46:23 2014
+++ src/sys/dev/i2c/hytp14reg.h	Sun Jun 29 09:06:05 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: hytp14reg.h,v 1.1 2014/05/18 11:46:23 kardel Exp $ */
+/* $NetBSD: hytp14reg.h,v 1.2 2014/06/29 09:06:05 kardel Exp $ */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -42,9 +42,6 @@
 
 #define HYTP14_DEFAULT_ADDR	0x28
 
-#define HYTP14_CMD_SEND		0x50 /* send command */
-#define HYTP14_CMD_RESP		0x51 /* receive response */
-
 #define HYTP14_CMD_START_NOM	0x80 /* end command mode (or power-off)  */
 #define HYTP14_CMD_START_CM	0xA0 /* start command mode (within 10ms after power-up) */
 #define HYTP14_CMD_GET_REV	0xB0 /* get revison */
@@ -53,13 +50,16 @@
 #define HYTP14_READ_OFFSET	0x00 /* command offset to read EEPROM words */
 #define HYTP14_WRITE_OFFSET	0x40 /* command offset to write EEPROM words */
 
-#define HYTP14_READ_EEPROM(_X_)	(HYTP14_READ_OFFSET + (_X_)  (HYTP14_NUM_WORDS - 1))
-#define HYTP14_WRITE_EEPROM(_X_) (HYTP14_WRITE_OFFSET + (_X_)  (HYTP14_NUM_WORDS - 1))
+#define HYTP14_READ_EEPROM(_X_)	(HYTP14_READ_OFFSET + ((_X_)  (HYTP14_NUM_WORDS - 1)))
+#define HYTP14_WRITE_EEPROM(_X_) (HYTP14_WRITE_OFFSET + ((_X_)  (HYTP14_NUM_WORDS - 1)))
 
-#define HYTP14_EEADDR_I2CADDR	0x1C /* I2C address EEPROD word address */
+#define HYTP14_EEADDR_I2CADDR	0x1C /* I2C address EEPROM word address */
 
 #define HYTP14_RESP_CMDMODE	0x80 /* command mode response */
-#define HYTP14_RESP_STALE	0y40 /* stale measurement data */
+#define HYTP14_RESP_STALE	0x40 /* stale measurement data */
+
+#define HYT_STATUS_FMT \177\20b\7CM\0b\6STALE\0b\5ERR_CFG\0b\4ERR_RAM\0b\3ERR_UNCEEP\0\
+   b\2ERR_COREEP\0f\0\2RESP\0=\0BSY\0=\1ACK\0=\2NAK\0=\3INV\0\0
 
 #define HYTP14_DIAG_ERR_CFG	0x20 /* configuration error */
 #define HYTP14_DIAG_ERR_RAMPRTY	0x10 /* RAM parity error */
@@ -81,10 +81,3 @@
 #define HYTP14_TEMP_OFFSET	(-40)
 
 #endif
-/*
- * $Log: hytp14reg.h,v $
- * Revision 1.1  2014/05/18 11:46:23  kardel
- * add HYT-221/271/939 humidity/temperature I2C sensor
- * extend envsys(4) framework by %rH (relative humidity)
- *
- */



CVS commit: src/sys/dev/gpio

2014-06-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 29 09:32:24 UTC 2014

Modified Files:
src/sys/dev/gpio: gpio.c

Log Message:
make implementation match gpio(4) man entry. do no change configuration
if no flags are be set (allows non-destructive inquiry via GPIOSET again).


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/gpio/gpio.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/gpio/gpio.c
diff -u src/sys/dev/gpio/gpio.c:1.55 src/sys/dev/gpio/gpio.c:1.56
--- src/sys/dev/gpio/gpio.c:1.55	Fri May 23 13:57:04 2014
+++ src/sys/dev/gpio/gpio.c	Sun Jun 29 09:32:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.55 2014/05/23 13:57:04 msaitoh Exp $ */
+/* $NetBSD: gpio.c,v 1.56 2014/06/29 09:32:24 kardel Exp $ */
 /*	$OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gpio.c,v 1.55 2014/05/23 13:57:04 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: gpio.c,v 1.56 2014/06/29 09:32:24 kardel Exp $);
 
 /*
  * General Purpose Input/Output framework.
@@ -699,12 +699,14 @@ gpio_ioctl(struct gpio_softc *sc, u_long
 		/* check that the controller supports all requested flags */
 		if ((flags  sc-sc_pins[pin].pin_caps) != flags)
 			return ENODEV;
-		flags = set-gp_flags | GPIO_PIN_SET;
+		flags = set-gp_flags;
 
 		set-gp_caps = sc-sc_pins[pin].pin_caps;
 		/* return old value */
 		set-gp_flags = sc-sc_pins[pin].pin_flags;
+
 		if (flags  0) {
+			flags |= GPIO_PIN_SET;
 			gpiobus_pin_ctl(gc, pin, flags);
 			/* update current value */
 			sc-sc_pins[pin].pin_flags = flags;



CVS commit: src/sys/dev/i2c

2014-06-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 29 09:52:43 UTC 2014

Modified Files:
src/sys/dev/i2c: hytp14.c

Log Message:
allow i2c address 0x01-0x7F
igore responses if the sensor is in command mode


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/hytp14.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/hytp14.c
diff -u src/sys/dev/i2c/hytp14.c:1.1 src/sys/dev/i2c/hytp14.c:1.2
--- src/sys/dev/i2c/hytp14.c:1.1	Sun May 18 11:46:23 2014
+++ src/sys/dev/i2c/hytp14.c	Sun Jun 29 09:52:43 2014
@@ -37,7 +37,7 @@
  */ 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hytp14.c,v 1.1 2014/05/18 11:46:23 kardel Exp $);
+__KERNEL_RCSID(0, $NetBSD: hytp14.c,v 1.2 2014/06/29 09:52:43 kardel Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -98,8 +98,8 @@ hytp14_match(device_t parent, cfdata_t m
 		if (strcmp(ia-ia_name, hythygtemp) == 0)
 			return 1;
 	} else {
-		/* indirect config - check typical address */
-		if (ia-ia_addr == HYTP14_DEFAULT_ADDR)
+		/* indirect config - check for configured address */
+		if ((ia-ia_addr  0)  (ia-ia_addr = 0x7F))
 			return 1;
 	}
 	return 0;
@@ -189,15 +189,17 @@ hytp14_refresh_sensor(struct hytp14_sc *
 
 		/* send MR command */
 /* avoid quick read/write by providing a result buffer */
-		if ((error = iic_exec(sc-sc_tag, I2C_OP_WRITE_WITH_STOP,
-  sc-sc_addr, NULL, 0, buf, sizeof buf, 0)) == 0) {
+		error = iic_exec(sc-sc_tag, I2C_OP_WRITE_WITH_STOP,
+ sc-sc_addr, NULL, 0, buf, sizeof buf, 0);
+if (error == 0) {
 			DPRINTF(3, (hytp14_refresh_sensor(%s): MR sent\n,
 device_xname(sc-sc_dev)));
 
 			/* send DF command - read data from sensor */
-			if ((error = iic_exec(sc-sc_tag, I2C_OP_READ_WITH_STOP,
-	  sc-sc_addr, NULL, 0, sc-sc_data,
-	  sizeof sc-sc_data, 0)) != 0) {
+			error = iic_exec(sc-sc_tag, I2C_OP_READ_WITH_STOP,
+	 sc-sc_addr, NULL, 0, sc-sc_data,
+	  sizeof sc-sc_data, 0);
+if (error != 0) {
 DPRINTF(2, (%s: %s: failed read from 0x%02x - error %d\n,
 	device_xname(sc-sc_dev),
 	__func__, sc-sc_addr, error));
@@ -224,7 +226,8 @@ hytp14_refresh_sensor(struct hytp14_sc *
 			
 	sc-sc_refresh = hardclock_ticks;
 	
-	if (error == 0) {
+	/* skip data if sensor is in command mode */
+	if (error == 0  (sc-sc_data[0]  HYTP14_RESP_CMDMODE) == 0) {
 		sc-sc_valid = ENVSYS_SVALID;
 	} else {
 		sc-sc_valid = ENVSYS_SINVALID;



CVS commit: src

2014-05-18 Thread Frank Kardel
, PENVSYS_TYPE_BATTERY,Battery capacity },
 	{ ENVSYS_BATTERY_CHARGE, -1,			Battery charge },
+	{ ENVSYS_SRELHUMIDITY,	-1,			relative Humidity },
 	{ -1,			-1,			unknown }
 };
 

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.135 src/sys/modules/Makefile:1.136
--- src/sys/modules/Makefile:1.135	Fri Jan  3 16:16:10 2014
+++ src/sys/modules/Makefile	Sun May 18 11:46:23 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.135 2014/01/03 16:16:10 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.136 2014/05/18 11:46:23 kardel Exp $
 
 .include bsd.own.mk
 
@@ -39,6 +39,7 @@ SUBDIR+=	gpioiic
 SUBDIR+=	gpioow
 SUBDIR+=	gpiosim
 SUBDIR+=	hfs
+SUBDIR+=	hythygtemp
 SUBDIR+=	if_axe
 SUBDIR+=	if_axen
 SUBDIR+=	if_npflog

Index: src/sys/sys/envsys.h
diff -u src/sys/sys/envsys.h:1.33 src/sys/sys/envsys.h:1.34
--- src/sys/sys/envsys.h:1.33	Wed Dec  5 04:21:30 2012
+++ src/sys/sys/envsys.h	Sun May 18 11:46:24 2014
@@ -1,7 +1,7 @@
-/* $NetBSD: envsys.h,v 1.33 2012/12/05 04:21:30 riastradh Exp $ */
+/* $NetBSD: envsys.h,v 1.34 2014/05/18 11:46:24 kardel Exp $ */
 
 /*-
- * Copyright (c) 1999, 2007 The NetBSD Foundation, Inc.
+ * Copyright (c) 1999, 2007, 2014 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -63,6 +63,7 @@ enum envsys_units {
 	ENVSYS_DRIVE,			/* Drive */
 	ENVSYS_BATTERY_CAPACITY,	/* Battery capacity */
 	ENVSYS_BATTERY_CHARGE,		/* Battery charging/discharging */
+	ENVSYS_SRELHUMIDITY,		/* relative humidity */
 	ENVSYS_NSENSORS
 };
 
@@ -161,7 +162,7 @@ typedef struct envsys_tre_data envsys_tr
 #ifdef ENVSYSUNITNAMES
 static const char * const envsysunitnames[] = {
 degC, RPM, VAC, V, Ohms, W,
-A, Wh, Ah, bool, integer, drive, Unk
+A, Wh, Ah, bool, integer, drive, %rH, Unk
 };
 static const char * const envsysdrivestatus[] = {
 unknown, empty, ready, powering up, online, idle, active,

Index: src/usr.sbin/envstat/envstat.8
diff -u src/usr.sbin/envstat/envstat.8:1.61 src/usr.sbin/envstat/envstat.8:1.62
--- src/usr.sbin/envstat/envstat.8:1.61	Thu Feb  9 18:10:26 2012
+++ src/usr.sbin/envstat/envstat.8	Sun May 18 11:46:24 2014
@@ -1,6 +1,6 @@
-.\	$NetBSD: envstat.8,v 1.61 2012/02/09 18:10:26 riz Exp $
+.\	$NetBSD: envstat.8,v 1.62 2014/05/18 11:46:24 kardel Exp $
 .\
-.\ Copyright (c) 2000, 2007, 2008, 2009 The NetBSD Foundation, Inc.
+.\ Copyright (c) 2000, 2007, 2008, 2009, 2014 The NetBSD Foundation, Inc.
 .\ All rights reserved.
 .\
 .\ This code is derived from software contributed to The NetBSD Foundation
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd June 7, 2011
+.Dd May 18, 2014
 .Dt ENVSTAT 8
 .Os
 .Sh NAME
@@ -166,6 +166,8 @@ Volts AC
 Watts
 .It Wh
 Watt-hours
+.It %rH
+relative Humidity
 .El
 .Sh EXAMPLES
 To display the
@@ -217,6 +219,7 @@ invalid states every second:
 .Xr envctrl 4 ,
 .Xr envsys 4 ,
 .Xr finsio 4 ,
+.Xr hythygtemp 4 ,
 .Xr ipmi 4 ,
 .Xr itesio 4 ,
 .Xr lm 4 ,

Index: src/usr.sbin/envstat/envstat.c
diff -u src/usr.sbin/envstat/envstat.c:1.94 src/usr.sbin/envstat/envstat.c:1.95
--- src/usr.sbin/envstat/envstat.c:1.94	Fri Dec 14 05:29:28 2012
+++ src/usr.sbin/envstat/envstat.c	Sun May 18 11:46:24 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.94 2012/12/14 05:29:28 pgoyette Exp $ */
+/* $NetBSD: envstat.c,v 1.95 2014/05/18 11:46:24 kardel Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: envstat.c,v 1.94 2012/12/14 05:29:28 pgoyette Exp $);
+__RCSID($NetBSD: envstat.c,v 1.95 2014/05/18 11:46:24 kardel Exp $);
 #endif /* not lint */
 
 #include stdio.h
@@ -975,6 +975,8 @@ do {	\
 stype = Wh;
 			else if (strcmp(sensor-type, Ampere hour) == 0)
 stype = Ah;
+			else if (strcmp(sensor-type, relative Humidity) == 0)
+stype = %rH;
 			else
 stype = ?;
 

Added files:

Index: src/share/man/man4/hythygtemp.4
diff -u /dev/null src/share/man/man4/hythygtemp.4:1.1
--- /dev/null	Sun May 18 11:46:24 2014
+++ src/share/man/man4/hythygtemp.4	Sun May 18 11:46:23 2014
@@ -0,0 +1,63 @@
+.\	$NetBSD: hythygtemp.4,v 1.1 2014/05/18 11:46:23 kardel Exp $
+.\
+.\Copyright (c) 2014 Frank Kardel
+.\All rights reserved.
+.\
+.\Redistribution and use in source and binary forms, with or without
+.\modification, are permitted provided that the following conditions
+.\are met:
+.\1. Redistributions of source code must retain the above copyright
+.\   notice, this list of conditions and the following disclaimer.
+.\2. Redistributions in binary form must reproduce the above copyright
+.\   notice, this list of conditions and the following disclaimer in the
+.\   documentation and/or other materials provided with the distribution.
+.\
+.\THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS
+.\``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\TO, THE IMPLIED WARRANTIES

CVS commit: src/sys/dev/onewire

2014-05-14 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed May 14 08:14:56 UTC 2014

Modified Files:
src/sys/dev/onewire: owtemp.c

Log Message:
calculate extended precision as per DS1920/DS1820 data sheets


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/onewire/owtemp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/onewire/owtemp.c
diff -u src/sys/dev/onewire/owtemp.c:1.16 src/sys/dev/onewire/owtemp.c:1.17
--- src/sys/dev/onewire/owtemp.c:1.16	Mon Jun 20 17:24:16 2011
+++ src/sys/dev/onewire/owtemp.c	Wed May 14 08:14:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: owtemp.c,v 1.16 2011/06/20 17:24:16 pgoyette Exp $ */
+/*	$NetBSD: owtemp.c,v 1.17 2014/05/14 08:14:56 kardel Exp $ */
 /*	$OpenBSD: owtemp.c,v 1.1 2006/03/04 16:27:03 grange Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: owtemp.c,v 1.16 2011/06/20 17:24:16 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: owtemp.c,v 1.17 2014/05/14 08:14:56 kardel Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -64,7 +64,7 @@ CFATTACH_DECL_NEW(owtemp, sizeof(struct 
 extern struct cfdriver owtemp_cd;
 
 static const struct onewire_matchfam owtemp_fams[] = {
-	{ ONEWIRE_FAMILY_DS1920 },
+	{ ONEWIRE_FAMILY_DS1920 }, /* also DS1820 */
 	{ ONEWIRE_FAMILY_DS18B20 },
 	{ ONEWIRE_FAMILY_DS1822 },
 };
@@ -235,6 +235,21 @@ owtemp_decode_ds1920(const uint8_t *buf)
 	temp = (int8_t)buf[1];
 	temp = (temp  8) | buf[0];
 
-	/* Convert to uK */
-	return (temp * 50 + 27315);
+	if (buf[7] != 0) {
+		/*
+	 	 * interpolate for higher precision using the count registers
+	 	 *
+	 	 * buf[7]: COUNT_PER_C(elsius)
+	 	 * buf[6]: COUNT_REMAIN
+	 	 *
+	 	 * T = TEMP - 0.25 + (COUNT_PER_C - COUNT_REMAIN) / COUNT_PER_C
+	 	 */
+		temp = ~1;
+	temp += 50 * temp + (50 * (buf[7] - buf[6])) / buf[7] - 25;
+	} else {
+		temp *= 50;
+	}
+
+	/* convert to uK */
+	return (temp + 27315);
 }



CVS commit: src

2014-04-06 Thread Frank Kardel
 0
+#mcp23s17gpio1 at spi? slave 0 flags 1 
+#mcp23s17gpio2 at spi? slave 0 flags 2
+#mcp23s17gpio3 at spi? slave 0 flags 3
+
+# gpio support (e. g. mcp23s17gpio)
+#gpio*		at gpiobus?
+
 # various options for wscons - we try to look as much like a standard
 # sun console as possible
 options 	WSEMUL_VT100		# sun terminal emulation

Index: src/sys/dev/spi/files.spi
diff -u src/sys/dev/spi/files.spi:1.3 src/sys/dev/spi/files.spi:1.4
--- src/sys/dev/spi/files.spi:1.3	Tue Feb 25 20:09:37 2014
+++ src/sys/dev/spi/files.spi	Sun Apr  6 17:59:39 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: files.spi,v 1.3 2014/02/25 20:09:37 rkujawa Exp $
+#	$NetBSD: files.spi,v 1.4 2014/04/06 17:59:39 kardel Exp $
 
 define	spibus { }
 
@@ -31,3 +31,7 @@ device	mcp48x1dac
 attach	mcp48x1dac at spi
 file	dev/spi/mcp48x1.c		mcp48x1dac	
 
+# MCP23S17 16-bit GPIO
+device	mcp23s17gpio: gpiobus
+attach	mcp23s17gpio at spi
+file	dev/spi/mcp23s17.c		mcp23s17gpio

Added files:

Index: src/share/man/man4/mcp23s17gpio.4
diff -u /dev/null src/share/man/man4/mcp23s17gpio.4:1.1
--- /dev/null	Sun Apr  6 17:59:39 2014
+++ src/share/man/man4/mcp23s17gpio.4	Sun Apr  6 17:59:39 2014
@@ -0,0 +1,61 @@
+.\	$NetBSD: mcp23s17gpio.4,v 1.1 2014/04/06 17:59:39 kardel Exp $
+.\
+.\Copyright (c) 2014 Frank Kardel
+.\All rights reserved.
+.\
+.\Redistribution and use in source and binary forms, with or without
+.\modification, are permitted provided that the following conditions
+.\are met:
+.\1. Redistributions of source code must retain the above copyright
+.\   notice, this list of conditions and the following disclaimer.
+.\2. Redistributions in binary form must reproduce the above copyright
+.\   notice, this list of conditions and the following disclaimer in the
+.\   documentation and/or other materials provided with the distribution.
+.\
+.\THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS
+.\``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+.\BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\POSSIBILITY OF SUCH DAMAGE.
+.\
+.Dd April 6th, 2014
+.Dt MCP23S17GPIO 4
+.Os
+.Sh NAME
+.Nm mcp23s17gpio
+.Nd Driver for MCP23S17 gpio chip via SPI bus
+.Sh SYNOPSIS
+.Cd mcp23s17gpio0 at spi? slave 0 flags 0
+.Cd mcp23s17gpio1 at spi? slave 0 flags 1
+.Cd mcp23s17gpio2 at spi? slave 0 flags 2
+.Cd mcp23s17gpio3 at spi? slave 0 flags 3
+.Cd gpio* at gpiobus?
+.Sh DESCRIPTION
+The
+.Nm
+driver supports up to 8 instances of the MCP23S17 16-bit GPIO chips. Access to
+the pins is provided by the
+.Xr gpio 4
+interface. The
+.Nm flags argument selects the hardware address of the chip instance.
+.Sh SEE ALSO
+.Xr spi 4 ,
+.Xr intro 4 ,
+.Xr gpio 4
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Nx 7.0 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Frank Kardel Aq Mt kar...@netbsd.org .

Index: src/sys/dev/spi/mcp23s17.c
diff -u /dev/null src/sys/dev/spi/mcp23s17.c:1.1
--- /dev/null	Sun Apr  6 17:59:39 2014
+++ src/sys/dev/spi/mcp23s17.c	Sun Apr  6 17:59:39 2014
@@ -0,0 +1,301 @@
+/*  $NetBSD: mcp23s17.c,v 1.1 2014/04/06 17:59:39 kardel Exp $ */
+
+/*-
+ * Copyright (c) 2014 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Frank Kardel.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY

CVS commit: src/external/bsd/ntp/dist/libntp

2014-04-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Apr  1 17:34:44 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: atouint.c

Log Message:
remove stray 'return 0;' that effectively disabled atouint().

Hi Christos!


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/libntp/atouint.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/atouint.c
diff -u src/external/bsd/ntp/dist/libntp/atouint.c:1.3 src/external/bsd/ntp/dist/libntp/atouint.c:1.4
--- src/external/bsd/ntp/dist/libntp/atouint.c:1.3	Sat Dec 28 03:20:13 2013
+++ src/external/bsd/ntp/dist/libntp/atouint.c	Tue Apr  1 17:34:44 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: atouint.c,v 1.3 2013/12/28 03:20:13 christos Exp $	*/
+/*	$NetBSD: atouint.c,v 1.4 2014/04/01 17:34:44 kardel Exp $	*/
 
 #include config.h
 #include sys/types.h
@@ -29,7 +29,6 @@ atouint(
 		return 0;
 
 	u = 0;
-		return 0;
 	while ('\0' != *cp) {
 		if (!isdigit((unsigned char)*cp))
 			return 0;



CVS commit: src/external/bsd/ntp/dist/libntp

2014-01-20 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Jan 20 19:03:33 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/libntp: work_fork.c

Log Message:
fix voluntary self-destruct (kill(0, SIGUP)) after successful int_res run and 
interface change


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libntp/work_fork.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/work_fork.c
diff -u src/external/bsd/ntp/dist/libntp/work_fork.c:1.1.1.1 src/external/bsd/ntp/dist/libntp/work_fork.c:1.2
--- src/external/bsd/ntp/dist/libntp/work_fork.c:1.1.1.1	Fri Dec 27 23:30:48 2013
+++ src/external/bsd/ntp/dist/libntp/work_fork.c	Mon Jan 20 19:03:33 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: work_fork.c,v 1.1.1.1 2013/12/27 23:30:48 christos Exp $	*/
+/*	$NetBSD: work_fork.c,v 1.2 2014/01/20 19:03:33 kardel Exp $	*/
 
 /*
  * work_fork.c - fork implementation for blocking worker child.
@@ -100,8 +100,10 @@ interrupt_worker_sleep(void)
 
 	for (idx = 0; idx  blocking_children_alloc; idx++) {
 		c = blocking_children[idx];
-		if (NULL == c)
+
+		if (NULL == c || c-reusable == TRUE)
 			continue;
+
 		rc = kill(c-pid, SIGHUP);
 		if (rc  0)
 			msyslog(LOG_ERR,



CVS commit: src/external/bsd/ntp

2014-01-05 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jan  5 15:13:36 UTC 2014

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c
src/external/bsd/ntp/include: config.h

Log Message:
- enable PARSE clocks (missed config option when merging)
- remove all conflict markers/finish merge in refclock_parse.c:1.10


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/ntp/dist/ntpd/refclock_parse.c
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.10 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.11
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.10	Sat Dec 28 03:20:14 2013
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Sun Jan  5 15:13:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.10 2013/12/28 03:20:14 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.11 2014/01/05 15:13:36 kardel Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -2543,74 +2543,37 @@ parsestate(
 		if (flagstrings[i].bit  lstate)
 		{
 			if (s != t)
- refclock_parse.c
 t = ap(buffer, size, t, ; );
 			t = ap(buffer, size, t, %s, flagstrings[i].name);
-===
-strlcpy(t, ; , BUFFER_SIZES(buffer, t, size));
-			if (strlcat(t, flagstrings[i].name, BUFFER_SIZES(buffer, t, size)) 
-			BUFFER_SIZES(buffer, t, size))
-t += strlen(t);
- 1.1.1.3
 		}
 		i++;
 	}
 
 	if (lstate  (PARSEB_S_LEAP|PARSEB_S_ANTENNA|PARSEB_S_PPS|PARSEB_S_POSITION))
 	{
- refclock_parse.c
 		if (s != t)
 			t = ap(buffer, size, t, ; );
 
 		t = ap(buffer, size, t, ();
-===
-		if (s != t 
-		strlcpy(t, ; , BUFFER_SIZES(buffer, t, size)) 
-		BUFFER_SIZES(buffer, t, size))
-			t += strlen(t);
- 1.1.1.3
 
- refclock_parse.c
 		s = t;
-===
-		if (strlcpy(t, (, BUFFER_SIZES(buffer, t, size))  
-		BUFFER_SIZES(buffer, t, size))
-			s = t = t + strlen(t);
- 1.1.1.3
 
 		i = 0;
 		while (sflagstrings[i].bit)
 		{
 			if (sflagstrings[i].bit  lstate)
 			{
- refclock_parse.c
 if (t != s)
 {
 	t = ap(buffer, size, t, ; );
 }
-===
-if (t != s 
-strlcpy(t, ; , BUFFER_SIZES(buffer, t, size)) 
-BUFFER_SIZES(buffer, t, size))
-	t += 2;
- 1.1.1.3
 	
- refclock_parse.c
 t = ap(buffer, size, t, %s,
 sflagstrings[i].name);
-===
-if (strlcpy(t, sflagstrings[i].name, BUFFER_SIZES(buffer, t, size)) 
-BUFFER_SIZES(buffer, t, size))
-	t += strlen(t);
- 1.1.1.3
 			}
 			i++;
 		}
- refclock_parse.c
 		t = ap(buffer, size, t, ));
-===
-		strlcpy(t, ), BUFFER_SIZES(buffer, t, size));
- 1.1.1.3
 	}
 	return buffer;
 }
@@ -2651,15 +2614,9 @@ parsestatus(
 	{
 		if (flagstrings[i].bit  lstate)
 		{
- refclock_parse.c
 			if (t == buffer)
 t = ap(buffer, size, t, ; );
 			t = ap(buffer, size, t, %s, flagstrings[i].name);
-===
-			if (buffer[0])
-strlcat(buffer, ; , size);
-			strlcat(buffer, flagstrings[i].name, size);
- 1.1.1.3
 		}
 		i++;
 	}
@@ -3307,18 +3264,9 @@ parse_start(
 		parse_shutdown(CLK_UNIT(parse-peer), peer); /* let our cleaning staff do the work */
 		return 0;			/* well, ok - special initialisation broke */
 	}
- refclock_parse.c
   
 	strlcpy(tmp_ctl.parseformat.parse_buffer, parse-parse_type-cl_format, sizeof(tmp_ctl.parseformat.parse_buffer));
 	tmp_ctl.parseformat.parse_count = strlen(tmp_ctl.parseformat.parse_buffer);
-===
-
-	tmp_ctl.parseformat.parse_count = strlcpy(tmp_ctl.parseformat.parse_buffer,
-		  parse-parse_type-cl_format,
-		  sizeof(tmp_ctl.parseformat.parse_buffer));
-	if (tmp_ctl.parseformat.parse_count = sizeof(tmp_ctl.parseformat.parse_buffer))
-		tmp_ctl.parseformat.parse_count = sizeof(tmp_ctl.parseformat.parse_buffer) - 1;
- 1.1.1.3
 
 	if (!PARSE_SETFMT(parse, tmp_ctl))
 	{
@@ -3605,11 +3553,7 @@ parse_control(
 
 		if (parse-timedata.parse_time.fp.l_ui == 0)
 		{
- refclock_parse.c
 			tt = ap(start, 128, tt, UNDEFINED\);
-===
-			strlcpy(tt, UNDEFINED\, BUFFER_SIZES(start, tt, 128));
- 1.1.1.3
 		}
 		else
 		{
@@ -3637,11 +3581,7 @@ parse_control(
 
 			tt += strlen(tt);
 
- refclock_parse.c
 			tt = ap(start, 512, tt, \);
-===
-			strlcat(tt, \, BUFFER_SIZES(start, tt, 512));
- 1.1.1.3
 
 			if (tmpctl.parsegettc.parse_count)
 			mkascii(outstatus+strlen(outstatus), (int)(sizeof(outstatus)- strlen(outstatus) - 1),
@@ -3670,12 +3610,7 @@ parse_control(
 				tmpctl.parseformat.parse_buffer);
 			}
 
- refclock_parse.c
 			tt = ap(start, 80, tt, \);
-===
-			strlcat(tt, tmpctl.parseformat.parse_buffer, 80);
-			strlcat(tt,\, 80);
- 1.1.1.3
 		}
 
 		/*
@@ -3683,12 +3618,7 @@ parse_control(
 		 */
 
 		start = tt = add_var(out-kv_list, LEN_STATES, RO|DEF);
- refclock_parse.c
 		tt 

CVS commit: src/external/bsd/ntp/include

2014-01-05 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jan  5 15:39:13 UTC 2014

Modified Files:
src/external/bsd/ntp/include: config.h

Log Message:
- enable the rest of the PARSE clocks (missed config option when merging)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/include/config.h
diff -u src/external/bsd/ntp/include/config.h:1.7 src/external/bsd/ntp/include/config.h:1.8
--- src/external/bsd/ntp/include/config.h:1.7	Sun Jan  5 15:13:36 2014
+++ src/external/bsd/ntp/include/config.h	Sun Jan  5 15:39:13 2014
@@ -38,13 +38,13 @@
 #define CLOCK_CHU 1
 
 /* Diems Computime Radio Clock? */
-/* #undef CLOCK_COMPUTIME */
+#define CLOCK_COMPUTIME 1
 
 /* Datum Programmable Time System? */
 #define CLOCK_DATUM 1
 
 /* ELV/DCF7000 clock? */
-/* #undef CLOCK_DCF7000 */
+#define CLOCK_DCF7000 1
 
 /* Dumb generic hh:mm:ss local clock? */
 #define CLOCK_DUMBCLOCK 1
@@ -59,7 +59,7 @@
 #define CLOCK_HEATH 1
 
 /* HOPF 6021 clock? */
-/* #undef CLOCK_HOPF6021 */
+#define CLOCK_HOPF6021 1
 
 /* HOPF PCI clock device? */
 #define CLOCK_HOPF_PCI 1
@@ -86,7 +86,7 @@
 #define CLOCK_LOCAL 1
 
 /* Meinberg clocks */
-/* #undef CLOCK_MEINBERG */
+#define CLOCK_MEINBERG 1
 
 /* Magnavox MX4200 GPS receiver */
 /* #undef CLOCK_MX4200 */
@@ -116,19 +116,19 @@
 #define CLOCK_PST 1
 
 /* DCF77 raw time code */
-/* #undef CLOCK_RAWDCF */
+#define CLOCK_RAWDCF 1
 
 /* RCC 8000 clock */
-/* #undef CLOCK_RCC8000 */
+#define CLOCK_RCC8000 1
 
 /* RIPE NCC Trimble clock */
 /* #undef CLOCK_RIPENCC */
 
 /* Schmid DCF77 clock */
-/* #undef CLOCK_SCHMID */
+#define CLOCK_SCHMID 1
 
 /* SEL240X protocol */
-/* #undef CLOCK_SEL240X */
+#define CLOCK_SEL240X 1
 
 /* clock thru shared memory */
 #define CLOCK_SHM 1
@@ -140,10 +140,10 @@
 /* #undef CLOCK_TPRO */
 
 /* Trimble GPS receiver/TAIP protocol */
-/* #undef CLOCK_TRIMTAIP */
+#define CLOCK_TRIMTAIP 1
 
 /* Trimble GPS receiver/TSIP protocol */
-/* #undef CLOCK_TRIMTSIP */
+#define CLOCK_TRIMTSIP 1
 
 /* Kinemetrics/TrueTime receivers */
 #define CLOCK_TRUETIME 1
@@ -158,10 +158,10 @@
 #define CLOCK_ULINK 1
 
 /* VARITEXT clock */
-/* #undef CLOCK_VARITEXT */
+#define CLOCK_VARITEXT 1
 
 /* WHARTON 400A Series clock */
-/* #undef CLOCK_WHARTON_400A */
+#define CLOCK_WHARTON_400A 1
 
 /* WWV audio driver */
 #define CLOCK_WWV 1



CVS commit: src/external/bsd/ntp/lib/libparse

2014-01-05 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jan  5 15:47:23 UTC 2014

Modified Files:
src/external/bsd/ntp/lib/libparse: Makefile

Log Message:
- add new clk_sel240x.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/lib/libparse/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/lib/libparse/Makefile
diff -u src/external/bsd/ntp/lib/libparse/Makefile:1.1 src/external/bsd/ntp/lib/libparse/Makefile:1.2
--- src/external/bsd/ntp/lib/libparse/Makefile:1.1	Sun Dec 13 17:13:47 2009
+++ src/external/bsd/ntp/lib/libparse/Makefile	Sun Jan  5 15:47:23 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:47 kardel Exp $
+#	$NetBSD: Makefile,v 1.2 2014/01/05 15:47:23 kardel Exp $
 
 LIBISPRIVATE=yes
 
@@ -16,6 +16,7 @@ SRCS= parse.c  \
   parse_conf.c \
   clk_meinberg.c   \
   clk_schmid.c \
+  clk_sel240x.c\
   clk_rawdcf.c \
   clk_trimtsip.c   \
   clk_dcf7000.c\



CVS commit: src/sys/dev/pci

2013-08-09 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Aug  9 19:51:29 UTC 2013

Modified Files:
src/sys/dev/pci: mpii.c

Log Message:
fix issues when reading variable block sized tapes.

symptoms:
generic HBA error on console when reading
with a larger blocksize. blocks read
are padded to requested block size with
a 5a... a5... pattern.

problems fixed:
- controller scsi_status values did not match
  the ones used by the spsipi layer.
  a mapping function was introduced.
- when experiencing an underrun (read 64k and
  get a 63k block) the controller posted
  not a SUCCESS status but CHECK status. handle
  that like SUCCESS adjusting xs-resid and set
  XS_SENSE.
  now the correct data amount is returned and
  nothing is 'added' and no 'generic HBA error'
  occurs.
- make decisions using variables and constants
  from the controller domain.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.2 src/sys/dev/pci/mpii.c:1.3
--- src/sys/dev/pci/mpii.c:1.2	Thu Aug  8 07:06:13 2013
+++ src/sys/dev/pci/mpii.c	Fri Aug  9 19:51:29 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.2 2013/08/08 07:06:13 kardel Exp $ */
+/* $NetBSD: mpii.c,v 1.3 2013/08/09 19:51:29 kardel Exp $ */
 /*	OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp 	*/
 /*
  * Copyright (c) 2010 Mike Belopuhov m...@crypt.org.ru
@@ -20,7 +20,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mpii.c,v 1.2 2013/08/08 07:06:13 kardel Exp $);
+__KERNEL_RCSID(0, $NetBSD: mpii.c,v 1.3 2013/08/09 19:51:29 kardel Exp $);
 
 #include bio.h
 
@@ -790,18 +790,18 @@ struct mpii_msg_scsi_io_error {
 	u_int16_t		reserved3;
 
 	u_int8_t		scsi_status;
-	/* XXX JPG validate this */
-#if notyet
-#define MPII_SCSIIO_ERR_STATUS_SUCCESS
-#define MPII_SCSIIO_ERR_STATUS_CHECK_COND
-#define MPII_SCSIIO_ERR_STATUS_BUSY
-#define MPII_SCSIIO_ERR_STATUS_INTERMEDIATE
-#define MPII_SCSIIO_ERR_STATUS_INTERMEDIATE_CONDMET
-#define MPII_SCSIIO_ERR_STATUS_RESERVATION_CONFLICT
-#define MPII_SCSIIO_ERR_STATUS_CMD_TERM
-#define MPII_SCSIIO_ERR_STATUS_TASK_SET_FULL
-#define MPII_SCSIIO_ERR_STATUS_ACA_ACTIVE
-#endif
+
+#define MPII_SCSIIO_ERR_STATUS_SUCCESS			(0x00)
+#define MPII_SCSIIO_ERR_STATUS_CHECK_COND		(0x02)
+#define MPII_SCSIIO_ERR_STATUS_BUSY			(0x04)
+#define MPII_SCSIIO_ERR_STATUS_INTERMEDIATE		(0x08)
+#define MPII_SCSIIO_ERR_STATUS_INTERMEDIATE_CONDMET	(0x10)
+#define MPII_SCSIIO_ERR_STATUS_RESERVATION_CONFLICT	(0x14)
+#define MPII_SCSIIO_ERR_STATUS_CMD_TERM			(0x22)
+#define MPII_SCSIIO_ERR_STATUS_TASK_SET_FULL		(0x28)
+#define MPII_SCSIIO_ERR_STATUS_ACA_ACTIVE		(0x30)
+#define MPII_SCSIIO_ERR_STATUS_TASK_ABORTED		(0x40)
+
 	u_int8_t		scsi_state;
 #define MPII_SCSIIO_ERR_STATE_AUTOSENSE_VALID		(10)
 #define MPII_SCSIIO_ERR_STATE_AUTOSENSE_FAILED		(11)
@@ -4682,6 +4682,58 @@ mpii_scsi_cmd_tmo_done(struct mpii_ccb *
 mpii_put_ccb(tccb-ccb_sc, tccb);
 }
 
+static u_int8_t
+map_scsi_status(u_int8_t mpii_scsi_status)
+{
+	u_int8_t scsi_status;
+	
+	switch (mpii_scsi_status) 
+	{
+	case MPII_SCSIIO_ERR_STATUS_SUCCESS:
+		scsi_status = SCSI_OK;
+		break;
+		
+	case MPII_SCSIIO_ERR_STATUS_CHECK_COND:
+		scsi_status = SCSI_CHECK;
+		break;
+		
+	case MPII_SCSIIO_ERR_STATUS_BUSY:
+		scsi_status = SCSI_BUSY;
+		break;
+		
+	case MPII_SCSIIO_ERR_STATUS_INTERMEDIATE:
+		scsi_status = SCSI_INTERM;
+		break;
+		
+	case MPII_SCSIIO_ERR_STATUS_INTERMEDIATE_CONDMET:
+		scsi_status = SCSI_INTERM;
+		break;
+		
+	case MPII_SCSIIO_ERR_STATUS_RESERVATION_CONFLICT:
+		scsi_status = SCSI_RESV_CONFLICT;
+		break;
+		
+	case MPII_SCSIIO_ERR_STATUS_CMD_TERM:
+	case MPII_SCSIIO_ERR_STATUS_TASK_ABORTED:
+		scsi_status = SCSI_TERMINATED;
+		break;
+
+	case MPII_SCSIIO_ERR_STATUS_TASK_SET_FULL:
+		scsi_status = SCSI_QUEUE_FULL;
+		break;
+
+	case MPII_SCSIIO_ERR_STATUS_ACA_ACTIVE:
+		scsi_status = SCSI_ACA_ACTIVE;
+		break;
+
+	default:
+		/* XXX: for the lack of anything better and other than OK */
+		scsi_status = 0xFF;
+		break;
+	}
+
+	return scsi_status;
+}
 
 static void
 mpii_scsi_cmd_done(struct mpii_ccb *ccb)
@@ -4745,31 +4797,43 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
 	DNPRINTF(MPII_D_CMD, %s:  bidirectional_transfer_count: 0x%08x\n,
 	DEVNAME(sc), le32toh(sie-bidirectional_transfer_count));
 
-	xs-status = sie-scsi_status;
+	xs-status = map_scsi_status(sie-scsi_status);
+
 	switch (le16toh(sie-ioc_status)  MPII_IOCSTATUS_MASK) {
 	case MPII_IOCSTATUS_SCSI_DATA_UNDERRUN:
-		switch (xs-status) {
-		case SCSI_OK:
+		switch (sie-scsi_status) {
+		case MPII_SCSIIO_ERR_STATUS_CHECK_COND:
+			xs-error = XS_SENSE;
+			/*FALLTHROUGH*/
+		case MPII_SCSIIO_ERR_STATUS_SUCCESS:
 			xs-resid = xs-datalen - 

CVS commit: src/sys/dev/scsipi

2013-08-09 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Aug  9 19:58:44 UTC 2013

Modified Files:
src/sys/dev/scsipi: ch.c

Log Message:
bump command timeout to 5 minutes. several
types of changers (Overland PowerLoader, Dell
PowerVault) have been exceeding the 100 sec
limit aborting a perfectly (slowly) progressing
operation.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/scsipi/ch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/scsipi/ch.c
diff -u src/sys/dev/scsipi/ch.c:1.87 src/sys/dev/scsipi/ch.c:1.88
--- src/sys/dev/scsipi/ch.c:1.87	Sat Oct 27 17:18:38 2012
+++ src/sys/dev/scsipi/ch.c	Fri Aug  9 19:58:44 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ch.c,v 1.87 2012/10/27 17:18:38 chs Exp $	*/
+/*	$NetBSD: ch.c,v 1.88 2013/08/09 19:58:44 kardel Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ch.c,v 1.87 2012/10/27 17:18:38 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: ch.c,v 1.88 2013/08/09 19:58:44 kardel Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -56,6 +56,8 @@ __KERNEL_RCSID(0, $NetBSD: ch.c,v 1.87 
 #include dev/scsipi/scsiconf.h
 
 #define CHRETRIES	2
+#define CHTIMEOUT	(5 * 60 * 1000)
+
 #define CHUNIT(x)	(minor((x)))
 
 struct ch_softc {
@@ -612,7 +614,7 @@ ch_move(struct ch_softc *sc, struct chan
 	 * Send command to changer.
 	 */
 	return (scsipi_command(sc-sc_periph, (void *)cmd, sizeof(cmd), 0, 0,
-	CHRETRIES, 10, NULL, 0));
+	CHRETRIES, CHTIMEOUT, NULL, 0));
 }
 
 static int
@@ -666,7 +668,7 @@ ch_exchange(struct ch_softc *sc, struct 
 	 * Send command to changer.
 	 */
 	return (scsipi_command(sc-sc_periph, (void *)cmd, sizeof(cmd), 0, 0,
-	CHRETRIES, 10, NULL, 0));
+	CHRETRIES, CHTIMEOUT, NULL, 0));
 }
 
 static int
@@ -702,7 +704,7 @@ ch_position(struct ch_softc *sc, struct 
 	 * Send command to changer.
 	 */
 	return (scsipi_command(sc-sc_periph, (void *)cmd, sizeof(cmd), 0, 0,
-	CHRETRIES, 10, NULL, 0));
+	CHRETRIES, CHTIMEOUT, NULL, 0));
 }
 
 /*
@@ -1041,7 +1043,7 @@ ch_getelemstatus(struct ch_softc *sc, in
 	 */
 	return (scsipi_command(sc-sc_periph, (void *)cmd, sizeof(cmd),
 	(void *)data, datalen,
-	CHRETRIES, 10, NULL, scsiflags | XS_CTL_DATA_IN));
+	CHRETRIES, CHTIMEOUT, NULL, scsiflags | XS_CTL_DATA_IN));
 }
 
 static int
@@ -1105,7 +1107,7 @@ ch_setvoltag(struct ch_softc *sc, struct
 	 * Send command to changer.
 	 */
 	return (scsipi_command(sc-sc_periph, (void *)cmd, sizeof(cmd),
-	(void *)data, datalen, CHRETRIES, 10, NULL,
+	(void *)data, datalen, CHRETRIES, CHTIMEOUT, NULL,
 	datalen ? XS_CTL_DATA_OUT : 0));
 }
 



CVS commit: src/sys/dev/pci

2013-08-08 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Thu Aug  8 07:06:13 UTC 2013

Modified Files:
src/sys/dev/pci: mpii.c

Log Message:
Allow 8 luns instead of 1. This enables access to the changer device on
a Dell PV-124T:
ch0 at scsibus0 target 9 lun 1: DELL, PV-124T, 0086 changer removable
ch0: 16 slots, 1 drive, 1 picker, 0 portals


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/mpii.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/mpii.c
diff -u src/sys/dev/pci/mpii.c:1.1 src/sys/dev/pci/mpii.c:1.2
--- src/sys/dev/pci/mpii.c:1.1	Thu Apr 19 17:50:51 2012
+++ src/sys/dev/pci/mpii.c	Thu Aug  8 07:06:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: mpii.c,v 1.1 2012/04/19 17:50:51 bouyer Exp $ */
+/* $NetBSD: mpii.c,v 1.2 2013/08/08 07:06:13 kardel Exp $ */
 /*	OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp 	*/
 /*
  * Copyright (c) 2010 Mike Belopuhov m...@crypt.org.ru
@@ -20,7 +20,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mpii.c,v 1.1 2012/04/19 17:50:51 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: mpii.c,v 1.2 2013/08/08 07:06:13 kardel Exp $);
 
 #include bio.h
 
@@ -2296,7 +2296,7 @@ mpii_attach(device_t parent, device_t se
 	chan-chan_bustype = scsi_sas_bustype;
 	chan-chan_channel = 0;
 	chan-chan_flags = 0;
-	chan-chan_nluns = 1;
+	chan-chan_nluns = 8;
 	chan-chan_ntargets = sc-sc_max_devices;
 	chan-chan_id = -1;
 



CVS import: src

2013-06-10 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Jun 10 06:04:35 UTC 2013

Update of /cvsroot/src
In directory ivanova.netbsd.org:/tmp/cvs-serv13274

Log Message:
Import of proposed patch to OpenBSD for supporting GPIO and status
leds on a Soekris net6501

patch posted on 2013-01-14 17:11:00 at
http://permalink.gmane.org/gmane.os.openbsd.tech/31317


Status:

Vendor Tag: matt_dainty
Release Tags:   GMANE_20130114171100

N src/sys/dev/isa/soekrisgpio.c
N src/share/man/man4/man4.x86/soekrisgpio.4

No conflicts created by this import



CVS commit: src

2013-06-10 Thread Frank Kardel
.
+.It soekrisgpio
+Soekris net6501 GPIO and LEDs driver
 .It tcic
 Databook DB86082, DB86084, DB86184, and DB86072
 .Tn PCMCIA
@@ -367,6 +369,7 @@ It is usually due to a suboptimally code
 .Xr sb 4 ,
 .Xr sea 4 ,
 .Xr sf2r 4 ,
+.Xr soekrisgpio 4 ,
 .Xr sm 4 ,
 .Xr tcic 4 ,
 .Xr tcom 4 ,

Index: src/share/man/man4/man4.x86/Makefile
diff -u src/share/man/man4/man4.x86/Makefile:1.13 src/share/man/man4/man4.x86/Makefile:1.14
--- src/share/man/man4/man4.x86/Makefile:1.13	Wed Jan  4 16:25:17 2012
+++ src/share/man/man4/man4.x86/Makefile	Mon Jun 10 07:14:01 2013
@@ -1,8 +1,8 @@
-#	$NetBSD: Makefile,v 1.13 2012/01/04 16:25:17 yamt Exp $
+#	$NetBSD: Makefile,v 1.14 2013/06/10 07:14:01 kardel Exp $
 
 MAN=	amdpcib.4 apic.4 balloon.4 coretemp.4 est.4 fdc.4 \
 	fwhrng.4 hpet.4 ichlpcib.4 lpt.4 mem.4 odcm.4 powernow.4 \
-	tprof_amdpmi.4 tprof_pmi.4 vmt.4
+	soekrisgpio.4 tprof_amdpmi.4 tprof_pmi.4 vmt.4
 
 MLINKS+=apic.4 ioapic.4 \
 	apic.4 lapic.4

Index: src/share/man/man4/man4.x86/soekrisgpio.4
diff -u src/share/man/man4/man4.x86/soekrisgpio.4:1.1.1.1 src/share/man/man4/man4.x86/soekrisgpio.4:1.2
--- src/share/man/man4/man4.x86/soekrisgpio.4:1.1.1.1	Mon Jun 10 06:04:35 2013
+++ src/share/man/man4/man4.x86/soekrisgpio.4	Mon Jun 10 07:14:01 2013
@@ -1,6 +1,7 @@
-.\ $OpenBSD$
+.\ $NetBSD: soekrisgpio.4,v 1.2 2013/06/10 07:14:01 kardel Exp $
+.\ from OpenBSD
 .\
-.\ Copyright (c) 2013 Matt Dainty matt@...
+.\ Copyright (c) 2013 Matt Dainty matt at bodgit-n-scarper.com
 .\
 .\ Permission to use, copy, modify, and distribute this software for any
 .\ purpose with or without fee is hereby granted, provided that the above
@@ -15,14 +16,14 @@
 .\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\
 .Dd $Mdocdate$
-.Dt SOEKRIS 4 amd64
+.Dt SOEKRIS 4 x86
 .Os
 .Sh NAME
-.Nm soekris
+.Nm soekrisgpio
 .Nd Soekris net6501 GPIO and LEDs
 .Sh SYNOPSIS
-.Cd soekris0 at isa? port 0x680
-.Cd gpio* at soekris?
+.Cd soekrisgpio0 at isa? port 0x680
+.Cd gpio* at soekrisgpio?
 .Sh DESCRIPTION
 The
 .Nm
@@ -46,12 +47,17 @@ Both may be used with
 The
 .Nm
 driver first appeared in
-.Ox 5.3 .
+.Nx
+7.0 .
 .Sh AUTHORS
 The
 .Nm
 driver was written by
-.An Matt Dainty Aq matt@... .
+.An Matt Dainty Aq matt@...
+and imported from a patch for OpenBSD to
+.Nx
+by
+.An Frank Kardel Aq kar...@netbsd.org .
 .Sh BUGS
-If the Xilinx FPGA is programmed with a different bistream, the driver will
-likely not function.
+If the Xilinx FPGA is programmed with a different bitstream, the driver will
+likely not function.
\ No newline at end of file

Index: src/sys/arch/amd64/conf/GENERIC
diff -u src/sys/arch/amd64/conf/GENERIC:1.377 src/sys/arch/amd64/conf/GENERIC:1.378
--- src/sys/arch/amd64/conf/GENERIC:1.377	Wed Jun  5 23:08:00 2013
+++ src/sys/arch/amd64/conf/GENERIC	Mon Jun 10 07:14:01 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.377 2013/06/05 23:08:00 christos Exp $
+# $NetBSD: GENERIC,v 1.378 2013/06/10 07:14:01 kardel Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include	arch/amd64/conf/std.amd64
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.377 $
+#ident 		GENERIC-$Revision: 1.378 $
 
 maxusers	64		# estimated number of users
 
@@ -532,6 +532,9 @@ ld*	at iop? tid ?			# block devices
 # Pulsing GPIO pins in software
 #gpiopwm*	at gpio?
 
+# Soekris 6501 GPIO/LED driver (provides gpiobus, needs gpio)
+#soekrisgpio0	at isa? port 0x680
+
 # SCSI Controllers and Devices
 
 # PCI SCSI controllers

Index: src/sys/arch/i386/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.359 src/sys/arch/i386/conf/ALL:1.360
--- src/sys/arch/i386/conf/ALL:1.359	Sat Jun  8 02:43:10 2013
+++ src/sys/arch/i386/conf/ALL	Mon Jun 10 07:14:01 2013
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.359 2013/06/08 02:43:10 dholland Exp $
+# $NetBSD: ALL,v 1.360 2013/06/10 07:14:01 kardel Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	arch/i386/conf/std.i386
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		ALL-$Revision: 1.359 $
+#ident 		ALL-$Revision: 1.360 $
 
 maxusers	64		# estimated number of users
 
@@ -777,6 +777,9 @@ owtemp* 	at onewire?			# Temperature sen
 # Keylock support
 gpiolock*	at gpio?
 
+# Soekris 6501 GPIO/LED driver (provides gpiobus, needs gpio)
+soekrisgpio0	at isa? port 0x680
+
 # SCSI Controllers and Devices
 
 # PCI SCSI controllers

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1094 src/sys/arch/i386/conf/GENERIC:1.1095
--- src/sys/arch/i386/conf/GENERIC:1.1094	Wed Jun  5 23:08:01 2013
+++ src/sys/arch/i386/conf/GENERIC	Mon Jun 10 07:14:01 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1094 2013/06/05 23:08:01 christos Exp $
+# $NetBSD: GENERIC,v 1.1095 2013/06/10 07:14:01 kardel Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	arch/i386/conf/std.i386
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary

CVS commit: src/lib/libc/sys

2013-06-08 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Jun  8 06:05:03 UTC 2013

Modified Files:
src/lib/libc/sys: chflags.2

Log Message:
Bring description in sync with errors-section and implementation reality.
(changing super-user only flags is not silently ignored)


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/lib/libc/sys/chflags.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/sys/chflags.2
diff -u src/lib/libc/sys/chflags.2:1.27 src/lib/libc/sys/chflags.2:1.28
--- src/lib/libc/sys/chflags.2:1.27	Sat Aug  6 11:28:24 2011
+++ src/lib/libc/sys/chflags.2	Sat Jun  8 06:05:03 2013
@@ -1,4 +1,4 @@
-.\	$NetBSD: chflags.2,v 1.27 2011/08/06 11:28:24 jruoho Exp $
+.\	$NetBSD: chflags.2,v 1.28 2013/06/08 06:05:03 kardel Exp $
 .\
 .\ Copyright (c) 1989, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -98,8 +98,6 @@ The
 and
 .Dv SF_APPEND
 flags may only be set or unset by the super-user.
-Attempts by the non-super-user to set the super-user only flags
-are silently ignored.
 These flags may be set at any time, but normally may only be unset when
 the system is in single-user mode.
 (See



CVS commit: src/sys/ufs/ufs

2013-06-07 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Jun  8 05:47:02 UTC 2013

Modified Files:
src/sys/ufs/ufs: ufs_vnops.c

Log Message:
fix clearing of system-flags (schg, sappnd). clearing system flags is possible 
again
at securelevel  1.
reviewed by christos@


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/sys/ufs/ufs/ufs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ufs/ufs_vnops.c
diff -u src/sys/ufs/ufs/ufs_vnops.c:1.212 src/sys/ufs/ufs/ufs_vnops.c:1.213
--- src/sys/ufs/ufs/ufs_vnops.c:1.212	Mon Mar 18 19:35:48 2013
+++ src/sys/ufs/ufs/ufs_vnops.c	Sat Jun  8 05:47:02 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ufs_vnops.c,v 1.212 2013/03/18 19:35:48 plunky Exp $	*/
+/*	$NetBSD: ufs_vnops.c,v 1.213 2013/06/08 05:47:02 kardel Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ufs_vnops.c,v 1.212 2013/03/18 19:35:48 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: ufs_vnops.c,v 1.213 2013/06/08 05:47:02 kardel Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ffs.h
@@ -503,7 +503,7 @@ ufs_setattr(void *v)
 			action |= KAUTH_VNODE_HAS_SYSFLAGS;
 		}
 
-		if ((vap-va_flags  UF_SETTABLE) != vap-va_flags) {
+		if ((vap-va_flags  SF_SETTABLE) != (ip-i_flags  SF_SETTABLE)) {
 			action |= KAUTH_VNODE_WRITE_SYSFLAGS;
 			changing_sysflags = true;
 		}



CVS commit: src/sys

2013-05-26 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun May 26 18:07:42 UTC 2013

Modified Files:
src/sys/conf: files
src/sys/kern: kern_tc.c
src/sys/sys: timepps.h

Log Message:
Extend kernel PPS api with pps_ref_event().
pps_ref_event() allows capturing PPS time stamps
that are not generated at precisely 1Hz (e. g.
by reading a precision clock via callout()).

This extension allows clock drivers to supply PPS
time-stamps and drive the kernel NTP PLL
without the overhead of interrupt-handling and
-processing.


To generate a diff of this commit:
cvs rdiff -u -r1.1070 -r1.1071 src/sys/conf/files
cvs rdiff -u -r1.44 -r1.45 src/sys/kern/kern_tc.c
cvs rdiff -u -r1.20 -r1.21 src/sys/sys/timepps.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1070 src/sys/conf/files:1.1071
--- src/sys/conf/files:1.1070	Sun Apr 28 03:11:32 2013
+++ src/sys/conf/files	Sun May 26 18:07:42 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1070 2013/04/28 03:11:32 christos Exp $
+#	$NetBSD: files,v 1.1071 2013/05/26 18:07:42 kardel Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -64,7 +64,7 @@ defflag opt_dtrace.h		KDTRACE_HOOKS
 defflag	opt_sysv.h		SYSVMSG SYSVSEM	SYSVSHM
 defparam opt_sysvparam.h	SHMMAXPGS SEMMNI SEMMNS SEMUME SEMMNU
 
-defflag	opt_ntp.h		PPS_SYNC NTP
+defflag	opt_ntp.h		PPS_SYNC PPS_DEBUG NTP
 
 defflag	opt_ptm.h		NO_DEV_PTM COMPAT_BSDPTY
 

Index: src/sys/kern/kern_tc.c
diff -u src/sys/kern/kern_tc.c:1.44 src/sys/kern/kern_tc.c:1.45
--- src/sys/kern/kern_tc.c:1.44	Tue Nov 13 20:10:02 2012
+++ src/sys/kern/kern_tc.c	Sun May 26 18:07:42 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.44 2012/11/13 20:10:02 pooka Exp $ */
+/* $NetBSD: kern_tc.c,v 1.45 2013/05/26 18:07:42 kardel Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $); */
-__KERNEL_RCSID(0, $NetBSD: kern_tc.c,v 1.44 2012/11/13 20:10:02 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_tc.c,v 1.45 2013/05/26 18:07:42 kardel Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_ntp.h
@@ -688,7 +688,8 @@ tc_setclock(const struct timespec *ts)
 
 	if (timestepwarnings) {
 		bintime2timespec(bt2, ts2);
-		log(LOG_INFO, Time stepped from %lld.%09ld to %lld.%09ld\n,
+		log(LOG_INFO,
+		Time stepped from %lld.%09ld to %lld.%09ld\n,
 		(long long)ts2.tv_sec, ts2.tv_nsec,
 		(long long)ts-tv_sec, ts-tv_nsec);
 	}
@@ -859,7 +860,8 @@ pps_ioctl(u_long cmd, void *data, struct
 
 	KASSERT(mutex_owned(timecounter_lock));
 
-	KASSERT(pps != NULL); /* XXX (NULL pps pointer in pps_ioctl) */
+	KASSERT(pps != NULL);
+
 	switch (cmd) {
 	case PPS_IOC_CREATE:
 		return (0);
@@ -913,6 +915,9 @@ pps_init(struct pps_state *pps)
 		pps-ppscap |= PPS_OFFSETCLEAR;
 }
 
+/*
+ * capture a timetamp in the pps structure
+ */
 void
 pps_capture(struct pps_state *pps)
 {
@@ -929,72 +934,223 @@ pps_capture(struct pps_state *pps)
 		pps-capgen = 0;
 }
 
+#ifdef PPS_DEBUG
+int ppsdebug = 0;
+#endif
+
+/*
+ * process a pps_capture()ed event
+ */
 void
 pps_event(struct pps_state *pps, int event)
 {
-	struct bintime bt;
+	pps_ref_event(pps, event, NULL, PPS_REFEVNT_PPS|PPS_REFEVNT_CAPTURE);
+}
+
+/*
+ * extended pps api /  kernel pll/fll entry point
+ *
+ * feed reference time stamps to PPS engine
+ *
+ * will simulate a PPS event and feed
+ * the NTP PLL/FLL if requested.
+ *
+ * the ref time stamps should be roughly once
+ * a second but do not need to be exactly in phase
+ * with the UTC second but should be close to it.
+ * this relaxation of requirements allows callout
+ * driven timestamping mechanisms to feed to pps 
+ * capture/kernel pll logic.
+ *
+ * calling pattern is:
+ *  pps_capture() (for PPS_REFEVNT_{CAPTURE|CAPCUR})
+ *  read timestamp from reference source
+ *  pps_ref_event()
+ *
+ * supported refmodes:
+ *  PPS_REFEVNT_CAPTURE
+ *use system timestamp of pps_capture()
+ *  PPS_REFEVNT_CURRENT
+ *use system timestamp of this call
+ *  PPS_REFEVNT_CAPCUR
+ *use average of read capture and current system time stamp
+ *  PPS_REFEVNT_PPS
+ *assume timestamp on second mark - ref_ts is ignored
+ *
+ */
+
+void
+pps_ref_event(struct pps_state *pps,
+	  int event,
+	  struct bintime *ref_ts,
+	  int refmode
+	)
+{
+	struct bintime bt;	/* current time */
+	struct bintime btd;	/* time difference */
+	struct bintime bt_ref;	/* reference time */
 	struct timespec ts, *tsp, *osp;
-	u_int64_t tcount, *pcount;
-	int foff;
-#ifdef PPS_SYNC
-	int fhard;
-#endif
+	struct timehands *th;
+	u_int64_t tcount, acount, dcount, *pcount;
+	int foff, fhard, gen;
 	pps_seq_t *pseq;
 
 	KASSERT(mutex_owned(timecounter_lock));
 
-	KASSERT(pps != NULL); /* XXX (NULL pps pointer in pps_event) */
-	/* If the timecounter was wound up underneath 

CVS commit: src/sys/dev/ic

2013-04-27 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Apr 27 13:25:09 UTC 2013

Modified Files:
src/sys/dev/ic: aic79xx_inline.h

Log Message:
fix panic due to physaddr instead of offset being passed to ahd_dmamap_sync


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/ic/aic79xx_inline.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/aic79xx_inline.h
diff -u src/sys/dev/ic/aic79xx_inline.h:1.21 src/sys/dev/ic/aic79xx_inline.h:1.22
--- src/sys/dev/ic/aic79xx_inline.h:1.21	Wed Apr  3 14:40:41 2013
+++ src/sys/dev/ic/aic79xx_inline.h	Sat Apr 27 13:25:09 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: aic79xx_inline.h,v 1.21 2013/04/03 14:40:41 christos Exp $	*/
+/*	$NetBSD: aic79xx_inline.h,v 1.22 2013/04/27 13:25:09 kardel Exp $	*/
 
 /*
  * Inline routines shareable across OS platforms.
@@ -393,7 +393,7 @@ ahd_sync_sense(struct ahd_softc *ahd, st
 {
 	ahd_dmamap_sync(ahd, ahd-parent_dmat,
 			scb-sense_map-dmamap,
-			/*offset*/scb-sense_busaddr,
+			/*offset*/scb-sense_busaddr - scb-sense_map-physaddr,
 			/*len*/AHD_SENSE_BUFSIZE, op);
 }
 



CVS commit: src/usr.sbin/route6d

2013-04-15 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Mon Apr 15 07:58:36 UTC 2013

Modified Files:
src/usr.sbin/route6d: route6d.c

Log Message:
reenable routing functionality by using RT_ROUNDUP for ROUNDUP when available


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.sbin/route6d/route6d.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/route6d/route6d.c
diff -u src/usr.sbin/route6d/route6d.c:1.66 src/usr.sbin/route6d/route6d.c:1.67
--- src/usr.sbin/route6d/route6d.c:1.66	Wed Aug 31 16:24:59 2011
+++ src/usr.sbin/route6d/route6d.c	Mon Apr 15 07:58:35 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: route6d.c,v 1.66 2011/08/31 16:24:59 plunky Exp $	*/
+/*	$NetBSD: route6d.c,v 1.67 2013/04/15 07:58:35 kardel Exp $	*/
 /*	$KAME: route6d.c,v 1.94 2002/10/26 20:08:55 itojun Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
 
 #include sys/cdefs.h
 #ifndef	lint
-__RCSID($NetBSD: route6d.c,v 1.66 2011/08/31 16:24:59 plunky Exp $);
+__RCSID($NetBSD: route6d.c,v 1.67 2013/04/15 07:58:35 kardel Exp $);
 #endif
 
 #include stdbool.h
@@ -83,8 +83,12 @@ __RCSID($NetBSD: route6d.c,v 1.66 2011/
 #endif
 
 /* alignment constraint for routing socket */
+#if defined(__NetBSD__)  defined(RT_ROUNDUP)
+#define ROUNDUP(a) RT_ROUNDUP(a)
+#else
 #define ROUNDUP(a) \
 	((a)  0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
+#endif
 #define ADVANCE(x, n) (x += ROUNDUP((n)-sa_len))
 
 /*



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-17 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Aug 17 22:37:26 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
re-enable broadcast client config after interface re-scanning
make broadcast transmission work again


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.9 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.10
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.9	Wed Feb  1 21:21:25 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Fri Aug 17 22:37:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.9 2012/02/01 21:21:25 kardel Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.10 2012/08/17 22:37:26 kardel Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -1592,9 +1592,11 @@ refresh_interface(
 {
 #ifdef  OS_MISSES_SPECIFIC_ROUTE_UPDATES
 	if (interface-fd != INVALID_SOCKET) {
+		int bcast = (interface-flags  INT_BCASTOPEN) != 0;
 		close_and_delete_fd_from_list(interface-fd);
+		interface-flags = ~INT_BCASTOPEN;
 		interface-fd = open_socket(interface-sin,
-	0, 0, interface);
+	bcast, 0, interface);
 		 /*
 		  * reset TTL indication so TTL is is set again 
 		  * next time around
@@ -2047,6 +2049,9 @@ update_interfaces(
 		msyslog(LOG_INFO, peers refreshed);
 	}
 
+	if (sys_bclient)
+		io_setbclient();
+
 	return new_interface_found;
 }
 
@@ -2074,9 +2079,6 @@ create_sockets(
 
 	update_interfaces(port, NULL, NULL);
 
-	if (sys_bclient)
-		io_setbclient();
-
 	/*
 	 * Now that we have opened all the sockets, turn off the reuse
 	 * flag for security.



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-08-11 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 11 20:09:08 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: refclock_parse.c

Log Message:
fix some fallout from append correction


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/refclock_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/refclock_parse.c
diff -u src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.6 src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.7
--- src/external/bsd/ntp/dist/ntpd/refclock_parse.c:1.6	Fri Aug 10 08:22:49 2012
+++ src/external/bsd/ntp/dist/ntpd/refclock_parse.c	Sat Aug 11 20:09:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refclock_parse.c,v 1.6 2012/08/10 08:22:49 christos Exp $	*/
+/*	$NetBSD: refclock_parse.c,v 1.7 2012/08/11 20:09:08 kardel Exp $	*/
 
 /*
  * /src/NTP/REPOSITORY/ntp4-dev/ntpd/refclock_parse.c,v 4.81 2009/05/01 10:15:29 kardel RELEASE_20090105_A
@@ -3527,7 +3527,9 @@ parse_control(
 			tmpctl.parsegettc.parse_state |= parse-timedata.parse_state 
 (PARSEB_PPS|PARSEB_S_PPS);
 
-			(void) parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+			(void)parsestate(tmpctl.parsegettc.parse_state, tt, BUFFER_SIZES(start, tt, 512));
+
+			tt += strlen(tt);
 
 			tt = ap(start, 512, tt, \);
 
@@ -3546,13 +3548,18 @@ parse_control(
 		}
 		else
 		{
+			int count = tmpctl.parseformat.parse_count - 1;
+
 			start = tt = add_var(out-kv_list, 80, RO|DEF);
 			tt = ap(start, 80, tt, refclock_format=\);
 
-			tt = ap(start, 80, tt, *.*s, 
-			tmpctl.parseformat.parse_count,
-			tmpctl.parseformat.parse_count,
-			tmpctl.parseformat.parse_buffer);
+			if (count  0) {
+tt = ap(start, 80, tt, %*.*s, 
+				count,
+				count,
+				tmpctl.parseformat.parse_buffer);
+			}
+
 			tt = ap(start, 80, tt, \);
 		}
 
@@ -4535,8 +4542,8 @@ gps16x_message(
 	if (utc.valid)
 	{
 		p = ap(buffer, sizeof(buffer), p, gps_utc_correction=\);
-		p += strlen(p);
 		mk_utcinfo(p, utc.t0t.wn, utc.WNlsf, utc.DNt, utc.delta_tls, utc.delta_tlsf, BUFFER_SIZE(buffer, p));
+		p += strlen(p);
 		p = ap(buffer, sizeof(buffer), p, \);
 	}
 	else
@@ -5457,7 +5464,6 @@ trimbletsip_message(
 t = ap(pbuffer, sizeof(pbuffer), t, -MANUAL, );
 			else
 t = ap(pbuffer, sizeof(pbuffer), t, -AUTO, );
-			t += strlen(t);
 			
 			t = ap(pbuffer, sizeof(pbuffer), t, satellites %02d %02d %02d %02d, PDOP %.2f, HDOP %.2f, VDOP %.2f, TDOP %.2f,
 mb(1), mb(2), mb(3), mb(4),



CVS commit: src/sbin/routed

2012-06-24 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 24 16:24:35 UTC 2012

Modified Files:
src/sbin/routed: if.c

Log Message:
PR/44647: commit fix proposed by Takahiro HAYASHI
verified to be working in -current and also helps NetBSD-6 BETA2


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sbin/routed/if.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/routed/if.c
diff -u src/sbin/routed/if.c:1.29 src/sbin/routed/if.c:1.30
--- src/sbin/routed/if.c:1.29	Wed Oct 13 09:19:40 2010
+++ src/sbin/routed/if.c	Sun Jun 24 16:24:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.29 2010/10/13 09:19:40 martin Exp $	*/
+/*	$NetBSD: if.c,v 1.30 2012/06/24 16:24:34 kardel Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -37,7 +37,7 @@
 #include pathnames.h
 
 #ifdef __NetBSD__
-__RCSID($NetBSD: if.c,v 1.29 2010/10/13 09:19:40 martin Exp $);
+__RCSID($NetBSD: if.c,v 1.30 2012/06/24 16:24:34 kardel Exp $);
 #elif defined(__FreeBSD__)
 __RCSID($FreeBSD$);
 #else
@@ -641,6 +641,9 @@ rt_xaddrs(struct rt_addrinfo *info,
 #ifdef _HAVE_SA_LEN
 	static struct sockaddr sa_zero;
 #endif
+#if defined(__NetBSD__)  defined(RT_ROUNDUP)
+#define ROUNDUP(a) RT_ROUNDUP(a)
+#else
 #ifdef sgi
 #define ROUNDUP(a) ((a)  0 ? (1 + (((a) - 1) | (sizeof(__uint64_t) - 1))) \
 		: sizeof(__uint64_t))
@@ -648,6 +651,7 @@ rt_xaddrs(struct rt_addrinfo *info,
 #define ROUNDUP(a) ((a)  0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) \
 		: sizeof(long))
 #endif
+#endif /* defined(__NetBSD__)  defined(RT_ROUNDUP) */
 
 
 	memset(info, 0, sizeof(*info));



CVS commit: src/lib/libc/net

2012-03-20 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Mar 20 10:34:33 UTC 2012

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
PR 46206: fix programmed SIGSEGV
more work is needed as tests seem to indicate that name resolution now
does no seem to work (firefox reports Server not found)
thanks to Ryo ONODERA for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.98 src/lib/libc/net/getaddrinfo.c:1.99
--- src/lib/libc/net/getaddrinfo.c:1.98	Sat Mar 17 21:56:40 2012
+++ src/lib/libc/net/getaddrinfo.c	Tue Mar 20 10:34:33 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.98 2012/03/17 21:56:40 christos Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.99 2012/03/20 10:34:33 kardel Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getaddrinfo.c,v 1.98 2012/03/17 21:56:40 christos Exp $);
+__RCSID($NetBSD: getaddrinfo.c,v 1.99 2012/03/20 10:34:33 kardel Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -1032,7 +1032,7 @@ addrconfig(uint64_t *mask)
 	if (getifaddrs(ifaddrs) == -1)
 		return -1;
 
-	mask = 0;
+	*mask = 0;
 	for (ifa = ifaddrs; ifa != NULL; ifa = ifa-ifa_next)
 		if (ifa-ifa_addr  (ifa-ifa_flags  IFF_UP)) {
 			_DIAGASSERT(ifa-ifa_addr-sa_family  64);



CVS commit: src/lib/libc/net

2012-03-20 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Mar 20 12:04:01 UTC 2012

Modified Files:
src/lib/libc/net: getaddrinfo.c

Log Message:
PR pkg/46206
re-establish fqdn lookup when AI_ADDRCONFIG is used in hints
AI_ADDRCONFIG led to fqdn lookup being skipped as the systems didn't
configure any PF_UNSPEC addresses - check was too strict here.
Thnaks to Ryo ONODERA for testing.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/lib/libc/net/getaddrinfo.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/net/getaddrinfo.c
diff -u src/lib/libc/net/getaddrinfo.c:1.99 src/lib/libc/net/getaddrinfo.c:1.100
--- src/lib/libc/net/getaddrinfo.c:1.99	Tue Mar 20 10:34:33 2012
+++ src/lib/libc/net/getaddrinfo.c	Tue Mar 20 12:04:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: getaddrinfo.c,v 1.99 2012/03/20 10:34:33 kardel Exp $	*/
+/*	$NetBSD: getaddrinfo.c,v 1.100 2012/03/20 12:04:01 kardel Exp $	*/
 /*	$KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $	*/
 
 /*
@@ -55,7 +55,7 @@
 
 #include sys/cdefs.h
 #if defined(LIBC_SCCS)  !defined(lint)
-__RCSID($NetBSD: getaddrinfo.c,v 1.99 2012/03/20 10:34:33 kardel Exp $);
+__RCSID($NetBSD: getaddrinfo.c,v 1.100 2012/03/20 12:04:01 kardel Exp $);
 #endif /* LIBC_SCCS and not lint */
 
 #include namespace.h
@@ -503,8 +503,11 @@ getaddrinfo(const char *hostname, const 
 	for (ex = explore; ex-e_af = 0; ex++) {
 		*pai = ai0;
 
+
 		/* ADDRCONFIG check */
-		if uint64_t)1  ex-e_af)  mask) == 0)
+		/* PF_UNSPEC entries are prepared for DNS queries only */
+		if (ex-e_af != PF_UNSPEC 
+		(((uint64_t)1  ex-e_af)  mask) == 0)
 			continue;
 
 		/* require exact match for family field */



CVS commit: src/external/bsd/ntp/dist/ntpq

2012-02-03 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Fri Feb  3 10:20:29 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.c

Log Message:
Clang compile fix from Joerg Sonneberger approved by releng.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpq/ntpq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.6 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.7
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.6	Wed Feb  1 22:48:15 2012
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Fri Feb  3 10:20:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.6 2012/02/01 22:48:15 kardel Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.7 2012/02/03 10:20:29 kardel Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -1080,7 +1080,7 @@ getresponse(
 
 		if (debug = 2)
 			printf(Got packet, size = %d\n, n);
-		if ((int)count  (n - CTL_HEADER_LEN)) {
+		if ((int)count  (n - (int)CTL_HEADER_LEN)) {
 			if (debug)
 printf(Received count of %d octets, 
 	data in packet is %u\n,



CVS commit: src/external/bsd/ntp/lib/libntp

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 08:15:21 UTC 2012

Modified Files:
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
add libotps for autoopts headers to CPPFLAGS


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/lib/libntp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/lib/libntp/Makefile
diff -u src/external/bsd/ntp/lib/libntp/Makefile:1.4 src/external/bsd/ntp/lib/libntp/Makefile:1.5
--- src/external/bsd/ntp/lib/libntp/Makefile:1.4	Wed Feb  1 07:46:30 2012
+++ src/external/bsd/ntp/lib/libntp/Makefile	Wed Feb  1 08:15:21 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2012/02/01 07:46:30 kardel Exp $
+#	$NetBSD: Makefile,v 1.5 2012/02/01 08:15:21 kardel Exp $
 
 LIBISPRIVATE=yes
 
@@ -25,6 +25,6 @@ SRCS=systime.c a_md5encrypt.c adjtime.c 
  uglydate.c uinttoa.c ymd2yd.c ntp_libopts.c
 
 COPTS.msyslog.c+= -Wno-format-nonliteral
-COPTS.ntp_libopts.c+= -I${IDIST}/sntp/libopts
+CPPFLAGS+= -I${IDIST}/sntp/libopts
 
 .include bsd.lib.mk



CVS commit: src/doc

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 08:59:07 UTC 2012

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
document ntp 4.2.6p5 import


To generate a diff of this commit:
cvs rdiff -u -r1.903 -r1.904 src/doc/3RDPARTY
cvs rdiff -u -r1.1664 -r1.1665 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.903 src/doc/3RDPARTY:1.904
--- src/doc/3RDPARTY:1.903	Tue Jan 31 20:11:41 2012
+++ src/doc/3RDPARTY	Wed Feb  1 08:59:07 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.903 2012/01/31 20:11:41 kardel Exp $
+#	$NetBSD: 3RDPARTY,v 1.904 2012/02/01 08:59:07 kardel Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -713,7 +713,7 @@ and ndbootd-raw.c.  Restore saved config
 HAVE_STRICT_ALIGNMENT.  Fix RCS IDs, import.
 
 Package:	ntp
-Version:	4.2.6
+Version:	4.2.6p5
 Current Vers:	4.2.6p5
 Maintainer:	David L. Mills mi...@udel.edu
 Archive Site:	ftp://ftp.udel.edu/pub/ntp/ntp4/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1664 src/doc/CHANGES:1.1665
--- src/doc/CHANGES:1.1664	Wed Feb  1 08:45:03 2012
+++ src/doc/CHANGES	Wed Feb  1 08:59:07 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1664 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1665 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1233,3 +1233,5 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
 		added with the bouyer-quota2 branch. [dholland 20120201]
 	mac68k: Add timecounter support to the CSI Hurdler Centronics
 		Parallel Interface cpi(4) driver. [hauke 20120201]
+	ntp: import ntp 4.2.6p5.
+		[kardel 20120201]



CVS commit: src/external/bsd/ntp

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 20:48:02 UTC 2012

Modified Files:
src/external/bsd/ntp: Makefile.inc
src/external/bsd/ntp/dist/ntpd: ntp_control.c ntp_io.c ntp_refclock.c
ntp_restrict.c refclock_jjy.c
src/external/bsd/ntp/dist/ntpq: ntpq.c
src/external/bsd/ntp/dist/sntp: crypto.c log.c main.c networking.c
networking.h
src/external/bsd/ntp/dist/sntp/libopts: numeric.c
src/external/bsd/ntp/dist/sntp/libopts/autoopts: options.h
src/external/bsd/ntp/dist/util: ntp-keygen-opts.c

Log Message:
back to WARNS=4 (constify and signedness corrections)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/ntp/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpd/ntp_control.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/ntp/dist/ntpd/ntp_io.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/ntpd/ntp_refclock.c \
src/external/bsd/ntp/dist/ntpd/refclock_jjy.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_restrict.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpq/ntpq.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/sntp/crypto.c \
src/external/bsd/ntp/dist/sntp/main.c \
src/external/bsd/ntp/dist/sntp/networking.h
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/sntp/log.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/sntp/networking.c
cvs rdiff -u -r1.1.1.2 -r1.2 src/external/bsd/ntp/dist/sntp/libopts/numeric.c
cvs rdiff -u -r1.3 -r1.4 \
src/external/bsd/ntp/dist/sntp/libopts/autoopts/options.h
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/dist/util/ntp-keygen-opts.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/Makefile.inc
diff -u src/external/bsd/ntp/Makefile.inc:1.10 src/external/bsd/ntp/Makefile.inc:1.11
--- src/external/bsd/ntp/Makefile.inc:1.10	Wed Feb  1 07:46:20 2012
+++ src/external/bsd/ntp/Makefile.inc	Wed Feb  1 20:48:01 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.10 2012/02/01 07:46:20 kardel Exp $
+#	$NetBSD: Makefile.inc,v 1.11 2012/02/01 20:48:01 kardel Exp $
 
 .if !defined(NTP_MAKEFILE_INC)
 NTP_MAKEFILE_INC=yes
@@ -10,8 +10,8 @@ CWARNFLAGS.clang+=	-Wno-unneeded-interna
 			-Wno-format-security \
 			-Wno-parentheses -Wno-constant-logical-operand
 
-#WARNS?=	4
-WARNS?=	0
+WARNS?=	4
+
 
 .include bsd.own.mk
 

Index: src/external/bsd/ntp/dist/ntpd/ntp_control.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.5 src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.6
--- src/external/bsd/ntp/dist/ntpd/ntp_control.c:1.5	Wed Feb  1 07:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_control.c	Wed Feb  1 20:48:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_control.c,v 1.5 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_control.c,v 1.6 2012/02/01 20:48:01 kardel Exp $	*/
 
 /*
  * ntp_control.c - respond to control messages and send async traps
@@ -700,11 +700,11 @@ process_control(
 	 * If the length is less than required for the header, or
 	 * it is a response or a fragment, ignore this.
 	 */
-	if (rbufp-recv_length  CTL_HEADER_LEN
+	if (rbufp-recv_length  (int)CTL_HEADER_LEN
 	|| pkt-r_m_e_op  (CTL_RESPONSE|CTL_MORE|CTL_ERROR)
 	|| pkt-offset != 0) {
 		DPRINTF(1, (invalid format in control packet\n));
-		if (rbufp-recv_length  CTL_HEADER_LEN)
+		if (rbufp-recv_length  (int)CTL_HEADER_LEN)
 			numctltooshort++;
 		if (pkt-r_m_e_op  CTL_RESPONSE)
 			numctlinputresp++;
@@ -1082,7 +1082,7 @@ ctl_putdbl(
 	while (*cq != '\0')
 		*cp++ = *cq++;
 	*cp++ = '=';
-	NTP_INSIST((cp - buffer)  sizeof(buffer));
+	NTP_INSIST((cp - buffer)  (int)sizeof(buffer));
 	snprintf(cp, sizeof(buffer) - (cp - buffer), %.3f, ts);
 	cp += strlen(cp);
 	ctl_putdata(buffer, (unsigned)(cp - buffer), 0);
@@ -1107,7 +1107,7 @@ ctl_putuint(
 		*cp++ = *cq++;
 
 	*cp++ = '=';
-	NTP_INSIST((cp - buffer)  sizeof(buffer));
+	NTP_INSIST((cp - buffer)  (int)sizeof(buffer));
 	snprintf(cp, sizeof(buffer) - (cp - buffer), %lu, uval);
 	cp += strlen(cp);
 	ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
@@ -1138,7 +1138,7 @@ ctl_putfs(
 	tm = gmtime(fstamp);
 	if (NULL ==  tm)
 		return;
-	NTP_INSIST((cp - buffer)  sizeof(buffer));
+	NTP_INSIST((cp - buffer)  (int)sizeof(buffer));
 	snprintf(cp, sizeof(buffer) - (cp - buffer),
 		 %04d%02d%02d%02d%02d, tm-tm_year + 1900,
 		 tm-tm_mon + 1, tm-tm_mday, tm-tm_hour, tm-tm_min);
@@ -1167,7 +1167,7 @@ ctl_puthex(
 		*cp++ = *cq++;
 
 	*cp++ = '=';
-	NTP_INSIST((cp - buffer)  sizeof(buffer));
+	NTP_INSIST((cp - buffer)  (int)sizeof(buffer));
 	snprintf(cp, sizeof(buffer) - (cp - buffer), 0x%lx, uval);
 	cp += strlen(cp);
 	ctl_putdata(buffer,(unsigned)( cp - buffer ), 0);
@@ -1193,7 +1193,7 @@ ctl_putint(
 		*cp++ = *cq++;
 
 	*cp++ = '=';
-	NTP_INSIST((cp - buffer)  sizeof(buffer));
+	NTP_INSIST((cp - buffer)  (int)sizeof(buffer));
 	snprintf(cp, sizeof(buffer) - 

CVS commit: src/external/bsd/ntp/lib/libopts

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 20:49:09 UTC 2012

Modified Files:
src/external/bsd/ntp/lib/libopts: Makefile

Log Message:
build libopts with WARNS=0 for now


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/lib/libopts/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/lib/libopts/Makefile
diff -u src/external/bsd/ntp/lib/libopts/Makefile:1.3 src/external/bsd/ntp/lib/libopts/Makefile:1.4
--- src/external/bsd/ntp/lib/libopts/Makefile:1.3	Wed Feb  1 07:46:30 2012
+++ src/external/bsd/ntp/lib/libopts/Makefile	Wed Feb  1 20:49:09 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2012/02/01 07:46:30 kardel Exp $
+#	$NetBSD: Makefile,v 1.4 2012/02/01 20:49:09 kardel Exp $
 
 LIBISPRIVATE=yes
 
@@ -8,6 +8,9 @@ LIB=opts
 
 .include ${.CURDIR}/../Makefile.inc
 
+# libopts is not really great code
+WARNS=0
+
 DIST=	${IDIST}/sntp/libopts
 
 CPPFLAGS+=-I${DIST}



CVS commit: src/external/bsd/ntp/dist/ntpd

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 21:21:26 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
initialize min_dist


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.8 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.9
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.8	Wed Feb  1 20:48:01 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Wed Feb  1 21:21:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.8 2012/02/01 20:48:01 kardel Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.9 2012/02/01 21:21:25 kardel Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -3801,7 +3801,9 @@ findclosestinterface(
 	sockaddr_u	addr_dist;
 	sockaddr_u	min_dist;
 
+	
 	winner = NULL;
+	min_dist = *addr;
 	
 	for (ep = ep_list; ep != NULL; ep = ep-elink) {
 		if (ep-ignore_packets ||



CVS commit: src/external/bsd/ntp/bin/sntp

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 21:22:19 UTC 2012

Modified Files:
src/external/bsd/ntp/bin/sntp: Makefile

Log Message:
use WARNS=0 until const issue is resolved


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/bin/sntp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/bin/sntp/Makefile
diff -u src/external/bsd/ntp/bin/sntp/Makefile:1.3 src/external/bsd/ntp/bin/sntp/Makefile:1.4
--- src/external/bsd/ntp/bin/sntp/Makefile:1.3	Wed Feb  1 07:46:21 2012
+++ src/external/bsd/ntp/bin/sntp/Makefile	Wed Feb  1 21:22:19 2012
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2012/02/01 07:46:21 kardel Exp $
+# $NetBSD: Makefile,v 1.4 2012/02/01 21:22:19 kardel Exp $
 
 USE_FORT?= yes	# network client/server
 
@@ -9,6 +9,8 @@ BINDIR=	/usr/sbin
 
 .include ${.CURDIR}/../Makefile.inc
 
+WARNS=0
+
 DIST=${IDIST}/sntp
 
 CPPFLAGS+=-I${IDIST}/sntp -I${IDIST}/sntp/libopts



CVS commit: src/external/bsd/ntp/dist

2012-02-01 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 22:48:16 UTC 2012

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_request.c
src/external/bsd/ntp/dist/ntpdc: ntpdc.c
src/external/bsd/ntp/dist/ntpq: ntpq.c

Log Message:
cleanup printf fmt differences between i386/amd64


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/ntp/dist/ntpd/ntp_request.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpdc/ntpdc.c
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/dist/ntpq/ntpq.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_request.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.6 src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.7
--- src/external/bsd/ntp/dist/ntpd/ntp_request.c:1.6	Wed Feb  1 07:46:22 2012
+++ src/external/bsd/ntp/dist/ntpd/ntp_request.c	Wed Feb  1 22:48:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_request.c,v 1.6 2012/02/01 07:46:22 kardel Exp $	*/
+/*	$NetBSD: ntp_request.c,v 1.7 2012/02/01 22:48:15 kardel Exp $	*/
 
 /*
  * ntp_request.c - respond to information requests
@@ -584,13 +584,13 @@ process_private(
 		 */
 		if (!INFO_IS_AUTH(inpkt-auth_seq) || !info_auth_keyid
 		|| ntohl(tailinpkt-keyid) != info_auth_keyid) {
-			DPRINTF(5, (failed auth %d info_auth_keyid %u pkt keyid %u maclen %zu\n,
+			DPRINTF(5, (failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n,
 INFO_IS_AUTH(inpkt-auth_seq),
 info_auth_keyid,
 ntohl(tailinpkt-keyid), (u_long)mac_len));
 #ifdef DEBUG
 			msyslog(LOG_DEBUG,
-process_private: failed auth %d info_auth_keyid %u pkt keyid %u maclen %zu\n,
+process_private: failed auth %d info_auth_keyid %u pkt keyid %u maclen %lu\n,
 INFO_IS_AUTH(inpkt-auth_seq),
 info_auth_keyid,
 ntohl(tailinpkt-keyid), (u_long)mac_len);

Index: src/external/bsd/ntp/dist/ntpdc/ntpdc.c
diff -u src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.4 src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.5
--- src/external/bsd/ntp/dist/ntpdc/ntpdc.c:1.4	Wed Feb  1 07:46:23 2012
+++ src/external/bsd/ntp/dist/ntpdc/ntpdc.c	Wed Feb  1 22:48:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpdc.c,v 1.4 2012/02/01 07:46:23 kardel Exp $	*/
+/*	$NetBSD: ntpdc.c,v 1.5 2012/02/01 22:48:15 kardel Exp $	*/
 
 /*
  * ntpdc - control and monitor your ntpd daemon
@@ -1782,7 +1782,7 @@ keytype(
 	int		key_type;
 
 	if (!pcmd-nargs) {
-		fprintf(fp, keytype is %s with %zu octet digests\n,
+		fprintf(fp, keytype is %s with %lu octet digests\n,
 			keytype_name(info_auth_keytype),
 			(u_long)info_auth_hashlen);
 		return;

Index: src/external/bsd/ntp/dist/ntpq/ntpq.c
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.c:1.5 src/external/bsd/ntp/dist/ntpq/ntpq.c:1.6
--- src/external/bsd/ntp/dist/ntpq/ntpq.c:1.5	Wed Feb  1 20:48:01 2012
+++ src/external/bsd/ntp/dist/ntpq/ntpq.c	Wed Feb  1 22:48:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntpq.c,v 1.5 2012/02/01 20:48:01 kardel Exp $	*/
+/*	$NetBSD: ntpq.c,v 1.6 2012/02/01 22:48:15 kardel Exp $	*/
 
 /*
  * ntpq - query an NTP server using mode 6 commands
@@ -1031,9 +1031,9 @@ getresponse(
 
 		if (n  shouldbesize) {
 			printf(Response packet claims %u octets 
-payload, above %ld received\n,
+payload, above %u received\n,
 count,
-n - CTL_HEADER_LEN
+(u_int)(n - CTL_HEADER_LEN)
 );
 			return ERR_INCOMPLETE;
 		}
@@ -1083,8 +1083,8 @@ getresponse(
 		if ((int)count  (n - CTL_HEADER_LEN)) {
 			if (debug)
 printf(Received count of %d octets, 
-	data in packet is %lu\n,
-	count, n-CTL_HEADER_LEN);
+	data in packet is %u\n,
+	count, (u_int)(n-CTL_HEADER_LEN));
 			continue;
 		}
 		if (count == 0  CTL_ISMORE(rpkt.r_m_e_op)) {
@@ -2448,7 +2448,7 @@ keytype(
 	int		key_type;
 
 	if (!pcmd-nargs) {
-		fprintf(fp, keytype is %s with %zu octet digests\n,
+		fprintf(fp, keytype is %s with %lu octet digests\n,
 			keytype_name(info_auth_keytype),
 			(u_long)info_auth_hashlen);
 		return;



CVS commit: src/external/bsd/ntp

2012-01-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Jan 31 20:05:13 UTC 2012

Modified Files:
src/external/bsd/ntp: ntp2netbsd

Log Message:
fix instructions in comment part


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/ntp2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/ntp2netbsd
diff -u src/external/bsd/ntp/ntp2netbsd:1.2 src/external/bsd/ntp/ntp2netbsd:1.3
--- src/external/bsd/ntp/ntp2netbsd:1.2	Sat Oct  8 19:28:39 2011
+++ src/external/bsd/ntp/ntp2netbsd	Tue Jan 31 20:05:13 2012
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: ntp2netbsd,v 1.2 2011/10/08 19:28:39 christos Exp $
+#	$NetBSD: ntp2netbsd,v 1.3 2012/01/31 20:05:13 kardel Exp $
 #
 # Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,8 +35,8 @@
 #	$ cd /some/where/temporary
 #	$ tar xpfz /new/ntp/release/tar/file
 #	$ sh /usr/src/external/bsd/ntp/ntp2netbsd ntp-4.x.y `pwd`
-#	$ cd src/externaä/bsd/ntp/dist
-#	$ cvs import -m Import ntp 4.x.y src/dist/ntp UDEL ntp-4-x-y
+#	$ cd src/external/bsd/ntp/dist
+#	$ cvs import -m Import ntp 4.x.y src/external/bsd/ntp/dist UDEL ntp-4-x-y
 #	$ cd ../../../../../ntp-4.x.y
 #	$ run ./configure  --enable-all-clocks --enable-parse-clocks
 #	$ echo cp config.h /usr/src/external/bsd/ntp/include



CVS commit: src/doc

2012-01-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Jan 31 20:11:42 UTC 2012

Modified Files:
src/doc: 3RDPARTY

Log Message:
update ntp current version


To generate a diff of this commit:
cvs rdiff -u -r1.902 -r1.903 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.902 src/doc/3RDPARTY:1.903
--- src/doc/3RDPARTY:1.902	Sat Jan 28 19:43:47 2012
+++ src/doc/3RDPARTY	Tue Jan 31 20:11:41 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.902 2012/01/28 19:43:47 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.903 2012/01/31 20:11:41 kardel Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -714,7 +714,7 @@ HAVE_STRICT_ALIGNMENT.  Fix RCS IDs, imp
 
 Package:	ntp
 Version:	4.2.6
-Current Vers:	4.2.4p8
+Current Vers:	4.2.6p5
 Maintainer:	David L. Mills mi...@udel.edu
 Archive Site:	ftp://ftp.udel.edu/pub/ntp/ntp4/
 Home Page:	http://www.ntp.org/, http://support.ntp.org/



CVS commit: src/external/bsd/ntp/dist

2012-01-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Jan 31 21:29:40 UTC 2012

Update of /cvsroot/src/external/bsd/ntp/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv2606

Log Message:
Import ntp 4.2.6p5

Status:

Vendor Tag: UDEL
Release Tags:   ntp-4-2-6p5

U src/external/bsd/ntp/dist/CommitLog-4.1.0
U src/external/bsd/ntp/dist/COPYRIGHT
U src/external/bsd/ntp/dist/ChangeLog
U src/external/bsd/ntp/dist/CommitLog
U src/external/bsd/ntp/dist/Makefile.am
U src/external/bsd/ntp/dist/INSTALL
U src/external/bsd/ntp/dist/NOTES.y2kfixes
U src/external/bsd/ntp/dist/Makefile.in
U src/external/bsd/ntp/dist/NEWS
U src/external/bsd/ntp/dist/README.bk
U src/external/bsd/ntp/dist/README
U src/external/bsd/ntp/dist/bincheck.mf
U src/external/bsd/ntp/dist/README.hackers
U src/external/bsd/ntp/dist/README.patches
U src/external/bsd/ntp/dist/README.refclocks
U src/external/bsd/ntp/dist/README.versions
U src/external/bsd/ntp/dist/TODO
U src/external/bsd/ntp/dist/WHERE-TO-START
U src/external/bsd/ntp/dist/aclocal.m4
U src/external/bsd/ntp/dist/bootstrap
U src/external/bsd/ntp/dist/build
U src/external/bsd/ntp/dist/compile
U src/external/bsd/ntp/dist/config.guess
U src/external/bsd/ntp/dist/config.h.in
U src/external/bsd/ntp/dist/config.sub
U src/external/bsd/ntp/dist/configure
U src/external/bsd/ntp/dist/configure.ac
U src/external/bsd/ntp/dist/depcomp
U src/external/bsd/ntp/dist/deps-ver
U src/external/bsd/ntp/dist/depsver.mf
U src/external/bsd/ntp/dist/dot.emacs
U src/external/bsd/ntp/dist/excludes
U src/external/bsd/ntp/dist/flock-build
U src/external/bsd/ntp/dist/install-sh
U src/external/bsd/ntp/dist/ltmain.sh
U src/external/bsd/ntp/dist/missing
U src/external/bsd/ntp/dist/packageinfo.sh
U src/external/bsd/ntp/dist/readme.y2kfixes
U src/external/bsd/ntp/dist/results.y2kfixes
U src/external/bsd/ntp/dist/version.m4
U src/external/bsd/ntp/dist/version
U src/external/bsd/ntp/dist/ylwrap
U src/external/bsd/ntp/dist/ElectricFence/tstheap.c
U src/external/bsd/ntp/dist/ElectricFence/efence.c
U src/external/bsd/ntp/dist/ElectricFence/eftest.c
U src/external/bsd/ntp/dist/ElectricFence/README
U src/external/bsd/ntp/dist/ElectricFence/page.c
U src/external/bsd/ntp/dist/ElectricFence/libefence.3
U src/external/bsd/ntp/dist/ElectricFence/Makefile.in
U src/external/bsd/ntp/dist/ElectricFence/print.c
U src/external/bsd/ntp/dist/ElectricFence/CHANGES
U src/external/bsd/ntp/dist/ElectricFence/Makefile.am
U src/external/bsd/ntp/dist/ElectricFence/COPYING
U src/external/bsd/ntp/dist/ElectricFence/efence.h
U src/external/bsd/ntp/dist/adjtimed/adjtimed.c
U src/external/bsd/ntp/dist/adjtimed/README
U src/external/bsd/ntp/dist/adjtimed/Makefile.in
U src/external/bsd/ntp/dist/adjtimed/Makefile.am
U src/external/bsd/ntp/dist/clockstuff/clktest.c
U src/external/bsd/ntp/dist/clockstuff/propdelay.c
U src/external/bsd/ntp/dist/clockstuff/chutest.c
U src/external/bsd/ntp/dist/clockstuff/Makefile.am
U src/external/bsd/ntp/dist/clockstuff/Makefile.in
U src/external/bsd/ntp/dist/clockstuff/README
U src/external/bsd/ntp/dist/conf/beauregard.conf
U src/external/bsd/ntp/dist/conf/malarky.conf
U src/external/bsd/ntp/dist/conf/pogo.conf
U src/external/bsd/ntp/dist/conf/rackety.conf
U src/external/bsd/ntp/dist/conf/grundoon.conf
U src/external/bsd/ntp/dist/conf/baldwin.conf
U src/external/bsd/ntp/dist/conf/README
U src/external/bsd/ntp/dist/html/ntptrace.html
U src/external/bsd/ntp/dist/html/kern.html
U src/external/bsd/ntp/dist/html/copyright.html
U src/external/bsd/ntp/dist/html/release.html
U src/external/bsd/ntp/dist/html/xleave.html
U src/external/bsd/ntp/dist/html/sntp.html
U src/external/bsd/ntp/dist/html/rate.html
U src/external/bsd/ntp/dist/html/accopt.html
U src/external/bsd/ntp/dist/html/config.html
U src/external/bsd/ntp/dist/html/ntpdc.html
U src/external/bsd/ntp/dist/html/rdebug.html
U src/external/bsd/ntp/dist/html/refclock.html
U src/external/bsd/ntp/dist/html/comdex.html
U src/external/bsd/ntp/dist/html/miscopt.html
U src/external/bsd/ntp/dist/html/ntp_conf.html
U src/external/bsd/ntp/dist/html/quick.html
U src/external/bsd/ntp/dist/html/manyopt.html
U src/external/bsd/ntp/dist/html/parsedata.html
U src/external/bsd/ntp/dist/html/extern.html
U src/external/bsd/ntp/dist/html/decode.html
U src/external/bsd/ntp/dist/html/howto.html
N src/external/bsd/ntp/dist/html/ntp-wait.html
U src/external/bsd/ntp/dist/html/build.html
U src/external/bsd/ntp/dist/html/ntpdsim.html
U src/external/bsd/ntp/dist/html/authopt.html
U src/external/bsd/ntp/dist/html/pps.html
U src/external/bsd/ntp/dist/html/parsenew.html
U src/external/bsd/ntp/dist/html/ntpdate.html
U src/external/bsd/ntp/dist/html/kernpps.html
U src/external/bsd/ntp/dist/html/gadget.html
U src/external/bsd/ntp/dist/html/msyslog.html
U src/external/bsd/ntp/dist/html/assoc.html
U src/external/bsd/ntp/dist/html/tickadj.html
U src/external/bsd/ntp/dist/html/ntpq.html
U src/external/bsd/ntp/dist/html/hints.html
U src/external/bsd/ntp/dist/html/clockopt.html
U 

CVS commit: src/external/bsd/ntp

2012-01-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 07:53:52 UTC 2012

Modified Files:
src/external/bsd/ntp: importdate

Log Message:
merge import ntp-4-2-6p5


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/importdate

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/importdate
diff -u src/external/bsd/ntp/importdate:1.1 src/external/bsd/ntp/importdate:1.2
--- src/external/bsd/ntp/importdate:1.1	Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/importdate	Wed Feb  1 07:53:52 2012
@@ -1 +1 @@
-Sun Dec 13 14:48:32 UTC 2009 (import)
+Wed Feb  1 07:49:06 UTC 2012 (import)



CVS commit: src/external/bsd/ntp/scripts

2012-01-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Wed Feb  1 07:54:58 UTC 2012

Modified Files:
src/external/bsd/ntp/scripts: mkver

Log Message:
NTP 4.2.6p5 (Harlan Stenn st...@ntp.org, 2011/12/24)

Focus: Bug fixes

Severity: Medium

This is a recommended upgrade.

This release updates sys_rootdisp and sys_jitter calculations to match the
RFC specification, fixes a potential IPv6 address matching error for the
nic and interface configuration directives, suppresses the creation of
extraneous ephemeral associations for certain broadcastclient and
multicastclient configurations, cleans up some ntpq display issues, and
includes improvements to orphan mode, minor bugs fixes and code clean-ups.

New features / changes in this release:

ntpd

 * Updated nic and interface IPv6 address handling to prevent
   mismatches with localhost [::1] and wildcard [::] which resulted from
   using the address/prefix format (e.g. fe80::/64)
 * Fix orphan mode stratum incorrectly counting to infinity
 * Orphan parent selection metric updated to includes missing ntohl()
 * Non-printable stratum 16 refid no longer sent to ntp
 * Duplicate ephemeral associations suppressed for broadcastclient and
   multicastclient without broadcastdelay
 * Exclude undetermined sys_refid from use in loopback TEST12
 * Exclude MODE_SERVER responses from KoD rate limiting
 * Include root delay in clock_update() sys_rootdisp calculations
 * get_systime() updated to exclude sys_residual offset (which only
   affected bits below sys_tick, the precision threshold)
 * sys.peer jitter weighting corrected in sys_jitter calculation

ntpq

 * -n option extended to include the billboard server column
 * IPv6 addresses in the local column truncated to prevent overruns

---
NTP 4.2.6p4 (Harlan Stenn st...@ntp.org, 2011/09/22)

Focus: Bug fixes and portability improvements

Severity: Medium

This is a recommended upgrade.

This release includes build infrastructure updates, code
clean-ups, minor bug fixes, fixes for a number of minor
ref-clock issues, and documentation revisions.

Portability improvements affect AIX, HP-UX, Linux, OS X and 64-bit time_t.

New features / changes in this release:

Build system

* Fix checking for struct rtattr
* Update config.guess and config.sub for AIX
* Upgrade required version of autogen and libopts for building
  from our source code repository

ntpd

* Back-ported several fixes for Coverity warnings from ntp-dev
* Fix a rare boundary condition in UNLINK_EXPR_SLIST()
* Allow logconfig =allall configuration directive
* Bind tentative IPv6 addresses on Linux
* Correct WWVB/Spectracom driver to timestamp CR instead of LF
* Improved tally bit handling to prevent incorrect ntpq peer status reports
* Exclude the Undisciplined Local Clock and ACTS drivers from the initial
  candidate list unless they are designated a prefer peer
* Prevent the consideration of Undisciplined Local Clock or ACTS drivers for
  selection during the 'tos orphanwait' period
* Prefer an Orphan Mode Parent over the Undisciplined Local Clock or ACTS
  drivers
* Improved support of the Parse Refclock trusttime flag in Meinberg mode
* Back-port utility routines from ntp-dev: mprintf(), emalloc_zero()
* Added the NTPD_TICKADJ_PPM environment variable for specifying baseline
  clock slew on Microsoft Windows
* Code cleanup in libntpq

ntpdc

* Fix timerstats reporting

ntpdate

* Reduce time required to set clock
* Allow a timeout greater than 2 seconds

sntp

* Backward incompatible command-line option change:
  -l/--filelog changed -l/--logfile (to be consistent with ntpd)

Documentation

* Update html2man. Fix some tags in the .html files
* Distribute ntp-wait.html

---
NTP 4.2.6p3 (Harlan Stenn st...@ntp.org, 2011/01/03)

Focus: Bug fixes and portability improvements

Severity: Medium

This is a recommended upgrade.

This release includes build infrastructure updates, code
clean-ups, minor bug fixes, fixes for a number of minor
ref-clock issues, and documentation revisions.

Portability improvements in this release affect AIX, Atari FreeMiNT,
FreeBSD4, Linux and Microsoft Windows.

New features / changes in this release:

Build system
* Use lsb_release to get information about Linux distributions.
* 'test' is in /usr/bin (instead of /bin) on some systems.
* Basic sanity checks for the ChangeLog file.
* Source certain build files with ./filename for systems without . in PATH.
* IRIX portability fix.
* Use a single copy of the libopts code.
* autogen/libopts upgrade.
* configure.ac m4 quoting cleanup.

ntpd
* Do not bind to IN6_IFF_ANYCAST addresses.
* Log the reason for exiting under Windows.
* Multicast fixes for Windows.
* Interpolation fixes for Windows.
* IPv4 and IPv6 Multicast fixes.
* Manycast solicitation fixes and general repairs.
* JJY refclock cleanup.
* NMEA refclock improvements.
* Oncore debug message cleanup.
* Palisade refclock now builds under Linux.
* Give RAWDCF more baud rates.
* Support Truetime Satellite clocks under 

CVS commit: src/external/bsd/ntp/dist/libntp

2011-06-19 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 19 15:58:07 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/libntp: ntp_lineedit.c

Log Message:
fix lineedit functionality. ntpq and friends would just exit on empty lines
which is not intended - there is a quit command for that purpose.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/libntp/ntp_lineedit.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/libntp/ntp_lineedit.c
diff -u src/external/bsd/ntp/dist/libntp/ntp_lineedit.c:1.1.1.1 src/external/bsd/ntp/dist/libntp/ntp_lineedit.c:1.2
--- src/external/bsd/ntp/dist/libntp/ntp_lineedit.c:1.1.1.1	Sun Dec 13 16:55:02 2009
+++ src/external/bsd/ntp/dist/libntp/ntp_lineedit.c	Sun Jun 19 15:58:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_lineedit.c,v 1.1.1.1 2009/12/13 16:55:02 kardel Exp $	*/
+/*	$NetBSD: ntp_lineedit.c,v 1.2 2011/06/19 15:58:07 kardel Exp $	*/
 
 /*
  * ntp_lineedit.c - generic interface to various line editing libs
@@ -174,11 +174,8 @@
 	if (NULL != line) {
 		if (*line) {
 			add_history(line);
-			*pcount = strlen(line);
-		} else {
-			free(line);
-			line = NULL;
 		}
+		*pcount = strlen(line);
 	}
 
 #endif	/* HAVE_READLINE_HISTORY */
@@ -187,12 +184,14 @@
 
 	cline = el_gets(ntp_el, pcount);
 
-	if (NULL != cline  *cline) {
+	if (NULL != cline) {
 		history(ntp_hist, hev, H_ENTER, cline);
-		*pcount = strlen(cline);
 		line = estrdup(cline);
-	} else
+	} else if (*pcount == -1) {
 		line = NULL;
+	} else {
+		line = estrdup();
+	}
 
 #endif	/* !HAVE_READLINE_HISTORY  HAVE_HISTEDIT_H */
 



CVS commit: src/external/bsd/ntp/dist

2011-01-09 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jan  9 14:49:40 UTC 2011

Modified Files:
src/external/bsd/ntp/dist/lib/isc/unix: net.c
src/external/bsd/ntp/dist/ntpd: ntp_io.c

Log Message:
make ntp compile for MKINET6=no


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/lib/isc/unix/net.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/dist/ntpd/ntp_io.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/lib/isc/unix/net.c
diff -u src/external/bsd/ntp/dist/lib/isc/unix/net.c:1.1.1.1 src/external/bsd/ntp/dist/lib/isc/unix/net.c:1.2
--- src/external/bsd/ntp/dist/lib/isc/unix/net.c:1.1.1.1	Sun Dec 13 16:54:38 2009
+++ src/external/bsd/ntp/dist/lib/isc/unix/net.c	Sun Jan  9 14:49:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.1.1.1 2009/12/13 16:54:38 kardel Exp $	*/
+/*	$NetBSD: net.c,v 1.2 2011/01/09 14:49:39 kardel Exp $	*/
 
 /*
  * Copyright (C) 2004, 2005, 2007, 2008  Internet Systems Consortium, Inc. (ISC)
@@ -106,11 +106,11 @@
 
 # if defined(WANT_IPV6)
 static isc_once_t 	once_ipv6only = ISC_ONCE_INIT;
-# endif
 
 # if defined(ISC_PLATFORM_HAVEIN6PKTINFO)
 static isc_once_t 	once_ipv6pktinfo = ISC_ONCE_INIT;
 # endif
+# endif
 #endif /* ISC_PLATFORM_HAVEIPV6 */
 
 static isc_once_t 	once = ISC_ONCE_INIT;
@@ -319,7 +319,6 @@
 	RUNTIME_CHECK(isc_once_do(once_ipv6only,
   try_ipv6only) == ISC_R_SUCCESS);
 }
-#endif /* WANT_IPV6 */
 
 #ifdef ISC_PLATFORM_HAVEIN6PKTINFO
 static void
@@ -376,6 +375,7 @@
 }
 #endif /* ISC_PLATFORM_HAVEIN6PKTINFO */
 #endif /* ISC_PLATFORM_HAVEIPV6 */
+#endif /* WANT_IPV6 */
 
 isc_result_t
 isc_net_probe_ipv6only(void) {

Index: src/external/bsd/ntp/dist/ntpd/ntp_io.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.4 src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.5
--- src/external/bsd/ntp/dist/ntpd/ntp_io.c:1.4	Sat Dec  4 23:08:35 2010
+++ src/external/bsd/ntp/dist/ntpd/ntp_io.c	Sun Jan  9 14:49:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_io.c,v 1.4 2010/12/04 23:08:35 christos Exp $	*/
+/*	$NetBSD: ntp_io.c,v 1.5 2011/01/09 14:49:40 kardel Exp $	*/
 
 /*
  * ntp_io.c - input/output routines for ntpd.	The socket-opening code
@@ -923,7 +923,10 @@
 	u_short	port
 	)
 {
-	int			v4wild, v6wild;
+	int			v4wild;
+#ifdef INCLUDE_IPV6_SUPPORT
+	int v6wild;
+#endif
 	sockaddr_u		wildaddr;
 	isc_netaddr_t		wnaddr;
 	nic_rule_action		action;
@@ -2902,7 +2905,9 @@
 		 */
 		int	rtc;
 		u_char	cttl;
+#ifdef INCLUDE_IPV6_SUPPORT
 		u_int	uttl;
+#endif
 		
 		switch (AF(inter-sin)) {
 			



CVS commit: src/external/bsd/ntp

2010-08-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Aug 29 10:13:07 UTC 2010

Modified Files:
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/include: config.h

Log Message:
make mDNS registration depend on compile time build option MKMDNS


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.3 src/external/bsd/ntp/bin/ntpd/Makefile:1.4
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.3	Sat Aug 28 20:51:08 2010
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Sun Aug 29 10:13:07 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2010/08/28 20:51:08 kardel Exp $
+#	$NetBSD: Makefile,v 1.4 2010/08/29 10:13:07 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -83,6 +83,10 @@
 
 CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
 
+.if (${MKMDNS} != no)
+CPPFLAGS+=-DUSE_MDNS
+.endif
+
 .PATH: ${DIST}
 
 ntpd.8: ntpd.1

Index: src/external/bsd/ntp/include/config.h
diff -u src/external/bsd/ntp/include/config.h:1.1 src/external/bsd/ntp/include/config.h:1.2
--- src/external/bsd/ntp/include/config.h:1.1	Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/include/config.h	Sun Aug 29 10:13:07 2010
@@ -333,7 +333,11 @@
 #define HAVE_DLFCN_H 1
 
 /* Use Rendezvous/DNS-SD registration */
+#ifdef USE_MDNS
 #define HAVE_DNSREGISTRATION 1
+#else
+#undef HAVE_DNSREGISTRATION
+#endif
 
 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
 /* #undef HAVE_DOPRNT */



CVS commit: src/external/bsd/ntp/bin/ntpd

2010-08-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Aug 29 11:15:33 UTC 2010

Modified Files:
src/external/bsd/ntp/bin/ntpd: Makefile

Log Message:
only refer to libdns_sd when mDNS is compiled in


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/ntp/bin/ntpd/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.4 src/external/bsd/ntp/bin/ntpd/Makefile:1.5
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.4	Sun Aug 29 10:13:07 2010
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Sun Aug 29 11:15:32 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2010/08/29 10:13:07 kardel Exp $
+#	$NetBSD: Makefile,v 1.5 2010/08/29 11:15:32 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -74,7 +74,7 @@
 	refclock_wwvb.c\
 	refclock_zyfer.c
 
-LDADD+=		-L${LIBPARSE} -lparse -L${LIBISC} -liscntp -lm -lutil -ldns_sd
+LDADD+=		-L${LIBPARSE} -lparse -L${LIBISC} -liscntp -lm -lutil
 DPADD+=		${LIBPARSE}/libparse.a ${LIBISC}/libiscntp.a ${LIBOPTS}/libopts.a  ${LIBNTP}/libntp.a ${LIBM} ${LIBUTIL}
 
 .include ${.CURDIR}/../Makefile.inc
@@ -85,6 +85,7 @@
 
 .if (${MKMDNS} != no)
 CPPFLAGS+=-DUSE_MDNS
+LDADD+=-ldns_sd
 .endif
 
 .PATH: ${DIST}



CVS commit: src/external/bsd/ntp/lib/libntp

2010-08-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Aug 29 18:52:59 UTC 2010

Modified Files:
src/external/bsd/ntp/lib/libntp: Makefile

Log Message:
remove commented out cruft


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/lib/libntp/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/lib/libntp/Makefile
diff -u src/external/bsd/ntp/lib/libntp/Makefile:1.1 src/external/bsd/ntp/lib/libntp/Makefile:1.2
--- src/external/bsd/ntp/lib/libntp/Makefile:1.1	Sun Dec 13 17:13:47 2009
+++ src/external/bsd/ntp/lib/libntp/Makefile	Sun Aug 29 18:52:59 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:47 kardel Exp $
+#	$NetBSD: Makefile,v 1.2 2010/08/29 18:52:59 kardel Exp $
 
 LIBISPRIVATE=yes
 
@@ -23,23 +23,5 @@
  recvbuff.c refnumtoa.c snprintf.c socktoa.c socktohost.c ssl_init.c \
  statestr.c strdup.c strstr.c syssignal.c tsftomsu.c tstotv.c tvtots.c \
  uglydate.c uinttoa.c ymd2yd.c 
-# net.c netaddr.c netscope.c \
-# ondestroy.c random.c result.c stdio.c stdtime.c strerror.c task.c \
-# thread.c time.c sockaddr.c
-# not found in libparse
-# assertions.c
-# buffer.c
-# conditions.c
-# dir.c
-# error.c 
-# errno2result.c
-# event.c
-# file.c
-# inet_ntop.c
-# inet_pton.c
-# interfaceiter.c
-# lib.c
-# log.c
-# md5.c   
-# msgcat.c 
+
 .include bsd.lib.mk



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-08-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Aug 29 18:54:30 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_intres.c

Log Message:
make IPV6 support decision consistent with code in ntp_io.c


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_intres.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_intres.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_intres.c:1.1.1.1 src/external/bsd/ntp/dist/ntpd/ntp_intres.c:1.2
--- src/external/bsd/ntp/dist/ntpd/ntp_intres.c:1.1.1.1	Sun Dec 13 16:55:34 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_intres.c	Sun Aug 29 18:54:30 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_intres.c,v 1.1.1.1 2009/12/13 16:55:34 kardel Exp $	*/
+/*	$NetBSD: ntp_intres.c,v 1.2 2010/08/29 18:54:30 kardel Exp $	*/
 
 /*
  * ripped off from ../ntpres/ntpres.c by Greg Troxel 4/2/92
@@ -472,7 +472,7 @@
 	ce = emalloc(sizeof(*ce));
 	ce-ce_name = estrdup(name);
 	ce-ce_peeraddr = 0;
-#ifdef ISC_PLATFORM_HAVEIPV6
+#ifdef INCLUDE_IPV6_SUPPORT
 	ce-ce_peeraddr6 = in6addr_any;
 #endif
 	ZERO_SOCK(ce-peer_store);



CVS commit: src/external/bsd/ntp

2010-08-29 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Aug 29 18:55:51 UTC 2010

Modified Files:
src/external/bsd/ntp: Makefile.inc
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/include: config.h

Log Message:
support to follow NetBSD build options for
MKCRYPTO
MKMDNS
MKINET6


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/Makefile.inc
cvs rdiff -u -r1.5 -r1.6 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/include/config.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/Makefile.inc
diff -u src/external/bsd/ntp/Makefile.inc:1.2 src/external/bsd/ntp/Makefile.inc:1.3
--- src/external/bsd/ntp/Makefile.inc:1.2	Mon Dec 14 02:09:39 2009
+++ src/external/bsd/ntp/Makefile.inc	Sun Aug 29 18:55:50 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.2 2009/12/14 02:09:39 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.3 2010/08/29 18:55:50 kardel Exp $
 
 .if !defined(NTP_MAKEFILE_INC)
 NTP_MAKEFILE_INC=yes
@@ -10,10 +10,6 @@
 
 .include bsd.own.mk
 
-.if ${MKCRYPTO} == no
-NTP_USE_OPENSSL?=no
-.endif
-
 IDIST=		${NETBSDSRCDIR}/external/bsd/ntp/dist
 NTP_SRCDIR=	${NETBSDSRCDIR}/external/bsd/ntp
 NTP_HTMLDIR=	/usr/share/doc/html/ntp
@@ -42,6 +38,11 @@
 DPADD+=		${LIBCRYPTO} ${LIBCRYPT}
 .endif
 
+.if (${MKMDNS} != no)
+CPPFLAGS+=-DHAVE_DNSREGISTRATION=1
+LDADD+=-ldns_sd
+.endif
+
 SRCS+=	version.c
 
 CLEANFILES+=version.c version.o
@@ -51,6 +52,14 @@
 
 .endif # defined(PROG)
 
+.if (${MKCRYPTO} != no)
+CPPFLAGS+=-DOPENSSL
+.endif
+
+.if (${MKINET6} != no)
+CPPFLAGS+=-DWANT_IPV6 
+.endif
+
 .if exists(${.CURDIR}/../../Makefile.inc)
 .include ${.CURDIR}/../../Makefile.inc
 .endif

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.5 src/external/bsd/ntp/bin/ntpd/Makefile:1.6
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.5	Sun Aug 29 11:15:32 2010
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Sun Aug 29 18:55:50 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2010/08/29 11:15:32 kardel Exp $
+#	$NetBSD: Makefile,v 1.6 2010/08/29 18:55:50 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -83,11 +83,6 @@
 
 CPPFLAGS+=-I${IDIST}/include -I${IDIST}/libopts
 
-.if (${MKMDNS} != no)
-CPPFLAGS+=-DUSE_MDNS
-LDADD+=-ldns_sd
-.endif
-
 .PATH: ${DIST}
 
 ntpd.8: ntpd.1

Index: src/external/bsd/ntp/include/config.h
diff -u src/external/bsd/ntp/include/config.h:1.2 src/external/bsd/ntp/include/config.h:1.3
--- src/external/bsd/ntp/include/config.h:1.2	Sun Aug 29 10:13:07 2010
+++ src/external/bsd/ntp/include/config.h	Sun Aug 29 18:55:51 2010
@@ -332,12 +332,9 @@
 /* Define to 1 if you have the dlfcn.h header file. */
 #define HAVE_DLFCN_H 1
 
+/* NetBSD: set by build process */
 /* Use Rendezvous/DNS-SD registration */
-#ifdef USE_MDNS
-#define HAVE_DNSREGISTRATION 1
-#else
-#undef HAVE_DNSREGISTRATION
-#endif
+/* #define HAVE_DNSREGISTRATION 1 */
 
 /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
 /* #undef HAVE_DOPRNT */
@@ -1063,7 +1060,7 @@
 #define ISC_PLATFORM_HAVEIN6PKTINFO /**/
 
 /* have IPv6? */
-#define ISC_PLATFORM_HAVEIPV6 /**/
+#define ISC_PLATFORM_HAVEIPV6
 
 /* struct sockaddr has sa_len? */
 #define ISC_PLATFORM_HAVESALEN /**/
@@ -1156,7 +1153,7 @@
 /* #undef NO_PARENB_IGNPAR */
 
 /* Default location of crypto key info */
-#define NTP_KEYSDIR /tmp/ntp-4.2.6/etc
+#define NTP_KEYSDIR /etc/ntp
 
 /* Path to sign daemon rendezvous socket */
 /* #undef NTP_SIGND_PATH */
@@ -1170,8 +1167,9 @@
 /* Do we have support for SHMEM_STATUS? */
 #define ONCORE_SHMEM_STATUS 1
 
+/* NetBSD: set by build process */
 /* Use OpenSSL? */
-#define OPENSSL /**/
+/* #define OPENSSL */
 
 /* Should we open the broadcast socket? */
 #define OPEN_BCAST_SOCKET 1
@@ -1244,13 +1242,21 @@
 /* #undef SCO5_CLOCK */
 
 /* The size of `char*', as computed by sizeof. */
+#ifndef _LP64
 #define SIZEOF_CHARP 4
+#else
+#define SIZEOF_CHARP 8
+#endif
 
 /* The size of `int', as computed by sizeof. */
 #define SIZEOF_INT 4
 
 /* The size of `long', as computed by sizeof. */
+#ifndef _LP64
 #define SIZEOF_LONG 4
+#else
+#define SIZEOF_LONG 8
+#endif
 
 /* The size of `short', as computed by sizeof. */
 #define SIZEOF_SHORT 2
@@ -1277,7 +1283,7 @@
 /* #undef STEP_SLEW */
 
 /* canonical system (cpu-vendor-os) of where we should run */
-#define STR_SYSTEM i386-unknown-netbsdelf5.99.20
+#define STR_SYSTEM i386-unknown-netbsdelf
 
 /* Buggy syscall() (Solaris2.4)? */
 /* #undef SYSCALL_BUG */
@@ -1349,8 +1355,9 @@
 /* Version number of package */
 #define VERSION 4.2.6
 
+/* NetBSD: set by build process */
 /* configure --enable-ipv6 */
-#define WANT_IPV6 /**/
+/* #define WANT_IPV6 */
 
 /* Define this if a working libregex can be found */
 #define WITH_LIBREGEX 1



CVS commit: src/external/bsd/ntp/dist/sntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:38:55 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/sntp: kod_management.c

Log Message:
remove uncondition #define DEBUG


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/sntp/kod_management.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/kod_management.c
diff -u src/external/bsd/ntp/dist/sntp/kod_management.c:1.1.1.1 src/external/bsd/ntp/dist/sntp/kod_management.c:1.2
--- src/external/bsd/ntp/dist/sntp/kod_management.c:1.1.1.1	Sun Dec 13 16:57:10 2009
+++ src/external/bsd/ntp/dist/sntp/kod_management.c	Sat Aug 28 15:38:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kod_management.c,v 1.1.1.1 2009/12/13 16:57:10 kardel Exp $	*/
+/*	$NetBSD: kod_management.c,v 1.2 2010/08/28 15:38:55 kardel Exp $	*/
 
 #include string.h
 #include sys/types.h
@@ -8,7 +8,6 @@
 #include log.h
 #include sntp-opts.h
 #include ntp_stdlib.h
-#define DEBUG
 
 int kod_init = 0, kod_db_cnt = 0;
 const char *kod_db_file;



CVS commit: src/external/bsd/ntp/dist/sntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:39:25 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/sntp: networking.c

Log Message:
fix DEBUG compilation


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/sntp/networking.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/networking.c
diff -u src/external/bsd/ntp/dist/sntp/networking.c:1.1.1.1 src/external/bsd/ntp/dist/sntp/networking.c:1.2
--- src/external/bsd/ntp/dist/sntp/networking.c:1.1.1.1	Sun Dec 13 16:57:11 2009
+++ src/external/bsd/ntp/dist/sntp/networking.c	Sat Aug 28 15:39:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: networking.c,v 1.1.1.1 2009/12/13 16:57:11 kardel Exp $	*/
+/*	$NetBSD: networking.c,v 1.2 2010/08/28 15:39:25 kardel Exp $	*/
 
 #include networking.h
 
@@ -62,6 +62,8 @@
 			free(logmsg);
 		} else {
 #ifdef DEBUG
+			struct addrinfo *dres;
+
 			for (dres = tres[resc]; dres; dres = dres-ai_next) {
 getnameinfo(dres-ai_addr, dres-ai_addrlen, adr_buf, sizeof(adr_buf), NULL, 0, NI_NUMERICHOST);
 STDLINE
@@ -160,7 +162,7 @@
 		pkt_output((struct pkt *) rdata, recvc, stdout);
 	}
 	else {
-		saved_errno = errno;
+		int saved_errno = errno;
 		printf(recvfrom error %d (%s)\n, errno, strerror(errno));
 		errno = saved_errno;
 	}



CVS commit: src/external/bsd/ntp/dist/ntpq

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:40:24 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpq: ntpq.1

Log Message:
.sp only takes a single arg


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpq/ntpq.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpq/ntpq.1
diff -u src/external/bsd/ntp/dist/ntpq/ntpq.1:1.1.1.1 src/external/bsd/ntp/dist/ntpq/ntpq.1:1.2
--- src/external/bsd/ntp/dist/ntpq/ntpq.1:1.1.1.1	Sun Dec 13 16:56:32 2009
+++ src/external/bsd/ntp/dist/ntpq/ntpq.1	Sat Aug 28 15:40:24 2010
@@ -96,7 +96,7 @@
 These are described following.
 .sp
 .IR ? [command_keyword]
-.sp 1x help [command_keyword]
+.sp 1x help [command_keyword]
 A
 .Ql \?
 by itself will print a list of all the command



CVS commit: src/external/bsd/ntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:42:46 UTC 2010

Modified Files:
src/external/bsd/ntp: Makefile
src/external/bsd/ntp/bin: Makefile Makefile.inc
src/external/bsd/ntp/bin/ntp-keygen: Makefile
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/bin/ntpdate: Makefile
src/external/bsd/ntp/bin/ntpdc: Makefile
src/external/bsd/ntp/bin/ntpq: Makefile
src/external/bsd/ntp/bin/ntptime: Makefile
Added Files:
src/external/bsd/ntp/bin/ntpdate: ntpdate.8
src/external/bsd/ntp/bin/ntptime: ntptime.8
src/external/bsd/ntp/bin/ntptrace: Makefile ntptrace.8 ntptrace.awk
src/external/bsd/ntp/bin/sntp: Makefile
src/external/bsd/ntp/html: Makefile

Log Message:
add installation of manual pages, html files and up to now missing commands 
(sntp, ntptrace)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/Makefile \
src/external/bsd/ntp/bin/Makefile.inc
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntp-keygen/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpdate/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/ntpdate/ntpdate.8
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpdc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntpq/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/ntp/bin/ntptime/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/ntptime/ntptime.8
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/ntptrace/Makefile \
src/external/bsd/ntp/bin/ntptrace/ntptrace.8 \
src/external/bsd/ntp/bin/ntptrace/ntptrace.awk
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/bin/sntp/Makefile
cvs rdiff -u -r0 -r1.1 src/external/bsd/ntp/html/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/Makefile
diff -u src/external/bsd/ntp/Makefile:1.1 src/external/bsd/ntp/Makefile:1.2
--- src/external/bsd/ntp/Makefile:1.1	Sun Dec 13 17:13:49 2009
+++ src/external/bsd/ntp/Makefile	Sat Aug 28 15:42:46 2010
@@ -1,5 +1,5 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:49 kardel Exp $
+#	$NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
 
-SUBDIR+= lib .WAIT bin
+SUBDIR+= lib .WAIT bin html
 
 .include bsd.subdir.mk

Index: src/external/bsd/ntp/bin/Makefile
diff -u src/external/bsd/ntp/bin/Makefile:1.1 src/external/bsd/ntp/bin/Makefile:1.2
--- src/external/bsd/ntp/bin/Makefile:1.1	Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/Makefile	Sat Aug 28 15:42:46 2010
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+#	$NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
 
-SUBDIR= ntp-keygen ntpd ntpdate ntpdc ntpq ntptime
+SUBDIR= ntp-keygen ntpd ntpdate ntpdc ntpq ntptime ntptrace sntp 
 
 .if (${MKCRYPTO} != no)
 SUBDIR+= ntp-keygen
Index: src/external/bsd/ntp/bin/Makefile.inc
diff -u src/external/bsd/ntp/bin/Makefile.inc:1.1 src/external/bsd/ntp/bin/Makefile.inc:1.2
--- src/external/bsd/ntp/bin/Makefile.inc:1.1	Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/Makefile.inc	Sat Aug 28 15:42:46 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.1 2009/12/13 17:13:48 kardel Exp $
+#	$NetBSD: Makefile.inc,v 1.2 2010/08/28 15:42:46 kardel Exp $
 
 .include ../Makefile.inc
 

Index: src/external/bsd/ntp/bin/ntp-keygen/Makefile
diff -u src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.1 src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.2
--- src/external/bsd/ntp/bin/ntp-keygen/Makefile:1.1	Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntp-keygen/Makefile	Sat Aug 28 15:42:46 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+#	$NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -6,7 +6,7 @@
 
 
 PROG=	ntp-keygen
-MAN=
+MAN=	ntp-keygen.8
 BINDIR=	/usr/sbin
 
 SRCS=	ntp-keygen-opts.c	\
@@ -23,4 +23,7 @@
 
 .PATH: ${DIST}
 
+ntp-keygen.8:	ntp-keygen.1
+	@cp $? $@
+
 .include bsd.prog.mk

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.1 src/external/bsd/ntp/bin/ntpd/Makefile:1.2
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.1	Sun Dec 13 17:13:48 2009
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Sat Aug 28 15:42:46 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+#	$NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -6,8 +6,7 @@
 
 
 PROG=	ntpd
-MAN=
-#MAN=	named.8 lwresd.8 named.conf.5
+MAN=	ntpd.8
 BINDIR=	/usr/sbin
 
 SRCS=	cmd_args.c\
@@ -86,4 +85,7 @@
 
 .PATH: ${DIST}
 
+ntpd.8: ntpd.1
+	@cp $? $@
+
 .include bsd.prog.mk

Index: src/external/bsd/ntp/bin/ntpdate/Makefile
diff -u src/external/bsd/ntp/bin/ntpdate/Makefile:1.1 src/external/bsd/ntp/bin/ntpdate/Makefile:1.2
--- 

CVS commit: src/usr.sbin

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:45:48 UTC 2010

Modified Files:
src/usr.sbin: Makefile

Log Message:
unhook ntp 4.2.4 reachover build


To generate a diff of this commit:
cvs rdiff -u -r1.246 -r1.247 src/usr.sbin/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/Makefile
diff -u src/usr.sbin/Makefile:1.246 src/usr.sbin/Makefile:1.247
--- src/usr.sbin/Makefile:1.246	Sun Aug 22 18:56:23 2010
+++ src/usr.sbin/Makefile	Sat Aug 28 15:45:48 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.246 2010/08/22 18:56:23 rmind Exp $
+#	$NetBSD: Makefile,v 1.247 2010/08/28 15:45:48 kardel Exp $
 #	from: @(#)Makefile	5.20 (Berkeley) 6/12/93
 
 .include bsd.own.mk
@@ -14,12 +14,12 @@
 	kgmon lastlogin link lmcconfig lockstat lpr mailwrapper makefs \
 	map-mbone mdconfig memswitch mlxctl mmcformat mopd mountd moused \
 	mrinfo mrouted mscdlabel mtrace \
-	mtree ndbootd ndiscvt netgroup_mkdb nfsd ntp ofctl paxctl pcictl \
+	mtree ndbootd ndiscvt netgroup_mkdb nfsd ofctl paxctl pcictl \
 	pppd psrset pstat pwd_mkdb postinstall powerd puffs quot quotacheck \
 	quotaon rarpd rbootd rdate \
 	repquota rmt rpc.bootparamd rpc.lockd rpc.pcnfsd \
  	rpc.statd rpcbind rwhod sa screenblank sdpd services_mkdb sesd \
-	schedctl sliplogin sntp \
+	schedctl sliplogin \
 	spray srtconfig sti sunlabel sup syslogd tadpolectl tcpdchk \
 	tcpdmatch tcpdump tcpdrop timed tpctl traceroute trpt unlink \
 	usbdevs user videomode vipw veriexecgen vnconfig wake wiconfig \



CVS commit: src/external/bsd

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:47:08 UTC 2010

Modified Files:
src/external/bsd: Makefile

Log Message:
hook in ntp 4.2.6 reachover build (new location in external/bsd/ntp)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/external/bsd/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/Makefile
diff -u src/external/bsd/Makefile:1.24 src/external/bsd/Makefile:1.25
--- src/external/bsd/Makefile:1.24	Wed Aug  4 17:12:33 2010
+++ src/external/bsd/Makefile	Sat Aug 28 15:47:08 2010
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.24 2010/08/04 17:12:33 christos Exp $
+#	$NetBSD: Makefile,v 1.25 2010/08/28 15:47:08 kardel Exp $
 
 .include bsd.own.mk
 
 SUBDIR+= am-utils bind cron dhcpcd fetch file flex libarchive libevent liblzf \
-	mdocml openresolv top byacc wpa
+	mdocml openresolv top byacc wpa ntp
 
 .if (${MKATF} != no)
 SUBDIR+= atf



CVS commit: src/doc

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 15:56:46 UTC 2010

Modified Files:
src/doc: CHANGES

Log Message:
unhook NTP 4.2.4 build, acivate NTP 4.2.6 build in external/bsd/ntp


To generate a diff of this commit:
cvs rdiff -u -r1.1432 -r1.1433 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1432 src/doc/CHANGES:1.1433
--- src/doc/CHANGES:1.1432	Thu Aug 26 15:01:07 2010
+++ src/doc/CHANGES	Sat Aug 28 15:56:45 2010
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1432 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1433 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -711,4 +711,5 @@
 	network: Added NPF - a new packet filter. [rmind 20100822]
 	tests: Convert the libdes tests to ATF.  [jmmv 20100825]
 	awk: upgrade to 20100523 [christos 20100826]
-
+	ntp: switch build to ntp 4.2.6 (imported 20091213 in external/bsd/ntp)
+		[kardel 20100827]
\ No newline at end of file



CVS commit: src/distrib/sets/lists/misc

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 16:17:32 UTC 2010

Modified Files:
src/distrib/sets/lists/misc: mi

Log Message:
adjust to new NTP 4.2.6 build


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/distrib/sets/lists/misc/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/misc/mi
diff -u src/distrib/sets/lists/misc/mi:1.167 src/distrib/sets/lists/misc/mi:1.168
--- src/distrib/sets/lists/misc/mi:1.167	Sun Aug 22 02:16:17 2010
+++ src/distrib/sets/lists/misc/mi	Sat Aug 28 16:17:32 2010
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.167 2010/08/22 02:16:17 perry Exp $
+# $NetBSD: mi,v 1.168 2010/08/28 16:17:32 kardel Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -37,6 +37,32 @@
 ./usr/share/doc/html/bzip2/manual_4.html	misc-obsolete		obsolete
 ./usr/share/doc/html/bzip2/manual_toc.html	misc-obsolete		obsolete
 ./usr/share/doc/html/ntp			misc-ntp-htmldoc
+./usr/share/doc/html/ntp/bugs.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/build.html		misc-obsolete		obsolete
+./usr/share/doc/html/ntp/comdex.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/config.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/decode.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/drivers/mx4200data.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/hints.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/kernpps.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/quick.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/rate.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/accopt.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/audio.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/authopt.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/clockopt.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/command.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/config.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/confopt.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/external.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/install.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/manual.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/misc.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/miscopt.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/monopt.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/scripts/refclock.txt	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/sitemap.html		misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/xleave.html		misc-ntp-htmldoc	doc
 ./usr/share/doc/html/ntp/Oncore-SHMEM.htm	misc-obsolete		obsolete
 ./usr/share/doc/html/ntp/accopt.htm		misc-obsolete		obsolete
 ./usr/share/doc/html/ntp/accopt.html		misc-ntp-htmldoc	doc
@@ -48,22 +74,23 @@
 ./usr/share/doc/html/ntp/authopt.html		misc-ntp-htmldoc	doc
 ./usr/share/doc/html/ntp/biblio.htm		misc-obsolete		obsolete
 ./usr/share/doc/html/ntp/build.htm		misc-obsolete		obsolete
-./usr/share/doc/html/ntp/build			misc-ntp-htmldoc
-./usr/share/doc/html/ntp/build/build.html	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/config.html	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/hints.html	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/patches.html	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/porting.html	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/quick.html	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts		misc-ntp-htmldoc
-./usr/share/doc/html/ntp/build/scripts/footer.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/links10.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/links11.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/links12.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/links7.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/links8.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/links9.txt	misc-ntp-htmldoc	doc
-./usr/share/doc/html/ntp/build/scripts/style.css	misc-ntp-htmldoc	doc
+./usr/share/doc/html/ntp/build.html		misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build			misc-obsolete
+./usr/share/doc/html/ntp/build/build.html	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/config.html	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/hints.html	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/patches.html	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/porting.html	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/quick.html	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/scripts		misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/scripts/footer.txt	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/scripts/links10.txt	misc-obsolete		obsolete
+./usr/share/doc/html/ntp/build/scripts/links11.txt	misc-obsolete		

CVS commit: src/external/bsd/ntp/bin/ntpd

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 20:51:08 UTC 2010

Modified Files:
src/external/bsd/ntp/bin/ntpd: Makefile

Log Message:
disable .y.c rule - ntp_parser.y needs bison which is not part of the tool chain


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/bin/ntpd/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/bin/ntpd/Makefile
diff -u src/external/bsd/ntp/bin/ntpd/Makefile:1.2 src/external/bsd/ntp/bin/ntpd/Makefile:1.3
--- src/external/bsd/ntp/bin/ntpd/Makefile:1.2	Sat Aug 28 15:42:46 2010
+++ src/external/bsd/ntp/bin/ntpd/Makefile	Sat Aug 28 20:51:08 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2010/08/28 15:42:46 kardel Exp $
+#	$NetBSD: Makefile,v 1.3 2010/08/28 20:51:08 kardel Exp $
 
 NOGCCERROR=yes
 
@@ -89,3 +89,7 @@
 	@cp $? $@
 
 .include bsd.prog.mk
+
+# kill default .y.c rule - to rebuild ntp_parser.c we need bison which is not part of the toolchain
+.y.c:
+



CVS commit: src/external/bsd/ntp/dist/ntpd

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 20:52:55 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/ntpd: ntp_scanner.c

Log Message:
don't return an int casted pointer as 'boolean' value - compare result of 
strchr with NULL


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/ntpd/ntp_scanner.c
diff -u src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.1.1.1 src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.2
--- src/external/bsd/ntp/dist/ntpd/ntp_scanner.c:1.1.1.1	Sun Dec 13 16:56:14 2009
+++ src/external/bsd/ntp/dist/ntpd/ntp_scanner.c	Sat Aug 28 20:52:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ntp_scanner.c,v 1.1.1.1 2009/12/13 16:56:14 kardel Exp $	*/
+/*	$NetBSD: ntp_scanner.c,v 1.2 2010/08/28 20:52:55 kardel Exp $	*/
 
 
 /* ntp_scanner.c
@@ -353,7 +353,7 @@
 	int ch
 	)
 {
-	return (int)strchr(special_chars, ch);
+	return strchr(special_chars, ch) != NULL;
 }
 
 



CVS commit: src/external/bsd/ntp/dist/sntp

2010-08-28 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Aug 28 20:54:24 UTC 2010

Modified Files:
src/external/bsd/ntp/dist/sntp: networking.c

Log Message:
using a char * as timeout value is a unique concept - atol() the string


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ntp/dist/sntp/networking.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/ntp/dist/sntp/networking.c
diff -u src/external/bsd/ntp/dist/sntp/networking.c:1.2 src/external/bsd/ntp/dist/sntp/networking.c:1.3
--- src/external/bsd/ntp/dist/sntp/networking.c:1.2	Sat Aug 28 15:39:25 2010
+++ src/external/bsd/ntp/dist/sntp/networking.c	Sat Aug 28 20:54:24 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: networking.c,v 1.2 2010/08/28 15:39:25 kardel Exp $	*/
+/*	$NetBSD: networking.c,v 1.3 2010/08/28 20:54:24 kardel Exp $	*/
 
 #include networking.h
 
@@ -280,7 +280,7 @@
 	FD_SET(rsock, bcst_fd);
 
 	if(ENABLED_OPT(TIMEOUT)) 
-		timeout_tv.tv_sec = (int) OPT_ARG(TIMEOUT);
+		timeout_tv.tv_sec = atol(OPT_ARG(TIMEOUT));
 	else 
 		timeout_tv.tv_sec = 68; /* ntpd broadcasts every 64s */
 	



CVS commit: src/sys/dev/usb

2010-06-27 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 27 10:32:13 UTC 2010

Modified Files:
src/sys/dev/usb: usbdevs usbdevs.h usbdevs_data.h

Log Message:
add MTK chipset based GPS receiver (e. g. Qstarz BT-Q1000eX)


To generate a diff of this commit:
cvs rdiff -u -r1.559 -r1.560 src/sys/dev/usb/usbdevs
cvs rdiff -u -r1.552 -r1.553 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.553 -r1.554 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.559 src/sys/dev/usb/usbdevs:1.560
--- src/sys/dev/usb/usbdevs:1.559	Sat Jun 19 22:41:32 2010
+++ src/sys/dev/usb/usbdevs	Sun Jun 27 10:32:13 2010
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.559 2010/06/19 22:41:32 kardel Exp $
+$NetBSD: usbdevs,v 1.560 2010/06/27 10:32:13 kardel Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -417,6 +417,7 @@
 vendor SITECOMEU	0x0df6	Sitecom Europe
 vendor HAWKING		0x0e66	Hawking
 vendor GMATE		0x0e7e	G.Mate, Inc
+vendor MTK		0x0e8d	MTK
 vendor OTI		0x0ea0	Ours Technology
 vendor PILOTECH		0x0eaf	Pilotech
 vendor NOVATECH		0x0eb0	Nova Tech
@@ -1177,6 +1178,9 @@
 /* G.Mate, Inc products */
 product GMATE YP3X00		0x1001	YP3X00 PDA
 
+/* MTK products */
+product	MTK GPS_RECEIVER	0x3329	GPS receiver
+
 /* Garmin products */
 product GARMIN FORERUNNER305	0x0003	Forerunner 305
 

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.552 src/sys/dev/usb/usbdevs.h:1.553
--- src/sys/dev/usb/usbdevs.h:1.552	Sat Jun 19 22:41:33 2010
+++ src/sys/dev/usb/usbdevs.h	Sun Jun 27 10:32:13 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs.h,v 1.552 2010/06/19 22:41:33 kardel Exp $	*/
+/*	$NetBSD: usbdevs.h,v 1.553 2010/06/27 10:32:13 kardel Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.558 2010/06/17 23:22:21 riz Exp
+ *	NetBSD: usbdevs,v 1.559 2010/06/19 22:41:32 kardel Exp
  */
 
 /*
@@ -424,6 +424,7 @@
 #define	USB_VENDOR_SITECOMEU	0x0df6		/* Sitecom Europe */
 #define	USB_VENDOR_HAWKING	0x0e66		/* Hawking */
 #define	USB_VENDOR_GMATE	0x0e7e		/* G.Mate, Inc */
+#define	USB_VENDOR_MTK	0x0e8d		/* MTK */
 #define	USB_VENDOR_OTI	0x0ea0		/* Ours Technology */
 #define	USB_VENDOR_PILOTECH	0x0eaf		/* Pilotech */
 #define	USB_VENDOR_NOVATECH	0x0eb0		/* Nova Tech */
@@ -1184,6 +1185,9 @@
 /* G.Mate, Inc products */
 #define	USB_PRODUCT_GMATE_YP3X00	0x1001		/* YP3X00 PDA */
 
+/* MTK products */
+#define	USB_PRODUCT_MTK_GPS_RECEIVER	0x3329		/* GPS receiver */
+
 /* Garmin products */
 #define	USB_PRODUCT_GARMIN_FORERUNNER305	0x0003		/* Forerunner 305 */
 

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.553 src/sys/dev/usb/usbdevs_data.h:1.554
--- src/sys/dev/usb/usbdevs_data.h:1.553	Sat Jun 19 22:41:33 2010
+++ src/sys/dev/usb/usbdevs_data.h	Sun Jun 27 10:32:13 2010
@@ -1,10 +1,10 @@
-/*	$NetBSD: usbdevs_data.h,v 1.553 2010/06/19 22:41:33 kardel Exp $	*/
+/*	$NetBSD: usbdevs_data.h,v 1.554 2010/06/27 10:32:13 kardel Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: usbdevs,v 1.558 2010/06/17 23:22:21 riz Exp
+ *	NetBSD: usbdevs,v 1.559 2010/06/19 22:41:32 kardel Exp
  */
 
 /*
@@ -1475,6 +1475,10 @@
 	G.Mate, Inc,
 	},
 	{
+	USB_VENDOR_MTK,
+	MTK,
+	},
+	{
 	USB_VENDOR_OTI,
 	Ours Technology,
 	},
@@ -1923,7 +1927,7 @@
 	GNU Radio USRP,
 	},
 };
-const int usb_nvendors = 471;
+const int usb_nvendors = 472;
 
 const struct usb_product usb_products[] = {
 	{
@@ -3587,6 +3591,10 @@
 	YP3X00 PDA,
 	},
 	{
+	USB_VENDOR_MTK, USB_PRODUCT_MTK_GPS_RECEIVER,
+	GPS receiver,
+	},
+	{
 	USB_VENDOR_GARMIN, USB_PRODUCT_GARMIN_FORERUNNER305,
 	Forerunner 305,
 	},
@@ -7311,4 +7319,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1346;
+const int usb_nproducts = 1347;



CVS commit: src/sys/dev/usb

2010-06-19 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Jun 19 22:41:33 UTC 2010

Modified Files:
src/sys/dev/usb: u3g.c usbdevs usbdevs.h usbdevs_data.h

Log Message:
add Huawei E1750 Mobile Broadband HSPA USB Stick


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/u3g.c
cvs rdiff -u -r1.558 -r1.559 src/sys/dev/usb/usbdevs
cvs rdiff -u -r1.551 -r1.552 src/sys/dev/usb/usbdevs.h
cvs rdiff -u -r1.552 -r1.553 src/sys/dev/usb/usbdevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/u3g.c
diff -u src/sys/dev/usb/u3g.c:1.14 src/sys/dev/usb/u3g.c:1.15
--- src/sys/dev/usb/u3g.c:1.14	Thu Jun 17 23:25:01 2010
+++ src/sys/dev/usb/u3g.c	Sat Jun 19 22:41:32 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: u3g.c,v 1.14 2010/06/17 23:25:01 riz Exp $	*/
+/*	$NetBSD: u3g.c,v 1.15 2010/06/19 22:41:32 kardel Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: u3g.c,v 1.14 2010/06/17 23:25:01 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: u3g.c,v 1.15 2010/06/19 22:41:32 kardel Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -450,10 +450,15 @@
 		if (uaa-product == USB_PRODUCT_HUAWEI_K3765)
 			return UMATCH_NONE;
 
-		if (uaa-product == USB_PRODUCT_HUAWEI_K3765INIT)
+		switch (uaa-product) {
+		case USB_PRODUCT_HUAWEI_E1750INIT:
+		case USB_PRODUCT_HUAWEI_K3765INIT:
 			return u3g_huawei_k3765_reinit(uaa-device);
-		else
+			break;
+		default:
 			return u3g_huawei_reinit(uaa-device);
+			break;
+		}
 	}
 
 	if (uaa-vendor == USB_VENDOR_NOVATEL2) {

Index: src/sys/dev/usb/usbdevs
diff -u src/sys/dev/usb/usbdevs:1.558 src/sys/dev/usb/usbdevs:1.559
--- src/sys/dev/usb/usbdevs:1.558	Thu Jun 17 23:22:21 2010
+++ src/sys/dev/usb/usbdevs	Sat Jun 19 22:41:32 2010
@@ -1,4 +1,4 @@
-$NetBSD: usbdevs,v 1.558 2010/06/17 23:22:21 riz Exp $
+$NetBSD: usbdevs,v 1.559 2010/06/19 22:41:32 kardel Exp $
 
 /*
  * Copyright (c) 1998-2004 The NetBSD Foundation, Inc.
@@ -1292,6 +1292,7 @@
 /* Huawei Technologies products */
 product HUAWEI MOBILE		0x1001	Huawei Mobile
 product HUAWEI E220  		0x1003	Huawei E220
+product HUAWEI E1750INIT  	0x1446	Huawei E1750 USB CD
 product HUAWEI K3765  		0x1465	Huawei K3765
 product HUAWEI K3765INIT 	0x1520	Huawei K3765 USB CD
 

Index: src/sys/dev/usb/usbdevs.h
diff -u src/sys/dev/usb/usbdevs.h:1.551 src/sys/dev/usb/usbdevs.h:1.552
--- src/sys/dev/usb/usbdevs.h:1.551	Thu Jun 17 23:22:50 2010
+++ src/sys/dev/usb/usbdevs.h	Sat Jun 19 22:41:33 2010
@@ -1,4 +1,4 @@
-/* ??? */
+/*	$NetBSD: usbdevs.h,v 1.552 2010/06/19 22:41:33 kardel Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -1299,6 +1299,7 @@
 /* Huawei Technologies products */
 #define	USB_PRODUCT_HUAWEI_MOBILE	0x1001		/* Huawei Mobile */
 #define	USB_PRODUCT_HUAWEI_E220	0x1003		/* Huawei E220 */
+#define	USB_PRODUCT_HUAWEI_E1750INIT	0x1446		/* Huawei E1750 USB CD */
 #define	USB_PRODUCT_HUAWEI_K3765	0x1465		/* Huawei K3765 */
 #define	USB_PRODUCT_HUAWEI_K3765INIT	0x1520		/* Huawei K3765 USB CD */
 

Index: src/sys/dev/usb/usbdevs_data.h
diff -u src/sys/dev/usb/usbdevs_data.h:1.552 src/sys/dev/usb/usbdevs_data.h:1.553
--- src/sys/dev/usb/usbdevs_data.h:1.552	Thu Jun 17 23:22:50 2010
+++ src/sys/dev/usb/usbdevs_data.h	Sat Jun 19 22:41:33 2010
@@ -1,4 +1,4 @@
-/* ??? */
+/*	$NetBSD: usbdevs_data.h,v 1.553 2010/06/19 22:41:33 kardel Exp $	*/
 
 /*
  * THIS FILE IS AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -3883,6 +3883,10 @@
 	Huawei E220,
 	},
 	{
+	USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E1750INIT,
+	Huawei E1750 USB CD,
+	},
+	{
 	USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_K3765,
 	Huawei K3765,
 	},
@@ -7307,4 +7311,4 @@
 	Prestige,
 	},
 };
-const int usb_nproducts = 1345;
+const int usb_nproducts = 1346;



CVS commit: src/sys/kern

2010-05-04 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue May  4 19:23:56 UTC 2010

Modified Files:
src/sys/kern: kern_uuid.c

Log Message:
switch to nanotime() for 100ns resolution


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/kern/kern_uuid.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_uuid.c
diff -u src/sys/kern/kern_uuid.c:1.16 src/sys/kern/kern_uuid.c:1.17
--- src/sys/kern/kern_uuid.c:1.16	Tue Nov 18 14:01:03 2008
+++ src/sys/kern/kern_uuid.c	Tue May  4 19:23:56 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_uuid.c,v 1.16 2008/11/18 14:01:03 joerg Exp $	*/
+/*	$NetBSD: kern_uuid.c,v 1.17 2010/05/04 19:23:56 kardel Exp $	*/
 
 /*
  * Copyright (c) 2002 Marcel Moolenaar
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_uuid.c,v 1.16 2008/11/18 14:01:03 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_uuid.c,v 1.17 2010/05/04 19:23:56 kardel Exp $);
 
 #include sys/param.h
 #include sys/endian.h
@@ -136,19 +136,15 @@
  * the Unix time since 00:00:00.00, January 1, 1970 to the date of the
  * Gregorian reform to the Christian calendar.
  */
-/*
- * At present, NetBSD has no timespec source, only timeval sources.  So,
- * we use timeval.
- */
 static uint64_t
 uuid_time(void)
 {
-	struct timeval tv;
+	struct timespec tsp;
 	uint64_t xtime = 0x01B21DD213814000LL;
 
-	microtime(tv);
-	xtime += (uint64_t)tv.tv_sec * 1000LL;
-	xtime += (uint64_t)(10 * tv.tv_usec);
+	nanotime(tsp);
+	xtime += (uint64_t)tsp.tv_sec * 1000LL;
+	xtime += (uint64_t)(tsp.tv_nsec / 100);
 	return (xtime  ((1LL  60) - 1LL));
 }
 



CVS commit: src/doc

2009-12-13 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Dec 13 16:48:56 UTC 2009

Modified Files:
src/doc: 3RDPARTY

Log Message:
note release of ntp 4.2.6


To generate a diff of this commit:
cvs rdiff -u -r1.738 -r1.739 src/doc/3RDPARTY

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.738 src/doc/3RDPARTY:1.739
--- src/doc/3RDPARTY:1.738	Tue Dec  8 21:54:22 2009
+++ src/doc/3RDPARTY	Sun Dec 13 16:48:56 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.738 2009/12/08 21:54:22 kardel Exp $
+#	$NetBSD: 3RDPARTY,v 1.739 2009/12/13 16:48:56 kardel Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -693,7 +693,7 @@
 HAVE_STRICT_ALIGNMENT.  Fix RCS IDs, import.
 
 Package:	ntp
-Version:	4.2.4p8
+Version:	4.2.6
 Current Vers:	4.2.4p8
 Maintainer:	David L. Mills mi...@udel.edu
 Archive Site:	ftp://ftp.udel.edu/pub/ntp/ntp4/



CVS commit: src/external/bsd/ntp/dist

2009-12-13 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Dec 13 16:57:37 UTC 2009

Update of /cvsroot/src/external/bsd/ntp/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28166

Log Message:
Import ntp 4.2.6

Status:

Vendor Tag: UDEL
Release Tags:   ntp-4-2-6

N src/external/bsd/ntp/dist/CommitLog-4.1.0
N src/external/bsd/ntp/dist/COPYRIGHT
N src/external/bsd/ntp/dist/ChangeLog
N src/external/bsd/ntp/dist/CommitLog
N src/external/bsd/ntp/dist/Makefile.am
N src/external/bsd/ntp/dist/INSTALL
N src/external/bsd/ntp/dist/NOTES.y2kfixes
N src/external/bsd/ntp/dist/Makefile.in
N src/external/bsd/ntp/dist/NEWS
N src/external/bsd/ntp/dist/README.bk
N src/external/bsd/ntp/dist/README
N src/external/bsd/ntp/dist/README.hackers
N src/external/bsd/ntp/dist/README.patches
N src/external/bsd/ntp/dist/README.refclocks
N src/external/bsd/ntp/dist/README.versions
N src/external/bsd/ntp/dist/TODO
N src/external/bsd/ntp/dist/WHERE-TO-START
N src/external/bsd/ntp/dist/aclocal.m4
N src/external/bsd/ntp/dist/bincheck.mf
N src/external/bsd/ntp/dist/bootstrap
N src/external/bsd/ntp/dist/build
N src/external/bsd/ntp/dist/compile
N src/external/bsd/ntp/dist/config.guess
N src/external/bsd/ntp/dist/config.h.in
N src/external/bsd/ntp/dist/config.sub
N src/external/bsd/ntp/dist/configure
N src/external/bsd/ntp/dist/configure.ac
N src/external/bsd/ntp/dist/depcomp
N src/external/bsd/ntp/dist/deps-ver
N src/external/bsd/ntp/dist/depsver.mf
N src/external/bsd/ntp/dist/dot.emacs
N src/external/bsd/ntp/dist/excludes
N src/external/bsd/ntp/dist/flock-build
N src/external/bsd/ntp/dist/install-sh
N src/external/bsd/ntp/dist/ltmain.sh
N src/external/bsd/ntp/dist/missing
N src/external/bsd/ntp/dist/packageinfo.sh
N src/external/bsd/ntp/dist/readme.y2kfixes
N src/external/bsd/ntp/dist/results.y2kfixes
N src/external/bsd/ntp/dist/version.m4
N src/external/bsd/ntp/dist/version
N src/external/bsd/ntp/dist/ylwrap
N src/external/bsd/ntp/dist/ElectricFence/efence.h
N src/external/bsd/ntp/dist/ElectricFence/Makefile.am
N src/external/bsd/ntp/dist/ElectricFence/README
N src/external/bsd/ntp/dist/ElectricFence/Makefile.in
N src/external/bsd/ntp/dist/ElectricFence/COPYING
N src/external/bsd/ntp/dist/ElectricFence/efence.c
N src/external/bsd/ntp/dist/ElectricFence/page.c
N src/external/bsd/ntp/dist/ElectricFence/print.c
N src/external/bsd/ntp/dist/ElectricFence/eftest.c
N src/external/bsd/ntp/dist/ElectricFence/tstheap.c
N src/external/bsd/ntp/dist/ElectricFence/libefence.3
N src/external/bsd/ntp/dist/ElectricFence/CHANGES
N src/external/bsd/ntp/dist/adjtimed/adjtimed.c
N src/external/bsd/ntp/dist/adjtimed/Makefile.am
N src/external/bsd/ntp/dist/adjtimed/README
N src/external/bsd/ntp/dist/adjtimed/Makefile.in
N src/external/bsd/ntp/dist/clockstuff/chutest.c
N src/external/bsd/ntp/dist/clockstuff/Makefile.am
N src/external/bsd/ntp/dist/clockstuff/README
N src/external/bsd/ntp/dist/clockstuff/Makefile.in
N src/external/bsd/ntp/dist/clockstuff/clktest.c
N src/external/bsd/ntp/dist/clockstuff/propdelay.c
N src/external/bsd/ntp/dist/arlib/arlib.h
N src/external/bsd/ntp/dist/arlib/configure.in
N src/external/bsd/ntp/dist/arlib/README
N src/external/bsd/ntp/dist/arlib/aclocal.m4
N src/external/bsd/ntp/dist/arlib/arlib.c
N src/external/bsd/ntp/dist/arlib/Makefile.am
N src/external/bsd/ntp/dist/arlib/Makefile.in
N src/external/bsd/ntp/dist/arlib/configure
N src/external/bsd/ntp/dist/arlib/COPYING
N src/external/bsd/ntp/dist/arlib/INSTALL
N src/external/bsd/ntp/dist/arlib/depcomp
N src/external/bsd/ntp/dist/arlib/install-sh
N src/external/bsd/ntp/dist/arlib/missing
N src/external/bsd/ntp/dist/arlib/arplib.h
N src/external/bsd/ntp/dist/arlib/sample.c
N src/external/bsd/ntp/dist/arlib/arlib.3
N src/external/bsd/ntp/dist/arlib/UNSHAR.HDR
N src/external/bsd/ntp/dist/conf/beauregard.conf
N src/external/bsd/ntp/dist/conf/baldwin.conf
N src/external/bsd/ntp/dist/conf/README
N src/external/bsd/ntp/dist/conf/grundoon.conf
N src/external/bsd/ntp/dist/conf/malarky.conf
N src/external/bsd/ntp/dist/conf/pogo.conf
N src/external/bsd/ntp/dist/conf/rackety.conf
N src/external/bsd/ntp/dist/html/copyright.html
N src/external/bsd/ntp/dist/html/extern.html
N src/external/bsd/ntp/dist/html/sntp.html
N src/external/bsd/ntp/dist/html/prefer.html
N src/external/bsd/ntp/dist/html/ntptrace.html
N src/external/bsd/ntp/dist/html/debug.html
N src/external/bsd/ntp/dist/html/comdex.html
N src/external/bsd/ntp/dist/html/config.html
N src/external/bsd/ntp/dist/html/manyopt.html
N src/external/bsd/ntp/dist/html/assoc.html
N src/external/bsd/ntp/dist/html/sitemap.html
N src/external/bsd/ntp/dist/html/keygen.html
N src/external/bsd/ntp/dist/html/ntpd.html
N src/external/bsd/ntp/dist/html/release.html
N src/external/bsd/ntp/dist/html/ntpdc.html
N src/external/bsd/ntp/dist/html/audio.html
N src/external/bsd/ntp/dist/html/xleave.html
N src/external/bsd/ntp/dist/html/hints.html
N src/external/bsd/ntp/dist/html/howto.html
N src/external/bsd/ntp/dist/html/quick.html
N 

CVS commit: src/external/bsd/ntp

2009-12-13 Thread Frank Kardel
 conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#notice, this list of conditions and the following disclaimer in the
+#documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# ntp2netbsd:  convert a ntp source tree into a
+# netbsd ntp source tree, under src/dist,
+# based on bind2netbsd by Bernd Ernesti
+#
+# Rough instructions for importing new NTP release:
+#
+#	$ cd /some/where/temporary
+#	$ tar xpfz /new/ntp/release/tar/file
+#	$ sh /usr/src/external/bsd/ntp/ntp2netbsd ntp-4.x.y `pwd`
+#	$ cd src/externaä/bsd/ntp/dist
+#	$ cvs import -m Import ntp 4.x.y src/dist/ntp UDEL ntp-4-x-y
+#	$ cd ../../../../../ntp-4.x.y
+#	$ run ./configure  --enable-all-clocks --enable-parse-clocks
+#	$ echo cp config.h /usr/src/external/bsd/ntp/include
+# - not really - we have some changed defaults and the vax port has no ieee.h support.
+#   so do a careful diff and patch - Frank Kardel
+#	$ echo cp scripts/mkver /usr/src/external/bsd/ntp/scripts
+#		merge possible changes to mkver 
+#	our version uses the import date in the file
+#   /usr/src/external/bsd/ntp/importdate for the date and buildnumber information
+#		to achieve consistent version string over all builds
+#	$ cd ..
+#	$ rm -r src ntp-4.x.y
+#	$ cd /usr/src/external/bsd/ntp
+#	$ cvs update
+#	$ cvs commit -m Updated autoconf generated files for ntp 4.x.y.
+#
+#	- check makefiles to see if any extra sources have been added,
+#	  esp. libntp and ntpd.
+#	- check for and remove img tags in html docs.
+#	- update distrib/sets if necessary.
+#   - update src/external/bsd/ntp/importdate to match the date of this import
+#
+if [ $# -ne 2 ]; then echo ntp2netbsd src dest; exit 1; fi
+
+r=$1
+d=$2/src/external/bsd/ntp/dist
+
+case $d in
+	/*)
+		;;
+	*)
+		d=`/bin/pwd`/$d
+		;;
+esac
+
+case $r in
+	/*)
+		;;
+	*)
+		r=`/bin/pwd`/$r
+		;;
+esac
+
+echo preparing directory $d
+rm -rf $d
+mkdir -p $d
+
+### Copy the files and directories
+echo copying $r to $d
+cd $r
+pax -rw * $d
+
+echo removing unneeded directories and files
+
+### Remove unneeded directories
+cd $d
+rm -r ports html/pic
+
+### Remove .cvsignore
+find $d -name '.cvsignore*' -exec rm {} \;
+
+### Remove the $'s around RCS tags
+find $d -type f -print | xargs egrep -l '\$(Id|Created|Header)' | while read f; do
+	sed -e 's/\$\(Id.*\) \$/\1/' \
+	-e 's/\$\(Created.*\) \$/\1/' \
+	-e 's/\$\(Header.*\) \$/\1/' \
+	 $f  /tmp/ntp1f$$  mv /tmp/ntp1f$$ $f  \
+	echo removed \$RCS tag from $f
+done
+
+### Add our NetBSD RCS Id
+find $d -name '*.[chly]' -print | while read c; do
+	sed 1q  $c | grep -q '\$NetBSD' || (
+echo /*	\$NetBSD\$	*/ /tmp/ntp3n$$
+echo  /tmp/ntp3n$$
+cat $c   /tmp/ntp3n$$
+mv /tmp/ntp3n$$ $c  echo added NetBSD RCS tag to $c
+	)
+done
+
+echo done
+
+### Clean up any CVS directories that might be around.
+echo cleaning up CVS residue.
+(
+	cd $d
+	find . -type d -name CVS -print | xargs rm -r
+)
+echo done
+
+### Fixing file and directory permissions.
+echo Fixing file/directory permissions.
+(
+	cd $d
+	find . -type f -print | xargs chmod u+rw,go+r
+	find . -type d -print | xargs chmod u+rwx,go+rx
+)
+echo done
+
+exit 0

Index: src/external/bsd/ntp/bin/Makefile
diff -u /dev/null src/external/bsd/ntp/bin/Makefile:1.1
--- /dev/null	Sun Dec 13 17:13:49 2009
+++ src/external/bsd/ntp/bin/Makefile	Sun Dec 13 17:13:48 2009
@@ -0,0 +1,12 @@
+#	$NetBSD: Makefile,v 1.1 2009/12/13 17:13:48 kardel Exp $
+
+SUBDIR= ntp-keygen ntpd ntpdate ntpdc ntpq ntptime
+
+.if (${MKCRYPTO} != no)
+SUBDIR+= ntp-keygen
+CPPFLAGS+=-DOPENSSL
+.endif
+
+.include Makefile.inc
+
+.include bsd.subdir.mk
Index: src/external/bsd/ntp/bin/Makefile.inc
diff -u /dev/null src/external/bsd/ntp/bin/Makefile.inc:1.1
--- /dev/null	Sun Dec 13 17:13:49 2009
+++ src/external/bsd/ntp/bin/Makefile.inc	Sun Dec 13 17:13:48 2009
@@ -0,0 +1,5 @@
+#	$NetBSD: Makefile.inc,v 1.1 2009/12/13 17:13:48 kardel Exp $
+
+.include ../Makefile.inc
+
+WARNS?=		2

Index: src/external/bsd/ntp/bin/ntp-keygen/Makefile
diff

CVS commit: src

2009-12-08 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Dec  8 21:52:07 UTC 2009

Modified Files:
src/dist/ntp: config.h.in configure
src/dist/ntp/ntpd: ntp_request.c
src/usr.sbin/ntp: importdate
src/usr.sbin/ntp/ntp-keygen: ntp-keygen.8
src/usr.sbin/ntp/ntpd: ntpd.8
src/usr.sbin/ntp/ntpdc: ntpdc.8
src/usr.sbin/ntp/ntpq: ntpq.8
src/usr.sbin/ntp/scripts: mkver
src/usr.sbin/sntp: sntp.1

Log Message:
Merge ntp 4.2.4p8


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/dist/ntp/config.h.in
cvs rdiff -u -r1.10 -r1.11 src/dist/ntp/configure
cvs rdiff -u -r1.9 -r1.10 src/dist/ntp/ntpd/ntp_request.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/ntp/importdate
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/ntp/ntp-keygen/ntp-keygen.8
cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/ntp/ntpd/ntpd.8
cvs rdiff -u -r1.19 -r1.20 src/usr.sbin/ntp/ntpdc/ntpdc.8
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/ntp/ntpq/ntpq.8
cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/ntp/scripts/mkver
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sntp/sntp.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffs are larger than 1MB and have been omitted


CVS commit: src/doc

2009-12-08 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Dec  8 21:54:23 UTC 2009

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
note import of ntp 4.2.4p8


To generate a diff of this commit:
cvs rdiff -u -r1.737 -r1.738 src/doc/3RDPARTY
cvs rdiff -u -r1.1328 -r1.1329 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.737 src/doc/3RDPARTY:1.738
--- src/doc/3RDPARTY:1.737	Mon Dec  7 00:47:49 2009
+++ src/doc/3RDPARTY	Tue Dec  8 21:54:22 2009
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.737 2009/12/07 00:47:49 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.738 2009/12/08 21:54:22 kardel Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -693,8 +693,8 @@
 HAVE_STRICT_ALIGNMENT.  Fix RCS IDs, import.
 
 Package:	ntp
-Version:	4.2.4p7
-Current Vers:	4.2.4p7
+Version:	4.2.4p8
+Current Vers:	4.2.4p8
 Maintainer:	David L. Mills mi...@udel.edu
 Archive Site:	ftp://ftp.udel.edu/pub/ntp/ntp4/
 Home Page:	http://www.ntp.org/, http://support.ntp.org/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1328 src/doc/CHANGES:1.1329
--- src/doc/CHANGES:1.1328	Sat Dec  5 20:17:13 2009
+++ src/doc/CHANGES	Tue Dec  8 21:54:22 2009
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1328 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1329 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -501,3 +501,4 @@
 	mount_portal(8): Remove the kernel portalfs driver and replace
 		mount_portal with a version implemented using puffs.
 		[pooka 20091205]
+	ntp:	Import ntp-4-2-4p8. [kardel 20091208]



CVS commit: src/distrib/sets/lists/base

2009-10-31 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sat Oct 31 22:56:38 UTC 2009

Modified Files:
src/distrib/sets/lists/base: mi

Log Message:
add ./usr/share/i18n/esdb/EBCDIC/EBCDIC-US.esdb - Hi tnozaki


To generate a diff of this commit:
cvs rdiff -u -r1.837 -r1.838 src/distrib/sets/lists/base/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.837 src/distrib/sets/lists/base/mi:1.838
--- src/distrib/sets/lists/base/mi:1.837	Sat Oct 31 15:06:52 2009
+++ src/distrib/sets/lists/base/mi	Sat Oct 31 22:56:38 2009
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.837 2009/10/31 15:06:52 tnozaki Exp $
+# $NetBSD: mi,v 1.838 2009/10/31 22:56:38 kardel Exp $
 #
 # Note:	Don't delete entries from here - mark them as obsolete instead,
 #	unless otherwise stated below.
@@ -2114,6 +2114,7 @@
 ./usr/share/i18n/esdb/EBCDIC/EBCDIC-IT.esdb	base-sysutil-share	nls
 ./usr/share/i18n/esdb/EBCDIC/EBCDIC-PT.esdb	base-sysutil-share	nls
 ./usr/share/i18n/esdb/EBCDIC/EBCDIC-UK.esdb	base-sysutil-share	nls
+./usr/share/i18n/esdb/EBCDIC/EBCDIC-US.esdb	base-sysutil-share	nls
 ./usr/share/i18n/esdb/EUC			base-sysutil-share
 ./usr/share/i18n/esdb/EUC/EUC-CN.esdb		base-sysutil-share	nls
 ./usr/share/i18n/esdb/EUC/EUC-JIS-2004.esdb	base-sysutil-share	nls



CVS commit: src/sys/arch/i386/pci

2009-10-20 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Tue Oct 20 17:29:06 UTC 2009

Modified Files:
src/sys/arch/i386/pci: geodevar.h

Log Message:
update copyright to 2 clause version of the NetBSD Foundation


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/pci/geodevar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/pci/geodevar.h
diff -u src/sys/arch/i386/pci/geodevar.h:1.3 src/sys/arch/i386/pci/geodevar.h:1.4
--- src/sys/arch/i386/pci/geodevar.h:1.3	Mon May  5 11:49:40 2008
+++ src/sys/arch/i386/pci/geodevar.h	Tue Oct 20 17:29:06 2009
@@ -1,9 +1,8 @@
-/*	$NetBSD: geodevar.h,v 1.3 2008/05/05 11:49:40 xtraeme Exp $	*/
+/*	$NetBSD: geodevar.h,v 1.4 2009/10/20 17:29:06 kardel Exp $	*/
 
 /*-
- * Copyright (c) 2006 Frank Kardel  All rights reserved.
- *
- * This code was written by Frank Kardel
+ * Copyright (c) 2006 The NetBSD Foundation, Inc.
+ * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -13,27 +12,21 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *must display the following acknowledgement:
- *	This product includes software developed by David Young.
- * 4. The name of David Young may not be used to endorse or promote
- *products derived from this software without specific prior
- *written permission.
  *
- * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL DAVID
- * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
- * OF SUCH DAMAGE.
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
  */
 
+
 /*
  * Register definitions for the AMD Geode SC1100.
  */



CVS commit: src/sys

2009-06-14 Thread Frank Kardel
Module Name:src
Committed By:   kardel
Date:   Sun Jun 14 13:16:32 UTC 2009

Modified Files:
src/sys/kern: kern_tc.c
src/sys/sys: timepps.h

Log Message:
Make PPS work with fast time counters ( 2GHz)
by making the pps count time stamp and the update
time stamp u_int64.
The time delta between two PPS events can now
be correctly calculated avoiding any unaccounted
for wraps with 32-bit counters.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/kern/kern_tc.c
cvs rdiff -u -r1.18 -r1.19 src/sys/sys/timepps.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_tc.c
diff -u src/sys/kern/kern_tc.c:1.39 src/sys/kern/kern_tc.c:1.40
--- src/sys/kern/kern_tc.c:1.39	Sat May 23 17:08:04 2009
+++ src/sys/kern/kern_tc.c	Sun Jun 14 13:16:32 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_tc.c,v 1.39 2009/05/23 17:08:04 ad Exp $ */
+/* $NetBSD: kern_tc.c,v 1.40 2009/06/14 13:16:32 kardel Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 /* __FBSDID($FreeBSD: src/sys/kern/kern_tc.c,v 1.166 2005/09/19 22:16:31 andre Exp $); */
-__KERNEL_RCSID(0, $NetBSD: kern_tc.c,v 1.39 2009/05/23 17:08:04 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_tc.c,v 1.40 2009/06/14 13:16:32 kardel Exp $);
 
 #include opt_ntp.h
 
@@ -87,16 +87,19 @@
 
 struct timehands {
 	/* These fields must be initialized by the driver. */
-	struct timecounter	*th_counter;
-	int64_t			th_adjustment;
-	u_int64_t		th_scale;
-	u_int	 		th_offset_count;
-	struct bintime		th_offset;
-	struct timeval		th_microtime;
-	struct timespec		th_nanotime;
+	struct timecounter	*th_counter; /* active timecounter */
+	int64_t			th_adjustment;   /* frequency adjustment */
+		 /* (NTP/adjtime) */
+	u_int64_t		th_scale;/* scale factor (counter */
+		 /* tick-time) */
+	u_int64_t 		th_offset_count; /* offset at last time */
+		 /* update (tc_windup()) */
+	struct bintime		th_offset;   /* bin (up)time at windup */
+	struct timeval		th_microtime;/* cached microtime */
+	struct timespec		th_nanotime; /* cached nanotime */
 	/* Fields not to be copied in tc_windup start with th_generation. */
-	volatile u_int		th_generation;
-	struct timehands	*th_next;
+	volatile u_int		th_generation;   /* current genration */
+	struct timehands	*th_next;/* next timehand */
 };
 
 static struct timehands th0;
@@ -732,7 +735,6 @@
 	else
 		ncount = 0;
 	th-th_offset_count += delta;
-	th-th_offset_count = th-th_counter-tc_counter_mask;
 	bintime_addx(th-th_offset, th-th_scale * delta);
 
 	/*
@@ -920,7 +922,7 @@
 	th = timehands;
 	pps-capgen = th-th_generation;
 	pps-capth = th;
-	pps-capcount = th-th_counter-tc_get_timecount(th-th_counter);
+	pps-capcount = (u_int64_t)tc_delta(th) + th-th_offset_count;
 	if (pps-capgen != th-th_generation)
 		pps-capgen = 0;
 }
@@ -930,7 +932,7 @@
 {
 	struct bintime bt;
 	struct timespec ts, *tsp, *osp;
-	u_int tcount, *pcount;
+	u_int64_t tcount, *pcount;
 	int foff, fhard;
 	pps_seq_t *pseq;
 
@@ -971,7 +973,6 @@
 
 	/* Convert the count to a timespec. */
 	tcount = pps-capcount - pps-capth-th_offset_count;
-	tcount = pps-capth-th_counter-tc_counter_mask;
 	bt = pps-capth-th_offset;
 	bintime_addx(bt, pps-capth-th_scale * tcount);
 	bintime_add(bt, timebasebin);

Index: src/sys/sys/timepps.h
diff -u src/sys/sys/timepps.h:1.18 src/sys/sys/timepps.h:1.19
--- src/sys/sys/timepps.h:1.18	Mon Apr 21 12:56:31 2008
+++ src/sys/sys/timepps.h	Sun Jun 14 13:16:32 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: timepps.h,v 1.18 2008/04/21 12:56:31 ad Exp $	*/
+/*	$NetBSD: timepps.h,v 1.19 2009/06/14 13:16:32 kardel Exp $	*/
 
 /*
  * Copyright (c) 1998 Jonathan Stone
@@ -139,7 +139,7 @@
 	/* Capture information. */
 	struct timehands *capth;
 	unsigned	capgen;
-	unsigned	capcount;
+	u_int64_t	capcount;
 
 	/* State information. */
 	pps_params_t	ppsparam;
@@ -147,7 +147,7 @@
 	int		kcmode;
 	int		ppscap;
 	struct timecounter *ppstc;
-	unsigned	ppscount[3];
+	u_int64_t	ppscount[3]; 
 };
 
 void pps_capture(struct pps_state *);



  1   2   >