From owner-p4-projects@FreeBSD.ORG Tue Jan 3 22:37:39 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4556C16A422; Tue, 3 Jan 2006 22:37:39 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02C3F16A41F for ; Tue, 3 Jan 2006 22:37:39 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2168543D6D for ; Tue, 3 Jan 2006 22:37:37 +0000 (GMT) (envelope-from imp@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k03Mbb5O033506 for ; Tue, 3 Jan 2006 22:37:37 GMT (envelope-from imp@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k03MbaYJ033503 for perforce@freebsd.org; Tue, 3 Jan 2006 22:37:36 GMT (envelope-from imp@freebsd.org) Date: Tue, 3 Jan 2006 22:37:36 GMT Message-Id: <200601032237.k03MbaYJ033503@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to imp@freebsd.org using -f From: Warner Losh To: Perforce Change Reviews Cc: Subject: PERFORCE change 89111 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2006 22:37:40 -0000 http://perforce.freebsd.org/chv.cgi?CH=89111 Change 89111 by imp@imp_Speedy on 2006/01/03 22:37:30 compile Affected files ... .. //depot/projects/arm/src/sys/arm/at91/if_ate.c#2 edit Differences ... ==== //depot/projects/arm/src/sys/arm/at91/if_ate.c#2 (text+ko) ==== @@ -29,8 +29,11 @@ #include #include #include +#include #include #include +#include +#include #include #include @@ -53,6 +56,15 @@ { struct ifnet *ifp; struct mtx sc_mtx; + device_t dev; + void *intrhand; + struct resource *irq_res; + int irq_rid; + struct resource *port_res; + int port_rid; + + // XXX bogus + int intr; }; #define ATE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -82,6 +94,7 @@ static int ate_probe(device_t dev); static int ate_attach(device_t dev); static int ate_detach(device_t dev); +static void ate_intr(void *); /* helper routines */ static int ate_activate(device_t dev); @@ -104,9 +117,11 @@ ate_attach(device_t dev) { struct ate_softc *sc = device_get_softc(dev); - struct ifnet *ifp; + struct ifnet *ifp = NULL; int err; + u_char eaddr[6]; + sc->dev = dev; err = ate_activate(dev); if (err) goto out; @@ -114,7 +129,7 @@ /* calling atestop before ifp is set is OK */ atestop(sc); ATE_LOCK_INIT(sc); - ifp = sc->ifp = if_alloc(IFT_ETHER); + sc->ifp = ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_mtu = ETHERMTU; @@ -134,14 +149,14 @@ /* * Activate the interrupt */ - err = bus_seutp_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, + err = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET | INTR_MPSAFE, ate_intr, sc, &sc->intrhand); if (err) - ether_detach(ifp); + ether_ifdetach(ifp); ATE_LOCK_DESTROY(sc); out:; if (err) - ate_deactive(dev); + ate_deactivate(dev); if (err && ifp) if_free(ifp); return (err); @@ -150,6 +165,7 @@ static int ate_detach(device_t dev) { + return EBUSY; /* XXX */ } static int @@ -164,29 +180,38 @@ return EINVAL; /* XXX */ } +static void +ate_intr(void *xsc) +{ + struct ate_softc *sc = xsc; + + sc->intr++; +} + /* * Reset and initialize the chip */ static void -ateinit_locked(void *) +ateinit_locked(void *xsc) { - struct sn_softc *sc = xsc; - struct ifnet *ifp = sc->ifp; + struct ate_softc *sc = xsc; +// struct ifnet *ifp = sc->ifp; ATE_ASSERT_LOCKED(sc); /* Insert code here */ + sc->intr++; } /* * dequeu packets and transmit */ static void -atestart_locked(struct ifnet *) +atestart_locked(struct ifnet *ifp) { - struct sn_softc *sc = ifp->if_softc; + struct ate_softc *sc = ifp->if_softc; - SN_ASSERT_LOCKED(sc); + ATE_ASSERT_LOCKED(sc); if (sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) return; /* XXX deque packets and transmit */ @@ -215,18 +240,18 @@ * so be careful. */ static void -atestop(struct ate_softc *) +atestop(struct ate_softc *sc) { } static void -atewatchdog(struct ifnet *) +atewatchdog(struct ifnet *ifp) { /* timeout, not sure what to do */ } static int -ateioctl(struct ifnet * ifp, u_long, caddr_t) +ateioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ate_softc *sc = ifp->if_softc; int error = 0;