Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Oct 2014 07:31:22 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273377 - in head: share/man/man9 sys/amd64/amd64 sys/arm/arm sys/cam/scsi sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/dev/dtrace sys/compat/ndis sys/dev/acpi_support sys/de...
Message-ID:  <201410210731.s9L7VMww096983@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Oct 21 07:31:21 2014
New Revision: 273377
URL: https://svnweb.freebsd.org/changeset/base/273377

Log:
  Fix multiple incorrect SYSCTL arguments in the kernel:
  
  - Wrong integer type was specified.
  
  - Wrong or missing "access" specifier. The "access" specifier
  sometimes included the SYSCTL type, which it should not, except for
  procedural SYSCTL nodes.
  
  - Logical OR where binary OR was expected.
  
  - Properly assert the "access" argument passed to all SYSCTL macros,
  using the CTASSERT macro. This applies to both static- and dynamically
  created SYSCTLs.
  
  - Properly assert the the data type for both static and dynamic
  SYSCTLs. In the case of static SYSCTLs we only assert that the data
  pointed to by the SYSCTL data pointer has the correct size, hence
  there is no easy way to assert types in the C language outside a
  C-function.
  
  - Rewrote some code which doesn't pass a constant "access" specifier
  when creating dynamic SYSCTL nodes, which is now a requirement.
  
  - Updated "EXAMPLES" section in SYSCTL manual page.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/share/man/man9/Makefile
  head/share/man/man9/sysctl.9
  head/sys/amd64/amd64/fpu.c
  head/sys/arm/arm/busdma_machdep-v6.c
  head/sys/arm/arm/busdma_machdep.c
  head/sys/cam/scsi/scsi_sa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  head/sys/cddl/dev/dtrace/dtrace_sysctl.c
  head/sys/compat/ndis/kern_ndis.c
  head/sys/dev/acpi_support/acpi_asus.c
  head/sys/dev/acpi_support/acpi_asus_wmi.c
  head/sys/dev/acpi_support/acpi_hp.c
  head/sys/dev/acpi_support/acpi_ibm.c
  head/sys/dev/acpi_support/acpi_rapidstart.c
  head/sys/dev/acpi_support/acpi_sony.c
  head/sys/dev/bxe/bxe.c
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_igb.c
  head/sys/dev/e1000/if_lem.c
  head/sys/dev/hatm/if_hatm.c
  head/sys/dev/ixgbe/ixgbe.c
  head/sys/dev/ixgbe/ixv.c
  head/sys/dev/ixl/if_ixl.c
  head/sys/dev/mpr/mpr.c
  head/sys/dev/mps/mps.c
  head/sys/dev/mrsas/mrsas.c
  head/sys/dev/mrsas/mrsas.h
  head/sys/dev/mxge/if_mxge.c
  head/sys/dev/oce/oce_sysctl.c
  head/sys/dev/qlxgb/qla_os.c
  head/sys/dev/qlxgbe/ql_os.c
  head/sys/dev/rt/if_rt.c
  head/sys/dev/sound/pci/hda/hdaa.c
  head/sys/dev/vxge/vxge.c
  head/sys/dev/xen/netfront/netfront.c
  head/sys/fs/devfs/devfs_devs.c
  head/sys/fs/fuse/fuse_main.c
  head/sys/fs/fuse/fuse_vfsops.c
  head/sys/geom/geom_kern.c
  head/sys/kern/kern_cpuset.c
  head/sys/kern/kern_descrip.c
  head/sys/kern/kern_mib.c
  head/sys/kern/kern_synch.c
  head/sys/kern/subr_devstat.c
  head/sys/kern/subr_kdb.c
  head/sys/kern/subr_uio.c
  head/sys/kern/vfs_cache.c
  head/sys/mips/mips/busdma_machdep.c
  head/sys/net80211/ieee80211_ht.c
  head/sys/net80211/ieee80211_hwmp.c
  head/sys/net80211/ieee80211_mesh.c
  head/sys/net80211/ieee80211_superg.c
  head/sys/netgraph/bluetooth/common/ng_bluetooth.c
  head/sys/netgraph/ng_base.c
  head/sys/netgraph/ng_socket.c
  head/sys/netinet/cc/cc_chd.c
  head/sys/netinet/tcp_timer.c
  head/sys/netipsec/ipsec.h
  head/sys/netpfil/pf/pf.c
  head/sys/ofed/drivers/net/mlx4/mlx4_en.h
  head/sys/powerpc/powermac/fcu.c
  head/sys/powerpc/powermac/smu.c
  head/sys/powerpc/powerpc/cpu.c
  head/sys/sys/sysctl.h
  head/sys/vm/memguard.c
  head/sys/vm/vm_kern.c
  head/sys/x86/x86/busdma_bounce.c

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/share/man/man9/Makefile	Tue Oct 21 07:31:21 2014	(r273377)
@@ -1499,6 +1499,7 @@ MLINKS+=sysctl.9 SYSCTL_DECL.9 \
 	sysctl.9 SYSCTL_ADD_ROOT_NODE.9 \
 	sysctl.9 SYSCTL_ADD_STRING.9 \
 	sysctl.9 SYSCTL_ADD_STRUCT.9 \
