From owner-p4-projects Sun Dec 22 11:37:19 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0DDA937B405; Sun, 22 Dec 2002 11:37:16 -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 998C537B401 for ; Sun, 22 Dec 2002 11:37:15 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3544143EE5 for ; Sun, 22 Dec 2002 11:37:15 -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 gBMJbFfh016783 for ; Sun, 22 Dec 2002 11:37:15 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBMJbEP9016780 for perforce@freebsd.org; Sun, 22 Dec 2002 11:37:14 -0800 (PST) Date: Sun, 22 Dec 2002 11:37:14 -0800 (PST) Message-Id: <200212221937.gBMJbEP9016780@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 22628 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=22628 Change 22628 by marcel@marcel_nfs on 2002/12/22 11:36:15 Convert to new sioprobe/sioattach interface. The rclk handling specific to puc(4) is now nothing special anymore... Affected files ... .. //depot/projects/ia64/sys/dev/sio/sio_puc.c#6 edit Differences ... ==== //depot/projects/ia64/sys/dev/sio/sio_puc.c#6 (text+ko) ==== @@ -38,6 +38,8 @@ #include #include #include +#include +#include #include #include @@ -58,34 +60,55 @@ static driver_t sio_puc_driver = { sio_driver_name, sio_puc_methods, - 0, + sizeof(struct com_s), }; static int sio_puc_attach(dev) device_t dev; { + struct com_s *com; + struct resource *res; + int error, rid; uintptr_t rclk; - if (BUS_READ_IVAR(device_get_parent(dev), dev, PUC_IVAR_FREQ, - &rclk) != 0) - rclk = DEFAULT_RCLK; - return (sioattach(dev, 0, rclk)); + com = device_get_softc(dev); + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 8, + RF_ACTIVE); + if (res == NULL) + return (ENXIO); + error = sioattach(dev); + if (error) + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + return (error); } static int sio_puc_probe(dev) device_t dev; { + struct com_s *com; + struct resource *res; + int error, rid; uintptr_t rclk; - if (BUS_READ_IVAR(device_get_parent(dev), dev, PUC_IVAR_FREQ, - &rclk) != 0) - rclk = DEFAULT_RCLK; + com = device_get_softc(dev); + rid = 0; + res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 8, + RF_ACTIVE); + if (res == NULL) + return (ENXIO); + com->bsh = rman_get_bushandle(res); + com->bst = rman_get_bustag(res); + if (!BUS_READ_IVAR(device_get_parent(dev), dev, PUC_IVAR_FREQ, &rclk)) + com->rclk = rclk; #ifdef PC98 SET_FLAG(dev, SET_IFTYPE(COM_IF_NS16550)); #endif - return (sioprobe(dev, 0, rclk, 1)); + error = sioprobe(dev); + bus_release_resource(dev, SYS_RES_IOPORT, rid, res); + return (error); } DRIVER_MODULE(sio, puc, sio_puc_driver, sio_devclass, 0, 0); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message