Lines Matching refs:func
248 int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) in cpqhp_configure_device() argument
263 if (func->pci_dev == NULL) in cpqhp_configure_device()
264 func->pci_dev = pci_find_slot(func->bus, (func->device << 3) | (func->function & 0x7)); in cpqhp_configure_device()
267 if (func->pci_dev == NULL) { in cpqhp_configure_device()
270 dev0.devfn = (func->device << 3) + (func->function & 0x7); in cpqhp_configure_device()
274 func->pci_dev = pci_scan_slot(&dev0); in cpqhp_configure_device()
275 if (func->pci_dev == NULL) { in cpqhp_configure_device()
281 if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { in cpqhp_configure_device()
282 pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus); in cpqhp_configure_device()
283 child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus); in cpqhp_configure_device()
288 temp = func->pci_dev; in cpqhp_configure_device()
299 int cpqhp_unconfigure_device(struct pci_func* func) in cpqhp_unconfigure_device() argument
309 dbg("%s: bus/dev/func = %x/%x/%x\n", __FUNCTION__, func->bus, func->device, func->function); in cpqhp_unconfigure_device()
312 struct pci_dev* temp = pci_find_slot(func->bus, (func->device << 3) | j); in cpqhp_unconfigure_device()
753 int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) in cpqhp_save_base_addr_length() argument
766 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
768 while (func != NULL) { in cpqhp_save_base_addr_length()
771 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_HEADER_TYP… in cpqhp_save_base_addr_length()
775 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_SECONDARY_… in cpqhp_save_base_addr_length()
794 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, cloop, temp_r… in cpqhp_save_base_addr_length()
795 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &base); in cpqhp_save_base_addr_length()
818 func->base_length[(cloop - 0x10) >> 2] = in cpqhp_save_base_addr_length()
820 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
829 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, cloop, temp_r… in cpqhp_save_base_addr_length()
830 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &base); in cpqhp_save_base_addr_length()
854 func->base_length[(cloop - 0x10) >> 2] = base; in cpqhp_save_base_addr_length()
855 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
863 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
879 int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) in cpqhp_save_used_resources() argument
900 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
902 while ((func != NULL) && func->is_a_board) { in cpqhp_save_used_resources()
904 …pci_read_config_word_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_COMMAND, &… in cpqhp_save_used_resources()
908 …pci_write_config_word_nodev(ctrl->pci_ops, func->bus, func->device, func->function, PCI_COMMAND, c… in cpqhp_save_used_resources()
911 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_HEADER_TYP… in cpqhp_save_used_resources()
916 …pci_write_config_word_nodev(ctrl->pci_ops, func->bus, func->device, func->function, PCI_BRIDGE_CON… in cpqhp_save_used_resources()
918 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_SECONDARY_… in cpqhp_save_used_resources()
920 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_SUBORDINAT… in cpqhp_save_used_resources()
929 bus_node->next = func->bus_head; in cpqhp_save_used_resources()
930 func->bus_head = bus_node; in cpqhp_save_used_resources()
933 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_IO_BASE, &… in cpqhp_save_used_resources()
935 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_IO_LIMIT, … in cpqhp_save_used_resources()
945 io_node->next = func->io_head; in cpqhp_save_used_resources()
946 func->io_head = io_node; in cpqhp_save_used_resources()
949 …pci_read_config_word_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_MEMORY_BAS… in cpqhp_save_used_resources()
951 …pci_read_config_word_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_MEMORY_LIM… in cpqhp_save_used_resources()
961 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
962 func->mem_head = mem_node; in cpqhp_save_used_resources()
965 …pci_read_config_word_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_PREF_MEMOR… in cpqhp_save_used_resources()
967 …pci_read_config_word_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_PREF_MEMOR… in cpqhp_save_used_resources()
977 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
978 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
982 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &save_… in cpqhp_save_used_resources()
985 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, cloop, temp_r… in cpqhp_save_used_resources()
987 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &base); in cpqhp_save_used_resources()
1007 io_node->next = func->io_head; in cpqhp_save_used_resources()
1008 func->io_head = io_node; in cpqhp_save_used_resources()
1023 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
1024 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
1039 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
1040 func->mem_head = mem_node; in cpqhp_save_used_resources()
1048 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &save_… in cpqhp_save_used_resources()
1051 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, cloop, temp_r… in cpqhp_save_used_resources()
1053 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &base); in cpqhp_save_used_resources()
1072 io_node->next = func->io_head; in cpqhp_save_used_resources()
1073 func->io_head = io_node; in cpqhp_save_used_resources()
1088 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
1089 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
1104 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
1105 func->mem_head = mem_node; in cpqhp_save_used_resources()
1114 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
1130 int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) in cpqhp_configure_board() argument
1141 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1143 while (func != NULL) { in cpqhp_configure_board()
1147 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, cloop, func->… in cpqhp_configure_board()
1150 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_HEADER_TYP… in cpqhp_configure_board()
1154 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_SECONDARY_… in cpqhp_configure_board()
1174 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &temp); in cpqhp_configure_board()
1176 if (temp != func->config_space[cloop >> 2]) { in cpqhp_configure_board()
1178 dbg("bus = %x, device = %x, function = %x\n", func->bus, func->device, func->function); in cpqhp_configure_board()
1179 dbg("temp = %x, config space = %x\n\n", temp, func->config_space[cloop]); in cpqhp_configure_board()
1185 func->configured = 1; in cpqhp_configure_board()
1187 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1203 int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) in cpqhp_valid_replace() argument
1215 if (!func->is_a_board) in cpqhp_valid_replace()
1218 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1220 while (func != NULL) { in cpqhp_valid_replace()
1221 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_VENDOR_ID… in cpqhp_valid_replace()
1227 if (temp_register != func->config_space[0]) in cpqhp_valid_replace()
1231 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_CLASS_REV… in cpqhp_valid_replace()
1234 if (temp_register != func->config_space[0x08 >> 2]) in cpqhp_valid_replace()
1238 …pci_read_config_byte_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_HEADER_TYP… in cpqhp_valid_replace()
1245 temp_register = func->config_space[0x18 >> 2]; in cpqhp_valid_replace()
1246 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, PCI_PRIMARY_B… in cpqhp_valid_replace()
1265 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, PCI_SUBSYSTEM… in cpqhp_valid_replace()
1267 if (temp_register != func->config_space[0x2C >> 2]) { in cpqhp_valid_replace()
1272 if (!((func->config_space[0] == 0xAE100E11) in cpqhp_valid_replace()
1279 …pci_write_config_dword_nodev(ctrl->pci_ops, func->bus, func->device, func->function, cloop, temp_r… in cpqhp_valid_replace()
1281 …pci_read_config_dword_nodev (ctrl->pci_ops, func->bus, func->device, func->function, cloop, &base); in cpqhp_valid_replace()
1304 if (func->base_length[(cloop - 0x10) >> 2] != base) in cpqhp_valid_replace()
1307 if (func->base_type[(cloop - 0x10) >> 2] != type) in cpqhp_valid_replace()
1320 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1343 struct pci_func *func = NULL; in cpqhp_find_available_resources() local
1444 func = cpqhp_slot_find(primary_bus, dev_func >> 3, 0); in cpqhp_find_available_resources()
1446 while (func && (func->function != (dev_func & 0x07))) { in cpqhp_find_available_resources()
1447 dbg("func = %p (bus, dev, fun) = (%d, %d, %d)\n", func, primary_bus, dev_func >> 3, index); in cpqhp_find_available_resources()
1448 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); in cpqhp_find_available_resources()
1452 if (!func) { in cpqhp_find_available_resources()
1488 io_node->next = func->io_head; in cpqhp_find_available_resources()
1489 func->io_head = io_node; in cpqhp_find_available_resources()
1510 mem_node->next = func->mem_head; in cpqhp_find_available_resources()
1511 func->mem_head = mem_node; in cpqhp_find_available_resources()
1533 p_mem_node->next = func->p_mem_head; in cpqhp_find_available_resources()
1534 func->p_mem_head = p_mem_node; in cpqhp_find_available_resources()
1554 bus_node->next = func->bus_head; in cpqhp_find_available_resources()
1555 func->bus_head = bus_node; in cpqhp_find_available_resources()
1583 int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * resources) in cpqhp_return_board_resources() argument
1590 if (!func) in cpqhp_return_board_resources()
1593 node = func->io_head; in cpqhp_return_board_resources()
1594 func->io_head = NULL; in cpqhp_return_board_resources()
1601 node = func->mem_head; in cpqhp_return_board_resources()
1602 func->mem_head = NULL; in cpqhp_return_board_resources()
1609 node = func->p_mem_head; in cpqhp_return_board_resources()
1610 func->p_mem_head = NULL; in cpqhp_return_board_resources()
1617 node = func->bus_head; in cpqhp_return_board_resources()
1618 func->bus_head = NULL; in cpqhp_return_board_resources()
1686 void cpqhp_destroy_board_resources (struct pci_func * func) in cpqhp_destroy_board_resources() argument
1690 res = func->io_head; in cpqhp_destroy_board_resources()
1691 func->io_head = NULL; in cpqhp_destroy_board_resources()
1699 res = func->mem_head; in cpqhp_destroy_board_resources()
1700 func->mem_head = NULL; in cpqhp_destroy_board_resources()
1708 res = func->p_mem_head; in cpqhp_destroy_board_resources()
1709 func->p_mem_head = NULL; in cpqhp_destroy_board_resources()
1717 res = func->bus_head; in cpqhp_destroy_board_resources()
1718 func->bus_head = NULL; in cpqhp_destroy_board_resources()