svn commit: r187308 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/bge dev/cxgb

Marius Strobl marius at FreeBSD.org
Thu Jan 15 12:19:54 PST 2009


Author: marius
Date: Thu Jan 15 20:19:53 2009
New Revision: 187308
URL: http://svn.freebsd.org/changeset/base/187308

Log:
  MFC: r183896
  
  Use bus_{read,write}_4(9) instead of bus_space_{read,write}_4(9)
  in order to get rid of the bus space handle and tag in the softc.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/bge/if_bge.c
  stable/7/sys/dev/bge/if_bgereg.h
  stable/7/sys/dev/cxgb/   (props changed)

Modified: stable/7/sys/dev/bge/if_bge.c
==============================================================================
--- stable/7/sys/dev/bge/if_bge.c	Thu Jan 15 20:13:50 2009	(r187307)
+++ stable/7/sys/dev/bge/if_bge.c	Thu Jan 15 20:19:53 2009	(r187308)
@@ -2387,11 +2387,7 @@ bge_attach(device_t dev)
 		goto fail;
 	}
 
-	sc->bge_btag = rman_get_bustag(sc->bge_res);
-	sc->bge_bhandle = rman_get_bushandle(sc->bge_res);
-
 	/* Save ASIC rev. */
-
 	sc->bge_chipid =
 	    pci_read_config(dev, BGE_PCI_MISC_CTL, 4) &
 	    BGE_PCIMISCCTL_ASICREV;

Modified: stable/7/sys/dev/bge/if_bgereg.h
==============================================================================
--- stable/7/sys/dev/bge/if_bgereg.h	Thu Jan 15 20:13:50 2009	(r187307)
+++ stable/7/sys/dev/bge/if_bgereg.h	Thu Jan 15 20:19:53 2009	(r187308)
@@ -1896,8 +1896,7 @@ struct bge_rcb {
 };
 
 #define	RCB_WRITE_4(sc, rcb, offset, val) \
-	bus_space_write_4(sc->bge_btag, sc->bge_bhandle, \
-			  rcb + offsetof(struct bge_rcb, offset), val)
+	bus_write_4(sc->bge_res, rcb + offsetof(struct bge_rcb, offset), val)
 #define	BGE_RCB_MAXLEN_FLAGS(maxlen, flags)	((maxlen) << 16 | (flags))
 
 #define	BGE_RCB_FLAG_USE_EXT_RX_BD	0x0001
@@ -2394,10 +2393,10 @@ struct bge_gib {
  */
 
 #define	CSR_WRITE_4(sc, reg, val)	\
-	bus_space_write_4(sc->bge_btag, sc->bge_bhandle, reg, val)
+	bus_write_4(sc->bge_res, reg, val)
 
 #define	CSR_READ_4(sc, reg)		\
-	bus_space_read_4(sc->bge_btag, sc->bge_bhandle, reg)
+	bus_read_4(sc->bge_res, reg)
 
 #define	BGE_SETBIT(sc, reg, x)	\
 	CSR_WRITE_4(sc, reg, (CSR_READ_4(sc, reg) | (x)))
@@ -2522,8 +2521,6 @@ struct bge_softc {
 	device_t		bge_dev;
 	struct mtx		bge_mtx;
 	device_t		bge_miibus;
-	bus_space_handle_t	bge_bhandle;
-	bus_space_tag_t		bge_btag;
 	void			*bge_intrhand;
 	struct resource		*bge_irq;
 	struct resource		*bge_res;


More information about the svn-src-stable-7 mailing list