From owner-p4-projects Sun Dec 22 11:27: 5 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 47F8037B401; Sun, 22 Dec 2002 11:27:02 -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 D022E37B405 for ; Sun, 22 Dec 2002 11:27:01 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70D7443EEF for ; Sun, 22 Dec 2002 11:27:01 -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 gBMJR1fh013194 for ; Sun, 22 Dec 2002 11:27:01 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id gBMJR0si013191 for perforce@freebsd.org; Sun, 22 Dec 2002 11:27:00 -0800 (PST) Date: Sun, 22 Dec 2002 11:27:00 -0800 (PST) Message-Id: <200212221927.gBMJR0si013191@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 22626 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=22626 Change 22626 by marcel@marcel_nfs on 2002/12/22 11:26:02 Convert to the new sioprobe/sioattach interface. Untested. While here, break siodetach even more. Affected files ... .. //depot/projects/ia64/sys/dev/sio/sio_pccard.c#6 edit Differences ... ==== //depot/projects/ia64/sys/dev/sio/sio_pccard.c#6 (text+ko) ==== @@ -66,7 +66,7 @@ static driver_t sio_pccard_driver = { sio_driver_name, sio_pccard_methods, - 0, + sizeof(struct com_s), }; static int @@ -91,27 +91,52 @@ sio_pccard_probe(dev) device_t dev; { + struct com_s *com; + struct resource *res; + int error, rid; #ifdef PC98 SET_FLAG(dev, SET_IFTYPE(COM_IF_MODEM_CARD)); #endif - /* Do not probe IRQ - pccard doesn't turn on the interrupt line */ - /* until bus_setup_intr */ - 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); + if (res == NULL) + return (ENXIO); + 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_pccard_attach(dev) device_t dev; { - return (sioattach(dev, 0, 0UL)); + struct com_s *com; + struct resource *res; + int error, rid; + + 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_pccard_detach(dev) device_t dev; { - return (siodetach(dev)); + /* XXX broken */ } DRIVER_MODULE(sio, pccard, sio_pccard_driver, sio_devclass, 0, 0); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message