Lines Matching refs: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()
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()
879 struct controller *ctrl = data; in cpqhp_ctrl_intr() local
887 misc = readw(ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
901 writew(misc, ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
904 misc = readw(ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
907 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
912 Diff = readl(ctrl->hpc_reg + INT_INPUT_CLEAR) ^ ctrl->ctrl_int_comp; in cpqhp_ctrl_intr()
914 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
917 writel(Diff, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
920 temp_dword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
924 writel(0xFFFFFFFF, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
926 schedule_flag += handle_switch_change((u8)(Diff & 0xFFL), ctrl); in cpqhp_ctrl_intr()
927 schedule_flag += handle_presence_change((u16)((Diff & 0xFFFF0000L) >> 16), ctrl); in cpqhp_ctrl_intr()
928 schedule_flag += handle_power_fault((u8)((Diff & 0xFF00L) >> 8), ctrl); in cpqhp_ctrl_intr()
931 reset = readb(ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
935 writeb(reset, ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
936 reset = readb(ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
937 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
1115 static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) in set_controller_speed() argument
1118 struct pci_bus *bus = ctrl->pci_bus; in set_controller_speed()
1120 u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); in set_controller_speed()
1122 u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1130 for (slot = ctrl->slot; slot; slot = slot->next) { in set_controller_speed()
1131 if (slot->device == (hp_slot + ctrl->slot_device_offset)) in set_controller_speed()
1150 if ((bus->cur_bus_speed > adapter_speed) && (!ctrl->pcix_speed_capability)) in set_controller_speed()
1154 if ((bus->cur_bus_speed < adapter_speed) && (!ctrl->pcix_speed_capability)) in set_controller_speed()
1166 writel(0x0L, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1167 writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1169 set_SOGO(ctrl); in set_controller_speed()
1170 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1176 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1178 reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); in set_controller_speed()
1203 writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); in set_controller_speed()
1208 writel(0, ctrl->hpc_reg + INT_MASK); in set_controller_speed()
1210 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1214 pci_read_config_byte(ctrl->pci_dev, 0x43, ®); in set_controller_speed()
1215 pci_write_config_byte(ctrl->pci_dev, 0x43, reg); in set_controller_speed()
1220 set_SOGO(ctrl); in set_controller_speed()
1222 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1226 writel(leds, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1227 writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1229 set_SOGO(ctrl); in set_controller_speed()
1230 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1233 slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in set_controller_speed()
1256 static u32 board_replaced(struct pci_func *func, struct controller *ctrl) in board_replaced() argument
1258 struct pci_bus *bus = ctrl->pci_bus; in board_replaced()
1264 hp_slot = func->device - ctrl->slot_device_offset; in board_replaced()
1269 if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) in board_replaced()
1274 else if (is_slot_enabled(ctrl, hp_slot)) in board_replaced()
1277 mutex_lock(&ctrl->crit_sect); in board_replaced()
1280 enable_slot_power(ctrl, hp_slot); in board_replaced()
1282 set_SOGO(ctrl); in board_replaced()
1285 wait_for_ctrl_irq(ctrl); in board_replaced()
1289 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1290 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1291 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1293 set_SOGO(ctrl); in board_replaced()
1296 wait_for_ctrl_irq(ctrl); in board_replaced()
1298 adapter_speed = get_adapter_speed(ctrl, hp_slot); in board_replaced()
1300 if (set_controller_speed(ctrl, adapter_speed, hp_slot)) in board_replaced()
1304 disable_slot_power(ctrl, hp_slot); in board_replaced()
1306 set_SOGO(ctrl); in board_replaced()
1309 wait_for_ctrl_irq(ctrl); in board_replaced()
1311 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1316 mutex_lock(&ctrl->crit_sect); in board_replaced()
1318 slot_enable(ctrl, hp_slot); in board_replaced()
1319 green_LED_blink(ctrl, hp_slot); in board_replaced()
1321 amber_LED_off(ctrl, hp_slot); in board_replaced()
1323 set_SOGO(ctrl); in board_replaced()
1326 wait_for_ctrl_irq(ctrl); in board_replaced()
1328 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1339 rc = cpqhp_valid_replace(ctrl, func); in board_replaced()
1344 rc = cpqhp_configure_board(ctrl, func); in board_replaced()
1353 mutex_lock(&ctrl->crit_sect); in board_replaced()
1355 amber_LED_on(ctrl, hp_slot); in board_replaced()
1356 green_LED_off(ctrl, hp_slot); in board_replaced()
1357 slot_disable(ctrl, hp_slot); in board_replaced()
1359 set_SOGO(ctrl); in board_replaced()
1362 wait_for_ctrl_irq(ctrl); in board_replaced()
1364 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1379 mutex_lock(&ctrl->crit_sect); in board_replaced()
1381 amber_LED_on(ctrl, hp_slot); in board_replaced()
1382 green_LED_off(ctrl, hp_slot); in board_replaced()
1383 slot_disable(ctrl, hp_slot); in board_replaced()
1385 set_SOGO(ctrl); in board_replaced()
1388 wait_for_ctrl_irq(ctrl); in board_replaced()
1390 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1407 static u32 board_added(struct pci_func *func, struct controller *ctrl) in board_added() argument
1416 struct pci_bus *bus = ctrl->pci_bus; in board_added()
1420 hp_slot = func->device - ctrl->slot_device_offset; in board_added()
1422 __func__, func->device, ctrl->slot_device_offset, hp_slot); in board_added()
1424 mutex_lock(&ctrl->crit_sect); in board_added()
1427 enable_slot_power(ctrl, hp_slot); in board_added()
1429 set_SOGO(ctrl); in board_added()
1432 wait_for_ctrl_irq(ctrl); in board_added()
1437 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); in board_added()
1438 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_added()
1439 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); in board_added()
1441 set_SOGO(ctrl); in board_added()
1444 wait_for_ctrl_irq(ctrl); in board_added()
1446 adapter_speed = get_adapter_speed(ctrl, hp_slot); in board_added()
1448 if (set_controller_speed(ctrl, adapter_speed, hp_slot)) in board_added()
1452 disable_slot_power(ctrl, hp_slot); in board_added()
1454 set_SOGO(ctrl); in board_added()
1457 wait_for_ctrl_irq(ctrl); in board_added()
1459 mutex_unlock(&ctrl->crit_sect); in board_added()
1464 p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in board_added()
1469 mutex_lock(&ctrl->crit_sect); in board_added()
1473 slot_enable(ctrl, hp_slot); in board_added()
1476 green_LED_blink(ctrl, hp_slot); in board_added()
1479 amber_LED_off(ctrl, hp_slot); in board_added()
1482 set_SOGO(ctrl); in board_added()
1486 wait_for_ctrl_irq(ctrl); in board_added()
1490 mutex_unlock(&ctrl->crit_sect); in board_added()
1508 ctrl->pci_bus->number = func->bus; in board_added()
1509 …rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(func->device, func->function), PCI_VENDOR_… in board_added()
1524 res_lists.io_head = ctrl->io_head; in board_added()
1525 res_lists.mem_head = ctrl->mem_head; in board_added()
1526 res_lists.p_mem_head = ctrl->p_mem_head; in board_added()
1527 res_lists.bus_head = ctrl->bus_head; in board_added()
1530 rc = configure_new_device(ctrl, func, 0, &res_lists); in board_added()
1533 ctrl->io_head = res_lists.io_head; in board_added()
1534 ctrl->mem_head = res_lists.mem_head; in board_added()
1535 ctrl->p_mem_head = res_lists.p_mem_head; in board_added()
1536 ctrl->bus_head = res_lists.bus_head; in board_added()
1538 cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); in board_added()
1539 cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); in board_added()
1540 cpqhp_resource_sort_and_combine(&(ctrl->io_head)); in board_added()
1541 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); in board_added()
1544 mutex_lock(&ctrl->crit_sect); in board_added()
1546 amber_LED_on(ctrl, hp_slot); in board_added()
1547 green_LED_off(ctrl, hp_slot); in board_added()
1548 slot_disable(ctrl, hp_slot); in board_added()
1550 set_SOGO(ctrl); in board_added()
1553 wait_for_ctrl_irq(ctrl); in board_added()
1555 mutex_unlock(&ctrl->crit_sect); in board_added()
1558 cpqhp_save_slot_config(ctrl, func); in board_added()
1571 new_slot = cpqhp_slot_find(ctrl->bus, func->device, index++); in board_added()
1573 cpqhp_configure_device(ctrl, new_slot); in board_added()
1576 mutex_lock(&ctrl->crit_sect); in board_added()
1578 green_LED_on(ctrl, hp_slot); in board_added()
1580 set_SOGO(ctrl); in board_added()
1583 wait_for_ctrl_irq(ctrl); in board_added()
1585 mutex_unlock(&ctrl->crit_sect); in board_added()
1587 mutex_lock(&ctrl->crit_sect); in board_added()
1589 amber_LED_on(ctrl, hp_slot); in board_added()
1590 green_LED_off(ctrl, hp_slot); in board_added()
1591 slot_disable(ctrl, hp_slot); in board_added()
1593 set_SOGO(ctrl); in board_added()
1596 wait_for_ctrl_irq(ctrl); in board_added()
1598 mutex_unlock(&ctrl->crit_sect); in board_added()
1612 static u32 remove_board(struct pci_func *func, u32 replace_flag, struct controller *ctrl) in remove_board() argument
1628 hp_slot = func->device - ctrl->slot_device_offset; in remove_board()
1633 if (replace_flag || !ctrl->add_support) in remove_board()
1634 rc = cpqhp_save_base_addr_length(ctrl, func); in remove_board()
1652 rc = cpqhp_save_used_resources(ctrl, func); in remove_board()
1659 mutex_lock(&ctrl->crit_sect); in remove_board()
1661 green_LED_off(ctrl, hp_slot); in remove_board()
1662 slot_disable(ctrl, hp_slot); in remove_board()
1664 set_SOGO(ctrl); in remove_board()
1667 temp_byte = readb(ctrl->hpc_reg + SLOT_SERR); in remove_board()
1669 writeb(temp_byte, ctrl->hpc_reg + SLOT_SERR); in remove_board()
1672 wait_for_ctrl_irq(ctrl); in remove_board()
1674 mutex_unlock(&ctrl->crit_sect); in remove_board()
1676 if (!replace_flag && ctrl->add_support) { in remove_board()
1678 res_lists.io_head = ctrl->io_head; in remove_board()
1679 res_lists.mem_head = ctrl->mem_head; in remove_board()
1680 res_lists.p_mem_head = ctrl->p_mem_head; in remove_board()
1681 res_lists.bus_head = ctrl->bus_head; in remove_board()
1685 ctrl->io_head = res_lists.io_head; in remove_board()
1686 ctrl->mem_head = res_lists.mem_head; in remove_board()
1687 ctrl->p_mem_head = res_lists.p_mem_head; in remove_board()
1688 ctrl->bus_head = res_lists.bus_head; in remove_board()
1690 cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); in remove_board()
1691 cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); in remove_board()
1692 cpqhp_resource_sort_and_combine(&(ctrl->io_head)); in remove_board()
1693 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); in remove_board()
1700 func = cpqhp_slot_find(ctrl->bus, device, 0); in remove_board()
1704 func = cpqhp_slot_create(ctrl->bus); in remove_board()
1709 func->bus = ctrl->bus; in remove_board()
1732 struct controller *ctrl; in event_thread() local
1745 for (ctrl = cpqhp_ctrl_list; ctrl; ctrl = ctrl->next) in event_thread()
1746 interrupt_event_handler(ctrl); in event_thread()
1770 static int update_slot_info(struct controller *ctrl, struct slot *slot) in update_slot_info() argument
1779 info->power_status = get_slot_enabled(ctrl, slot); in update_slot_info()
1780 info->attention_status = cpq_get_attention_status(ctrl, slot); in update_slot_info()
1781 info->latch_status = cpq_get_latch_status(ctrl, slot); in update_slot_info()
1782 info->adapter_status = get_presence_status(ctrl, slot); in update_slot_info()
1788 static void interrupt_event_handler(struct controller *ctrl) in interrupt_event_handler() argument
1801 if (ctrl->event_queue[loop].event_type != 0) { in interrupt_event_handler()
1802 hp_slot = ctrl->event_queue[loop].hp_slot; in interrupt_event_handler()
1804 func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); in interrupt_event_handler()
1808 p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in interrupt_event_handler()
1815 if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) { in interrupt_event_handler()
1817 } else if (ctrl->event_queue[loop].event_type == in interrupt_event_handler()
1822 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1827 green_LED_on(ctrl, hp_slot); in interrupt_event_handler()
1831 green_LED_off(ctrl, hp_slot); in interrupt_event_handler()
1838 amber_LED_off(ctrl, hp_slot); in interrupt_event_handler()
1840 set_SOGO(ctrl); in interrupt_event_handler()
1843 wait_for_ctrl_irq(ctrl); in interrupt_event_handler()
1845 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1848 else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) { in interrupt_event_handler()
1851 if (is_slot_enabled(ctrl, hp_slot)) { in interrupt_event_handler()
1860 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1864 amber_LED_off(ctrl, hp_slot); in interrupt_event_handler()
1865 green_LED_blink(ctrl, hp_slot); in interrupt_event_handler()
1867 set_SOGO(ctrl); in interrupt_event_handler()
1870 wait_for_ctrl_irq(ctrl); in interrupt_event_handler()
1872 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1877 p_slot->ctrl = ctrl; in interrupt_event_handler()
1885 else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) { in interrupt_event_handler()
1889 update_slot_info(ctrl, p_slot); in interrupt_event_handler()
1892 ctrl->event_queue[loop].event_type = 0; in interrupt_event_handler()
1916 struct controller *ctrl = (struct controller *) p_slot->ctrl; in cpqhp_pushbutton_thread() local
1923 if (is_slot_enabled(ctrl, hp_slot)) { in cpqhp_pushbutton_thread()
1927 dbg("In power_down_board, func = %p, ctrl = %p\n", func, ctrl); in cpqhp_pushbutton_thread()
1933 if (cpqhp_process_SS(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1934 amber_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1935 green_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1937 set_SOGO(ctrl); in cpqhp_pushbutton_thread()
1940 wait_for_ctrl_irq(ctrl); in cpqhp_pushbutton_thread()
1949 dbg("In add_board, func = %p, ctrl = %p\n", func, ctrl); in cpqhp_pushbutton_thread()
1955 if (ctrl != NULL) { in cpqhp_pushbutton_thread()
1956 if (cpqhp_process_SI(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1957 amber_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1958 green_LED_off(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1960 set_SOGO(ctrl); in cpqhp_pushbutton_thread()
1963 wait_for_ctrl_irq(ctrl); in cpqhp_pushbutton_thread()
1974 int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func) in cpqhp_process_SI() argument
1986 hp_slot = device - ctrl->slot_device_offset; in cpqhp_process_SI()
1987 p_slot = cpqhp_find_slot(ctrl, device); in cpqhp_process_SI()
1992 tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_process_SI()
1998 rc = board_replaced(func, ctrl); in cpqhp_process_SI()
2003 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
2007 func->bus = ctrl->bus; in cpqhp_process_SI()
2014 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
2018 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2024 rc = board_added(func, ctrl); in cpqhp_process_SI()
2032 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
2037 func->bus = ctrl->bus; in cpqhp_process_SI()
2044 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
2049 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2061 update_slot_info(ctrl, p_slot); in cpqhp_process_SI()
2067 int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) in cpqhp_process_SS() argument
2075 struct pci_bus *pci_bus = ctrl->pci_bus; in cpqhp_process_SS()
2079 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2080 p_slot = cpqhp_find_slot(ctrl, device); in cpqhp_process_SS()
2116 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2119 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhp_process_SS()
2122 replace_flag = !(ctrl->add_support); in cpqhp_process_SS()
2123 rc = remove_board(func, replace_flag, ctrl); in cpqhp_process_SS()
2129 update_slot_info(ctrl, p_slot); in cpqhp_process_SS()
2141 static void switch_leds(struct controller *ctrl, const int num_of_slots, in switch_leds() argument
2151 writel(*work_LED, ctrl->hpc_reg + LED_CONTROL); in switch_leds()
2153 set_SOGO(ctrl); in switch_leds()
2156 wait_for_ctrl_irq(ctrl); in switch_leds()
2170 int cpqhp_hardware_test(struct controller *ctrl, int test_num) in cpqhp_hardware_test() argument
2177 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0f; in cpqhp_hardware_test()
2185 save_LED = readl(ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2187 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2188 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2189 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2190 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2193 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2194 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2195 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2197 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2198 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2199 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2202 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2204 set_SOGO(ctrl); in cpqhp_hardware_test()
2207 wait_for_ctrl_irq(ctrl); in cpqhp_hardware_test()
2212 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2214 set_SOGO(ctrl); in cpqhp_hardware_test()
2217 wait_for_ctrl_irq(ctrl); in cpqhp_hardware_test()
2222 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2224 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2228 writel(save_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2230 set_SOGO(ctrl); in cpqhp_hardware_test()
2233 wait_for_ctrl_irq(ctrl); in cpqhp_hardware_test()
2255 static u32 configure_new_device(struct controller *ctrl, struct pci_func *func, in configure_new_device() argument
2268 ctrl->pci_bus->number = func->bus; in configure_new_device()
2269 …rc = pci_bus_read_config_byte(ctrl->pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp_… in configure_new_device()
2283 rc = configure_new_function(ctrl, new_slot, behind_bridge, resources); in configure_new_device()
2307 pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID); in configure_new_device()
2351 static int configure_new_function(struct controller *ctrl, struct pci_func *func, in configure_new_function() argument
2381 pci_bus = ctrl->pci_bus; in configure_new_function()
2568 rc = configure_new_device(ctrl, new_slot, 1, &temp_resources); in configure_new_function()