diff options
author | Alex Chiang <achiang@hp.com> | 2009-03-31 11:23:16 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-06-11 15:04:08 -0400 |
commit | 427438c61b0083a60bb953cb36cfdc5841f0bb03 (patch) | |
tree | 4583b0f23eed091006324bc1f3f61ed7fcd8a7ac /drivers/pci/hotplug/cpqphp_core.c | |
parent | 861fefbf550d41e7a4f44584f3ec35977fa08bf1 (diff) |
PCI Hotplug: cpqphp: fix comment style
Fix up comments from C++ to C-style, wrapping if necessary, etc.
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/hotplug/cpqphp_core.c')
-rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 157 |
1 files changed, 84 insertions, 73 deletions
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 55eae4c233c9..91dc95850cce 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c | |||
@@ -26,7 +26,6 @@ | |||
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 | * | ||
30 | */ | 29 | */ |
31 | 30 | ||
32 | #include <linux/module.h> | 31 | #include <linux/module.h> |
@@ -171,7 +170,7 @@ static int init_SERR(struct controller * ctrl) | |||
171 | tempdword = ctrl->first_slot; | 170 | tempdword = ctrl->first_slot; |
172 | 171 | ||
173 | number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; | 172 | number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; |
174 | // Loop through slots | 173 | /* Loop through slots */ |
175 | while (number_of_slots) { | 174 | while (number_of_slots) { |
176 | physical_slot = tempdword; | 175 | physical_slot = tempdword; |
177 | writeb(0, ctrl->hpc_reg + SLOT_SERR); | 176 | writeb(0, ctrl->hpc_reg + SLOT_SERR); |
@@ -200,7 +199,7 @@ static int pci_print_IRQ_route (void) | |||
200 | 199 | ||
201 | len = (routing_table->size - sizeof(struct irq_routing_table)) / | 200 | len = (routing_table->size - sizeof(struct irq_routing_table)) / |
202 | sizeof(struct irq_info); | 201 | sizeof(struct irq_info); |
203 | // Make sure I got at least one entry | 202 | /* Make sure I got at least one entry */ |
204 | if (len == 0) { | 203 | if (len == 0) { |
205 | kfree(routing_table); | 204 | kfree(routing_table); |
206 | return -1; | 205 | return -1; |
@@ -244,7 +243,7 @@ static void __iomem *get_subsequent_smbios_entry(void __iomem *smbios_start, | |||
244 | if (!smbios_table || !curr) | 243 | if (!smbios_table || !curr) |
245 | return(NULL); | 244 | return(NULL); |
246 | 245 | ||
247 | // set p_max to the end of the table | 246 | /* set p_max to the end of the table */ |
248 | p_max = smbios_start + readw(smbios_table + ST_LENGTH); | 247 | p_max = smbios_start + readw(smbios_table + ST_LENGTH); |
249 | 248 | ||
250 | p_temp = curr; | 249 | p_temp = curr; |
@@ -253,7 +252,8 @@ static void __iomem *get_subsequent_smbios_entry(void __iomem *smbios_start, | |||
253 | while ((p_temp < p_max) && !bail) { | 252 | while ((p_temp < p_max) && !bail) { |
254 | /* Look for the double NULL terminator | 253 | /* Look for the double NULL terminator |
255 | * The first condition is the previous byte | 254 | * The first condition is the previous byte |
256 | * and the second is the curr */ | 255 | * and the second is the curr |
256 | */ | ||
257 | if (!previous_byte && !(readb(p_temp))) { | 257 | if (!previous_byte && !(readb(p_temp))) { |
258 | bail = 1; | 258 | bail = 1; |
259 | } | 259 | } |
@@ -387,8 +387,9 @@ static int ctrl_slot_setup(struct controller *ctrl, | |||
387 | slot->task_event.expires = jiffies + 5 * HZ; | 387 | slot->task_event.expires = jiffies + 5 * HZ; |
388 | slot->task_event.function = cpqhp_pushbutton_thread; | 388 | slot->task_event.function = cpqhp_pushbutton_thread; |
389 | 389 | ||
390 | //FIXME: these capabilities aren't used but if they are | 390 | /*FIXME: these capabilities aren't used but if they are |
391 | // they need to be correctly implemented | 391 | * they need to be correctly implemented |
392 | */ | ||
392 | slot->capabilities |= PCISLOT_REPLACE_SUPPORTED; | 393 | slot->capabilities |= PCISLOT_REPLACE_SUPPORTED; |
393 | slot->capabilities |= PCISLOT_INTERLOCK_SUPPORTED; | 394 | slot->capabilities |= PCISLOT_INTERLOCK_SUPPORTED; |
394 | 395 | ||
@@ -402,14 +403,14 @@ static int ctrl_slot_setup(struct controller *ctrl, | |||
402 | ctrl_slot = | 403 | ctrl_slot = |
403 | slot_device - (readb(ctrl->hpc_reg + SLOT_MASK) >> 4); | 404 | slot_device - (readb(ctrl->hpc_reg + SLOT_MASK) >> 4); |
404 | 405 | ||
405 | // Check presence | 406 | /* Check presence */ |
406 | slot->capabilities |= | 407 | slot->capabilities |= |
407 | ((((~tempdword) >> 23) | | 408 | ((((~tempdword) >> 23) | |
408 | ((~tempdword) >> 15)) >> ctrl_slot) & 0x02; | 409 | ((~tempdword) >> 15)) >> ctrl_slot) & 0x02; |
409 | // Check the switch state | 410 | /* Check the switch state */ |
410 | slot->capabilities |= | 411 | slot->capabilities |= |
411 | ((~tempdword & 0xFF) >> ctrl_slot) & 0x01; | 412 | ((~tempdword & 0xFF) >> ctrl_slot) & 0x01; |
412 | // Check the slot enable | 413 | /* Check the slot enable */ |
413 | slot->capabilities |= | 414 | slot->capabilities |= |
414 | ((read_slot_enable(ctrl) << 2) >> ctrl_slot) & 0x04; | 415 | ((read_slot_enable(ctrl) << 2) >> ctrl_slot) & 0x04; |
415 | 416 | ||
@@ -476,11 +477,11 @@ static int ctrl_slot_cleanup (struct controller * ctrl) | |||
476 | 477 | ||
477 | cpqhp_remove_debugfs_files(ctrl); | 478 | cpqhp_remove_debugfs_files(ctrl); |
478 | 479 | ||
479 | //Free IRQ associated with hot plug device | 480 | /* Free IRQ associated with hot plug device */ |
480 | free_irq(ctrl->interrupt, ctrl); | 481 | free_irq(ctrl->interrupt, ctrl); |
481 | //Unmap the memory | 482 | /* Unmap the memory */ |
482 | iounmap(ctrl->hpc_reg); | 483 | iounmap(ctrl->hpc_reg); |
483 | //Finally reclaim PCI mem | 484 | /* Finally reclaim PCI mem */ |
484 | release_mem_region(pci_resource_start(ctrl->pci_dev, 0), | 485 | release_mem_region(pci_resource_start(ctrl->pci_dev, 0), |
485 | pci_resource_len(ctrl->pci_dev, 0)); | 486 | pci_resource_len(ctrl->pci_dev, 0)); |
486 | 487 | ||
@@ -488,20 +489,17 @@ static int ctrl_slot_cleanup (struct controller * ctrl) | |||
488 | } | 489 | } |
489 | 490 | ||
490 | 491 | ||
491 | //============================================================================ | 492 | /** |
492 | // function: get_slot_mapping | 493 | * get_slot_mapping - determine logical slot mapping for PCI device |
493 | // | 494 | * |
494 | // Description: Attempts to determine a logical slot mapping for a PCI | 495 | * Won't work for more than one PCI-PCI bridge in a slot. |
495 | // device. Won't work for more than one PCI-PCI bridge | 496 | * |
496 | // in a slot. | 497 | * @bus_num - bus number of PCI device |
497 | // | 498 | * @dev_num - device number of PCI device |
498 | // Input: u8 bus_num - bus number of PCI device | 499 | * @slot - Pointer to u8 where slot number will be returned |
499 | // u8 dev_num - device number of PCI device | 500 | * |
500 | // u8 *slot - Pointer to u8 where slot number will | 501 | * Output: SUCCESS or FAILURE |
501 | // be returned | 502 | */ |
502 | // | ||
503 | // Output: SUCCESS or FAILURE | ||
504 | //============================================================================= | ||
505 | static int | 503 | static int |
506 | get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) | 504 | get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) |
507 | { | 505 | { |
@@ -522,7 +520,7 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) | |||
522 | 520 | ||
523 | len = (PCIIRQRoutingInfoLength->size - | 521 | len = (PCIIRQRoutingInfoLength->size - |
524 | sizeof(struct irq_routing_table)) / sizeof(struct irq_info); | 522 | sizeof(struct irq_routing_table)) / sizeof(struct irq_info); |
525 | // Make sure I got at least one entry | 523 | /* Make sure I got at least one entry */ |
526 | if (len == 0) { | 524 | if (len == 0) { |
527 | kfree(PCIIRQRoutingInfoLength); | 525 | kfree(PCIIRQRoutingInfoLength); |
528 | return -1; | 526 | return -1; |
@@ -539,13 +537,14 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) | |||
539 | return 0; | 537 | return 0; |
540 | } else { | 538 | } else { |
541 | /* Did not get a match on the target PCI device. Check | 539 | /* Did not get a match on the target PCI device. Check |
542 | * if the current IRQ table entry is a PCI-to-PCI bridge | 540 | * if the current IRQ table entry is a PCI-to-PCI |
543 | * device. If so, and it's secondary bus matches the | 541 | * bridge device. If so, and it's secondary bus |
544 | * bus number for the target device, I need to save the | 542 | * matches the bus number for the target device, I need |
545 | * bridge's slot number. If I can not find an entry for | 543 | * to save the bridge's slot number. If I can not find |
546 | * the target device, I will have to assume it's on the | 544 | * an entry for the target device, I will have to |
547 | * other side of the bridge, and assign it the bridge's | 545 | * assume it's on the other side of the bridge, and |
548 | * slot. */ | 546 | * assign it the bridge's slot. |
547 | */ | ||
549 | bus->number = tbus; | 548 | bus->number = tbus; |
550 | pci_bus_read_config_dword(bus, PCI_DEVFN(tdevice, 0), | 549 | pci_bus_read_config_dword(bus, PCI_DEVFN(tdevice, 0), |
551 | PCI_CLASS_REVISION, &work); | 550 | PCI_CLASS_REVISION, &work); |
@@ -563,17 +562,18 @@ get_slot_mapping(struct pci_bus *bus, u8 bus_num, u8 dev_num, u8 *slot) | |||
563 | 562 | ||
564 | } | 563 | } |
565 | 564 | ||
566 | // If we got here, we didn't find an entry in the IRQ mapping table | 565 | /* If we got here, we didn't find an entry in the IRQ mapping table for |
567 | // for the target PCI device. If we did determine that the target | 566 | * the target PCI device. If we did determine that the target device |
568 | // device is on the other side of a PCI-to-PCI bridge, return the | 567 | * is on the other side of a PCI-to-PCI bridge, return the slot number |
569 | // slot number for the bridge. | 568 | * for the bridge. |
569 | */ | ||
570 | if (bridgeSlot != 0xFF) { | 570 | if (bridgeSlot != 0xFF) { |
571 | *slot = bridgeSlot; | 571 | *slot = bridgeSlot; |
572 | kfree(PCIIRQRoutingInfoLength); | 572 | kfree(PCIIRQRoutingInfoLength); |
573 | return 0; | 573 | return 0; |
574 | } | 574 | } |
575 | kfree(PCIIRQRoutingInfoLength); | 575 | kfree(PCIIRQRoutingInfoLength); |
576 | // Couldn't find an entry in the routing table for this PCI device | 576 | /* Couldn't find an entry in the routing table for this PCI device */ |
577 | return -1; | 577 | return -1; |
578 | } | 578 | } |
579 | 579 | ||
@@ -595,7 +595,7 @@ cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, | |||
595 | 595 | ||
596 | hp_slot = func->device - ctrl->slot_device_offset; | 596 | hp_slot = func->device - ctrl->slot_device_offset; |
597 | 597 | ||
598 | // Wait for exclusive access to hardware | 598 | /* Wait for exclusive access to hardware */ |
599 | mutex_lock(&ctrl->crit_sect); | 599 | mutex_lock(&ctrl->crit_sect); |
600 | 600 | ||
601 | if (status == 1) { | 601 | if (status == 1) { |
@@ -603,17 +603,17 @@ cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, | |||
603 | } else if (status == 0) { | 603 | } else if (status == 0) { |
604 | amber_LED_off (ctrl, hp_slot); | 604 | amber_LED_off (ctrl, hp_slot); |
605 | } else { | 605 | } else { |
606 | // Done with exclusive hardware access | 606 | /* Done with exclusive hardware access */ |
607 | mutex_unlock(&ctrl->crit_sect); | 607 | mutex_unlock(&ctrl->crit_sect); |
608 | return(1); | 608 | return(1); |
609 | } | 609 | } |
610 | 610 | ||
611 | set_SOGO(ctrl); | 611 | set_SOGO(ctrl); |
612 | 612 | ||
613 | // Wait for SOBS to be unset | 613 | /* Wait for SOBS to be unset */ |
614 | wait_for_ctrl_irq (ctrl); | 614 | wait_for_ctrl_irq (ctrl); |
615 | 615 | ||
616 | // Done with exclusive hardware access | 616 | /* Done with exclusive hardware access */ |
617 | mutex_unlock(&ctrl->crit_sect); | 617 | mutex_unlock(&ctrl->crit_sect); |
618 | 618 | ||
619 | return(0); | 619 | return(0); |
@@ -815,7 +815,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
815 | return err; | 815 | return err; |
816 | } | 816 | } |
817 | 817 | ||
818 | // Need to read VID early b/c it's used to differentiate CPQ and INTC discovery | 818 | /* Need to read VID early b/c it's used to differentiate CPQ and INTC |
819 | * discovery | ||
820 | */ | ||
819 | rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); | 821 | rc = pci_read_config_word(pdev, PCI_VENDOR_ID, &vendor_id); |
820 | if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { | 822 | if (rc || ((vendor_id != PCI_VENDOR_ID_COMPAQ) && (vendor_id != PCI_VENDOR_ID_INTEL))) { |
821 | err(msg_HPC_non_compaq_or_intel); | 823 | err(msg_HPC_non_compaq_or_intel); |
@@ -837,7 +839,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
837 | * Also Intel HPC's may have RID=0. | 839 | * Also Intel HPC's may have RID=0. |
838 | */ | 840 | */ |
839 | if ((pdev->revision > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) { | 841 | if ((pdev->revision > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) { |
840 | // TODO: This code can be made to support non-Compaq or Intel subsystem IDs | 842 | /* TODO: This code can be made to support non-Compaq or Intel |
843 | * subsystem IDs | ||
844 | */ | ||
841 | rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); | 845 | rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); |
842 | if (rc) { | 846 | if (rc) { |
843 | err("%s : pci_read_config_word failed\n", __func__); | 847 | err("%s : pci_read_config_word failed\n", __func__); |
@@ -865,7 +869,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
865 | 869 | ||
866 | info("Hot Plug Subsystem Device ID: %x\n", subsystem_deviceid); | 870 | info("Hot Plug Subsystem Device ID: %x\n", subsystem_deviceid); |
867 | 871 | ||
868 | /* Set Vendor ID, so it can be accessed later from other functions */ | 872 | /* Set Vendor ID, so it can be accessed later from other |
873 | * functions | ||
874 | */ | ||
869 | ctrl->vendor_id = vendor_id; | 875 | ctrl->vendor_id = vendor_id; |
870 | 876 | ||
871 | switch (subsystem_vid) { | 877 | switch (subsystem_vid) { |
@@ -992,23 +998,23 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
992 | 998 | ||
993 | /* PHP Status (0=De-feature PHP, 1=Normal operation) */ | 999 | /* PHP Status (0=De-feature PHP, 1=Normal operation) */ |
994 | if (subsystem_deviceid & 0x0008) { | 1000 | if (subsystem_deviceid & 0x0008) { |
995 | ctrl->defeature_PHP = 1; // PHP supported | 1001 | ctrl->defeature_PHP = 1; /* PHP supported */ |
996 | } else { | 1002 | } else { |
997 | ctrl->defeature_PHP = 0; // PHP not supported | 1003 | ctrl->defeature_PHP = 0; /* PHP not supported */ |
998 | } | 1004 | } |
999 | 1005 | ||
1000 | /* Alternate Base Address Register Interface (0=not supported, 1=supported) */ | 1006 | /* Alternate Base Address Register Interface (0=not supported, 1=supported) */ |
1001 | if (subsystem_deviceid & 0x0010) { | 1007 | if (subsystem_deviceid & 0x0010) { |
1002 | ctrl->alternate_base_address = 1; // supported | 1008 | ctrl->alternate_base_address = 1; /* supported */ |
1003 | } else { | 1009 | } else { |
1004 | ctrl->alternate_base_address = 0; // not supported | 1010 | ctrl->alternate_base_address = 0; /* not supported */ |
1005 | } | 1011 | } |
1006 | 1012 | ||
1007 | /* PCI Config Space Index (0=not supported, 1=supported) */ | 1013 | /* PCI Config Space Index (0=not supported, 1=supported) */ |
1008 | if (subsystem_deviceid & 0x0020) { | 1014 | if (subsystem_deviceid & 0x0020) { |
1009 | ctrl->pci_config_space = 1; // supported | 1015 | ctrl->pci_config_space = 1; /* supported */ |
1010 | } else { | 1016 | } else { |
1011 | ctrl->pci_config_space = 0; // not supported | 1017 | ctrl->pci_config_space = 0; /* not supported */ |
1012 | } | 1018 | } |
1013 | 1019 | ||
1014 | /* PCI-X support */ | 1020 | /* PCI-X support */ |
@@ -1042,7 +1048,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1042 | return -ENODEV; | 1048 | return -ENODEV; |
1043 | } | 1049 | } |
1044 | 1050 | ||
1045 | // Tell the user that we found one. | 1051 | /* Tell the user that we found one. */ |
1046 | info("Initializing the PCI hot plug controller residing on PCI bus %d\n", | 1052 | info("Initializing the PCI hot plug controller residing on PCI bus %d\n", |
1047 | pdev->bus->number); | 1053 | pdev->bus->number); |
1048 | 1054 | ||
@@ -1120,7 +1126,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1120 | * | 1126 | * |
1121 | ********************************************************/ | 1127 | ********************************************************/ |
1122 | 1128 | ||
1123 | // find the physical slot number of the first hot plug slot | 1129 | /* find the physical slot number of the first hot plug slot */ |
1124 | 1130 | ||
1125 | /* Get slot won't work for devices behind bridges, but | 1131 | /* Get slot won't work for devices behind bridges, but |
1126 | * in this case it will always be called for the "base" | 1132 | * in this case it will always be called for the "base" |
@@ -1137,7 +1143,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1137 | goto err_iounmap; | 1143 | goto err_iounmap; |
1138 | } | 1144 | } |
1139 | 1145 | ||
1140 | // Store PCI Config Space for all devices on this bus | 1146 | /* Store PCI Config Space for all devices on this bus */ |
1141 | rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); | 1147 | rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); |
1142 | if (rc) { | 1148 | if (rc) { |
1143 | err("%s: unable to save PCI configuration data, error %d\n", | 1149 | err("%s: unable to save PCI configuration data, error %d\n", |
@@ -1148,7 +1154,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1148 | /* | 1154 | /* |
1149 | * Get IO, memory, and IRQ resources for new devices | 1155 | * Get IO, memory, and IRQ resources for new devices |
1150 | */ | 1156 | */ |
1151 | // The next line is required for cpqhp_find_available_resources | 1157 | /* The next line is required for cpqhp_find_available_resources */ |
1152 | ctrl->interrupt = pdev->irq; | 1158 | ctrl->interrupt = pdev->irq; |
1153 | if (ctrl->interrupt < 0x10) { | 1159 | if (ctrl->interrupt < 0x10) { |
1154 | cpqhp_legacy_mode = 1; | 1160 | cpqhp_legacy_mode = 1; |
@@ -1196,12 +1202,14 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1196 | goto err_iounmap; | 1202 | goto err_iounmap; |
1197 | } | 1203 | } |
1198 | 1204 | ||
1199 | /* Enable Shift Out interrupt and clear it, also enable SERR on power fault */ | 1205 | /* Enable Shift Out interrupt and clear it, also enable SERR on power |
1206 | * fault | ||
1207 | */ | ||
1200 | temp_word = readw(ctrl->hpc_reg + MISC); | 1208 | temp_word = readw(ctrl->hpc_reg + MISC); |
1201 | temp_word |= 0x4006; | 1209 | temp_word |= 0x4006; |
1202 | writew(temp_word, ctrl->hpc_reg + MISC); | 1210 | writew(temp_word, ctrl->hpc_reg + MISC); |
1203 | 1211 | ||
1204 | // Changed 05/05/97 to clear all interrupts at start | 1212 | /* Changed 05/05/97 to clear all interrupts at start */ |
1205 | writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_INPUT_CLEAR); | 1213 | writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_INPUT_CLEAR); |
1206 | 1214 | ||
1207 | ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); | 1215 | ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); |
@@ -1216,13 +1224,14 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1216 | cpqhp_ctrl_list = ctrl; | 1224 | cpqhp_ctrl_list = ctrl; |
1217 | } | 1225 | } |
1218 | 1226 | ||
1219 | // turn off empty slots here unless command line option "ON" set | 1227 | /* turn off empty slots here unless command line option "ON" set |
1220 | // Wait for exclusive access to hardware | 1228 | * Wait for exclusive access to hardware |
1229 | */ | ||
1221 | mutex_lock(&ctrl->crit_sect); | 1230 | mutex_lock(&ctrl->crit_sect); |
1222 | 1231 | ||
1223 | num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; | 1232 | num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; |
1224 | 1233 | ||
1225 | // find first device number for the ctrl | 1234 | /* find first device number for the ctrl */ |
1226 | device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; | 1235 | device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; |
1227 | 1236 | ||
1228 | while (num_of_slots) { | 1237 | while (num_of_slots) { |
@@ -1234,7 +1243,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1234 | hp_slot = func->device - ctrl->slot_device_offset; | 1243 | hp_slot = func->device - ctrl->slot_device_offset; |
1235 | dbg("hp_slot: %d\n", hp_slot); | 1244 | dbg("hp_slot: %d\n", hp_slot); |
1236 | 1245 | ||
1237 | // We have to save the presence info for these slots | 1246 | /* We have to save the presence info for these slots */ |
1238 | temp_word = ctrl->ctrl_int_comp >> 16; | 1247 | temp_word = ctrl->ctrl_int_comp >> 16; |
1239 | func->presence_save = (temp_word >> hp_slot) & 0x01; | 1248 | func->presence_save = (temp_word >> hp_slot) & 0x01; |
1240 | func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; | 1249 | func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; |
@@ -1258,7 +1267,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1258 | 1267 | ||
1259 | if (!power_mode) { | 1268 | if (!power_mode) { |
1260 | set_SOGO(ctrl); | 1269 | set_SOGO(ctrl); |
1261 | // Wait for SOBS to be unset | 1270 | /* Wait for SOBS to be unset */ |
1262 | wait_for_ctrl_irq(ctrl); | 1271 | wait_for_ctrl_irq(ctrl); |
1263 | } | 1272 | } |
1264 | 1273 | ||
@@ -1269,7 +1278,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1269 | goto err_free_irq; | 1278 | goto err_free_irq; |
1270 | } | 1279 | } |
1271 | 1280 | ||
1272 | // Done with exclusive hardware access | 1281 | /* Done with exclusive hardware access */ |
1273 | mutex_unlock(&ctrl->crit_sect); | 1282 | mutex_unlock(&ctrl->crit_sect); |
1274 | 1283 | ||
1275 | cpqhp_create_debugfs_files(ctrl); | 1284 | cpqhp_create_debugfs_files(ctrl); |
@@ -1316,11 +1325,11 @@ static int one_time_init(void) | |||
1316 | cpqhp_slot_list[loop] = NULL; | 1325 | cpqhp_slot_list[loop] = NULL; |
1317 | } | 1326 | } |
1318 | 1327 | ||
1319 | // FIXME: We also need to hook the NMI handler eventually. | 1328 | /* FIXME: We also need to hook the NMI handler eventually. |
1320 | // this also needs to be worked with Christoph | 1329 | * this also needs to be worked with Christoph |
1321 | // register_NMI_handler(); | 1330 | * register_NMI_handler(); |
1322 | 1331 | */ | |
1323 | // Map rom address | 1332 | /* Map rom address */ |
1324 | cpqhp_rom_start = ioremap(ROM_PHY_ADDR, ROM_PHY_LEN); | 1333 | cpqhp_rom_start = ioremap(ROM_PHY_ADDR, ROM_PHY_LEN); |
1325 | if (!cpqhp_rom_start) { | 1334 | if (!cpqhp_rom_start) { |
1326 | err ("Could not ioremap memory region for ROM\n"); | 1335 | err ("Could not ioremap memory region for ROM\n"); |
@@ -1328,7 +1337,9 @@ static int one_time_init(void) | |||
1328 | goto error; | 1337 | goto error; |
1329 | } | 1338 | } |
1330 | 1339 | ||
1331 | /* Now, map the int15 entry point if we are on compaq specific hardware */ | 1340 | /* Now, map the int15 entry point if we are on compaq specific |
1341 | * hardware | ||
1342 | */ | ||
1332 | compaq_nvram_init(cpqhp_rom_start); | 1343 | compaq_nvram_init(cpqhp_rom_start); |
1333 | 1344 | ||
1334 | /* Map smbios table entry point structure */ | 1345 | /* Map smbios table entry point structure */ |
@@ -1462,11 +1473,11 @@ static void __exit unload_cpqphpd(void) | |||
1462 | } | 1473 | } |
1463 | } | 1474 | } |
1464 | 1475 | ||
1465 | // Stop the notification mechanism | 1476 | /* Stop the notification mechanism */ |
1466 | if (initialized) | 1477 | if (initialized) |
1467 | cpqhp_event_stop_thread(); | 1478 | cpqhp_event_stop_thread(); |
1468 | 1479 | ||
1469 | //unmap the rom address | 1480 | /* unmap the rom address */ |
1470 | if (cpqhp_rom_start) | 1481 | if (cpqhp_rom_start) |
1471 | iounmap(cpqhp_rom_start); | 1482 | iounmap(cpqhp_rom_start); |
1472 | if (smbios_start) | 1483 | if (smbios_start) |