svn commit: r211372 - stable/7/sys/dev/bge

Pyun YongHyeon yongari at FreeBSD.org
Sun Aug 15 22:53:47 UTC 2010


Author: yongari
Date: Sun Aug 15 22:53:46 2010
New Revision: 211372
URL: http://svn.freebsd.org/changeset/base/211372

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/7/sys/dev/bge/if_bge.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c	Sun Aug 15 22:51:52 2010	(r211371)
+++ stable/7/sys/dev/bge/if_bge.c	Sun Aug 15 22:53:46 2010	(r211372)
@@ -437,6 +437,7 @@ static void bge_poll(struct ifnet *ifp, 
 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 | PCI_RF_DENSE);
 
@@ -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
@@ -4294,7 +4291,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;
 		}


More information about the svn-src-all mailing list