• 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()
711 slot->number, ctrl->slot_device_offset, in ctrl_slot_setup()
714 ctrl->pci_dev->bus, in ctrl_slot_setup()
722 slot->next = ctrl->slot; in ctrl_slot_setup()
723 ctrl->slot = slot; in ctrl_slot_setup()
825 struct controller *ctrl; in cpqhpc_probe() local
884 ctrl = kzalloc(sizeof(struct controller), GFP_KERNEL); in cpqhpc_probe()
885 if (!ctrl) { in cpqhpc_probe()
898 ctrl->vendor_id = vendor_id; in cpqhpc_probe()
903 ctrl->push_flag = 1; in cpqhpc_probe()
904 ctrl->slot_switch_type = 1; in cpqhpc_probe()
905 ctrl->push_button = 1; in cpqhpc_probe()
906 ctrl->pci_config_space = 1; in cpqhpc_probe()
907 ctrl->defeature_PHP = 1; in cpqhpc_probe()
908 ctrl->pcix_support = 1; in cpqhpc_probe()
909 ctrl->pcix_speed_capability = 1; in cpqhpc_probe()
938 ctrl->slot_switch_type = 1; in cpqhpc_probe()
940 ctrl->push_button = 0; in cpqhpc_probe()
941 ctrl->pci_config_space = 1; in cpqhpc_probe()
942 ctrl->defeature_PHP = 1; in cpqhpc_probe()
943 ctrl->pcix_support = 0; in cpqhpc_probe()
944 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
948 ctrl->push_flag = 1; in cpqhpc_probe()
949 ctrl->slot_switch_type = 1; in cpqhpc_probe()
951 ctrl->push_button = 1; in cpqhpc_probe()
952 ctrl->pci_config_space = 1; in cpqhpc_probe()
953 ctrl->defeature_PHP = 1; in cpqhpc_probe()
954 ctrl->pcix_support = 0; in cpqhpc_probe()
955 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
959 ctrl->slot_switch_type = 1; in cpqhpc_probe()
961 ctrl->push_button = 0; in cpqhpc_probe()
962 ctrl->pci_config_space = 1; in cpqhpc_probe()
963 ctrl->defeature_PHP = 1; in cpqhpc_probe()
964 ctrl->pcix_support = 0; in cpqhpc_probe()
965 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
969 ctrl->push_flag = 1; in cpqhpc_probe()
970 ctrl->slot_switch_type = 1; in cpqhpc_probe()
972 ctrl->push_button = 1; in cpqhpc_probe()
973 ctrl->pci_config_space = 1; in cpqhpc_probe()
974 ctrl->defeature_PHP = 1; in cpqhpc_probe()
975 ctrl->pcix_support = 0; in cpqhpc_probe()
976 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
980 ctrl->push_flag = 1; in cpqhpc_probe()
981 ctrl->slot_switch_type = 1; in cpqhpc_probe()
983 ctrl->push_button = 1; in cpqhpc_probe()
984 ctrl->pci_config_space = 1; in cpqhpc_probe()
985 ctrl->defeature_PHP = 1; in cpqhpc_probe()
986 ctrl->pcix_support = 1; in cpqhpc_probe()
987 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
1005 ctrl->push_button = 0; in cpqhpc_probe()
1007 ctrl->push_button = 1; in cpqhpc_probe()
1011 ctrl->slot_switch_type = 0; in cpqhpc_probe()
1013 ctrl->slot_switch_type = 1; in cpqhpc_probe()
1017 ctrl->defeature_PHP = 1; /* PHP supported */ in cpqhpc_probe()
1019 ctrl->defeature_PHP = 0; /* PHP not supported */ in cpqhpc_probe()
1025 ctrl->alternate_base_address = 1; in cpqhpc_probe()
1027 ctrl->alternate_base_address = 0; in cpqhpc_probe()
1031 ctrl->pci_config_space = 1; in cpqhpc_probe()
1033 ctrl->pci_config_space = 0; in cpqhpc_probe()
1037 ctrl->pcix_support = 1; in cpqhpc_probe()
1040 ctrl->pcix_speed_capability = 1; in cpqhpc_probe()
1044 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
1047 ctrl->pcix_support = 0; in cpqhpc_probe()
1048 ctrl->pcix_speed_capability = 0; in cpqhpc_probe()
1064 dbg(" slot_switch_type %s\n", ctrl->slot_switch_type ? in cpqhpc_probe()
1066 dbg(" defeature_PHP %s\n", ctrl->defeature_PHP ? in cpqhpc_probe()
1068 dbg(" alternate_base_address %s\n", ctrl->alternate_base_address ? in cpqhpc_probe()
1070 dbg(" pci_config_space %s\n", ctrl->pci_config_space ? in cpqhpc_probe()
1072 dbg(" pcix_speed_capability %s\n", ctrl->pcix_speed_capability ? in cpqhpc_probe()
1074 dbg(" pcix_support %s\n", ctrl->pcix_support ? in cpqhpc_probe()
1077 ctrl->pci_dev = pdev; in cpqhpc_probe()
1078 pci_set_drvdata(pdev, ctrl); in cpqhpc_probe()
1082 ctrl->pci_bus = kmemdup(pdev->bus, sizeof(*ctrl->pci_bus), GFP_KERNEL); in cpqhpc_probe()
1083 if (!ctrl->pci_bus) { in cpqhpc_probe()
1089 ctrl->bus = pdev->bus->number; in cpqhpc_probe()
1090 ctrl->rev = pdev->revision; in cpqhpc_probe()
1091 dbg("bus device function rev: %d %d %d %d\n", ctrl->bus, in cpqhpc_probe()
1092 PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); in cpqhpc_probe()
1094 mutex_init(&ctrl->crit_sect); in cpqhpc_probe()
1095 init_waitqueue_head(&ctrl->queue); in cpqhpc_probe()
1113 ctrl->hpc_reg = ioremap(pci_resource_start(pdev, 0), in cpqhpc_probe()
1115 if (!ctrl->hpc_reg) { in cpqhpc_probe()
1124 bus->cur_bus_speed = get_controller_speed(ctrl); in cpqhpc_probe()
1141 rc = get_slot_mapping(ctrl->pci_bus, pdev->bus->number, in cpqhpc_probe()
1142 (readb(ctrl->hpc_reg + SLOT_MASK) >> 4), in cpqhpc_probe()
1143 &(ctrl->first_slot)); in cpqhpc_probe()
1145 ctrl->first_slot, rc); in cpqhpc_probe()
1152 rc = cpqhp_save_config(ctrl, ctrl->bus, readb(ctrl->hpc_reg + SLOT_MASK)); in cpqhpc_probe()
1163 ctrl->interrupt = pdev->irq; in cpqhpc_probe()
1164 if (ctrl->interrupt < 0x10) { in cpqhpc_probe()
1169 ctrl->cfgspc_irq = 0; in cpqhpc_probe()
1170 pci_read_config_byte(pdev, PCI_INTERRUPT_LINE, &ctrl->cfgspc_irq); in cpqhpc_probe()
1172 rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start); in cpqhpc_probe()
1173 ctrl->add_support = !rc; in cpqhpc_probe()
1183 ctrl->slot_device_offset = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in cpqhpc_probe()
1184 dbg("NumSlots %d\n", ctrl->slot_device_offset); in cpqhpc_probe()
1186 ctrl->next_event = 0; in cpqhpc_probe()
1189 rc = ctrl_slot_setup(ctrl, smbios_start, smbios_table); in cpqhpc_probe()
1198 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); in cpqhpc_probe()
1201 dbg("HPC interrupt = %d\n", ctrl->interrupt); in cpqhpc_probe()
1202 if (request_irq(ctrl->interrupt, cpqhp_ctrl_intr, in cpqhpc_probe()
1203 IRQF_SHARED, MY_NAME, ctrl)) { in cpqhpc_probe()
1205 ctrl->interrupt); in cpqhpc_probe()
1213 temp_word = readw(ctrl->hpc_reg + MISC); in cpqhpc_probe()
1215 writew(temp_word, ctrl->hpc_reg + MISC); in cpqhpc_probe()
1218 writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhpc_probe()
1220 ctrl->ctrl_int_comp = readl(ctrl->hpc_reg + INT_INPUT_CLEAR); in cpqhpc_probe()
1222 writel(0x0L, ctrl->hpc_reg + INT_MASK); in cpqhpc_probe()
1225 cpqhp_ctrl_list = ctrl; in cpqhpc_probe()
1226 ctrl->next = NULL; in cpqhpc_probe()
1228 ctrl->next = cpqhp_ctrl_list; in cpqhpc_probe()
1229 cpqhp_ctrl_list = ctrl; in cpqhpc_probe()
1235 mutex_lock(&ctrl->crit_sect); in cpqhpc_probe()
1237 num_of_slots = readb(ctrl->hpc_reg + SLOT_MASK) & 0x0F; in cpqhpc_probe()
1240 device = readb(ctrl->hpc_reg + SLOT_MASK) >> 4; in cpqhpc_probe()
1244 func = cpqhp_slot_find(ctrl->bus, device, 0); in cpqhpc_probe()
1248 hp_slot = func->device - ctrl->slot_device_offset; in cpqhpc_probe()
1252 temp_word = ctrl->ctrl_int_comp >> 16; in cpqhpc_probe()
1256 if (ctrl->ctrl_int_comp & (0x1L << hp_slot)) in cpqhpc_probe()
1263 green_LED_off(ctrl, hp_slot); in cpqhpc_probe()
1264 slot_disable(ctrl, hp_slot); in cpqhpc_probe()
1272 set_SOGO(ctrl); in cpqhpc_probe()
1274 wait_for_ctrl_irq(ctrl); in cpqhpc_probe()
1277 rc = init_SERR(ctrl); in cpqhpc_probe()
1280 mutex_unlock(&ctrl->crit_sect); in cpqhpc_probe()
1285 mutex_unlock(&ctrl->crit_sect); in cpqhpc_probe()
1287 cpqhp_create_debugfs_files(ctrl); in cpqhpc_probe()
1292 free_irq(ctrl->interrupt, ctrl); in cpqhpc_probe()
1294 iounmap(ctrl->hpc_reg); in cpqhpc_probe()
1298 kfree(ctrl->pci_bus); in cpqhpc_probe()
1300 kfree(ctrl); in cpqhpc_probe()
1312 struct controller *ctrl; in unload_cpqphpd() local
1319 ctrl = cpqhp_ctrl_list; in unload_cpqphpd()
1321 while (ctrl) { in unload_cpqphpd()
1322 if (ctrl->hpc_reg) { in unload_cpqphpd()
1324 rc = read_slot_enable(ctrl); in unload_cpqphpd()
1326 writeb(0, ctrl->hpc_reg + SLOT_SERR); in unload_cpqphpd()
1327 writel(0xFFFFFFC0L | ~rc, ctrl->hpc_reg + INT_MASK); in unload_cpqphpd()
1329 misc = readw(ctrl->hpc_reg + MISC); in unload_cpqphpd()
1331 writew(misc, ctrl->hpc_reg + MISC); in unload_cpqphpd()
1334 ctrl_slot_cleanup(ctrl); in unload_cpqphpd()
1336 res = ctrl->io_head; in unload_cpqphpd()
1343 res = ctrl->mem_head; in unload_cpqphpd()
1350 res = ctrl->p_mem_head; in unload_cpqphpd()
1357 res = ctrl->bus_head; in unload_cpqphpd()
1364 kfree(ctrl->pci_bus); in unload_cpqphpd()
1366 tctrl = ctrl; in unload_cpqphpd()
1367 ctrl = ctrl->next; in unload_cpqphpd()