Lines Matching refs:p_slot
54 static int board_added(struct slot *p_slot) in board_added() argument
57 struct controller *ctrl = p_slot->ctrl; in board_added()
62 retval = pciehp_power_on_slot(p_slot); in board_added()
67 pciehp_green_led_blink(p_slot); in board_added()
77 if (ctrl->power_fault_detected || pciehp_query_power_fault(p_slot)) { in board_added()
78 ctrl_err(ctrl, "Slot(%s): Power fault\n", slot_name(p_slot)); in board_added()
83 retval = pciehp_configure_device(p_slot); in board_added()
92 pciehp_green_led_on(p_slot); in board_added()
93 pciehp_set_attention_status(p_slot, 0); in board_added()
97 set_slot_off(ctrl, p_slot); in board_added()
105 static void remove_board(struct slot *p_slot) in remove_board() argument
107 struct controller *ctrl = p_slot->ctrl; in remove_board()
109 pciehp_unconfigure_device(p_slot); in remove_board()
112 pciehp_power_off_slot(p_slot); in remove_board()
123 pciehp_green_led_off(p_slot); in remove_board()
138 struct slot *p_slot = container_of(work, struct slot, work.work); in pciehp_queue_pushbutton_work() local
139 struct controller *ctrl = p_slot->ctrl; in pciehp_queue_pushbutton_work()
141 mutex_lock(&p_slot->lock); in pciehp_queue_pushbutton_work()
142 switch (p_slot->state) { in pciehp_queue_pushbutton_work()
152 mutex_unlock(&p_slot->lock); in pciehp_queue_pushbutton_work()
155 void pciehp_handle_button_press(struct slot *p_slot) in pciehp_handle_button_press() argument
157 struct controller *ctrl = p_slot->ctrl; in pciehp_handle_button_press()
159 mutex_lock(&p_slot->lock); in pciehp_handle_button_press()
160 switch (p_slot->state) { in pciehp_handle_button_press()
163 if (p_slot->state == ON_STATE) { in pciehp_handle_button_press()
164 p_slot->state = BLINKINGOFF_STATE; in pciehp_handle_button_press()
166 slot_name(p_slot)); in pciehp_handle_button_press()
168 p_slot->state = BLINKINGON_STATE; in pciehp_handle_button_press()
170 slot_name(p_slot)); in pciehp_handle_button_press()
173 pciehp_green_led_blink(p_slot); in pciehp_handle_button_press()
174 pciehp_set_attention_status(p_slot, 0); in pciehp_handle_button_press()
175 schedule_delayed_work(&p_slot->work, 5 * HZ); in pciehp_handle_button_press()
184 ctrl_info(ctrl, "Slot(%s): Button cancel\n", slot_name(p_slot)); in pciehp_handle_button_press()
185 cancel_delayed_work(&p_slot->work); in pciehp_handle_button_press()
186 if (p_slot->state == BLINKINGOFF_STATE) { in pciehp_handle_button_press()
187 p_slot->state = ON_STATE; in pciehp_handle_button_press()
188 pciehp_green_led_on(p_slot); in pciehp_handle_button_press()
190 p_slot->state = OFF_STATE; in pciehp_handle_button_press()
191 pciehp_green_led_off(p_slot); in pciehp_handle_button_press()
193 pciehp_set_attention_status(p_slot, 0); in pciehp_handle_button_press()
195 slot_name(p_slot)); in pciehp_handle_button_press()
199 slot_name(p_slot), p_slot->state); in pciehp_handle_button_press()
202 mutex_unlock(&p_slot->lock); in pciehp_handle_button_press()
283 static int __pciehp_enable_slot(struct slot *p_slot) in __pciehp_enable_slot() argument
286 struct controller *ctrl = p_slot->ctrl; in __pciehp_enable_slot()
288 pciehp_get_adapter_status(p_slot, &getstatus); in __pciehp_enable_slot()
290 ctrl_info(ctrl, "Slot(%s): No adapter\n", slot_name(p_slot)); in __pciehp_enable_slot()
293 if (MRL_SENS(p_slot->ctrl)) { in __pciehp_enable_slot()
294 pciehp_get_latch_status(p_slot, &getstatus); in __pciehp_enable_slot()
297 slot_name(p_slot)); in __pciehp_enable_slot()
302 if (POWER_CTRL(p_slot->ctrl)) { in __pciehp_enable_slot()
303 pciehp_get_power_status(p_slot, &getstatus); in __pciehp_enable_slot()
306 slot_name(p_slot)); in __pciehp_enable_slot()
311 return board_added(p_slot); in __pciehp_enable_slot()
332 static int __pciehp_disable_slot(struct slot *p_slot) in __pciehp_disable_slot() argument
335 struct controller *ctrl = p_slot->ctrl; in __pciehp_disable_slot()
337 if (POWER_CTRL(p_slot->ctrl)) { in __pciehp_disable_slot()
338 pciehp_get_power_status(p_slot, &getstatus); in __pciehp_disable_slot()
341 slot_name(p_slot)); in __pciehp_disable_slot()
346 remove_board(p_slot); in __pciehp_disable_slot()
366 int pciehp_sysfs_enable_slot(struct slot *p_slot) in pciehp_sysfs_enable_slot() argument
368 struct controller *ctrl = p_slot->ctrl; in pciehp_sysfs_enable_slot()
370 mutex_lock(&p_slot->lock); in pciehp_sysfs_enable_slot()
371 switch (p_slot->state) { in pciehp_sysfs_enable_slot()
374 mutex_unlock(&p_slot->lock); in pciehp_sysfs_enable_slot()
386 slot_name(p_slot)); in pciehp_sysfs_enable_slot()
392 slot_name(p_slot)); in pciehp_sysfs_enable_slot()
396 slot_name(p_slot), p_slot->state); in pciehp_sysfs_enable_slot()
399 mutex_unlock(&p_slot->lock); in pciehp_sysfs_enable_slot()
404 int pciehp_sysfs_disable_slot(struct slot *p_slot) in pciehp_sysfs_disable_slot() argument
406 struct controller *ctrl = p_slot->ctrl; in pciehp_sysfs_disable_slot()
408 mutex_lock(&p_slot->lock); in pciehp_sysfs_disable_slot()
409 switch (p_slot->state) { in pciehp_sysfs_disable_slot()
412 mutex_unlock(&p_slot->lock); in pciehp_sysfs_disable_slot()
419 slot_name(p_slot)); in pciehp_sysfs_disable_slot()
425 slot_name(p_slot)); in pciehp_sysfs_disable_slot()
429 slot_name(p_slot), p_slot->state); in pciehp_sysfs_disable_slot()
432 mutex_unlock(&p_slot->lock); in pciehp_sysfs_disable_slot()