+	sysctl.9 SYSCTL_ADD_UAUTO.9 \
 	sysctl.9 SYSCTL_ADD_UINT.9 \
 	sysctl.9 SYSCTL_ADD_ULONG.9 \
 	sysctl.9 SYSCTL_ADD_UQUAD.9 \

Modified: head/share/man/man9/sysctl.9
==============================================================================
--- head/share/man/man9/sysctl.9	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/share/man/man9/sysctl.9	Tue Oct 21 07:31:21 2014	(r273377)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 15, 2014
+.Dd October 20, 2014
 .Dt SYSCTL 9
 .Os
 .Sh NAME
@@ -39,6 +39,7 @@
 .Nm SYSCTL_ADD_ROOT_NODE ,
 .Nm SYSCTL_ADD_STRING ,
 .Nm SYSCTL_ADD_STRUCT ,
+.Nm SYSCTL_ADD_UAUTO ,
 .Nm SYSCTL_ADD_UINT ,
 .Nm SYSCTL_ADD_ULONG ,
 .Nm SYSCTL_ADD_UQUAD ,
@@ -82,7 +83,6 @@
 .Fa "const char *name"
 .Fa "int ctlflags"
 .Fa "long *ptr"
-.Fa "intptr_t val"
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
@@ -128,7 +128,6 @@
 .Fa "const char *name"
 .Fa "int ctlflags"
 .Fa "quad_t *ptr"
-.Fa "intptr_t val"
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
@@ -181,7 +180,6 @@
 .Fa "const char *name"
 .Fa "int ctlflags"
 .Fa "unsigned long *ptr"
-.Fa "intptr_t val"
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid *
@@ -192,7 +190,16 @@
 .Fa "const char *name"
 .Fa "int ctlflags"
 .Fa "u_quad_t *ptr"
-.Fa "intptr_t val"
+.Fa "const char *descr"
+.Fc
+.Ft struct sysctl_oid *
+.Fo SYSCTL_ADD_UAUTO
+.Fa "struct sysctl_ctx_list *ctx"
+.Fa "struct sysctl_oid_list *parent"
+.Fa "int number"
+.Fa "const char *name"
+.Fa "int ctlflags"
+.Fa "void *ptr"
 .Fa "const char *descr"
 .Fc
 .Ft struct sysctl_oid_list *
@@ -283,13 +290,13 @@ For string type OIDs a length of zero me
 will be used to get the length of the string at each access to the OID.
 .It Fa ptr
 Pointer to sysctl variable or string data.
-For sysctl values the pointer can be NULL which means the OID is read-only and the returned value should be taken from the
+For sysctl values the pointer can be SYSCTL_NULL_XXX_PTR which means the OID is read-only and the returned value should be taken from the
 .Fa val
 argument.
 .It Fa val
 If the
 .Fa ptr
-argument is NULL, gives the constant value returned by this OID.
+argument is SYSCTL_NULL_XXX_PTR, gives the constant value returned by this OID.
 Else this argument is not used.
 .It Fa struct_type
 Name of structure type.
@@ -424,8 +431,9 @@ Dynamic nodes are created using one of t
 .Fn SYSCTL_ADD_ROOT_NODE ,
 .Fn SYSCTL_ADD_STRING ,
 .Fn SYSCTL_ADD_STRUCT ,
+.Fn SYSCTL_ADD_UAUTO ,
 .Fn SYSCTL_ADD_UINT ,
-.Fn SYSCTL_ADD_ULONG
+.Fn SYSCTL_ADD_ULONG ,
 or
 .Fn SYSCTL_UQUAD
 functions.
@@ -521,10 +529,10 @@ Examples of integer, opaque, string, and
 .Bd -literal -offset indent
 /*
  * Example of a constant integer value.  Notice that the control
- * flags are CTLFLAG_RD, the variable pointer is NULL, and the
- * value is declared.
+ * flags are CTLFLAG_RD, the variable pointer is SYSCTL_NULL_INT_PTR,
+ * and the value is declared.
  */
-SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, NULL,
+SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, SYSCTL_NULL_INT_PTR,
     sizeof(struct bio), "sizeof(struct bio)");
 
 /*

Modified: head/sys/amd64/amd64/fpu.c
==============================================================================
--- head/sys/amd64/amd64/fpu.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/amd64/amd64/fpu.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -130,7 +130,7 @@ CTASSERT(sizeof(struct pcb) % XSAVE_AREA
 static	void	fpu_clean_state(void);
 
 SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD,
-    NULL, 1, "Floating point instructions executed in hardware");
+    SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware");
 
 int use_xsave;			/* non-static for cpu_switch.S */
 uint64_t xsave_mask;		/* the same */

Modified: head/sys/arm/arm/busdma_machdep-v6.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep-v6.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/arm/arm/busdma_machdep-v6.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -1525,9 +1525,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat)
 	SYSCTL_ADD_STRING(busdma_sysctl_tree(bz),
 	    SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
 	    "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, "");
-	SYSCTL_ADD_INT(busdma_sysctl_tree(bz),
+	SYSCTL_ADD_ULONG(busdma_sysctl_tree(bz),
 	    SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
-	    "alignment", CTLFLAG_RD, &bz->alignment, 0, "");
+	    "alignment", CTLFLAG_RD, &bz->alignment, "");
 
 	return (0);
 }

