From owner-freebsd-hackers Tue Jun 5 16: 1:17 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.dis.org (mass.dis.org [216.240.45.41]) by hub.freebsd.org (Postfix) with ESMTP id 6B3E237B403 for ; Tue, 5 Jun 2001 16:01:10 -0700 (PDT) (envelope-from msmith@mass.dis.org) Received: from mass.dis.org (localhost [127.0.0.1]) by mass.dis.org (8.11.3/8.11.3) with ESMTP id f55N9Zj02982; Tue, 5 Jun 2001 16:09:35 -0700 (PDT) (envelope-from msmith@mass.dis.org) Message-Id: <200106052309.f55N9Zj02982@mass.dis.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: j mckitrick Cc: freebsd-hackers@freebsd.org Subject: Re: newbussifying drivers In-reply-to: Your message of "Tue, 05 Jun 2001 23:00:32 BST." <20010605230032.B96188@dogma.freebsd-uk.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 05 Jun 2001 16:09:35 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > | Typically, probe routines these days are invoked with a single set of I/O > | parameters to probe (and even this is only ISA devices). > | > | It's pretty rare to need to bit-bang to find a device these days anyway; > | you should probably be looking for PnP data or similar. This is what > | hints are (basically) - manually-supplied PnP data. > > How would you recommending fixing this, taken from the ex driver? Ok, this is basically a manual PnP scan for a card that has pre-PnP metaconfig. The only way to do this "right" is going to be to call bus_alloc_resource() to pick up the PnP port, something like: > for (ioport = 0x200; ioport < 0x3a0; ioport += 0x10) { rid = 0; if ((res = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, ioport, ioport + 0x10, 0x10, RF_ACTIVE)) == NULL) continue; > /* No board found at address */ > if (!look_for_card(ioport)) { > continue; > } if (!look_for_card(res)) goto complete; > if (bootverbose) > printf("ex: Found card at 0x%03x!\n", ioport); > /* Board in PnP mode */ > if (eeprom_read(ioport, EE_W0) & EE_W0_PNP) { /* PnP probe will find this card */ if (eeprom_read(res, EE_WO) & EE_WO_PNP) goto complete; ... complete: bus_release_resource(parent, SYS_RES_IOPORT, rid, res); } > > > I'm taking this on as my personal project, so the more info i get, the > better work i can do. :-) You'll want to replace all the inb/outb stuff with macros that wrap the bus_space_read/write functions. You can use the same macros in the identify routine, you'll just be allocating the resources differently. I hope this helps. Regards, Mike -- ... every activity meets with opposition, everyone who acts has his rivals and unfortunately opponents also. But not because people want to be opponents, rather because the tasks and relationships force people to take different points of view. [Dr. Fritz Todt] V I C T O R Y N O T V E N G E A N C E To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message