Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing PCI Device from user space programs

I have a device which would be interface with my processor through pcie. I have written driver for it using the existing pci file operations.

Now my problem is how do I access it from user space programs? PCI File operations do not have IOCTL support and hence I cant make an ioctl call unlike other char devices. I cannot use pci_config_read_byte etc. functions as they are meant for kernel space(included in linux/pci.h).

like image 941
vaibhav3002 Avatar asked Nov 30 '25 04:11

vaibhav3002


1 Answers

I've used the uio framework to do this. You can then just export the pci bar to userspace. On x86, you can just treat it as a volatile memory region.

like image 188
Bill Lynch Avatar answered Dec 02 '25 19:12

Bill Lynch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!