Play it safe and make MSI and MSI-X an option you have to turn on for MPT.

This commit is contained in:
Matt Jacob 2006-11-19 23:15:42 +00:00
parent 21167708e8
commit 804625ee9c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164416
2 changed files with 15 additions and 4 deletions

View File

@ -496,7 +496,8 @@ struct mpt_softc {
uint32_t mpt_pers_mask;
uint32_t
unit : 8,
: 3,
: 2,
msi_enable : 1,
twildcard : 1,
tenabled : 1,
do_cfg_role : 1,

View File

@ -326,6 +326,8 @@ mpt_set_options(struct mpt_softc *mpt)
}
mpt->do_cfg_role = 1;
}
mpt->msi_enable = 0;
}
#else
static void
@ -350,6 +352,13 @@ mpt_set_options(struct mpt_softc *mpt)
mpt->cfg_role = tval;
mpt->do_cfg_role = 1;
}
tval = 0;
mpt->msi_enable = 1;
if (resource_int_value(device_get_name(mpt->dev),
device_get_unit(mpt->dev), "msi_enable", &tval) == 0 && tval == 1) {
mpt->msi_enable = 1;
}
}
#endif
@ -512,13 +521,14 @@ mpt_pci_attach(device_t dev)
/* Get a handle to the interrupt */
iqd = 0;
if (pci_msi_count(dev) == 1) {
if (mpt->msi_enable && pci_msi_count(dev) == 1) {
mpt->pci_msi_count = 1;
if (pci_alloc_msi(dev, &mpt->pci_msi_count) == 0)
if (pci_alloc_msi(dev, &mpt->pci_msi_count) == 0) {
iqd = 1;
else
} else {
mpt->pci_msi_count = 0;
}
}
mpt->pci_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &iqd,
RF_ACTIVE | RF_SHAREABLE);
if (mpt->pci_irq == NULL) {