Module Name: src Committed By: tsutsui Date: Fri Sep 18 13:48:54 UTC 2009
Modified Files: src/sys/dev/sbus: be.c Log Message: Split device_t/softc. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/dev/sbus/be.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/sbus/be.c diff -u src/sys/dev/sbus/be.c:1.68 src/sys/dev/sbus/be.c:1.69 --- src/sys/dev/sbus/be.c:1.68 Fri Sep 18 13:45:20 2009 +++ src/sys/dev/sbus/be.c Fri Sep 18 13:48:54 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: be.c,v 1.68 2009/09/18 13:45:20 tsutsui Exp $ */ +/* $NetBSD: be.c,v 1.69 2009/09/18 13:48:54 tsutsui Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.68 2009/09/18 13:45:20 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: be.c,v 1.69 2009/09/18 13:48:54 tsutsui Exp $"); #include "opt_ddb.h" #include "opt_inet.h" @@ -114,7 +114,7 @@ #include <dev/sbus/bereg.h> struct be_softc { - struct device sc_dev; + device_t sc_dev; bus_space_tag_t sc_bustag; /* bus & DMA tags */ bus_dma_tag_t sc_dmatag; bus_dmamap_t sc_dmamap; @@ -205,7 +205,7 @@ int be_intphy_service(struct be_softc *, struct mii_data *, int); -CFATTACH_DECL(be, sizeof(struct be_softc), +CFATTACH_DECL_NEW(be, sizeof(struct be_softc), bematch, beattach, NULL, NULL); int @@ -233,6 +233,8 @@ int rseg, error; u_int32_t v; + sc->sc_dev = self; + if (sa->sa_nreg < 3) { printf("%s: only %d register sets\n", device_xname(self), sa->sa_nreg); @@ -715,7 +717,7 @@ { struct be_softc *sc = ifp->if_softc; - log(LOG_ERR, "%s: device timeout\n", device_xname(&sc->sc_dev)); + log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev)); ++sc->sc_ethercom.ec_if.if_oerrors; bereset(sc); @@ -755,7 +757,7 @@ int beqint(struct be_softc *sc, u_int32_t why) { - device_t self = &sc->sc_dev; + device_t self = sc->sc_dev; int r = 0, rst = 0; if (why & BE_CR_STAT_TXIRQ) @@ -833,7 +835,7 @@ int beeint(struct be_softc *sc, u_int32_t why) { - device_t self = &sc->sc_dev; + device_t self = sc->sc_dev; int r = 0, rst = 0; if (why & BE_BR_STAT_RFIFOVF) { @@ -1384,7 +1386,7 @@ int be_mii_reset(struct be_softc *sc, int phy) { - device_t self = &sc->sc_dev; + device_t self = sc->sc_dev; int n; be_mii_writereg(self, phy, MII_BMCR, @@ -1485,7 +1487,7 @@ be_intphy_service(struct be_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; - device_t self = &sc->sc_dev; + device_t self = sc->sc_dev; int bmcr, bmsr; int error; @@ -1639,7 +1641,7 @@ be_intphy_status(struct be_softc *sc) { struct mii_data *mii = &sc->sc_mii; - device_t self = &sc->sc_dev; + device_t self = sc->sc_dev; int media_active, media_status; int bmcr, bmsr;