From nobody Thu Jun 23 18:15:57 2022 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 5B1E1876456; Thu, 23 Jun 2022 18:15:58 +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 4LTT2j68D2z3PM9; Thu, 23 Jun 2022 18:15:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656008157; 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=ZyPyByKBgRW5RrqW6V3DUvxBEMzT7pRiwCRj4R+uHyM=; b=qsQ0zn1MiVgIOW5Nd0gTO0scyutgei1MZSSoA0eZgLx1urtJGkFGg+6WoAAmDT8u/jlvIs +KOtG0IZSPrva9dh6dxk6ZkVNotHl/vRw5+ZHjw6bCmEja46jAQVO2Bj1NaNr2bjpwps2Q euLQm6ctgHLn22YMtxmlwlXwZXh1EPvaKgIZEFpbdNY92mfal04Ow0BihOuvf22lpYG2AK OXeTdVe9/tquLhzr8WdIOHo9O8KLjiXiv4eGw/nWHp3KVKBR8X8J9BSlVWYgO9esa02BFK LQUG4q9M3qfqwgobh3q64gjUlhvyy8r4a7ERbwDf19OzPzjn5l5hib4+8pNyKw== 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 B2D03200C3; Thu, 23 Jun 2022 18:15:57 +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 25NIFvOp014704; Thu, 23 Jun 2022 18:15:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25NIFvFN014703; Thu, 23 Jun 2022 18:15:57 GMT (envelope-from git) Date: Thu, 23 Jun 2022 18:15:57 GMT Message-Id: <202206231815.25NIFvFN014703@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: ca01879004d4 - main - if_dwc: consistently use if.c helper methods 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca01879004d4fe49c2617f15048a52281963d0ac Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656008157; 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=ZyPyByKBgRW5RrqW6V3DUvxBEMzT7pRiwCRj4R+uHyM=; b=pFOKY4U2pTHwaQaxgdx8/O/HVvd5BTQ03fBucflTAmtSB1xWZu14ZWCUE8gCi3Bz7zAP/p 5iIpITsVxqSW8XjU8mkIMYrynTefPSsfpC6yCr6cmF7veJd9GcVaq7gGZ0dtZujc9j7CSx n25PNo959pyip7sIjg4LsILfdn7unYaizgOOF3l4U9PceJoWSGcP0UUIzWMD3oneMNjDvb +5sJcJWC8jvVlACCVeMztTYQPyOHHEYuI3Tg/5XoVW8ad4FoQlJl1iK9ZREVbBgZnfSTlv 04ZdLySipTKh6k44/7wdPgGRlpz3OFSlgvaf/8aa5BbK8kMw/gIIRYVjdI6Aug== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656008157; a=rsa-sha256; cv=none; b=a8+1AqmAjeR0K0ZtBMSmLzonY60JZ3yX4DBtjgTLRwzd05L1Kg7IDfXc9WCk8718o/VKxS /Gg5lkgaovykSXllTZbErJ31wneAJGU8mmGzfz4TqAL4NBQm9pn1SRyDkVuvXZxZcEQA8N 7EW6KS36oTxVXpVsi7fBdjaF8g2d4WclWxyWsFU7ktY9IB2nGzQ6dtAH3FMAmmEvNS0T8z qEpoXESgP29X7GYw/tFHT8NTSqycIFXvp2/QnB7hCairlOkT6aCYQnz+2C02x2fDIuFT7Z znGEjnkJigAfba/I+voK9qB6G0OOUn4/2CnXmyf8VQScPy+mo1d99lMT4zCSDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=ca01879004d4fe49c2617f15048a52281963d0ac commit ca01879004d4fe49c2617f15048a52281963d0ac Author: Mitchell Horne AuthorDate: 2022-06-21 13:28:06 +0000 Commit: Mitchell Horne CommitDate: 2022-06-23 18:15:09 +0000 if_dwc: consistently use if.c helper methods And if_t rather than struct ifnet *. No functional change intended. Reviewed by: manu MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35497 --- sys/dev/dwc/if_dwc.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c index d2d73f2d313c..e83d2f7906c9 100644 --- a/sys/dev/dwc/if_dwc.c +++ b/sys/dev/dwc/if_dwc.c @@ -354,12 +354,12 @@ dwc_miibus_statchg(device_t dev) */ static void -dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) +dwc_media_status(if_t ifp, struct ifmediareq *ifmr) { struct dwc_softc *sc; struct mii_data *mii; - sc = ifp->if_softc; + sc = if_getsoftc(ifp); mii = sc->mii_softc; DWC_LOCK(sc); mii_pollstat(mii); @@ -376,12 +376,12 @@ dwc_media_change_locked(struct dwc_softc *sc) } static int -dwc_media_change(struct ifnet * ifp) +dwc_media_change(if_t ifp) { struct dwc_softc *sc; int error; - sc = ifp->if_softc; + sc = if_getsoftc(ifp); DWC_LOCK(sc); error = dwc_media_change_locked(sc); @@ -441,7 +441,7 @@ static void dwc_setup_rxfilter(struct dwc_softc *sc) { struct dwc_hash_maddr_ctx ctx; - struct ifnet *ifp; + if_t ifp; uint8_t *eaddr; uint32_t ffval, hi, lo; int nhash, i; @@ -454,7 +454,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) /* * Set the multicast (group) filter hash. */ - if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + if ((if_getflags(ifp) & IFF_ALLMULTI) != 0) { ffval = (FRAME_FILTER_PM); for (i = 0; i < nhash; i++) ctx.hash[i] = ~0; @@ -469,7 +469,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) /* * Set the individual address filter hash. */ - if (ifp->if_flags & IFF_PROMISC) + if ((if_getflags(ifp) & IFF_PROMISC) != 0) ffval |= (FRAME_FILTER_PR); /* @@ -802,7 +802,7 @@ static struct mbuf * dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc, struct dwc_bufmap *map) { - struct ifnet *ifp; + if_t ifp; struct mbuf *m, *m0; int len; uint32_t rdesc0; @@ -873,7 +873,7 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc, m_adj(m, -ETHER_CRC_LEN); DWC_UNLOCK(sc); - (*ifp->if_input)(ifp, m); + if_input(ifp, m); DWC_LOCK(sc); return (m0); } @@ -1050,7 +1050,7 @@ out: static void dwc_txstart_locked(struct dwc_softc *sc) { - struct ifnet *ifp; + if_t ifp; struct mbuf *m; int enqueued; @@ -1099,9 +1099,9 @@ dwc_txstart_locked(struct dwc_softc *sc) } static void -dwc_txstart(struct ifnet *ifp) +dwc_txstart(if_t ifp) { - struct dwc_softc *sc = ifp->if_softc; + struct dwc_softc *sc = if_getsoftc(ifp); DWC_LOCK(sc); dwc_txstart_locked(sc); @@ -1111,7 +1111,7 @@ dwc_txstart(struct ifnet *ifp) static void dwc_init_locked(struct dwc_softc *sc) { - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; DWC_ASSERT_LOCKED(sc); @@ -1146,7 +1146,7 @@ dwc_init(void *if_softc) static void dwc_stop_locked(struct dwc_softc *sc) { - struct ifnet *ifp; + if_t ifp; DWC_ASSERT_LOCKED(sc); @@ -1162,14 +1162,14 @@ dwc_stop_locked(struct dwc_softc *sc) } static int -dwc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +dwc_ioctl(if_t ifp, u_long cmd, caddr_t data) { struct dwc_softc *sc; struct mii_data *mii; struct ifreq *ifr; int flags, mask, error; - sc = ifp->if_softc; + sc = if_getsoftc(ifp); ifr = (struct ifreq *)data; error = 0; @@ -1238,7 +1238,7 @@ dwc_txfinish_locked(struct dwc_softc *sc) { struct dwc_bufmap *bmap; struct dwc_hwdesc *desc; - struct ifnet *ifp; + if_t ifp; int idx, last_idx; bool map_finished; @@ -1369,7 +1369,7 @@ static void dwc_clear_stats(struct dwc_softc *sc) static void dwc_harvest_stats(struct dwc_softc *sc) { - struct ifnet *ifp; + if_t ifp; /* We don't need to harvest too often. */ if (++sc->stats_harvest_count < STATS_HARVEST_INTERVAL) @@ -1402,7 +1402,7 @@ static void dwc_tick(void *arg) { struct dwc_softc *sc; - struct ifnet *ifp; + if_t ifp; int link_was_up; sc = arg; @@ -1551,7 +1551,7 @@ dwc_attach(device_t dev) { uint8_t macaddr[ETHER_ADDR_LEN]; struct dwc_softc *sc; - struct ifnet *ifp; + if_t ifp; int error, i; uint32_t reg; phandle_t node; @@ -1677,7 +1677,7 @@ dwc_attach(device_t dev) /* Set up the ethernet interface. */ sc->ifp = ifp = if_alloc(IFT_ETHER); - ifp->if_softc = sc; + if_setsoftc(ifp, sc); if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setflags(sc->ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); if_setstartfn(ifp, dwc_txstart);