From owner-svn-src-all@freebsd.org Mon Dec 16 21:34:58 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEA021CF4C6; Mon, 16 Dec 2019 21:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47cF0y4H2Xz4LyB; Mon, 16 Dec 2019 21:34:58 +0000 (UTC) (envelope-from imp@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 8E2AE3996; Mon, 16 Dec 2019 21:34:58 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBGLYwhb096818; Mon, 16 Dec 2019 21:34:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBGLYwhP096816; Mon, 16 Dec 2019 21:34:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201912162134.xBGLYwhP096816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 16 Dec 2019 21:34:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355823 - in head/sys/dev: exca pccbb X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: exca pccbb X-SVN-Commit-Revision: 355823 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2019 21:34:58 -0000 Author: imp Date: Mon Dec 16 21:34:57 2019 New Revision: 355823 URL: https://svnweb.freebsd.org/changeset/base/355823 Log: Add slot number ivar to return which slot number the child is attached to. This will always be 0 for pccbb, but may be non-zero for other kinds of bridges, should they show up in the tree. Make querying it generic. Modified: head/sys/dev/exca/excavar.h head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/exca/excavar.h ============================================================================== --- head/sys/dev/exca/excavar.h Mon Dec 16 21:34:51 2019 (r355822) +++ head/sys/dev/exca/excavar.h Mon Dec 16 21:34:57 2019 (r355823) @@ -151,4 +151,17 @@ exca_clrb(struct exca_softc *sc, int reg, uint8_t mask exca_putb(sc, reg, exca_getb(sc, reg) & ~mask); } +enum { + EXCA_IVAR_SLOT = 100, +}; + +#define EXCA_ACCESSOR(A, B, T) \ +static inline int \ +exca_get_ ## A(device_t dev, T *t) \ +{ \ + return BUS_READ_IVAR(device_get_parent(dev), dev, \ + EXCA_IVAR_ ## B, (uintptr_t *) t); \ +} + +EXCA_ACCESSOR(slot, SLOT, uint32_t) #endif /* !_SYS_DEV_EXCA_EXCAVAR_H */ Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Mon Dec 16 21:34:51 2019 (r355822) +++ head/sys/dev/pccbb/pccbb.c Mon Dec 16 21:34:57 2019 (r355823) @@ -1565,6 +1565,9 @@ cbb_read_ivar(device_t brdev, device_t child, int whic case PCIB_IVAR_BUS: *result = sc->bus.sec; return (0); + case EXCA_IVAR_SLOT: + *result = 0; + return (0); } return (ENOENT); } @@ -1577,6 +1580,8 @@ cbb_write_ivar(device_t brdev, device_t child, int whi case PCIB_IVAR_DOMAIN: return (EINVAL); case PCIB_IVAR_BUS: + return (EINVAL); + case EXCA_IVAR_SLOT: return (EINVAL); } return (ENOENT);