diff options
author | Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> | 2008-06-07 08:14:35 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-10 06:33:59 -0400 |
commit | 7058b06188232381c13ff05a3caf458bb892b834 (patch) | |
tree | 8267b04f84e1c1fd212b02aeae89ada2cafad161 /arch/x86/pci/irq.c | |
parent | ce8e37cdbdb34a9faeade22e0e6440f0d04560f5 (diff) |
x86: coding style fixes to arch/x86/pci/irq.
Before:
total: 60 errors, 85 warnings, 1237 lines checked
After:
total: 1 errors, 82 warnings, 1226 lines checked
WARNING: line over 80 characters
Compile tested.
paolo@paolo-desktop:/tmp$ size irq.o.*
text data bss dec hex filename
6128 440 76 6644 19f4 irq.o.after
6128 440 76 6644 19f4 irq.o.before
Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/pci/irq.c')
-rw-r--r-- | arch/x86/pci/irq.c | 261 |
1 files changed, 125 insertions, 136 deletions
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 0908fca901bf..7300567e480b 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -11,8 +11,8 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/dmi.h> | 13 | #include <linux/dmi.h> |
14 | #include <asm/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <asm/io_apic.h> | 16 | #include <asm/io_apic.h> |
17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
18 | #include <linux/acpi.h> | 18 | #include <linux/acpi.h> |
@@ -61,7 +61,7 @@ void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; | |||
61 | * and perform checksum verification. | 61 | * and perform checksum verification. |
62 | */ | 62 | */ |
63 | 63 | ||
64 | static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) | 64 | static inline struct irq_routing_table *pirq_check_routing_table(u8 *addr) |
65 | { | 65 | { |
66 | struct irq_routing_table *rt; | 66 | struct irq_routing_table *rt; |
67 | int i; | 67 | int i; |
@@ -74,7 +74,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) | |||
74 | rt->size < sizeof(struct irq_routing_table)) | 74 | rt->size < sizeof(struct irq_routing_table)) |
75 | return NULL; | 75 | return NULL; |
76 | sum = 0; | 76 | sum = 0; |
77 | for (i=0; i < rt->size; i++) | 77 | for (i = 0; i < rt->size; i++) |
78 | sum += addr[i]; | 78 | sum += addr[i]; |
79 | if (!sum) { | 79 | if (!sum) { |
80 | DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); | 80 | DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); |
@@ -100,7 +100,7 @@ static struct irq_routing_table * __init pirq_find_routing_table(void) | |||
100 | return rt; | 100 | return rt; |
101 | printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n"); | 101 | printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n"); |
102 | } | 102 | } |
103 | for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { | 103 | for (addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { |
104 | rt = pirq_check_routing_table(addr); | 104 | rt = pirq_check_routing_table(addr); |
105 | if (rt) | 105 | if (rt) |
106 | return rt; | 106 | return rt; |
@@ -122,20 +122,20 @@ static void __init pirq_peer_trick(void) | |||
122 | struct irq_info *e; | 122 | struct irq_info *e; |
123 | 123 | ||
124 | memset(busmap, 0, sizeof(busmap)); | 124 | memset(busmap, 0, sizeof(busmap)); |
125 | for(i=0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { | 125 | for (i = 0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { |
126 | e = &rt->slots[i]; | 126 | e = &rt->slots[i]; |
127 | #ifdef DEBUG | 127 | #ifdef DEBUG |
128 | { | 128 | { |
129 | int j; | 129 | int j; |
130 | DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); | 130 | DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); |
131 | for(j=0; j<4; j++) | 131 | for (j = 0; j < 4; j++) |
132 | DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); | 132 | DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); |
133 | DBG("\n"); | 133 | DBG("\n"); |
134 | } | 134 | } |
135 | #endif | 135 | #endif |
136 | busmap[e->bus] = 1; | 136 | busmap[e->bus] = 1; |
137 | } | 137 | } |
138 | for(i = 1; i < 256; i++) { | 138 | for (i = 1; i < 256; i++) { |
139 | int node; | 139 | int node; |
140 | if (!busmap[i] || pci_find_bus(0, i)) | 140 | if (!busmap[i] || pci_find_bus(0, i)) |
141 | continue; | 141 | continue; |
@@ -285,7 +285,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | |||
285 | static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; | 285 | static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; |
286 | 286 | ||
287 | WARN_ON_ONCE(pirq > 4); | 287 | WARN_ON_ONCE(pirq > 4); |
288 | return read_config_nybble(router,0x43, pirqmap[pirq-1]); | 288 | return read_config_nybble(router, 0x43, pirqmap[pirq-1]); |
289 | } | 289 | } |
290 | 290 | ||
291 | static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 291 | static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
@@ -314,7 +314,7 @@ static int pirq_opti_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
314 | 314 | ||
315 | /* | 315 | /* |
316 | * Cyrix: nibble offset 0x5C | 316 | * Cyrix: nibble offset 0x5C |
317 | * 0x5C bits 7:4 is INTB bits 3:0 is INTA | 317 | * 0x5C bits 7:4 is INTB bits 3:0 is INTA |
318 | * 0x5D bits 7:4 is INTD bits 3:0 is INTC | 318 | * 0x5D bits 7:4 is INTD bits 3:0 is INTC |
319 | */ | 319 | */ |
320 | static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 320 | static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
@@ -350,7 +350,7 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
350 | * Apparently there are systems implementing PCI routing table using | 350 | * Apparently there are systems implementing PCI routing table using |
351 | * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D. | 351 | * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D. |
352 | * We try our best to handle both link mappings. | 352 | * We try our best to handle both link mappings. |
353 | * | 353 | * |
354 | * Currently (2003-05-21) it appears most SiS chipsets follow the | 354 | * Currently (2003-05-21) it appears most SiS chipsets follow the |
355 | * definition of routing registers from the SiS-5595 southbridge. | 355 | * definition of routing registers from the SiS-5595 southbridge. |
356 | * According to the SiS 5595 datasheets the revision id's of the | 356 | * According to the SiS 5595 datasheets the revision id's of the |
@@ -370,7 +370,7 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
370 | * | 370 | * |
371 | * 0x62: USBIRQ: | 371 | * 0x62: USBIRQ: |
372 | * bit 6 OHCI function disabled (0), enabled (1) | 372 | * bit 6 OHCI function disabled (0), enabled (1) |
373 | * | 373 | * |
374 | * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved | 374 | * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved |
375 | * | 375 | * |
376 | * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved | 376 | * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved |
@@ -487,9 +487,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
487 | u8 irq; | 487 | u8 irq; |
488 | irq = 0; | 488 | irq = 0; |
489 | if (pirq <= 4) | 489 | if (pirq <= 4) |
490 | { | ||
491 | irq = read_config_nybble(router, 0x56, pirq - 1); | 490 | irq = read_config_nybble(router, 0x56, pirq - 1); |
492 | } | ||
493 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", | 491 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", |
494 | dev->vendor, dev->device, pirq, irq); | 492 | dev->vendor, dev->device, pirq, irq); |
495 | return irq; | 493 | return irq; |
@@ -497,12 +495,10 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
497 | 495 | ||
498 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 496 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
499 | { | 497 | { |
500 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", | 498 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", |
501 | dev->vendor, dev->device, pirq, irq); | 499 | dev->vendor, dev->device, pirq, irq); |
502 | if (pirq <= 4) | 500 | if (pirq <= 4) |
503 | { | ||
504 | write_config_nybble(router, 0x56, pirq - 1, irq); | 501 | write_config_nybble(router, 0x56, pirq - 1, irq); |
505 | } | ||
506 | return 1; | 502 | return 1; |
507 | } | 503 | } |
508 | 504 | ||
@@ -549,50 +545,49 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route | |||
549 | if (pci_dev_present(pirq_440gx)) | 545 | if (pci_dev_present(pirq_440gx)) |
550 | return 0; | 546 | return 0; |
551 | 547 | ||
552 | switch(device) | 548 | switch (device) { |
553 | { | 549 | case PCI_DEVICE_ID_INTEL_82371FB_0: |
554 | case PCI_DEVICE_ID_INTEL_82371FB_0: | 550 | case PCI_DEVICE_ID_INTEL_82371SB_0: |
555 | case PCI_DEVICE_ID_INTEL_82371SB_0: | 551 | case PCI_DEVICE_ID_INTEL_82371AB_0: |
556 | case PCI_DEVICE_ID_INTEL_82371AB_0: | 552 | case PCI_DEVICE_ID_INTEL_82371MX: |
557 | case PCI_DEVICE_ID_INTEL_82371MX: | 553 | case PCI_DEVICE_ID_INTEL_82443MX_0: |
558 | case PCI_DEVICE_ID_INTEL_82443MX_0: | 554 | case PCI_DEVICE_ID_INTEL_82801AA_0: |
559 | case PCI_DEVICE_ID_INTEL_82801AA_0: | 555 | case PCI_DEVICE_ID_INTEL_82801AB_0: |
560 | case PCI_DEVICE_ID_INTEL_82801AB_0: | 556 | case PCI_DEVICE_ID_INTEL_82801BA_0: |
561 | case PCI_DEVICE_ID_INTEL_82801BA_0: | 557 | case PCI_DEVICE_ID_INTEL_82801BA_10: |
562 | case PCI_DEVICE_ID_INTEL_82801BA_10: | 558 | case PCI_DEVICE_ID_INTEL_82801CA_0: |
563 | case PCI_DEVICE_ID_INTEL_82801CA_0: | 559 | case PCI_DEVICE_ID_INTEL_82801CA_12: |
564 | case PCI_DEVICE_ID_INTEL_82801CA_12: | 560 | case PCI_DEVICE_ID_INTEL_82801DB_0: |
565 | case PCI_DEVICE_ID_INTEL_82801DB_0: | 561 | case PCI_DEVICE_ID_INTEL_82801E_0: |
566 | case PCI_DEVICE_ID_INTEL_82801E_0: | 562 | case PCI_DEVICE_ID_INTEL_82801EB_0: |
567 | case PCI_DEVICE_ID_INTEL_82801EB_0: | 563 | case PCI_DEVICE_ID_INTEL_ESB_1: |
568 | case PCI_DEVICE_ID_INTEL_ESB_1: | 564 | case PCI_DEVICE_ID_INTEL_ICH6_0: |
569 | case PCI_DEVICE_ID_INTEL_ICH6_0: | 565 | case PCI_DEVICE_ID_INTEL_ICH6_1: |
570 | case PCI_DEVICE_ID_INTEL_ICH6_1: | 566 | case PCI_DEVICE_ID_INTEL_ICH7_0: |
571 | case PCI_DEVICE_ID_INTEL_ICH7_0: | 567 | case PCI_DEVICE_ID_INTEL_ICH7_1: |
572 | case PCI_DEVICE_ID_INTEL_ICH7_1: | 568 | case PCI_DEVICE_ID_INTEL_ICH7_30: |
573 | case PCI_DEVICE_ID_INTEL_ICH7_30: | 569 | case PCI_DEVICE_ID_INTEL_ICH7_31: |
574 | case PCI_DEVICE_ID_INTEL_ICH7_31: | 570 | case PCI_DEVICE_ID_INTEL_ESB2_0: |
575 | case PCI_DEVICE_ID_INTEL_ESB2_0: | 571 | case PCI_DEVICE_ID_INTEL_ICH8_0: |
576 | case PCI_DEVICE_ID_INTEL_ICH8_0: | 572 | case PCI_DEVICE_ID_INTEL_ICH8_1: |
577 | case PCI_DEVICE_ID_INTEL_ICH8_1: | 573 | case PCI_DEVICE_ID_INTEL_ICH8_2: |
578 | case PCI_DEVICE_ID_INTEL_ICH8_2: | 574 | case PCI_DEVICE_ID_INTEL_ICH8_3: |
579 | case PCI_DEVICE_ID_INTEL_ICH8_3: | 575 | case PCI_DEVICE_ID_INTEL_ICH8_4: |
580 | case PCI_DEVICE_ID_INTEL_ICH8_4: | 576 | case PCI_DEVICE_ID_INTEL_ICH9_0: |
581 | case PCI_DEVICE_ID_INTEL_ICH9_0: | 577 | case PCI_DEVICE_ID_INTEL_ICH9_1: |
582 | case PCI_DEVICE_ID_INTEL_ICH9_1: | 578 | case PCI_DEVICE_ID_INTEL_ICH9_2: |
583 | case PCI_DEVICE_ID_INTEL_ICH9_2: | 579 | case PCI_DEVICE_ID_INTEL_ICH9_3: |
584 | case PCI_DEVICE_ID_INTEL_ICH9_3: | 580 | case PCI_DEVICE_ID_INTEL_ICH9_4: |
585 | case PCI_DEVICE_ID_INTEL_ICH9_4: | 581 | case PCI_DEVICE_ID_INTEL_ICH9_5: |
586 | case PCI_DEVICE_ID_INTEL_ICH9_5: | 582 | case PCI_DEVICE_ID_INTEL_TOLAPAI_0: |
587 | case PCI_DEVICE_ID_INTEL_TOLAPAI_0: | 583 | case PCI_DEVICE_ID_INTEL_ICH10_0: |
588 | case PCI_DEVICE_ID_INTEL_ICH10_0: | 584 | case PCI_DEVICE_ID_INTEL_ICH10_1: |
589 | case PCI_DEVICE_ID_INTEL_ICH10_1: | 585 | case PCI_DEVICE_ID_INTEL_ICH10_2: |
590 | case PCI_DEVICE_ID_INTEL_ICH10_2: | 586 | case PCI_DEVICE_ID_INTEL_ICH10_3: |
591 | case PCI_DEVICE_ID_INTEL_ICH10_3: | 587 | r->name = "PIIX/ICH"; |
592 | r->name = "PIIX/ICH"; | 588 | r->get = pirq_piix_get; |
593 | r->get = pirq_piix_get; | 589 | r->set = pirq_piix_set; |
594 | r->set = pirq_piix_set; | 590 | return 1; |
595 | return 1; | ||
596 | } | 591 | } |
597 | return 0; | 592 | return 0; |
598 | } | 593 | } |
@@ -606,7 +601,7 @@ static __init int via_router_probe(struct irq_router *r, | |||
606 | * workarounds for some buggy BIOSes | 601 | * workarounds for some buggy BIOSes |
607 | */ | 602 | */ |
608 | if (device == PCI_DEVICE_ID_VIA_82C586_0) { | 603 | if (device == PCI_DEVICE_ID_VIA_82C586_0) { |
609 | switch(router->device) { | 604 | switch (router->device) { |
610 | case PCI_DEVICE_ID_VIA_82C686: | 605 | case PCI_DEVICE_ID_VIA_82C686: |
611 | /* | 606 | /* |
612 | * Asus k7m bios wrongly reports 82C686A | 607 | * Asus k7m bios wrongly reports 82C686A |
@@ -624,7 +619,7 @@ static __init int via_router_probe(struct irq_router *r, | |||
624 | } | 619 | } |
625 | } | 620 | } |
626 | 621 | ||
627 | switch(device) { | 622 | switch (device) { |
628 | case PCI_DEVICE_ID_VIA_82C586_0: | 623 | case PCI_DEVICE_ID_VIA_82C586_0: |
629 | r->name = "VIA"; | 624 | r->name = "VIA"; |
630 | r->get = pirq_via586_get; | 625 | r->get = pirq_via586_get; |
@@ -647,13 +642,12 @@ static __init int via_router_probe(struct irq_router *r, | |||
647 | 642 | ||
648 | static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 643 | static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
649 | { | 644 | { |
650 | switch(device) | 645 | switch (device) { |
651 | { | 646 | case PCI_DEVICE_ID_VLSI_82C534: |
652 | case PCI_DEVICE_ID_VLSI_82C534: | 647 | r->name = "VLSI 82C534"; |
653 | r->name = "VLSI 82C534"; | 648 | r->get = pirq_vlsi_get; |
654 | r->get = pirq_vlsi_get; | 649 | r->set = pirq_vlsi_set; |
655 | r->set = pirq_vlsi_set; | 650 | return 1; |
656 | return 1; | ||
657 | } | 651 | } |
658 | return 0; | 652 | return 0; |
659 | } | 653 | } |
@@ -661,14 +655,13 @@ static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router | |||
661 | 655 | ||
662 | static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 656 | static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
663 | { | 657 | { |
664 | switch(device) | 658 | switch (device) { |
665 | { | 659 | case PCI_DEVICE_ID_SERVERWORKS_OSB4: |
666 | case PCI_DEVICE_ID_SERVERWORKS_OSB4: | 660 | case PCI_DEVICE_ID_SERVERWORKS_CSB5: |
667 | case PCI_DEVICE_ID_SERVERWORKS_CSB5: | 661 | r->name = "ServerWorks"; |
668 | r->name = "ServerWorks"; | 662 | r->get = pirq_serverworks_get; |
669 | r->get = pirq_serverworks_get; | 663 | r->set = pirq_serverworks_set; |
670 | r->set = pirq_serverworks_set; | 664 | return 1; |
671 | return 1; | ||
672 | } | 665 | } |
673 | return 0; | 666 | return 0; |
674 | } | 667 | } |
@@ -677,7 +670,7 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, | |||
677 | { | 670 | { |
678 | if (device != PCI_DEVICE_ID_SI_503) | 671 | if (device != PCI_DEVICE_ID_SI_503) |
679 | return 0; | 672 | return 0; |
680 | 673 | ||
681 | r->name = "SIS"; | 674 | r->name = "SIS"; |
682 | r->get = pirq_sis_get; | 675 | r->get = pirq_sis_get; |
683 | r->set = pirq_sis_set; | 676 | r->set = pirq_sis_set; |
@@ -686,47 +679,43 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, | |||
686 | 679 | ||
687 | static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 680 | static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
688 | { | 681 | { |
689 | switch(device) | 682 | switch (device) { |
690 | { | 683 | case PCI_DEVICE_ID_CYRIX_5520: |
691 | case PCI_DEVICE_ID_CYRIX_5520: | 684 | r->name = "NatSemi"; |
692 | r->name = "NatSemi"; | 685 | r->get = pirq_cyrix_get; |
693 | r->get = pirq_cyrix_get; | 686 | r->set = pirq_cyrix_set; |
694 | r->set = pirq_cyrix_set; | 687 | return 1; |
695 | return 1; | ||
696 | } | 688 | } |
697 | return 0; | 689 | return 0; |
698 | } | 690 | } |
699 | 691 | ||
700 | static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 692 | static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
701 | { | 693 | { |
702 | switch(device) | 694 | switch (device) { |
703 | { | 695 | case PCI_DEVICE_ID_OPTI_82C700: |
704 | case PCI_DEVICE_ID_OPTI_82C700: | 696 | r->name = "OPTI"; |
705 | r->name = "OPTI"; | 697 | r->get = pirq_opti_get; |
706 | r->get = pirq_opti_get; | 698 | r->set = pirq_opti_set; |
707 | r->set = pirq_opti_set; | 699 | return 1; |
708 | return 1; | ||
709 | } | 700 | } |
710 | return 0; | 701 | return 0; |
711 | } | 702 | } |
712 | 703 | ||
713 | static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 704 | static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
714 | { | 705 | { |
715 | switch(device) | 706 | switch (device) { |
716 | { | 707 | case PCI_DEVICE_ID_ITE_IT8330G_0: |
717 | case PCI_DEVICE_ID_ITE_IT8330G_0: | 708 | r->name = "ITE"; |
718 | r->name = "ITE"; | 709 | r->get = pirq_ite_get; |
719 | r->get = pirq_ite_get; | 710 | r->set = pirq_ite_set; |
720 | r->set = pirq_ite_set; | 711 | return 1; |
721 | return 1; | ||
722 | } | 712 | } |
723 | return 0; | 713 | return 0; |
724 | } | 714 | } |
725 | 715 | ||
726 | static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 716 | static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
727 | { | 717 | { |
728 | switch(device) | 718 | switch (device) { |
729 | { | ||
730 | case PCI_DEVICE_ID_AL_M1533: | 719 | case PCI_DEVICE_ID_AL_M1533: |
731 | case PCI_DEVICE_ID_AL_M1563: | 720 | case PCI_DEVICE_ID_AL_M1563: |
732 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); | 721 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); |
@@ -740,25 +729,24 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, | |||
740 | 729 | ||
741 | static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 730 | static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
742 | { | 731 | { |
743 | switch(device) | 732 | switch (device) { |
744 | { | 733 | case PCI_DEVICE_ID_AMD_VIPER_740B: |
745 | case PCI_DEVICE_ID_AMD_VIPER_740B: | 734 | r->name = "AMD756"; |
746 | r->name = "AMD756"; | 735 | break; |
747 | break; | 736 | case PCI_DEVICE_ID_AMD_VIPER_7413: |
748 | case PCI_DEVICE_ID_AMD_VIPER_7413: | 737 | r->name = "AMD766"; |
749 | r->name = "AMD766"; | 738 | break; |
750 | break; | 739 | case PCI_DEVICE_ID_AMD_VIPER_7443: |
751 | case PCI_DEVICE_ID_AMD_VIPER_7443: | 740 | r->name = "AMD768"; |
752 | r->name = "AMD768"; | 741 | break; |
753 | break; | 742 | default: |
754 | default: | 743 | return 0; |
755 | return 0; | ||
756 | } | 744 | } |
757 | r->get = pirq_amd756_get; | 745 | r->get = pirq_amd756_get; |
758 | r->set = pirq_amd756_set; | 746 | r->set = pirq_amd756_set; |
759 | return 1; | 747 | return 1; |
760 | } | 748 | } |
761 | 749 | ||
762 | static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 750 | static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
763 | { | 751 | { |
764 | switch (device) { | 752 | switch (device) { |
@@ -800,7 +788,7 @@ static struct pci_dev *pirq_router_dev; | |||
800 | * FIXME: should we have an option to say "generic for | 788 | * FIXME: should we have an option to say "generic for |
801 | * chipset" ? | 789 | * chipset" ? |
802 | */ | 790 | */ |
803 | 791 | ||
804 | static void __init pirq_find_router(struct irq_router *r) | 792 | static void __init pirq_find_router(struct irq_router *r) |
805 | { | 793 | { |
806 | struct irq_routing_table *rt = pirq_table; | 794 | struct irq_routing_table *rt = pirq_table; |
@@ -819,7 +807,7 @@ static void __init pirq_find_router(struct irq_router *r) | |||
819 | r->name = "default"; | 807 | r->name = "default"; |
820 | r->get = NULL; | 808 | r->get = NULL; |
821 | r->set = NULL; | 809 | r->set = NULL; |
822 | 810 | ||
823 | DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", | 811 | DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", |
824 | rt->rtr_vendor, rt->rtr_device); | 812 | rt->rtr_vendor, rt->rtr_device); |
825 | 813 | ||
@@ -830,7 +818,7 @@ static void __init pirq_find_router(struct irq_router *r) | |||
830 | return; | 818 | return; |
831 | } | 819 | } |
832 | 820 | ||
833 | for( h = pirq_routers; h->vendor; h++) { | 821 | for (h = pirq_routers; h->vendor; h++) { |
834 | /* First look for a router match */ | 822 | /* First look for a router match */ |
835 | if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device)) | 823 | if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device)) |
836 | break; | 824 | break; |
@@ -882,7 +870,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
882 | 870 | ||
883 | if (!pirq_table) | 871 | if (!pirq_table) |
884 | return 0; | 872 | return 0; |
885 | 873 | ||
886 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); | 874 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); |
887 | info = pirq_get_info(dev); | 875 | info = pirq_get_info(dev); |
888 | if (!info) { | 876 | if (!info) { |
@@ -921,8 +909,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
921 | */ | 909 | */ |
922 | newirq = dev->irq; | 910 | newirq = dev->irq; |
923 | if (newirq && !((1 << newirq) & mask)) { | 911 | if (newirq && !((1 << newirq) & mask)) { |
924 | if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0; | 912 | if (pci_probe & PCI_USE_PIRQ_MASK) |
925 | else printk("\n" KERN_WARNING | 913 | newirq = 0; |
914 | else | ||
915 | printk("\n" KERN_WARNING | ||
926 | "PCI: IRQ %i for device %s doesn't match PIRQ mask " | 916 | "PCI: IRQ %i for device %s doesn't match PIRQ mask " |
927 | "- try pci=usepirqmask\n" KERN_DEBUG, newirq, | 917 | "- try pci=usepirqmask\n" KERN_DEBUG, newirq, |
928 | pci_name(dev)); | 918 | pci_name(dev)); |
@@ -942,8 +932,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
942 | irq = pirq & 0xf; | 932 | irq = pirq & 0xf; |
943 | DBG(" -> hardcoded IRQ %d\n", irq); | 933 | DBG(" -> hardcoded IRQ %d\n", irq); |
944 | msg = "Hardcoded"; | 934 | msg = "Hardcoded"; |
945 | } else if ( r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ | 935 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ |
946 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) { | 936 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { |
947 | DBG(" -> got IRQ %d\n", irq); | 937 | DBG(" -> got IRQ %d\n", irq); |
948 | msg = "Found"; | 938 | msg = "Found"; |
949 | eisa_set_level_irq(irq); | 939 | eisa_set_level_irq(irq); |
@@ -978,15 +968,15 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
978 | continue; | 968 | continue; |
979 | if (info->irq[pin].link == pirq) { | 969 | if (info->irq[pin].link == pirq) { |
980 | /* We refuse to override the dev->irq information. Give a warning! */ | 970 | /* We refuse to override the dev->irq information. Give a warning! */ |
981 | if ( dev2->irq && dev2->irq != irq && \ | 971 | if (dev2->irq && dev2->irq != irq && \ |
982 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ | 972 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ |
983 | ((1 << dev2->irq) & mask)) ) { | 973 | ((1 << dev2->irq) & mask))) { |
984 | #ifndef CONFIG_PCI_MSI | 974 | #ifndef CONFIG_PCI_MSI |
985 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", | 975 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", |
986 | pci_name(dev2), dev2->irq, irq); | 976 | pci_name(dev2), dev2->irq, irq); |
987 | #endif | 977 | #endif |
988 | continue; | 978 | continue; |
989 | } | 979 | } |
990 | dev2->irq = irq; | 980 | dev2->irq = irq; |
991 | pirq_penalty[irq]++; | 981 | pirq_penalty[irq]++; |
992 | if (dev != dev2) | 982 | if (dev != dev2) |
@@ -1024,8 +1014,7 @@ static void __init pcibios_fixup_irqs(void) | |||
1024 | /* | 1014 | /* |
1025 | * Recalculate IRQ numbers if we use the I/O APIC. | 1015 | * Recalculate IRQ numbers if we use the I/O APIC. |
1026 | */ | 1016 | */ |
1027 | if (io_apic_assign_pci_irqs) | 1017 | if (io_apic_assign_pci_irqs) { |
1028 | { | ||
1029 | int irq; | 1018 | int irq; |
1030 | 1019 | ||
1031 | if (pin) { | 1020 | if (pin) { |
@@ -1038,10 +1027,10 @@ static void __init pcibios_fixup_irqs(void) | |||
1038 | * busses itself so we should get into this branch reliably. | 1027 | * busses itself so we should get into this branch reliably. |
1039 | */ | 1028 | */ |
1040 | if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ | 1029 | if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ |
1041 | struct pci_dev * bridge = dev->bus->self; | 1030 | struct pci_dev *bridge = dev->bus->self; |
1042 | 1031 | ||
1043 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; | 1032 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; |
1044 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1033 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1045 | PCI_SLOT(bridge->devfn), pin); | 1034 | PCI_SLOT(bridge->devfn), pin); |
1046 | if (irq >= 0) | 1035 | if (irq >= 0) |
1047 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1036 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", |
@@ -1131,7 +1120,7 @@ static int __init pcibios_irq_init(void) | |||
1131 | pirq_find_router(&pirq_router); | 1120 | pirq_find_router(&pirq_router); |
1132 | if (pirq_table->exclusive_irqs) { | 1121 | if (pirq_table->exclusive_irqs) { |
1133 | int i; | 1122 | int i; |
1134 | for (i=0; i<16; i++) | 1123 | for (i = 0; i < 16; i++) |
1135 | if (!(pirq_table->exclusive_irqs & (1 << i))) | 1124 | if (!(pirq_table->exclusive_irqs & (1 << i))) |
1136 | pirq_penalty[i] += 100; | 1125 | pirq_penalty[i] += 100; |
1137 | } | 1126 | } |
@@ -1196,10 +1185,10 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1196 | */ | 1185 | */ |
1197 | temp_dev = dev; | 1186 | temp_dev = dev; |
1198 | while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ | 1187 | while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ |
1199 | struct pci_dev * bridge = dev->bus->self; | 1188 | struct pci_dev *bridge = dev->bus->self; |
1200 | 1189 | ||
1201 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; | 1190 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; |
1202 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1191 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1203 | PCI_SLOT(bridge->devfn), pin); | 1192 | PCI_SLOT(bridge->devfn), pin); |
1204 | if (irq >= 0) | 1193 | if (irq >= 0) |
1205 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1194 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", |