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()
548 int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func) in cpqhp_save_base_addr_length() argument
563 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
565 while (func != NULL) { in cpqhp_save_base_addr_length()
566 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
567 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_base_addr_length()
586 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
620 func->base_length[(cloop - 0x10) >> 2] = in cpqhp_save_base_addr_length()
622 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
660 func->base_length[(cloop - 0x10) >> 2] = base; in cpqhp_save_base_addr_length()
661 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
669 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
685 int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) in cpqhp_save_used_resources() argument
708 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
710 while ((func != NULL) && func->is_a_board) { in cpqhp_save_used_resources()
711 pci_bus->number = func->bus; in cpqhp_save_used_resources()
712 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_used_resources()
738 bus_node->next = func->bus_head; in cpqhp_save_used_resources()
739 func->bus_head = bus_node; in cpqhp_save_used_resources()
753 io_node->next = func->io_head; in cpqhp_save_used_resources()
754 func->io_head = io_node; in cpqhp_save_used_resources()
769 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
770 func->mem_head = mem_node; in cpqhp_save_used_resources()
785 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
786 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
818 io_node->next = func->io_head; in cpqhp_save_used_resources()
819 func->io_head = io_node; in cpqhp_save_used_resources()
835 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
836 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
852 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
853 func->mem_head = mem_node; in cpqhp_save_used_resources()
889 io_node->next = func->io_head; in cpqhp_save_used_resources()
890 func->io_head = io_node; in cpqhp_save_used_resources()
906 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
907 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
923 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
924 func->mem_head = mem_node; in cpqhp_save_used_resources()
932 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
948 int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func) in cpqhp_configure_board() argument
961 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
963 while (func != NULL) { in cpqhp_configure_board()
964 pci_bus->number = func->bus; in cpqhp_configure_board()
965 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_configure_board()
971 pci_bus_write_config_dword(pci_bus, devfn, cloop, func->config_space[cloop >> 2]); in cpqhp_configure_board()
999 if (temp != func->config_space[cloop >> 2]) { in cpqhp_configure_board()
1001 dbg("bus = %x, device = %x, function = %x\n", func->bus, func->device, func->function); in cpqhp_configure_board()
1002 dbg("temp = %x, config space = %x\n\n", temp, func->config_space[cloop >> 2]); in cpqhp_configure_board()
1008 func->configured = 1; in cpqhp_configure_board()
1010 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1026 int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func) in cpqhp_valid_replace() argument
1040 if (!func->is_a_board) in cpqhp_valid_replace()
1043 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1045 while (func != NULL) { in cpqhp_valid_replace()
1046 pci_bus->number = func->bus; in cpqhp_valid_replace()
1047 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_valid_replace()
1055 if (temp_register != func->config_space[0]) in cpqhp_valid_replace()
1062 if (temp_register != func->config_space[0x08 >> 2]) in cpqhp_valid_replace()
1074 temp_register = func->config_space[0x18 >> 2]; in cpqhp_valid_replace()
1095 if (temp_register != func->config_space[0x2C >> 2]) { in cpqhp_valid_replace()
1100 if (!((func->config_space[0] == 0xAE100E11) in cpqhp_valid_replace()
1134 if (func->base_length[(cloop - 0x10) >> 2] != base) in cpqhp_valid_replace()
1137 if (func->base_type[(cloop - 0x10) >> 2] != type) in cpqhp_valid_replace()
1151 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1175 struct pci_func *func = NULL; in cpqhp_find_available_resources() local
1272 func = cpqhp_slot_find(primary_bus, dev_func >> 3, 0); in cpqhp_find_available_resources()
1274 while (func && (func->function != (dev_func & 0x07))) { in cpqhp_find_available_resources()
1275 dbg("func = %p (bus, dev, fun) = (%d, %d, %d)\n", func, primary_bus, dev_func >> 3, index); in cpqhp_find_available_resources()
1276 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); in cpqhp_find_available_resources()
1280 if (!func) { in cpqhp_find_available_resources()
1317 io_node->next = func->io_head; in cpqhp_find_available_resources()
1318 func->io_head = io_node; in cpqhp_find_available_resources()
1340 mem_node->next = func->mem_head; in cpqhp_find_available_resources()
1341 func->mem_head = mem_node; in cpqhp_find_available_resources()
1365 p_mem_node->next = func->p_mem_head; in cpqhp_find_available_resources()
1366 func->p_mem_head = p_mem_node; in cpqhp_find_available_resources()
1388 bus_node->next = func->bus_head; in cpqhp_find_available_resources()
1389 func->bus_head = bus_node; in cpqhp_find_available_resources()
1418 int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources) in cpqhp_return_board_resources() argument
1425 if (!func) in cpqhp_return_board_resources()
1428 node = func->io_head; in cpqhp_return_board_resources()
1429 func->io_head = NULL; in cpqhp_return_board_resources()
1436 node = func->mem_head; in cpqhp_return_board_resources()
1437 func->mem_head = NULL; in cpqhp_return_board_resources()
1444 node = func->p_mem_head; in cpqhp_return_board_resources()
1445 func->p_mem_head = NULL; in cpqhp_return_board_resources()
1452 node = func->bus_head; in cpqhp_return_board_resources()
1453 func->bus_head = NULL; in cpqhp_return_board_resources()
1521 void cpqhp_destroy_board_resources(struct pci_func *func) in cpqhp_destroy_board_resources() argument
1525 res = func->io_head; in cpqhp_destroy_board_resources()
1526 func->io_head = NULL; in cpqhp_destroy_board_resources()
1534 res = func->mem_head; in cpqhp_destroy_board_resources()
1535 func->mem_head = NULL; in cpqhp_destroy_board_resources()
1543 res = func->p_mem_head; in cpqhp_destroy_board_resources()
1544 func->p_mem_head = NULL; in cpqhp_destroy_board_resources()
1552 res = func->bus_head; in cpqhp_destroy_board_resources()
1553 func->bus_head = NULL; in cpqhp_destroy_board_resources()