I am writing a PCIe driver for Linux, currently without DMA, and need to know how to read and write to the PCIe device once it is enabled from user space.
In the driver I do the basics in probe():
pci_enable_device();
pci_request_regions();
pci_iomap();
But then how do I access this memory from user space to read and write? Do I add file operations to my PCIe driver? Does the memory from pci_iomap show up some place where the user space code can call:
open('mapped memory location');
mmap(...);
If so then what is the location?
Note: the PCIe device will not plugging into any Linux subsystems such as audio, Ethernet, etc.
/dev/vboxnetctl
, which I assume you can issue commands to. I'm not certain that the Linux kernel would allow any userspace program to read/write to a PCIe device willy-nilly, that sounds like it might be dangerous. – Naftuli Kaypcim_*()
API. – 0andriypcim_*()
exactly and why should I be using it? Sometimes documentation for Linux can be painful to gather so could you please provide a sentence or two on it? – user2205930