summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorPyun YongHyeon <yongari@FreeBSD.org>2010-11-29 01:36:15 +0000
committerPyun YongHyeon <yongari@FreeBSD.org>2010-11-29 01:36:15 +0000
commit366e0ad315b58dfe061d63bc5229dfaac27b6f25 (patch)
tree31f85d103bda1c2dbfd6fe587149563effbd42d5 /sys/dev
parentd6202d6b7cf188d7ee749929e4736cb490166e5f (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/jme/if_jme.c40
1 files changed, 12 insertions, 28 deletions
diff --git a/sys/dev/jme/if_jme.c b/sys/dev/jme/if_jme.c
index f8a478ef6a4f..1cdd5607537e 100644
--- a/sys/dev/jme/if_jme.c
+++ b/sys/dev/jme/if_jme.c
@@ -201,13 +201,6 @@ static struct resource_spec jme_irq_spec_legacy[] = {
static struct resource_spec jme_irq_spec_msi[] = {
{ SYS_RES_IRQ, 1, RF_ACTIVE },
- { SYS_RES_IRQ, 2, RF_ACTIVE },
- { SYS_RES_IRQ, 3, RF_ACTIVE },
- { SYS_RES_IRQ, 4, RF_ACTIVE },
- { SYS_RES_IRQ, 5, RF_ACTIVE },
- { SYS_RES_IRQ, 6, RF_ACTIVE },
- { SYS_RES_IRQ, 7, RF_ACTIVE },
- { SYS_RES_IRQ, 8, RF_ACTIVE },
{ -1, 0, 0 }
};
@@ -586,11 +579,16 @@ jme_attach(device_t dev)
device_printf(dev, "MSI count : %d\n", msic);
}
+ /* Use 1 MSI/MSI-X. */
+ if (msixc > 1)
+ msixc = 1;
+ if (msic > 1)
+ msic = 1;
/* Prefer MSIX over MSI. */
if (msix_disable == 0 || msi_disable == 0) {
- if (msix_disable == 0 && msixc == JME_MSIX_MESSAGES &&
+ if (msix_disable == 0 && msixc > 0 &&
pci_alloc_msix(dev, &msixc) == 0) {
- if (msic == JME_MSIX_MESSAGES) {
+ if (msixc == 1) {
device_printf(dev, "Using %d MSIX messages.\n",
msixc);
sc->jme_flags |= JME_FLAG_MSIX;
@@ -599,9 +597,8 @@ jme_attach(device_t dev)
pci_release_msi(dev);
}
if (msi_disable == 0 && (sc->jme_flags & JME_FLAG_MSIX) == 0 &&
- msic == JME_MSI_MESSAGES &&
- pci_alloc_msi(dev, &msic) == 0) {
- if (msic == JME_MSI_MESSAGES) {
+ msic > 0 && pci_alloc_msi(dev, &msic) == 0) {
+ if (msic == 1) {
device_printf(dev, "Using %d MSI messages.\n",
msic);
sc->jme_flags |= JME_FLAG_MSI;
@@ -794,13 +791,7 @@ jme_attach(device_t dev)
taskqueue_start_threads(&sc->jme_tq, 1, PI_NET, "%s taskq",
device_get_nameunit(sc->jme_dev));
- if ((sc->jme_flags & JME_FLAG_MSIX) != 0)
- msic = JME_MSIX_MESSAGES;
- else if ((sc->jme_flags & JME_FLAG_MSI) != 0)
- msic = JME_MSI_MESSAGES;
- else
- msic = 1;
- for (i = 0; i < msic; i++) {
+ for (i = 0; i < 1; i++) {
error = bus_setup_intr(dev, sc->jme_irq[i],
INTR_TYPE_NET | INTR_MPSAFE, jme_intr, NULL, sc,
&sc->jme_intrhand[i]);
@@ -828,7 +819,7 @@ jme_detach(device_t dev)
{
struct jme_softc *sc;
struct ifnet *ifp;
- int i, msic;
+ int i;
sc = device_get_softc(dev);
@@ -863,14 +854,7 @@ jme_detach(device_t dev)
sc->jme_ifp = NULL;
}
- msic = 1;
- if ((sc->jme_flags & JME_FLAG_MSIX) != 0)
- msic = JME_MSIX_MESSAGES;
- else if ((sc->jme_flags & JME_FLAG_MSI) != 0)
- msic = JME_MSI_MESSAGES;
- else
- msic = 1;
- for (i = 0; i < msic; i++) {
+ for (i = 0; i < 1; i++) {
if (sc->jme_intrhand[i] != NULL) {
bus_teardown_intr(dev, sc->jme_irq[i],
sc->jme_intrhand[i]);