Lines Matching refs:func
85 int cpqhp_configure_device (struct controller* ctrl, struct pci_func* func) in cpqhp_configure_device() argument
91 if (func->pci_dev == NULL) in cpqhp_configure_device()
92 func->pci_dev = pci_find_slot(func->bus, PCI_DEVFN(func->device, func->function)); in cpqhp_configure_device()
95 if (func->pci_dev == NULL) { in cpqhp_configure_device()
98 num = pci_scan_slot(ctrl->pci_dev->bus, PCI_DEVFN(func->device, func->function)); in cpqhp_configure_device()
102 func->pci_dev = pci_find_slot(func->bus, PCI_DEVFN(func->device, func->function)); in cpqhp_configure_device()
103 if (func->pci_dev == NULL) { in cpqhp_configure_device()
109 if (func->pci_dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { in cpqhp_configure_device()
110 pci_read_config_byte(func->pci_dev, PCI_SECONDARY_BUS, &bus); in cpqhp_configure_device()
111 child = (struct pci_bus*) pci_add_new_bus(func->pci_dev->bus, (func->pci_dev), bus); in cpqhp_configure_device()
119 int cpqhp_unconfigure_device(struct pci_func* func) in cpqhp_unconfigure_device() argument
123 dbg("%s: bus/dev/func = %x/%x/%x\n", __func__, func->bus, func->device, func->function); in cpqhp_unconfigure_device()
126 struct pci_dev* temp = pci_find_slot(func->bus, PCI_DEVFN(func->device, j)); in cpqhp_unconfigure_device()
572 int cpqhp_save_base_addr_length(struct controller *ctrl, struct pci_func * func) in cpqhp_save_base_addr_length() argument
587 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
589 while (func != NULL) { in cpqhp_save_base_addr_length()
590 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
591 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_base_addr_length()
611 pci_bus->number = func->bus; in cpqhp_save_base_addr_length()
641 func->base_length[(cloop - 0x10) >> 2] = in cpqhp_save_base_addr_length()
643 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
677 func->base_length[(cloop - 0x10) >> 2] = base; in cpqhp_save_base_addr_length()
678 func->base_type[(cloop - 0x10) >> 2] = type; in cpqhp_save_base_addr_length()
686 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_base_addr_length()
702 int cpqhp_save_used_resources (struct controller *ctrl, struct pci_func * func) in cpqhp_save_used_resources() argument
725 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
727 while ((func != NULL) && func->is_a_board) { in cpqhp_save_used_resources()
728 pci_bus->number = func->bus; in cpqhp_save_used_resources()
729 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_save_used_resources()
755 bus_node->next = func->bus_head; in cpqhp_save_used_resources()
756 func->bus_head = bus_node; in cpqhp_save_used_resources()
770 io_node->next = func->io_head; in cpqhp_save_used_resources()
771 func->io_head = io_node; in cpqhp_save_used_resources()
786 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
787 func->mem_head = mem_node; in cpqhp_save_used_resources()
802 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
803 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
832 io_node->next = func->io_head; in cpqhp_save_used_resources()
833 func->io_head = io_node; in cpqhp_save_used_resources()
849 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
850 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
866 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
867 func->mem_head = mem_node; in cpqhp_save_used_resources()
899 io_node->next = func->io_head; in cpqhp_save_used_resources()
900 func->io_head = io_node; in cpqhp_save_used_resources()
916 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
917 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
933 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
934 func->mem_head = mem_node; in cpqhp_save_used_resources()
943 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
959 int cpqhp_configure_board(struct controller *ctrl, struct pci_func * func) in cpqhp_configure_board() argument
972 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
974 while (func != NULL) { in cpqhp_configure_board()
975 pci_bus->number = func->bus; in cpqhp_configure_board()
976 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_configure_board()
981 pci_bus_write_config_dword (pci_bus, devfn, cloop, func->config_space[cloop >> 2]); in cpqhp_configure_board()
1009 if (temp != func->config_space[cloop >> 2]) { in cpqhp_configure_board()
1011 dbg("bus = %x, device = %x, function = %x\n", func->bus, func->device, func->function); in cpqhp_configure_board()
1012 dbg("temp = %x, config space = %x\n\n", temp, func->config_space[cloop >> 2]); in cpqhp_configure_board()
1018 func->configured = 1; in cpqhp_configure_board()
1020 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1036 int cpqhp_valid_replace(struct controller *ctrl, struct pci_func * func) in cpqhp_valid_replace() argument
1050 if (!func->is_a_board) in cpqhp_valid_replace()
1053 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1055 while (func != NULL) { in cpqhp_valid_replace()
1056 pci_bus->number = func->bus; in cpqhp_valid_replace()
1057 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_valid_replace()
1065 if (temp_register != func->config_space[0]) in cpqhp_valid_replace()
1072 if (temp_register != func->config_space[0x08 >> 2]) in cpqhp_valid_replace()
1083 temp_register = func->config_space[0x18 >> 2]; in cpqhp_valid_replace()
1104 if (temp_register != func->config_space[0x2C >> 2]) { in cpqhp_valid_replace()
1109 if (!((func->config_space[0] == 0xAE100E11) in cpqhp_valid_replace()
1139 if (func->base_length[(cloop - 0x10) >> 2] != base) in cpqhp_valid_replace()
1142 if (func->base_type[(cloop - 0x10) >> 2] != type) in cpqhp_valid_replace()
1155 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1179 struct pci_func *func = NULL; in cpqhp_find_available_resources() local
1278 func = cpqhp_slot_find(primary_bus, dev_func >> 3, 0); in cpqhp_find_available_resources()
1280 while (func && (func->function != (dev_func & 0x07))) { in cpqhp_find_available_resources()
1281 dbg("func = %p (bus, dev, fun) = (%d, %d, %d)\n", func, primary_bus, dev_func >> 3, index); in cpqhp_find_available_resources()
1282 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); in cpqhp_find_available_resources()
1286 if (!func) { in cpqhp_find_available_resources()
1323 io_node->next = func->io_head; in cpqhp_find_available_resources()
1324 func->io_head = io_node; in cpqhp_find_available_resources()
1346 mem_node->next = func->mem_head; in cpqhp_find_available_resources()
1347 func->mem_head = mem_node; in cpqhp_find_available_resources()
1370 p_mem_node->next = func->p_mem_head; in cpqhp_find_available_resources()
1371 func->p_mem_head = p_mem_node; in cpqhp_find_available_resources()
1392 bus_node->next = func->bus_head; in cpqhp_find_available_resources()
1393 func->bus_head = bus_node; in cpqhp_find_available_resources()
1421 int cpqhp_return_board_resources(struct pci_func * func, struct resource_lists * resources) in cpqhp_return_board_resources() argument
1428 if (!func) in cpqhp_return_board_resources()
1431 node = func->io_head; in cpqhp_return_board_resources()
1432 func->io_head = NULL; in cpqhp_return_board_resources()
1439 node = func->mem_head; in cpqhp_return_board_resources()
1440 func->mem_head = NULL; in cpqhp_return_board_resources()
1447 node = func->p_mem_head; in cpqhp_return_board_resources()
1448 func->p_mem_head = NULL; in cpqhp_return_board_resources()
1455 node = func->bus_head; in cpqhp_return_board_resources()
1456 func->bus_head = NULL; in cpqhp_return_board_resources()
1524 void cpqhp_destroy_board_resources (struct pci_func * func) in cpqhp_destroy_board_resources() argument
1528 res = func->io_head; in cpqhp_destroy_board_resources()
1529 func->io_head = NULL; in cpqhp_destroy_board_resources()
1537 res = func->mem_head; in cpqhp_destroy_board_resources()
1538 func->mem_head = NULL; in cpqhp_destroy_board_resources()
1546 res = func->p_mem_head; in cpqhp_destroy_board_resources()
1547 func->p_mem_head = NULL; in cpqhp_destroy_board_resources()
1555 res = func->bus_head; in cpqhp_destroy_board_resources()
1556 func->bus_head = NULL; in cpqhp_destroy_board_resources()