Lines Matching refs: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()
810 io_node->next = func->io_head; in cpqhp_save_used_resources()
811 func->io_head = io_node; in cpqhp_save_used_resources()
826 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
827 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
842 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
843 func->mem_head = mem_node; in cpqhp_save_used_resources()
878 io_node->next = func->io_head; in cpqhp_save_used_resources()
879 func->io_head = io_node; in cpqhp_save_used_resources()
894 p_mem_node->next = func->p_mem_head; in cpqhp_save_used_resources()
895 func->p_mem_head = p_mem_node; in cpqhp_save_used_resources()
910 mem_node->next = func->mem_head; in cpqhp_save_used_resources()
911 func->mem_head = mem_node; in cpqhp_save_used_resources()
919 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_save_used_resources()
935 int cpqhp_configure_board(struct controller *ctrl, struct pci_func *func) in cpqhp_configure_board() argument
948 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
950 while (func != NULL) { in cpqhp_configure_board()
951 pci_bus->number = func->bus; in cpqhp_configure_board()
952 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_configure_board()
958 pci_bus_write_config_dword(pci_bus, devfn, cloop, func->config_space[cloop >> 2]); in cpqhp_configure_board()
986 if (temp != func->config_space[cloop >> 2]) { in cpqhp_configure_board()
988 dbg("bus = %x, device = %x, function = %x\n", func->bus, func->device, func->function); in cpqhp_configure_board()
989 dbg("temp = %x, config space = %x\n\n", temp, func->config_space[cloop >> 2]); in cpqhp_configure_board()
995 func->configured = 1; in cpqhp_configure_board()
997 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_configure_board()
1013 int cpqhp_valid_replace(struct controller *ctrl, struct pci_func *func) in cpqhp_valid_replace() argument
1027 if (!func->is_a_board) in cpqhp_valid_replace()
1030 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1032 while (func != NULL) { in cpqhp_valid_replace()
1033 pci_bus->number = func->bus; in cpqhp_valid_replace()
1034 devfn = PCI_DEVFN(func->device, func->function); in cpqhp_valid_replace()
1042 if (temp_register != func->config_space[0]) in cpqhp_valid_replace()
1049 if (temp_register != func->config_space[0x08 >> 2]) in cpqhp_valid_replace()
1061 temp_register = func->config_space[0x18 >> 2]; in cpqhp_valid_replace()
1082 if (temp_register != func->config_space[0x2C >> 2]) { in cpqhp_valid_replace()
1087 if (!((func->config_space[0] == 0xAE100E11) in cpqhp_valid_replace()
1121 if (func->base_length[(cloop - 0x10) >> 2] != base) in cpqhp_valid_replace()
1124 if (func->base_type[(cloop - 0x10) >> 2] != type) in cpqhp_valid_replace()
1138 func = cpqhp_slot_find(func->bus, func->device, index++); in cpqhp_valid_replace()
1162 struct pci_func *func = NULL; in cpqhp_find_available_resources() local
1259 func = cpqhp_slot_find(primary_bus, dev_func >> 3, 0); in cpqhp_find_available_resources()
1261 while (func && (func->function != (dev_func & 0x07))) { in cpqhp_find_available_resources()
1262 dbg("func = %p (bus, dev, fun) = (%d, %d, %d)\n", func, primary_bus, dev_func >> 3, index); in cpqhp_find_available_resources()
1263 func = cpqhp_slot_find(primary_bus, dev_func >> 3, index++); in cpqhp_find_available_resources()
1267 if (!func) { in cpqhp_find_available_resources()
1304 io_node->next = func->io_head; in cpqhp_find_available_resources()
1305 func->io_head = io_node; in cpqhp_find_available_resources()
1327 mem_node->next = func->mem_head; in cpqhp_find_available_resources()
1328 func->mem_head = mem_node; in cpqhp_find_available_resources()
1352 p_mem_node->next = func->p_mem_head; in cpqhp_find_available_resources()
1353 func->p_mem_head = p_mem_node; in cpqhp_find_available_resources()
1375 bus_node->next = func->bus_head; in cpqhp_find_available_resources()
1376 func->bus_head = bus_node; in cpqhp_find_available_resources()
1405 int cpqhp_return_board_resources(struct pci_func *func, struct resource_lists *resources) in cpqhp_return_board_resources() argument
1412 if (!func) in cpqhp_return_board_resources()
1415 node = func->io_head; in cpqhp_return_board_resources()
1416 func->io_head = NULL; in cpqhp_return_board_resources()
1423 node = func->mem_head; in cpqhp_return_board_resources()
1424 func->mem_head = NULL; in cpqhp_return_board_resources()
1431 node = func->p_mem_head; in cpqhp_return_board_resources()
1432 func->p_mem_head = NULL; in cpqhp_return_board_resources()
1439 node = func->bus_head; in cpqhp_return_board_resources()
1440 func->bus_head = NULL; in cpqhp_return_board_resources()
1508 void cpqhp_destroy_board_resources(struct pci_func *func) in cpqhp_destroy_board_resources() argument
1512 res = func->io_head; in cpqhp_destroy_board_resources()
1513 func->io_head = NULL; in cpqhp_destroy_board_resources()
1521 res = func->mem_head; in cpqhp_destroy_board_resources()
1522 func->mem_head = NULL; in cpqhp_destroy_board_resources()
1530 res = func->p_mem_head; in cpqhp_destroy_board_resources()
1531 func->p_mem_head = NULL; in cpqhp_destroy_board_resources()
1539 res = func->bus_head; in cpqhp_destroy_board_resources()
1540 func->bus_head = NULL; in cpqhp_destroy_board_resources()