Modified: head/sys/arm/arm/busdma_machdep.c
==============================================================================
--- head/sys/arm/arm/busdma_machdep.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/arm/arm/busdma_machdep.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -1346,9 +1346,9 @@ alloc_bounce_zone(bus_dma_tag_t dmat)
 	SYSCTL_ADD_STRING(busdma_sysctl_tree(bz),
 	    SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
 	    "lowaddr", CTLFLAG_RD, bz->lowaddrid, 0, "");
-	SYSCTL_ADD_INT(busdma_sysctl_tree(bz),
+	SYSCTL_ADD_ULONG(busdma_sysctl_tree(bz),
 	    SYSCTL_CHILDREN(busdma_sysctl_tree_top(bz)), OID_AUTO,
-	    "alignment", CTLFLAG_RD, &bz->alignment, 0, "");
+	    "alignment", CTLFLAG_RD, &bz->alignment, "");
 
 	return (0);
 }

Modified: head/sys/cam/scsi/scsi_sa.c
==============================================================================
--- head/sys/cam/scsi/scsi_sa.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/cam/scsi/scsi_sa.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -1487,13 +1487,13 @@ sasysctlinit(void *context, int pending)
 		goto bailout;
 
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-	    OID_AUTO, "allow_io_split", CTLTYPE_INT | CTLFLAG_RDTUN | CTLFLAG_NOFETCH, 
+	    OID_AUTO, "allow_io_split", CTLFLAG_RDTUN | CTLFLAG_NOFETCH, 
 	    &softc->allow_io_split, 0, "Allow Splitting I/O");
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-	    OID_AUTO, "maxio", CTLTYPE_INT | CTLFLAG_RD, 
+	    OID_AUTO, "maxio", CTLFLAG_RD, 
 	    &softc->maxio, 0, "Maximum I/O size");
 	SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree),
-	    OID_AUTO, "cpi_maxio", CTLTYPE_INT | CTLFLAG_RD, 
+	    OID_AUTO, "cpi_maxio", CTLFLAG_RD, 
 	    &softc->cpi_maxio, 0, "Maximum Controller I/O size");
 
 bailout:

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -67,8 +67,8 @@
 #include "zfs_comutil.h"
 
 /* Used by fstat(1). */
-SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD, 0, sizeof(znode_t),
-    "sizeof(znode_t)");
+SYSCTL_INT(_debug_sizeof, OID_AUTO, znode, CTLFLAG_RD,
+    SYSCTL_NULL_INT_PTR, sizeof(znode_t), "sizeof(znode_t)");
 
 /*
  * Define ZNODE_STATS to turn on statistic gathering. By default, it is only

Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c
==============================================================================
--- head/sys/cddl/dev/dtrace/dtrace_sysctl.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/cddl/dev/dtrace/dtrace_sysctl.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -86,8 +86,8 @@ SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTL
 SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max,
     0, "largest allowed argument to memstr(), 0 indicates no limit");
 
-SYSCTL_LONG(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW,
+SYSCTL_QUAD(_kern_dtrace, OID_AUTO, dof_maxsize, CTLFLAG_RW,
     &dtrace_dof_maxsize, 0, "largest allowed DOF table");
 
-SYSCTL_LONG(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
+SYSCTL_QUAD(_kern_dtrace, OID_AUTO, helper_actions_max, CTLFLAG_RW,
     &dtrace_helper_actions_max, 0, "maximum number of allowed helper actions");

Modified: head/sys/compat/ndis/kern_ndis.c
==============================================================================
--- head/sys/compat/ndis/kern_ndis.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/compat/ndis/kern_ndis.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -79,6 +79,7 @@ __FBSDID("$FreeBSD$");
 #include <dev/if_ndis/if_ndisvar.h>
 
 #define NDIS_DUMMY_PATH "\\\\some\\bogus\\path"
+#define	NDIS_FLAG_RDONLY 1
 
 static void ndis_status_func(ndis_handle, ndis_status, void *, uint32_t);
 static void ndis_statusdone_func(ndis_handle);
@@ -326,48 +327,48 @@ ndis_create_sysctls(arg)
 	 * We qualify as the latter.
 	 */
 	ndis_add_sysctl(sc, "Environment",
-	    "Windows environment", "1", CTLFLAG_RD);
+	    "Windows environment", "1", NDIS_FLAG_RDONLY);
 
 	/* NDIS version should be 5.1. */
 	ndis_add_sysctl(sc, "NdisVersion",
-	    "NDIS API Version", "0x00050001", CTLFLAG_RD);
+	    "NDIS API Version", "0x00050001", NDIS_FLAG_RDONLY);
 
 	/*
 	 * Some miniport drivers rely on the existence of the SlotNumber,
 	 * NetCfgInstanceId and DriverDesc keys.
 	 */
