Lines Matching full:ctrl
28 static u32 configure_new_device(struct controller *ctrl, struct pci_func *func,
30 static int configure_new_function(struct controller *ctrl, struct pci_func *func,
32 static void interrupt_event_handler(struct controller *ctrl);
53 static u8 handle_switch_change(u8 change, struct controller *ctrl) in handle_switch_change() argument
72 func = cpqhp_slot_find(ctrl->bus, in handle_switch_change()
73 (hp_slot + ctrl->slot_device_offset), 0); in handle_switch_change()
78 taskInfo = &(ctrl->event_queue[ctrl->next_event]); in handle_switch_change()
79 ctrl->next_event = (ctrl->next_event + 1) % 10; in handle_switch_change()
84 temp_word = ctrl->ctrl_int_comp >> 16; in handle_switch_change()
88 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in handle_switch_change()
113 * @ctrl: scan lots of this controller
116 static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) in cpqhp_find_slot() argument
118 struct slot *slot = ctrl->slot; in cpqhp_find_slot()
127 static u8 handle_presence_change(u16 change, struct controller *ctrl) in handle_presence_change() argument
151 func = cpqhp_slot_find(ctrl->bus, in handle_presence_change()
152 (hp_slot + ctrl->slot_device_offset), 0); in handle_presence_change()
154 taskInfo = &(ctrl->event_queue[ctrl->next_event]); in handle_presence_change()
155 ctrl->next_event = (ctrl->next_event + 1) % 10; in handle_presence_change()
160 p_slot = cpqhp_find_slot(ctrl, hp_slot + (readb(ctrl->hpc_reg + SLOT_MASK) >> 4)); in handle_presence_change()
167 if (func->switch_save && (ctrl->push_button == 1)) { in handle_presence_change()
168 temp_word = ctrl->ctrl_int_comp >> 16; in handle_presence_change()
201 temp_word = ctrl->ctrl_int_comp >> 16; in handle_presence_change()
205 if ((!(ctrl->ctrl_int_comp & (0x010000 << hp_slot))) || in handle_presence_change()
206 (!(ctrl->ctrl_int_comp & (0x01000000 << hp_slot)))) { in handle_presence_change()
221 static u8 handle_power_fault(u8 change, struct controller *ctrl) in handle_power_fault() argument
242 func = cpqhp_slot_find(ctrl->bus, in handle_power_fault()
243 (hp_slot + ctrl->slot_device_offset), 0); in handle_power_fault()
245 taskInfo = &(ctrl->event_queue[ctrl->next_event]); in handle_power_fault()
246 ctrl->next_event = (ctrl->next_event + 1) % 10; in handle_power_fault()
251 if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) { in handle_power_fault()
264 if (ctrl->rev < 4) { in handle_power_fault()
265 amber_LED_on(ctrl, hp_slot); in handle_power_fault()
266 green_LED_off(ctrl, hp_slot); in handle_power_fault()
267 set_SOGO(ctrl); in handle_power_fault()
274 simulated_NMI(hp_slot, ctrl); */ in handle_power_fault()
879 struct controller *ctrl = data; in cpqhp_ctrl_intr() local
886 misc = readw(ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
900 writew(misc, ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
903 misc = readw(ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
906 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
911 Diff = readl(ctrl->hpc_reg + INT_INPUT_CLEAR) ^ ctrl->ctrl_int_comp; in cpqhp_ctrl_intr()
913 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
916 writel(Diff, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
919 readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
923 writel(0xFFFFFFFF, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
925 schedule_flag += handle_switch_change((u8)(Diff & 0xFFL), ctrl); in cpqhp_ctrl_intr()
926 schedule_flag += handle_presence_change((u16)((Diff & 0xFFFF0000L) >> 16), ctrl); in cpqhp_ctrl_intr()
927 schedule_flag += handle_power_fault((u8)((Diff & 0xFF00L) >> 8), ctrl); in cpqhp_ctrl_intr()
930 reset = readb(ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
934 writeb(reset, ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
935 reset = readb(ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
936 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
1107 * @ctrl: controller to change frequency/mode for.
1114 static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) in set_controller_speed() argument
1117 struct pci_bus *bus = ctrl->pci_bus; in set_controller_speed()
1119 u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); in set_controller_speed()
1121 u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1129 for (slot = ctrl->slot; slot; slot = slot->next) { in set_controller_speed()
1130 if (slot->device == (hp_slot + ctrl->slot_device_offset)) in set_controller_speed()
1132 if (get_presence_status(ctrl, slot) == 0) in set_controller_speed()
1147 if ((bus->cur_bus_speed > adapter_speed) && (!ctrl->pcix_speed_capability)) in set_controller_speed()
1151 if ((bus->cur_bus_speed < adapter_speed) && (!ctrl->pcix_speed_capability)) in set_controller_speed()
1163 writel(0x0L, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1164 writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1166 set_SOGO(ctrl); in set_controller_speed()
1167 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1173 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1175 reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); in set_controller_speed()
1200 writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); in set_controller_speed()
1205 writel(0, ctrl->hpc_reg + INT_MASK); in set_controller_speed()
1207 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1211 pci_read_config_byte(ctrl->pci_dev, 0x43, ®); in set_controller_speed()
1212 pci_write_config_byte(ctrl->pci_dev, 0x43, reg); in set_controller_speed()
1217 set_SOGO(ctrl); in set_controller_speed()
1219 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1223 writel(leds, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1224 writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1226 set_SOGO(ctrl); in set_controller_speed()
1227 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1230 slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in set_controller_speed()
1245 * @ctrl: hotplug controller
1253 static u32 board_replaced(struct pci_func *func, struct controller *ctrl) in board_replaced() argument
1255 struct pci_bus *bus = ctrl->pci_bus; in board_replaced()
1261 hp_slot = func->device - ctrl->slot_device_offset; in board_replaced()
1266 if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) in board_replaced()
1271 else if (is_slot_enabled(ctrl, hp_slot)) in board_replaced()
1274 mutex_lock(&ctrl->crit_sect); in board_replaced()
1277 enable_slot_power(ctrl, hp_slot); in board_replaced()
1279 set_SOGO(ctrl); in board_replaced()
1282 wait_for_ctrl_irq(ctrl); in board_replaced()
1286 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1287 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1288 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1290 set_SOGO(ctrl); in board_replaced()
1293 wait_for_ctrl_irq(ctrl); in board_replaced()
1295 adapter_speed = get_adapter_speed(ctrl, hp_slot); in board_replaced()
1297 if (set_controller_speed(ctrl, adapter_speed, hp_slot)) in board_replaced()
1301 disable_slot_power(ctrl, hp_slot); in board_replaced()
1303 set_SOGO(ctrl); in board_replaced()
1306 wait_for_ctrl_irq(ctrl); in board_replaced()
1308 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1313 mutex_lock(&ctrl->crit_sect); in board_replaced()
1315 slot_enable(ctrl, hp_slot); in board_replaced()
1316 green_LED_blink(ctrl, hp_slot); in board_replaced()
1318 amber_LED_off(ctrl, hp_slot); in board_replaced()
1320 set_SOGO(ctrl); in board_replaced()
1323 wait_for_ctrl_irq(ctrl); in board_replaced()
1325 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1336 rc = cpqhp_valid_replace(ctrl, func); in board_replaced()
1341 rc = cpqhp_configure_board(ctrl, func); in board_replaced()
1350 mutex_lock(&ctrl->crit_sect); in board_replaced()
1352 amber_LED_on(ctrl, hp_slot); in board_replaced()
1353 green_LED_off(ctrl, hp_slot); in board_replaced()
1354 slot_disable(ctrl, hp_slot); in board_replaced()
1356 set_SOGO(ctrl); in board_replaced()
1359 wait_for_ctrl_irq(ctrl); in board_replaced()
1361 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1376 mutex_lock(&ctrl->crit_sect); in board_replaced()
1378 amber_LED_on(ctrl, hp_slot); in board_replaced()
1379 green_LED_off(ctrl, hp_slot); in board_replaced()
1380 slot_disable(ctrl, hp_slot); in board_replaced()
1382 set_SOGO(ctrl); in board_replaced()
1385 wait_for_ctrl_irq(ctrl); in board_replaced()
1387 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1399 * @ctrl: hotplug controller
1404 static u32 board_added(struct pci_func *func, struct controller *ctrl) in board_added() argument
1413 struct pci_bus *bus = ctrl->pci_bus; in board_added()
1416 hp_slot = func->device - ctrl->slot_device_offset; in board_added()
1418 __func__, func->device, ctrl->slot_device_offset, hp_slot); in board_added()
1420 mutex_lock(&ctrl->crit_sect); in board_added()
1423 enable_slot_power(ctrl, hp_slot); in board_added()
1425 set_SOGO(ctrl); in board_added()
1428 wait_for_ctrl_irq(ctrl); in board_added()
1433 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); in board_added()
1434 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_added()
1435 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); in board_added()
1437 set_SOGO(ctrl); in board_added()
1440 wait_for_ctrl_irq(ctrl); in board_added()
1442 adapter_speed = get_adapter_speed(ctrl, hp_slot); in board_added()
1444 if (set_controller_speed(ctrl, adapter_speed, hp_slot)) in board_added()
1448 disable_slot_power(ctrl, hp_slot); in board_added()
1450 set_SOGO(ctrl); in board_added()
1453 wait_for_ctrl_irq(ctrl); in board_added()
1455 mutex_unlock(&ctrl->crit_sect); in board_added()
1460 cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in board_added()
1465 mutex_lock(&ctrl->crit_sect); in board_added()
1469 slot_enable(ctrl, hp_slot); in board_added()
1472 green_LED_blink(ctrl, hp_slot); in board_added()
1475 amber_LED_off(ctrl, hp_slot); in board_added()
1478 set_SOGO(ctrl); in board_added()
1482 wait_for_ctrl_irq(ctrl); in board_added()
1486 mutex_unlock(&ctrl->crit_sect); in board_added()
1504 ctrl->pci_bus->number = func->bus; in board_added()
1505 …rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(func->device, func->function), PCI_VENDOR_… in board_added()
1520 res_lists.io_head = ctrl->io_head; in board_added()
1521 res_lists.mem_head = ctrl->mem_head; in board_added()
1522 res_lists.p_mem_head = ctrl->p_mem_head; in board_added()
1523 res_lists.bus_head = ctrl->bus_head; in board_added()
1526 rc = configure_new_device(ctrl, func, 0, &res_lists); in board_added()
1529 ctrl->io_head = res_lists.io_head; in board_added()
1530 ctrl->mem_head = res_lists.mem_head; in board_added()
1531 ctrl->p_mem_head = res_lists.p_mem_head; in board_added()
1532 ctrl->bus_head = res_lists.bus_head; in board_added()
1534 cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); in board_added()
1535 cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); in board_added()
1536 cpqhp_resource_sort_and_combine(&(ctrl->io_head)); in board_added()
1537 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); in board_added()
1540 mutex_lock(&ctrl->crit_sect); in board_added()
1542 amber_LED_on(ctrl, hp_slot); in board_added()
1543 green_LED_off(ctrl, hp_slot); in board_added()
1544 slot_disable(ctrl, hp_slot); in board_added()
1546 set_SOGO(ctrl); in board_added()
1549 wait_for_ctrl_irq(ctrl); in board_added()
1551 mutex_unlock(&ctrl->crit_sect); in board_added()
1554 cpqhp_save_slot_config(ctrl, func); in board_added()
1567 new_slot = cpqhp_slot_find(ctrl->bus, func->device, index++); in board_added()
1569 cpqhp_configure_device(ctrl, new_slot); in board_added()
1572 mutex_lock(&ctrl->crit_sect); in board_added()
1574 green_LED_on(ctrl, hp_slot); in board_added()
1576 set_SOGO(ctrl); in board_added()
1579 wait_for_ctrl_irq(ctrl); in board_added()
1581 mutex_unlock(&ctrl->crit_sect); in board_added()
1583 mutex_lock(&ctrl->crit_sect); in board_added()
1585 amber_LED_on(ctrl, hp_slot); in board_added()
1586 green_LED_off(ctrl, hp_slot); in board_added()
1587 slot_disable(ctrl, hp_slot); in board_added()
1589 set_SOGO(ctrl); in board_added()
1592 wait_for_ctrl_irq(ctrl); in board_added()
1594 mutex_unlock(&ctrl->crit_sect); in board_added()
1606 * @ctrl: target controller
1608 static u32 remove_board(struct pci_func *func, u32 replace_flag, struct controller *ctrl) in remove_board() argument
1623 hp_slot = func->device - ctrl->slot_device_offset; in remove_board()
1628 if (replace_flag || !ctrl->add_support) in remove_board()
1629 cpqhp_save_base_addr_length(ctrl, func); in remove_board()
1647 cpqhp_save_used_resources(ctrl, func); in remove_board()
1654 mutex_lock(&ctrl->crit_sect); in remove_board()
1656 green_LED_off(ctrl, hp_slot); in remove_board()
1657 slot_disable(ctrl, hp_slot); in remove_board()
1659 set_SOGO(ctrl); in remove_board()
1662 temp_byte = readb(ctrl->hpc_reg + SLOT_SERR); in remove_board()
1664 writeb(temp_byte, ctrl->hpc_reg + SLOT_SERR); in remove_board()
1667 wait_for_ctrl_irq(ctrl); in remove_board()
1669 mutex_unlock(&ctrl->crit_sect); in remove_board()
1671 if (!replace_flag && ctrl->add_support) { in remove_board()
1673 res_lists.io_head = ctrl->io_head; in remove_board()
1674 res_lists.mem_head = ctrl->mem_head; in remove_board()
1675 res_lists.p_mem_head = ctrl->p_mem_head; in remove_board()
1676 res_lists.bus_head = ctrl->bus_head; in remove_board()
1680 ctrl->io_head = res_lists.io_head; in remove_board()
1681 ctrl->mem_head = res_lists.mem_head; in remove_board()
1682 ctrl->p_mem_head = res_lists.p_mem_head; in remove_board()
1683 ctrl->bus_head = res_lists.bus_head; in remove_board()
1685 cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); in remove_board()
1686 cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); in remove_board()
1687 cpqhp_resource_sort_and_combine(&(ctrl->io_head)); in remove_board()
1688 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); in remove_board()
1695 func = cpqhp_slot_find(ctrl->bus, device, 0); in remove_board()
1699 func = cpqhp_slot_create(ctrl->bus); in remove_board()
1704 func->bus = ctrl->bus; in remove_board()
1727 struct controller *ctrl; in event_thread() local
1740 for (ctrl = cpqhp_ctrl_list; ctrl; ctrl = ctrl->next) in event_thread()
1741 interrupt_event_handler(ctrl); in event_thread()
1765 static void interrupt_event_handler(struct controller *ctrl) in interrupt_event_handler() argument
1778 if (ctrl->event_queue[loop].event_type != 0) { in interrupt_event_handler()
1779 hp_slot = ctrl->event_queue[loop].hp_slot; in interrupt_event_handler()
1781 func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); in interrupt_event_handler()
1785 p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in interrupt_event_handler()
1792 if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) { in interrupt_event_handler()
1794 } else if (ctrl->event_queue[loop].event_type == in interrupt_event_handler()
1799 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1804 green_LED_on(ctrl, hp_slot); in interrupt_event_handler()
1808 green_LED_off(ctrl, hp_slot); in interrupt_event_handler()
1815 amber_LED_off(ctrl, hp_slot); in interrupt_event_handler()
1817 set_SOGO(ctrl); in interrupt_event_handler()
1820 wait_for_ctrl_irq(ctrl); in interrupt_event_handler()
1822 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1825 else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) { in interrupt_event_handler()
1828 if (is_slot_enabled(ctrl, hp_slot)) { in interrupt_event_handler()
1837 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1841 amber_LED_off(ctrl, hp_slot); in interrupt_event_handler()
1842 green_LED_blink(ctrl, hp_slot); in interrupt_event_handler()
1844 set_SOGO(ctrl); in interrupt_event_handler()
1847 wait_for_ctrl_irq(ctrl); in interrupt_event_handler()
1849 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1854 p_slot->ctrl = ctrl; in interrupt_event_handler()
1862 else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) { in interrupt_event_handler()
1866 ctrl->event_queue[loop].event_type = 0; in interrupt_event_handler()
1887 struct controller *ctrl = (struct controller *) p_slot->ctrl; in cpqhp_pushbutton_thread() local
1892 if (is_slot_enabled(ctrl, hp_slot)) { in cpqhp_pushbutton_thread()
1896 dbg("In power_down_board, func = %p, ctrl = %p\n", func, ctrl); in cpqhp_pushbutton_thread()
1902 if (cpqhp_process_SS(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1903 amber_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1904 green_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1906 set_SOGO(ctrl); in cpqhp_pushbutton_thread()
1909 wait_for_ctrl_irq(ctrl); in cpqhp_pushbutton_thread()
1918 dbg("In add_board, func = %p, ctrl = %p\n", func, ctrl); in cpqhp_pushbutton_thread()
1924 if (ctrl != NULL) { in cpqhp_pushbutton_thread()
1925 if (cpqhp_process_SI(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1926 amber_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1927 green_LED_off(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1929 set_SOGO(ctrl); in cpqhp_pushbutton_thread()
1932 wait_for_ctrl_irq(ctrl); in cpqhp_pushbutton_thread()
1941 int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func) in cpqhp_process_SI() argument
1952 hp_slot = device - ctrl->slot_device_offset; in cpqhp_process_SI()
1953 p_slot = cpqhp_find_slot(ctrl, device); in cpqhp_process_SI()
1956 tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_process_SI()
1962 rc = board_replaced(func, ctrl); in cpqhp_process_SI()
1967 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
1971 func->bus = ctrl->bus; in cpqhp_process_SI()
1978 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
1982 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
1988 rc = board_added(func, ctrl); in cpqhp_process_SI()
1996 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
2001 func->bus = ctrl->bus; in cpqhp_process_SI()
2008 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
2013 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2028 int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) in cpqhp_process_SS() argument
2036 struct pci_bus *pci_bus = ctrl->pci_bus; in cpqhp_process_SS()
2039 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2040 p_slot = cpqhp_find_slot(ctrl, device); in cpqhp_process_SS()
2074 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2077 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhp_process_SS()
2080 replace_flag = !(ctrl->add_support); in cpqhp_process_SS()
2081 rc = remove_board(func, replace_flag, ctrl); in cpqhp_process_SS()
2091 * @ctrl: controller to use
2096 static void switch_leds(struct controller *ctrl, const int num_of_slots, in switch_leds() argument
2106 writel(*work_LED, ctrl->hpc_reg + LED_CONTROL); in switch_leds()
2108 set_SOGO(ctrl); in switch_leds()
2111 wait_for_ctrl_irq(ctrl); in switch_leds()
2120 * @ctrl: target controller
2123 * For hot plug ctrl folks to play with.
2125 int cpqhp_hardware_test(struct controller *ctrl, int test_num) in cpqhp_hardware_test() argument
2132 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0f; in cpqhp_hardware_test()
2140 save_LED = readl(ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2142 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2143 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2144 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2145 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2148 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2149 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2150 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2152 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2153 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2154 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2157 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2159 set_SOGO(ctrl); in cpqhp_hardware_test()
2162 wait_for_ctrl_irq(ctrl); in cpqhp_hardware_test()
2167 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2169 set_SOGO(ctrl); in cpqhp_hardware_test()
2172 wait_for_ctrl_irq(ctrl); in cpqhp_hardware_test()
2177 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2179 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2183 writel(save_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2185 set_SOGO(ctrl); in cpqhp_hardware_test()
2188 wait_for_ctrl_irq(ctrl); in cpqhp_hardware_test()
2203 * @ctrl: pointer to controller structure
2210 static u32 configure_new_device(struct controller *ctrl, struct pci_func *func, in configure_new_device() argument
2223 ctrl->pci_bus->number = func->bus; in configure_new_device()
2224 …rc = pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp_… in configure_new_device()
2238 rc = configure_new_function(ctrl, new_slot, behind_bridge, resources); in configure_new_device()
2262 pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID); in configure_new_device()
2298 * @ctrl: pointer to controller structure
2306 static int configure_new_function(struct controller *ctrl, struct pci_func *func, in configure_new_function() argument
2336 pci_bus = ctrl->pci_bus; in configure_new_function()
2523 rc = configure_new_device(ctrl, new_slot, 1, &temp_resources); in configure_new_function()