ChangeSet 1.1587.12.92, 2004/05/17 16:08:02-07:00, greg@kroah.com PCI Hotplug: clean up a lot of global symbols that do not need to be. drivers/pci/hotplug/acpiphp.h | 3 drivers/pci/hotplug/acpiphp_glue.c | 91 +++++++++---------- drivers/pci/hotplug/acpiphp_res.c | 8 + drivers/pci/hotplug/cpci_hotplug.h | 1 drivers/pci/hotplug/cpci_hotplug_core.c | 2 drivers/pci/hotplug/cpci_hotplug_pci.c | 2 drivers/pci/hotplug/cpcihp_zt5550.c | 2 drivers/pci/hotplug/cpqphp.h | 1 drivers/pci/hotplug/cpqphp_ctrl.c | 4 drivers/pci/hotplug/ibmphp.h | 2 drivers/pci/hotplug/ibmphp_core.c | 2 drivers/pci/hotplug/ibmphp_res.c | 1 drivers/pci/hotplug/pciehp.h | 1 drivers/pci/hotplug/pciehp_ctrl.c | 150 ++++++++++++++++---------------- drivers/pci/hotplug/pciehprm.h | 1 drivers/pci/hotplug/pciehprm_acpi.c | 2 drivers/pci/hotplug/pciehprm_nonacpi.c | 5 - drivers/pci/hotplug/shpchp.h | 1 drivers/pci/hotplug/shpchp_ctrl.c | 150 ++++++++++++++++---------------- drivers/pci/hotplug/shpchprm.h | 1 drivers/pci/hotplug/shpchprm_acpi.c | 4 drivers/pci/hotplug/shpchprm_legacy.c | 5 - drivers/pci/hotplug/shpchprm_nonacpi.c | 5 - 23 files changed, 212 insertions(+), 232 deletions(-) diff -Nru a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h --- a/drivers/pci/hotplug/acpiphp.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/acpiphp.h Mon May 17 16:56:05 2004 @@ -218,9 +218,7 @@ extern int acpiphp_get_num_slots (void); extern struct acpiphp_slot *get_slot_from_id (int id); typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data); -extern int acpiphp_for_each_slot (acpiphp_callback fn, void *data); -extern int acpiphp_check_bridge (struct acpiphp_bridge *bridge); extern int acpiphp_enable_slot (struct acpiphp_slot *slot); extern int acpiphp_disable_slot (struct acpiphp_slot *slot); extern u8 acpiphp_get_power_status (struct acpiphp_slot *slot); @@ -239,7 +237,6 @@ /* acpiphp_res.c */ extern struct pci_resource *acpiphp_get_io_resource (struct pci_resource **head, u32 size); -extern struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size); extern struct pci_resource *acpiphp_get_resource (struct pci_resource **head, u32 size); extern struct pci_resource *acpiphp_get_resource_with_base (struct pci_resource **head, u64 base, u32 size); extern int acpiphp_resource_sort_and_combine (struct pci_resource **head); diff -Nru a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c --- a/drivers/pci/hotplug/acpiphp_glue.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/acpiphp_glue.c Mon May 17 16:56:05 2004 @@ -919,6 +919,48 @@ return (unsigned int)sta; } +/** + * acpiphp_check_bridge - re-enumerate devices + * + * Iterate over all slots under this bridge and make sure that if a + * card is present they are enabled, and if not they are disabled. + */ +static int acpiphp_check_bridge(struct acpiphp_bridge *bridge) +{ + struct acpiphp_slot *slot; + int retval = 0; + int enabled, disabled; + + enabled = disabled = 0; + + for (slot = bridge->slots; slot; slot = slot->next) { + unsigned int status = get_slot_status(slot); + if (slot->flags & SLOT_ENABLED) { + if (status == ACPI_STA_ALL) + continue; + retval = acpiphp_disable_slot(slot); + if (retval) { + err("Error occurred in disabling\n"); + goto err_exit; + } + disabled++; + } else { + if (status != ACPI_STA_ALL) + continue; + retval = acpiphp_enable_slot(slot); + if (retval) { + err("Error occurred in enabling\n"); + goto err_exit; + } + enabled++; + } + } + + dbg("%s: %d enabled, %d disabled\n", __FUNCTION__, enabled, disabled); + + err_exit: + return retval; +} /* * ACPI event handlers @@ -1140,13 +1182,14 @@ } +#if 0 /** * acpiphp_for_each_slot - call function for each slot * @fn: callback function * @data: context to be passed to callback function * */ -int acpiphp_for_each_slot(acpiphp_callback fn, void *data) +static int acpiphp_for_each_slot(acpiphp_callback fn, void *data) { struct list_head *node; struct acpiphp_bridge *bridge; @@ -1165,7 +1208,7 @@ err_exit: return retval; } - +#endif /* search matching slot from id */ struct acpiphp_slot *get_slot_from_id(int id) @@ -1240,50 +1283,6 @@ err_exit: up(&slot->crit_sect); - return retval; -} - - -/** - * acpiphp_check_bridge - re-enumerate devices - * - * Iterate over all slots under this bridge and make sure that if a - * card is present they are enabled, and if not they are disabled. - */ -int acpiphp_check_bridge(struct acpiphp_bridge *bridge) -{ - struct acpiphp_slot *slot; - int retval = 0; - int enabled, disabled; - - enabled = disabled = 0; - - for (slot = bridge->slots; slot; slot = slot->next) { - unsigned int status = get_slot_status(slot); - if (slot->flags & SLOT_ENABLED) { - if (status == ACPI_STA_ALL) - continue; - retval = acpiphp_disable_slot(slot); - if (retval) { - err("Error occurred in disabling\n"); - goto err_exit; - } - disabled++; - } else { - if (status != ACPI_STA_ALL) - continue; - retval = acpiphp_enable_slot(slot); - if (retval) { - err("Error occurred in enabling\n"); - goto err_exit; - } - enabled++; - } - } - - dbg("%s: %d enabled, %d disabled\n", __FUNCTION__, enabled, disabled); - - err_exit: return retval; } diff -Nru a/drivers/pci/hotplug/acpiphp_res.c b/drivers/pci/hotplug/acpiphp_res.c --- a/drivers/pci/hotplug/acpiphp_res.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/acpiphp_res.c Mon May 17 16:56:05 2004 @@ -105,7 +105,7 @@ return 0; } - +#if 0 /* * sort_by_max_size - sort nodes by their length, largest first */ @@ -151,6 +151,7 @@ return 0; } +#endif /** * get_io_resource - get resource for I/O ports @@ -247,6 +248,7 @@ } +#if 0 /** * get_max_resource - get the largest resource * @@ -254,7 +256,7 @@ * list pointed to by head. It aligns the node on top and bottom * to "size" alignment before returning it. */ -struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size) +static struct pci_resource *acpiphp_get_max_resource (struct pci_resource **head, u32 size) { struct pci_resource *max; struct pci_resource *temp; @@ -340,7 +342,7 @@ /* If we get here, we couldn't find one */ return NULL; } - +#endif /** * get_resource - get resource (mem, pfmem) diff -Nru a/drivers/pci/hotplug/cpci_hotplug.h b/drivers/pci/hotplug/cpci_hotplug.h --- a/drivers/pci/hotplug/cpci_hotplug.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/cpci_hotplug.h Mon May 17 16:56:05 2004 @@ -84,7 +84,6 @@ extern u8 cpci_get_latch_status(struct slot *slot); extern u8 cpci_get_adapter_status(struct slot *slot); extern u16 cpci_get_hs_csr(struct slot * slot); -extern u16 cpci_set_hs_csr(struct slot * slot, u16 hs_csr); extern int cpci_set_attention_status(struct slot *slot, int status); extern int cpci_check_and_clear_ins(struct slot * slot); extern int cpci_check_ext(struct slot * slot); diff -Nru a/drivers/pci/hotplug/cpci_hotplug_core.c b/drivers/pci/hotplug/cpci_hotplug_core.c --- a/drivers/pci/hotplug/cpci_hotplug_core.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/cpci_hotplug_core.c Mon May 17 16:56:05 2004 @@ -323,7 +323,7 @@ } /* This is the interrupt mode interrupt handler */ -irqreturn_t +static irqreturn_t cpci_hp_intr(int irq, void *data, struct pt_regs *regs) { dbg("entered cpci_hp_intr"); diff -Nru a/drivers/pci/hotplug/cpci_hotplug_pci.c b/drivers/pci/hotplug/cpci_hotplug_pci.c --- a/drivers/pci/hotplug/cpci_hotplug_pci.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/cpci_hotplug_pci.c Mon May 17 16:56:05 2004 @@ -127,6 +127,7 @@ return hs_csr; } +#if 0 u16 cpci_set_hs_csr(struct slot* slot, u16 hs_csr) { int hs_cap; @@ -156,6 +157,7 @@ } return new_hs_csr; } +#endif int cpci_check_and_clear_ins(struct slot* slot) { diff -Nru a/drivers/pci/hotplug/cpcihp_zt5550.c b/drivers/pci/hotplug/cpcihp_zt5550.c --- a/drivers/pci/hotplug/cpcihp_zt5550.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/cpcihp_zt5550.c Mon May 17 16:56:05 2004 @@ -172,7 +172,7 @@ return 0; } -int zt5550_hc_disable_irq(void) +static int zt5550_hc_disable_irq(void) { u8 reg; diff -Nru a/drivers/pci/hotplug/cpqphp.h b/drivers/pci/hotplug/cpqphp.h --- a/drivers/pci/hotplug/cpqphp.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/cpqphp.h Mon May 17 16:56:05 2004 @@ -431,7 +431,6 @@ extern void cpqhp_destroy_resource_list (struct resource_lists * resources); extern int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func); extern int cpqhp_unconfigure_device (struct pci_func* func); -extern struct slot *cpqhp_find_slot (struct controller *ctrl, u8 device); /* Global variables */ extern int cpqhp_debug; diff -Nru a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c --- a/drivers/pci/hotplug/cpqphp_ctrl.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/cpqphp_ctrl.c Mon May 17 16:56:05 2004 @@ -142,7 +142,7 @@ * @ctrl: scan lots of this controller * @device: the device id to find */ -struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) +static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) { struct slot *slot = ctrl->slot; @@ -2226,7 +2226,7 @@ * @num_of_slots: number of slots to use * @direction: 1 to start from the left side, 0 to start right. */ -void switch_leds(struct controller *ctrl, const int num_of_slots, +static void switch_leds(struct controller *ctrl, const int num_of_slots, u32 *work_LED, const int direction) { int loop; diff -Nru a/drivers/pci/hotplug/ibmphp.h b/drivers/pci/hotplug/ibmphp.h --- a/drivers/pci/hotplug/ibmphp.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/ibmphp.h Mon May 17 16:56:05 2004 @@ -271,7 +271,6 @@ ***********************************************************/ extern struct list_head ibmphp_ebda_pci_rsrc_head; extern struct list_head ibmphp_slot_head; -extern struct list_head ibmphp_res_head; /*********************************************************** * FUNCTION PROTOTYPES * ***********************************************************/ @@ -754,7 +753,6 @@ /* Functions */ extern int ibmphp_init_devno (struct slot **); /* This function is called from EBDA, so we need it not be static */ -extern int ibmphp_disable_slot (struct hotplug_slot *); /* This function is called from HPC, so we need it to not be static */ extern int ibmphp_do_disable_slot (struct slot *slot_cur); extern int ibmphp_update_slot_info (struct slot *); /* This function is called from HPC, so we need it to not be be static */ extern int ibmphp_configure_card (struct pci_func *, u8); diff -Nru a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c --- a/drivers/pci/hotplug/ibmphp_core.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/ibmphp_core.c Mon May 17 16:56:05 2004 @@ -1146,7 +1146,7 @@ * OUTPUT: SUCCESS 0 ; FAILURE: UNCONFIGURE , VALIDATE * DISABLE POWER , * **************************************************************/ -int ibmphp_disable_slot (struct hotplug_slot *hotplug_slot) +static int ibmphp_disable_slot (struct hotplug_slot *hotplug_slot) { struct slot *slot = hotplug_slot->private; int rc; diff -Nru a/drivers/pci/hotplug/ibmphp_res.c b/drivers/pci/hotplug/ibmphp_res.c --- a/drivers/pci/hotplug/ibmphp_res.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/ibmphp_res.c Mon May 17 16:56:05 2004 @@ -45,7 +45,6 @@ static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8); static LIST_HEAD(gbuses); -LIST_HEAD(ibmphp_res_head); static struct bus_node * __init alloc_error_bus (struct ebda_pci_rsrc * curr, u8 busno, int flag) { diff -Nru a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h --- a/drivers/pci/hotplug/pciehp.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/pciehp.h Mon May 17 16:56:05 2004 @@ -196,7 +196,6 @@ extern void pciehp_create_ctrl_files (struct controller *ctrl); /* controller functions */ -extern void pciehp_pushbutton_thread (unsigned long event_pointer); extern int pciehprm_find_available_resources (struct controller *ctrl); extern int pciehp_event_start_thread (void); extern void pciehp_event_stop_thread (void); diff -Nru a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c --- a/drivers/pci/hotplug/pciehp_ctrl.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/pciehp_ctrl.c Mon May 17 16:56:05 2004 @@ -1395,6 +1395,81 @@ } +/** + * pciehp_pushbutton_thread + * + * Scheduled procedure to handle blocking stuff for the pushbuttons + * Handles all pending events and exits. + * + */ +static void pciehp_pushbutton_thread(unsigned long slot) +{ + struct slot *p_slot = (struct slot *) slot; + u8 getstatus; + int rc; + + pushbutton_pending = 0; + + if (!p_slot) { + dbg("%s: Error! slot NULL\n", __FUNCTION__); + return; + } + + p_slot->hpc_ops->get_power_status(p_slot, &getstatus); + if (getstatus) { + p_slot->state = POWEROFF_STATE; + dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); + + if (pciehp_disable_slot(p_slot)) { + /* Wait for exclusive access to hardware */ + down(&p_slot->ctrl->crit_sect); + + /* Turn on the Attention LED */ + rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); + if (rc) { + err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); + return; + } + + /* Wait for the command to complete */ + wait_for_ctrl_irq (p_slot->ctrl); + + /* Done with exclusive hardware access */ + up(&p_slot->ctrl->crit_sect); + } + p_slot->state = STATIC_STATE; + } else { + p_slot->state = POWERON_STATE; + dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); + + if (pciehp_enable_slot(p_slot)) { + /* Wait for exclusive access to hardware */ + down(&p_slot->ctrl->crit_sect); + + /* Turn off the green LED */ + rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); + if (rc) { + err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); + return; + } + /* Wait for the command to complete */ + wait_for_ctrl_irq (p_slot->ctrl); + + p_slot->hpc_ops->green_led_off(p_slot); + + /* Wait for the command to complete */ + wait_for_ctrl_irq (p_slot->ctrl); + + /* Done with exclusive hardware access */ + up(&p_slot->ctrl->crit_sect); + } + p_slot->state = STATIC_STATE; + } + + return; +} + + /* this is the main worker thread */ static int event_thread(void* data) { @@ -1605,81 +1680,6 @@ } } /* End of FOR loop */ } -} - - -/** - * pciehp_pushbutton_thread - * - * Scheduled procedure to handle blocking stuff for the pushbuttons - * Handles all pending events and exits. - * - */ -void pciehp_pushbutton_thread(unsigned long slot) -{ - struct slot *p_slot = (struct slot *) slot; - u8 getstatus; - int rc; - - pushbutton_pending = 0; - - if (!p_slot) { - dbg("%s: Error! slot NULL\n", __FUNCTION__); - return; - } - - p_slot->hpc_ops->get_power_status(p_slot, &getstatus); - if (getstatus) { - p_slot->state = POWEROFF_STATE; - dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); - - if (pciehp_disable_slot(p_slot)) { - /* Wait for exclusive access to hardware */ - down(&p_slot->ctrl->crit_sect); - - /* Turn on the Attention LED */ - rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); - if (rc) { - err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); - return; - } - - /* Wait for the command to complete */ - wait_for_ctrl_irq (p_slot->ctrl); - - /* Done with exclusive hardware access */ - up(&p_slot->ctrl->crit_sect); - } - p_slot->state = STATIC_STATE; - } else { - p_slot->state = POWERON_STATE; - dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); - - if (pciehp_enable_slot(p_slot)) { - /* Wait for exclusive access to hardware */ - down(&p_slot->ctrl->crit_sect); - - /* Turn off the green LED */ - rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); - if (rc) { - err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); - return; - } - /* Wait for the command to complete */ - wait_for_ctrl_irq (p_slot->ctrl); - - p_slot->hpc_ops->green_led_off(p_slot); - - /* Wait for the command to complete */ - wait_for_ctrl_irq (p_slot->ctrl); - - /* Done with exclusive hardware access */ - up(&p_slot->ctrl->crit_sect); - } - p_slot->state = STATIC_STATE; - } - - return; } diff -Nru a/drivers/pci/hotplug/pciehprm.h b/drivers/pci/hotplug/pciehprm.h --- a/drivers/pci/hotplug/pciehprm.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/pciehprm.h Mon May 17 16:56:05 2004 @@ -37,7 +37,6 @@ int pciehprm_init(enum php_ctlr_type ct); void pciehprm_cleanup(void); int pciehprm_print_pirt(void); -void *pciehprm_get_slot(struct slot *slot); int pciehprm_find_available_resources(struct controller *ctrl); int pciehprm_set_hpp(struct controller *ctrl, struct pci_func *func, u8 card_type); void pciehprm_enable_card(struct controller *ctrl, struct pci_func *func, u8 card_type); diff -Nru a/drivers/pci/hotplug/pciehprm_acpi.c b/drivers/pci/hotplug/pciehprm_acpi.c --- a/drivers/pci/hotplug/pciehprm_acpi.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/pciehprm_acpi.c Mon May 17 16:56:05 2004 @@ -1301,6 +1301,7 @@ } +#if 0 void * pciehprm_get_slot(struct slot *slot) { struct acpi_bridge *ab = acpi_bridges_head; @@ -1312,6 +1313,7 @@ return (void *)aps; } +#endif static void pciehprm_dump_func_res( struct pci_func *fun) { diff -Nru a/drivers/pci/hotplug/pciehprm_nonacpi.c b/drivers/pci/hotplug/pciehprm_nonacpi.c --- a/drivers/pci/hotplug/pciehprm_nonacpi.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/pciehprm_nonacpi.c Mon May 17 16:56:05 2004 @@ -52,11 +52,6 @@ return 0; } -void * pciehprm_get_slot(struct slot *slot) -{ - return NULL; -} - int pciehprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum) { diff -Nru a/drivers/pci/hotplug/shpchp.h b/drivers/pci/hotplug/shpchp.h --- a/drivers/pci/hotplug/shpchp.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/shpchp.h Mon May 17 16:56:05 2004 @@ -205,7 +205,6 @@ extern void shpchp_create_ctrl_files (struct controller *ctrl); /* controller functions */ -extern void shpchp_pushbutton_thread(unsigned long event_pointer); extern int shpchprm_find_available_resources(struct controller *ctrl); extern int shpchp_event_start_thread(void); extern void shpchp_event_stop_thread(void); diff -Nru a/drivers/pci/hotplug/shpchp_ctrl.c b/drivers/pci/hotplug/shpchp_ctrl.c --- a/drivers/pci/hotplug/shpchp_ctrl.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/shpchp_ctrl.c Mon May 17 16:56:05 2004 @@ -1796,6 +1796,81 @@ } +/** + * shpchp_pushbutton_thread + * + * Scheduled procedure to handle blocking stuff for the pushbuttons + * Handles all pending events and exits. + * + */ +static void shpchp_pushbutton_thread (unsigned long slot) +{ + struct slot *p_slot = (struct slot *) slot; + u8 getstatus; + int rc; + + pushbutton_pending = 0; + + if (!p_slot) { + dbg("%s: Error! slot NULL\n", __FUNCTION__); + return; + } + + p_slot->hpc_ops->get_power_status(p_slot, &getstatus); + if (getstatus) { + p_slot->state = POWEROFF_STATE; + dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); + + if (shpchp_disable_slot(p_slot)) { + /* Wait for exclusive access to hardware */ + down(&p_slot->ctrl->crit_sect); + + /* Turn on the Attention LED */ + rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); + if (rc) { + err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); + return; + } + + /* Wait for the command to complete */ + wait_for_ctrl_irq (p_slot->ctrl); + + /* Done with exclusive hardware access */ + up(&p_slot->ctrl->crit_sect); + } + p_slot->state = STATIC_STATE; + } else { + p_slot->state = POWERON_STATE; + dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); + + if (shpchp_enable_slot(p_slot)) { + /* Wait for exclusive access to hardware */ + down(&p_slot->ctrl->crit_sect); + + /* Turn off the green LED */ + rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); + if (rc) { + err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); + return; + } + /* Wait for the command to complete */ + wait_for_ctrl_irq (p_slot->ctrl); + + p_slot->hpc_ops->green_led_off(p_slot); + + /* Wait for the command to complete */ + wait_for_ctrl_irq (p_slot->ctrl); + + /* Done with exclusive hardware access */ + up(&p_slot->ctrl->crit_sect); + } + p_slot->state = STATIC_STATE; + } + + return; +} + + /* this is the main worker thread */ static int event_thread(void* data) { @@ -2006,81 +2081,6 @@ change = 1; } } /* End of FOR loop */ - } - - return; -} - - -/** - * shpchp_pushbutton_thread - * - * Scheduled procedure to handle blocking stuff for the pushbuttons - * Handles all pending events and exits. - * - */ -void shpchp_pushbutton_thread (unsigned long slot) -{ - struct slot *p_slot = (struct slot *) slot; - u8 getstatus; - int rc; - - pushbutton_pending = 0; - - if (!p_slot) { - dbg("%s: Error! slot NULL\n", __FUNCTION__); - return; - } - - p_slot->hpc_ops->get_power_status(p_slot, &getstatus); - if (getstatus) { - p_slot->state = POWEROFF_STATE; - dbg("In power_down_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); - - if (shpchp_disable_slot(p_slot)) { - /* Wait for exclusive access to hardware */ - down(&p_slot->ctrl->crit_sect); - - /* Turn on the Attention LED */ - rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); - if (rc) { - err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); - return; - } - - /* Wait for the command to complete */ - wait_for_ctrl_irq (p_slot->ctrl); - - /* Done with exclusive hardware access */ - up(&p_slot->ctrl->crit_sect); - } - p_slot->state = STATIC_STATE; - } else { - p_slot->state = POWERON_STATE; - dbg("In add_board, b:d(%x:%x)\n", p_slot->bus, p_slot->device); - - if (shpchp_enable_slot(p_slot)) { - /* Wait for exclusive access to hardware */ - down(&p_slot->ctrl->crit_sect); - - /* Turn off the green LED */ - rc = p_slot->hpc_ops->set_attention_status(p_slot, 1); - if (rc) { - err("%s: Issue of Set Atten Indicator On command failed\n", __FUNCTION__); - return; - } - /* Wait for the command to complete */ - wait_for_ctrl_irq (p_slot->ctrl); - - p_slot->hpc_ops->green_led_off(p_slot); - - /* Wait for the command to complete */ - wait_for_ctrl_irq (p_slot->ctrl); - - /* Done with exclusive hardware access */ - up(&p_slot->ctrl->crit_sect); - } - p_slot->state = STATIC_STATE; } return; diff -Nru a/drivers/pci/hotplug/shpchprm.h b/drivers/pci/hotplug/shpchprm.h --- a/drivers/pci/hotplug/shpchprm.h Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/shpchprm.h Mon May 17 16:56:05 2004 @@ -39,7 +39,6 @@ int shpchprm_init(enum php_ctlr_type ct); void shpchprm_cleanup(void); int shpchprm_print_pirt(void); -void *shpchprm_get_slot(struct slot *slot); int shpchprm_find_available_resources(struct controller *ctrl); int shpchprm_set_hpp(struct controller *ctrl, struct pci_func *func, u8 card_type); void shpchprm_enable_card(struct controller *ctrl, struct pci_func *func, u8 card_type); diff -Nru a/drivers/pci/hotplug/shpchprm_acpi.c b/drivers/pci/hotplug/shpchprm_acpi.c --- a/drivers/pci/hotplug/shpchprm_acpi.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/shpchprm_acpi.c Mon May 17 16:56:05 2004 @@ -1299,7 +1299,8 @@ } -void * shpchprm_get_slot(struct slot *slot) +#if 0 +static void * shpchprm_get_slot(struct slot *slot) { struct acpi_bridge *ab = acpi_bridges_head; struct acpi_php_slot *aps = get_acpi_slot (ab, slot->number); @@ -1310,6 +1311,7 @@ return (void *)aps; } +#endif static void shpchprm_dump_func_res( struct pci_func *fun) { diff -Nru a/drivers/pci/hotplug/shpchprm_legacy.c b/drivers/pci/hotplug/shpchprm_legacy.c --- a/drivers/pci/hotplug/shpchprm_legacy.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/shpchprm_legacy.c Mon May 17 16:56:05 2004 @@ -55,11 +55,6 @@ return 0; } -void * shpchprm_get_slot(struct slot *slot) -{ - return NULL; -} - int shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum) { int offset = devnum - ctrl->slot_device_offset; diff -Nru a/drivers/pci/hotplug/shpchprm_nonacpi.c b/drivers/pci/hotplug/shpchprm_nonacpi.c --- a/drivers/pci/hotplug/shpchprm_nonacpi.c Mon May 17 16:56:05 2004 +++ b/drivers/pci/hotplug/shpchprm_nonacpi.c Mon May 17 16:56:05 2004 @@ -51,11 +51,6 @@ return 0; } -void * shpchprm_get_slot(struct slot *slot) -{ - return NULL; -} - int shpchprm_get_physical_slot_number(struct controller *ctrl, u32 *sun, u8 busnum, u8 devnum) { int offset = devnum - ctrl->slot_device_offset;