From owner-svn-src-head@freebsd.org Mon Aug 13 23:53:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C136010584FA; Mon, 13 Aug 2018 23:53:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 648587273B; Mon, 13 Aug 2018 23:53:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 400B913BA7; Mon, 13 Aug 2018 23:53:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7DNrCjs070972; Mon, 13 Aug 2018 23:53:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7DNrCs7070971; Mon, 13 Aug 2018 23:53:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201808132353.w7DNrCs7070971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 13 Aug 2018 23:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r337731 - head/sys/dev/iicbus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/iicbus X-SVN-Commit-Revision: 337731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2018 23:53:12 -0000 Author: ian Date: Mon Aug 13 23:53:11 2018 New Revision: 337731 URL: https://svnweb.freebsd.org/changeset/base/337731 Log: Export the eeprom device size via readonly sysctl. Also export the write page size and address size, although they are likely to be inherently less-interesting values outside of the driver. Modified: head/sys/dev/iicbus/icee.c Modified: head/sys/dev/iicbus/icee.c ============================================================================== --- head/sys/dev/iicbus/icee.c Mon Aug 13 23:46:44 2018 (r337730) +++ head/sys/dev/iicbus/icee.c Mon Aug 13 23:53:11 2018 (r337731) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -186,6 +187,8 @@ static int icee_attach(device_t dev) { struct icee_softc *sc = device_get_softc(dev); + struct sysctl_ctx_list *ctx; + struct sysctl_oid_list *tree; sc->dev = dev; sc->addr = iicbus_get_addr(dev); @@ -205,6 +208,16 @@ icee_attach(device_t dev) return (ENOMEM); } sc->cdev->si_drv1 = sc; + + ctx = device_get_sysctl_ctx(dev); + tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "address_size", CTLFLAG_RD, + &sc->type, 0, "Memory array address size in bits"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "device_size", CTLFLAG_RD, + &sc->size, 0, "Memory array capacity in bytes"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "write_size", CTLFLAG_RD, + &sc->wr_sz, 0, "Memory array page write size in bytes"); + return (0); }