Greg Freemyer wrote:
On Tue, 25 Jan 2005 15:00:37 -0800, Pierre Patino <pierre@cruzio.com> wrote:
Hello I've been tasked to port a PCI device from Solaris to Linux. I know something about Solaris drivers and next to nothing about Linux drivers. Can someone point me to their favorite example of a PCI driver that they used as a starting point? There's a fair bit of DMA involved as well.
TIA & Cheers
Good Luck,
I'm familiar with Sys V UNIX drivers and I've tried to look at the Linux kernel driver code. It is very different. The USB code in particular is very difficult to navigate, so don't use that as a reference unless you have to.
I don't think the kernel has a PCI driver concept.
They do have IDE, SATA, USB, SCSI, Video, Serial etc.
So what subsystem is your driver for?
Also, can your driver be converted into kernel module? If so, that really is the best way to go.
FYI: I know the libata driver (for SATA drives) is newly written for 2.6 and supports DMA. Unfortunately it is layered below the SCSI layer, so the upper level interface is not very generic, but the lower level PCI interaction may be a good reference for you.
FYI2: When SGI wanted to port XFS to linux, they first tried it with there own people. They were able to succeed from a purely technical perspective, but were unable to get mainline kernel acceptance. Finally they brought in a trusted Linux Kernel Developer as a consultant to rework the code. (ie. the kernel developers have become very picky about the structure of code being formally added to the kernel.)
Greg
Thanks for the input. Our PCI device is meant to accept four channels of analog signals, perform some A/D magic and jam the values into RAM so a user process can access them and perform some further analysis. I don't expect the Linux kernel group to ever see this code. We want to load a module at boot time and let the needed process perform open/read/write/ioctl/close on the appropriate /dev/whatever.