Attached it a patch to make sharing of the main ata control interrupts
dependent on a tunable, hw.ata.shared_irqs.  This is required for my new
HP Omnibook 500 to use the CMD 648 in the expansion base to work as it
appears hardwired to interrupt 15 (which is fairly logical given that
there is no where to attach devices to the secondary channel.)  If this
looks ok and you don't have time to deal with it, I'd be happy to commit
it myself.

-- Brooks

-- 
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529  9BF0 5D8E 8BE9 F238 1AD4

Index: sys/dev/ata/ata-pci.c
===================================================================
RCS file: /usr/cvs/src/sys/dev/ata/ata-pci.c,v
retrieving revision 1.6
diff -u -r1.6 ata-pci.c
--- sys/dev/ata/ata-pci.c       8 Jun 2001 09:51:33 -0000       1.6
+++ sys/dev/ata/ata-pci.c       21 Aug 2001 05:08:32 -0000
@@ -49,6 +49,15 @@
 #include <pci/pcireg.h>
 #include <dev/ata/ata-all.h>
 
+/* internal vars */
+static int shared_irqs = 0;
+TUNABLE_INT("hw.ata.shared_irqs", &shared_irqs);
+
+/* systcl vars */
+SYSCTL_DECL(_hw_ata);
+SYSCTL_INT(_hw_ata, OID_AUTO, shared_irqs, CTLFLAG_RD, &shared_irqs, 0,
+           "Share PCI IRQs?");
+
 /* misc defines */
 #define IOMASK 0xfffffffc
 #define ATA_MASTERDEV(dev)             ((pci_get_progif(dev) & 0x80) && \
@@ -515,7 +524,8 @@
 
            return BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
                                      SYS_RES_IRQ, rid,
-                                     irq, irq, 1, flags & ~RF_SHAREABLE);
+                                     irq, irq, 1, flags &
+                                     (shared_irqs ? ~0 : ~RF_SHAREABLE));
 #endif
        }
        else {
Index: share/man/man4/ata.4
===================================================================
RCS file: /usr/cvs/src/share/man/man4/ata.4,v
retrieving revision 1.20
diff -u -r1.20 ata.4
--- share/man/man4/ata.4        14 Jul 2001 19:40:46 -0000      1.20
+++ share/man/man4/ata.4        21 Aug 2001 19:19:56 -0000
@@ -71,6 +71,9 @@
 .It Va hw.ata.tags
 set to 1 to enable Tagged Queuing support (default is disabled)
 (only IBM DPTA and DTLA drives support that)
+.It Va hw.ata.shared_irqs
+set to 1 to allow sharing interrupts with the main controler
+(default is disabled)
 .El
 .Sh DESCRIPTION
 This driver provides access to disk drives, ATAPI CD-ROM and DVD drives,

PGP signature

Reply via email to