Lines Matching refs:func
70 int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func) in cpqhp_configure_device() argument
77 if (func->pci_dev == NULL) in cpqhp_configure_device()
78 func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus, in cpqhp_configure_device()
79 PCI_DEVFN(func->device, in cpqhp_configure_device()
80 func->function)); in cpqhp_configure_device()
83 if (func->pci_dev == NULL) { in cpqhp_configure_device()
86 num = pci_scan_slot(ctrl->pci_dev->bus, PCI_DEVFN(func->device, func->function)); in cpqhp_configure_device()
90 func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus, in cpqhp_configure_device()
91 PCI_DEVFN(func->device, in cpqhp_configure_device()
92 func->function)); in cpqhp_configure_device()
93 if (func->pci_dev == NULL) { in cpqhp_configure_device()
99 if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { in cpqhp_configure_device()
100 pci_hp_add_bridge(func->pci_dev); in cpqhp_configure_device()
101 child = func->pci_dev->subordinate; in cpqhp_configure_device()
106 pci_dev_put(func->pci_dev); in cpqhp_configure_device()
114 int cpqhp_unconfigure_device(struct pci_func *func) in cpqhp_unconfigure_device() argument
118 dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); in cpqhp_unconfigure_device()
123 func->bus, in cpqhp_unconfigure_device()
124 PCI_DEVFN(func->device, in cpqhp_unconfigure_device()
550 int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func) in cpqhp_save_base_addr_length() argument
565 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
567 while (func != NULL) { in cpqhp_save_base_addr_length()
568 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
569 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_base_addr_length()
588 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
622 func->base_length[(cloop - 0x10) >> 2] = in cpqhp_save_base_addr_length()
624 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
662 func->base_length[(cloop - 0x10) >> 2] = base; in cpqhp_save_base_addr_length()
663 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
671 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
687 int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) in cpqhp_save_used_resources() argument
710 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
712 while ((func != NULL) && func->is_a_board) { in cpqhp_save_used_resources()
713 pci_bus->number = func->bus; in cpqhp_save_used_resources()
714 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_used_resources()
740 bus_node->next = func->bus_head; in cpqhp_save_used_resources()
741 func->bus_head = bus_node; in cpqhp_save_used_resources()
755 io_node->next = func->io_head; in cpqhp_save_used_resources()
756 func->io_head = io_node; in cpqhp_save_used_resources()
771 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
772 func->mem_head = mem_node; in cpqhp_save_used_resources()
787 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
788 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
820 io_node->next = func->io_head; in cpqhp_save_used_resources()
821 func->io_head = io_node; in cpqhp_save_used_resources()
837 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
838 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
854 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
855 func->mem_head = mem_node; in cpqhp_save_used_resources()
891 io_node->next = func->io_head; in cpqhp_save_used_resources()
892 func->io_head = io_node; in cpqhp_save_used_resources()
908 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
909 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
925 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
926 func->mem_head = mem_node; in cpqhp_save_used_resources()
934 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
950 int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func) in cpqhp_configure_board() argument
963 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
965 while (func != NULL) { in cpqhp_configure_board()
966 pci_bus->number = func->bus; in cpqhp_configure_board()
967 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_configure_board()
973 pci_bus_write_config_dword(pci_bus, devfn, cloop, func->config_space[cloop >> 2]); in cpqhp_configure_board()
1001 if (temp != func->config_space[cloop >> 2]) { in cpqhp_configure_board()
1003 dbg("bus = %x, device = %x, function = %x\n", func->bus, func->device, func->function); in cpqhp_configure_board()
1004 dbg("temp = %x, config space = %x\n\n", temp, func->config_space[cloop >> 2]); in cpqhp_configure_board()
1010 func->configured = 1; in cpqhp_configure_board()
1012 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1028 int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func) in cpqhp_valid_replace() argument
1042 if (!func->is_a_board) in cpqhp_valid_replace()
1045 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1047 while (func != NULL) { in cpqhp_valid_replace()
1048 pci_bus->number = func->bus; in cpqhp_valid_replace()
1049 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_valid_replace()
1057 if (temp_register != func->config_space[0]) in cpqhp_valid_replace()
1064 if (temp_register != func->config_space[0x08 >> 2]) in cpqhp_valid_replace()
1076 temp_register = func->config_space[0x18 >> 2]; in cpqhp_valid_replace()
1097 if (temp_register != func->config_space[0x2C >> 2]) { in cpqhp_valid_replace()
1102 if (!((func->config_space[0] == 0xAE100E11) in cpqhp_valid_replace()
1136 if (func->base_length[(cloop - 0x10) >> 2] != base) in cpqhp_valid_replace()
1139 if (func->base_type[(cloop - 0x10) >> 2] != type) in cpqhp_valid_replace()
1153 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1177 struct pci_func *func = NULL; in cpqhp_find_available_resources() local
1274 func = cpqhp_slot_find(primary_bus, dev_func >> 3, 0); in cpqhp_find_available_resources()
1276 while (func && (func->function != (dev_func & 0x07))) { in cpqhp_find_available_resources()
1277 dbg("func = %p (bus, dev, fun) = (%d, %d, %d)\n", func, primary_bus, dev_func >> 3, index); in cpqhp_find_available_resources()
1278 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); in cpqhp_find_available_resources()
1282 if (!func) { in cpqhp_find_available_resources()
1319 io_node->next = func->io_head; in cpqhp_find_available_resources()
1320 func->io_head = io_node; in cpqhp_find_available_resources()
1342 mem_node->next = func->mem_head; in cpqhp_find_available_resources()
1343 func->mem_head = mem_node; in cpqhp_find_available_resources()
1367 p_mem_node->next = func->p_mem_head; in cpqhp_find_available_resources()
1368 func->p_mem_head = p_mem_node; in cpqhp_find_available_resources()
1390 bus_node->next = func->bus_head; in cpqhp_find_available_resources()
1391 func->bus_head = bus_node; in cpqhp_find_available_resources()
1420 int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources) in cpqhp_return_board_resources() argument
1427 if (!func) in cpqhp_return_board_resources()
1430 node = func->io_head; in cpqhp_return_board_resources()
1431 func->io_head = NULL; in cpqhp_return_board_resources()
1438 node = func->mem_head; in cpqhp_return_board_resources()
1439 func->mem_head = NULL; in cpqhp_return_board_resources()
1446 node = func->p_mem_head; in cpqhp_return_board_resources()
1447 func->p_mem_head = NULL; in cpqhp_return_board_resources()
1454 node = func->bus_head; in cpqhp_return_board_resources()
1455 func->bus_head = NULL; in cpqhp_return_board_resources()
1523 void cpqhp_destroy_board_resources(struct pci_func *func) in cpqhp_destroy_board_resources() argument
1527 res = func->io_head; in cpqhp_destroy_board_resources()
1528 func->io_head = NULL; in cpqhp_destroy_board_resources()
1536 res = func->mem_head; in cpqhp_destroy_board_resources()
1537 func->mem_head = NULL; in cpqhp_destroy_board_resources()
1545 res = func->p_mem_head; in cpqhp_destroy_board_resources()
1546 func->p_mem_head = NULL; in cpqhp_destroy_board_resources()
1554 res = func->bus_head; in cpqhp_destroy_board_resources()
1555 func->bus_head = NULL; in cpqhp_destroy_board_resources()