From owner-svn-src-head@freebsd.org Fri Sep 30 17:19:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 386D9C0385E; Fri, 30 Sep 2016 17:19:44 +0000 (UTC) (envelope-from loos@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 mx1.freebsd.org (Postfix) with ESMTPS id 1659A303; Fri, 30 Sep 2016 17:19:44 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8UHJhn8047382; Fri, 30 Sep 2016 17:19:43 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8UHJhdv047381; Fri, 30 Sep 2016 17:19:43 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201609301719.u8UHJhdv047381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 30 Sep 2016 17:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306511 - head/sys/arm/ti/cpsw X-SVN-Group: head 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.23 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: Fri, 30 Sep 2016 17:19:44 -0000 Author: loos Date: Fri Sep 30 17:19:43 2016 New Revision: 306511 URL: https://svnweb.freebsd.org/changeset/base/306511 Log: Fix a typo in CPSW_DEBUG MACRO and then replace all the CPSWP_DEBUG() calls with CPSW_DEBUG(). Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Sep 30 17:16:02 2016 (r306510) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Sep 30 17:19:43 2016 (r306511) @@ -255,8 +255,6 @@ static struct cpsw_stat { * Basic debug support. */ -#define IF_DEBUG(_sc) if ((_sc)->if_flags & IFF_DEBUG) - static void cpsw_debugf_head(const char *funcname) { @@ -278,20 +276,12 @@ cpsw_debugf(const char *fmt, ...) } #define CPSW_DEBUGF(_sc, a) do { \ - if (sc->debug) { \ + if ((_sc)->debug) { \ cpsw_debugf_head(__func__); \ cpsw_debugf a; \ } \ } while (0) -#define CPSWP_DEBUGF(_sc, a) do { \ - IF_DEBUG((_sc)) { \ - cpsw_debugf_head(__func__); \ - cpsw_debugf a; \ - } \ -} while (0) - - /* * Locking macros */ @@ -1052,7 +1042,7 @@ cpswp_detach(device_t dev) struct cpswp_softc *sc; sc = device_get_softc(dev); - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); if (device_is_attached(dev)) { ether_ifdetach(sc->ifp); CPSW_PORT_LOCK(sc); @@ -1098,7 +1088,7 @@ cpswp_init(void *arg) { struct cpswp_softc *sc = arg; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK(sc); cpswp_init_locked(arg); CPSW_PORT_UNLOCK(sc); @@ -1111,7 +1101,7 @@ cpswp_init_locked(void *arg) struct ifnet *ifp; uint32_t reg; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK_ASSERT(sc); ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) @@ -1240,7 +1230,7 @@ cpswp_stop_locked(struct cpswp_softc *sc uint32_t reg; ifp = sc->ifp; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK_ASSERT(sc); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -1362,7 +1352,7 @@ cpswp_ioctl(struct ifnet *ifp, u_long co if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { changed = ifp->if_flags ^ sc->if_flags; - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: UP & RUNNING (changed=0x%x)", changed)); if (changed & IFF_PROMISC) @@ -1372,12 +1362,12 @@ cpswp_ioctl(struct ifnet *ifp, u_long co cpsw_set_allmulti(sc, ifp->if_flags & IFF_ALLMULTI); } else { - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: UP but not RUNNING; starting up")); cpswp_init_locked(sc); } } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("SIOCSIFFLAGS: not UP but RUNNING; shutting down")); cpswp_stop_locked(sc); } @@ -1488,7 +1478,7 @@ cpswp_miibus_statchg(device_t dev) uint32_t mac_control, reg; sc = device_get_softc(dev); - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); reg = CPSW_SL_MACCONTROL(sc->unit); mac_control = cpsw_read_4(sc->swsc, reg); @@ -1766,7 +1756,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) "Can't defragment packet; dropping\n"); m_freem(slot->mbuf); } else { - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("Requeueing defragmented packet")); IF_PREPEND(&sc->ifp->if_snd, m0); } @@ -1786,7 +1776,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bus_dmamap_sync(sc->swsc->mbuf_dtag, slot->dmamap, BUS_DMASYNC_PREWRITE); - CPSWP_DEBUGF(sc, + CPSW_DEBUGF(sc->swsc, ("Queueing TX packet: %d segments + %d pad bytes", nsegs, padlen)); @@ -2115,7 +2105,7 @@ cpswp_ifmedia_sts(struct ifnet *ifp, str struct mii_data *mii; sc = ifp->if_softc; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK(sc); mii = sc->mii; @@ -2132,7 +2122,7 @@ cpswp_ifmedia_upd(struct ifnet *ifp) struct cpswp_softc *sc; sc = ifp->if_softc; - CPSWP_DEBUGF(sc, ("")); + CPSW_DEBUGF(sc->swsc, ("")); CPSW_PORT_LOCK(sc); mii_mediachg(sc->mii); sc->media_status = sc->mii->mii_media.ifm_media;