Use the pci_types crate for writing the command register and reading the status register
Also avoided reading the BARs when a driver may already be running as fetching the BAR size temporarily invalidates the BAR.
Also avoided reading the BARs when a driver may already be running as fetching the BAR size temporarily invalidates the BAR.