-	ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", CTLFLAG_RD);
+	ndis_add_sysctl(sc, "SlotNumber", "Slot Numer", "01", NDIS_FLAG_RDONLY);
 	ndis_add_sysctl(sc, "NetCfgInstanceId", "NetCfgInstanceId",
-	    "{12345678-1234-5678-CAFE0-123456789ABC}", CTLFLAG_RD);
+	    "{12345678-1234-5678-CAFE0-123456789ABC}", NDIS_FLAG_RDONLY);
 	ndis_add_sysctl(sc, "DriverDesc", "Driver Description",
-	    "NDIS Network Adapter", CTLFLAG_RD);
+	    "NDIS Network Adapter", NDIS_FLAG_RDONLY);
 
 	/* Bus type (PCI, PCMCIA, etc...) */
 	sprintf(buf, "%d", (int)sc->ndis_iftype);
-	ndis_add_sysctl(sc, "BusType", "Bus Type", buf, CTLFLAG_RD);
+	ndis_add_sysctl(sc, "BusType", "Bus Type", buf, NDIS_FLAG_RDONLY);
 
 	if (sc->ndis_res_io != NULL) {
 		sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io));
 		ndis_add_sysctl(sc, "IOBaseAddress",
-		    "Base I/O Address", buf, CTLFLAG_RD);
+		    "Base I/O Address", buf, NDIS_FLAG_RDONLY);
 	}
 
 	if (sc->ndis_irq != NULL) {
 		sprintf(buf, "%lu", rman_get_start(sc->ndis_irq));
 		ndis_add_sysctl(sc, "InterruptNumber",
-		    "Interrupt Number", buf, CTLFLAG_RD);
+		    "Interrupt Number", buf, NDIS_FLAG_RDONLY);
 	}
 
 	return (0);
 }
 
 int
-ndis_add_sysctl(arg, key, desc, val, flag)
+ndis_add_sysctl(arg, key, desc, val, flag_rdonly)
 	void			*arg;
 	char			*key;
 	char			*desc;
 	char			*val;
-	int			flag;
+	int			flag_rdonly;
 {
 	struct ndis_softc	*sc;
 	struct ndis_cfglist	*cfg;
@@ -392,13 +393,21 @@ ndis_add_sysctl(arg, key, desc, val, fla
 
 	TAILQ_INSERT_TAIL(&sc->ndis_cfglist_head, cfg, link);
 
-	cfg->ndis_oid =
-	SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev),
-	    SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)),
-	    OID_AUTO, cfg->ndis_cfg.nc_cfgkey, flag,
-	    cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val),
-	    cfg->ndis_cfg.nc_cfgdesc);
-
+	if (flag_rdonly != 0) {
+		cfg->ndis_oid =
+		    SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev),
+		    SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)),
+		    OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RD,
+		    cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val),
+		    cfg->ndis_cfg.nc_cfgdesc);
+	} else {
+		cfg->ndis_oid =
+		    SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->ndis_dev),
+		    SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ndis_dev)),
+		    OID_AUTO, cfg->ndis_cfg.nc_cfgkey, CTLFLAG_RW,
+		    cfg->ndis_cfg.nc_val, sizeof(cfg->ndis_cfg.nc_val),
+		    cfg->ndis_cfg.nc_cfgdesc);
+	}
 	return (0);
 }
 

Modified: head/sys/dev/acpi_support/acpi_asus.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_asus.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/acpi_support/acpi_asus.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -465,43 +465,39 @@ static struct {
 	char	*name;
 	char	*description;
 	int	method;
-	int	flags;
+	int	flag_anybody;
 } acpi_asus_sysctls[] = {
 	{
 		.name		= "lcd_backlight",
 		.method		= ACPI_ASUS_METHOD_LCD,
 		.description	= "state of the lcd backlight",
-		.flags 		= CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY
+		.flag_anybody	= 1
 	},
 	{
 		.name		= "lcd_brightness",
 		.method		= ACPI_ASUS_METHOD_BRN,
 		.description	= "brightness of the lcd panel",
-		.flags 		= CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY
+		.flag_anybody	= 1
 	},
 	{
 		.name		= "video_output",
 		.method		= ACPI_ASUS_METHOD_DISP,
 		.description	= "display output state",
-		.flags 		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "camera",
 		.method		= ACPI_ASUS_METHOD_CAMERA,
 		.description	= "internal camera state",  
-		.flags 		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "cardreader",
 		.method		= ACPI_ASUS_METHOD_CARDRD,
 		.description	= "internal card reader state",
-		.flags 		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wlan",
 		.method		= ACPI_ASUS_METHOD_WLAN,
 		.description	= "wireless lan state",
-		.flags		= CTLTYPE_INT | CTLFLAG_RW
 	},
 
 	{ .name = NULL }
@@ -741,12 +737,21 @@ acpi_asus_attach(device_t dev)
 		if (!acpi_asus_sysctl_init(sc, acpi_asus_sysctls[i].method))
 			continue;
 
-		SYSCTL_ADD_PROC(&sc->sysctl_ctx,
-		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-		    acpi_asus_sysctls[i].name,
-		    acpi_asus_sysctls[i].flags,
-		    sc, i, acpi_asus_sysctl, "I",
-		    acpi_asus_sysctls[i].description);
+		if (acpi_asus_sysctls[i].flag_anybody != 0) {
+			SYSCTL_ADD_PROC(&sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_asus_sysctls[i].name,
+			    CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY,
+			    sc, i, acpi_asus_sysctl, "I",
+			    acpi_asus_sysctls[i].description);
+		} else {
+			SYSCTL_ADD_PROC(&sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_asus_sysctls[i].name,
+			    CTLTYPE_INT | CTLFLAG_RW,
+			    sc, i, acpi_asus_sysctl, "I",
+			    acpi_asus_sysctls[i].description);
+		}
 	}
 
 	/* Attach leds */

