Lines Matching refs:ctrl
42 static u32 configure_new_device(struct controller *ctrl, struct pci_func *func,
44 static int configure_new_function(struct controller *ctrl, struct pci_func *func,
46 static void interrupt_event_handler(struct controller *ctrl);
67 static u8 handle_switch_change(u8 change, struct controller *ctrl) in handle_switch_change() argument
86 func = cpqhp_slot_find(ctrl->bus, in handle_switch_change()
87 (hp_slot + ctrl->slot_device_offset), 0); in handle_switch_change()
92 taskInfo = &(ctrl->event_queue[ctrl->next_event]); in handle_switch_change()
93 ctrl->next_event = (ctrl->next_event + 1) % 10; in handle_switch_change()
98 temp_word = ctrl->ctrl_int_comp >> 16; in handle_switch_change()
102 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in handle_switch_change()
130 static struct slot *cpqhp_find_slot(struct controller *ctrl, u8 device) in cpqhp_find_slot() argument
132 struct slot *slot = ctrl->slot; in cpqhp_find_slot()
141 static u8 handle_presence_change(u16 change, struct controller *ctrl) in handle_presence_change() argument
165 func = cpqhp_slot_find(ctrl->bus, in handle_presence_change()
166 (hp_slot + ctrl->slot_device_offset), 0); in handle_presence_change()
168 taskInfo = &(ctrl->event_queue[ctrl->next_event]); in handle_presence_change()
169 ctrl->next_event = (ctrl->next_event + 1) % 10; in handle_presence_change()
174 p_slot = cpqhp_find_slot(ctrl, hp_slot + (readb(ctrl->hpc_reg + SLOT_MASK) >> 4)); in handle_presence_change()
181 if (func->switch_save && (ctrl->push_button == 1)) { in handle_presence_change()
182 temp_word = ctrl->ctrl_int_comp >> 16; in handle_presence_change()
215 temp_word = ctrl->ctrl_int_comp >> 16; in handle_presence_change()
219 if ((!(ctrl->ctrl_int_comp & (0x010000 << hp_slot))) || in handle_presence_change()
220 (!(ctrl->ctrl_int_comp & (0x01000000 << hp_slot)))) { in handle_presence_change()
235 static u8 handle_power_fault(u8 change, struct controller *ctrl) in handle_power_fault() argument
256 func = cpqhp_slot_find(ctrl->bus, in handle_power_fault()
257 (hp_slot + ctrl->slot_device_offset), 0); in handle_power_fault()
259 taskInfo = &(ctrl->event_queue[ctrl->next_event]); in handle_power_fault()
260 ctrl->next_event = (ctrl->next_event + 1) % 10; in handle_power_fault()
265 if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) { in handle_power_fault()
278 if (ctrl->rev < 4) { in handle_power_fault()
279 amber_LED_on (ctrl, hp_slot); in handle_power_fault()
280 green_LED_off (ctrl, hp_slot); in handle_power_fault()
281 set_SOGO (ctrl); in handle_power_fault()
893 struct controller *ctrl = data; in cpqhp_ctrl_intr() local
901 misc = readw(ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
915 writew(misc, ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
918 misc = readw(ctrl->hpc_reg + MISC); in cpqhp_ctrl_intr()
921 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
926 Diff = readl(ctrl->hpc_reg + INT_INPUT_CLEAR) ^ ctrl->ctrl_int_comp; in cpqhp_ctrl_intr()
928 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
931 writel(Diff, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
934 temp_dword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
938 writel(0xFFFFFFFF, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_ctrl_intr()
940 schedule_flag += handle_switch_change((u8)(Diff & 0xFFL), ctrl); in cpqhp_ctrl_intr()
941 schedule_flag += handle_presence_change((u16)((Diff & 0xFFFF0000L) >> 16), ctrl); in cpqhp_ctrl_intr()
942 schedule_flag += handle_power_fault((u8)((Diff & 0xFF00L) >> 8), ctrl); in cpqhp_ctrl_intr()
945 reset = readb(ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
949 writeb(reset, ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
950 reset = readb(ctrl->hpc_reg + RESET_FREQ_MODE); in cpqhp_ctrl_intr()
951 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
1129 static u8 set_controller_speed(struct controller *ctrl, u8 adapter_speed, u8 hp_slot) in set_controller_speed() argument
1132 struct pci_bus *bus = ctrl->pci_bus; in set_controller_speed()
1134 u8 slot_power = readb(ctrl->hpc_reg + SLOT_POWER); in set_controller_speed()
1136 u32 leds = readl(ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1144 for (slot = ctrl->slot; slot; slot = slot->next) { in set_controller_speed()
1145 if (slot->device == (hp_slot + ctrl->slot_device_offset)) in set_controller_speed()
1164 if ((bus->cur_bus_speed > adapter_speed) && (!ctrl->pcix_speed_capability)) in set_controller_speed()
1168 if ((bus->cur_bus_speed < adapter_speed) && (!ctrl->pcix_speed_capability)) in set_controller_speed()
1180 writel(0x0L, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1181 writeb(0x00, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1183 set_SOGO(ctrl); in set_controller_speed()
1184 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1190 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1192 reg16 = readw(ctrl->hpc_reg + NEXT_CURR_FREQ); in set_controller_speed()
1217 writew(reg16, ctrl->hpc_reg + NEXT_CURR_FREQ); in set_controller_speed()
1222 writel(0, ctrl->hpc_reg + INT_MASK); in set_controller_speed()
1224 pci_write_config_byte(ctrl->pci_dev, 0x41, reg); in set_controller_speed()
1228 pci_read_config_byte(ctrl->pci_dev, 0x43, ®); in set_controller_speed()
1229 pci_write_config_byte(ctrl->pci_dev, 0x43, reg); in set_controller_speed()
1234 set_SOGO(ctrl); in set_controller_speed()
1236 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1240 writel(leds, ctrl->hpc_reg + LED_CONTROL); in set_controller_speed()
1241 writeb(slot_power, ctrl->hpc_reg + SLOT_ENABLE); in set_controller_speed()
1243 set_SOGO(ctrl); in set_controller_speed()
1244 wait_for_ctrl_irq(ctrl); in set_controller_speed()
1247 slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in set_controller_speed()
1270 static u32 board_replaced(struct pci_func *func, struct controller *ctrl) in board_replaced() argument
1272 struct pci_bus *bus = ctrl->pci_bus; in board_replaced()
1278 hp_slot = func->device - ctrl->slot_device_offset; in board_replaced()
1283 if (readl(ctrl->hpc_reg + INT_INPUT_CLEAR) & (0x01L << hp_slot)) in board_replaced()
1288 else if (is_slot_enabled (ctrl, hp_slot)) in board_replaced()
1291 mutex_lock(&ctrl->crit_sect); in board_replaced()
1294 enable_slot_power (ctrl, hp_slot); in board_replaced()
1296 set_SOGO(ctrl); in board_replaced()
1299 wait_for_ctrl_irq (ctrl); in board_replaced()
1303 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1304 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1305 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); in board_replaced()
1307 set_SOGO(ctrl); in board_replaced()
1310 wait_for_ctrl_irq (ctrl); in board_replaced()
1312 adapter_speed = get_adapter_speed(ctrl, hp_slot); in board_replaced()
1314 if (set_controller_speed(ctrl, adapter_speed, hp_slot)) in board_replaced()
1318 disable_slot_power (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()
1330 mutex_lock(&ctrl->crit_sect); in board_replaced()
1332 slot_enable (ctrl, hp_slot); in board_replaced()
1333 green_LED_blink (ctrl, hp_slot); in board_replaced()
1335 amber_LED_off (ctrl, hp_slot); in board_replaced()
1337 set_SOGO(ctrl); in board_replaced()
1340 wait_for_ctrl_irq (ctrl); in board_replaced()
1342 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1353 rc = cpqhp_valid_replace(ctrl, func); in board_replaced()
1358 rc = cpqhp_configure_board(ctrl, func); in board_replaced()
1367 mutex_lock(&ctrl->crit_sect); in board_replaced()
1369 amber_LED_on (ctrl, hp_slot); in board_replaced()
1370 green_LED_off (ctrl, hp_slot); in board_replaced()
1371 slot_disable (ctrl, hp_slot); in board_replaced()
1373 set_SOGO(ctrl); in board_replaced()
1376 wait_for_ctrl_irq (ctrl); in board_replaced()
1378 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1393 mutex_lock(&ctrl->crit_sect); in board_replaced()
1395 amber_LED_on (ctrl, hp_slot); in board_replaced()
1396 green_LED_off (ctrl, hp_slot); in board_replaced()
1397 slot_disable (ctrl, hp_slot); in board_replaced()
1399 set_SOGO(ctrl); in board_replaced()
1402 wait_for_ctrl_irq (ctrl); in board_replaced()
1404 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1421 static u32 board_added(struct pci_func *func, struct controller *ctrl) in board_added() argument
1430 struct pci_bus *bus = ctrl->pci_bus; in board_added()
1434 hp_slot = func->device - ctrl->slot_device_offset; in board_added()
1436 __func__, func->device, ctrl->slot_device_offset, hp_slot); in board_added()
1438 mutex_lock(&ctrl->crit_sect); in board_added()
1441 enable_slot_power(ctrl, hp_slot); in board_added()
1443 set_SOGO(ctrl); in board_added()
1446 wait_for_ctrl_irq (ctrl); in board_added()
1451 temp_byte = readb(ctrl->hpc_reg + SLOT_POWER); in board_added()
1452 writeb(0x00, ctrl->hpc_reg + SLOT_POWER); in board_added()
1453 writeb(temp_byte, ctrl->hpc_reg + SLOT_POWER); in board_added()
1455 set_SOGO(ctrl); in board_added()
1458 wait_for_ctrl_irq (ctrl); in board_added()
1460 adapter_speed = get_adapter_speed(ctrl, hp_slot); in board_added()
1462 if (set_controller_speed(ctrl, adapter_speed, hp_slot)) in board_added()
1466 disable_slot_power (ctrl, hp_slot); in board_added()
1468 set_SOGO(ctrl); in board_added()
1471 wait_for_ctrl_irq(ctrl); in board_added()
1473 mutex_unlock(&ctrl->crit_sect); in board_added()
1478 p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in board_added()
1483 mutex_lock(&ctrl->crit_sect); in board_added()
1487 slot_enable (ctrl, hp_slot); in board_added()
1490 green_LED_blink (ctrl, hp_slot); in board_added()
1493 amber_LED_off (ctrl, hp_slot); in board_added()
1496 set_SOGO(ctrl); in board_added()
1500 wait_for_ctrl_irq (ctrl); in board_added()
1504 mutex_unlock(&ctrl->crit_sect); in board_added()
1522 ctrl->pci_bus->number = func->bus; in board_added()
1523 …rc = pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(func->device, func->function), PCI_VENDOR… in board_added()
1538 res_lists.io_head = ctrl->io_head; in board_added()
1539 res_lists.mem_head = ctrl->mem_head; in board_added()
1540 res_lists.p_mem_head = ctrl->p_mem_head; in board_added()
1541 res_lists.bus_head = ctrl->bus_head; in board_added()
1544 rc = configure_new_device(ctrl, func, 0, &res_lists); in board_added()
1547 ctrl->io_head = res_lists.io_head; in board_added()
1548 ctrl->mem_head = res_lists.mem_head; in board_added()
1549 ctrl->p_mem_head = res_lists.p_mem_head; in board_added()
1550 ctrl->bus_head = res_lists.bus_head; in board_added()
1552 cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); in board_added()
1553 cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); in board_added()
1554 cpqhp_resource_sort_and_combine(&(ctrl->io_head)); in board_added()
1555 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); in board_added()
1558 mutex_lock(&ctrl->crit_sect); in board_added()
1560 amber_LED_on (ctrl, hp_slot); in board_added()
1561 green_LED_off (ctrl, hp_slot); in board_added()
1562 slot_disable (ctrl, hp_slot); in board_added()
1564 set_SOGO(ctrl); in board_added()
1567 wait_for_ctrl_irq (ctrl); in board_added()
1569 mutex_unlock(&ctrl->crit_sect); in board_added()
1572 cpqhp_save_slot_config(ctrl, func); in board_added()
1585 new_slot = cpqhp_slot_find(ctrl->bus, func->device, index++); in board_added()
1587 cpqhp_configure_device(ctrl, new_slot); in board_added()
1590 mutex_lock(&ctrl->crit_sect); in board_added()
1592 green_LED_on (ctrl, hp_slot); in board_added()
1594 set_SOGO(ctrl); in board_added()
1597 wait_for_ctrl_irq (ctrl); in board_added()
1599 mutex_unlock(&ctrl->crit_sect); in board_added()
1601 mutex_lock(&ctrl->crit_sect); in board_added()
1603 amber_LED_on (ctrl, hp_slot); in board_added()
1604 green_LED_off (ctrl, hp_slot); in board_added()
1605 slot_disable (ctrl, hp_slot); in board_added()
1607 set_SOGO(ctrl); in board_added()
1610 wait_for_ctrl_irq (ctrl); in board_added()
1612 mutex_unlock(&ctrl->crit_sect); in board_added()
1626 static u32 remove_board(struct pci_func *func, u32 replace_flag, struct controller *ctrl) in remove_board() argument
1642 hp_slot = func->device - ctrl->slot_device_offset; in remove_board()
1647 if (replace_flag || !ctrl->add_support) in remove_board()
1648 rc = cpqhp_save_base_addr_length(ctrl, func); in remove_board()
1666 rc = cpqhp_save_used_resources(ctrl, func); in remove_board()
1673 mutex_lock(&ctrl->crit_sect); in remove_board()
1675 green_LED_off (ctrl, hp_slot); in remove_board()
1676 slot_disable (ctrl, hp_slot); in remove_board()
1678 set_SOGO(ctrl); in remove_board()
1681 temp_byte = readb(ctrl->hpc_reg + SLOT_SERR); in remove_board()
1683 writeb(temp_byte, ctrl->hpc_reg + SLOT_SERR); in remove_board()
1686 wait_for_ctrl_irq (ctrl); in remove_board()
1688 mutex_unlock(&ctrl->crit_sect); in remove_board()
1690 if (!replace_flag && ctrl->add_support) { in remove_board()
1692 res_lists.io_head = ctrl->io_head; in remove_board()
1693 res_lists.mem_head = ctrl->mem_head; in remove_board()
1694 res_lists.p_mem_head = ctrl->p_mem_head; in remove_board()
1695 res_lists.bus_head = ctrl->bus_head; in remove_board()
1699 ctrl->io_head = res_lists.io_head; in remove_board()
1700 ctrl->mem_head = res_lists.mem_head; in remove_board()
1701 ctrl->p_mem_head = res_lists.p_mem_head; in remove_board()
1702 ctrl->bus_head = res_lists.bus_head; in remove_board()
1704 cpqhp_resource_sort_and_combine(&(ctrl->mem_head)); in remove_board()
1705 cpqhp_resource_sort_and_combine(&(ctrl->p_mem_head)); in remove_board()
1706 cpqhp_resource_sort_and_combine(&(ctrl->io_head)); in remove_board()
1707 cpqhp_resource_sort_and_combine(&(ctrl->bus_head)); in remove_board()
1714 func = cpqhp_slot_find(ctrl->bus, device, 0); in remove_board()
1718 func = cpqhp_slot_create(ctrl->bus); in remove_board()
1723 func->bus = ctrl->bus; in remove_board()
1745 struct controller *ctrl; in event_thread() local
1758 for (ctrl = cpqhp_ctrl_list; ctrl; ctrl=ctrl->next) in event_thread()
1759 interrupt_event_handler(ctrl); in event_thread()
1783 static int update_slot_info(struct controller *ctrl, struct slot *slot) in update_slot_info() argument
1792 info->power_status = get_slot_enabled(ctrl, slot); in update_slot_info()
1793 info->attention_status = cpq_get_attention_status(ctrl, slot); in update_slot_info()
1794 info->latch_status = cpq_get_latch_status(ctrl, slot); in update_slot_info()
1795 info->adapter_status = get_presence_status(ctrl, slot); in update_slot_info()
1801 static void interrupt_event_handler(struct controller *ctrl) in interrupt_event_handler() argument
1814 if (ctrl->event_queue[loop].event_type != 0) { in interrupt_event_handler()
1815 hp_slot = ctrl->event_queue[loop].hp_slot; in interrupt_event_handler()
1817 func = cpqhp_slot_find(ctrl->bus, (hp_slot + ctrl->slot_device_offset), 0); in interrupt_event_handler()
1821 p_slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in interrupt_event_handler()
1828 if (ctrl->event_queue[loop].event_type == INT_BUTTON_PRESS) { in interrupt_event_handler()
1830 } else if (ctrl->event_queue[loop].event_type == in interrupt_event_handler()
1835 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1840 green_LED_on (ctrl, hp_slot); in interrupt_event_handler()
1844 green_LED_off (ctrl, hp_slot); in interrupt_event_handler()
1851 amber_LED_off (ctrl, hp_slot); in interrupt_event_handler()
1853 set_SOGO(ctrl); in interrupt_event_handler()
1856 wait_for_ctrl_irq (ctrl); in interrupt_event_handler()
1858 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1861 else if (ctrl->event_queue[loop].event_type == INT_BUTTON_RELEASE) { in interrupt_event_handler()
1864 if (is_slot_enabled (ctrl, hp_slot)) { in interrupt_event_handler()
1873 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1877 amber_LED_off (ctrl, hp_slot); in interrupt_event_handler()
1878 green_LED_blink (ctrl, hp_slot); in interrupt_event_handler()
1880 set_SOGO(ctrl); in interrupt_event_handler()
1883 wait_for_ctrl_irq (ctrl); in interrupt_event_handler()
1885 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1888 p_slot->ctrl = ctrl; in interrupt_event_handler()
1898 else if (ctrl->event_queue[loop].event_type == INT_POWER_FAULT) { in interrupt_event_handler()
1902 update_slot_info(ctrl, p_slot); in interrupt_event_handler()
1905 ctrl->event_queue[loop].event_type = 0; in interrupt_event_handler()
1929 struct controller *ctrl = (struct controller *) p_slot->ctrl; in cpqhp_pushbutton_thread() local
1936 if (is_slot_enabled(ctrl, hp_slot)) { in cpqhp_pushbutton_thread()
1940 dbg("In power_down_board, func = %p, ctrl = %p\n", func, ctrl); in cpqhp_pushbutton_thread()
1946 if (cpqhp_process_SS(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1947 amber_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1948 green_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1950 set_SOGO(ctrl); in cpqhp_pushbutton_thread()
1953 wait_for_ctrl_irq(ctrl); in cpqhp_pushbutton_thread()
1962 dbg("In add_board, func = %p, ctrl = %p\n", func, ctrl); in cpqhp_pushbutton_thread()
1968 if (ctrl != NULL) { in cpqhp_pushbutton_thread()
1969 if (cpqhp_process_SI(ctrl, func) != 0) { in cpqhp_pushbutton_thread()
1970 amber_LED_on(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1971 green_LED_off(ctrl, hp_slot); in cpqhp_pushbutton_thread()
1973 set_SOGO(ctrl); in cpqhp_pushbutton_thread()
1976 wait_for_ctrl_irq (ctrl); in cpqhp_pushbutton_thread()
1987 int cpqhp_process_SI(struct controller *ctrl, struct pci_func *func) in cpqhp_process_SI() argument
1999 hp_slot = device - ctrl->slot_device_offset; in cpqhp_process_SI()
2000 p_slot = cpqhp_find_slot(ctrl, device); in cpqhp_process_SI()
2005 tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_process_SI()
2011 rc = board_replaced(func, ctrl); in cpqhp_process_SI()
2016 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
2020 func->bus = ctrl->bus; in cpqhp_process_SI()
2027 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
2031 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2037 rc = board_added(func, ctrl); in cpqhp_process_SI()
2045 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
2050 func->bus = ctrl->bus; in cpqhp_process_SI()
2057 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
2062 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2074 update_slot_info(ctrl, p_slot); in cpqhp_process_SI()
2080 int cpqhp_process_SS(struct controller *ctrl, struct pci_func *func) in cpqhp_process_SS() argument
2088 struct pci_bus *pci_bus = ctrl->pci_bus; in cpqhp_process_SS()
2092 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2093 p_slot = cpqhp_find_slot(ctrl, device); in cpqhp_process_SS()
2129 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2132 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhp_process_SS()
2135 replace_flag = !(ctrl->add_support); in cpqhp_process_SS()
2136 rc = remove_board(func, replace_flag, ctrl); in cpqhp_process_SS()
2142 update_slot_info(ctrl, p_slot); in cpqhp_process_SS()
2154 static void switch_leds(struct controller *ctrl, const int num_of_slots, in switch_leds() argument
2164 writel(*work_LED, ctrl->hpc_reg + LED_CONTROL); in switch_leds()
2166 set_SOGO(ctrl); in switch_leds()
2169 wait_for_ctrl_irq(ctrl); in switch_leds()
2183 int cpqhp_hardware_test(struct controller *ctrl, int test_num) in cpqhp_hardware_test() argument
2190 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0f; in cpqhp_hardware_test()
2198 save_LED = readl(ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2200 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2201 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2202 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2203 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2206 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2207 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2208 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2210 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2211 switch_leds(ctrl, num_of_slots, &work_LED, 0); in cpqhp_hardware_test()
2212 switch_leds(ctrl, num_of_slots, &work_LED, 1); in cpqhp_hardware_test()
2215 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2217 set_SOGO(ctrl); in cpqhp_hardware_test()
2220 wait_for_ctrl_irq (ctrl); in cpqhp_hardware_test()
2225 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2227 set_SOGO(ctrl); in cpqhp_hardware_test()
2230 wait_for_ctrl_irq (ctrl); in cpqhp_hardware_test()
2235 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2237 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2241 writel(save_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2243 set_SOGO(ctrl); in cpqhp_hardware_test()
2246 wait_for_ctrl_irq (ctrl); in cpqhp_hardware_test()
2268 static u32 configure_new_device(struct controller *ctrl, struct pci_func *func, in configure_new_device() argument
2281 ctrl->pci_bus->number = func->bus; in configure_new_device()
2282 …rc = pci_bus_read_config_byte (ctrl->pci_bus, PCI_DEVFN(func->device, func->function), 0x0E, &temp… in configure_new_device()
2296 rc = configure_new_function(ctrl, new_slot, behind_bridge, resources); in configure_new_device()
2320 pci_bus_read_config_dword (ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID); in configure_new_device()
2364 static int configure_new_function(struct controller *ctrl, struct pci_func *func, in configure_new_function() argument
2394 pci_bus = ctrl->pci_bus; in configure_new_function()
2581 rc = configure_new_device(ctrl, new_slot, 1, &temp_resources); in configure_new_function()