add helper functions to determine if the pci device use MMIO or IO ports
reduce the number of interrupts, some cleanups