Date: Thu, 24 Jul 2003 23:37:08 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Geoff Glasson <glastech@iinet.net.au> Cc: freebsd-hackers@freebsd.org Subject: Re: Probing for devices Message-ID: <3F20D014.C421667@mindspring.com> References: <200307242017.29676.glastech@iinet.net.au>
next in thread | previous in thread | raw e-mail | index | archive | help
Geoff Glasson wrote: > I'm trying to port the Linux i810 Direct Rendering Interface ( DRI ) kernel > module to FreeBSD. I have reached the point where the thing compiles, and I > can load it as a kernel module, but it can't find the graphics device. > > Through a process of elimination I have come to the conclusion that once the > AGP kernel module probes and attaches to the i810 graphics device, nothing > else can attach to it. When I read the section on PCI devices it implied ( > to me at least ) that multiple kernel modules should be able to attach to the > same device. I have tried to get it to work without any success. How would you expect the hardware to act if both drivers were being accessed simultaneously? In general, multiple device attaches are only possible on multifunction devices, where the driver claims by function, rather than merely by PCI ID. You will likely need to have the two drivers intentionally cooperate with each other on the management of the device, in order to accomplish your goal. If your driver is an actual port of the Linux driver, rather than a rewrite, licensing dictates that it talk to the FreeBSD driver and ask it to step out of the way so it can do what it wants to do, and that it act gracefully if the FreeBSD driver refuses because someone is using it. Ideally, your driver would leave the FreeBSD driver in place, and ask it to do some of the device management functions you need on behalf of your driver, rather than your driver attempting to do them directly. If your driver is in the exact same ecological niche (e.g. it provides the same AGP services the FreeBSD driver does), then you will need to ensure that only one driver is ever loaded into the kernel at a time. -- Terry
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3F20D014.C421667>