Lines Matching full:func

73 int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)  in cpqhp_configure_device()  argument
80 if (func->pci_dev == NULL) in cpqhp_configure_device()
81 func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus, in cpqhp_configure_device()
82 PCI_DEVFN(func->device, in cpqhp_configure_device()
83 func->function)); in cpqhp_configure_device()
86 if (func->pci_dev == NULL) { in cpqhp_configure_device()
89 num = pci_scan_slot(ctrl->pci_dev->bus, PCI_DEVFN(func->device, func->function)); in cpqhp_configure_device()
93 func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus, in cpqhp_configure_device()
94 PCI_DEVFN(func->device, in cpqhp_configure_device()
95 func->function)); in cpqhp_configure_device()
96 if (func->pci_dev == NULL) { in cpqhp_configure_device()
102 if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { in cpqhp_configure_device()
103 pci_hp_add_bridge(func->pci_dev); in cpqhp_configure_device()
104 child = func->pci_dev->subordinate; in cpqhp_configure_device()
109 pci_dev_put(func->pci_dev); in cpqhp_configure_device()
117 int cpqhp_unconfigure_device(struct pci_func *func) in cpqhp_unconfigure_device() argument
121 dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); in cpqhp_unconfigure_device()
126 func->bus, in cpqhp_unconfigure_device()
127 PCI_DEVFN(func->device, in cpqhp_unconfigure_device()
541 int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func *func) in cpqhp_save_base_addr_length() argument
556 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
558 while (func != NULL) { in cpqhp_save_base_addr_length()
559 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
560 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_base_addr_length()
579 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
613 func->base_length[(cloop - 0x10) >> 2] = in cpqhp_save_base_addr_length()
615 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
653 func->base_length[(cloop - 0x10) >> 2] = base; in cpqhp_save_base_addr_length()
654 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
662 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
678 int cpqhp_save_used_resources(struct controller *ctrl, struct pci_func *func) in cpqhp_save_used_resources() argument
701 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
703 while ((func != NULL) && func->is_a_board) { in cpqhp_save_used_resources()
704 pci_bus->number = func->bus; in cpqhp_save_used_resources()
705 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_used_resources()
731 bus_node->next = func->bus_head; in cpqhp_save_used_resources()
732 func->bus_head = bus_node; in cpqhp_save_used_resources()
746 io_node->next = func->io_head; in cpqhp_save_used_resources()
747 func->io_head = io_node; in cpqhp_save_used_resources()
762 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
763 func->mem_head = mem_node; in cpqhp_save_used_resources()
778 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
779 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
811 io_node->next = func->io_head; in cpqhp_save_used_resources()
812 func->io_head = io_node; in cpqhp_save_used_resources()
828 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
829 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
845 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
846 func->mem_head = mem_node; in cpqhp_save_used_resources()
882 io_node->next = func->io_head; in cpqhp_save_used_resources()
883 func->io_head = io_node; in cpqhp_save_used_resources()
899 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
900 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
916 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
917 func->mem_head = mem_node; in cpqhp_save_used_resources()
925 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
941 int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func) in cpqhp_configure_board() argument
954 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
956 while (func != NULL) { in cpqhp_configure_board()
957 pci_bus->number = func->bus; in cpqhp_configure_board()
958 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_configure_board()
964 pci_bus_write_config_dword(pci_bus, devfn, cloop, func->config_space[cloop >> 2]); in cpqhp_configure_board()
992 if (temp != func->config_space[cloop >> 2]) { in cpqhp_configure_board()
994 dbg("bus = %x, device = %x, function = %x\n", func->bus, func->device, func->function); in cpqhp_configure_board()
995 dbg("temp = %x, config space = %x\n\n", temp, func->config_space[cloop >> 2]); in cpqhp_configure_board()
1001 func->configured = 1; in cpqhp_configure_board()
1003 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1019 int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func) in cpqhp_valid_replace() argument
1033 if (!func->is_a_board) in cpqhp_valid_replace()
1036 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1038 while (func != NULL) { in cpqhp_valid_replace()
1039 pci_bus->number = func->bus; in cpqhp_valid_replace()
1040 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_valid_replace()
1048 if (temp_register != func->config_space[0]) in cpqhp_valid_replace()
1055 if (temp_register != func->config_space[0x08 >> 2]) in cpqhp_valid_replace()
1067 temp_register = func->config_space[0x18 >> 2]; in cpqhp_valid_replace()
1088 if (temp_register != func->config_space[0x2C >> 2]) { in cpqhp_valid_replace()
1093 if (!((func->config_space[0] == 0xAE100E11) in cpqhp_valid_replace()
1127 if (func->base_length[(cloop - 0x10) >> 2] != base) in cpqhp_valid_replace()
1130 if (func->base_type[(cloop - 0x10) >> 2] != type) in cpqhp_valid_replace()
1144 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1168 struct pci_func *func = NULL; in cpqhp_find_available_resources() local
1265 func = cpqhp_slot_find(primary_bus, dev_func >> 3, 0); in cpqhp_find_available_resources()
1267 while (func && (func->function != (dev_func & 0x07))) { in cpqhp_find_available_resources()
1268 dbg("func = %p (bus, dev, fun) = (%d, %d, %d)\n", func, primary_bus, dev_func >> 3, index); in cpqhp_find_available_resources()
1269 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); in cpqhp_find_available_resources()
1273 if (!func) { in cpqhp_find_available_resources()
1310 io_node->next = func->io_head; in cpqhp_find_available_resources()
1311 func->io_head = io_node; in cpqhp_find_available_resources()
1333 mem_node->next = func->mem_head; in cpqhp_find_available_resources()
1334 func->mem_head = mem_node; in cpqhp_find_available_resources()
1358 p_mem_node->next = func->p_mem_head; in cpqhp_find_available_resources()
1359 func->p_mem_head = p_mem_node; in cpqhp_find_available_resources()
1381 bus_node->next = func->bus_head; in cpqhp_find_available_resources()
1382 func->bus_head = bus_node; in cpqhp_find_available_resources()
1411 int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources) in cpqhp_return_board_resources() argument
1418 if (!func) in cpqhp_return_board_resources()
1421 node = func->io_head; in cpqhp_return_board_resources()
1422 func->io_head = NULL; in cpqhp_return_board_resources()
1429 node = func->mem_head; in cpqhp_return_board_resources()
1430 func->mem_head = NULL; in cpqhp_return_board_resources()
1437 node = func->p_mem_head; in cpqhp_return_board_resources()
1438 func->p_mem_head = NULL; in cpqhp_return_board_resources()
1445 node = func->bus_head; in cpqhp_return_board_resources()
1446 func->bus_head = NULL; in cpqhp_return_board_resources()
1514 void cpqhp_destroy_board_resources(struct pci_func *func) in cpqhp_destroy_board_resources() argument
1518 res = func->io_head; in cpqhp_destroy_board_resources()
1519 func->io_head = NULL; in cpqhp_destroy_board_resources()
1527 res = func->mem_head; in cpqhp_destroy_board_resources()
1528 func->mem_head = NULL; in cpqhp_destroy_board_resources()
1536 res = func->p_mem_head; in cpqhp_destroy_board_resources()
1537 func->p_mem_head = NULL; in cpqhp_destroy_board_resources()
1545 res = func->bus_head; in cpqhp_destroy_board_resources()
1546 func->bus_head = NULL; in cpqhp_destroy_board_resources()