Modified: head/sys/dev/acpi_support/acpi_asus_wmi.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_asus_wmi.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/acpi_support/acpi_asus_wmi.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -119,163 +119,139 @@ static struct {
 	char	*name;
 	int	dev_id;
 	char	*description;
-	int	access;
+	int	flag_rdonly;
 } acpi_asus_wmi_sysctls[] = {
 	{
 		.name		= "hw_switch",
 		.dev_id		= ASUS_WMI_DEVID_HW_SWITCH,
 		.description	= "hw_switch",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wireless_led",
 		.dev_id		= ASUS_WMI_DEVID_WIRELESS_LED,
 		.description	= "Wireless LED control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "cwap",
 		.dev_id		= ASUS_WMI_DEVID_CWAP,
 		.description	= "Alt+F2 function",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wlan",
 		.dev_id		= ASUS_WMI_DEVID_WLAN,
 		.description	= "WLAN power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "bluetooth",
 		.dev_id		= ASUS_WMI_DEVID_BLUETOOTH,
 		.description	= "Bluetooth power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "gps",
 		.dev_id		= ASUS_WMI_DEVID_GPS,
 		.description	= "GPS power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wimax",
 		.dev_id		= ASUS_WMI_DEVID_WIMAX,
 		.description	= "WiMAX power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wwan3g",
 		.dev_id		= ASUS_WMI_DEVID_WWAN3G,
 		.description	= "WWAN-3G power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "uwb",
 		.dev_id		= ASUS_WMI_DEVID_UWB,
 		.description	= "UWB power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "led1",
 		.dev_id		= ASUS_WMI_DEVID_LED1,
 		.description	= "LED1 control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "led2",
 		.dev_id		= ASUS_WMI_DEVID_LED2,
 		.description	= "LED2 control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "led3",
 		.dev_id		= ASUS_WMI_DEVID_LED3,
 		.description	= "LED3 control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "led4",
 		.dev_id		= ASUS_WMI_DEVID_LED4,
 		.description	= "LED4 control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "led5",
 		.dev_id		= ASUS_WMI_DEVID_LED5,
 		.description	= "LED5 control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "led6",
 		.dev_id		= ASUS_WMI_DEVID_LED6,
 		.description	= "LED6 control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "backlight",
 		.dev_id		= ASUS_WMI_DEVID_BACKLIGHT,
 		.description	= "LCD backlight on/off control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "brightness",
 		.dev_id		= ASUS_WMI_DEVID_BRIGHTNESS,
 		.description	= "LCD backlight brightness control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "kbd_backlight",
 		.dev_id		= ASUS_WMI_DEVID_KBD_BACKLIGHT,
 		.description	= "Keyboard backlight brightness control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "light_sensor",
 		.dev_id		= ASUS_WMI_DEVID_LIGHT_SENSOR,
 		.description	= "Ambient light sensor",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "camera",
 		.dev_id		= ASUS_WMI_DEVID_CAMERA,
 		.description	= "Camera power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "cardreader",
 		.dev_id		= ASUS_WMI_DEVID_CARDREADER,
 		.description	= "Cardreader power control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "touchpad",
 		.dev_id		= ASUS_WMI_DEVID_TOUCHPAD,
 		.description	= "Touchpad control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "touchpad_led",
 		.dev_id		= ASUS_WMI_DEVID_TOUCHPAD_LED,
 		.description	= "Touchpad LED control",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "themperature",
 		.dev_id		= ASUS_WMI_DEVID_THERMAL_CTRL,
 		.description	= "Temperature (C)",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "fan_speed",
 		.dev_id		= ASUS_WMI_DEVID_FAN_CTRL,
 		.description	= "Fan speed (0-3)",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "processor_state",
 		.dev_id		= ASUS_WMI_DEVID_PROCESSOR_STATE,
-		.description	= "Processor state",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
+		.flag_rdonly	= 1
 	},
 	{ NULL, 0, NULL, 0 }
 };
@@ -449,12 +425,21 @@ next:
 			break;
 		}
 
-		SYSCTL_ADD_PROC(sc->sysctl_ctx,
-		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-		    acpi_asus_wmi_sysctls[i].name,
-		    acpi_asus_wmi_sysctls[i].access,
-		    sc, i, acpi_asus_wmi_sysctl, "I",
-		    acpi_asus_wmi_sysctls[i].description);
+		if (acpi_asus_wmi_sysctls[i].flag_rdonly != 0) {
+			SYSCTL_ADD_PROC(sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_asus_wmi_sysctls[i].name,
+			    CTLTYPE_INT | CTLFLAG_RD,
+			    sc, i, acpi_asus_wmi_sysctl, "I",
+			    acpi_asus_wmi_sysctls[i].description);
+		} else {
+			SYSCTL_ADD_PROC(sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_asus_wmi_sysctls[i].name,
+			    CTLTYPE_INT | CTLFLAG_RW,
+			    sc, i, acpi_asus_wmi_sysctl, "I",
+			    acpi_asus_wmi_sysctls[i].description);
+		}
 	}
 	ACPI_SERIAL_END(asus_wmi);
 

