Lines Matching +full:irqs +full:- +full:map +full:- +full:range

1 // SPDX-License-Identifier: GPL-2.0+
6 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
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()
80 taskInfo->hp_slot = hp_slot; in handle_switch_change()
84 temp_word = ctrl->ctrl_int_comp >> 16; in handle_switch_change()
85 func->presence_save = (temp_word >> hp_slot) & 0x01; in handle_switch_change()
86 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; in handle_switch_change()
88 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in handle_switch_change()
93 func->switch_save = 0; in handle_switch_change()
95 taskInfo->event_type = INT_SWITCH_OPEN; in handle_switch_change()
101 func->switch_save = 0x10; in handle_switch_change()
103 taskInfo->event_type = INT_SWITCH_CLOSE; in handle_switch_change()
112 * cpqhp_find_slot - find the struct slot of given device
118 struct slot *slot = ctrl->slot; in cpqhp_find_slot()
120 while (slot && (slot->device != device)) in cpqhp_find_slot()
121 slot = slot->next; in cpqhp_find_slot()
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()
156 taskInfo->hp_slot = hp_slot; 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()
172 if (temp_byte != func->presence_save) { in handle_presence_change()
177 taskInfo->event_type = INT_BUTTON_PRESS; in handle_presence_change()
180 * button Released - TAKE ACTION!!!! in handle_presence_change()
183 taskInfo->event_type = INT_BUTTON_RELEASE; in handle_presence_change()
186 if ((p_slot->state == BLINKINGON_STATE) in handle_presence_change()
187 || (p_slot->state == BLINKINGOFF_STATE)) { in handle_presence_change()
188 taskInfo->event_type = INT_BUTTON_CANCEL; in handle_presence_change()
190 } else if ((p_slot->state == POWERON_STATE) in handle_presence_change()
191 || (p_slot->state == POWEROFF_STATE)) { in handle_presence_change()
192 /* info(msg_button_ignore, p_slot->number); */ in handle_presence_change()
193 taskInfo->event_type = INT_BUTTON_IGNORE; in handle_presence_change()
201 temp_word = ctrl->ctrl_int_comp >> 16; in handle_presence_change()
202 func->presence_save = (temp_word >> hp_slot) & 0x01; in handle_presence_change()
203 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; 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()
208 taskInfo->event_type = INT_PRESENCE_ON; in handle_presence_change()
211 taskInfo->event_type = INT_PRESENCE_OFF; in handle_presence_change()
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()
247 taskInfo->hp_slot = hp_slot; in handle_power_fault()
251 if (ctrl->ctrl_int_comp & (0x00000100 << hp_slot)) { in handle_power_fault()
255 func->status = 0x00; in handle_power_fault()
257 taskInfo->event_type = INT_POWER_FAULT_CLEAR; in handle_power_fault()
262 taskInfo->event_type = INT_POWER_FAULT; in handle_power_fault()
264 if (ctrl->rev < 4) { in handle_power_fault()
283 func->status = 0xFF; in handle_power_fault()
295 * sort_by_size - sort nodes on the list by their length, smallest first.
307 if (!((*head)->next)) in sort_by_size()
314 if (((*head)->next) && in sort_by_size()
315 ((*head)->length > (*head)->next->length)) { in sort_by_size()
318 *head = (*head)->next; in sort_by_size()
319 current_res->next = (*head)->next; in sort_by_size()
320 (*head)->next = current_res; in sort_by_size()
325 while (current_res->next && current_res->next->next) { in sort_by_size()
326 if (current_res->next->length > current_res->next->next->length) { in sort_by_size()
328 next_res = current_res->next; in sort_by_size()
329 current_res->next = current_res->next->next; in sort_by_size()
330 current_res = current_res->next; in sort_by_size()
331 next_res->next = current_res->next; in sort_by_size()
332 current_res->next = next_res; in sort_by_size()
334 current_res = current_res->next; in sort_by_size()
343 * sort_by_max_size - sort nodes on the list by their length, largest first.
355 if (!((*head)->next)) in sort_by_max_size()
362 if (((*head)->next) && in sort_by_max_size()
363 ((*head)->length < (*head)->next->length)) { in sort_by_max_size()
366 *head = (*head)->next; in sort_by_max_size()
367 current_res->next = (*head)->next; in sort_by_max_size()
368 (*head)->next = current_res; in sort_by_max_size()
373 while (current_res->next && current_res->next->next) { in sort_by_max_size()
374 if (current_res->next->length < current_res->next->next->length) { in sort_by_max_size()
376 next_res = current_res->next; in sort_by_max_size()
377 current_res->next = current_res->next->next; in sort_by_max_size()
378 current_res = current_res->next; in sort_by_max_size()
379 next_res->next = current_res->next; in sort_by_max_size()
380 current_res->next = next_res; in sort_by_max_size()
382 current_res = current_res->next; in sort_by_max_size()
391 * do_pre_bridge_resource_split - find node of resources that are unused
414 if ((*head)->base != (*orig_head)->base) in do_pre_bridge_resource_split()
417 if ((*head)->length == (*orig_head)->length) in do_pre_bridge_resource_split()
427 if (node->length & (alignment - 1)) { in do_pre_bridge_resource_split()
436 temp_dword = (node->length | (alignment-1)) + 1 - alignment; in do_pre_bridge_resource_split()
438 split_node->base = node->base; in do_pre_bridge_resource_split()
439 split_node->length = temp_dword; in do_pre_bridge_resource_split()
441 node->length -= temp_dword; in do_pre_bridge_resource_split()
442 node->base += split_node->length; in do_pre_bridge_resource_split()
446 split_node->next = node; in do_pre_bridge_resource_split()
449 if (node->length < alignment) in do_pre_bridge_resource_split()
454 *head = node->next; in do_pre_bridge_resource_split()
457 while (prevnode->next != node) in do_pre_bridge_resource_split()
458 prevnode = prevnode->next; in do_pre_bridge_resource_split()
460 prevnode->next = node->next; in do_pre_bridge_resource_split()
462 node->next = NULL; in do_pre_bridge_resource_split()
469 * do_bridge_resource_split - find one node of resources that aren't in use
487 while (node->next) { in do_bridge_resource_split()
489 node = node->next; in do_bridge_resource_split()
493 if (node->length < alignment) in do_bridge_resource_split()
496 if (node->base & (alignment - 1)) { in do_bridge_resource_split()
498 temp_dword = (node->base | (alignment-1)) + 1; in do_bridge_resource_split()
499 if ((node->length - (temp_dword - node->base)) < alignment) in do_bridge_resource_split()
502 node->length -= (temp_dword - node->base); in do_bridge_resource_split()
503 node->base = temp_dword; in do_bridge_resource_split()
506 if (node->length & (alignment - 1)) in do_bridge_resource_split()
518 * get_io_resource - find first node of given size not in ISA aliasing window.
542 for (node = *head; node; node = node->next) { in get_io_resource()
543 if (node->length < size) in get_io_resource()
546 if (node->base & (size - 1)) { in get_io_resource()
550 temp_dword = (node->base | (size-1)) + 1; in get_io_resource()
553 if ((node->length - (temp_dword - node->base)) < size) in get_io_resource()
561 split_node->base = node->base; in get_io_resource()
562 split_node->length = temp_dword - node->base; in get_io_resource()
563 node->base = temp_dword; in get_io_resource()
564 node->length -= split_node->length; in get_io_resource()
567 split_node->next = node->next; in get_io_resource()
568 node->next = split_node; in get_io_resource()
569 } /* End of non-aligned base */ in get_io_resource()
572 if (node->length > size) { in get_io_resource()
581 split_node->base = node->base + size; in get_io_resource()
582 split_node->length = node->length - size; in get_io_resource()
583 node->length = size; in get_io_resource()
586 split_node->next = node->next; in get_io_resource()
587 node->next = split_node; in get_io_resource()
591 if (node->base & 0x300L) in get_io_resource()
598 *head = node->next; in get_io_resource()
601 while (prevnode->next != node) in get_io_resource()
602 prevnode = prevnode->next; in get_io_resource()
604 prevnode->next = node->next; in get_io_resource()
606 node->next = NULL; in get_io_resource()
615 * get_max_resource - get largest node which has at least the given size.
636 for (max = *head; max; max = max->next) { in get_max_resource()
640 if (max->length < size) in get_max_resource()
643 if (max->base & (size - 1)) { in get_max_resource()
647 temp_dword = (max->base | (size-1)) + 1; in get_max_resource()
650 if ((max->length - (temp_dword - max->base)) < size) in get_max_resource()
658 split_node->base = max->base; in get_max_resource()
659 split_node->length = temp_dword - max->base; in get_max_resource()
660 max->base = temp_dword; in get_max_resource()
661 max->length -= split_node->length; in get_max_resource()
663 split_node->next = max->next; in get_max_resource()
664 max->next = split_node; in get_max_resource()
667 if ((max->base + max->length) & (size - 1)) { in get_max_resource()
675 temp_dword = ((max->base + max->length) & ~(size - 1)); in get_max_resource()
676 split_node->base = temp_dword; in get_max_resource()
677 split_node->length = max->length + max->base in get_max_resource()
678 - split_node->base; in get_max_resource()
679 max->length -= split_node->length; in get_max_resource()
681 split_node->next = max->next; in get_max_resource()
682 max->next = split_node; in get_max_resource()
686 if (max->length < size) in get_max_resource()
692 *head = max->next; in get_max_resource()
694 while (temp && temp->next != max) in get_max_resource()
695 temp = temp->next; in get_max_resource()
698 temp->next = max->next; in get_max_resource()
701 max->next = NULL; in get_max_resource()
710 * get_resource - find resource of given size and split up larger ones.
733 for (node = *head; node; node = node->next) { in get_resource()
735 __func__, size, node, node->base, node->length); in get_resource()
736 if (node->length < size) in get_resource()
739 if (node->base & (size - 1)) { in get_resource()
744 temp_dword = (node->base | (size-1)) + 1; in get_resource()
747 if ((node->length - (temp_dword - node->base)) < size) in get_resource()
755 split_node->base = node->base; in get_resource()
756 split_node->length = temp_dword - node->base; in get_resource()
757 node->base = temp_dword; in get_resource()
758 node->length -= split_node->length; in get_resource()
760 split_node->next = node->next; in get_resource()
761 node->next = split_node; in get_resource()
762 } /* End of non-aligned base */ in get_resource()
765 if (node->length > size) { in get_resource()
775 split_node->base = node->base + size; in get_resource()
776 split_node->length = node->length - size; in get_resource()
777 node->length = size; in get_resource()
780 split_node->next = node->next; in get_resource()
781 node->next = split_node; in get_resource()
788 *head = node->next; in get_resource()
791 while (prevnode->next != node) in get_resource()
792 prevnode = prevnode->next; in get_resource()
794 prevnode->next = node->next; in get_resource()
796 node->next = NULL; in get_resource()
804 * cpqhp_resource_sort_and_combine - sort nodes by base addresses and clean up
824 dbg("*head->next = %p\n", (*head)->next); in cpqhp_resource_sort_and_combine()
826 if (!(*head)->next) in cpqhp_resource_sort_and_combine()
829 dbg("*head->base = 0x%x\n", (*head)->base); in cpqhp_resource_sort_and_combine()
830 dbg("*head->next->base = 0x%x\n", (*head)->next->base); in cpqhp_resource_sort_and_combine()
835 if (((*head)->next) && in cpqhp_resource_sort_and_combine()
836 ((*head)->base > (*head)->next->base)) { in cpqhp_resource_sort_and_combine()
838 (*head) = (*head)->next; in cpqhp_resource_sort_and_combine()
839 node1->next = (*head)->next; in cpqhp_resource_sort_and_combine()
840 (*head)->next = node1; in cpqhp_resource_sort_and_combine()
846 while (node1->next && node1->next->next) { in cpqhp_resource_sort_and_combine()
847 if (node1->next->base > node1->next->next->base) { in cpqhp_resource_sort_and_combine()
849 node2 = node1->next; in cpqhp_resource_sort_and_combine()
850 node1->next = node1->next->next; in cpqhp_resource_sort_and_combine()
851 node1 = node1->next; in cpqhp_resource_sort_and_combine()
852 node2->next = node1->next; in cpqhp_resource_sort_and_combine()
853 node1->next = node2; in cpqhp_resource_sort_and_combine()
855 node1 = node1->next; in cpqhp_resource_sort_and_combine()
861 while (node1 && node1->next) { in cpqhp_resource_sort_and_combine()
862 if ((node1->base + node1->length) == node1->next->base) { in cpqhp_resource_sort_and_combine()
865 node1->length += node1->next->length; in cpqhp_resource_sort_and_combine()
866 node2 = node1->next; in cpqhp_resource_sort_and_combine()
867 node1->next = node1->next->next; in cpqhp_resource_sort_and_combine()
870 node1 = node1->next; in cpqhp_resource_sort_and_combine()
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()
905 dbg("%s - waking up\n", __func__); in cpqhp_ctrl_intr()
906 wake_up_interruptible(&ctrl->queue); in cpqhp_ctrl_intr()
910 /* General-interrupt-input interrupt Pending */ 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()
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()
948 * cpqhp_slot_create - Creates a node and adds it to the proper bus.
962 new_slot->next = NULL; in cpqhp_slot_create()
963 new_slot->configured = 1; in cpqhp_slot_create()
969 while (next->next != NULL) in cpqhp_slot_create()
970 next = next->next; in cpqhp_slot_create()
971 next->next = new_slot; in cpqhp_slot_create()
978 * slot_remove - Removes a node from the linked list of slots.
990 next = cpqhp_slot_list[old_slot->bus]; in slot_remove()
995 cpqhp_slot_list[old_slot->bus] = old_slot->next; in slot_remove()
1001 while ((next->next != old_slot) && (next->next != NULL)) in slot_remove()
1002 next = next->next; in slot_remove()
1004 if (next->next == old_slot) { in slot_remove()
1005 next->next = old_slot->next; in slot_remove()
1015 * bridge_slot_remove - Removes a node from the linked list of slots.
1026 secondaryBus = (bridge->config_space[0x06] >> 8) & 0xFF; in bridge_slot_remove()
1027 subordinateBus = (bridge->config_space[0x06] >> 16) & 0xFF; in bridge_slot_remove()
1036 next = cpqhp_slot_list[bridge->bus]; in bridge_slot_remove()
1042 cpqhp_slot_list[bridge->bus] = bridge->next; in bridge_slot_remove()
1046 while ((next->next != bridge) && (next->next != NULL)) in bridge_slot_remove()
1047 next = next->next; in bridge_slot_remove()
1049 if (next->next != bridge) in bridge_slot_remove()
1051 next->next = bridge->next; in bridge_slot_remove()
1059 * cpqhp_slot_find - Looks for a node by bus, and device, multiple functions accessed
1068 int found = -1; in cpqhp_slot_find()
1073 if ((func == NULL) || ((func->device == device) && (index == 0))) in cpqhp_slot_find()
1076 if (func->device == device) in cpqhp_slot_find()
1079 while (func->next != NULL) { in cpqhp_slot_find()
1080 func = func->next; in cpqhp_slot_find()
1082 if (func->device == device) in cpqhp_slot_find()
1098 if (((func->config_space[0x03] >> 16) & 0xFF) == 0x01) in is_bridge()
1106 * set_controller_speed - set the frequency and/or mode of a specific controller segment.
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()
1123 if (bus->cur_bus_speed == adapter_speed) 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()
1138 if (bus->cur_bus_speed < adapter_speed) 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()
1157 if (bus->max_bus_speed < adapter_speed) { in set_controller_speed()
1158 if (bus->cur_bus_speed == bus->max_bus_speed) in set_controller_speed()
1160 adapter_speed = bus->max_bus_speed; 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()
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()
1204 /* Re-enable interrupts */ 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, &reg); in set_controller_speed()
1212 pci_write_config_byte(ctrl->pci_dev, 0x43, reg); in set_controller_speed()
1215 if (((bus->cur_bus_speed == PCI_SPEED_66MHz) && (adapter_speed == PCI_SPEED_66MHz_PCIX)) || in set_controller_speed()
1216 ((bus->cur_bus_speed == PCI_SPEED_66MHz_PCIX) && (adapter_speed == PCI_SPEED_66MHz))) 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()
1229 bus->cur_bus_speed = adapter_speed; in set_controller_speed()
1230 slot = cpqhp_find_slot(ctrl, hp_slot + ctrl->slot_device_offset); in set_controller_speed()
1233 slot->number); in set_controller_speed()
1243 * board_replaced - Called after a board has been replaced in the system.
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()
1274 mutex_lock(&ctrl->crit_sect); 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()
1296 if (bus->cur_bus_speed != adapter_speed) in board_replaced()
1308 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1313 mutex_lock(&ctrl->crit_sect); in board_replaced()
1325 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1331 if (func->status == 0xFF) { in board_replaced()
1334 func->status = 0; in board_replaced()
1350 mutex_lock(&ctrl->crit_sect); in board_replaced()
1361 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1376 mutex_lock(&ctrl->crit_sect); in board_replaced()
1387 mutex_unlock(&ctrl->crit_sect); in board_replaced()
1397 * board_added - Called after a board has been added to the system.
1413 struct pci_bus *bus = ctrl->pci_bus; in board_added()
1416 hp_slot = func->device - ctrl->slot_device_offset; in board_added()
1417 dbg("%s: func->device, slot_offset, hp_slot = %d, %d ,%d\n", 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()
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()
1443 if (bus->cur_bus_speed != adapter_speed) 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()
1486 mutex_unlock(&ctrl->crit_sect); in board_added()
1494 dbg("%s: func status = %x\n", __func__, func->status); in board_added()
1496 if (func->status == 0xFF) { in board_added()
1501 func->status = 0; 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()
1524 res_lists.irqs = NULL; 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()
1551 mutex_unlock(&ctrl->crit_sect); in board_added()
1558 func->status = 0; in board_added()
1559 func->switch_save = 0x10; in board_added()
1560 func->is_a_board = 0x01; in board_added()
1567 new_slot = cpqhp_slot_find(ctrl->bus, func->device, index++); in board_added()
1568 if (new_slot && !new_slot->pci_dev) in board_added()
1572 mutex_lock(&ctrl->crit_sect); in board_added()
1581 mutex_unlock(&ctrl->crit_sect); in board_added()
1583 mutex_lock(&ctrl->crit_sect); in board_added()
1594 mutex_unlock(&ctrl->crit_sect); in board_added()
1603 * remove_board - Turns off slot and LEDs
1621 device = func->device; in remove_board()
1623 hp_slot = func->device - ctrl->slot_device_offset; in remove_board()
1628 if (replace_flag || !ctrl->add_support) in remove_board()
1630 else if (!func->bus_head && !func->mem_head && in remove_board()
1631 !func->p_mem_head && !func->io_head) { in remove_board()
1636 temp_func = cpqhp_slot_find(func->bus, func->device, index++); in remove_board()
1638 if (temp_func->bus_head || temp_func->mem_head in remove_board()
1639 || temp_func->p_mem_head || temp_func->io_head) { in remove_board()
1643 temp_func = cpqhp_slot_find(temp_func->bus, temp_func->device, index++); in remove_board()
1650 if (func->is_a_board) in remove_board()
1651 func->status = 0x01; in remove_board()
1652 func->configured = 0; in remove_board()
1654 mutex_lock(&ctrl->crit_sect); 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()
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()
1705 func->device = device; in remove_board()
1706 func->function = 0; in remove_board()
1707 func->configured = 0; in remove_board()
1708 func->switch_save = 0x10; in remove_board()
1709 func->is_a_board = 0; in remove_board()
1710 func->p_task_event = NULL; in remove_board()
1740 for (ctrl = cpqhp_ctrl_list; ctrl; ctrl = ctrl->next) in event_thread()
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()
1797 del_timer(&p_slot->task_event); in interrupt_event_handler()
1799 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1801 if (p_slot->state == BLINKINGOFF_STATE) { in interrupt_event_handler()
1805 } else if (p_slot->state == BLINKINGON_STATE) { in interrupt_event_handler()
1811 info(msg_button_cancel, p_slot->number); in interrupt_event_handler()
1813 p_slot->state = STATIC_STATE; 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()
1830 p_slot->state = BLINKINGOFF_STATE; in interrupt_event_handler()
1831 info(msg_button_off, p_slot->number); in interrupt_event_handler()
1834 p_slot->state = BLINKINGON_STATE; in interrupt_event_handler()
1835 info(msg_button_on, p_slot->number); in interrupt_event_handler()
1837 mutex_lock(&ctrl->crit_sect); in interrupt_event_handler()
1849 mutex_unlock(&ctrl->crit_sect); in interrupt_event_handler()
1850 timer_setup(&p_slot->task_event, in interrupt_event_handler()
1853 p_slot->hp_slot = hp_slot; in interrupt_event_handler()
1854 p_slot->ctrl = ctrl; in interrupt_event_handler()
1855 /* p_slot->physical_slot = physical_slot; */ in interrupt_event_handler()
1856 p_slot->task_event.expires = jiffies + 5 * HZ; /* 5 second delay */ in interrupt_event_handler()
1859 add_timer(&p_slot->task_event); 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()
1876 * cpqhp_pushbutton_thread - handle pushbutton events
1877 * @t: pointer to struct timer_list which holds all timer-related callbacks
1887 struct controller *ctrl = (struct controller *) p_slot->ctrl; in cpqhp_pushbutton_thread()
1890 hp_slot = p_slot->hp_slot; in cpqhp_pushbutton_thread()
1893 p_slot->state = POWEROFF_STATE; in cpqhp_pushbutton_thread()
1895 func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0); in cpqhp_pushbutton_thread()
1912 p_slot->state = STATIC_STATE; in cpqhp_pushbutton_thread()
1914 p_slot->state = POWERON_STATE; in cpqhp_pushbutton_thread()
1917 func = cpqhp_slot_find(p_slot->bus, p_slot->device, 0); in cpqhp_pushbutton_thread()
1936 p_slot->state = STATIC_STATE; in cpqhp_pushbutton_thread()
1951 device = func->device; in cpqhp_process_SI()
1952 hp_slot = device - ctrl->slot_device_offset; in cpqhp_process_SI()
1956 tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhp_process_SI()
1961 if (func->is_a_board) { in cpqhp_process_SI()
1967 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
1971 func->bus = ctrl->bus; in cpqhp_process_SI()
1972 func->device = device; in cpqhp_process_SI()
1973 func->function = 0; in cpqhp_process_SI()
1974 func->configured = 0; in cpqhp_process_SI()
1975 func->is_a_board = 1; in cpqhp_process_SI()
1978 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
1979 func->presence_save = (temp_word >> hp_slot) & 0x01; in cpqhp_process_SI()
1980 func->presence_save |= (temp_word >> (hp_slot + 7)) & 0x02; in cpqhp_process_SI()
1982 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
1983 func->switch_save = 0; in cpqhp_process_SI()
1985 func->switch_save = 0x10; in cpqhp_process_SI()
1996 func = cpqhp_slot_create(ctrl->bus); in cpqhp_process_SI()
2001 func->bus = ctrl->bus; in cpqhp_process_SI()
2002 func->device = device; in cpqhp_process_SI()
2003 func->function = 0; in cpqhp_process_SI()
2004 func->configured = 0; in cpqhp_process_SI()
2005 func->is_a_board = 0; in cpqhp_process_SI()
2008 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhp_process_SI()
2009 func->presence_save = (temp_word >> hp_slot) & 0x01; in cpqhp_process_SI()
2010 func->presence_save |= in cpqhp_process_SI()
2013 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) { in cpqhp_process_SI()
2014 func->switch_save = 0; in cpqhp_process_SI()
2016 func->switch_save = 0x10; in cpqhp_process_SI()
2036 struct pci_bus *pci_bus = ctrl->pci_bus; in cpqhp_process_SS()
2038 device = func->device; in cpqhp_process_SS()
2039 func = cpqhp_slot_find(ctrl->bus, device, index++); in cpqhp_process_SS()
2044 pci_bus->number = func->bus; in cpqhp_process_SS()
2045 devfn = PCI_DEVFN(func->device, func->function); 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()
2090 * switch_leds - switch the leds, go from one site to the other.
2106 writel(*work_LED, ctrl->hpc_reg + LED_CONTROL); in switch_leds()
2119 * cpqhp_hardware_test - runs hardware tests
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()
2148 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2152 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2157 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); in cpqhp_hardware_test()
2167 writel(work_LED, ctrl->hpc_reg + LED_CONTROL); 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()
2202 * configure_new_device - Configures the PCI header information of one board.
2222 /* Check for Multi-function device */ in configure_new_device()
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()
2230 if (temp_byte & 0x80) /* Multi-function device */ in configure_new_device()
2245 new_slot = cpqhp_slot_find(new_slot->bus, new_slot->device, index++); in configure_new_device()
2262 pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(func->device, function), 0x00, &ID); in configure_new_device()
2268 new_slot = cpqhp_slot_create(func->bus); in configure_new_device()
2273 new_slot->bus = func->bus; in configure_new_device()
2274 new_slot->device = func->device; in configure_new_device()
2275 new_slot->function = function; in configure_new_device()
2276 new_slot->is_a_board = 1; in configure_new_device()
2277 new_slot->status = 0; in configure_new_device()
2297 * configure_new_function - Configures the PCI header information of one device
2331 struct irq_mapping irqs; in configure_new_function() local
2336 pci_bus = ctrl->pci_bus; in configure_new_function()
2337 pci_bus->number = func->bus; in configure_new_function()
2338 devfn = PCI_DEVFN(func->device, func->function); in configure_new_function()
2347 dbg("set Primary bus = %d\n", func->bus); in configure_new_function()
2348 rc = pci_bus_write_config_byte(pci_bus, devfn, PCI_PRIMARY_BUS, func->bus); in configure_new_function()
2352 /* find range of buses to use */ in configure_new_function()
2354 bus_node = get_max_resource(&(resources->bus_head), 1); in configure_new_function()
2358 return -ENOMEM; in configure_new_function()
2361 temp_byte = bus_node->base; in configure_new_function()
2362 dbg("set Secondary bus = %d\n", bus_node->base); in configure_new_function()
2368 temp_byte = bus_node->base + bus_node->length - 1; in configure_new_function()
2369 dbg("set subordinate bus = %d\n", bus_node->base + bus_node->length - 1); in configure_new_function()
2390 io_node = get_max_resource(&(resources->io_head), 0x1000); in configure_new_function()
2392 return -ENOMEM; in configure_new_function()
2393 mem_node = get_max_resource(&(resources->mem_head), 0x100000); in configure_new_function()
2395 return -ENOMEM; in configure_new_function()
2396 p_mem_node = get_max_resource(&(resources->p_mem_head), 0x100000); in configure_new_function()
2398 return -ENOMEM; in configure_new_function()
2401 dbg("(base, len, next) (%x, %x, %p)\n", io_node->base, in configure_new_function()
2402 io_node->length, io_node->next); in configure_new_function()
2404 dbg("(base, len, next) (%x, %x, %p)\n", mem_node->base, in configure_new_function()
2405 mem_node->length, mem_node->next); in configure_new_function()
2407 dbg("(base, len, next) (%x, %x, %p)\n", p_mem_node->base, in configure_new_function()
2408 p_mem_node->length, p_mem_node->next); in configure_new_function()
2411 if (!resources->irqs) { in configure_new_function()
2412 irqs.barber_pole = 0; in configure_new_function()
2413 irqs.interrupt[0] = 0; in configure_new_function()
2414 irqs.interrupt[1] = 0; in configure_new_function()
2415 irqs.interrupt[2] = 0; in configure_new_function()
2416 irqs.interrupt[3] = 0; in configure_new_function()
2417 irqs.valid_INT = 0; in configure_new_function()
2419 irqs.barber_pole = resources->irqs->barber_pole; in configure_new_function()
2420 irqs.interrupt[0] = resources->irqs->interrupt[0]; in configure_new_function()
2421 irqs.interrupt[1] = resources->irqs->interrupt[1]; in configure_new_function()
2422 irqs.interrupt[2] = resources->irqs->interrupt[2]; in configure_new_function()
2423 irqs.interrupt[3] = resources->irqs->interrupt[3]; in configure_new_function()
2424 irqs.valid_INT = resources->irqs->valid_INT; in configure_new_function()
2433 temp_resources.irqs = &irqs; in configure_new_function()
2454 bus_node->base += 1; in configure_new_function()
2455 bus_node->length -= 1; in configure_new_function()
2456 bus_node->next = NULL; in configure_new_function()
2459 * IO range registers */ in configure_new_function()
2461 io_node->next = NULL; in configure_new_function()
2464 temp_byte = io_node->base >> 8; in configure_new_function()
2467 temp_byte = (io_node->base + io_node->length - 1) >> 8; in configure_new_function()
2471 * range registers. in configure_new_function()
2474 mem_node->next = NULL; in configure_new_function()
2477 temp_word = mem_node->base >> 16; in configure_new_function()
2480 temp_word = (mem_node->base + mem_node->length - 1) >> 16; in configure_new_function()
2484 p_mem_node->next = NULL; in configure_new_function()
2487 temp_word = p_mem_node->base >> 16; in configure_new_function()
2490 temp_word = (p_mem_node->base + p_mem_node->length - 1) >> 16; in configure_new_function()
2495 irqs.barber_pole--; in configure_new_function()
2501 irqs.barber_pole = (irqs.barber_pole + 1) & 0x03; in configure_new_function()
2504 pci_bus->number = hold_bus_node->base; in configure_new_function()
2506 pci_bus->number = func->bus; in configure_new_function()
2510 new_slot = cpqhp_slot_create(hold_bus_node->base); in configure_new_function()
2513 rc = -ENOMEM; in configure_new_function()
2517 new_slot->bus = hold_bus_node->base; in configure_new_function()
2518 new_slot->device = device; in configure_new_function()
2519 new_slot->function = 0; in configure_new_function()
2520 new_slot->is_a_board = 1; in configure_new_function()
2521 new_slot->status = 0; in configure_new_function()
2531 if (resources->irqs) { in configure_new_function()
2532 resources->irqs->interrupt[0] = irqs.interrupt[0]; in configure_new_function()
2533 resources->irqs->interrupt[1] = irqs.interrupt[1]; in configure_new_function()
2534 resources->irqs->interrupt[2] = irqs.interrupt[2]; in configure_new_function()
2535 resources->irqs->interrupt[3] = irqs.interrupt[3]; in configure_new_function()
2536 resources->irqs->valid_INT = irqs.valid_INT; in configure_new_function()
2540 if (irqs.valid_INT & (0x01 << cloop)) { in configure_new_function()
2541 rc = cpqhp_set_irq(func->bus, func->device, in configure_new_function()
2542 cloop + 1, irqs.interrupt[cloop]); in configure_new_function()
2552 hold_bus_node->length = bus_node->base - hold_bus_node->base; in configure_new_function()
2554 hold_bus_node->next = func->bus_head; in configure_new_function()
2555 func->bus_head = hold_bus_node; in configure_new_function()
2557 temp_byte = temp_resources.bus_head->base - 1; in configure_new_function()
2562 if (temp_resources.bus_head->length == 0) { in configure_new_function()
2566 return_resource(&(resources->bus_head), temp_resources.bus_head); in configure_new_function()
2578 hold_IO_node->base = io_node->base + io_node->length; in configure_new_function()
2580 temp_byte = (hold_IO_node->base) >> 8; in configure_new_function()
2583 return_resource(&(resources->io_head), io_node); in configure_new_function()
2592 hold_IO_node->length = io_node->base - hold_IO_node->base; in configure_new_function()
2595 if (hold_IO_node->length) { in configure_new_function()
2596 hold_IO_node->next = func->io_head; in configure_new_function()
2597 func->io_head = hold_IO_node; in configure_new_function()
2599 temp_byte = (io_node->base - 1) >> 8; in configure_new_function()
2602 return_resource(&(resources->io_head), io_node); in configure_new_function()
2608 return_resource(&(resources->io_head), io_node); in configure_new_function()
2612 /* it used most of the range */ in configure_new_function()
2613 hold_IO_node->next = func->io_head; in configure_new_function()
2614 func->io_head = hold_IO_node; in configure_new_function()
2617 /* it used the whole range */ in configure_new_function()
2618 hold_IO_node->next = func->io_head; in configure_new_function()
2619 func->io_head = hold_IO_node; in configure_new_function()
2629 hold_mem_node->base = mem_node->base + mem_node->length; in configure_new_function()
2631 temp_word = (hold_mem_node->base) >> 16; in configure_new_function()
2634 return_resource(&(resources->mem_head), mem_node); in configure_new_function()
2643 hold_mem_node->length = mem_node->base - hold_mem_node->base; in configure_new_function()
2645 if (hold_mem_node->length) { in configure_new_function()
2646 hold_mem_node->next = func->mem_head; in configure_new_function()
2647 func->mem_head = hold_mem_node; in configure_new_function()
2650 temp_word = (mem_node->base - 1) >> 16; in configure_new_function()
2654 return_resource(&(resources->mem_head), mem_node); in configure_new_function()
2660 return_resource(&(resources->mem_head), mem_node); in configure_new_function()
2664 /* it used most of the range */ in configure_new_function()
2665 hold_mem_node->next = func->mem_head; in configure_new_function()
2666 func->mem_head = hold_mem_node; in configure_new_function()
2669 /* it used the whole range */ in configure_new_function()
2670 hold_mem_node->next = func->mem_head; in configure_new_function()
2671 func->mem_head = hold_mem_node; in configure_new_function()
2681 hold_p_mem_node->base = p_mem_node->base + p_mem_node->length; in configure_new_function()
2683 temp_word = (hold_p_mem_node->base) >> 16; in configure_new_function()
2686 return_resource(&(resources->p_mem_head), p_mem_node); in configure_new_function()
2695 hold_p_mem_node->length = p_mem_node->base - hold_p_mem_node->base; in configure_new_function()
2698 if (hold_p_mem_node->length) { in configure_new_function()
2699 hold_p_mem_node->next = func->p_mem_head; in configure_new_function()
2700 func->p_mem_head = hold_p_mem_node; in configure_new_function()
2702 temp_word = (p_mem_node->base - 1) >> 16; in configure_new_function()
2705 return_resource(&(resources->p_mem_head), p_mem_node); in configure_new_function()
2711 return_resource(&(resources->p_mem_head), p_mem_node); in configure_new_function()
2715 /* it used the most of the range */ in configure_new_function()
2716 hold_p_mem_node->next = func->p_mem_head; in configure_new_function()
2717 func->p_mem_head = hold_p_mem_node; in configure_new_function()
2720 /* it used the whole range */ in configure_new_function()
2721 hold_p_mem_node->next = func->p_mem_head; in configure_new_function()
2722 func->p_mem_head = hold_p_mem_node; in configure_new_function()
2754 dbg("CND: bus=%d, devfn=%d, offset=%d\n", pci_bus->number, devfn, cloop); in configure_new_function()
2762 /* Map IO */ in configure_new_function()
2769 io_node = get_io_resource(&(resources->io_head), base); in configure_new_function()
2771 return -ENOMEM; in configure_new_function()
2773 io_node->base, io_node->length, io_node->next); in configure_new_function()
2774 dbg("func (%p) io_head (%p)\n", func, func->io_head); in configure_new_function()
2777 base = io_node->base; in configure_new_function()
2778 io_node->next = func->io_head; in configure_new_function()
2779 func->io_head = io_node; in configure_new_function()
2781 /* Map prefetchable memory */ in configure_new_function()
2786 p_mem_node = get_resource(&(resources->p_mem_head), base); in configure_new_function()
2790 base = p_mem_node->base; in configure_new_function()
2792 p_mem_node->next = func->p_mem_head; in configure_new_function()
2793 func->p_mem_head = p_mem_node; in configure_new_function()
2795 return -ENOMEM; in configure_new_function()
2797 /* Map memory */ in configure_new_function()
2802 mem_node = get_resource(&(resources->mem_head), base); in configure_new_function()
2806 base = mem_node->base; in configure_new_function()
2808 mem_node->next = func->mem_head; in configure_new_function()
2809 func->mem_head = mem_node; in configure_new_function()
2811 return -ENOMEM; in configure_new_function()
2819 /* Check for 64-bit base */ in configure_new_function()
2840 if (temp_byte && resources->irqs && in configure_new_function()
2841 (resources->irqs->valid_INT & in configure_new_function()
2842 (0x01 << ((temp_byte + resources->irqs->barber_pole - 1) & 0x03)))) { in configure_new_function()
2844 IRQ = resources->irqs->interrupt[(temp_byte + in configure_new_function()
2845 resources->irqs->barber_pole - 1) & 0x03]; in configure_new_function()
2861 rc = cpqhp_set_irq(func->bus, func->device, temp_byte, IRQ); in configure_new_function()
2865 /* TBD - this code may also belong in the other clause in configure_new_function()
2867 resources->irqs->interrupt[(temp_byte + resources->irqs->barber_pole - 1) & 0x03] = IRQ; in configure_new_function()
2868 resources->irqs->valid_INT |= 0x01 << (temp_byte + resources->irqs->barber_pole - 1) & 0x03; in configure_new_function()
2895 } else { /* End of Not-A-Bridge else */ in configure_new_function()
2900 func->configured = 1; in configure_new_function()
2906 return_resource(&(resources->bus_head), hold_bus_node); in configure_new_function()
2907 return_resource(&(resources->io_head), hold_IO_node); in configure_new_function()
2908 return_resource(&(resources->mem_head), hold_mem_node); in configure_new_function()
2909 return_resource(&(resources->p_mem_head), hold_p_mem_node); in configure_new_function()