int irq = (primary ? IDE0_IRQ : IDE1_IRQ);
boolean nativeMode = false;
// Detect PCI IDE Controller, look for enhanced mode
if (device instanceof PCIDevice) {
final PCIDevice pciDev = (PCIDevice) device;
final PCIDeviceConfig pciCfg = pciDev.getConfig();
final int pIntf = pciCfg.getMinorClass();
final int progMask = 0x02 | 0x08;
final int enhModeMask = 0x01 | 0x04;
if ((pIntf & progMask) == progMask) {
// Mode is programmable, set enhanced mode