From owner-freebsd-hackers Sat Mar 27 16:36:49 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 7B80B14BE2 for ; Sat, 27 Mar 1999 16:36:44 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.1/8.9.1) with ESMTP id TAA12296 for ; Sat, 27 Mar 1999 19:36:25 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.9.3/8.9.1) id TAA55656; Sat, 27 Mar 1999 19:36:22 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Sat, 27 Mar 1999 19:36:21 -0500 (EST) To: freebsd-hackers@freebsd.org Subject: kld questions X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14077.30470.231888.128618@grasshopper.cs.duke.edu> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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. Thanks, Drew ------------------------------------------------------------------------------ Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin Duke University Email: gallatin@cs.duke.edu Department of Computer Science Phone: (919) 660-6590 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message