CVS commit: src/sys/dev/ofw

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 19:33:39 UTC 2015

Modified Files:
src/sys/dev/ofw: ofw_subr.c openfirm.h

Log Message:
add of_getprop_bool and of_getprop_uint32 helpers


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/ofw/ofw_subr.c
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/ofw/openfirm.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/ofw/ofw_subr.c
diff -u src/sys/dev/ofw/ofw_subr.c:1.26 src/sys/dev/ofw/ofw_subr.c:1.27
--- src/sys/dev/ofw/ofw_subr.c:1.26	Sun Dec 13 11:51:13 2015
+++ src/sys/dev/ofw/ofw_subr.c	Wed Dec 16 19:33:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_subr.c,v 1.26 2015/12/13 11:51:13 jmcneill Exp $	*/
+/*	$NetBSD: ofw_subr.c,v 1.27 2015/12/16 19:33:39 jmcneill Exp $	*/
 
 /*
  * Copyright 1998
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.26 2015/12/13 11:51:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.27 2015/12/16 19:33:39 jmcneill Exp $");
 
 #include 
 #include 
@@ -443,3 +443,31 @@ of_enter_i2c_devs(prop_dictionary_t prop
 
 	prop_dictionary_set_bool(props, "i2c-indirect-config", false);
 }
+
+/*
+ * Get the value of a boolean property. If the property is present,
+ * return true. Otherwise, return false.
+ */
+bool
+of_getprop_bool(int node, const char *prop)
+{
+	return OF_getproplen(node, prop) >= 0;
+}
+
+/*
+ * Get the value of a uint32 property, compensating for host byte order.
+ * Returns 0 on success, non-zero on failure.
+ */
+int
+of_getprop_uint32(int node, const char *prop, uint32_t *val)
+{
+	uint32_t v;
+	int len;
+
+	len = OF_getprop(node, prop, , sizeof(v));
+	if (len != sizeof(v))
+		return -1;
+
+	*val = be32toh(v);
+	return 0;
+}

Index: src/sys/dev/ofw/openfirm.h
diff -u src/sys/dev/ofw/openfirm.h:1.32 src/sys/dev/ofw/openfirm.h:1.33
--- src/sys/dev/ofw/openfirm.h:1.32	Sun Dec 13 11:51:13 2015
+++ src/sys/dev/ofw/openfirm.h	Wed Dec 16 19:33:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: openfirm.h,v 1.32 2015/12/13 11:51:13 jmcneill Exp $	*/
+/*	$NetBSD: openfirm.h,v 1.33 2015/12/16 19:33:39 jmcneill Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -120,4 +120,7 @@ char	*of_get_mode_string(char *, int);
 
 void	of_enter_i2c_devs(prop_dictionary_t, int, size_t, int);
 
+bool	of_getprop_bool(int, const char *);
+int	of_getprop_uint32(int, const char *, uint32_t *);
+
 #endif /*_OPENFIRM_H_*/



CVS commit: src/sys/dev/fdt

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 19:33:16 UTC 2015

Modified Files:
src/sys/dev/fdt: fdtbus.c

Log Message:
sometimes status is "ok" instead of "okay", allow both


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdtbus.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/fdt/fdtbus.c
diff -u src/sys/dev/fdt/fdtbus.c:1.1 src/sys/dev/fdt/fdtbus.c:1.2
--- src/sys/dev/fdt/fdtbus.c:1.1	Sun Dec 13 17:30:40 2015
+++ src/sys/dev/fdt/fdtbus.c	Wed Dec 16 19:33:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtbus.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $ */
+/* $NetBSD: fdtbus.c,v 1.2 2015/12/16 19:33:16 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdtbus.c,v 1.2 2015/12/16 19:33:16 jmcneill Exp $");
 
 #include 
 #include 
@@ -111,7 +111,8 @@ fdt_scan(device_t self, const struct fdt
 			status = kmem_zalloc(len, KM_SLEEP);
 			alen = OF_getprop(child, "status", status, len);
 			KASSERT(alen == len);
-			const bool okay_p = strcmp(status, "okay") == 0;
+			const bool okay_p = strcmp(status, "okay") == 0 ||
+	strcmp(status, "ok") == 0;
 			kmem_free(status, len);
 			if (!okay_p) {
 continue;



CVS commit: src/sys/arch/arm/nvidia

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 19:46:56 UTC 2015

Modified Files:
src/sys/arch/arm/nvidia: tegra_com.c tegra_i2c.c tegra_lic.c
tegra_sdhc.c tegra_usbphy.c

Log Message:
use of_getprop_uint32


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/nvidia/tegra_com.c \
src/sys/arch/arm/nvidia/tegra_usbphy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/nvidia/tegra_i2c.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/nvidia/tegra_lic.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/arm/nvidia/tegra_sdhc.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/arm/nvidia/tegra_com.c
diff -u src/sys/arch/arm/nvidia/tegra_com.c:1.3 src/sys/arch/arm/nvidia/tegra_com.c:1.4
--- src/sys/arch/arm/nvidia/tegra_com.c:1.3	Sun Dec 13 17:39:19 2015
+++ src/sys/arch/arm/nvidia/tegra_com.c	Wed Dec 16 19:46:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_com.c,v 1.3 2015/12/13 17:39:19 jmcneill Exp $ */
+/* $NetBSD: tegra_com.c,v 1.4 2015/12/16 19:46:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.3 2015/12/13 17:39:19 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: tegra_com.c,v 1.4 2015/12/16 19:46:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -98,17 +98,17 @@ tegra_com_attach(device_t parent, device
 	bus_addr_t addr;
 	bus_size_t size;
 	u_int reg_shift;
-	int error, len;
+	int error;
 
 	if (fdtbus_get_reg(faa->faa_phandle, 0, , ) != 0) {
 		aprint_error(": couldn't get registers\n");
 		return;
 	}
 
-	len = OF_getprop(faa->faa_phandle, "reg-shift", _shift,
-	sizeof(reg_shift));
-	if (len == sizeof(reg_shift)) {
-		reg_shift = be32toh(reg_shift);
+	if (of_getprop_uint32(faa->faa_phandle, "reg-shift", _shift)) {
+		/* missing or bad reg-shift property, assume 2 */
+		bst = faa->faa_a4x_bst;
+	} else {
 		if (reg_shift == 2) {
 			bst = faa->faa_a4x_bst;
 		} else if (reg_shift == 0) {
@@ -118,9 +118,6 @@ tegra_com_attach(device_t parent, device
 			reg_shift);
 			return;
 		}
-	} else {
-		/* missing or bad reg-shift property, assume 2 */
-		bst = faa->faa_a4x_bst;
 	}
 
 	sc->sc_dev = self;
Index: src/sys/arch/arm/nvidia/tegra_usbphy.c
diff -u src/sys/arch/arm/nvidia/tegra_usbphy.c:1.3 src/sys/arch/arm/nvidia/tegra_usbphy.c:1.4
--- src/sys/arch/arm/nvidia/tegra_usbphy.c:1.3	Sun Dec 13 17:39:19 2015
+++ src/sys/arch/arm/nvidia/tegra_usbphy.c	Wed Dec 16 19:46:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_usbphy.c,v 1.3 2015/12/13 17:39:19 jmcneill Exp $ */
+/* $NetBSD: tegra_usbphy.c,v 1.4 2015/12/16 19:46:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_usbphy.c,v 1.3 2015/12/13 17:39:19 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_usbphy.c,v 1.4 2015/12/16 19:46:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -69,16 +69,16 @@ struct tegra_usbphy_softc {
 	u_int			sc_port;
 
 	struct tegra_gpio_pin	*sc_pin_vbus;
-	uint8_t			sc_hssync_start_delay;
-	uint8_t			sc_idle_wait_delay;
-	uint8_t			sc_elastic_limit;
-	uint8_t			sc_term_range_adj;
-	uint8_t			sc_xcvr_setup;
-	uint8_t			sc_xcvr_lsfslew;
-	uint8_t			sc_xcvr_lsrslew;
-	uint8_t			sc_hssquelch_level;
-	uint8_t			sc_hsdiscon_level;
-	uint8_t			sc_xcvr_hsslew;
+	uint32_t		sc_hssync_start_delay;
+	uint32_t		sc_idle_wait_delay;
+	uint32_t		sc_elastic_limit;
+	uint32_t		sc_term_range_adj;
+	uint32_t		sc_xcvr_setup;
+	uint32_t		sc_xcvr_lsfslew;
+	uint32_t		sc_xcvr_lsrslew;
+	uint32_t		sc_hssquelch_level;
+	uint32_t		sc_hsdiscon_level;
+	uint32_t		sc_xcvr_hsslew;
 };
 
 static int	tegra_usbphy_parse_properties(struct tegra_usbphy_softc *);
@@ -147,19 +147,12 @@ tegra_usbphy_attach(device_t parent, dev
 static int
 tegra_usbphy_parse_properties(struct tegra_usbphy_softc *sc)
 {
-	const int phandle = sc->sc_phandle;
-	const int plen = sizeof(u_int);
-	u_int val;
-
 #define PROPGET(k, v)			\
-do {	\
-	if (OF_getprop(phandle, (k), , plen) != plen) {		\
+	if (of_getprop_uint32(sc->sc_phandle, (k), (v))) {		\
 		aprint_error_dev(sc->sc_dev,\
 		"missing property '%s'\n", (k));			\
 		return EIO;		\
-	}\
-	*(v) = be32toh(val);		\
-} while (0)
+	}
 
 	PROPGET("nvidia,hssync-start-delay", >sc_hssync_start_delay);
 	PROPGET("nvidia,idle-wait-delay", >sc_idle_wait_delay);

Index: src/sys/arch/arm/nvidia/tegra_i2c.c
diff -u src/sys/arch/arm/nvidia/tegra_i2c.c:1.9 src/sys/arch/arm/nvidia/tegra_i2c.c:1.10
--- src/sys/arch/arm/nvidia/tegra_i2c.c:1.9	Sun Dec 13 17:39:19 2015
+++ src/sys/arch/arm/nvidia/tegra_i2c.c	Wed Dec 16 19:46:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_i2c.c,v 1.9 2015/12/13 17:39:19 jmcneill Exp $ */
+/* $NetBSD: tegra_i2c.c,v 1.10 2015/12/16 19:46:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 

CVS commit: src/usr.bin/ftp

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 16 21:11:47 UTC 2015

Modified Files:
src/usr.bin/ftp: fetch.c

Log Message:
PR/50438: NONAKA Kimihiro: ftp(1): CONNECT method support
Please test!


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/usr.bin/ftp/fetch.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.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.214 src/usr.bin/ftp/fetch.c:1.215
--- src/usr.bin/ftp/fetch.c:1.214	Wed Dec 16 14:17:16 2015
+++ src/usr.bin/ftp/fetch.c	Wed Dec 16 16:11:47 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.214 2015/12/16 19:17:16 christos Exp $	*/
+/*	$NetBSD: fetch.c,v 1.215 2015/12/16 21:11:47 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.214 2015/12/16 19:17:16 christos Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.215 2015/12/16 21:11:47 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -184,6 +184,18 @@ initurlinfo(struct urlinfo *ui)
 	ui->portnum = 0;
 }
 
+#ifdef WITH_SSL
+static void
+copyurlinfo(struct urlinfo *dui, struct urlinfo *sui)
+{
+	dui->host = ftp_strdup(sui->host);
+	dui->port = ftp_strdup(sui->port);
+	dui->path = ftp_strdup(sui->path);
+	dui->utype = sui->utype;
+	dui->portnum = sui->portnum;
+}
+#endif
+
 static void
 freeurlinfo(struct urlinfo *ui)
 {
@@ -721,10 +733,9 @@ print_cache(FETCH *fin, int isproxy)
 }
 
 static int
-print_get(FETCH *fin, int isproxy, const struct urlinfo *ui)
+print_get(FETCH *fin, int hasleading, int isproxy, const struct urlinfo *ui)
 {
-	int hasleading = 0;
-	const char *leading = "  (";
+	const char *leading = hasleading ? ", " : "  (";
 
 	if (isproxy) {
 		if (verbose) {
@@ -807,66 +818,87 @@ print_proxy(FETCH *fin, const char *lead
 #define C_OK 0
 #define C_CLEANUP 1
 #define C_IMPROPER 2
-
+#define C_PROXY 3
+#define C_NOPROXY 4
 
 static int
-negotiate_connection(FETCH *fin, const char *url, const char *penv,
-off_t *rangestart, off_t *rangeend, off_t *entitylen,
-time_t *mtime, struct authinfo *wauth, struct authinfo *pauth,
-int *rval, int *ischunked)
+getresponseline(FETCH *fin, char *buf, size_t buflen, int *len)
 {
-	int			len, hcode, rv;
-	char			buf[FTPBUFLEN], *ep;
-	const char		*errormsg, *cp, *token;
-	char 			*location, *message, *auth;
-
-	auth = message = location = NULL;
+	const char *errormsg;
 
-	/* Read the response */
 	alarmtimer(quit_time ? quit_time : 60);
-	len = fetch_getline(fin, buf, sizeof(buf), );
+	*len = fetch_getline(fin, buf, buflen, );
 	alarmtimer(0);
