struct pci_func *func; 
static void interrupt_event_handler(struct controller *ctrl){	int loop = 0;	int change = 1;	struct pci_func *func;	u8 hp_slot;	u8 getstatus;	struct slot *p_slot;	while (change) {		change = 0;		for (loop = 0; loop < 10; loop++) {			if (ctrl->event_queue[loop].event_type != 0) {				hp_slot = ctrl->event_queue[loop].hp_slot;				func = pciehp_slot_find(ctrl->slot_bus, (hp_slot + ctrl->slot_device_offset), 0);				p_slot = pciehp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset);				dbg("hp_slot %d, func %p, p_slot %p\n", hp_slot, func, p_slot);				if (ctrl->event_queue[loop].event_type == INT_BUTTON_CANCEL) {					dbg("button cancel\n");					del_timer(&p_slot->task_event);					switch (p_slot->state) {					case BLINKINGOFF_STATE:						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);												if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_on(p_slot);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						if (ATTN_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->set_attention_status(p_slot, 0);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);						break;					case BLINKINGON_STATE:						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);						if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_off(p_slot);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						if (ATTN_LED(ctrl->ctrlcap)){							p_slot->hpc_ops->set_attention_status(p_slot, 0);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);						break;					default:						warn("Not a valid state\n");						return;					}					info(msg_button_cancel, p_slot->number);					p_slot->state = STATIC_STATE;				}				/* ***********Button Pressed (No action on 1st press...) */				else if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) {										if (ATTN_BUTTN(ctrl->ctrlcap)) {						dbg("Button pressed\n");						p_slot->hpc_ops->get_power_status(p_slot, &getstatus);						if (getstatus) {							/* slot is on */							dbg("slot is on\n");							p_slot->state = BLINKINGOFF_STATE;							info(msg_button_off, p_slot->number);						} else {							/* slot is off */							dbg("slot is off\n");							p_slot->state = BLINKINGON_STATE;							info(msg_button_on, p_slot->number);						}						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);						/* blink green LED and turn off amber */						if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_blink(p_slot);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						if (ATTN_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->set_attention_status(p_slot, 0);							/* Wait for the command to complete */							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);						init_timer(&p_slot->task_event);						p_slot->task_event.expires = jiffies + 5 * HZ;   /* 5 second delay */						p_slot->task_event.function = (void (*)(unsigned long)) pushbutton_helper_thread;						p_slot->task_event.data = (unsigned long) p_slot;						dbg("add_timer p_slot = %p\n", (void *) p_slot);						add_timer(&p_slot->task_event);					}				}				/***********POWER FAULT********************/				else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) {					if (POWER_CTRL(ctrl->ctrlcap)) {						dbg("power fault\n");						/* Wait for exclusive access to hardware */						down(&ctrl->crit_sect);						if (ATTN_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->set_attention_status(p_slot, 1);							wait_for_ctrl_irq (ctrl);						}						if (PWR_LED(ctrl->ctrlcap)) {							p_slot->hpc_ops->green_led_off(p_slot);							wait_for_ctrl_irq (ctrl);						}						/* Done with exclusive hardware access */						up(&ctrl->crit_sect);					}				}				/***********SURPRISE REMOVAL********************/				else if ((ctrl->event_queue[loop].event_type == INT_PRESENCE_ON) || 					(ctrl->event_queue[loop].event_type == INT_PRESENCE_OFF)) {					if (HP_SUPR_RM(ctrl->ctrlcap)) {						dbg("Surprise Removal\n");						if (p_slot) {							surprise_rm_pending = (unsigned long) p_slot;							up(&event_semaphore);							update_slot_info(p_slot);						}					}				} else {					/* refresh notification */					if (p_slot)						update_slot_info(p_slot);				}				ctrl->event_queue[loop].event_type = 0;				change = 1;			}		}		/* End of FOR loop */	}}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/ca22a5e4d70620b7f3d809e424daa5214b0aa00d/pciehp_ctrl.c/clean/drivers/pci/hotplug/pciehp_ctrl.c