How do you MMAP PCI Configurations Space to User Space
I'm new to writing kernel modules and am staring down an interesting issue. I'm currently writing a PCI module, and one aspect required is to memory map the configuration space. The macros that I've seen, such as pci_iomap, do not help beyond the base address registers. I've tried reading through the kernel source code, such as delving through macros like read_config_byte, but I haven't found what I was looking for. There was some mention of using mmap on /dev/mem to mmap the PCI Configuration Space, but ... how would you know which offset to use? I'm quite lost, and would love to hear suggestions of how to address this issue. Thanks in advance, to everyone who has taken the time to read this.