Skip to contentSkip to conversation

Writing RTDM driver for multiple PCI cards

Xenomai Wojciech Domski 1 participant 1 message Apr 9, 2015

lore
Share & tools
lore
#0 lore raw

Dear All,

I would like to write an another driver for a PCI card. I have encountered an issue, however. I have some experience with writing RTDM drivers but
for a single PCI card.

Now I would like to write a driver which would support multiple PCI cards. How should I do that?

For example when writing a character device driver for standard Linux kernel we can use something
like alloc_chrdev_region() or register_chrdev_region(). In those functions one of the parameters is
count which refers to the number of devices. If I am not mistaken those devices will be available
under /dev/device1, /dev/device2 and so on.

What kind of mechanic should I use to achieve similar result with RTDM. One difference is that in RTDM I do not have those devices under /dev but they
are registered under some device name space in Xenomai which handles this. Is there a way to make one driver with name ex. MyDev for 3 devices and access them by passing MyDev1, MyDev2 or MyDev3 to rt_dev_open()?

Best regards,

Signature · 5 lines
Wojciech Domski

Domski.pl

Wojciech.Domski.pl