-	if (len < 0) {
+	if (*len < 0) {
 		if (*errormsg == '\n')
 			errormsg++;
 		warnx("Receiving HTTP reply: %s", errormsg);
-		goto cleanup_fetch_url;
+		return C_CLEANUP;
 	}
-	while (len > 0 && (ISLWS(buf[len-1])))
-		buf[--len] = '\0';
+	while (*len > 0 && (ISLWS(buf[*len-1])))
+		buf[--*len] = '\0';
 
-	DPRINTF("%s: received `%s'\n", __func__, buf);
+	if (*len)
+		DPRINTF("%s: received `%s'\n", __func__, buf);
+	return C_OK;
+}
+
+static int
+getresponse(FETCH *fin, char **cp, size_t buflen, int *hcode)
+{
+	int len, rv;
+	char *ep, *buf = *cp;
+
+	*hcode = 0;
+	if ((rv = getresponseline(fin, buf, buflen, )) != C_OK)
+		return rv;
 
 	/* Determine HTTP response code */
-	cp = strchr(buf, ' ');
-	if (cp == NULL)
-		goto improper;
-	else
-		cp++;
+	*cp = strchr(buf, ' ');
+	if (*cp == NULL)
+		return C_IMPROPER;
 
-	hcode = strtol(cp, , 10);
+	(*cp)++;
+
+	*hcode = strtol(*cp, , 10);
 	if (*ep != '\0' && !isspace((unsigned char)*ep))
-		goto improper;
+		return C_IMPROPER;
+
+	return C_OK;
+}
+
+static int
+negotiate_connection(FETCH *fin, const char *url, const char *penv,
+off_t *rangestart, off_t *rangeend, off_t *entitylen,
+time_t *mtime, struct authinfo *wauth, struct authinfo *pauth,
+int *rval, int *ischunked, char **auth)
+{
+	int			len, hcode, rv;
+	char			buf[FTPBUFLEN], *ep;
+	const char		*cp, *token;
+	char 			*location, *message;
 
-	message = ftp_strdup(cp);
+	*auth = message = location = NULL;
+
+	/* Read the response */
+	ep = buf;
+	switch (getresponse(fin, , sizeof(buf), )) {
+	case C_CLEANUP:
+		goto cleanup_fetch_url;
+	case C_IMPROPER:
+		goto improper;
+	case C_OK:
+		message = ftp_strdup(ep);
+		break;
+	}
 
 	/* Read the rest of the header. */
 
 	for (;;) {
-		alarmtimer(quit_time ? quit_time : 60);
-		len = fetch_getline(fin, buf, sizeof(buf), );
-		alarmtimer(0);
-		if (len < 0) {
-			if (*errormsg == '\n')
-errormsg++;
-			warnx("Receiving HTTP reply: %s", errormsg);
+		if ((rv = getresponseline(fin, buf, sizeof(buf), )) != C_OK)
 			goto cleanup_fetch_url;
-		}
-		while (len > 0 && (ISLWS(buf[len-1])))
-			buf[--len] = '\0';
 		if (len == 0)
 			break;
-		DPRINTF("%s: received `%s'\n", __func__, buf);
 
 	/*
 	 * Look for some headers
@@ -960,8 +992,8 @@ negotiate_connection(FETCH *fin, const c
 "scheme `%s'\n", 

CVS commit: src/sys/dev/fdt

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 19:33:55 UTC 2015

Modified Files:
src/sys/dev/fdt: fdt_intr.c fdt_subr.c fixedregulator.c gpiokeys.c

Log Message:
Use of_getprop_bool/of_getprop_uint32


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/fdt_intr.c
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/fdt_subr.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fixedregulator.c \
src/sys/dev/fdt/gpiokeys.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/fdt/fdt_intr.c
diff -u src/sys/dev/fdt/fdt_intr.c:1.2 src/sys/dev/fdt/fdt_intr.c:1.3
--- src/sys/dev/fdt/fdt_intr.c:1.2	Wed Dec 16 12:17:45 2015
+++ src/sys/dev/fdt/fdt_intr.c	Wed Dec 16 19:33:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
+/* $NetBSD: fdt_intr.c,v 1.3 2015/12/16 19:33:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.3 2015/12/16 19:33:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -50,12 +50,10 @@ static int
 fdtbus_get_interrupt_parent(int phandle)
 {
 	u_int interrupt_parent;
-	int len;
 
 	while (phandle >= 0) {
-		len = OF_getprop(phandle, "interrupt-parent",
-		_parent, sizeof(interrupt_parent));
-		if (len == sizeof(interrupt_parent)) {
+		if (of_getprop_uint32(phandle, "interrupt-parent",
+		_parent) == 0) {
 			break;
 		}
 		if (phandle == 0) {
@@ -67,8 +65,6 @@ fdtbus_get_interrupt_parent(int phandle)
 		return -1;
 	}
 
-	interrupt_parent = fdt32_to_cpu(interrupt_parent);
-
 	const void *data = fdtbus_get_data();
 	const int off = fdt_node_offset_by_phandle(data, interrupt_parent);
 	if (off < 0) {

Index: src/sys/dev/fdt/fdt_subr.c
diff -u src/sys/dev/fdt/fdt_subr.c:1.3 src/sys/dev/fdt/fdt_subr.c:1.4
--- src/sys/dev/fdt/fdt_subr.c:1.3	Wed Dec 16 12:17:45 2015
+++ src/sys/dev/fdt/fdt_subr.c	Wed Dec 16 19:33:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.3 2015/12/16 12:17:45 jmcneill Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.4 2015/12/16 19:33:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.3 2015/12/16 12:17:45 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.4 2015/12/16 19:33:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -82,18 +82,14 @@ fdtbus_phandle2offset(int phandle)
 static int
 fdtbus_get_addr_cells(int phandle)
 {
-	int val, addr_cells, error;
+	uint32_t addr_cells;
 
 	const int parent = OF_parent(phandle);
 	if (parent == -1)
 		return -1;
 
-	error = OF_getprop(parent, "#address-cells", , sizeof(val));
-	if (error <= 0) {
+	if (of_getprop_uint32(parent, "#address-cells", _cells))
 		addr_cells = 2;
-	} else {
-		addr_cells = fdt32_to_cpu(val);
-	}
 
 	return addr_cells;
 }
@@ -101,18 +97,14 @@ fdtbus_get_addr_cells(int phandle)
 static int
 fdtbus_get_size_cells(int phandle)
 {
-	int val, size_cells, error;
+	uint32_t size_cells;
 
 	const int parent = OF_parent(phandle);
 	if (parent == -1)
 		return -1;
 
-	error = OF_getprop(parent, "#size-cells", , sizeof(val));
-	if (error <= 0) {
+	if (of_getprop_uint32(parent, "#size-cells", _cells))
 		size_cells = 0;
-	} else {
-		size_cells = fdt32_to_cpu(val);
-	}
 
 	return size_cells;
 }

Index: src/sys/dev/fdt/fixedregulator.c
diff -u src/sys/dev/fdt/fixedregulator.c:1.1 src/sys/dev/fdt/fixedregulator.c:1.2
--- src/sys/dev/fdt/fixedregulator.c:1.1	Sun Dec 13 17:30:40 2015
+++ src/sys/dev/fdt/fixedregulator.c	Wed Dec 16 19:33:55 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fixedregulator.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $ */
+/* $NetBSD: fixedregulator.c,v 1.2 2015/12/16 19:33:55 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fixedregulator.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fixedregulator.c,v 1.2 2015/12/16 19:33:55 jmcneill Exp $");
 
 #include 
 #include 
@@ -100,18 +100,14 @@ fixedregulator_attach(device_t parent, d
 	}
 
 	gpioflags = GPIO_PIN_OUTPUT;
-	if (OF_getproplen(phandle, "gpio-open-drain") >= 0) {
+	if (of_getprop_bool(phandle, "gpio-open-drain"))
 		gpioflags |= GPIO_PIN_OPENDRAIN;
-	}
 
+	sc->sc_always_on = of_getprop_bool(phandle, "regulator-always-on");
 	sc->sc_pin = fdtbus_gpio_acquire(phandle, "gpio", gpioflags);
-	if (sc->sc_pin == NULL ||
-	OF_getproplen(phandle, "regulator-always-on") >= 0) {
+	if (sc->sc_pin == NULL)
 		sc->sc_always_on = true;
-	}
-	if (OF_getproplen(phandle, "enable-active-high") >= 0) {
-		sc->sc_enable_val = 1;
-	}
+	sc->sc_enable_val = of_getprop_bool(phandle, "enable-active-high");
 
 	fdtbus_register_regulator_controller(self, 

CVS commit: src/usr.bin/ftp

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 16 19:17:16 UTC 2015

Modified Files:
src/usr.bin/ftp: fetch.c

Log Message:
more refactoring:
- introduce authinfo and urlinfo structures
- split negotiation code out.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/usr.bin/ftp/fetch.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.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.213 src/usr.bin/ftp/fetch.c:1.214
--- src/usr.bin/ftp/fetch.c:1.213	Tue Dec 15 20:20:05 2015
+++ src/usr.bin/ftp/fetch.c	Wed Dec 16 14:17:16 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.213 2015/12/16 01:20:05 nonaka Exp $	*/
+/*	$NetBSD: fetch.c,v 1.214 2015/12/16 19:17:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.213 2015/12/16 01:20:05 nonaka Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.214 2015/12/16 19:17:16 christos Exp $");
 #endif /* not lint */
 
 /*
@@ -80,19 +80,35 @@ typedef enum {
 	CLASSIC_URL_T
 } url_t;
 
+struct authinfo {
+	char *auth;
+	char *user;
+	char *pass;
+};
+
+struct urlinfo {
+	char *host;
+	char *port;
+	char *path;
+	url_t utype;
+	in_port_t portnum;
+};
+
 __dead static void	aborthttp(int);
 __dead static void	timeouthttp(int);
 #ifndef NO_AUTH
-static int	auth_url(const char *, char **, const char *, const char *);
+static int	auth_url(const char *, char **, const struct authinfo *);
 static void	base64_encode(const unsigned char *, size_t, unsigned char *);
 #endif
 static int	go_fetch(const char *);
 static int	fetch_ftp(const char *);
 static int	fetch_url(const char *, const char *, char *, char *);
 static const char *match_token(const char **, const char *);
-static int	parse_url(const char *, const char *, url_t *, char **,
-			char **, char **, char **, in_port_t *, char **);
+static int	parse_url(const char *, const char *, struct urlinfo *,
+struct authinfo *);
 static void	url_decode(char *);
+static void	freeauthinfo(struct authinfo *);
+static void	freeurlinfo(struct urlinfo *);
 
 static int	redirect_loop;
 
@@ -144,6 +160,38 @@ match_token(const char **buf, const char
 	return orig;
 }
 
+static void
+initauthinfo(struct authinfo *ai, char *auth)
+{
+	ai->auth = auth;
+	ai->user = ai->pass = 0;
+}
+
+static void
+freeauthinfo(struct authinfo *a)
+{
+	FREEPTR(a->user);
+	if (a->pass != NULL)
+		memset(a->pass, 0, strlen(a->pass));
+	FREEPTR(a->pass);
+}
+
+static void
+initurlinfo(struct urlinfo *ui)
+{
+	ui->host = ui->port = ui->path = 0;
+	ui->utype = UNKNOWN_URL_T;
+	ui->portnum = 0;
+}
+
+static void
+freeurlinfo(struct urlinfo *ui)
+{
+	FREEPTR(ui->host);
+	FREEPTR(ui->port);
+	FREEPTR(ui->path);
+}
+
 #ifndef NO_AUTH
 /*
  * Generate authorization response based on given authentication challenge.
@@ -151,8 +199,7 @@ match_token(const char **buf, const char
  * Sets response to a malloc(3)ed string; caller should free.
  */
 static int
-auth_url(const char *challenge, char **response, const char *guser,
-	const char *gpass)
+auth_url(const char *challenge, char **response, const struct authinfo *auth)
 {
 	const char	*cp, *scheme, *errormsg;
 	char		*ep, *clear, *realm;
@@ -196,8 +243,8 @@ auth_url(const char *challenge, char **r
 	}
 
 	fprintf(ttyout, "Username for `%s': ", realm);
-	if (guser != NULL) {
-		(void)strlcpy(uuser, guser, sizeof(uuser));
+	if (auth->user != NULL) {
+		(void)strlcpy(uuser, auth->user, sizeof(uuser));
 		fprintf(ttyout, "%s\n", uuser);
 	} else {
 		(void)fflush(ttyout);
@@ -206,8 +253,8 @@ auth_url(const char *challenge, char **r
 			goto cleanup_auth_url;
 		}
 	}
-	if (gpass != NULL)
-		upass = gpass;
+	if (auth->pass != NULL)
+		upass = auth->pass;
 	else {
 		gotpass = getpass("Password: ");
 		if (gotpass == NULL) {
@@ -227,7 +274,7 @@ auth_url(const char *challenge, char **r
 
 		/* scheme + " " + enc + "\0" */
 	rlen = strlen(scheme) + 1 + (clen + 2) * 4 / 3 + 1;
-	*response = (char *)ftp_malloc(rlen);
+	*response = ftp_malloc(rlen);
 	(void)strlcpy(*response, scheme, rlen);
 	len = strlcat(*response, " ", rlen);
 			/* use  `clen - 1'  to not encode the trailing NUL */
@@ -326,57 +373,47 @@ url_decode(char *url)
  *	"ftp://host/dir/file;		"dir/file"
  *	"ftp://host//dir/file;		"/dir/file"
  */
+
 static int
-parse_url(const char *url, const char *desc, url_t *utype,
-		char **uuser, char **pass, char **host, char **port,
-		in_port_t *portnum, char **path)
+parse_url(const char *url, const char *desc, struct urlinfo *ui,
+struct authinfo *auth) 
 {
 	const char	*origurl, *tport;
 	char		*cp, *ep, *thost;
 	size_t		 len;
 
-	if (url == NULL || desc == NULL || utype == NULL || uuser == NULL
-	|| pass == NULL || host == NULL || port == NULL || portnum == NULL
-	|| path == NULL)
+	if (url == NULL || desc == NULL || ui == NULL || auth == NULL)
 		

CVS commit: src/sys/arch

2015-12-16 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Dec 16 18:54:03 UTC 2015

Modified Files:
src/sys/arch/i386/i386: trap.c
src/sys/arch/x86/x86: cpu.c

Log Message:
Extend SMEP support to i386 (does not require PAE).


To generate a diff of this commit:
cvs rdiff -u -r1.275 -r1.276 src/sys/arch/i386/i386/trap.c
cvs rdiff -u -r1.118 -r1.119 src/sys/arch/x86/x86/cpu.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/i386/i386/trap.c
diff -u src/sys/arch/i386/i386/trap.c:1.275 src/sys/arch/i386/i386/trap.c:1.276
--- src/sys/arch/i386/i386/trap.c:1.275	Fri Feb 27 17:45:52 2015
+++ src/sys/arch/i386/i386/trap.c	Wed Dec 16 18:54:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.275 2015/02/27 17:45:52 christos Exp $	*/
+/*	$NetBSD: trap.c,v 1.276 2015/12/16 18:54:03 maxv Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.275 2015/02/27 17:45:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.276 2015/12/16 18:54:03 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -553,6 +553,14 @@ kernelfault:
 		}
 
 		cr2 = rcr2();
+
+		if (frame->tf_err & PGEX_X) {
+			/* SMEP might have brought us here */
+			if (cr2 > VM_MIN_ADDRESS && cr2 <= VM_MAXUSER_ADDRESS)
+panic("prevented execution of %p (SMEP)",
+(void *)cr2);
+		}
+
 		goto faultcommon;
 
 	case T_PAGEFLT|T_USER: {	/* page fault */

Index: src/sys/arch/x86/x86/cpu.c
diff -u src/sys/arch/x86/x86/cpu.c:1.118 src/sys/arch/x86/x86/cpu.c:1.119
--- src/sys/arch/x86/x86/cpu.c:1.118	Sun Dec 13 15:53:06 2015
+++ src/sys/arch/x86/x86/cpu.c	Wed Dec 16 18:54:03 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.118 2015/12/13 15:53:06 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.119 2015/12/16 18:54:03 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.118 2015/12/13 15:53:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.119 2015/12/16 18:54:03 maxv Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mpbios.h"		/* for MPDEBUG */
@@ -581,11 +581,9 @@ cpu_init(struct cpu_info *ci)
 	if (cpu_feature[1] & CPUID2_XSAVE)
 		cr4 |= CR4_OSXSAVE;
 
-#ifdef __x86_64__
 	/* If SMEP is supported, enable it */
 	if (cpu_feature[5] & CPUID_SEF_SMEP)
 		cr4 |= CR4_SMEP;
-#endif
 
 	if (cr4) {
 		cr4 |= rcr4();



CVS commit: src/sys/net

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 16 23:14:42 UTC 2015

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

Log Message:
don't free mbuf twice.
XXX: pullup 7.


To generate a diff of this commit:
cvs rdiff -u -r1.192 -r1.193 src/sys/net/bpf.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/bpf.c
diff -u src/sys/net/bpf.c:1.192 src/sys/net/bpf.c:1.193
--- src/sys/net/bpf.c:1.192	Wed Oct 14 15:40:09 2015
+++ src/sys/net/bpf.c	Wed Dec 16 18:14:42 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: bpf.c,v 1.192 2015/10/14 19:40:09 christos Exp $	*/
+/*	$NetBSD: bpf.c,v 1.193 2015/12/16 23:14:42 christos Exp $	*/
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.192 2015/10/14 19:40:09 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.193 2015/12/16 23:14:42 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -721,7 +721,8 @@ bpf_write(struct file *fp, off_t *offp, 
 	if (mc != NULL) {
 		if (error == 0)
 			(*ifp->if_input)(ifp, mc);
-		m_freem(mc);
+		else
+			m_freem(mc);
 	}
 	splx(s);
 	KERNEL_UNLOCK_ONE(NULL);



CVS commit: src/usr.bin/ftp

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 16 23:00:39 UTC 2015

Modified Files:
src/usr.bin/ftp: ftp_var.h

Log Message:
make DPRINTF/DWARN always statements.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/usr.bin/ftp/ftp_var.h

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

Modified files:

Index: src/usr.bin/ftp/ftp_var.h
diff -u src/usr.bin/ftp/ftp_var.h:1.83 src/usr.bin/ftp/ftp_var.h:1.84
--- src/usr.bin/ftp/ftp_var.h:1.83	Mon Jan 12 09:17:08 2015
+++ src/usr.bin/ftp/ftp_var.h	Wed Dec 16 18:00:39 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftp_var.h,v 1.83 2015/01/12 14:17:08 christos Exp $	*/
+/*	$NetBSD: ftp_var.h,v 1.84 2015/12/16 23:00:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996-2009 The NetBSD Foundation, Inc.
@@ -337,11 +337,12 @@ extern	struct option	optiontab[];
 #endif
 
 #ifdef NO_DEBUG
-#define DPRINTF(...)
-#define DWARN(...)
+#define DPRINTF(...)	(void)0
+#define DWARN(...)	(void)0
 #else
-#define DPRINTF(...)	if (ftp_debug) (void)fprintf(ttyout, __VA_ARGS__)
-#define DWARN(...)	if (ftp_debug) warn(__VA_ARGS__)
+#define DWFTP(a)	do a; while (/*CONSTCOND*/0)
+#define DPRINTF(...)	DWFTP(if (ftp_debug) (void)fprintf(ttyout, __VA_ARGS__))
+#define DWARN(...)	DWFTP(if (ftp_debug) warn(__VA_ARGS__))
 #endif
 
 #define STRorNULL(s)	((s) ? (s) : "")



CVS commit: src/external/bsd/bind

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 17 04:00:22 UTC 2015

Modified Files:
src/external/bsd/bind: bind2netbsd
src/external/bsd/bind/include: config.h
src/external/bsd/bind/include/isc: platform.h
src/external/bsd/bind/include/lwres: platform.h
src/external/bsd/bind/lib/libbind9: shlib_version
src/external/bsd/bind/lib/libdns: shlib_version
src/external/bsd/bind/lib/libirs: shlib_version
src/external/bsd/bind/lib/libisc: shlib_version
src/external/bsd/bind/lib/libisccc: shlib_version
src/external/bsd/bind/lib/libisccfg: shlib_version
src/external/bsd/bind/lib/liblwres: shlib_version

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/bind/bind2netbsd
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/bind/include/config.h
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/bind/include/isc/platform.h
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/bind/include/lwres/platform.h
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/bind/lib/libbind9/shlib_version
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/bind/lib/libdns/shlib_version
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/bind/lib/libirs/shlib_version
cvs rdiff -u -r1.16 -r1.17 src/external/bsd/bind/lib/libisc/shlib_version
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/bind/lib/libisccc/shlib_version
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/bind/lib/libisccfg/shlib_version
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/bind/lib/liblwres/shlib_version

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/bind/bind2netbsd
diff -u src/external/bsd/bind/bind2netbsd:1.2 src/external/bsd/bind/bind2netbsd:1.3
--- src/external/bsd/bind/bind2netbsd:1.2	Wed Mar  5 21:12:56 2014
+++ src/external/bsd/bind/bind2netbsd	Wed Dec 16 23:00:21 2015
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-#	$NetBSD: bind2netbsd,v 1.2 2014/03/06 02:12:56 christos Exp $
+#	$NetBSD: bind2netbsd,v 1.3 2015/12/17 04:00:21 christos Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -34,7 +34,7 @@
 #
 #	$ cd /some/where/temporary
 #	$ tar xpfz /new/bind/release/tar/file
-#	$ sh /usr/src/external/bsd/bind/dist/bind2netbsd bind-9.x.y `pwd`
+#	$ sh /usr/src/external/bsd/bind/bind2netbsd bind-9.x.y `pwd`
 #	$ cd src/external/bsd/bind/dist
 #	$ cvs -d cvs.netbsd.org:/cvsroot import -m "Import bind 9.x.y" src/external/bsd/bind/dist ISC bind-9-x-y
 #	$ cd ../../../../../bind-9.x.y

Index: src/external/bsd/bind/include/config.h
diff -u src/external/bsd/bind/include/config.h:1.16 src/external/bsd/bind/include/config.h:1.17
--- src/external/bsd/bind/include/config.h:1.16	Wed Jul  8 13:29:00 2015
+++ src/external/bsd/bind/include/config.h	Wed Dec 16 23:00:21 2015
@@ -181,15 +181,16 @@ int sigwait(const unsigned int *set, int
 /* Define to enable "rrset-order fixed" syntax. */
 #define DNS_RDATASET_FIXED 1
 
+/* Define to enable the "fetches-per-server" and "fetches-per-zone" options.
+   */
+#define ENABLE_FETCHLIMIT 1
+
 /* Define to enable rpz-nsdname rules. */
 #define ENABLE_RPZ_NSDNAME 1
 
 /* Define to enable rpz-nsip rules. */
 #define ENABLE_RPZ_NSIP 1
 
-/* Define to enable 'sit' support. */
-#define ENABLE_SIT 1
-
 /* Solaris hack to get select_large_fdset. */
 /* #undef FD_SETSIZE */
 
@@ -202,9 +203,6 @@ int sigwait(const unsigned int *set, int
MSVC and with C++ compilers. */
 #define FLEXIBLE_ARRAY_MEMBER /**/
 
-/* Define to 1 if you have the `AES_encrypt' function. */
-#define HAVE_AES_ENCRYPT 1
-
 /* Define to 1 if you have the `chroot' function. */
 #define HAVE_CHROOT 1
 
@@ -277,6 +275,9 @@ int sigwait(const unsigned int *set, int
 /* Define if libjson was found */
 /* #undef HAVE_JSON */
 
+/* Define if json-c was found */
+/* #undef HAVE_JSON_C */
+
 /* Define to 1 if you have the  header file. */
 /* #undef HAVE_KERBEROSV5_KRB5_H */
 
@@ -353,7 +354,7 @@ int sigwait(const unsigned int *set, int
 #define HAVE_NET_ROUTE_H 1
 
 /* Define if your OpenSSL version supports AES */
-#define HAVE_OPENSSL_AES 1
+/* #undef HAVE_OPENSSL_AES */
 
 /* Define if your OpenSSL version supports ECDSA. */
 #define HAVE_OPENSSL_ECDSA 1
@@ -380,7 +381,7 @@ int sigwait(const unsigned int *set, int
 /* #undef HAVE_PTHREAD_YIELD_NP */
 
 /* Define to 1 if you have the `readline' function. */
-/* #undef HAVE_READLINE */
+#define HAVE_READLINE 1
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_REGEX_H 1
@@ -545,6 +546,9 @@ int sigwait(const unsigned int *set, int
non-blocking. */
 /* #undef USE_FIONBIO_IOCTL */
 
+/* Define to enable very verbose query trace logging. */
+#define WANT_QUERYTRACE 1
+
 /* define if idnkit support is to be included. */
 /* #undef WITH_IDN */
 

Index: src/external/bsd/bind/include/isc/platform.h
diff -u src/external/bsd/bind/include/isc/platform.h:1.19 

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

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 17 04:00:46 UTC 2015

Modified Files:
src/external/bsd/bind/dist: CHANGES README config.h.in configure
configure.in srcid version
src/external/bsd/bind/dist/bin/check: check-tool.c named-checkconf.c
named-checkzone.c
src/external/bsd/bind/dist/bin/confgen: keygen.c util.c
src/external/bsd/bind/dist/bin/dig: dig.1 dig.c dighost.c nslookup.c
src/external/bsd/bind/dist/bin/dig/include/dig: dig.h
src/external/bsd/bind/dist/bin/dnssec: dnssec-dsfromkey.8
dnssec-dsfromkey.c dnssec-keygen.c dnssec-revoke.c dnssec-settime.c
dnssec-signzone.c
src/external/bsd/bind/dist/bin/named: client.c config.c control.c
interfacemgr.c logconf.c lwdclient.c lwresd.c main.c named.8
query.c server.c statschannel.c update.c xfrout.c
src/external/bsd/bind/dist/bin/named/include/named: lwdclient.h main.h
server.h
src/external/bsd/bind/dist/bin/named/win32: ntservice.c os.c
src/external/bsd/bind/dist/bin/nsupdate: nsupdate.1 nsupdate.c
src/external/bsd/bind/dist/bin/pkcs11: pkcs11-destroy.c pkcs11-keygen.c
pkcs11-list.c
src/external/bsd/bind/dist/bin/rndc: rndc.8 rndc.c util.c
src/external/bsd/bind/dist/bin/tests: adb_test.c backtrace_test.c
byaddr_test.c byname_test.c cfg_test.c compress_test.c db_test.c
entropy2_test.c entropy_test.c fsaccess_test.c gxba_test.c
gxbn_test.c hash_test.c inter_test.c keyboard_test.c lex_test.c
lfsr_test.c log_test.c lwres_test.c lwresconf_test.c makejournal.c
master_test.c name_test.c ratelimiter_test.c rbt_test.c
rdata_test.c serial_test.c sig0_test.c sock_test.c sym_test.c
task_test.c timer_test.c wire_test.c zone_test.c
src/external/bsd/bind/dist/bin/tests/db: t_db.c
src/external/bsd/bind/dist/bin/tests/dst: dst_test.c
src/external/bsd/bind/dist/bin/tests/names: t_names.c
src/external/bsd/bind/dist/bin/tests/net: driver.c netaddr_multicast.c
src/external/bsd/bind/dist/bin/tests/rbt: t_rbt.c
src/external/bsd/bind/dist/bin/tests/system/dlzexternal: driver.c
src/external/bsd/bind/dist/bin/tests/system/lwresd: lwtest.c
src/external/bsd/bind/dist/bin/tests/system/rsabigexponent: bigkey.c
src/external/bsd/bind/dist/bin/tests/system/tkey: keycreate.c
keydelete.c
src/external/bsd/bind/dist/bin/tests/tasks: t_tasks.c
src/external/bsd/bind/dist/bin/tools: arpaname.c isc-hmac-fixup.c
named-journalprint.c
src/external/bsd/bind/dist/doc/arm: Bv9ARM.ch04.html Bv9ARM.ch06.html
Bv9ARM.ch07.html Bv9ARM.ch08.html Bv9ARM.ch09.html Bv9ARM.html
Bv9ARM.pdf man.arpaname.html man.ddns-confgen.html man.delv.html
man.dig.html man.dnssec-checkds.html man.dnssec-coverage.html
man.dnssec-dsfromkey.html man.dnssec-importkey.html
man.dnssec-keyfromlabel.html man.dnssec-keygen.html
man.dnssec-revoke.html man.dnssec-settime.html
man.dnssec-signzone.html man.dnssec-verify.html man.genrandom.html
man.host.html man.isc-hmac-fixup.html man.named-checkconf.html
man.named-checkzone.html man.named-journalprint.html
man.named-rrchecker.html man.named.html man.nsec3hash.html
man.nsupdate.html man.rndc-confgen.html man.rndc.conf.html
man.rndc.html
src/external/bsd/bind/dist/lib/bind9: check.c
src/external/bsd/bind/dist/lib/dns: adb.c api cache.c callbacks.c
client.c diff.c dispatch.c dlz.c dnssec.c dst_api.c dst_openssl.h
dst_parse.c gssapi_link.c gssapictx.c hmac_link.c journal.c
keytable.c log.c master.c message.c name.c ncache.c nsec.c nsec3.c
openssl_link.c openssldh_link.c openssldsa_link.c
opensslecdsa_link.c opensslgost_link.c opensslrsa_link.c order.c
private.c rbt.c rbtdb.c rcode.c rdata.c request.c resolver.c
result.c rootns.c rpz.c rrl.c sdb.c sdlz.c spnego.c tcpmsg.c tkey.c
tsig.c update.c view.c xfrin.c zone.c
src/external/bsd/bind/dist/lib/dns/include/dns: adb.h log.h message.h
name.h resolver.h result.h rrl.h stats.h types.h zone.h
src/external/bsd/bind/dist/lib/dns/include/dst: dst.h
src/external/bsd/bind/dist/lib/dns/rdata/any_255: tsig_250.c
src/external/bsd/bind/dist/lib/dns/rdata/ch_3: a_1.c
src/external/bsd/bind/dist/lib/dns/rdata/generic: afsdb_18.c cert_37.c
cname_5.c dlv_32769.c dname_39.c dnskey_48.c ds_43.c gpos_27.c
hinfo_13.c hip_55.c ipseckey_45.c isdn_20.c key_25.c
keydata_65533.c loc_29.c mb_7.c md_3.c mf_4.c mg_8.c minfo_14.c
mr_9.c mx_15.c ns_2.c nsec3_50.c nsec3param_51.c nsec_47.c

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

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 17 04:10:03 UTC 2015

Modified Files:
src/external/bsd/bind/include: config.h
src/external/bsd/bind/include/isc: platform.h

Log Message:
fix merge botches


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/external/bsd/bind/include/config.h
cvs rdiff -u -r1.20 -r1.21 src/external/bsd/bind/include/isc/platform.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/bind/include/config.h
diff -u src/external/bsd/bind/include/config.h:1.17 src/external/bsd/bind/include/config.h:1.18
--- src/external/bsd/bind/include/config.h:1.17	Wed Dec 16 23:00:21 2015
+++ src/external/bsd/bind/include/config.h	Wed Dec 16 23:10:03 2015
@@ -354,7 +354,7 @@ int sigwait(const unsigned int *set, int
 #define HAVE_NET_ROUTE_H 1
 
 /* Define if your OpenSSL version supports AES */
-/* #undef HAVE_OPENSSL_AES */
+#define HAVE_OPENSSL_AES 1
 
 /* Define if your OpenSSL version supports ECDSA. */
 #define HAVE_OPENSSL_ECDSA 1
@@ -381,7 +381,7 @@ int sigwait(const unsigned int *set, int
 /* #undef HAVE_PTHREAD_YIELD_NP */
 
 /* Define to 1 if you have the `readline' function. */
-#define HAVE_READLINE 1
+/* #undef HAVE_READLINE */
 
 /* Define to 1 if you have the  header file. */
 #define HAVE_REGEX_H 1

Index: src/external/bsd/bind/include/isc/platform.h
diff -u src/external/bsd/bind/include/isc/platform.h:1.20 src/external/bsd/bind/include/isc/platform.h:1.21
--- src/external/bsd/bind/include/isc/platform.h:1.20	Wed Dec 16 23:00:21 2015
+++ src/external/bsd/bind/include/isc/platform.h	Wed Dec 16 23:10:03 2015
@@ -291,7 +291,9 @@
  * If the "xaddq" operation (64bit xadd) is available on this architecture,
  * ISC_PLATFORM_HAVEXADDQ will be defined.
  */
+#ifdef __HAVE_ATOMIC64_OPS
 #define ISC_PLATFORM_HAVEXADDQ 1
+#endif
 
 /*
  * If the "atomic swap" operation is available on this architecture,
@@ -344,7 +346,7 @@
 /*
  * Defined if we are enabling SIT (Source Identity Token).
  */
-#undef ISC_PLATFORM_USESIT
+#define ISC_PLATFORM_USESIT 1
 
 /***
  ***	Windows dll support.



CVS commit: src/usr.bin/ftp

2015-12-16 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Thu Dec 17 04:36:56 UTC 2015

Modified Files:
src/usr.bin/ftp: fetch.c

Log Message:
- Fix to connect https via proxy.
- Fix ttyout message.


To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/usr.bin/ftp/fetch.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.bin/ftp/fetch.c
diff -u src/usr.bin/ftp/fetch.c:1.215 src/usr.bin/ftp/fetch.c:1.216
--- src/usr.bin/ftp/fetch.c:1.215	Wed Dec 16 21:11:47 2015
+++ src/usr.bin/ftp/fetch.c	Thu Dec 17 04:36:56 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: fetch.c,v 1.215 2015/12/16 21:11:47 christos Exp $	*/
+/*	$NetBSD: fetch.c,v 1.216 2015/12/17 04:36:56 nonaka Exp $	*/
 
 /*-
  * Copyright (c) 1997-2015 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: fetch.c,v 1.215 2015/12/16 21:11:47 christos Exp $");
+__RCSID("$NetBSD: fetch.c,v 1.216 2015/12/17 04:36:56 nonaka Exp $");
 #endif /* not lint */
 
 /*
@@ -184,7 +184,6 @@ initurlinfo(struct urlinfo *ui)
 	ui->portnum = 0;
 }
 
-#ifdef WITH_SSL
 static void
 copyurlinfo(struct urlinfo *dui, struct urlinfo *sui)
 {
@@ -194,7 +193,6 @@ copyurlinfo(struct urlinfo *dui, struct 
 	dui->utype = sui->utype;
 	dui->portnum = sui->portnum;
 }
-#endif
 
 static void
 freeurlinfo(struct urlinfo *ui)
@@ -691,25 +689,29 @@ handle_proxy(const char *url, const char
 }
 
 static void
-print_host(FETCH *fin, const char *host)
+print_host(FETCH *fin, const struct urlinfo *ui)
 {
 	char *h, *p;
 
-	if (strchr(host, ':') == NULL) {
-		fetch_printf(fin, "Host: %s", host);
-		return;
-	}
+	if (strchr(ui->host, ':') == NULL) {
+		fetch_printf(fin, "Host: %s", ui->host);
+	} else {
+		/*
+		 * strip off IPv6 scope identifier, since it is
+		 * local to the node
+		 */
+		h = ftp_strdup(ui->host);
+		if (isipv6addr(h) && (p = strchr(h, '%')) != NULL)
+			*p = '\0';
 
-	/*
-	 * strip off IPv6 scope identifier, since it is
-	 * local to the node
-	 */
-	h = ftp_strdup(host);
-	if (isipv6addr(h) && (p = strchr(h, '%')) != NULL)
-		*p = '\0';
+		fetch_printf(fin, "Host: [%s]", h);
+		free(h);
+	}
 
-	fetch_printf(fin, "Host: [%s]", h);
-	free(h);
+	if ((ui->utype == HTTP_URL_T && ui->portnum != HTTP_PORT) ||
+	(ui->utype == HTTPS_URL_T && ui->portnum != HTTPS_PORT))
+		fetch_printf(fin, ":%u", ui->portnum);
+	fetch_printf(fin, "\r\n");
 }
 
 static void
@@ -733,7 +735,8 @@ print_cache(FETCH *fin, int isproxy)
 }
 
 static int
-print_get(FETCH *fin, int hasleading, int isproxy, const struct urlinfo *ui)
+print_get(FETCH *fin, int hasleading, int isproxy, const struct urlinfo *oui,
+const struct urlinfo *ui)
 {
 	const char *leading = hasleading ? ", " : "  (";
 
@@ -745,17 +748,12 @@ print_get(FETCH *fin, int hasleading, in
 			hasleading++;
 		}
 		fetch_printf(fin, "GET %s HTTP/1.0\r\n", ui->path);
+		print_host(fin, oui);
 		return hasleading;
 	}
 
 	fetch_printf(fin, "GET %s HTTP/1.1\r\n", ui->path);
-	print_host(fin, ui->host);
-
-	if ((ui->utype == HTTP_URL_T && ui->portnum != HTTP_PORT) ||
-	(ui->utype == HTTPS_URL_T && ui->portnum != HTTPS_PORT))
-		fetch_printf(fin, ":%u", ui->portnum);
-
-	fetch_printf(fin, "\r\n");
+	print_host(fin, ui);
 	fetch_printf(fin, "Accept: */*\r\n");
 	fetch_printf(fin, "Connection: close\r\n");
 	if (restart_point) {
@@ -793,10 +791,10 @@ getmtime(const char *cp, time_t *mtime)
 }
 
 static int
-print_proxy(FETCH *fin, const char *leading,
-const char *wwwauth, const char *proxyauth)
+print_proxy(FETCH *fin, int hasleading, const char *wwwauth,
+const char *proxyauth)
 {
-	int hasleading = 0;
+	const char *leading = hasleading ? ", " : "  (";
 
 	if (wwwauth) {
 		if (verbose) {
@@ -1109,12 +1107,10 @@ out:
 #ifdef WITH_SSL
 static int
 connectmethod(int s, FETCH *fin, struct urlinfo *oui, struct urlinfo *ui,
-struct authinfo *wauth, struct authinfo *pauth,
-char **auth, int *hasleading)
+struct authinfo *pauth, char **auth, int *hasleading)
 {
 	void *ssl;
 	int hcode, rv;
-	const char *leading = *hasleading ? ", " : "  (";
 	const char *cp;
 	char buf[FTPBUFLEN], *ep;
 	char *message = NULL;
@@ -1142,27 +1138,10 @@ connectmethod(int s, FETCH *fin, struct 
 	}
 
 	print_agent(fin);
-	*hasleading = print_proxy(fin, leading, wauth->auth, pauth->auth);
-
-	if (verbose) {
-		leading = ", ";
-		(*hasleading)++;
-	} else {
-		leading = "  (";
-		*hasleading = 0;
-	}
-	if (pauth->auth) {
-		if (verbose) {
-			fprintf(ttyout, "%swith proxy authorization" , leading);
-			leading = ", ";
-			(*hasleading)++;
-		}
-		fetch_printf(fin, "Proxy-Authorization: %s\r\n", pauth->auth);
-	}
+	*hasleading = print_proxy(fin, *hasleading, NULL, pauth->auth);
 
 	if (verbose && *hasleading)
 		fputs(")\n", ttyout);
-	leading = "  (";
 	*hasleading = 0;
 
 	fetch_printf(fin, "\r\n");
@@ -1217,14 +1196,10 @@ connectmethod(int s, FETCH *fin, struct 
 		goto cleanup_fetch_url;
 	}
 
-	if 

CVS commit: src/sys

2015-12-16 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu Dec 17 02:38:33 UTC 2015

Modified Files:
src/sys/net: if_llatbl.h
src/sys/netinet: if_arp.c

Log Message:
Fix memory leak of llentry#la_opaque

llentry#la_opaque which is for token ring is allocated in arp.c
and freed in arp.c when freeing llentry. However, llentry can be
freed from other places, e.g., lltable_free. In such cases,
la_opaque is never freed.

To fix that, add a new callback (lle_ll_free) to llentry and
register a destruction function of la_opque to it. On freeing a
llentry, we can surely free la_opque via the callback.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/net/if_llatbl.h
cvs rdiff -u -r1.197 -r1.198 src/sys/netinet/if_arp.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_llatbl.h
diff -u src/sys/net/if_llatbl.h:1.6 src/sys/net/if_llatbl.h:1.7
--- src/sys/net/if_llatbl.h:1.6	Wed Nov 25 06:21:26 2015
+++ src/sys/net/if_llatbl.h	Thu Dec 17 02:38:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_llatbl.h,v 1.6 2015/11/25 06:21:26 ozaki-r Exp $	*/
+/*	$NetBSD: if_llatbl.h,v 1.7 2015/12/17 02:38:33 ozaki-r Exp $	*/
 /*
  * Copyright (c) 2004 Luigi Rizzo, Alessandro Cerri. All rights reserved.
  * Copyright (c) 2004-2008 Qing Li. All rights reserved.
@@ -79,6 +79,7 @@ struct llentry {
 	struct lltable		 *lle_tbl;
 	struct llentries	 *lle_head;
 	void			(*lle_free)(struct llentry *);
+	void			(*lle_ll_free)(struct llentry *);
 	struct mbuf		 *la_hold;
 	int			 la_numheld;  /* # of packets currently held */
 	time_t			 la_expire;
@@ -202,9 +203,11 @@ struct llentry {
 } while (0)
 
 #define	LLE_FREE_LOCKED(lle) do {\
-	if ((lle)->lle_refcnt == 1)\
+	if ((lle)->lle_refcnt == 1) {\
+		if ((lle)->lle_ll_free != NULL)			\
+			(lle)->lle_ll_free(lle);		\
 		(lle)->lle_free(lle);\
-	else {			\
+	} else {		\
 		LLE_REMREF(lle);\
 		LLE_WUNLOCK(lle);\
 	}			\

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.197 src/sys/netinet/if_arp.c:1.198
--- src/sys/netinet/if_arp.c:1.197	Wed Dec 16 05:44:59 2015
+++ src/sys/netinet/if_arp.c	Thu Dec 17 02:38:33 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.197 2015/12/16 05:44:59 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.198 2015/12/17 02:38:33 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.197 2015/12/16 05:44:59 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.198 2015/12/17 02:38:33 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -175,6 +175,11 @@ static void arp_dad_start(struct ifaddr 
 static void arp_dad_stop(struct ifaddr *);
 static void arp_dad_duplicated(struct ifaddr *);
 
+static void arp_init_llentry(struct ifnet *, struct llentry *);
+#if NTOKEN > 0
+static void arp_free_llentry_tokenring(struct llentry *);
+#endif
+
 struct	ifqueue arpintrq = {
 	.ifq_head = NULL,
 	.ifq_tail = NULL,
@@ -424,6 +429,30 @@ arp_setgate(struct rtentry *rt, struct s
 	return gate;
 }
 
+static void
+arp_init_llentry(struct ifnet *ifp, struct llentry *lle)
+{
+
+	switch (ifp->if_type) {
+#if NTOKEN > 0
+	case IFT_ISO88025:
+		lle->la_opaque = kmem_intr_alloc(sizeof(struct token_rif),
+		KM_NOSLEEP);
+		lle->lle_ll_free = arp_free_llentry_tokenring;
+		break;
+#endif
+	}
+}
+
+#if NTOKEN > 0
+static void
+arp_free_llentry_tokenring(struct llentry *lle)
+{
+
+	kmem_intr_free(lle->la_opaque, sizeof(struct token_rif));
+}
+#endif
+
 /*
  * Parallel to llc_rtrequest.
  */
@@ -646,20 +675,11 @@ arp_rtrequest(int req, struct rtentry *r
 		}
 		rt->rt_llinfo = la;
 		LLE_ADDREF(la);
-		switch (ifp->if_type) {
-#if NTOKEN > 0
-		case IFT_ISO88025:
-			la->la_opaque = kmem_alloc(sizeof(struct token_rif),
-			KM_SLEEP);
-			break;
-#endif /* NTOKEN > 0 */
-		default:
-			break;
-		}
 		la->la_rt = rt;
 		rt->rt_refcnt++;
 		rt->rt_flags |= RTF_LLINFO;
 		arp_inuse++, arp_allocated++;
+		arp_init_llentry(ifp, la);
 
 		LLE_WUNLOCK(la);
 		la = NULL;
@@ -682,19 +702,6 @@ arp_rtrequest(int req, struct rtentry *r
 		IF_AFDATA_WLOCK(ifp);
 		LLE_WLOCK(la);
 
-		if (la->la_opaque != NULL) {
-			switch (ifp->if_type) {
-#if NTOKEN > 0
-			case IFT_ISO88025:
-kmem_free(la->la_opaque,
-sizeof(struct token_rif));
-break;
-#endif /* NTOKEN > 0 */
-			default:
-break;
-			}
-		}
-
 		if (la->la_rt != NULL) {
 			/*
 			 * Don't rtfree (may actually free objects) here.



CVS commit: src/doc

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 17 04:04:39 UTC 2015

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
new bind


To generate a diff of this commit:
cvs rdiff -u -r1.1267 -r1.1268 src/doc/3RDPARTY
cvs rdiff -u -r1.2118 -r1.2119 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.1267 src/doc/3RDPARTY:1.1268
--- src/doc/3RDPARTY:1.1267	Sun Dec  6 16:54:26 2015
+++ src/doc/3RDPARTY	Wed Dec 16 23:04:39 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1267 2015/12/06 21:54:26 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1268 2015/12/17 04:04:39 christos Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -114,8 +114,8 @@ Notes:
 bc includes dc, both of which are in the NetBSD tree.
 
 Package:	bind [named and utils]
-Version:	9.10.2-P4
-Current Vers:	9.10.2-P4
+Version:	9.10.3-P2
+Current Vers:	9.10.3-P2
 Maintainer:	Paul Vixie <vi...@vix.com>
 Archive Site:	ftp://ftp.isc.org/isc/bind9/
 Home Page:	http://www.isc.org/software/bind/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2118 src/doc/CHANGES:1.2119
--- src/doc/CHANGES:1.2118	Wed Dec 16 03:08:22 2015
+++ src/doc/CHANGES	Wed Dec 16 23:04:39 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2118 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2119 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -227,3 +227,4 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	ip6addrctl: Import from FreeBSD [christos 20151212]
 	adm1026hm(4): Add driver for ADM1026 i2c hardware monitor
 		[jdc 20151216]
+	bind: Import version 9.10.3-P2. [christos 20151216]



CVS commit: src/distrib/sets/lists

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec 17 04:03:42 UTC 2015

Modified Files:
src/distrib/sets/lists/base: shl.mi
src/distrib/sets/lists/debug: shl.mi

Log Message:
bump bind libraries.


To generate a diff of this commit:
cvs rdiff -u -r1.755 -r1.756 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.117 -r1.118 src/distrib/sets/lists/debug/shl.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/shl.mi
diff -u src/distrib/sets/lists/base/shl.mi:1.755 src/distrib/sets/lists/base/shl.mi:1.756
--- src/distrib/sets/lists/base/shl.mi:1.755	Sat Nov 21 23:44:30 2015
+++ src/distrib/sets/lists/base/shl.mi	Wed Dec 16 23:03:42 2015
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.755 2015/11/22 04:44:30 kamil Exp $
+# $NetBSD: shl.mi,v 1.756 2015/12/17 04:03:42 christos Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -191,7 +191,7 @@
 ./usr/lib/libbfd.so.13.0			base-sys-shlib		compatfile,binutils
 ./usr/lib/libbind9.sobase-bind-shlib		compatfile
 ./usr/lib/libbind9.so.8base-bind-shlib		compatfile
-./usr/lib/libbind9.so.8.2			base-bind-shlib		compatfile
+./usr/lib/libbind9.so.8.3			base-bind-shlib		compatfile
 ./usr/lib/libblacklist.so			base-sys-shlib		compatfile
 ./usr/lib/libblacklist.so.0			base-sys-shlib		compatfile
 ./usr/lib/libblacklist.so.0.0			base-sys-shlib		compatfile
@@ -235,7 +235,7 @@
 ./usr/lib/libcurses.so.7.0			base-sys-shlib		compatfile
 ./usr/lib/libdes.sobase-crypto-shlib	compatfile,crypto
 ./usr/lib/libdes.so.8base-crypto-shlib	compatfile,crypto
-./usr/lib/libdes.so.8.2base-crypto-shlib	compatfile,crypto
+./usr/lib/libdes.so.8.3base-crypto-shlib	compatfile,crypto
 ./usr/lib/libdevmapper.so			base-lvm-shlib		compatfile,lvm
 ./usr/lib/libdevmapper.so.1			base-lvm-shlib		compatfile,lvm
 ./usr/lib/libdevmapper.so.1.0			base-lvm-shlib		compatfile,lvm
@@ -244,7 +244,7 @@
 ./usr/lib/libdm.so.0.0base-sys-shlib		compatfile
 ./usr/lib/libdns.sobase-bind-shlib		compatfile
 ./usr/lib/libdns.so.8base-bind-shlib		compatfile
-./usr/lib/libdns.so.8.2base-bind-shlib		compatfile
+./usr/lib/libdns.so.8.3base-bind-shlib		compatfile
 ./usr/lib/libdns_sd.sobase-mdns-shlib		compatfile,mdns
 ./usr/lib/libdns_sd.so.0			base-mdns-shlib		compatfile,mdns
 ./usr/lib/libdns_sd.so.0.0			base-mdns-shlib		compatfile,mdns
@@ -313,16 +313,16 @@
 ./usr/lib/libipsec.so.3.0			base-net-shlib		compatfile
 ./usr/lib/libirs.sobase-bind-shlib		compatfile
 ./usr/lib/libirs.so.8base-bind-shlib		compatfile
-./usr/lib/libirs.so.8.2base-bind-shlib		compatfile
+./usr/lib/libirs.so.8.3base-bind-shlib		compatfile
 ./usr/lib/libisc.sobase-bind-shlib		compatfile
 ./usr/lib/libisc.so.8base-bind-shlib		compatfile
-./usr/lib/libisc.so.8.2base-bind-shlib		compatfile
+./usr/lib/libisc.so.8.3base-bind-shlib		compatfile
 ./usr/lib/libisccc.sobase-bind-shlib		compatfile
 ./usr/lib/libisccc.so.8base-bind-shlib		compatfile
-./usr/lib/libisccc.so.8.2			base-bind-shlib		compatfile
+./usr/lib/libisccc.so.8.3			base-bind-shlib		compatfile
 ./usr/lib/libisccfg.sobase-bind-shlib		compatfile
 ./usr/lib/libisccfg.so.8			base-bind-shlib		compatfile
-./usr/lib/libisccfg.so.8.2			base-bind-shlib		compatfile
+./usr/lib/libisccfg.so.8.3			base-bind-shlib		compatfile
 ./usr/lib/libiscsi.sobase-iscsi-shlib	iscsi,compatfile
 ./usr/lib/libiscsi.so.2base-iscsi-shlib	iscsi,compatfile
 ./usr/lib/libiscsi.so.2.0			base-iscsi-shlib	iscsi,compatfile
@@ -370,7 +370,7 @@
 ./usr/lib/liblutok.so.2.0			base-sys-shlib		kyua,compatfile
 ./usr/lib/liblwres.sobase-bind-shlib		compatfile
 ./usr/lib/liblwres.so.8base-bind-shlib		compatfile
-./usr/lib/liblwres.so.8.2			base-bind-shlib		compatfile
+./usr/lib/liblwres.so.8.3			base-bind-shlib		compatfile
 ./usr/lib/liblzf.sobase-sys-shlib		compatfile
 ./usr/lib/liblzf.so.1base-sys-shlib		compatfile
 ./usr/lib/liblzf.so.1.0base-sys-shlib		compatfile

Index: src/distrib/sets/lists/debug/shl.mi
diff -u src/distrib/sets/lists/debug/shl.mi:1.117 src/distrib/sets/lists/debug/shl.mi:1.118
--- src/distrib/sets/lists/debug/shl.mi:1.117	Sat Nov 21 23:44:30 2015
+++ src/distrib/sets/lists/debug/shl.mi	Wed Dec 16 23:03:42 2015
@@ -1,4 +1,4 @@
-# $NetBSD: shl.mi,v 1.117 2015/11/22 04:44:30 kamil Exp $
+# $NetBSD: shl.mi,v 1.118 2015/12/17 04:03:42 christos Exp $
 ./usr/libdata/debug/lib		base-sys-usr	debug,dynamicroot,compatdir
 ./usr/libdata/debug/lib/libblacklist.so.0.0.debug		comp-sys-debug	debug,dynamicroot
 ./usr/libdata/debug/lib/libc.so.12.199.debug			comp-sys-debug	debug,dynamicroot
@@ -61,7 +61,7 @@
 ./usr/libdata/debug/usr/lib/libatf-c.so.0.0.debug		comp-atf-debug	debug,compatfile,atf
 ./usr/libdata/debug/usr/lib/libavl.so.0.0.debug			comp-zfs-debug	debug,compatfile,zfs
 

CVS commit: src/sys/dev

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 12:22:48 UTC 2015

Modified Files:
src/sys/dev/fdt: files.fdt
src/sys/dev/ofw: files.ofw

Log Message:
fix FDT build without openfirm pseudo-device


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/fdt/files.fdt
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ofw/files.ofw

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/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.3 src/sys/dev/fdt/files.fdt:1.4
--- src/sys/dev/fdt/files.fdt:1.3	Wed Dec 16 12:03:44 2015
+++ src/sys/dev/fdt/files.fdt	Wed Dec 16 12:22:48 2015
@@ -1,8 +1,8 @@
-# $NetBSD: files.fdt,v 1.3 2015/12/16 12:03:44 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.4 2015/12/16 12:22:48 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
-defflag	opt_fdt.hFDT: libfdt
+defflag	opt_fdt.hFDT: libfdt, ofw_subr
 
 define	fdtbus { }
 

Index: src/sys/dev/ofw/files.ofw
diff -u src/sys/dev/ofw/files.ofw:1.13 src/sys/dev/ofw/files.ofw:1.14
--- src/sys/dev/ofw/files.ofw:1.13	Mon Jan  8 06:43:09 2007
+++ src/sys/dev/ofw/files.ofw	Wed Dec 16 12:22:48 2015
@@ -1,15 +1,16 @@
-#	$NetBSD: files.ofw,v 1.13 2007/01/08 06:43:09 macallan Exp $
+#	$NetBSD: files.ofw,v 1.14 2015/12/16 12:22:48 jmcneill Exp $
 #
 # First cut on Openfirmware interface
 #
 
 define	ofbus {}
 define	of_network_dev
+define	ofw_subr
 
 defpseudo openfirm
 file	dev/ofw/openfirmio.c		openfirm needs-flag
 
-file	dev/ofw/ofw_subr.c		ofbus | openfirm
+file	dev/ofw/ofw_subr.c		ofbus | openfirm | ofw_subr
 
 file	dev/ofw/ofw_network_subr.c	of_network_dev
 



CVS commit: src/sys/dev/fdt

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 12:03:45 UTC 2015

Modified Files:
src/sys/dev/fdt: fdt_subr.c files.fdt
Added Files:
src/sys/dev/fdt: fdt_gpio.c fdt_i2c.c fdt_intr.c fdt_regulator.c

Log Message:
split gpio, i2c, intr, and regulator helpers into separate files


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/fdt_gpio.c src/sys/dev/fdt/fdt_i2c.c \
src/sys/dev/fdt/fdt_intr.c src/sys/dev/fdt/fdt_regulator.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdt_subr.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/files.fdt

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/fdt/fdt_subr.c
diff -u src/sys/dev/fdt/fdt_subr.c:1.1 src/sys/dev/fdt/fdt_subr.c:1.2
--- src/sys/dev/fdt/fdt_subr.c:1.1	Sun Dec 13 17:30:40 2015
+++ src/sys/dev/fdt/fdt_subr.c	Wed Dec 16 12:03:44 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_subr.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $ */
+/* $NetBSD: fdt_subr.c,v 1.2 2015/12/16 12:03:44 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v 1.2 2015/12/16 12:03:44 jmcneill Exp $");
 
 #include 
 #include 
@@ -38,46 +38,6 @@ __KERNEL_RCSID(0, "$NetBSD: fdt_subr.c,v
 #include 
 #include 
 
-struct fdtbus_interrupt_controller {
-	device_t ic_dev;
-	int ic_phandle;
-	const struct fdtbus_interrupt_controller_func *ic_funcs;
-
-	struct fdtbus_interrupt_controller *ic_next;
-};
-
-static struct fdtbus_interrupt_controller *fdtbus_ic = NULL;
-
-struct fdtbus_i2c_controller {
-	device_t i2c_dev;
-	int i2c_phandle;
-	const struct fdtbus_i2c_controller_func *i2c_funcs;
-
-	struct fdtbus_i2c_controller *i2c_next;
-};
-
-static struct fdtbus_i2c_controller *fdtbus_i2c = NULL;
-
-struct fdtbus_gpio_controller {
-	device_t gc_dev;
-	int gc_phandle;
-	const struct fdtbus_gpio_controller_func *gc_funcs;
-
-	struct fdtbus_gpio_controller *gc_next;
-};
-
-static struct fdtbus_gpio_controller *fdtbus_gc = NULL;
-
-struct fdtbus_regulator_controller {
-	device_t rc_dev;
-	int rc_phandle;
-	const struct fdtbus_regulator_controller_func *rc_funcs;
-
-	struct fdtbus_regulator_controller *rc_next;
-};
-
-static struct fdtbus_regulator_controller *fdtbus_rc = NULL;
-
 static int
 fdtbus_get_addr_cells(int phandle)
 {
@@ -116,336 +76,6 @@ fdtbus_get_size_cells(int phandle)
 	return size_cells;
 }
 
-static int
-fdtbus_get_interrupt_parent(int phandle)
-{
-	u_int interrupt_parent;
-	int len;
-
-	while (phandle >= 0) {
-		len = OF_getprop(phandle, "interrupt-parent",
-		_parent, sizeof(interrupt_parent));
-		if (len == sizeof(interrupt_parent)) {
-			break;
-		}
-		if (phandle == 0) {
-			return -1;
-		}
-		phandle = OF_parent(phandle);
-	}
-	if (phandle < 0) {
-		return -1;
-	}
-
-	interrupt_parent = fdt32_to_cpu(interrupt_parent);
-
-	const void *data = fdt_openfirm_get_data();
-	const int off = fdt_node_offset_by_phandle(data, interrupt_parent);
-	if (off < 0) {
-		return -1;
-	}
-
-	return fdt_openfirm_get_phandle(off);
-}
-
-static struct fdtbus_interrupt_controller *
-fdtbus_get_interrupt_controller(int phandle)
-{
-	struct fdtbus_interrupt_controller *ic;
-
-	const int ic_phandle = fdtbus_get_interrupt_parent(phandle);
-	if (ic_phandle < 0) {
-		return NULL;
-	}
-
-	for (ic = fdtbus_ic; ic; ic = ic->ic_next) {
-		if (ic->ic_phandle == ic_phandle) {
-			return ic;
-		}
-	}
-
-	return NULL;
-}
-
-int
-fdtbus_register_interrupt_controller(device_t dev, int phandle,
-const struct fdtbus_interrupt_controller_func *funcs)
-{
-	struct fdtbus_interrupt_controller *ic;
-
-	ic = kmem_alloc(sizeof(*ic), KM_SLEEP);
-	ic->ic_dev = dev;
-	ic->ic_phandle = phandle;
-	ic->ic_funcs = funcs;
-
-	ic->ic_next = fdtbus_ic;
-	fdtbus_ic = ic;
-
-	return 0;
-}
-
-void *
-fdtbus_intr_establish(int phandle, u_int index, int ipl, int flags,
-int (*func)(void *), void *arg)
-{
-	struct fdtbus_interrupt_controller *ic;
-
-	ic = fdtbus_get_interrupt_controller(phandle);
-	if (ic == NULL)
-		return NULL;
-
-	return ic->ic_funcs->establish(ic->ic_dev, phandle, index, ipl,
-	flags, func, arg);
-}
-
-void
-fdtbus_intr_disestablish(int phandle, void *ih)
-{
-	struct fdtbus_interrupt_controller *ic;
-
-	ic = fdtbus_get_interrupt_controller(phandle);
-	KASSERT(ic != NULL);
-
-	return ic->ic_funcs->disestablish(ic->ic_dev, ih);
-}
-
-bool
-fdtbus_intr_str(int phandle, u_int index, char *buf, size_t buflen)
-{
-	struct fdtbus_interrupt_controller *ic;
-
-	ic = fdtbus_get_interrupt_controller(phandle);
-	if (ic == NULL)
-		return false;
-
-	return ic->ic_funcs->intrstr(ic->ic_dev, phandle, index, buf, buflen);
-}
-
-int
-fdtbus_register_gpio_controller(device_t dev, int phandle,
-const struct fdtbus_gpio_controller_func *funcs)
-{
-	struct fdtbus_gpio_controller *gc;
-
-	gc 

CVS commit: src/sys/arch/evbarm/exynos

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 12:18:34 UTC 2015

Modified Files:
src/sys/arch/evbarm/exynos: exynos_machdep.c

Log Message:
fdt_openfirm_set_data -> fdtbus_set_data


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/exynos/exynos_machdep.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/evbarm/exynos/exynos_machdep.c
diff -u src/sys/arch/evbarm/exynos/exynos_machdep.c:1.4 src/sys/arch/evbarm/exynos/exynos_machdep.c:1.5
--- src/sys/arch/evbarm/exynos/exynos_machdep.c:1.4	Mon Dec 14 22:06:57 2015
+++ src/sys/arch/evbarm/exynos/exynos_machdep.c	Wed Dec 16 12:18:34 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: exynos_machdep.c,v 1.4 2015/12/14 22:06:57 marty Exp $ */
+/*	$NetBSD: exynos_machdep.c,v 1.5 2015/12/16 12:18:34 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_machdep.c,v 1.4 2015/12/14 22:06:57 marty Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_machdep.c,v 1.5 2015/12/16 12:18:34 jmcneill Exp $");
 
 #include "opt_evbarm_boardtype.h"
 #include "opt_exynos.h"
@@ -105,8 +105,6 @@ __KERNEL_RCSID(0, "$NetBSD: exynos_machd
  * made into a linux (not netbsd) uboot image.
  */
 #include 
-#include 
-#include 
 #include 
 #define FDT_BUF_SIZE	(128*1024)
 static uint8_t fdt_data[FDT_BUF_SIZE];
@@ -412,7 +410,7 @@ initarm(void *arg)
 		if (error != 0) {
 			panic("fdt_move failed: %s", fdt_strerror(error));
 		}
-		fdt_openfirm_set_data(fdt_data);
+		fdtbus_set_data(fdt_data);
 	} else {
 		panic("fdt_check_header failed: %s", fdt_strerror(error));
 	}



CVS commit: src/sys/arch/evbarm/conf

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 12:26:15 UTC 2015

Modified Files:
src/sys/arch/evbarm/conf: TEGRA std.tegra

Log Message:
move options FDT to std.tegra


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/TEGRA
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/evbarm/conf/std.tegra

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/evbarm/conf/TEGRA
diff -u src/sys/arch/evbarm/conf/TEGRA:1.4 src/sys/arch/evbarm/conf/TEGRA:1.5
--- src/sys/arch/evbarm/conf/TEGRA:1.4	Tue Dec 15 15:35:10 2015
+++ src/sys/arch/evbarm/conf/TEGRA	Wed Dec 16 12:26:14 2015
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: TEGRA,v 1.4 2015/12/15 15:35:10 jmcneill Exp $
+#	$NetBSD: TEGRA,v 1.5 2015/12/16 12:26:14 jmcneill Exp $
 #
 #	NVIDIA Tegra K1 (T124)
 #
@@ -11,7 +11,6 @@ options 	CPU_CORTEXA15
 options 	SOC_TEGRA124
 options 	MULTIPROCESSOR
 
-options 	FDT		# Flattened Device Tree support
 pseudo-device 	openfirm	# /dev/openfirm
 
 options 	DIAGNOSTIC	# internal consistency checks

Index: src/sys/arch/evbarm/conf/std.tegra
diff -u src/sys/arch/evbarm/conf/std.tegra:1.10 src/sys/arch/evbarm/conf/std.tegra:1.11
--- src/sys/arch/evbarm/conf/std.tegra:1.10	Wed Nov 25 08:39:45 2015
+++ src/sys/arch/evbarm/conf/std.tegra	Wed Dec 16 12:26:14 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: std.tegra,v 1.10 2015/11/25 08:39:45 skrll Exp $
+#	$NetBSD: std.tegra,v 1.11 2015/12/16 12:26:14 jmcneill Exp $
 #
 
 machine	evbarm arm
@@ -6,6 +6,7 @@ include 	"arch/evbarm/conf/std.evbarm"
 
 include		"arch/evbarm/conf/files.tegra"
 
+options 	FDT# Flattened Device Tree support
 options 	MODULAR
 options 	MODULAR_DEFAULT_AUTOLOAD
 options 	__HAVE_CPU_COUNTER



CVS commit: src/crypto/external/bsd/openssh/dist

2015-12-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 16 13:23:38 UTC 2015

Modified Files:
src/crypto/external/bsd/openssh/dist: sftp.c

Log Message:
PR/50564: Rin Okuyama: sftp: filename completion is broken


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/crypto/external/bsd/openssh/dist/sftp.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/external/bsd/openssh/dist/sftp.c
diff -u src/crypto/external/bsd/openssh/dist/sftp.c:1.16 src/crypto/external/bsd/openssh/dist/sftp.c:1.17
--- src/crypto/external/bsd/openssh/dist/sftp.c:1.16	Fri Aug 21 04:20:59 2015
+++ src/crypto/external/bsd/openssh/dist/sftp.c	Wed Dec 16 08:23:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: sftp.c,v 1.16 2015/08/21 08:20:59 christos Exp $	*/
+/*	$NetBSD: sftp.c,v 1.17 2015/12/16 13:23:38 christos Exp $	*/
 /* $OpenBSD: sftp.c,v 1.171 2015/08/20 22:32:42 deraadt Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller 
@@ -17,7 +17,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: sftp.c,v 1.16 2015/08/21 08:20:59 christos Exp $");
+__RCSID("$NetBSD: sftp.c,v 1.17 2015/12/16 13:23:38 christos Exp $");
 #include 	/* MIN MAX */
 #include 
 #include 
@@ -1845,8 +1845,8 @@ complete_match(EditLine *el, struct sftp
 	if (remote != LOCAL) {
 		tmp = make_absolute(tmp, remote_path);
 		remote_glob(conn, tmp, GLOB_DOOFFS|GLOB_MARK, NULL, );
+	} else
 		glob(tmp, GLOB_LIMIT|GLOB_DOOFFS|GLOB_MARK, NULL, );
-	}
 	
 	/* Determine length of pwd so we can trim completion display */
 	for (hadglob = tmplen = pwdlen = 0; tmp[tmplen] != 0; tmplen++) {



CVS commit: src/sys/dev/fdt

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 12:17:45 UTC 2015

Modified Files:
src/sys/dev/fdt: fdt_gpio.c fdt_i2c.c fdt_intr.c fdt_openfirm.c
fdt_regulator.c fdt_subr.c fdtvar.h
Removed Files:
src/sys/dev/fdt: fdt_openfirm.h

Log Message:
Only OF_* functions should be in fdt_openfirm.c, move the rest to fdt_subr.c.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/fdt_gpio.c src/sys/dev/fdt/fdt_i2c.c \
src/sys/dev/fdt/fdt_intr.c src/sys/dev/fdt/fdt_openfirm.c \
src/sys/dev/fdt/fdt_regulator.c src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.1 -r0 src/sys/dev/fdt/fdt_openfirm.h
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/fdt/fdt_subr.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/fdt/fdt_gpio.c
diff -u src/sys/dev/fdt/fdt_gpio.c:1.1 src/sys/dev/fdt/fdt_gpio.c:1.2
--- src/sys/dev/fdt/fdt_gpio.c:1.1	Wed Dec 16 12:03:44 2015
+++ src/sys/dev/fdt/fdt_gpio.c	Wed Dec 16 12:17:45 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_gpio.c,v 1.1 2015/12/16 12:03:44 jmcneill Exp $ */
+/* $NetBSD: fdt_gpio.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,15 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_gpio.c,v 1.1 2015/12/16 12:03:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_gpio.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $");
 
 #include 
 #include 
 #include 
 
 #include 
-#include 
-#include 
 #include 
 
 struct fdtbus_gpio_controller {
Index: src/sys/dev/fdt/fdt_i2c.c
diff -u src/sys/dev/fdt/fdt_i2c.c:1.1 src/sys/dev/fdt/fdt_i2c.c:1.2
--- src/sys/dev/fdt/fdt_i2c.c:1.1	Wed Dec 16 12:03:44 2015
+++ src/sys/dev/fdt/fdt_i2c.c	Wed Dec 16 12:17:45 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_i2c.c,v 1.1 2015/12/16 12:03:44 jmcneill Exp $ */
+/* $NetBSD: fdt_i2c.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,15 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.1 2015/12/16 12:03:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_i2c.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $");
 
 #include 
 #include 
 #include 
 
 #include 
-#include 
-#include 
 #include 
 
 struct fdtbus_i2c_controller {
Index: src/sys/dev/fdt/fdt_intr.c
diff -u src/sys/dev/fdt/fdt_intr.c:1.1 src/sys/dev/fdt/fdt_intr.c:1.2
--- src/sys/dev/fdt/fdt_intr.c:1.1	Wed Dec 16 12:03:44 2015
+++ src/sys/dev/fdt/fdt_intr.c	Wed Dec 16 12:17:45 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_intr.c,v 1.1 2015/12/16 12:03:44 jmcneill Exp $ */
+/* $NetBSD: fdt_intr.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,15 +27,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.1 2015/12/16 12:03:44 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_intr.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $");
 
 #include 
 #include 
 #include 
 
 #include 
-#include 
-#include 
 #include 
 
 struct fdtbus_interrupt_controller {
@@ -71,13 +69,13 @@ fdtbus_get_interrupt_parent(int phandle)
 
 	interrupt_parent = fdt32_to_cpu(interrupt_parent);
 
-	const void *data = fdt_openfirm_get_data();
+	const void *data = fdtbus_get_data();
 	const int off = fdt_node_offset_by_phandle(data, interrupt_parent);
 	if (off < 0) {
 		return -1;
 	}
 
-	return fdt_openfirm_get_phandle(off);
+	return fdtbus_offset2phandle(off);
 }
 
 static struct fdtbus_interrupt_controller *
Index: src/sys/dev/fdt/fdt_openfirm.c
diff -u src/sys/dev/fdt/fdt_openfirm.c:1.1 src/sys/dev/fdt/fdt_openfirm.c:1.2
--- src/sys/dev/fdt/fdt_openfirm.c:1.1	Sun Dec 13 17:30:40 2015
+++ src/sys/dev/fdt/fdt_openfirm.c	Wed Dec 16 12:17:45 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: fdt_openfirm.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $ */
+/* $NetBSD: fdt_openfirm.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,59 +27,17 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fdt_openfirm.c,v 1.1 2015/12/13 17:30:40 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fdt_openfirm.c,v 1.2 2015/12/16 12:17:45 jmcneill Exp $");
 
 #include 
 
 #include 
-#include 
-#include 
-
-static const void *fdt_data;
-
-bool
-fdt_openfirm_set_data(const void *data)
-{
-	KASSERT(fdt_data == NULL);
-	if (fdt_check_header(data) != 0) {
-		return false;
-	}
-	fdt_data = data;
-	return true;
-}
-
-const void *
-fdt_openfirm_get_data(void)
-{
-	return fdt_data;
-}
-
-int
-fdt_openfirm_get_phandle(int offset)
-{
-	if (offset < 0)
-		return 0;
-
-	return offset + fdt_off_dt_struct(fdt_data);
-}
-
-int
-fdt_openfirm_get_offset(int phandle)
-{
-	const int dtoff = fdt_off_dt_struct(fdt_data);
-
-	if (phandle == -1)
-		phandle = dtoff;
-
-	if (phandle < dtoff)
-		return -1;
-
-	return phandle - dtoff;
-}
+#include 
 
 int
 OF_peer(int phandle)
 {
+	const void *fdt_data 

CVS commit: src/sys/arch/evbarm/tegra

2015-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Dec 16 12:18:02 UTC 2015

Modified Files:
src/sys/arch/evbarm/tegra: tegra_machdep.c

Log Message:
fdt_openfirm_set_data -> fdtbus_set_data


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/evbarm/tegra/tegra_machdep.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/evbarm/tegra/tegra_machdep.c
diff -u src/sys/arch/evbarm/tegra/tegra_machdep.c:1.35 src/sys/arch/evbarm/tegra/tegra_machdep.c:1.36
--- src/sys/arch/evbarm/tegra/tegra_machdep.c:1.35	Sun Dec 13 22:55:05 2015
+++ src/sys/arch/evbarm/tegra/tegra_machdep.c	Wed Dec 16 12:18:02 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: tegra_machdep.c,v 1.35 2015/12/13 22:55:05 jmcneill Exp $ */
+/* $NetBSD: tegra_machdep.c,v 1.36 2015/12/16 12:18:02 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.35 2015/12/13 22:55:05 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tegra_machdep.c,v 1.36 2015/12/16 12:18:02 jmcneill Exp $");
 
 #include "opt_tegra.h"
 #include "opt_machdep.h"
@@ -104,8 +104,6 @@ char *boot_args = NULL;
 u_int uboot_args[4] = { 0 };	/* filled in by tegra_start.S (not in bss) */
 
 #include 
-#include 
-#include 
 #include 
 #define FDT_BUF_SIZE	(128*1024)
 static uint8_t fdt_data[FDT_BUF_SIZE];
@@ -266,7 +264,7 @@ initarm(void *arg)
 		if (error != 0) {
 			panic("fdt_move failed: %s", fdt_strerror(error));
 		}
-		fdt_openfirm_set_data(fdt_data);
+		fdtbus_set_data(fdt_data);
 	} else {
 		panic("fdt_check_header failed: %s", fdt_strerror(error));
 	}



CVS commit: src/share/man/man4

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:24:30 UTC 2015

Added Files:
src/share/man/man4: adm1026hm.4
Removed Files:
src/share/man/man4: adm1026tm.4

Log Message:
Correct the name of the manual page (pointed out by wiz).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/man/man4/adm1026hm.4
cvs rdiff -u -r1.2 -r0 src/share/man/man4/adm1026tm.4

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

Added files:

Index: src/share/man/man4/adm1026hm.4
diff -u /dev/null src/share/man/man4/adm1026hm.4:1.1
--- /dev/null	Wed Dec 16 08:24:30 2015
+++ src/share/man/man4/adm1026hm.4	Wed Dec 16 08:24:30 2015
@@ -0,0 +1,83 @@
+.\"	$NetBSD: adm1026hm.4,v 1.1 2015/12/16 08:24:30 jdc Exp $
+.\"
+.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
+.\" All rights reserved.
+.\"
+.\" This code is derived from software contributed to The NetBSD Foundation
+.\" by Julian Coleman.
+.\"
+.\" 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, 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 December 11, 2015
+.Dt ADM1026HM 4
+.Os
+.Sh NAME
+.Nm adm1026hm
+.Nd Analog Devices ADM1026 complete thermal system management controller
+.Sh SYNOPSIS
+.Cd "adm1026hm* at iic0 addr 0x2e: ADM1026 hardware monitor: rev. 0x4, step. 0x5"
+.Cd "adm1026hm*: 8 fans, 3 temperatures, 15 voltages"
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for the Analog Devices ADM1026 hardware monitor.
+The chip possesses 8 fan speed sensors, 3 temperature sensors,
+and 17 voltage sensors.
+The number of each sensor type configured by the driver depends on the
+chip configuration.
+.Pp
+The values of the sensors are made available through the
+.Xr envstat 8
+interface.
+.Bl -column "V3.3 standby" "uV DC" "Description" -offset indent
+.It Sy "Sensor" Ta Sy "Units" Ta Sy "Description"
+.It Li "fan N" Ta "RPM" Ta "Fan 0-7"
+.It Li "internal" Ta "C" Ta "Internal temperature"
+.It Li "external N" Ta "C" Ta "External temperature 1\(en2"
+.It Li "Vbatt" Ta "mV DC" Ta "Battery voltage"
+.It Li "V3.3 standby" Ta "mV DC" Ta "3.3V standby voltage"
+.It Li "V3.3 main" Ta "mV DC" Ta "3.3V main voltage"
+.It Li "V5.0" Ta "mV DC" Ta "5.0V supply voltage"
+.It Li "V+12" Ta "mV DC" Ta "+12V supply voltage"
+.It Li "V-12" Ta "mV DC" Ta "-12V supply voltage"
+.It Li "V3.3 N" Ta "mV DC" Ta "Analog in (3.3V reference) 0\(en5"
+.It Li "V2.5 N" Ta "mV DC" Ta "Analog in (2.5V reference) 0\(en3"
+.El
+.Sh SEE ALSO
+.Xr iic 4 ,
+.Xr intro 4 ,
+.Xr envstat 8
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Julian Coleman Aq Mt jcole...@netbsd.org .
+.Sh BUGS
+It's not possible to determine if either a sensor is not connected,
+or the monitored device is producing no output.
+Therefore, unconnected sensors will show outputs of 0.
+.Pp
+The
+.Nm
+driver does not support checking or altering limit values, interrupt output,
+nor the built-in EEPROM.



CVS commit: src/sys/dev/ic

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:04:58 UTC 2015

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

Log Message:
Allow pcfiic to handle i2c writes using cmdbuf for the register, and buf for
the value to be written.  Prior to this, we would send an empty write command
to the correct i2c address, plus an empty write command to the device at the
i2c address of the first byte of buf.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/pcf8584.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/pcf8584.c
diff -u src/sys/dev/ic/pcf8584.c:1.11 src/sys/dev/ic/pcf8584.c:1.12
--- src/sys/dev/ic/pcf8584.c:1.11	Mon Jan 20 22:02:32 2014
+++ src/sys/dev/ic/pcf8584.c	Wed Dec 16 08:04:58 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcf8584.c,v 1.11 2014/01/20 22:02:32 jdc Exp $	*/
+/*	$NetBSD: pcf8584.c,v 1.12 2015/12/16 08:04:58 jdc Exp $	*/
 /*	$OpenBSD: pcf8584.c,v 1.9 2007/10/20 18:46:21 kettenis Exp $ */
 
 /*
@@ -175,14 +175,28 @@ pcfiic_i2c_exec(void *arg, i2c_op_t op, 
 	if (sc->sc_master)
 		pcfiic_choose_bus(sc, addr >> 7);
 
-	if (pcfiic_xmit(sc, addr & 0x7f, cmdbuf, cmdlen) != 0)
-		return (1);
-
-	if (len > 0) {
-		if (I2C_OP_WRITE_P(op))
-			ret = pcfiic_xmit(sc, addr & 0x7f, buf, len);
-		else
-			ret = pcfiic_recv(sc, addr & 0x7f, buf, len);
+	/*
+	 * If we are writing, write address, cmdbuf, buf.
+	 * If we are reading, write address, cmdbuf, then read address, buf.
+	 */
+	if (I2C_OP_WRITE_P(op)) {
+		if (len > 0) {
+			uint8_t *tmp;
+
+			tmp = malloc(cmdlen + len, M_DEVBUF,
+			   flags & I2C_F_POLL ? M_NOWAIT : M_WAITOK);
+			if (tmp == NULL)
+return (1);
+			memcpy(tmp, cmdbuf, cmdlen);
+			memcpy(tmp + cmdlen, buf, len);
+			ret = pcfiic_xmit(sc, addr & 0x7f, tmp, cmdlen + len);
+			free(tmp, M_DEVBUF);
+		} else
+			ret = pcfiic_xmit(sc, addr & 0x7f, cmdbuf, cmdlen);
+	} else {
+		if (pcfiic_xmit(sc, addr & 0x7f, cmdbuf, cmdlen) != 0)
+			return (1);
+		ret = pcfiic_recv(sc, addr & 0x7f, buf, len);
 	}
 	return (ret);
 }



CVS commit: src/sys/arch/sparc64/conf

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:00:00 UTC 2015

Modified Files:
src/sys/arch/sparc64/conf: GENERIC

Log Message:
Add adm1026hm* for V210, V240, and V440 environmental monitoring.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/sparc64/conf/GENERIC

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/sparc64/conf/GENERIC
diff -u src/sys/arch/sparc64/conf/GENERIC:1.182 src/sys/arch/sparc64/conf/GENERIC:1.183
--- src/sys/arch/sparc64/conf/GENERIC:1.182	Sat Sep 26 11:16:13 2015
+++ src/sys/arch/sparc64/conf/GENERIC	Wed Dec 16 08:00:00 2015
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.182 2015/09/26 11:16:13 maxv Exp $
+# $NetBSD: GENERIC,v 1.183 2015/12/16 08:00:00 jdc Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include	"arch/sparc64/conf/std.sparc64"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.182 $"
+#ident 		"GENERIC-$Revision: 1.183 $"
 
 maxusers	64
 
@@ -950,6 +950,7 @@ iic*		at alipm?
 
 spdmem*		at iic? addr?
 admtemp*	at iic? addr?
+adm1026hm*	at iic? addr?
 ecadc*		at iic? addr?	# envctrl/envctrltwo on E250/E450
 lmtemp*		at iic? addr?
 tda*		at iic? addr?	# fan control on SB1000/2000



CVS commit: src/sys/dev/i2c

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:05:38 UTC 2015

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

Log Message:
Add direct configuration support via compatible names.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/dev/i2c/dbcool.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/dbcool.c
diff -u src/sys/dev/i2c/dbcool.c:1.43 src/sys/dev/i2c/dbcool.c:1.44
--- src/sys/dev/i2c/dbcool.c:1.43	Thu Apr 23 23:23:00 2015
+++ src/sys/dev/i2c/dbcool.c	Wed Dec 16 08:05:38 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: dbcool.c,v 1.43 2015/04/23 23:23:00 pgoyette Exp $ */
+/*	$NetBSD: dbcool.c,v 1.44 2015/12/16 08:05:38 jdc Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.43 2015/04/23 23:23:00 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.44 2015/12/16 08:05:38 jdc Exp $");
 
 #include 
 #include 
@@ -731,6 +731,10 @@ static char dbcool_cur_behav[16];
 CFATTACH_DECL_NEW(dbcool, sizeof(struct dbcool_softc),
 dbcool_match, dbcool_attach, dbcool_detach, NULL);
 
+static const char * dbcool_compats[] = {
+	"i2c-adm1031",
+	NULL
+};
 int
 dbcool_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -742,12 +746,19 @@ dbcool_match(device_t parent, cfdata_t c
 	dc.dc_readreg = dbcool_readreg;
 	dc.dc_writereg = dbcool_writereg;
 
-	/* no probing if we attach to iic, but verify chip id  and address */
-	if ((ia->ia_addr & DBCOOL_ADDRMASK) != DBCOOL_ADDR)
-		return 0;
-	if (dbcool_chip_ident() >= 0)
-		return 1;
-
+	/* Direct config - match compats */
+	if (ia->ia_name) {
+		if (ia->ia_ncompat > 0) {
+			if (iic_compat_match(ia, dbcool_compats))
+return 1;
+		}
+	/* Indirect config - check address and chip ID */
+	} else {
+		if ((ia->ia_addr & DBCOOL_ADDRMASK) != DBCOOL_ADDR)
+			return 0;
+		if (dbcool_chip_ident() >= 0)
+			return 1;
+	}
 	return 0;
 }
 



CVS commit: src/doc

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:08:22 UTC 2015

Modified Files:
src/doc: CHANGES

Log Message:
Mention new ADM1026 i2c driver.


To generate a diff of this commit:
cvs rdiff -u -r1.2117 -r1.2118 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.2117 src/doc/CHANGES:1.2118
--- src/doc/CHANGES:1.2117	Sat Dec 12 23:43:36 2015
+++ src/doc/CHANGES	Wed Dec 16 08:08:22 2015
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2117 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2118 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -225,3 +225,5 @@ Changes from NetBSD 7.0 to NetBSD 8.0:
 	dhcpcd: Import dhcpcd 6.9.4. [roy 20151130]
 	openssl: Import openssl 1.0.1q [christos 20151206]
 	ip6addrctl: Import from FreeBSD [christos 20151212]
+	adm1026hm(4): Add driver for ADM1026 i2c hardware monitor
+		[jdc 20151216]



CVS commit: src/share/man/man4

2015-12-16 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec 16 08:16:18 UTC 2015

Modified Files:
src/share/man/man4: adm1026tm.4

Log Message:
Sort sections. Fix Dt.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/share/man/man4/adm1026tm.4

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/adm1026tm.4
diff -u src/share/man/man4/adm1026tm.4:1.1 src/share/man/man4/adm1026tm.4:1.2
--- src/share/man/man4/adm1026tm.4:1.1	Wed Dec 16 07:59:01 2015
+++ src/share/man/man4/adm1026tm.4	Wed Dec 16 08:16:18 2015
@@ -1,4 +1,4 @@
-.\"	$NetBSD: adm1026tm.4,v 1.1 2015/12/16 07:59:01 jdc Exp $
+.\"	$NetBSD: adm1026tm.4,v 1.2 2015/12/16 08:16:18 wiz Exp $
 .\"
 .\" Copyright (c) 2015 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
 .Dd December 11, 2015
-.Dt ADM1026HM
+.Dt ADM1026HM 4
 .Os
 .Sh NAME
 .Nm adm1026hm
@@ -66,6 +66,12 @@ interface.
 .Xr iic 4 ,
 .Xr intro 4 ,
 .Xr envstat 8
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Julian Coleman Aq Mt jcole...@netbsd.org .
 .Sh BUGS
 It's not possible to determine if either a sensor is not connected,
 or the monitored device is producing no output.
@@ -75,9 +81,3 @@ The
 .Nm
 driver does not support checking or altering limit values, interrupt output,
 nor the built-in EEPROM.
-.Sh AUTHORS
-.An -nosplit
-The
-.Nm
-driver was written by
-.An Julian Coleman Aq Mt jcole...@netbsd.org .



CVS commit: src/sys/arch/sparc64/sparc64

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:01:19 UTC 2015

Modified Files:
src/sys/arch/sparc64/sparc64: autoconf.c

Log Message:
Add V210/V240 environmental sensors that are not in the OFW tree.
Add device properties for adm1026hm on V210, V240, and V440.


To generate a diff of this commit:
cvs rdiff -u -r1.206 -r1.207 src/sys/arch/sparc64/sparc64/autoconf.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/sparc64/sparc64/autoconf.c
diff -u src/sys/arch/sparc64/sparc64/autoconf.c:1.206 src/sys/arch/sparc64/sparc64/autoconf.c:1.207
--- src/sys/arch/sparc64/sparc64/autoconf.c:1.206	Sun Dec 13 11:51:37 2015
+++ src/sys/arch/sparc64/sparc64/autoconf.c	Wed Dec 16 08:01:19 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.206 2015/12/13 11:51:37 jmcneill Exp $ */
+/*	$NetBSD: autoconf.c,v 1.207 2015/12/16 08:01:19 jdc Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -48,7 +48,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.206 2015/12/13 11:51:37 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.207 2015/12/16 08:01:19 jdc Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -1142,6 +1142,58 @@ noether:
 			prop_object_release(cfg);
 			
 		}
+
+		/*
+		 * Add V210/V240 environmental sensors that are not in
+		 * the OFW tree.
+		 */
+		if (device_is_a(busdev, "pcfiic") &&
+		(!strcmp(machine_model, "SUNW,Sun-Fire-V240") ||
+		!strcmp(machine_model, "SUNW,Sun-Fire-V210"))) {
+			prop_dictionary_t props = device_properties(busdev);
+			prop_array_t cfg = NULL;
+			prop_dictionary_t sens;
+			prop_data_t data;
+			const char name_lm[] = "i2c-lm75";
+			const char name_adm[] = "i2c-adm1026";
+
+			DPRINTF(ACDB_PROBE, ("\nAdding sensors for %s ",
+			machine_model));
+			cfg = prop_dictionary_get(props, "i2c-child-devices");
+ 			if (!cfg) {
+cfg = prop_array_create();
+prop_dictionary_set(props, "i2c-child-devices",
+cfg);
+prop_dictionary_set_bool(props,
+"i2c-indirect-config", false);
+			}
+
+			/* ADM1026 at 0x2e */
+			sens = prop_dictionary_create();
+			prop_dictionary_set_uint32(sens, "addr", 0x2e);
+			prop_dictionary_set_uint64(sens, "cookie", 0);
+			prop_dictionary_set_cstring(sens, "name",
+			"hardware-monitor");
+			data = prop_data_create_data(_adm[0],
+			sizeof(name_adm));
+			prop_dictionary_set(sens, "compatible", data);
+			prop_object_release(data);
+			prop_array_add(cfg, sens);
+			prop_object_release(sens);
+
+			/* LM75 at 0x4e */
+			sens = prop_dictionary_create();
+			prop_dictionary_set_uint32(sens, "addr", 0x4e);
+			prop_dictionary_set_uint64(sens, "cookie", 0);
+			prop_dictionary_set_cstring(sens, "name",
+			"temperature-sensor");
+			data = prop_data_create_data(_lm[0],
+			sizeof(name_lm));
+			prop_dictionary_set(sens, "compatible", data);
+			prop_object_release(data);
+			prop_array_add(cfg, sens);
+			prop_object_release(sens);
+		}
 	}
 
 	/* set properties for PCI framebuffers */
@@ -1205,6 +1257,27 @@ noether:
 instance = OF_open(name);
 #endif
 	}
+
+	/* Hardware specific device properties */
+	if ((!strcmp(machine_model, "SUNW,Sun-Fire-V240") ||
+	!strcmp(machine_model, "SUNW,Sun-Fire-V210"))) {
+		device_t busparent = device_parent(busdev);
+		prop_dictionary_t props = device_properties(dev);
+
+		if (busparent != NULL && device_is_a(busparent, "pcfiic") &&
+		device_is_a(dev, "adm1026hm") && props != NULL) {
+			prop_dictionary_set_uint8(props, "fan_div2", 0x55);
+			prop_dictionary_set_bool(props, "multi_read", true);
+		}
+	}
+	if (!strcmp(machine_model, "SUNW,Sun-Fire-V440")) {
+		device_t busparent = device_parent(busdev);
+		prop_dictionary_t props = device_properties(dev);
+		if (busparent != NULL && device_is_a(busparent, "pcfiic") &&
+		device_is_a(dev, "adm1026hm") && props != NULL) {
+			prop_dictionary_set_bool(props, "multi_read", true);
+		}
+	}
 }
 
 /*



CVS commit: src/share/man/man4

2015-12-16 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Wed Dec 16 08:20:03 UTC 2015

Modified Files:
src/share/man/man4: Makefile

Log Message:
Add manual page for ADM1026.


To generate a diff of this commit:
cvs rdiff -u -r1.624 -r1.625 src/share/man/man4/Makefile

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/Makefile
diff -u src/share/man/man4/Makefile:1.624 src/share/man/man4/Makefile:1.625
--- src/share/man/man4/Makefile:1.624	Wed Oct 14 04:22:45 2015
+++ src/share/man/man4/Makefile	Wed Dec 16 08:20:03 2015
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.624 2015/10/14 04:22:45 nonaka Exp $
+#	$NetBSD: Makefile,v 1.625 2015/12/16 08:20:03 jdc Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
 	adbbt.4 adbkbd.4 adbms.4 \
-	adc.4 admtemp.4 adv.4 adw.4 age.4 agp.4 agr.4 ahb.4 ahc.4 \
+	adc.4 adm1026hm.4 admtemp.4 adv.4 adw.4 age.4 agp.4 agr.4 ahb.4 ahc.4 \
 	ahcisata.4 ahd.4 \
 	aibs.4 alc.4 ale.4 alipm.4 altmem.4 altq.4 amdpm.4 amdtemp.4 amhphy.4 \
 	amr.4 aps.4 asus.4 \