From owner-freebsd-hackers Thu Jan 18 9:58:40 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.interware.hu (mail.interware.hu [195.70.32.130]) by hub.freebsd.org (Postfix) with ESMTP id 858E037B401; Thu, 18 Jan 2001 09:58:15 -0800 (PST) Received: from timbuktu-50.budapest.interware.hu ([195.70.51.242] helo=elischer.org) by mail.interware.hu with esmtp (Exim 3.16 #1 (Debian)) id 14JJK9-0004op-00; Thu, 18 Jan 2001 18:58:13 +0100 Message-ID: <3A67101A.BCFB4736@elischer.org> Date: Thu, 18 Jan 2001 07:47:38 -0800 From: Julian Elischer X-Mailer: Mozilla 4.7 [en] (X11; U; FreeBSD 5.0-CURRENT i386) X-Accept-Language: en, hu MIME-Version: 1.0 To: "David E. Cross" Cc: Mike Smith , "David E. Cross" , hackers@freebsd.org, crossd@cs.rpi.edu Subject: Re: Device Driver Question (bus_set_resource) References: <200101181456.JAA40926@cs.rpi.edu> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "David E. Cross" wrote: > > > > Thank you... > > > > > > After a couple of hours, Jon Chen and I have figured out most of what you > > > just said :P :) > > > > > > How would one use hints with a kld? > > > > Badly. 8( You can only really set them with the loader right now. > > > > There are a couple of kernel datastores that need some tweaking; the > > environment is one of them. > > Ok, everything is working well, except for one last thing... > > I load the driver the first time, and it loads correctly. I unload it and > reload it and it attempts to attach twice (with the exact same resource > values). I unload and reload it and it attempts to load 3 times, unload/reload > ... 4 times (you see the pattern). If I load the second module I am working > on (exact same type as this module), it tries to re-attach the old module > "N" times (depending on the number of previous unload/reloads). > > I am obviously building up state somewhere in the kernel... how can I get > rid of this "state"? the sample driver in /usr/share/examples/drivers does the following: if (device_find_child(parent, "${1}", 0)) { printf("${UPPER}: already attached\n"); return; } so it doesn't do this if it finds that it has already been done once. (in the 'identify' routine) (did you look at the example? It's most of what you need) > > -- > David Cross | email: crossd@cs.rpi.edu > Lab Director | Rm: 308 Lally Hall > Rensselaer Polytechnic Institute, | Ph: 518.276.2860 > Department of Computer Science | Fax: 518.276.4033 > I speak only for myself. | WinNT:Linux::Linux:FreeBSD > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-hackers" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ from Perth, presently in: Budapest v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message