From owner-freebsd-hackers Sun Mar 28 4:50:57 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id D6E2415637 for ; Sun, 28 Mar 1999 04:49:13 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id NAA10569; Sun, 28 Mar 1999 13:49:21 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Sun, 28 Mar 1999 13:49:21 +0100 (BST) From: Doug Rabson To: Andrew Gallatin Cc: freebsd-hackers@freebsd.org Subject: Re: kld questions In-Reply-To: <14077.30470.231888.128618@grasshopper.cs.duke.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, 27 Mar 1999, Andrew Gallatin wrote: > > I'm interested in transforming our Trapeze/Myrinet device driver into > a KLD, and I've got two specific questions about KLDs. > > o How do I attach a PCI device after boot time? Is this even > supported? Can anybody point me at any sample code? > > o How do I make the KLD unload procedure wait until the module is > ready to be unloaded? Is it legal to sleep? > > The motivation behind this question is that the driver allocates its > own memory for receives, and wraps external mbufs around that memory. > That means it has its own mbuf reference & free routines. It would be > a bad thing if an mbuf the driver allocated was still floating around > in the upper layers of the IP stack after the driver was unloaded -- > eventually, M_FREE would call the no-longer existent ext_free() > function. The current pci code has some remnants of old LKM support but I don't think it includes anything functional. The new pci code which I am slowly working on will support loadable drivers (that is the whole point really). This nearly works now with one missing piece (the system needs to re-probe unrecognised devices after a new driver is loaded). -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message