• Home
  • Raw
  • Download

Lines Matching refs:ctrl

134 static int init_SERR(struct controller * ctrl)  in init_SERR()  argument
140 if (!ctrl) in init_SERR()
143 tempdword = ctrl->first_slot; in init_SERR()
145 number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in init_SERR()
149 writeb(0, ctrl->hpc_reg + SLOT_SERR); in init_SERR()
294 static int ctrl_slot_cleanup (struct controller * ctrl) in ctrl_slot_cleanup() argument
298 old_slot = ctrl->slot; in ctrl_slot_cleanup()
299 ctrl->slot = NULL; in ctrl_slot_cleanup()
308 cpqhp_remove_debugfs_files(ctrl); in ctrl_slot_cleanup()
311 free_irq(ctrl->interrupt, ctrl); in ctrl_slot_cleanup()
313 iounmap(ctrl->hpc_reg); in ctrl_slot_cleanup()
315 release_mem_region(pci_resource_start(ctrl->pci_dev, 0), in ctrl_slot_cleanup()
316 pci_resource_len(ctrl->pci_dev, 0)); in ctrl_slot_cleanup()
402 cpqhp_set_attention_status(struct controller *ctrl, struct pci_func *func, in cpqhp_set_attention_status() argument
410 hp_slot = func->device - ctrl->slot_device_offset; in cpqhp_set_attention_status()
413 mutex_lock(&ctrl->crit_sect); in cpqhp_set_attention_status()
416 amber_LED_on (ctrl, hp_slot); in cpqhp_set_attention_status()
418 amber_LED_off (ctrl, hp_slot); in cpqhp_set_attention_status()
421 mutex_unlock(&ctrl->crit_sect); in cpqhp_set_attention_status()
425 set_SOGO(ctrl); in cpqhp_set_attention_status()
428 wait_for_ctrl_irq (ctrl); in cpqhp_set_attention_status()
431 mutex_unlock(&ctrl->crit_sect); in cpqhp_set_attention_status()
446 struct controller *ctrl = slot->ctrl; in set_attention_status() local
454 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) in set_attention_status()
465 return cpqhp_set_attention_status(ctrl, slot_func, status); in set_attention_status()
473 struct controller *ctrl = slot->ctrl; in process_SI() local
481 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) in process_SI()
496 dbg("board_added(%p, %p)\n", slot_func, ctrl); in process_SI()
497 return cpqhp_process_SI(ctrl, slot_func); in process_SI()
505 struct controller *ctrl = slot->ctrl; in process_SS() local
513 if (cpqhp_get_bus_dev(ctrl, &bus, &devfn, slot->number) == -1) in process_SS()
524 dbg("In %s, slot_func = %p, ctrl = %p\n", __func__, slot_func, ctrl); in process_SS()
525 return cpqhp_process_SS(ctrl, slot_func); in process_SS()
532 struct controller *ctrl = slot->ctrl; in hardware_test() local
536 return cpqhp_hardware_test(ctrl, value); in hardware_test()
543 struct controller *ctrl = slot->ctrl; in get_power_status() local
547 *value = get_slot_enabled(ctrl, slot); in get_power_status()
554 struct controller *ctrl = slot->ctrl; in get_attention_status() local
558 *value = cpq_get_attention_status(ctrl, slot); in get_attention_status()
565 struct controller *ctrl = slot->ctrl; in get_latch_status() local
569 *value = cpq_get_latch_status(ctrl, slot); in get_latch_status()
577 struct controller *ctrl = slot->ctrl; in get_adapter_status() local
581 *value = get_presence_status(ctrl, slot); in get_adapter_status()
599 static int ctrl_slot_setup(struct controller *ctrl, in ctrl_slot_setup() argument
606 struct pci_bus *bus = ctrl->pci_bus; in ctrl_slot_setup()
618 tempdword = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in ctrl_slot_setup()
620 number_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in ctrl_slot_setup()
621 slot_device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in ctrl_slot_setup()
622 slot_number = ctrl->first_slot; in ctrl_slot_setup()
647 slot->ctrl = ctrl; in ctrl_slot_setup()
648 slot->bus = ctrl->bus; in ctrl_slot_setup()
682 slot_device - (readb(ctrl->hpc_reg + SLOT_MASK) >> 4); in ctrl_slot_setup()
693 ((read_slot_enable(ctrl) << 2) >> ctrl_slot) & 0x04; in ctrl_slot_setup()
701 hotplug_slot_info->power_status = get_slot_enabled(ctrl, slot); in ctrl_slot_setup()
703 cpq_get_attention_status(ctrl, slot); in ctrl_slot_setup()
705 cpq_get_latch_status(ctrl, slot); in ctrl_slot_setup()
707 get_presence_status(ctrl, slot); in ctrl_slot_setup()
712 slot->number, ctrl->slot_device_offset, in ctrl_slot_setup()
715 ctrl->pci_dev->bus, in ctrl_slot_setup()
723 slot->next = ctrl->slot; in ctrl_slot_setup()
724 ctrl->slot = slot; in ctrl_slot_setup()
826 struct controller *ctrl; in cpqhpc_probe() local
886 ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL); in cpqhpc_probe()
887 if (!ctrl) { in cpqhpc_probe()
900 ctrl->vendor_id = vendor_id; in cpqhpc_probe()
905 ctrl->push_flag = 1; in cpqhpc_probe()
906 ctrl->slot_switch_type = 1; in cpqhpc_probe()
907 ctrl->push_button = 1; in cpqhpc_probe()
908 ctrl->pci_config_space = 1; in cpqhpc_probe()
909 ctrl->defeature_PHP = 1; in cpqhpc_probe()
910 ctrl->pcix_support = 1; in cpqhpc_probe()
911 ctrl->pcix_speed_capability = 1; in cpqhpc_probe()
940 ctrl->slot_switch_type = 1; in cpqhpc_probe()
942 ctrl->push_button = 0; in cpqhpc_probe()
943 ctrl->pci_config_space = 1; in cpqhpc_probe()
944 ctrl->defeature_PHP = 1; in cpqhpc_probe()
945 ctrl->pcix_support = 0; in cpqhpc_probe()
946 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
950 ctrl->push_flag = 1; in cpqhpc_probe()
951 ctrl->slot_switch_type = 1; in cpqhpc_probe()
953 ctrl->push_button = 1; in cpqhpc_probe()
954 ctrl->pci_config_space = 1; in cpqhpc_probe()
955 ctrl->defeature_PHP = 1; in cpqhpc_probe()
956 ctrl->pcix_support = 0; in cpqhpc_probe()
957 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
961 ctrl->slot_switch_type = 1; in cpqhpc_probe()
963 ctrl->push_button = 0; in cpqhpc_probe()
964 ctrl->pci_config_space = 1; in cpqhpc_probe()
965 ctrl->defeature_PHP = 1; in cpqhpc_probe()
966 ctrl->pcix_support = 0; in cpqhpc_probe()
967 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
971 ctrl->push_flag = 1; in cpqhpc_probe()
972 ctrl->slot_switch_type = 1; in cpqhpc_probe()
974 ctrl->push_button = 1; in cpqhpc_probe()
975 ctrl->pci_config_space = 1; in cpqhpc_probe()
976 ctrl->defeature_PHP = 1; in cpqhpc_probe()
977 ctrl->pcix_support = 0; in cpqhpc_probe()
978 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
982 ctrl->push_flag = 1; in cpqhpc_probe()
983 ctrl->slot_switch_type = 1; in cpqhpc_probe()
985 ctrl->push_button = 1; in cpqhpc_probe()
986 ctrl->pci_config_space = 1; in cpqhpc_probe()
987 ctrl->defeature_PHP = 1; in cpqhpc_probe()
988 ctrl->pcix_support = 1; in cpqhpc_probe()
989 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
1007 ctrl->push_button = 0; in cpqhpc_probe()
1009 ctrl->push_button = 1; in cpqhpc_probe()
1013 ctrl->slot_switch_type = 0; in cpqhpc_probe()
1015 ctrl->slot_switch_type = 1; in cpqhpc_probe()
1019 ctrl->defeature_PHP = 1; /* PHP supported */ in cpqhpc_probe()
1021 ctrl->defeature_PHP = 0; /* PHP not supported */ in cpqhpc_probe()
1027 ctrl->alternate_base_address = 1; in cpqhpc_probe()
1029 ctrl->alternate_base_address = 0; in cpqhpc_probe()
1033 ctrl->pci_config_space = 1; in cpqhpc_probe()
1035 ctrl->pci_config_space = 0; in cpqhpc_probe()
1039 ctrl->pcix_support = 1; in cpqhpc_probe()
1042 ctrl->pcix_speed_capability = 1; in cpqhpc_probe()
1046 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
1049 ctrl->pcix_support = 0; in cpqhpc_probe()
1050 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
1066 dbg(" slot_switch_type %s\n", ctrl->slot_switch_type ? in cpqhpc_probe()
1068 dbg(" defeature_PHP %s\n", ctrl->defeature_PHP ? in cpqhpc_probe()
1070 dbg(" alternate_base_address %s\n", ctrl->alternate_base_address ? in cpqhpc_probe()
1072 dbg(" pci_config_space %s\n", ctrl->pci_config_space ? in cpqhpc_probe()
1074 dbg(" pcix_speed_capability %s\n", ctrl->pcix_speed_capability ? in cpqhpc_probe()
1076 dbg(" pcix_support %s\n", ctrl->pcix_support ? in cpqhpc_probe()
1079 ctrl->pci_dev = pdev; in cpqhpc_probe()
1080 pci_set_drvdata(pdev, ctrl); in cpqhpc_probe()
1084 ctrl->pci_bus = kmemdup(pdev->bus, sizeof(*ctrl->pci_bus), GFP_KERNEL); in cpqhpc_probe()
1085 if (!ctrl->pci_bus) { in cpqhpc_probe()
1091 ctrl->bus = pdev->bus->number; in cpqhpc_probe()
1092 ctrl->rev = pdev->revision; in cpqhpc_probe()
1093 dbg("bus device function rev: %d %d %d %d\n", ctrl->bus, in cpqhpc_probe()
1094 PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); in cpqhpc_probe()
1096 mutex_init(&ctrl->crit_sect); in cpqhpc_probe()
1097 init_waitqueue_head(&ctrl->queue); in cpqhpc_probe()
1116 ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0), in cpqhpc_probe()
1118 if (!ctrl->hpc_reg) { in cpqhpc_probe()
1127 bus->cur_bus_speed = get_controller_speed(ctrl); in cpqhpc_probe()
1144 rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number, in cpqhpc_probe()
1145 (readb(ctrl->hpc_reg + SLOT_MASK) >> 4), in cpqhpc_probe()
1146 &(ctrl->first_slot)); in cpqhpc_probe()
1148 ctrl->first_slot, rc); in cpqhpc_probe()
1155 rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); in cpqhpc_probe()
1166 ctrl->interrupt = pdev->irq; in cpqhpc_probe()
1167 if (ctrl->interrupt < 0x10) { in cpqhpc_probe()
1172 ctrl->cfgspc_irq = 0; in cpqhpc_probe()
1173 pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &ctrl->cfgspc_irq); in cpqhpc_probe()
1175 rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start); in cpqhpc_probe()
1176 ctrl->add_support = !rc; in cpqhpc_probe()
1186 ctrl->slot_device_offset = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in cpqhpc_probe()
1187 dbg("NumSlots %d \n", ctrl->slot_device_offset); in cpqhpc_probe()
1189 ctrl->next_event = 0; in cpqhpc_probe()
1192 rc = ctrl_slot_setup(ctrl, smbios_start, smbios_table); in cpqhpc_probe()
1201 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); in cpqhpc_probe()
1204 dbg("HPC interrupt = %d \n", ctrl->interrupt); in cpqhpc_probe()
1205 if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, in cpqhpc_probe()
1206 IRQF_SHARED, MY_NAME, ctrl)) { in cpqhpc_probe()
1208 ctrl->interrupt); in cpqhpc_probe()
1216 temp_word = readw(ctrl->hpc_reg + MISC); in cpqhpc_probe()
1218 writew(temp_word, ctrl->hpc_reg + MISC); in cpqhpc_probe()
1221 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhpc_probe()
1223 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhpc_probe()
1225 writel(0x0L, ctrl->hpc_reg + INT_MASK); in cpqhpc_probe()
1228 cpqhp_ctrl_list = ctrl; in cpqhpc_probe()
1229 ctrl->next = NULL; in cpqhpc_probe()
1231 ctrl->next = cpqhp_ctrl_list; in cpqhpc_probe()
1232 cpqhp_ctrl_list = ctrl; in cpqhpc_probe()
1238 mutex_lock(&ctrl->crit_sect); in cpqhpc_probe()
1240 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in cpqhpc_probe()
1243 device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in cpqhpc_probe()
1247 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhpc_probe()
1251 hp_slot = func->device - ctrl->slot_device_offset; in cpqhpc_probe()
1255 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhpc_probe()
1259 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) in cpqhpc_probe()
1266 green_LED_off(ctrl, hp_slot); in cpqhpc_probe()
1267 slot_disable(ctrl, hp_slot); in cpqhpc_probe()
1275 set_SOGO(ctrl); in cpqhpc_probe()
1277 wait_for_ctrl_irq(ctrl); in cpqhpc_probe()
1280 rc = init_SERR(ctrl); in cpqhpc_probe()
1283 mutex_unlock(&ctrl->crit_sect); in cpqhpc_probe()
1288 mutex_unlock(&ctrl->crit_sect); in cpqhpc_probe()
1290 cpqhp_create_debugfs_files(ctrl); in cpqhpc_probe()
1295 free_irq(ctrl->interrupt, ctrl); in cpqhpc_probe()
1297 iounmap(ctrl->hpc_reg); in cpqhpc_probe()
1301 kfree(ctrl->pci_bus); in cpqhpc_probe()
1303 kfree(ctrl); in cpqhpc_probe()
1315 struct controller *ctrl; in unload_cpqphpd() local
1322 ctrl = cpqhp_ctrl_list; in unload_cpqphpd()
1324 while (ctrl) { in unload_cpqphpd()
1325 if (ctrl->hpc_reg) { in unload_cpqphpd()
1327 rc = read_slot_enable (ctrl); in unload_cpqphpd()
1329 writeb(0, ctrl->hpc_reg + SLOT_SERR); in unload_cpqphpd()
1330 writel(0xFFFFFFC0L | ~rc, ctrl->hpc_reg + INT_MASK); in unload_cpqphpd()
1332 misc = readw(ctrl->hpc_reg + MISC); in unload_cpqphpd()
1334 writew(misc, ctrl->hpc_reg + MISC); in unload_cpqphpd()
1337 ctrl_slot_cleanup(ctrl); in unload_cpqphpd()
1339 res = ctrl->io_head; in unload_cpqphpd()
1346 res = ctrl->mem_head; in unload_cpqphpd()
1353 res = ctrl->p_mem_head; in unload_cpqphpd()
1360 res = ctrl->bus_head; in unload_cpqphpd()
1367 kfree (ctrl->pci_bus); in unload_cpqphpd()
1369 tctrl = ctrl; in unload_cpqphpd()
1370 ctrl = ctrl->next; in unload_cpqphpd()