From nobody Wed Mar 08 15:15:48 2023 X-Original-To: dev-commits-src-all@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 4PWwqm6SgLz3wWDL; Wed, 8 Mar 2023 15:15:48 +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 4PWwqm61wjz3P9P; Wed, 8 Mar 2023 15:15:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678288548; 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=+5OaAptdIYBENP2I6VbVwROC0z43D3GfRAWpW2ZBaSY=; b=iQtcjeiAOJT0V5do0AyP3OC0925DYOEyiDFADpppDpvQJ8zUSl9j99Mg1uzvrK4mLnGsSr BHPqy2BAk54+a+J0Gc/v6fNKGR6nWJPTq4mi8n4ruqJnZZv+x33QdaOZZw2K2fjIj+KkcS peRdOjcgZb93drV4mYIOkTJKQvCuZmkKCy5ndnP7lvVB9a5jsXinSZo/a0jN2zeRN+PJFs VNx/S1DPcQXxVyrRYKD0nWNr1B8DOjD9qmqEUsyHX5l9eGmVezbtw2duji3wphObpDTezv sN45USShO06lsPiAAUvUjwaEeiSV5T1zfuQgTb6v/Sa/RlYAdchY7jziERU2XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678288548; 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=+5OaAptdIYBENP2I6VbVwROC0z43D3GfRAWpW2ZBaSY=; b=uNpO2raRekENkFst7az9xQJH5POorhbJbQGjZxPuYnGWW106mfpXPK/XyxqS8EOhwpIpTv oR8KFXW3l7fuZqYYfhA/PbXHDpWpKrSTSdys3iDi8/kRd4KgUN/Phmkclc+T10UkMrYrMf Lth5ozFKwn8TOPj2AMU86kFLHu9+xvbx+iKG0zssNM0lonhd6fn8cxxnvvO8c16pEK+c69 yfKZrTGzECyQGjWiGI4xgQAob88pwJqr0AUvLoP6HXBeUATbYGUZznipTQVqUmXhktMBJB OgpVcNzLei5EZ5cJmLto8ldr36dBx4pJoHVVi8p03sRkLa8vIU+KgV20KU8e7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678288548; a=rsa-sha256; cv=none; b=US9Nbjo2BEWVJiNBIZ3agGF2yGKeoLe2hHyOXRlVRhRHebRMvWz3S9C6L87D2tpcgkc3hE KI0ohf0Vmi8gsCX+epGJBCS9EobujTasMCCrpOrOOvLIKLDschm9zUjhtnAo2T8h9bTW6j bDKpm+k94O6ViFRPSLhdn1SjI0jXGrL12SmNWkJrdqhAn87j+LwjZNvkUFQHHpe6D3XspF eRexNTbYo1/2xIIc+IYuyTW+QNrJwoLesl8fDqYrbx94PeNX7xLkR71JmOlUGYW/4mRBwg 48Q+V9W1sDz7NNu40g7Srm2zthPcXJLT9irSaJwDSm7RzLmjQ7dJ4X9HFRXmyw== 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 4PWwqm55mYzVf8; Wed, 8 Mar 2023 15:15:48 +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 328FFmRT031152; Wed, 8 Mar 2023 15:15:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 328FFmMV031151; Wed, 8 Mar 2023 15:15:48 GMT (envelope-from git) Date: Wed, 8 Mar 2023 15:15:48 GMT Message-Id: <202303081515.328FFmMV031151@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: a472fd7a5737 - main - eqos: Mechanically convert to IfAPI List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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: a472fd7a5737192addae1022ad682581224920f0 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=a472fd7a5737192addae1022ad682581224920f0 commit a472fd7a5737192addae1022ad682581224920f0 Author: Justin Hibbits AuthorDate: 2023-03-07 21:27:35 +0000 Commit: Justin Hibbits CommitDate: 2023-03-08 15:18:16 +0000 eqos: Mechanically convert to IfAPI Reviewed by: zlei Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D38963 --- sys/dev/eqos/if_eqos.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sys/dev/eqos/if_eqos.c b/sys/dev/eqos/if_eqos.c index 1eba702bb524..d6bd84097a13 100644 --- a/sys/dev/eqos/if_eqos.c +++ b/sys/dev/eqos/if_eqos.c @@ -222,9 +222,9 @@ eqos_miibus_statchg(device_t dev) } static void -eqos_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) +eqos_media_status(if_t ifp, struct ifmediareq *ifmr) { - struct eqos_softc *sc = ifp->if_softc; + struct eqos_softc *sc = if_getsoftc(ifp); struct mii_data *mii = device_get_softc(sc->miibus); EQOS_LOCK(sc); @@ -235,9 +235,9 @@ eqos_media_status(struct ifnet *ifp, struct ifmediareq *ifmr) } static int -eqos_media_change(struct ifnet *ifp) +eqos_media_change(if_t ifp) { - struct eqos_softc *sc = ifp->if_softc; + struct eqos_softc *sc = if_getsoftc(ifp); int error; EQOS_LOCK(sc); @@ -408,7 +408,7 @@ eqos_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) static void eqos_setup_rxfilter(struct eqos_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; uint32_t pfil, hash[2]; const uint8_t *eaddr; uint32_t val; @@ -422,10 +422,10 @@ eqos_setup_rxfilter(struct eqos_softc *sc) GMAC_MAC_PACKET_FILTER_PCF_MASK); hash[0] = hash[1] = 0xffffffff; - if ((ifp->if_flags & IFF_PROMISC)) { + if ((if_getflags(ifp) & IFF_PROMISC)) { pfil |= GMAC_MAC_PACKET_FILTER_PR | GMAC_MAC_PACKET_FILTER_PCF_ALL; - } else if ((ifp->if_flags & IFF_ALLMULTI)) { + } else if ((if_getflags(ifp) & IFF_ALLMULTI)) { pfil |= GMAC_MAC_PACKET_FILTER_PM; } else { hash[0] = hash[1] = 0; @@ -434,7 +434,7 @@ eqos_setup_rxfilter(struct eqos_softc *sc) } /* Write our unicast address */ - eaddr = IF_LLADDR(ifp); + eaddr = if_getlladdr(ifp); val = eaddr[4] | (eaddr[5] << 8); WR4(sc, GMAC_MAC_ADDRESS0_HIGH, val); val = eaddr[0] | (eaddr[1] << 8) | (eaddr[2] << 16) | @@ -489,7 +489,7 @@ static void eqos_init(void *if_softc) { struct eqos_softc *sc = if_softc; - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct mii_data *mii = device_get_softc(sc->miibus); uint32_t val; @@ -569,9 +569,9 @@ eqos_init(void *if_softc) } static void -eqos_start_locked(struct ifnet *ifp) +eqos_start_locked(if_t ifp) { - struct eqos_softc *sc = ifp->if_softc; + struct eqos_softc *sc = if_getsoftc(ifp); struct mbuf *m; int pending = 0; @@ -613,9 +613,9 @@ eqos_start_locked(struct ifnet *ifp) } static void -eqos_start(struct ifnet *ifp) +eqos_start(if_t ifp) { - struct eqos_softc *sc = ifp->if_softc; + struct eqos_softc *sc = if_getsoftc(ifp); EQOS_LOCK(sc); eqos_start_locked(ifp); @@ -625,7 +625,7 @@ eqos_start(struct ifnet *ifp) static void eqos_stop(struct eqos_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; uint32_t val; int retry; @@ -676,7 +676,7 @@ eqos_stop(struct eqos_softc *sc) static void eqos_rxintr(struct eqos_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct mbuf *m; uint32_t rdes3; int error, length; @@ -706,7 +706,7 @@ eqos_rxintr(struct eqos_softc *sc) m_adj(m, -ETHER_CRC_LEN); EQOS_UNLOCK(sc); - (*ifp->if_input)(ifp, m); + if_input(ifp, m); EQOS_LOCK(sc); } @@ -729,7 +729,7 @@ eqos_rxintr(struct eqos_softc *sc) static void eqos_txintr(struct eqos_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; struct eqos_bufmap *bmap; uint32_t tdes3; @@ -865,9 +865,9 @@ eqos_intr(void *arg) } static int -eqos_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +eqos_ioctl(if_t ifp, u_long cmd, caddr_t data) { - struct eqos_softc *sc = ifp->if_softc; + struct eqos_softc *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; int flags, mask; @@ -1105,7 +1105,7 @@ static int eqos_attach(device_t dev) { struct eqos_softc *sc = device_get_softc(dev); - struct ifnet *ifp; + if_t ifp; uint32_t ver; uint8_t eaddr[ETHER_ADDR_LEN]; u_int userver, snpsver; @@ -1178,7 +1178,7 @@ eqos_attach(device_t dev) /* Setup ethernet interface */ ifp = sc->ifp = if_alloc(IFT_ETHER); - ifp->if_softc = sc; + if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(sc->dev), device_get_unit(sc->dev)); if_setflags(sc->ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setstartfn(ifp, eqos_start); @@ -1213,7 +1213,7 @@ eqos_detach(device_t dev) EQOS_LOCK(sc); eqos_stop(sc); EQOS_UNLOCK(sc); - sc->ifp->if_flags &= ~IFF_UP; + if_setflagbits(sc->ifp, 0, IFF_UP); ether_ifdetach(sc->ifp); }