From nobody Tue Jan 31 20:03:25 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P5wwF3dyQz3c8XX; Tue, 31 Jan 2023 20:03:25 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5wwF34K3z3DGy; Tue, 31 Jan 2023 20:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675195405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gtw3FkFMUd3m02Xu0CBQ+w86K6HkLHEdRMIpiwYDjQA=; b=IPxaatkWcdIinYd2qVrQgjeTQajuaNfe8IpOsY/kY37qstjW7a9RwZYT6CZ7TYNiQaQSt4 RFsWUBAXN5sx21Y4DOQDYM2m6x0m+EjQDOxs/LMzMgEualEYr1jOY5TPiagCMWX+XTBRaE rUarep87aUmaleZIR34ZjNMEis34U+DKhfxuwZcyX2g3QRFqxm0yQGz3Cmva46UTmFveBP VVqHodK4rVJyJ07GUS2DPTH6y+AmKnnbjF6OZtlNeBBk3nXpR4d168zNsOBdWcntKN6JsO 7EnlkuHADXfku72NksiITaqFo3dHrp87HgxfJrsnGAlVu0uPYbllu7pt+acrAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675195405; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gtw3FkFMUd3m02Xu0CBQ+w86K6HkLHEdRMIpiwYDjQA=; b=o8HkwP5H1KXaDpZP8eBftVJdGSmlP4wRecIaXg+vvSt+xONEHi00AVrr0Lh1OpF4cwTFtH z1s3x12YTyX5ejf06wL0EvPMOZnHfQNVCME8nFUZ+2mi4oGjx0neG6MTT33717C27P600g ZYck0Y+eU8Ud2ED5xEfPW/a31pfzXGAJV8dyyWqUB/YTdgTet8aiKNVCRTcC0ICp0KxNV0 7+ZYKi6iBTOiIFopTmTCT0+m1eCuODQYyJ3+/oRrTeMSnkwYdBWl2XwZ/yMKhW5xzYBLvb xYF1ejI/aA8dcMsev3QM1bdq3r3KJoh4Q9iWAobk4tLTWaoe0+bw+6kOBk8BIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675195405; a=rsa-sha256; cv=none; b=gSJzv26iaFC81LXKvXI6klCrfoZBHyCsN2A+AfgqOrD2GFeJMijZpcD5+Yi1VNijkB01Ip TPg4X6zlYJFDBGA2vUtpdnIEwVG6LrBfP6M3IvlIrT1WoL5rMI1aWCc4Ywf+HH+p3LXCZO XQdPvO3qB4iLO9aJnxqvFCS41PEeSyHNUMyNAuaLveIstuRLXQjABPR4wk2x6P+3U42r3Y qT93mX9iF9tXHLCjRdppwygBJSn9pwJMaBVmVPDCx/9PYjzRnejrkJUNgxO04qmKFgtWPv M61k1DzT48UAWFnKLtEq8x7VxToMwRl06yneZMGBnXqN1JIQcFk0VJxghyQihA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P5wwF28cXz12NP; Tue, 31 Jan 2023 20:03:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30VK3PwM025125; Tue, 31 Jan 2023 20:03:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30VK3PVH025124; Tue, 31 Jan 2023 20:03:25 GMT (envelope-from git) Date: Tue, 31 Jan 2023 20:03:25 GMT Message-Id: <202301312003.30VK3PVH025124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Justin Hibbits Subject: git: 087f0d352ac6 - main - Mechanically convert bge(4) to DrvAPI List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhibbits X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 087f0d352ac6e949a51b3e7e0f696d10844e8ada Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=087f0d352ac6e949a51b3e7e0f696d10844e8ada commit 087f0d352ac6e949a51b3e7e0f696d10844e8ada Author: Justin Hibbits AuthorDate: 2022-08-19 19:16:26 +0000 Commit: Justin Hibbits CommitDate: 2023-01-31 20:02:18 +0000 Mechanically convert bge(4) to DrvAPI Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D37842 --- sys/dev/bge/if_bge.c | 10 ++++++---- sys/dev/bge/if_bgereg.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c index eb72af69a448..726f89379ad0 100644 --- a/sys/dev/bge/if_bge.c +++ b/sys/dev/bge/if_bge.c @@ -1922,6 +1922,7 @@ bge_blockinit(struct bge_softc *sc) { struct bge_rcb *rcb; bus_size_t vrcb; + caddr_t lladdr; bge_hostaddr taddr; uint32_t dmactl, rdmareg, val; int i, limit; @@ -2268,11 +2269,12 @@ bge_blockinit(struct bge_softc *sc) RCB_WRITE_4(sc, vrcb, bge_maxlen_flags, BGE_RCB_MAXLEN_FLAGS(sc->bge_return_ring_cnt, 0)); + lladdr = if_getlladdr(sc->bge_ifp); /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, - (IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + - IF_LLADDR(sc->bge_ifp)[2] + IF_LLADDR(sc->bge_ifp)[3] + - IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5]) & + (lladdr[0] + lladdr[1] + + lladdr[2] + lladdr[3] + + lladdr[4] + lladdr[5]) & BGE_TX_BACKOFF_SEED_MASK); /* Set inter-packet gap */ @@ -5450,7 +5452,7 @@ bge_init_locked(struct bge_softc *sc) (if_getcapenable(ifp) & IFCAP_VLAN_MTU ? ETHER_VLAN_ENCAP_LEN : 0)); /* Load our MAC address. */ - m = (uint16_t *)IF_LLADDR(sc->bge_ifp); + m = (uint16_t *)if_getlladdr(sc->bge_ifp); CSR_WRITE_4(sc, BGE_MAC_ADDR1_LO, htons(m[0])); CSR_WRITE_4(sc, BGE_MAC_ADDR1_HI, (htons(m[1]) << 16) | htons(m[2])); diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h index 494b5f53694f..98cb76d96162 100644 --- a/sys/dev/bge/if_bgereg.h +++ b/sys/dev/bge/if_bgereg.h @@ -2942,7 +2942,7 @@ struct bge_bcom_hack { #define ASF_STACKUP 4 struct bge_softc { - struct ifnet *bge_ifp; /* interface info */ + if_t bge_ifp; /* interface info */ device_t bge_dev; struct mtx bge_mtx; device_t bge_miibus;