How to access second PCI card with same signature in linux

Dec 09, 2008 2 Replies

Hi all, I have developed a linux based PCI card driver.Now I am using single card, with single card my application is working fine.Now I have inserted the second card with the same signature,



So how can i access that second card using the same driver.



Is there any Minor number mechanism to work with the second card.I don't know, Can anyone help me regarding this issue, it will be great pleasure.



Thanking you.


In kernel 2.4, to enumerate all your cards you need to keep calling pci_find_device() until it fails. For each device, you can map your I/O & memory resources.

Regards,

Mark McDougall, Engineer Virtual Logic Pty Ltd, 21-25 King St, Rockdale, 2216 Ph: +612-9599-3255 Fax: +612-9599-3266

Funny. I've never had the slightest problem with a single driver accessing multiple identical cards. They always get sequential devices nodes and udev maps them to names like /dev/dsp, /dev/dsp1, /dev/dsp2. You can force assignments by using the PCI address to differentiate them, but if you don't, linux will simply assign them device nodes as they are discovered, typically in the order the PCI bus is scanned (?).

Maybe you should look at the existing source code for any existing driver to see how it's done.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required