--- linux-2.2.12.orig/drivers/usb/uhci.c Sat May 1 00:20:53 1999 +++ linux/drivers/usb/uhci.c Tue Sep 7 21:57:03 1999 @@ -1165,11 +1165,78 @@ #endif + +void print_pci(struct pci_dev *dev) { + /* int i; */ + if (dev==NULL) + return; + printk("devfn : %x \n", dev->devfn); + printk("vendor : %x \n", dev->vendor); + printk("device : %x \n", dev->device); + printk("class : %x \n", dev->class); + printk("hdr_type: %x \n", dev->hdr_type); + printk("master : %x \n", dev->master); + printk("irq : %x \n", dev->irq); + /* for (i=0; i<6; i++) + printk("base_addr[%d] : %lx \n", i, dev->base_address[i]); + */ +} + +static int irq=10; +MODULE_PARM(irq, "i"); + int uhci_init(void) { int retval; struct pci_dev *dev = NULL; u8 type; + u8 route; + u8 elcr1,elcr2; + + while ( (dev = pci_find_device( PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_0, dev))!=NULL ) { + printk(" Find PCI 82371AB-0 \n"); + /* print_pci(dev); */ + pci_read_config_byte(dev, 0x63, &route); + if ( route==0x80 ) { /* 0x80=Routing disable */ + + if ( irq<3 || irq==8 || irq==13 || 15 %0x \n", elcr1); + } else { + elcr2 = inb(0x4d1); /* Port 0x4d1 : Edge/Level Control Register */ + printk(" ELCR2 : %0x ", elcr2); + switch ( route ) { + case 0x09 : elcr2 |= 0x02; break; + case 0x0a : elcr2 |= 0x04; break; + case 0x0b : elcr2 |= 0x08; break; + case 0x0c : elcr2 |= 0x10; break; + case 0x0e : elcr2 |= 0x40; break; + case 0x0f : elcr2 |= 0x80; break; + } + outb(elcr2, 0x4d1); + printk("-> %0x \n", elcr2); + } + + } else { + pci_read_config_byte(dev, 0x63, &route); + printk(" USB PIRQD routed to %x \n", route); + } + } retval = -ENODEV; for (;;) { @@ -1180,6 +1247,13 @@ pci_read_config_byte(dev, PCI_CLASS_PROG, &type); if(type != 0) continue; + + /* Check IRQ */ + if ( dev->irq != route ){ + printk("USB irq set from %0x to %0x \n", dev->irq, route); + dev->irq = route; + } + /* Ok set it up */ retval = start_uhci(dev); if (retval < 0)