From owner-svn-src-stable-8@FreeBSD.ORG Sun Aug 15 22:51:52 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80131106566B; Sun, 15 Aug 2010 22:51:52 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3618FC17; Sun, 15 Aug 2010 22:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMpqU5075151; Sun, 15 Aug 2010 22:51:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMpqeD075149; Sun, 15 Aug 2010 22:51:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152251.o7FMpqeD075149@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211371 - stable/8/sys/dev/bge X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Aug 2010 22:51:52 -0000 Author: yongari Date: Sun Aug 15 22:51:52 2010 New Revision: 211371 URL: http://svn.freebsd.org/changeset/base/211371 Log: MFC r210011,210013-210015: r210011: Make bge_stop_fw() static. While I'm here use ANSI function definitions. r210013: style. r210014: Fix error message for jumbo buffer allocation failure. r210015: Prefer PCIR_BAR macro over BGE_PCI_BAR0. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:45:40 2010 (r211370) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:51:52 2010 (r211371) @@ -437,6 +437,7 @@ static int bge_poll(struct ifnet *ifp, e static void bge_sig_post_reset(struct bge_softc *, int); static void bge_sig_legacy(struct bge_softc *, int); static void bge_sig_pre_reset(struct bge_softc *, int); +static void bge_stop_fw(struct bge_softc *); static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); @@ -859,7 +860,7 @@ bge_miibus_writereg(device_t dev, int ph if (sc->bge_asicrev == BGE_ASICREV_BCM5906 && (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) - return(0); + return (0); /* Reading with autopolling on may trigger PCI errors */ autopoll = CSR_READ_4(sc, BGE_MI_MODE); @@ -1264,10 +1265,9 @@ bge_setvlan(struct bge_softc *sc) } static void -bge_sig_pre_reset(sc, type) - struct bge_softc *sc; - int type; +bge_sig_pre_reset(struct bge_softc *sc, int type) { + /* * Some chips don't like this so only do this if ASF is enabled */ @@ -1287,10 +1287,9 @@ bge_sig_pre_reset(sc, type) } static void -bge_sig_post_reset(sc, type) - struct bge_softc *sc; - int type; +bge_sig_post_reset(struct bge_softc *sc, int type) { + if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { switch (type) { case BGE_RESET_START: @@ -1305,10 +1304,9 @@ bge_sig_post_reset(sc, type) } static void -bge_sig_legacy(sc, type) - struct bge_softc *sc; - int type; +bge_sig_legacy(struct bge_softc *sc, int type) { + if (sc->bge_asf_mode) { switch (type) { case BGE_RESET_START: @@ -1321,10 +1319,8 @@ bge_sig_legacy(sc, type) } } -void bge_stop_fw(struct bge_softc *); -void -bge_stop_fw(sc) - struct bge_softc *sc; +static void +bge_stop_fw(struct bge_softc *sc) { int i; @@ -2564,7 +2560,7 @@ bge_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = BGE_PCI_BAR0; + rid = PCIR_BAR(0); sc->bge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -3074,7 +3070,7 @@ bge_release_resources(struct bge_softc * if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - BGE_PCI_BAR0, sc->bge_res); + PCIR_BAR(0), sc->bge_res); if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); @@ -3118,7 +3114,7 @@ bge_reset(struct bge_softc *sc) if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || BGE_IS_5755_PLUS(sc)) { if (bootverbose) - device_printf(sc->bge_dev, "Disabling fastboot\n"); + device_printf(dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); } @@ -3239,7 +3235,7 @@ bge_reset(struct bge_softc *sc) DELAY(100); } if (i == BGE_TIMEOUT) { - device_printf(sc->bge_dev, "reset timed out\n"); + device_printf(dev, "reset timed out\n"); return (1); } } else { @@ -3257,8 +3253,9 @@ bge_reset(struct bge_softc *sc) } if ((sc->bge_flags & BGE_FLAG_EADDR) && i == BGE_TIMEOUT) - device_printf(sc->bge_dev, "firmware handshake timed out, " - "found 0x%08x\n", val); + device_printf(dev, + "firmware handshake timed out, found 0x%08x\n", + val); } /* @@ -3310,7 +3307,7 @@ bge_reset(struct bge_softc *sc) } DELAY(10000); - return(0); + return (0); } static __inline void @@ -4298,7 +4295,8 @@ bge_init_locked(struct bge_softc *sc) if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN)) { if (bge_init_rx_ring_jumbo(sc) != 0) { - device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + device_printf(sc->bge_dev, + "no memory for jumbo Rx buffers.\n"); bge_stop(sc); return; }