diff options
author | Alex Chiang <achiang@hp.com> | 2009-03-31 11:23:11 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-11 15:04:07 -0400 |
commit | 861fefbf550d41e7a4f44584f3ec35977fa08bf1 (patch) | |
tree | e7fd059f852d225f5270bd5ef0a367eab06a6a8f /drivers/pci/hotplug | |
parent | d09ee9687e027fc7d2c6b95daf05a8ef3ff06340 (diff) |
PCI Hotplug: cpqphp: stray whitespace cleanups
Clean up all stray whitespace issues, such as trailing whitespace,
spaces before tabs, etc. and whatever else vim's c_space_errors
highlights in red.
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/cpqphp.h | 58 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 56 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_ctrl.c | 86 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_nvram.c | 18 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_pci.c | 14 |
5 files changed, 110 insertions, 122 deletions
diff --git a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h index afaf8f69f73e..b627dfd74500 100644 --- a/drivers/pci/hotplug/cpqphp.h +++ b/drivers/pci/hotplug/cpqphp.h | |||
@@ -150,25 +150,25 @@ struct ctrl_reg { /* offset */ | |||
150 | 150 | ||
151 | /* offsets to the controller registers based on the above structure layout */ | 151 | /* offsets to the controller registers based on the above structure layout */ |
152 | enum ctrl_offsets { | 152 | enum ctrl_offsets { |
153 | SLOT_RST = offsetof(struct ctrl_reg, slot_RST), | 153 | SLOT_RST = offsetof(struct ctrl_reg, slot_RST), |
154 | SLOT_ENABLE = offsetof(struct ctrl_reg, slot_enable), | 154 | SLOT_ENABLE = offsetof(struct ctrl_reg, slot_enable), |
155 | MISC = offsetof(struct ctrl_reg, misc), | 155 | MISC = offsetof(struct ctrl_reg, misc), |
156 | LED_CONTROL = offsetof(struct ctrl_reg, led_control), | 156 | LED_CONTROL = offsetof(struct ctrl_reg, led_control), |
157 | INT_INPUT_CLEAR = offsetof(struct ctrl_reg, int_input_clear), | 157 | INT_INPUT_CLEAR = offsetof(struct ctrl_reg, int_input_clear), |
158 | INT_MASK = offsetof(struct ctrl_reg, int_mask), | 158 | INT_MASK = offsetof(struct ctrl_reg, int_mask), |
159 | CTRL_RESERVED0 = offsetof(struct ctrl_reg, reserved0), | 159 | CTRL_RESERVED0 = offsetof(struct ctrl_reg, reserved0), |
160 | CTRL_RESERVED1 = offsetof(struct ctrl_reg, reserved1), | 160 | CTRL_RESERVED1 = offsetof(struct ctrl_reg, reserved1), |
161 | CTRL_RESERVED2 = offsetof(struct ctrl_reg, reserved1), | 161 | CTRL_RESERVED2 = offsetof(struct ctrl_reg, reserved1), |
162 | GEN_OUTPUT_AB = offsetof(struct ctrl_reg, gen_output_AB), | 162 | GEN_OUTPUT_AB = offsetof(struct ctrl_reg, gen_output_AB), |
163 | NON_INT_INPUT = offsetof(struct ctrl_reg, non_int_input), | 163 | NON_INT_INPUT = offsetof(struct ctrl_reg, non_int_input), |
164 | CTRL_RESERVED3 = offsetof(struct ctrl_reg, reserved3), | 164 | CTRL_RESERVED3 = offsetof(struct ctrl_reg, reserved3), |
165 | CTRL_RESERVED4 = offsetof(struct ctrl_reg, reserved4), | 165 | CTRL_RESERVED4 = offsetof(struct ctrl_reg, reserved4), |
166 | CTRL_RESERVED5 = offsetof(struct ctrl_reg, reserved5), | 166 | CTRL_RESERVED5 = offsetof(struct ctrl_reg, reserved5), |
167 | CTRL_RESERVED6 = offsetof(struct ctrl_reg, reserved6), | 167 | CTRL_RESERVED6 = offsetof(struct ctrl_reg, reserved6), |
168 | CTRL_RESERVED7 = offsetof(struct ctrl_reg, reserved7), | 168 | CTRL_RESERVED7 = offsetof(struct ctrl_reg, reserved7), |
169 | CTRL_RESERVED8 = offsetof(struct ctrl_reg, reserved8), | 169 | CTRL_RESERVED8 = offsetof(struct ctrl_reg, reserved8), |
170 | SLOT_MASK = offsetof(struct ctrl_reg, slot_mask), | 170 | SLOT_MASK = offsetof(struct ctrl_reg, slot_mask), |
171 | CTRL_RESERVED9 = offsetof(struct ctrl_reg, reserved9), | 171 | CTRL_RESERVED9 = offsetof(struct ctrl_reg, reserved9), |
172 | CTRL_RESERVED10 = offsetof(struct ctrl_reg, reserved10), | 172 | CTRL_RESERVED10 = offsetof(struct ctrl_reg, reserved10), |
173 | CTRL_RESERVED11 = offsetof(struct ctrl_reg, reserved11), | 173 | CTRL_RESERVED11 = offsetof(struct ctrl_reg, reserved11), |
174 | SLOT_SERR = offsetof(struct ctrl_reg, slot_SERR), | 174 | SLOT_SERR = offsetof(struct ctrl_reg, slot_SERR), |
@@ -220,15 +220,15 @@ struct slot_rt { | |||
220 | /* offsets to the hotplug slot resource table registers based on the above structure layout */ | 220 | /* offsets to the hotplug slot resource table registers based on the above structure layout */ |
221 | enum slot_rt_offsets { | 221 | enum slot_rt_offsets { |
222 | DEV_FUNC = offsetof(struct slot_rt, dev_func), | 222 | DEV_FUNC = offsetof(struct slot_rt, dev_func), |
223 | PRIMARY_BUS = offsetof(struct slot_rt, primary_bus), | 223 | PRIMARY_BUS = offsetof(struct slot_rt, primary_bus), |
224 | SECONDARY_BUS = offsetof(struct slot_rt, secondary_bus), | 224 | SECONDARY_BUS = offsetof(struct slot_rt, secondary_bus), |
225 | MAX_BUS = offsetof(struct slot_rt, max_bus), | 225 | MAX_BUS = offsetof(struct slot_rt, max_bus), |
226 | IO_BASE = offsetof(struct slot_rt, io_base), | 226 | IO_BASE = offsetof(struct slot_rt, io_base), |
227 | IO_LENGTH = offsetof(struct slot_rt, io_length), | 227 | IO_LENGTH = offsetof(struct slot_rt, io_length), |
228 | MEM_BASE = offsetof(struct slot_rt, mem_base), | 228 | MEM_BASE = offsetof(struct slot_rt, mem_base), |
229 | MEM_LENGTH = offsetof(struct slot_rt, mem_length), | 229 | MEM_LENGTH = offsetof(struct slot_rt, mem_length), |
230 | PRE_MEM_BASE = offsetof(struct slot_rt, pre_mem_base), | 230 | PRE_MEM_BASE = offsetof(struct slot_rt, pre_mem_base), |
231 | PRE_MEM_LENGTH = offsetof(struct slot_rt, pre_mem_length), | 231 | PRE_MEM_LENGTH = offsetof(struct slot_rt, pre_mem_length), |
232 | }; | 232 | }; |
233 | 233 | ||
234 | struct pci_func { | 234 | struct pci_func { |
@@ -471,7 +471,7 @@ static inline void return_resource(struct pci_resource **head, struct pci_resour | |||
471 | static inline void set_SOGO(struct controller *ctrl) | 471 | static inline void set_SOGO(struct controller *ctrl) |
472 | { | 472 | { |
473 | u16 misc; | 473 | u16 misc; |
474 | 474 | ||
475 | misc = readw(ctrl->hpc_reg + MISC); | 475 | misc = readw(ctrl->hpc_reg + MISC); |
476 | misc = (misc | 0x0001) & 0xFFFB; | 476 | misc = (misc | 0x0001) & 0xFFFB; |
477 | writew(misc, ctrl->hpc_reg + MISC); | 477 | writew(misc, ctrl->hpc_reg + MISC); |
@@ -481,7 +481,7 @@ static inline void set_SOGO(struct controller *ctrl) | |||
481 | static inline void amber_LED_on(struct controller *ctrl, u8 slot) | 481 | static inline void amber_LED_on(struct controller *ctrl, u8 slot) |
482 | { | 482 | { |
483 | u32 led_control; | 483 | u32 led_control; |
484 | 484 | ||
485 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); | 485 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); |
486 | led_control |= (0x01010000L << slot); | 486 | led_control |= (0x01010000L << slot); |
487 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); | 487 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); |
@@ -491,7 +491,7 @@ static inline void amber_LED_on(struct controller *ctrl, u8 slot) | |||
491 | static inline void amber_LED_off(struct controller *ctrl, u8 slot) | 491 | static inline void amber_LED_off(struct controller *ctrl, u8 slot) |
492 | { | 492 | { |
493 | u32 led_control; | 493 | u32 led_control; |
494 | 494 | ||
495 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); | 495 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); |
496 | led_control &= ~(0x01010000L << slot); | 496 | led_control &= ~(0x01010000L << slot); |
497 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); | 497 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); |
@@ -504,7 +504,7 @@ static inline int read_amber_LED(struct controller *ctrl, u8 slot) | |||
504 | 504 | ||
505 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); | 505 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); |
506 | led_control &= (0x01010000L << slot); | 506 | led_control &= (0x01010000L << slot); |
507 | 507 | ||
508 | return led_control ? 1 : 0; | 508 | return led_control ? 1 : 0; |
509 | } | 509 | } |
510 | 510 | ||
@@ -512,7 +512,7 @@ static inline int read_amber_LED(struct controller *ctrl, u8 slot) | |||
512 | static inline void green_LED_on(struct controller *ctrl, u8 slot) | 512 | static inline void green_LED_on(struct controller *ctrl, u8 slot) |
513 | { | 513 | { |
514 | u32 led_control; | 514 | u32 led_control; |
515 | 515 | ||
516 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); | 516 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); |
517 | led_control |= 0x0101L << slot; | 517 | led_control |= 0x0101L << slot; |
518 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); | 518 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); |
@@ -521,7 +521,7 @@ static inline void green_LED_on(struct controller *ctrl, u8 slot) | |||
521 | static inline void green_LED_off(struct controller *ctrl, u8 slot) | 521 | static inline void green_LED_off(struct controller *ctrl, u8 slot) |
522 | { | 522 | { |
523 | u32 led_control; | 523 | u32 led_control; |
524 | 524 | ||
525 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); | 525 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); |
526 | led_control &= ~(0x0101L << slot); | 526 | led_control &= ~(0x0101L << slot); |
527 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); | 527 | writel(led_control, ctrl->hpc_reg + LED_CONTROL); |
@@ -531,7 +531,7 @@ static inline void green_LED_off(struct controller *ctrl, u8 slot) | |||
531 | static inline void green_LED_blink(struct controller *ctrl, u8 slot) | 531 | static inline void green_LED_blink(struct controller *ctrl, u8 slot) |
532 | { | 532 | { |
533 | u32 led_control; | 533 | u32 led_control; |
534 | 534 | ||
535 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); | 535 | led_control = readl(ctrl->hpc_reg + LED_CONTROL); |
536 | led_control &= ~(0x0101L << slot); | 536 | led_control &= ~(0x0101L << slot); |
537 | led_control |= (0x0001L << slot); | 537 | led_control |= (0x0001L << slot); |
@@ -586,11 +586,11 @@ static inline u8 read_slot_enable(struct controller *ctrl) | |||
586 | static inline u8 get_controller_speed(struct controller *ctrl) | 586 | static inline u8 get_controller_speed(struct controller *ctrl) |
587 | { | 587 | { |
588 | u8 curr_freq; | 588 | u8 curr_freq; |
589 | u16 misc; | 589 | u16 misc; |
590 | 590 | ||
591 | if (ctrl->pcix_support) { | 591 | if (ctrl->pcix_support) { |
592 | curr_freq = readb(ctrl->hpc_reg + NEXT_CURR_FREQ); | 592 | curr_freq = readb(ctrl->hpc_reg + NEXT_CURR_FREQ); |
593 | if ((curr_freq & 0xB0) == 0xB0) | 593 | if ((curr_freq & 0xB0) == 0xB0) |
594 | return PCI_SPEED_133MHz_PCIX; | 594 | return PCI_SPEED_133MHz_PCIX; |
595 | if ((curr_freq & 0xA0) == 0xA0) | 595 | if ((curr_freq & 0xA0) == 0xA0) |
596 | return PCI_SPEED_100MHz_PCIX; | 596 | return PCI_SPEED_100MHz_PCIX; |
@@ -602,10 +602,10 @@ static inline u8 get_controller_speed(struct controller *ctrl) | |||
602 | return PCI_SPEED_33MHz; | 602 | return PCI_SPEED_33MHz; |
603 | } | 603 | } |
604 | 604 | ||
605 | misc = readw(ctrl->hpc_reg + MISC); | 605 | misc = readw(ctrl->hpc_reg + MISC); |
606 | return (misc & 0x0800) ? PCI_SPEED_66MHz : PCI_SPEED_33MHz; | 606 | return (misc & 0x0800) ? PCI_SPEED_66MHz : PCI_SPEED_33MHz; |
607 | } | 607 | } |
608 | 608 | ||
609 | 609 | ||
610 | /* | 610 | /* |
611 | * get_adapter_speed - find the max supported frequency/mode of adapter. | 611 | * get_adapter_speed - find the max supported frequency/mode of adapter. |
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index c2e1bcbb28a7..55eae4c233c9 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c | |||
@@ -25,7 +25,7 @@ | |||
25 | * Send feedback to <greg@kroah.com> | 25 | * Send feedback to <greg@kroah.com> |
26 | * | 26 | * |
27 | * Jan 12, 2003 - Added 66/100/133MHz PCI-X support, | 27 | * Jan 12, 2003 - Added 66/100/133MHz PCI-X support, |
28 | * Torben Mathiasen <torben.mathiasen@hp.com> | 28 | * Torben Mathiasen <torben.mathiasen@hp.com> |
29 | * | 29 | * |
30 | */ | 30 | */ |
31 | 31 | ||
@@ -100,8 +100,8 @@ static struct hotplug_slot_ops cpqphp_hotplug_slot_ops = { | |||
100 | .get_attention_status = get_attention_status, | 100 | .get_attention_status = get_attention_status, |
101 | .get_latch_status = get_latch_status, | 101 | .get_latch_status = get_latch_status, |
102 | .get_adapter_status = get_adapter_status, | 102 | .get_adapter_status = get_adapter_status, |
103 | .get_max_bus_speed = get_max_bus_speed, | 103 | .get_max_bus_speed = get_max_bus_speed, |
104 | .get_cur_bus_speed = get_cur_bus_speed, | 104 | .get_cur_bus_speed = get_cur_bus_speed, |
105 | }; | 105 | }; |
106 | 106 | ||
107 | 107 | ||
@@ -144,7 +144,7 @@ static void __iomem * detect_SMBIOS_pointer(void __iomem *begin, void __iomem *e | |||
144 | break; | 144 | break; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | if (!status) | 148 | if (!status) |
149 | fp = NULL; | 149 | fp = NULL; |
150 | 150 | ||
@@ -292,7 +292,7 @@ static void __iomem *get_SMBIOS_entry(void __iomem *smbios_start, | |||
292 | if (!smbios_table) | 292 | if (!smbios_table) |
293 | return NULL; | 293 | return NULL; |
294 | 294 | ||
295 | if (!previous) { | 295 | if (!previous) { |
296 | previous = smbios_start; | 296 | previous = smbios_start; |
297 | } else { | 297 | } else { |
298 | previous = get_subsequent_smbios_entry(smbios_start, | 298 | previous = get_subsequent_smbios_entry(smbios_start, |
@@ -300,7 +300,7 @@ static void __iomem *get_SMBIOS_entry(void __iomem *smbios_start, | |||
300 | } | 300 | } |
301 | 301 | ||
302 | while (previous) { | 302 | while (previous) { |
303 | if (readb(previous + SMBIOS_GENERIC_TYPE) != type) { | 303 | if (readb(previous + SMBIOS_GENERIC_TYPE) != type) { |
304 | previous = get_subsequent_smbios_entry(smbios_start, | 304 | previous = get_subsequent_smbios_entry(smbios_start, |
305 | smbios_table, previous); | 305 | smbios_table, previous); |
306 | } else { | 306 | } else { |
@@ -426,7 +426,7 @@ static int ctrl_slot_setup(struct controller *ctrl, | |||
426 | cpq_get_latch_status(ctrl, slot); | 426 | cpq_get_latch_status(ctrl, slot); |
427 | hotplug_slot_info->adapter_status = | 427 | hotplug_slot_info->adapter_status = |
428 | get_presence_status(ctrl, slot); | 428 | get_presence_status(ctrl, slot); |
429 | 429 | ||
430 | dbg("registering bus %d, dev %d, number %d, " | 430 | dbg("registering bus %d, dev %d, number %d, " |
431 | "ctrl->slot_device_offset %d, slot %d\n", | 431 | "ctrl->slot_device_offset %d, slot %d\n", |
432 | slot->bus, slot->device, | 432 | slot->bus, slot->device, |
@@ -440,7 +440,7 @@ static int ctrl_slot_setup(struct controller *ctrl, | |||
440 | err("pci_hp_register failed with error %d\n", result); | 440 | err("pci_hp_register failed with error %d\n", result); |
441 | goto error_info; | 441 | goto error_info; |
442 | } | 442 | } |
443 | 443 | ||
444 | slot->next = ctrl->slot; | 444 | slot->next = ctrl->slot; |
445 | ctrl->slot = slot; | 445 | ctrl->slot = slot; |
446 | 446 | ||
@@ -563,9 +563,9 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) | |||
563 | 563 | ||
564 | } | 564 | } |
565 | 565 | ||
566 | // If we got here, we didn't find an entry in the IRQ mapping table | 566 | // If we got here, we didn't find an entry in the IRQ mapping table |
567 | // for the target PCI device. If we did determine that the target | 567 | // for the target PCI device. If we did determine that the target |
568 | // device is on the other side of a PCI-to-PCI bridge, return the | 568 | // device is on the other side of a PCI-to-PCI bridge, return the |
569 | // slot number for the bridge. | 569 | // slot number for the bridge. |
570 | if (bridgeSlot != 0xFF) { | 570 | if (bridgeSlot != 0xFF) { |
571 | *slot = bridgeSlot; | 571 | *slot = bridgeSlot; |
@@ -719,7 +719,7 @@ static int hardware_test(struct hotplug_slot *hotplug_slot, u32 value) | |||
719 | 719 | ||
720 | dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); | 720 | dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); |
721 | 721 | ||
722 | return cpqhp_hardware_test(ctrl, value); | 722 | return cpqhp_hardware_test(ctrl, value); |
723 | } | 723 | } |
724 | 724 | ||
725 | 725 | ||
@@ -738,7 +738,7 @@ static int get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value) | |||
738 | { | 738 | { |
739 | struct slot *slot = hotplug_slot->private; | 739 | struct slot *slot = hotplug_slot->private; |
740 | struct controller *ctrl = slot->ctrl; | 740 | struct controller *ctrl = slot->ctrl; |
741 | 741 | ||
742 | dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); | 742 | dbg("%s - physical_slot = %s\n", __func__, slot_name(slot)); |
743 | 743 | ||
744 | *value = cpq_get_attention_status(ctrl, slot); | 744 | *value = cpq_get_attention_status(ctrl, slot); |
@@ -832,7 +832,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
832 | } | 832 | } |
833 | 833 | ||
834 | /* Check for the proper subsytem ID's | 834 | /* Check for the proper subsytem ID's |
835 | * Intel uses a different SSID programming model than Compaq. | 835 | * Intel uses a different SSID programming model than Compaq. |
836 | * For Intel, each SSID bit identifies a PHP capability. | 836 | * For Intel, each SSID bit identifies a PHP capability. |
837 | * Also Intel HPC's may have RID=0. | 837 | * Also Intel HPC's may have RID=0. |
838 | */ | 838 | */ |
@@ -1087,7 +1087,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1087 | if (rc) { | 1087 | if (rc) { |
1088 | goto err_free_bus; | 1088 | goto err_free_bus; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | dbg("pdev = %p\n", pdev); | 1091 | dbg("pdev = %p\n", pdev); |
1092 | dbg("pci resource start %llx\n", (unsigned long long)pci_resource_start(pdev, 0)); | 1092 | dbg("pci resource start %llx\n", (unsigned long long)pci_resource_start(pdev, 0)); |
1093 | dbg("pci resource len %llx\n", (unsigned long long)pci_resource_len(pdev, 0)); | 1093 | dbg("pci resource len %llx\n", (unsigned long long)pci_resource_len(pdev, 0)); |
@@ -1182,7 +1182,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1182 | __func__, rc); | 1182 | __func__, rc); |
1183 | goto err_iounmap; | 1183 | goto err_iounmap; |
1184 | } | 1184 | } |
1185 | 1185 | ||
1186 | /* Mask all general input interrupts */ | 1186 | /* Mask all general input interrupts */ |
1187 | writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); | 1187 | writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); |
1188 | 1188 | ||
@@ -1291,7 +1291,6 @@ err_disable_device: | |||
1291 | return rc; | 1291 | return rc; |
1292 | } | 1292 | } |
1293 | 1293 | ||
1294 | |||
1295 | static int one_time_init(void) | 1294 | static int one_time_init(void) |
1296 | { | 1295 | { |
1297 | int loop; | 1296 | int loop; |
@@ -1328,10 +1327,10 @@ static int one_time_init(void) | |||
1328 | retval = -EIO; | 1327 | retval = -EIO; |
1329 | goto error; | 1328 | goto error; |
1330 | } | 1329 | } |
1331 | 1330 | ||
1332 | /* Now, map the int15 entry point if we are on compaq specific hardware */ | 1331 | /* Now, map the int15 entry point if we are on compaq specific hardware */ |
1333 | compaq_nvram_init(cpqhp_rom_start); | 1332 | compaq_nvram_init(cpqhp_rom_start); |
1334 | 1333 | ||
1335 | /* Map smbios table entry point structure */ | 1334 | /* Map smbios table entry point structure */ |
1336 | smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start, | 1335 | smbios_table = detect_SMBIOS_pointer(cpqhp_rom_start, |
1337 | cpqhp_rom_start + ROM_PHY_LEN); | 1336 | cpqhp_rom_start + ROM_PHY_LEN); |
@@ -1361,7 +1360,6 @@ error: | |||
1361 | return retval; | 1360 | return retval; |
1362 | } | 1361 | } |
1363 | 1362 | ||
1364 | |||
1365 | static void __exit unload_cpqphpd(void) | 1363 | static void __exit unload_cpqphpd(void) |
1366 | { | 1364 | { |
1367 | struct pci_func *next; | 1365 | struct pci_func *next; |
@@ -1381,10 +1379,10 @@ static void __exit unload_cpqphpd(void) | |||
1381 | if (ctrl->hpc_reg) { | 1379 | if (ctrl->hpc_reg) { |
1382 | u16 misc; | 1380 | u16 misc; |
1383 | rc = read_slot_enable (ctrl); | 1381 | rc = read_slot_enable (ctrl); |
1384 | 1382 | ||
1385 | writeb(0, ctrl->hpc_reg + SLOT_SERR); | 1383 | writeb(0, ctrl->hpc_reg + SLOT_SERR); |
1386 | writel(0xFFFFFFC0L | ~rc, ctrl->hpc_reg + INT_MASK); | 1384 | writel(0xFFFFFFC0L | ~rc, ctrl->hpc_reg + INT_MASK); |
1387 | 1385 | ||
1388 | misc = readw(ctrl->hpc_reg + MISC); | 1386 | misc = readw(ctrl->hpc_reg + MISC); |
1389 | misc &= 0xFFFD; | 1387 | misc &= 0xFFFD; |
1390 | writew(misc, ctrl->hpc_reg + MISC); | 1388 | writew(misc, ctrl->hpc_reg + MISC); |
@@ -1475,27 +1473,23 @@ static void __exit unload_cpqphpd(void) | |||
1475 | iounmap(smbios_start); | 1473 | iounmap(smbios_start); |
1476 | } | 1474 | } |
1477 | 1475 | ||
1478 | |||
1479 | |||
1480 | static struct pci_device_id hpcd_pci_tbl[] = { | 1476 | static struct pci_device_id hpcd_pci_tbl[] = { |
1481 | { | 1477 | { |
1482 | /* handle any PCI Hotplug controller */ | 1478 | /* handle any PCI Hotplug controller */ |
1483 | .class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG << 8) | 0x00), | 1479 | .class = ((PCI_CLASS_SYSTEM_PCI_HOTPLUG << 8) | 0x00), |
1484 | .class_mask = ~0, | 1480 | .class_mask = ~0, |
1485 | 1481 | ||
1486 | /* no matter who makes it */ | 1482 | /* no matter who makes it */ |
1487 | .vendor = PCI_ANY_ID, | 1483 | .vendor = PCI_ANY_ID, |
1488 | .device = PCI_ANY_ID, | 1484 | .device = PCI_ANY_ID, |
1489 | .subvendor = PCI_ANY_ID, | 1485 | .subvendor = PCI_ANY_ID, |
1490 | .subdevice = PCI_ANY_ID, | 1486 | .subdevice = PCI_ANY_ID, |
1491 | 1487 | ||
1492 | }, { /* end: all zeroes */ } | 1488 | }, { /* end: all zeroes */ } |
1493 | }; | 1489 | }; |
1494 | 1490 | ||
1495 | MODULE_DEVICE_TABLE(pci, hpcd_pci_tbl); | 1491 | MODULE_DEVICE_TABLE(pci, hpcd_pci_tbl); |
1496 | 1492 | ||
1497 | |||
1498 | |||
1499 | static struct pci_driver cpqhpc_driver = { | 1493 | static struct pci_driver cpqhpc_driver = { |
1500 | .name = "compaq_pci_hotplug", | 1494 | .name = "compaq_pci_hotplug", |
1501 | .id_table = hpcd_pci_tbl, | 1495 | .id_table = hpcd_pci_tbl, |
@@ -1503,8 +1497,6 @@ static struct pci_driver cpqhpc_driver = { | |||
1503 | /* remove: cpqhpc_remove_one, */ | 1497 | /* remove: cpqhpc_remove_one, */ |
1504 | }; | 1498 | }; |
1505 | 1499 | ||
1506 | |||
1507 | |||
1508 | static int __init cpqhpc_init(void) | 1500 | static int __init cpqhpc_init(void) |
1509 | { | 1501 | { |
1510 | int result; | 1502 | int result; |
@@ -1518,7 +1510,6 @@ static int __init cpqhpc_init(void) | |||
1518 | return result; | 1510 | return result; |
1519 | } | 1511 | } |
1520 | 1512 | ||
1521 | |||
1522 | static void __exit cpqhpc_cleanup(void) | 1513 | static void __exit cpqhpc_cleanup(void) |
1523 | { | 1514 | { |
1524 | dbg("unload_cpqphpd()\n"); | 1515 | dbg("unload_cpqphpd()\n"); |
@@ -1529,8 +1520,5 @@ static void __exit cpqhpc_cleanup(void) | |||
1529 | cpqhp_shutdown_debugfs(); | 1520 | cpqhp_shutdown_debugfs(); |
1530 | } | 1521 | } |
1531 | 1522 | ||
1532 | |||
1533 | module_init(cpqhpc_init); | 1523 | module_init(cpqhpc_init); |
1534 | module_exit(cpqhpc_cleanup); | 1524 | module_exit(cpqhpc_cleanup); |
1535 | |||
1536 | |||
diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c index cc227a8c4b11..ec3a76519af2 100644 --- a/drivers/pci/hotplug/cpqphp_ctrl.c +++ b/drivers/pci/hotplug/cpqphp_ctrl.c | |||
@@ -642,7 +642,7 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz | |||
642 | return NULL; | 642 | return NULL; |
643 | 643 | ||
644 | for (max = *head; max; max = max->next) { | 644 | for (max = *head; max; max = max->next) { |
645 | /* If not big enough we could probably just bail, | 645 | /* If not big enough we could probably just bail, |
646 | * instead we'll continue to the next. */ | 646 | * instead we'll continue to the next. */ |
647 | if (max->length < size) | 647 | if (max->length < size) |
648 | continue; | 648 | continue; |
@@ -886,7 +886,7 @@ irqreturn_t cpqhp_ctrl_intr(int IRQ, void *data) | |||
886 | u32 Diff; | 886 | u32 Diff; |
887 | u32 temp_dword; | 887 | u32 temp_dword; |
888 | 888 | ||
889 | 889 | ||
890 | misc = readw(ctrl->hpc_reg + MISC); | 890 | misc = readw(ctrl->hpc_reg + MISC); |
891 | /*************************************** | 891 | /*************************************** |
892 | * Check to see if it was our interrupt | 892 | * Check to see if it was our interrupt |
@@ -1130,33 +1130,33 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1130 | u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); | 1130 | u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); |
1131 | u16 reg16; | 1131 | u16 reg16; |
1132 | u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); | 1132 | u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); |
1133 | 1133 | ||
1134 | if (ctrl->speed == adapter_speed) | 1134 | if (ctrl->speed == adapter_speed) |
1135 | return 0; | 1135 | return 0; |
1136 | 1136 | ||
1137 | /* We don't allow freq/mode changes if we find another adapter running | 1137 | /* We don't allow freq/mode changes if we find another adapter running |
1138 | * in another slot on this controller */ | 1138 | * in another slot on this controller */ |
1139 | for(slot = ctrl->slot; slot; slot = slot->next) { | 1139 | for(slot = ctrl->slot; slot; slot = slot->next) { |
1140 | if (slot->device == (hp_slot + ctrl->slot_device_offset)) | 1140 | if (slot->device == (hp_slot + ctrl->slot_device_offset)) |
1141 | continue; | 1141 | continue; |
1142 | if (!slot->hotplug_slot || !slot->hotplug_slot->info) | 1142 | if (!slot->hotplug_slot || !slot->hotplug_slot->info) |
1143 | continue; | 1143 | continue; |
1144 | if (slot->hotplug_slot->info->adapter_status == 0) | 1144 | if (slot->hotplug_slot->info->adapter_status == 0) |
1145 | continue; | 1145 | continue; |
1146 | /* If another adapter is running on the same segment but at a | 1146 | /* If another adapter is running on the same segment but at a |
1147 | * lower speed/mode, we allow the new adapter to function at | 1147 | * lower speed/mode, we allow the new adapter to function at |
1148 | * this rate if supported */ | 1148 | * this rate if supported */ |
1149 | if (ctrl->speed < adapter_speed) | 1149 | if (ctrl->speed < adapter_speed) |
1150 | return 0; | 1150 | return 0; |
1151 | 1151 | ||
1152 | return 1; | 1152 | return 1; |
1153 | } | 1153 | } |
1154 | 1154 | ||
1155 | /* If the controller doesn't support freq/mode changes and the | 1155 | /* If the controller doesn't support freq/mode changes and the |
1156 | * controller is running at a higher mode, we bail */ | 1156 | * controller is running at a higher mode, we bail */ |
1157 | if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) | 1157 | if ((ctrl->speed > adapter_speed) && (!ctrl->pcix_speed_capability)) |
1158 | return 1; | 1158 | return 1; |
1159 | 1159 | ||
1160 | /* But we allow the adapter to run at a lower rate if possible */ | 1160 | /* But we allow the adapter to run at a lower rate if possible */ |
1161 | if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability)) | 1161 | if ((ctrl->speed < adapter_speed) && (!ctrl->pcix_speed_capability)) |
1162 | return 0; | 1162 | return 0; |
@@ -1171,22 +1171,22 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1171 | 1171 | ||
1172 | writel(0x0L, ctrl->hpc_reg + LED_CONTROL); | 1172 | writel(0x0L, ctrl->hpc_reg + LED_CONTROL); |
1173 | writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); | 1173 | writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); |
1174 | 1174 | ||
1175 | set_SOGO(ctrl); | 1175 | set_SOGO(ctrl); |
1176 | wait_for_ctrl_irq(ctrl); | 1176 | wait_for_ctrl_irq(ctrl); |
1177 | 1177 | ||
1178 | if (adapter_speed != PCI_SPEED_133MHz_PCIX) | 1178 | if (adapter_speed != PCI_SPEED_133MHz_PCIX) |
1179 | reg = 0xF5; | 1179 | reg = 0xF5; |
1180 | else | 1180 | else |
1181 | reg = 0xF4; | 1181 | reg = 0xF4; |
1182 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); | 1182 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); |
1183 | 1183 | ||
1184 | reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); | 1184 | reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); |
1185 | reg16 &= ~0x000F; | 1185 | reg16 &= ~0x000F; |
1186 | switch(adapter_speed) { | 1186 | switch(adapter_speed) { |
1187 | case(PCI_SPEED_133MHz_PCIX): | 1187 | case(PCI_SPEED_133MHz_PCIX): |
1188 | reg = 0x75; | 1188 | reg = 0x75; |
1189 | reg16 |= 0xB; | 1189 | reg16 |= 0xB; |
1190 | break; | 1190 | break; |
1191 | case(PCI_SPEED_100MHz_PCIX): | 1191 | case(PCI_SPEED_100MHz_PCIX): |
1192 | reg = 0x74; | 1192 | reg = 0x74; |
@@ -1203,47 +1203,47 @@ static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_ | |||
1203 | default: /* 33MHz PCI 2.2 */ | 1203 | default: /* 33MHz PCI 2.2 */ |
1204 | reg = 0x71; | 1204 | reg = 0x71; |
1205 | break; | 1205 | break; |
1206 | 1206 | ||
1207 | } | 1207 | } |
1208 | reg16 |= 0xB << 12; | 1208 | reg16 |= 0xB << 12; |
1209 | writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); | 1209 | writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); |
1210 | 1210 | ||
1211 | mdelay(5); | 1211 | mdelay(5); |
1212 | 1212 | ||
1213 | /* Reenable interrupts */ | 1213 | /* Reenable interrupts */ |
1214 | writel(0, ctrl->hpc_reg + INT_MASK); | 1214 | writel(0, ctrl->hpc_reg + INT_MASK); |
1215 | 1215 | ||
1216 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); | 1216 | pci_write_config_byte(ctrl->pci_dev, 0x41, reg); |
1217 | 1217 | ||
1218 | /* Restart state machine */ | 1218 | /* Restart state machine */ |
1219 | reg = ~0xF; | 1219 | reg = ~0xF; |
1220 | pci_read_config_byte(ctrl->pci_dev, 0x43, ®); | 1220 | pci_read_config_byte(ctrl->pci_dev, 0x43, ®); |
1221 | pci_write_config_byte(ctrl->pci_dev, 0x43, reg); | 1221 | pci_write_config_byte(ctrl->pci_dev, 0x43, reg); |
1222 | 1222 | ||
1223 | /* Only if mode change...*/ | 1223 | /* Only if mode change...*/ |
1224 | if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || | 1224 | if (((ctrl->speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || |
1225 | ((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) | 1225 | ((ctrl->speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) |
1226 | set_SOGO(ctrl); | 1226 | set_SOGO(ctrl); |
1227 | 1227 | ||
1228 | wait_for_ctrl_irq(ctrl); | 1228 | wait_for_ctrl_irq(ctrl); |
1229 | mdelay(1100); | 1229 | mdelay(1100); |
1230 | 1230 | ||
1231 | /* Restore LED/Slot state */ | 1231 | /* Restore LED/Slot state */ |
1232 | writel(leds, ctrl->hpc_reg + LED_CONTROL); | 1232 | writel(leds, ctrl->hpc_reg + LED_CONTROL); |
1233 | writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); | 1233 | writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); |
1234 | 1234 | ||
1235 | set_SOGO(ctrl); | 1235 | set_SOGO(ctrl); |
1236 | wait_for_ctrl_irq(ctrl); | 1236 | wait_for_ctrl_irq(ctrl); |
1237 | 1237 | ||
1238 | ctrl->speed = adapter_speed; | 1238 | ctrl->speed = adapter_speed; |
1239 | slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 1239 | slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
1240 | 1240 | ||
1241 | info("Successfully changed frequency/mode for adapter in slot %d\n", | 1241 | info("Successfully changed frequency/mode for adapter in slot %d\n", |
1242 | slot->number); | 1242 | slot->number); |
1243 | return 0; | 1243 | return 0; |
1244 | } | 1244 | } |
1245 | 1245 | ||
1246 | /* the following routines constitute the bulk of the | 1246 | /* the following routines constitute the bulk of the |
1247 | hotplug controller logic | 1247 | hotplug controller logic |
1248 | */ | 1248 | */ |
1249 | 1249 | ||
@@ -1299,7 +1299,7 @@ static u32 board_replaced(struct pci_func *func, struct controller *ctrl) | |||
1299 | 1299 | ||
1300 | /* Wait for SOBS to be unset */ | 1300 | /* Wait for SOBS to be unset */ |
1301 | wait_for_ctrl_irq (ctrl); | 1301 | wait_for_ctrl_irq (ctrl); |
1302 | 1302 | ||
1303 | adapter_speed = get_adapter_speed(ctrl, hp_slot); | 1303 | adapter_speed = get_adapter_speed(ctrl, hp_slot); |
1304 | if (ctrl->speed != adapter_speed) | 1304 | if (ctrl->speed != adapter_speed) |
1305 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) | 1305 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) |
@@ -1443,12 +1443,12 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) | |||
1443 | 1443 | ||
1444 | /* Wait for SOBS to be unset */ | 1444 | /* Wait for SOBS to be unset */ |
1445 | wait_for_ctrl_irq (ctrl); | 1445 | wait_for_ctrl_irq (ctrl); |
1446 | 1446 | ||
1447 | adapter_speed = get_adapter_speed(ctrl, hp_slot); | 1447 | adapter_speed = get_adapter_speed(ctrl, hp_slot); |
1448 | if (ctrl->speed != adapter_speed) | 1448 | if (ctrl->speed != adapter_speed) |
1449 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) | 1449 | if (set_controller_speed(ctrl, adapter_speed, hp_slot)) |
1450 | rc = WRONG_BUS_FREQUENCY; | 1450 | rc = WRONG_BUS_FREQUENCY; |
1451 | 1451 | ||
1452 | /* turn off board without attaching to the bus */ | 1452 | /* turn off board without attaching to the bus */ |
1453 | disable_slot_power (ctrl, hp_slot); | 1453 | disable_slot_power (ctrl, hp_slot); |
1454 | 1454 | ||
@@ -1461,7 +1461,7 @@ static u32 board_added(struct pci_func *func, struct controller *ctrl) | |||
1461 | 1461 | ||
1462 | if (rc) | 1462 | if (rc) |
1463 | return rc; | 1463 | return rc; |
1464 | 1464 | ||
1465 | p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); | 1465 | p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); |
1466 | 1466 | ||
1467 | /* turn on board and blink green LED */ | 1467 | /* turn on board and blink green LED */ |
@@ -1859,12 +1859,12 @@ static void interrupt_event_handler(struct controller *ctrl) | |||
1859 | info(msg_button_on, p_slot->number); | 1859 | info(msg_button_on, p_slot->number); |
1860 | } | 1860 | } |
1861 | mutex_lock(&ctrl->crit_sect); | 1861 | mutex_lock(&ctrl->crit_sect); |
1862 | 1862 | ||
1863 | dbg("blink green LED and turn off amber\n"); | 1863 | dbg("blink green LED and turn off amber\n"); |
1864 | 1864 | ||
1865 | amber_LED_off (ctrl, hp_slot); | 1865 | amber_LED_off (ctrl, hp_slot); |
1866 | green_LED_blink (ctrl, hp_slot); | 1866 | green_LED_blink (ctrl, hp_slot); |
1867 | 1867 | ||
1868 | set_SOGO(ctrl); | 1868 | set_SOGO(ctrl); |
1869 | 1869 | ||
1870 | /* Wait for SOBS to be unset */ | 1870 | /* Wait for SOBS to be unset */ |
@@ -1958,7 +1958,7 @@ void cpqhp_pushbutton_thread(unsigned long slot) | |||
1958 | if (cpqhp_process_SI(ctrl, func) != 0) { | 1958 | if (cpqhp_process_SI(ctrl, func) != 0) { |
1959 | amber_LED_on(ctrl, hp_slot); | 1959 | amber_LED_on(ctrl, hp_slot); |
1960 | green_LED_off(ctrl, hp_slot); | 1960 | green_LED_off(ctrl, hp_slot); |
1961 | 1961 | ||
1962 | set_SOGO(ctrl); | 1962 | set_SOGO(ctrl); |
1963 | 1963 | ||
1964 | /* Wait for SOBS to be unset */ | 1964 | /* Wait for SOBS to be unset */ |
@@ -2079,7 +2079,7 @@ int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) | |||
2079 | struct pci_bus *pci_bus = ctrl->pci_bus; | 2079 | struct pci_bus *pci_bus = ctrl->pci_bus; |
2080 | int physical_slot=0; | 2080 | int physical_slot=0; |
2081 | 2081 | ||
2082 | device = func->device; | 2082 | device = func->device; |
2083 | func = cpqhp_slot_find(ctrl->bus, device, index++); | 2083 | func = cpqhp_slot_find(ctrl->bus, device, index++); |
2084 | p_slot = cpqhp_find_slot(ctrl, device); | 2084 | p_slot = cpqhp_find_slot(ctrl, device); |
2085 | if (p_slot) { | 2085 | if (p_slot) { |
@@ -2216,7 +2216,7 @@ int cpqhp_hardware_test(struct controller *ctrl, int test_num) | |||
2216 | long_delay((3*HZ)/10); | 2216 | long_delay((3*HZ)/10); |
2217 | work_LED = work_LED >> 16; | 2217 | work_LED = work_LED >> 16; |
2218 | writel(work_LED, ctrl->hpc_reg + LED_CONTROL); | 2218 | writel(work_LED, ctrl->hpc_reg + LED_CONTROL); |
2219 | 2219 | ||
2220 | set_SOGO(ctrl); | 2220 | set_SOGO(ctrl); |
2221 | 2221 | ||
2222 | /* Wait for SOGO interrupt */ | 2222 | /* Wait for SOGO interrupt */ |
@@ -2339,7 +2339,7 @@ static u32 configure_new_device(struct controller * ctrl, struct pci_func * func | |||
2339 | 2339 | ||
2340 | 2340 | ||
2341 | /* | 2341 | /* |
2342 | Configuration logic that involves the hotplug data structures and | 2342 | Configuration logic that involves the hotplug data structures and |
2343 | their bookkeeping | 2343 | their bookkeeping |
2344 | */ | 2344 | */ |
2345 | 2345 | ||
@@ -2917,17 +2917,17 @@ static int configure_new_function(struct controller *ctrl, struct pci_func *func | |||
2917 | } /* End of base register loop */ | 2917 | } /* End of base register loop */ |
2918 | if (cpqhp_legacy_mode) { | 2918 | if (cpqhp_legacy_mode) { |
2919 | /* Figure out which interrupt pin this function uses */ | 2919 | /* Figure out which interrupt pin this function uses */ |
2920 | rc = pci_bus_read_config_byte (pci_bus, devfn, | 2920 | rc = pci_bus_read_config_byte (pci_bus, devfn, |
2921 | PCI_INTERRUPT_PIN, &temp_byte); | 2921 | PCI_INTERRUPT_PIN, &temp_byte); |
2922 | 2922 | ||
2923 | /* If this function needs an interrupt and we are behind | 2923 | /* If this function needs an interrupt and we are behind |
2924 | * a bridge and the pin is tied to something that's | 2924 | * a bridge and the pin is tied to something that's |
2925 | * alread mapped, set this one the same */ | 2925 | * alread mapped, set this one the same */ |
2926 | if (temp_byte && resources->irqs && | 2926 | if (temp_byte && resources->irqs && |
2927 | (resources->irqs->valid_INT & | 2927 | (resources->irqs->valid_INT & |
2928 | (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { | 2928 | (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { |
2929 | /* We have to share with something already set up */ | 2929 | /* We have to share with something already set up */ |
2930 | IRQ = resources->irqs->interrupt[(temp_byte + | 2930 | IRQ = resources->irqs->interrupt[(temp_byte + |
2931 | resources->irqs->barber_pole - 1) & 0x03]; | 2931 | resources->irqs->barber_pole - 1) & 0x03]; |
2932 | } else { | 2932 | } else { |
2933 | /* Program IRQ based on card type */ | 2933 | /* Program IRQ based on card type */ |
diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index cb174888002b..76e110f0e3a6 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c | |||
@@ -113,7 +113,7 @@ static u32 add_byte( u32 **p_buffer, u8 value, u32 *used, u32 *avail) | |||
113 | 113 | ||
114 | if ((*used + 1) > *avail) | 114 | if ((*used + 1) > *avail) |
115 | return(1); | 115 | return(1); |
116 | 116 | ||
117 | *((u8*)*p_buffer) = value; | 117 | *((u8*)*p_buffer) = value; |
118 | tByte = (u8**)p_buffer; | 118 | tByte = (u8**)p_buffer; |
119 | (*tByte)++; | 119 | (*tByte)++; |
@@ -170,10 +170,10 @@ static u32 access_EV (u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size) | |||
170 | unsigned long flags; | 170 | unsigned long flags; |
171 | int op = operation; | 171 | int op = operation; |
172 | int ret_val; | 172 | int ret_val; |
173 | 173 | ||
174 | if (!compaq_int15_entry_point) | 174 | if (!compaq_int15_entry_point) |
175 | return -ENODEV; | 175 | return -ENODEV; |
176 | 176 | ||
177 | spin_lock_irqsave(&int15_lock, flags); | 177 | spin_lock_irqsave(&int15_lock, flags); |
178 | __asm__ ( | 178 | __asm__ ( |
179 | "xorl %%ebx,%%ebx\n" \ | 179 | "xorl %%ebx,%%ebx\n" \ |
@@ -187,7 +187,7 @@ static u32 access_EV (u16 operation, u8 *ev_name, u8 *buffer, u32 *buf_size) | |||
187 | "D" (buffer), "m" (compaq_int15_entry_point) | 187 | "D" (buffer), "m" (compaq_int15_entry_point) |
188 | : "%ebx", "%edx"); | 188 | : "%ebx", "%edx"); |
189 | spin_unlock_irqrestore(&int15_lock, flags); | 189 | spin_unlock_irqrestore(&int15_lock, flags); |
190 | 190 | ||
191 | return((ret_val & 0xFF00) >> 8); | 191 | return((ret_val & 0xFF00) >> 8); |
192 | } | 192 | } |
193 | 193 | ||
@@ -263,7 +263,7 @@ static u32 store_HRT (void __iomem *rom_start) | |||
263 | p_EV_header = (struct ev_hrt_header *) pFill; | 263 | p_EV_header = (struct ev_hrt_header *) pFill; |
264 | 264 | ||
265 | ctrl = cpqhp_ctrl_list; | 265 | ctrl = cpqhp_ctrl_list; |
266 | 266 | ||
267 | // The revision of this structure | 267 | // The revision of this structure |
268 | rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); | 268 | rc = add_byte( &pFill, 1 + ctrl->push_flag, &usedbytes, &available); |
269 | if (rc) | 269 | if (rc) |
@@ -401,7 +401,7 @@ static u32 store_HRT (void __iomem *rom_start) | |||
401 | 401 | ||
402 | ctrl = ctrl->next; | 402 | ctrl = ctrl->next; |
403 | } | 403 | } |
404 | 404 | ||
405 | p_EV_header->num_of_ctrl = numCtrl; | 405 | p_EV_header->num_of_ctrl = numCtrl; |
406 | 406 | ||
407 | // Now store the EV | 407 | // Now store the EV |
@@ -479,7 +479,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | |||
479 | function = p_ev_ctrl->function; | 479 | function = p_ev_ctrl->function; |
480 | 480 | ||
481 | while ((bus != ctrl->bus) || | 481 | while ((bus != ctrl->bus) || |
482 | (device != PCI_SLOT(ctrl->pci_dev->devfn)) || | 482 | (device != PCI_SLOT(ctrl->pci_dev->devfn)) || |
483 | (function != PCI_FUNC(ctrl->pci_dev->devfn))) { | 483 | (function != PCI_FUNC(ctrl->pci_dev->devfn))) { |
484 | nummem = p_ev_ctrl->mem_avail; | 484 | nummem = p_ev_ctrl->mem_avail; |
485 | numpmem = p_ev_ctrl->p_mem_avail; | 485 | numpmem = p_ev_ctrl->p_mem_avail; |
@@ -640,14 +640,14 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | |||
640 | if (rc) | 640 | if (rc) |
641 | return(rc); | 641 | return(rc); |
642 | } else { | 642 | } else { |
643 | if ((evbuffer[0] != 0) && (!ctrl->push_flag)) | 643 | if ((evbuffer[0] != 0) && (!ctrl->push_flag)) |
644 | return 1; | 644 | return 1; |
645 | } | 645 | } |
646 | 646 | ||
647 | return 0; | 647 | return 0; |
648 | } | 648 | } |
649 | 649 | ||
650 | 650 | ||
651 | int compaq_nvram_store (void __iomem *rom_start) | 651 | int compaq_nvram_store (void __iomem *rom_start) |
652 | { | 652 | { |
653 | int rc = 1; | 653 | int rc = 1; |
diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index 6c0ed0fcb8ee..573a2702fb6a 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c | |||
@@ -82,7 +82,7 @@ static void __iomem *detect_HRT_floating_pointer(void __iomem *begin, void __iom | |||
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | 85 | int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) |
86 | { | 86 | { |
87 | unsigned char bus; | 87 | unsigned char bus; |
88 | struct pci_bus *child; | 88 | struct pci_bus *child; |
@@ -116,10 +116,10 @@ int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | 118 | ||
119 | int cpqhp_unconfigure_device(struct pci_func* func) | 119 | int cpqhp_unconfigure_device(struct pci_func* func) |
120 | { | 120 | { |
121 | int j; | 121 | int j; |
122 | 122 | ||
123 | dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); | 123 | dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); |
124 | 124 | ||
125 | for (j=0; j<8 ; j++) { | 125 | for (j=0; j<8 ; j++) { |
@@ -195,8 +195,8 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) | |||
195 | 195 | ||
196 | 196 | ||
197 | /* | 197 | /* |
198 | * WTF??? This function isn't in the code, yet a function calls it, but the | 198 | * WTF??? This function isn't in the code, yet a function calls it, but the |
199 | * compiler optimizes it away? strange. Here as a placeholder to keep the | 199 | * compiler optimizes it away? strange. Here as a placeholder to keep the |
200 | * compiler happy. | 200 | * compiler happy. |
201 | */ | 201 | */ |
202 | static int PCI_ScanBusNonBridge (u8 bus, u8 device) | 202 | static int PCI_ScanBusNonBridge (u8 bus, u8 device) |
@@ -398,7 +398,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug) | |||
398 | 398 | ||
399 | index = 0; | 399 | index = 0; |
400 | new_slot = cpqhp_slot_find(busnumber, device, index++); | 400 | new_slot = cpqhp_slot_find(busnumber, device, index++); |
401 | while (new_slot && | 401 | while (new_slot && |
402 | (new_slot->function != (u8) function)) | 402 | (new_slot->function != (u8) function)) |
403 | new_slot = cpqhp_slot_find(busnumber, device, index++); | 403 | new_slot = cpqhp_slot_find(busnumber, device, index++); |
404 | 404 | ||
@@ -1168,7 +1168,7 @@ int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) | |||
1168 | * this function is for hot plug ADD! | 1168 | * this function is for hot plug ADD! |
1169 | * | 1169 | * |
1170 | * returns 0 if success | 1170 | * returns 0 if success |
1171 | */ | 1171 | */ |
1172 | int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_start) | 1172 | int cpqhp_find_available_resources(struct controller *ctrl, void __iomem *rom_start) |
1173 | { | 1173 | { |
1174 | u8 temp; | 1174 | u8 temp; |