2002-06-25 13:21:47

by Bloch, Jack

[permalink] [raw]
Subject: Question concerning PCI device driver

I have written a device driver for a cPCI board which is currently running
under a 2.2 Kernel. When I load the driver via insmod, I register it it as a
CHRDEV to get the major number assigned dynamically. My application uses
this to build the node dynamically whenever it is started. This provides a
clean interface for IOCTL commands.

I am now porting this driver to a 2.4 Kernel and in the Linux device driver
book it talks about using pci_module_init. How do I get the major number to
allow for IOCTL commands? Or alternatively is there a different way to
interface IOCTL's to a PCI driver. By the way the board is not a network
interface but a very specialized 8 bit serial interface. Please CC me
directly in any responses.


Thanks in advance.

Jack Bloch
Siemens Carrier Networks
e-mail : [email protected]
phone : (561) 923-6550


2002-06-25 14:49:21

by Stelian Pop

[permalink] [raw]
Subject: Re: Question concerning PCI device driver

On Tue, Jun 25, 2002 at 09:21:46AM -0400, Bloch, Jack wrote:

> I am now porting this driver to a 2.4 Kernel and in the Linux device driver
> book it talks about using pci_module_init. How do I get the major number to
> allow for IOCTL commands?

Just do it in the same way, only the pci management functions changed:
you will now need to register your chrdev in the pci_probe callback
instead of the module_init() function.

You should look at the existing drivers in the kernel tree, under
drivers/char, and you'll find many drivers which work that way...

Stelian.
--
Stelian Pop <[email protected]>
Alcove - http://www.alcove.com