Lines Matching refs:ctrl
59 u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl) in shpchp_handle_attention_button() argument
65 ctrl_dbg(ctrl, "Attention button interrupt received\n"); in shpchp_handle_attention_button()
67 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_attention_button()
73 ctrl_info(ctrl, "Button pressed on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_attention_button()
82 u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl) in shpchp_handle_switch_change() argument
89 ctrl_dbg(ctrl, "Switch interrupt received\n"); in shpchp_handle_switch_change()
91 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_switch_change()
94 ctrl_dbg(ctrl, "Card present %x Power status %x\n", in shpchp_handle_switch_change()
101 ctrl_info(ctrl, "Latch open on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_switch_change()
105 ctrl_err(ctrl, "Surprise Removal of card\n"); in shpchp_handle_switch_change()
111 ctrl_info(ctrl, "Latch close on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_switch_change()
120 u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl) in shpchp_handle_presence_change() argument
126 ctrl_dbg(ctrl, "Presence/Notify input change\n"); in shpchp_handle_presence_change()
128 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_presence_change()
138 ctrl_info(ctrl, "Card present on Slot(%s)\n", in shpchp_handle_presence_change()
145 ctrl_info(ctrl, "Card not present on Slot(%s)\n", in shpchp_handle_presence_change()
155 u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl) in shpchp_handle_power_fault() argument
161 ctrl_dbg(ctrl, "Power fault interrupt received\n"); in shpchp_handle_power_fault()
163 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_power_fault()
169 ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", in shpchp_handle_power_fault()
177 ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_power_fault()
181 ctrl_info(ctrl, "Power fault bit %x set\n", hp_slot); in shpchp_handle_power_fault()
192 static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, in change_bus_speed() argument
197 ctrl_dbg(ctrl, "Change speed to %d\n", speed); in change_bus_speed()
200 ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", in change_bus_speed()
207 static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, in fix_bus_speed() argument
219 ctrl_err(ctrl, "Speed of bus %x and adapter %x mismatch\n", in fix_bus_speed()
228 rc = change_bus_speed(ctrl, pslot, asp); in fix_bus_speed()
231 rc = change_bus_speed(ctrl, pslot, msp); in fix_bus_speed()
249 struct controller *ctrl = p_slot->ctrl; in board_added() local
250 struct pci_bus *parent = ctrl->pci_dev->subordinate; in board_added()
252 hp_slot = p_slot->device - ctrl->slot_device_offset; in board_added()
254 ctrl_dbg(ctrl, "%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", in board_added()
255 __func__, p_slot->device, ctrl->slot_device_offset, hp_slot); in board_added()
260 ctrl_err(ctrl, "Failed to power on slot\n"); in board_added()
264 if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) { in board_added()
267 ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", in board_added()
275 ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); in board_added()
282 ctrl_err(ctrl, "Can't get adapter speed or bus mode mismatch\n"); in board_added()
286 bsp = ctrl->pci_dev->subordinate->cur_bus_speed; in board_added()
287 msp = ctrl->pci_dev->subordinate->max_bus_speed; in board_added()
290 if (!list_empty(&ctrl->pci_dev->subordinate->devices)) in board_added()
293 ctrl_dbg(ctrl, "%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, max_bus_speed %d\n", in board_added()
297 rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); in board_added()
304 ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); in board_added()
311 ctrl_dbg(ctrl, "%s: slot status = %x\n", __func__, p_slot->status); in board_added()
315 ctrl_dbg(ctrl, "%s: Power fault\n", __func__); in board_added()
322 ctrl_err(ctrl, "Cannot add device at %04x:%02x:%02x\n", in board_added()
339 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", in board_added()
354 struct controller *ctrl = p_slot->ctrl; in remove_board() local
361 hp_slot = p_slot->device - ctrl->slot_device_offset; in remove_board()
362 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in remove_board()
364 ctrl_dbg(ctrl, "%s: hp_slot = %d\n", __func__, hp_slot); in remove_board()
373 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", in remove_board()
380 ctrl_err(ctrl, "Issue of Set Attention command failed\n"); in remove_board()
439 ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n", in shpchp_queue_pushbutton_work()
488 struct controller *ctrl = p_slot->ctrl; in handle_button_press_event() local
495 ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", in handle_button_press_event()
499 ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", in handle_button_press_event()
515 ctrl_info(ctrl, "Button cancel on Slot(%s)\n", in handle_button_press_event()
523 ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", in handle_button_press_event()
534 ctrl_info(ctrl, "Button ignore on Slot(%s)\n", in handle_button_press_event()
539 ctrl_warn(ctrl, "Not a valid state\n"); in handle_button_press_event()
555 ctrl_dbg(p_slot->ctrl, "%s: Power fault\n", __func__); in interrupt_event_handler()
573 struct controller *ctrl = p_slot->ctrl; in shpchp_enable_slot() local
576 mutex_lock(&p_slot->ctrl->crit_sect); in shpchp_enable_slot()
579 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); in shpchp_enable_slot()
584 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); in shpchp_enable_slot()
589 ctrl_info(ctrl, "Already enabled on slot(%s)\n", in shpchp_enable_slot()
599 ctrl_dbg(ctrl, "%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); in shpchp_enable_slot()
602 if (((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD) || in shpchp_enable_slot()
603 (p_slot->ctrl->pci_dev->device == PCI_DEVICE_ID_AMD_POGO_7458)) in shpchp_enable_slot()
604 && p_slot->ctrl->num_slots == 1) { in shpchp_enable_slot()
621 mutex_unlock(&p_slot->ctrl->crit_sect); in shpchp_enable_slot()
630 struct controller *ctrl = p_slot->ctrl; in shpchp_disable_slot() local
632 if (!p_slot->ctrl) in shpchp_disable_slot()
636 mutex_lock(&p_slot->ctrl->crit_sect); in shpchp_disable_slot()
640 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); in shpchp_disable_slot()
645 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); in shpchp_disable_slot()
650 ctrl_info(ctrl, "Already disabled on slot(%s)\n", in shpchp_disable_slot()
658 mutex_unlock(&p_slot->ctrl->crit_sect); in shpchp_disable_slot()
665 struct controller *ctrl = p_slot->ctrl; in shpchp_sysfs_enable_slot() local
679 ctrl_info(ctrl, "Slot %s is already in powering on state\n", in shpchp_sysfs_enable_slot()
684 ctrl_info(ctrl, "Already enabled on slot %s\n", in shpchp_sysfs_enable_slot()
688 ctrl_err(ctrl, "Not a valid state on slot %s\n", in shpchp_sysfs_enable_slot()
700 struct controller *ctrl = p_slot->ctrl; in shpchp_sysfs_disable_slot() local
714 ctrl_info(ctrl, "Slot %s is already in powering off state\n", in shpchp_sysfs_disable_slot()
719 ctrl_info(ctrl, "Already disabled on slot %s\n", in shpchp_sysfs_disable_slot()
723 ctrl_err(ctrl, "Not a valid state on slot %s\n", in shpchp_sysfs_disable_slot()