summaryrefslogtreecommitdiffstats
path: root/sys/dev/mpt
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-11-19 23:15:42 +0000
committermjacob <mjacob@FreeBSD.org>2006-11-19 23:15:42 +0000
commit88507f6ff3f4050fe0afd785efee3118d0d95943 (patch)
tree433c2366a429c27234cce6dca0edbbf0b0164572 /sys/dev/mpt
parent6d0d993f423606d2d7fbf8c26589c166c3b920fc (diff)
downloadFreeBSD-src-88507f6ff3f4050fe0afd785efee3118d0d95943.zip
FreeBSD-src-88507f6ff3f4050fe0afd785efee3118d0d95943.tar.gz
Play it safe and make MSI and MSI-X an option you have to turn on for MPT.
Diffstat (limited to 'sys/dev/mpt')
-rw-r--r--sys/dev/mpt/mpt.h3
-rw-r--r--sys/dev/mpt/mpt_pci.c16
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h
index b347a0b..4671521 100644
--- a/sys/dev/mpt/mpt.h
+++ b/sys/dev/mpt/mpt.h
@@ -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,
diff --git a/sys/dev/mpt/mpt_pci.c b/sys/dev/mpt/mpt_pci.c
index 03b267a..58532f4 100644
--- a/sys/dev/mpt/mpt_pci.c
+++ b/sys/dev/mpt/mpt_pci.c
@@ -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,12 +521,13 @@ 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);
OpenPOWER on IntegriCloud