Modified: head/sys/dev/acpi_support/acpi_hp.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_hp.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/acpi_support/acpi_hp.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -152,135 +152,123 @@ static struct {
 	char	*name;
 	int	method;
 	char	*description;
-	int	access;
+	int	flag_rdonly;
 } acpi_hp_sysctls[] = {
 	{
 		.name		= "wlan_enabled",
 		.method		= ACPI_HP_METHOD_WLAN_ENABLED,
 		.description	= "Enable/Disable WLAN (WiFi)",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wlan_radio",
 		.method		= ACPI_HP_METHOD_WLAN_RADIO,
 		.description	= "WLAN radio status",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "wlan_on_air",
 		.method		= ACPI_HP_METHOD_WLAN_ON_AIR,
 		.description	= "WLAN radio ready to use (enabled and radio)",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "wlan_enable_if_radio_on",
 		.method		= ACPI_HP_METHOD_WLAN_ENABLE_IF_RADIO_ON,
 		.description	= "Enable WLAN if radio is turned on",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wlan_disable_if_radio_off",
 		.method		= ACPI_HP_METHOD_WLAN_DISABLE_IF_RADIO_OFF,
 		.description	= "Disable WLAN if radio is turned off",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "bt_enabled",
 		.method		= ACPI_HP_METHOD_BLUETOOTH_ENABLED,
 		.description	= "Enable/Disable Bluetooth",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "bt_radio",
 		.method		= ACPI_HP_METHOD_BLUETOOTH_RADIO,
 		.description	= "Bluetooth radio status",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "bt_on_air",
 		.method		= ACPI_HP_METHOD_BLUETOOTH_ON_AIR,
 		.description	= "Bluetooth radio ready to use"
 				    " (enabled and radio)",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "bt_enable_if_radio_on",
 		.method		= ACPI_HP_METHOD_BLUETOOTH_ENABLE_IF_RADIO_ON,
 		.description	= "Enable bluetooth if radio is turned on",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "bt_disable_if_radio_off",
 		.method		= ACPI_HP_METHOD_BLUETOOTH_DISABLE_IF_RADIO_OFF,
 		.description	= "Disable bluetooth if radio is turned off",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wwan_enabled",
 		.method		= ACPI_HP_METHOD_WWAN_ENABLED,
 		.description	= "Enable/Disable WWAN (UMTS)",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wwan_radio",
 		.method		= ACPI_HP_METHOD_WWAN_RADIO,
 		.description	= "WWAN radio status",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "wwan_on_air",
 		.method		= ACPI_HP_METHOD_WWAN_ON_AIR,
 		.description	= "WWAN radio ready to use (enabled and radio)",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "wwan_enable_if_radio_on",
 		.method		= ACPI_HP_METHOD_WWAN_ENABLE_IF_RADIO_ON,
 		.description	= "Enable WWAN if radio is turned on",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wwan_disable_if_radio_off",
 		.method		= ACPI_HP_METHOD_WWAN_DISABLE_IF_RADIO_OFF,
 		.description	= "Disable WWAN if radio is turned off",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "als_enabled",
 		.method		= ACPI_HP_METHOD_ALS,
 		.description	= "Enable/Disable ALS (Ambient light sensor)",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "display",
 		.method		= ACPI_HP_METHOD_DISPLAY,
 		.description	= "Display status",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "hdd_temperature",
 		.method		= ACPI_HP_METHOD_HDDTEMP,
 		.description	= "HDD temperature",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "is_docked",
 		.method		= ACPI_HP_METHOD_DOCK,
 		.description	= "Docking station status",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "cmi_detail",
 		.method		= ACPI_HP_METHOD_CMI_DETAIL,
 		.description	= "Details shown in CMI output "
 				    "(cat /dev/hpcmi)",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "verbose",
 		.method		= ACPI_HP_METHOD_VERBOSE,
 		.description	= "Verbosity level",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 
 	{ NULL, 0, NULL, 0 }
@@ -560,11 +548,19 @@ acpi_hp_attach(device_t dev)
 			sc->was_wwan_on_air = arg;
 		}
 
-		SYSCTL_ADD_PROC(sc->sysctl_ctx,
-		SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-			acpi_hp_sysctls[i].name, acpi_hp_sysctls[i].access,
-			sc, i, acpi_hp_sysctl, "I",
-			acpi_hp_sysctls[i].description);
+		if (acpi_hp_sysctls[i].flag_rdonly != 0) {
+			SYSCTL_ADD_PROC(sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD,
+			    sc, i, acpi_hp_sysctl, "I",
+			    acpi_hp_sysctls[i].description);
+		} else {
+			SYSCTL_ADD_PROC(sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_hp_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW,
+			    sc, i, acpi_hp_sysctl, "I",
+			    acpi_hp_sysctls[i].description);
+		}
 	}
 	ACPI_SERIAL_END(hp);
 

