From owner-p4-projects Sun Dec 22 11:19:55 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id C3FC437B405; Sun, 22 Dec 2002 11:19:52 -0800 (PST) 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 5CE8537B401 for ; Sun, 22 Dec 2002 11:19:52 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11A6B43EDA for ; Sun, 22 Dec 2002 11:19:52 -0800 (PST) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id gBMJJpfh009689 for ; Sun, 22 Dec 2002 11:19:51 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBMJJpY3009686 for perforce@freebsd.org; Sun, 22 Dec 2002 11:19:51 -0800 (PST) Date: Sun, 22 Dec 2002 11:19:51 -0800 (PST) Message-Id: <200212221919.gBMJJpY3009686@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 22625 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://perforce.freebsd.org/chv.cgi?CH=22625 Change 22625 by marcel@marcel_nfs on 2002/12/22 11:19:45 Convert to the new sioprobe/sioattach interface. Untested. Affected files ... .. //depot/projects/ia64/sys/dev/sio/sio_ebus.c#4 edit Differences ... ==== //depot/projects/ia64/sys/dev/sio/sio_ebus.c#4 (text+ko) ==== @@ -34,6 +34,9 @@ #include #include +#include + +#include #include @@ -55,7 +58,7 @@ static driver_t sio_ebus_driver = { sio_driver_name, sio_ebus_methods, - 0, + sizeof(struct com_s), }; DRIVER_MODULE(sio, ebus, sio_ebus_driver, sio_devclass, 0, 0); @@ -94,20 +97,43 @@ sio_ebus_probe(dev) device_t dev; { - char *n; + struct com_s *com; + struct resource *res; + char *n; + int error, rid; n = ebus_get_name(dev); if (!sio_ofw_inlist(n, sio_ofw_names) && (strcmp(n, "serial") != 0 || !sio_ofw_inlist(ebus_get_compat(dev), sio_ofw_compat))) return (ENXIO); - /* Do not probe IRQ - isa_irq_pending() does not work for ebus. */ - return (sioprobe(dev, 0, 0UL, 1)); + + com = device_get_softc(dev); + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 8, + RF_ACTIVE); + com->bsh = rman_get_bushandle(res); + com->bst = rman_get_bustag(res); + error = sioprobe(dev); + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + return (error); } static int sio_ebus_attach(dev) device_t dev; { + struct com_s *com; + struct resource *res; + int error, rid; - return (sioattach(dev, 0, 0UL)); + com = device_get_softc(dev); + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 8, + RF_ACTIVE); + com->bsh = rman_get_bushandle(res); + com->bst = rman_get_bustag(res); + error = sioattach(dev, 0, 0UL); + if (error) + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message