How to set irq for PCI->PCMCIA adapter
M. Warner Losh
imp at bsdimp.com
Sun Apr 6 22:03:32 PDT 2003
Oh, I just reread things. You need a stable patch. Try this one.
Warner
Index: pci_cfgreg.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/isa/Attic/pci_cfgreg.c,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 pci_cfgreg.c
--- pci_cfgreg.c 28 Nov 2001 05:47:03 -0000 1.1.2.7
+++ pci_cfgreg.c 7 Apr 2003 05:02:41 -0000
@@ -35,6 +35,7 @@
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/malloc.h>
+#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/pmap.h>
#include <machine/md_var.h>
@@ -67,6 +68,16 @@
static struct PIR_table *pci_route_table;
static int pci_route_count;
+/* sysctl vars */
+SYSCTL_NODE(_hw, OID_AUTO, pci, CTLFLAG_RD, 0, "PCI Bus parameters");
+
+static uint32_t pci_irq_override_mask = 0xdef4;
+TUNABLE_INT("hw.pci.irq_override_mask", &pci_irq_override_mask);
+SYSCTL_INT(_hw_pci, OID_AUTO, irq_override_mask, CTLFLAG_RD,
+ &pci_irq_override_mask, 0xdef4,
+ "Mask of allowed irqs to try to route when it has no good clue about\n"
+ "which irqs it should use.");
+
static u_int16_t
pcibios_get_version(void)
{
@@ -413,7 +434,8 @@
/* life is tough, so just pick an interrupt */
for (irq = 0; irq < 16; irq++) {
ibit = (1 << irq);
-
+ if ((ibit & pci_irq_override_mask) == 0)
+ continue;
if (pe->pe_intpin[pin - 1].irqs & ibit) {
PRVERB(("pci_cfgintr_virgin: using routable interrupt %d\n", irq));
return(irq);
More information about the freebsd-mobile
mailing list