Modified: head/sys/dev/acpi_support/acpi_ibm.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_ibm.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/acpi_support/acpi_ibm.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -192,79 +192,70 @@ static struct {
 	char	*name;
 	int	method;
 	char	*description;
-	int	access;
+	int	flag_rdonly;
 } acpi_ibm_sysctls[] = {
 	{
 		.name		= "events",
 		.method		= ACPI_IBM_METHOD_EVENTS,
 		.description	= "ACPI events enable",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "eventmask",
 		.method		= ACPI_IBM_METHOD_EVENTMASK,
 		.description	= "ACPI eventmask",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "hotkey",
 		.method		= ACPI_IBM_METHOD_HOTKEY,
 		.description	= "Key Status",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "lcd_brightness",
 		.method		= ACPI_IBM_METHOD_BRIGHTNESS,
 		.description	= "LCD Brightness",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "volume",
 		.method		= ACPI_IBM_METHOD_VOLUME,
 		.description	= "Volume",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "mute",
 		.method		= ACPI_IBM_METHOD_MUTE,
 		.description	= "Mute",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "thinklight",
 		.method		= ACPI_IBM_METHOD_THINKLIGHT,
 		.description	= "Thinklight enable",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "bluetooth",
 		.method		= ACPI_IBM_METHOD_BLUETOOTH,
 		.description	= "Bluetooth enable",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "wlan",
 		.method		= ACPI_IBM_METHOD_WLAN,
 		.description	= "WLAN enable",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "fan_speed",
 		.method		= ACPI_IBM_METHOD_FANSPEED,
 		.description	= "Fan speed",
-		.access		= CTLTYPE_INT | CTLFLAG_RD
+		.flag_rdonly	= 1
 	},
 	{
 		.name		= "fan_level",
 		.method		= ACPI_IBM_METHOD_FANLEVEL,
 		.description	= "Fan level",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 	{
 		.name		= "fan",
 		.method		= ACPI_IBM_METHOD_FANSTATUS,
 		.description	= "Fan enable",
-		.access		= CTLTYPE_INT | CTLFLAG_RW
 	},
 
 	{ NULL, 0, NULL, 0 }
@@ -415,11 +406,19 @@ acpi_ibm_attach(device_t dev)
 		if (!acpi_ibm_sysctl_init(sc, acpi_ibm_sysctls[i].method))
 			continue;
 
-		SYSCTL_ADD_PROC(sc->sysctl_ctx,
-		    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
-		    acpi_ibm_sysctls[i].name, acpi_ibm_sysctls[i].access,
-		    sc, i, acpi_ibm_sysctl, "I",
-		    acpi_ibm_sysctls[i].description);
+		if (acpi_ibm_sysctls[i].flag_rdonly != 0) {
+			SYSCTL_ADD_PROC(sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RD,
+			    sc, i, acpi_ibm_sysctl, "I",
+			    acpi_ibm_sysctls[i].description);
+		} else {
+			SYSCTL_ADD_PROC(sc->sysctl_ctx,
+			    SYSCTL_CHILDREN(sc->sysctl_tree), OID_AUTO,
+			    acpi_ibm_sysctls[i].name, CTLTYPE_INT | CTLFLAG_RW,
+			    sc, i, acpi_ibm_sysctl, "I",
+			    acpi_ibm_sysctls[i].description);
+		}
 	}
 
 	/* Hook up thermal node */
@@ -483,15 +482,10 @@ acpi_ibm_resume(device_t dev)
 	for (int i = 0; acpi_ibm_sysctls[i].name != NULL; i++) {
 		int val;
 
-		if ((acpi_ibm_sysctls[i].access & CTLFLAG_RD) == 0) {
-			continue;
-		}
-
 		val = acpi_ibm_sysctl_get(sc, i);
 
-		if ((acpi_ibm_sysctls[i].access & CTLFLAG_WR) == 0) {
+		if (acpi_ibm_sysctls[i].flag_rdonly != 0)
 			continue;
-		}
 
 		acpi_ibm_sysctl_set(sc, i, val);
 	}

Modified: head/sys/dev/acpi_support/acpi_rapidstart.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_rapidstart.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/acpi_support/acpi_rapidstart.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -84,12 +84,21 @@ acpi_rapidstart_attach(device_t dev)
 	sc->sysctl_ctx = device_get_sysctl_ctx(dev);
 	sc->sysctl_tree = device_get_sysctl_tree(dev);
 	for (i = 0 ; acpi_rapidstart_oids[i].nodename != NULL; i++){
-		SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-		    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-		    i, acpi_rapidstart_oids[i].nodename , CTLTYPE_INT |
-		    ((acpi_rapidstart_oids[i].setmethod)? CTLFLAG_RW: CTLFLAG_RD),
-		    dev, i, sysctl_acpi_rapidstart_gen_handler, "I",
-		    acpi_rapidstart_oids[i].comment);
+		if (acpi_rapidstart_oids[i].setmethod != NULL) {
+			SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+			    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+			    i, acpi_rapidstart_oids[i].nodename,
+			    CTLTYPE_INT | CTLFLAG_RW,
+			    dev, i, sysctl_acpi_rapidstart_gen_handler, "I",
+			    acpi_rapidstart_oids[i].comment);
+		} else {
+			SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+			    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+			    i, acpi_rapidstart_oids[i].nodename,
+			    CTLTYPE_INT | CTLFLAG_RD,
+			    dev, i, sysctl_acpi_rapidstart_gen_handler, "I",
+			    acpi_rapidstart_oids[i].comment);
+		}
 	}
 	return (0);
 }

