Lines Matching refs:ctrl

45 u8 shpchp_handle_attention_button(u8 hp_slot, struct controller *ctrl)  in shpchp_handle_attention_button()  argument
51 ctrl_dbg(ctrl, "Attention button interrupt received\n"); in shpchp_handle_attention_button()
53 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_attention_button()
59 ctrl_info(ctrl, "Button pressed on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_attention_button()
68 u8 shpchp_handle_switch_change(u8 hp_slot, struct controller *ctrl) in shpchp_handle_switch_change() argument
75 ctrl_dbg(ctrl, "Switch interrupt received\n"); in shpchp_handle_switch_change()
77 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_switch_change()
80 ctrl_dbg(ctrl, "Card present %x Power status %x\n", in shpchp_handle_switch_change()
87 ctrl_info(ctrl, "Latch open on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_switch_change()
91 ctrl_err(ctrl, "Surprise Removal of card\n"); in shpchp_handle_switch_change()
97 ctrl_info(ctrl, "Latch close on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_switch_change()
106 u8 shpchp_handle_presence_change(u8 hp_slot, struct controller *ctrl) in shpchp_handle_presence_change() argument
112 ctrl_dbg(ctrl, "Presence/Notify input change\n"); in shpchp_handle_presence_change()
114 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_presence_change()
124 ctrl_info(ctrl, "Card present on Slot(%s)\n", in shpchp_handle_presence_change()
131 ctrl_info(ctrl, "Card not present on Slot(%s)\n", in shpchp_handle_presence_change()
141 u8 shpchp_handle_power_fault(u8 hp_slot, struct controller *ctrl) in shpchp_handle_power_fault() argument
147 ctrl_dbg(ctrl, "Power fault interrupt received\n"); in shpchp_handle_power_fault()
149 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in shpchp_handle_power_fault()
155 ctrl_info(ctrl, "Power fault cleared on Slot(%s)\n", in shpchp_handle_power_fault()
163 ctrl_info(ctrl, "Power fault on Slot(%s)\n", slot_name(p_slot)); in shpchp_handle_power_fault()
167 ctrl_info(ctrl, "Power fault bit %x set\n", hp_slot); in shpchp_handle_power_fault()
178 static int change_bus_speed(struct controller *ctrl, struct slot *p_slot, in change_bus_speed() argument
183 ctrl_dbg(ctrl, "Change speed to %d\n", speed); in change_bus_speed()
186 ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", in change_bus_speed()
193 static int fix_bus_speed(struct controller *ctrl, struct slot *pslot, in fix_bus_speed() argument
205 ctrl_err(ctrl, "Speed of bus %x and adapter %x mismatch\n", in fix_bus_speed()
214 rc = change_bus_speed(ctrl, pslot, asp); in fix_bus_speed()
217 rc = change_bus_speed(ctrl, pslot, msp); in fix_bus_speed()
235 struct controller *ctrl = p_slot->ctrl; in board_added() local
236 struct pci_bus *parent = ctrl->pci_dev->subordinate; in board_added()
238 hp_slot = p_slot->device - ctrl->slot_device_offset; in board_added()
240 ctrl_dbg(ctrl, "%s: p_slot->device, slot_offset, hp_slot = %d, %d ,%d\n", in board_added()
241 __func__, p_slot->device, ctrl->slot_device_offset, hp_slot); in board_added()
246 ctrl_err(ctrl, "Failed to power on slot\n"); in board_added()
250 if ((ctrl->pci_dev->vendor == 0x8086) && (ctrl->pci_dev->device == 0x0332)) { in board_added()
253 ctrl_err(ctrl, "%s: Issue of set bus speed mode command failed\n", in board_added()
261 ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); in board_added()
268 ctrl_err(ctrl, "Can't get adapter speed or bus mode mismatch\n"); in board_added()
272 bsp = ctrl->pci_dev->subordinate->cur_bus_speed; in board_added()
273 msp = ctrl->pci_dev->subordinate->max_bus_speed; in board_added()
276 if (!list_empty(&ctrl->pci_dev->subordinate->devices)) in board_added()
279 ctrl_dbg(ctrl, "%s: slots_not_empty %d, adapter_speed %d, bus_speed %d, max_bus_speed %d\n", in board_added()
283 rc = fix_bus_speed(ctrl, p_slot, slots_not_empty, asp, bsp, msp); in board_added()
290 ctrl_err(ctrl, "Issue of Slot Enable command failed\n"); in board_added()
297 ctrl_dbg(ctrl, "%s: slot status = %x\n", __func__, p_slot->status); in board_added()
301 ctrl_dbg(ctrl, "%s: Power fault\n", __func__); in board_added()
307 ctrl_err(ctrl, "Cannot add device at %04x:%02x:%02x\n", in board_added()
324 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", in board_added()
339 struct controller *ctrl = p_slot->ctrl; in remove_board() local
345 hp_slot = p_slot->device - ctrl->slot_device_offset; in remove_board()
346 p_slot = shpchp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in remove_board()
348 ctrl_dbg(ctrl, "%s: hp_slot = %d\n", __func__, hp_slot); in remove_board()
357 ctrl_err(ctrl, "%s: Issue of Slot Disable command failed\n", in remove_board()
364 ctrl_err(ctrl, "Issue of Set Attention command failed\n"); in remove_board()
423 ctrl_err(p_slot->ctrl, "%s: Cannot allocate memory\n", in shpchp_queue_pushbutton_work()
461 struct controller *ctrl = p_slot->ctrl; in handle_button_press_event() local
468 ctrl_info(ctrl, "PCI slot #%s - powering off due to button press\n", in handle_button_press_event()
472 ctrl_info(ctrl, "PCI slot #%s - powering on due to button press\n", in handle_button_press_event()
488 ctrl_info(ctrl, "Button cancel on Slot(%s)\n", in handle_button_press_event()
496 ctrl_info(ctrl, "PCI slot #%s - action canceled due to button press\n", in handle_button_press_event()
507 ctrl_info(ctrl, "Button ignore on Slot(%s)\n", in handle_button_press_event()
512 ctrl_warn(ctrl, "Not a valid state\n"); in handle_button_press_event()
528 ctrl_dbg(p_slot->ctrl, "%s: Power fault\n", __func__); in interrupt_event_handler()
546 struct controller *ctrl = p_slot->ctrl; in shpchp_enable_slot() local
549 mutex_lock(&p_slot->ctrl->crit_sect); in shpchp_enable_slot()
552 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); in shpchp_enable_slot()
557 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); in shpchp_enable_slot()
562 ctrl_info(ctrl, "Already enabled on slot(%s)\n", in shpchp_enable_slot()
572 ctrl_dbg(ctrl, "%s: p_slot->pwr_save %x\n", __func__, p_slot->pwr_save); in shpchp_enable_slot()
575 if ((p_slot->ctrl->pci_dev->vendor == PCI_VENDOR_ID_AMD && in shpchp_enable_slot()
576 p_slot->ctrl->pci_dev->device == PCI_DEVICE_ID_AMD_POGO_7458) in shpchp_enable_slot()
577 && p_slot->ctrl->num_slots == 1) { in shpchp_enable_slot()
593 mutex_unlock(&p_slot->ctrl->crit_sect); in shpchp_enable_slot()
602 struct controller *ctrl = p_slot->ctrl; in shpchp_disable_slot() local
604 if (!p_slot->ctrl) in shpchp_disable_slot()
608 mutex_lock(&p_slot->ctrl->crit_sect); in shpchp_disable_slot()
612 ctrl_info(ctrl, "No adapter on slot(%s)\n", slot_name(p_slot)); in shpchp_disable_slot()
617 ctrl_info(ctrl, "Latch open on slot(%s)\n", slot_name(p_slot)); in shpchp_disable_slot()
622 ctrl_info(ctrl, "Already disabled on slot(%s)\n", in shpchp_disable_slot()
630 mutex_unlock(&p_slot->ctrl->crit_sect); in shpchp_disable_slot()
637 struct controller *ctrl = p_slot->ctrl; in shpchp_sysfs_enable_slot() local
652 ctrl_info(ctrl, "Slot %s is already in powering on state\n", in shpchp_sysfs_enable_slot()
657 ctrl_info(ctrl, "Already enabled on slot %s\n", in shpchp_sysfs_enable_slot()
661 ctrl_err(ctrl, "Not a valid state on slot %s\n", in shpchp_sysfs_enable_slot()
673 struct controller *ctrl = p_slot->ctrl; in shpchp_sysfs_disable_slot() local
688 ctrl_info(ctrl, "Slot %s is already in powering off state\n", in shpchp_sysfs_disable_slot()
693 ctrl_info(ctrl, "Already disabled on slot %s\n", in shpchp_sysfs_disable_slot()
697 ctrl_err(ctrl, "Not a valid state on slot %s\n", in shpchp_sysfs_disable_slot()