Modified: head/sys/dev/acpi_support/acpi_sony.c
==============================================================================
--- head/sys/dev/acpi_support/acpi_sony.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/acpi_support/acpi_sony.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -132,13 +132,22 @@ acpi_sony_attach(device_t dev)
 	sc = device_get_softc(dev);
 	acpi_GetInteger(acpi_get_handle(dev), ACPI_SONY_GET_PID, &sc->pid);
 	device_printf(dev, "PID %x\n", sc->pid);
-	for (i = 0 ; acpi_sony_oids[i].nodename != NULL; i++){
-		SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
-		    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
-		    i, acpi_sony_oids[i].nodename , CTLTYPE_INT |
-		    ((acpi_sony_oids[i].setmethod)? CTLFLAG_RW: CTLFLAG_RD),
-		    dev, i, sysctl_acpi_sony_gen_handler, "I",
-		    acpi_sony_oids[i].comment);
+	for (i = 0 ; acpi_sony_oids[i].nodename != NULL; i++) {
+		if (acpi_sony_oids[i].setmethod != NULL) {
+			SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+			    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+			    i, acpi_sony_oids[i].nodename ,
+			    CTLTYPE_INT | CTLFLAG_RW,
+			    dev, i, sysctl_acpi_sony_gen_handler, "I",
+			    acpi_sony_oids[i].comment);
+		} else {
+			SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
+			    SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
+			    i, acpi_sony_oids[i].nodename ,
+			    CTLTYPE_INT | CTLFLAG_RD,
+			    dev, i, sysctl_acpi_sony_gen_handler, "I",
+			    acpi_sony_oids[i].comment);
+		}
 	}
 	return (0);
 }

Modified: head/sys/dev/bxe/bxe.c
==============================================================================
--- head/sys/dev/bxe/bxe.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/bxe/bxe.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -16216,7 +16216,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
                       "version");
 
     SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version",
-                      CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0,
+                      CTLFLAG_RD, sc->devinfo.bc_ver_str, 0,
                       "bootcode version");
 
     snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d",
@@ -16225,7 +16225,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
              BCM_5710_FW_REVISION_VERSION,
              BCM_5710_FW_ENGINEERING_VERSION);
     SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version",
-                      CTLFLAG_RD, &sc->fw_ver_str, 0,
+                      CTLFLAG_RD, sc->fw_ver_str, 0,
                       "firmware version");
 
     snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s",
@@ -16235,7 +16235,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
          (sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" :
                                                                 "Unknown"));
     SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode",
-                      CTLFLAG_RD, &sc->mf_mode_str, 0,
+                      CTLFLAG_RD, sc->mf_mode_str, 0,
                       "multifunction mode");
 
     SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics",
@@ -16243,7 +16243,7 @@ bxe_add_sysctls(struct bxe_softc *sc)
                     "multifunction vnics per port");
 
     SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr",
-                      CTLFLAG_RD, &sc->mac_addr_str, 0,
+                      CTLFLAG_RD, sc->mac_addr_str, 0,
                       "mac address");
 
     snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d",
@@ -16253,12 +16253,12 @@ bxe_add_sysctls(struct bxe_softc *sc)
                                               "???GT/s"),
         sc->devinfo.pcie_link_width);
     SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link",
-                      CTLFLAG_RD, &sc->pci_link_str, 0,
+                      CTLFLAG_RD, sc->pci_link_str, 0,
                       "pci link status");
 
     sc->debug = bxe_debug;
-    SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug",
-                    CTLFLAG_RW, &sc->debug, 0,
+    SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug",
+                    CTLFLAG_RW, &sc->debug,
                     "debug logging mode");
 
     sc->rx_budget = bxe_rx_budget;

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c	Tue Oct 21 07:24:58 2014	(r273376)
+++ head/sys/dev/cxgb/cxgb_sge.c	Tue Oct 21 07:31:21 2014	(r273377)
@@ -3365,7 +3365,7 @@ t3_add_attach_sysctls(adapter_t *sc)
 	/* random information */
 	SYSCTL_ADD_STRING(ctx, children, OID_AUTO, 
 	    "firmware_version",
-	    CTLFLAG_RD, &sc->fw_version,
+	    CTLFLAG_RD, sc->fw_version,
 	    0, "firmware version");
 	SYSCTL_ADD_UINT(ctx, children, OID_AUTO,
 	    "hw_revision",
@@ -3373,7 +3373,7 @@ t3_add_attach_sysctls(adapter_t *sc)
 	    0, "chip model");
 	SYSCTL_ADD_STRING(ctx, children, OID_AUTO, 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410210731.s9L7VMww096983>