Lines Matching refs:link

101 	struct acpi_pci_link	*link = (struct acpi_pci_link *) context;  in acpi_pci_link_check_possible()  local
121 link->irq.possible[i] = p->interrupts[i]; in acpi_pci_link_check_possible()
122 link->irq.possible_count++; in acpi_pci_link_check_possible()
124 link->irq.edge_level = p->edge_level; in acpi_pci_link_check_possible()
125 link->irq.active_high_low = p->active_high_low; in acpi_pci_link_check_possible()
126 link->irq.resource_type = ACPI_RSTYPE_IRQ; in acpi_pci_link_check_possible()
142 link->irq.possible[i] = p->interrupts[i]; in acpi_pci_link_check_possible()
143 link->irq.possible_count++; in acpi_pci_link_check_possible()
145 link->irq.edge_level = p->edge_level; in acpi_pci_link_check_possible()
146 link->irq.active_high_low = p->active_high_low; in acpi_pci_link_check_possible()
147 link->irq.resource_type = ACPI_RSTYPE_EXT_IRQ; in acpi_pci_link_check_possible()
162 struct acpi_pci_link *link) in acpi_pci_link_get_possible() argument
168 if (!link) in acpi_pci_link_get_possible()
171 status = acpi_walk_resources(link->handle, METHOD_NAME__PRS, in acpi_pci_link_get_possible()
172 acpi_pci_link_check_possible, link); in acpi_pci_link_get_possible()
179 "Found %d possible IRQs\n", link->irq.possible_count)); in acpi_pci_link_get_possible()
242 struct acpi_pci_link *link) in acpi_pci_link_get_current() argument
250 if (!link || !link->handle) in acpi_pci_link_get_current()
253 link->irq.active = 0; in acpi_pci_link_get_current()
258 result = acpi_bus_get_status(link->device); in acpi_pci_link_get_current()
264 if (!link->device->status.enabled) { in acpi_pci_link_get_current()
274 status = acpi_walk_resources(link->handle, METHOD_NAME__CRS, in acpi_pci_link_get_current()
287 link->irq.active = irq; in acpi_pci_link_get_current()
289 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Link at IRQ %d \n", link->irq.active)); in acpi_pci_link_get_current()
297 struct acpi_pci_link *link, in acpi_pci_link_set() argument
310 if (!link || !irq) in acpi_pci_link_set()
315 switch(link->irq.resource_type) { in acpi_pci_link_set()
319 resource.res.data.irq.edge_level = link->irq.edge_level; in acpi_pci_link_set()
320 resource.res.data.irq.active_high_low = link->irq.active_high_low; in acpi_pci_link_set()
321 if (link->irq.edge_level == ACPI_EDGE_SENSITIVE) in acpi_pci_link_set()
333 resource.res.data.extended_irq.edge_level = link->irq.edge_level; in acpi_pci_link_set()
334 resource.res.data.extended_irq.active_high_low = link->irq.active_high_low; in acpi_pci_link_set()
335 if (link->irq.edge_level == ACPI_EDGE_SENSITIVE) in acpi_pci_link_set()
344 printk("ACPI BUG: resource_type %d\n", link->irq.resource_type); in acpi_pci_link_set()
350 status = acpi_set_current_resources(link->handle, &buffer); in acpi_pci_link_set()
359 result = acpi_bus_get_status(link->device); in acpi_pci_link_set()
364 if (!link->device->status.enabled) { in acpi_pci_link_set()
367 acpi_device_name(link->device), in acpi_pci_link_set()
368 acpi_device_bid(link->device)); in acpi_pci_link_set()
372 result = acpi_pci_link_get_current(link); in acpi_pci_link_set()
381 if (link->irq.active != irq) { in acpi_pci_link_set()
388 acpi_device_name(link->device), in acpi_pci_link_set()
389 acpi_device_bid(link->device), in acpi_pci_link_set()
390 link->irq.active, irq); in acpi_pci_link_set()
391 link->irq.active = irq; in acpi_pci_link_set()
394 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Set IRQ %d\n", link->irq.active)); in acpi_pci_link_set()
469 struct acpi_pci_link *link = NULL; in acpi_pci_link_check() local
479 link = list_entry(node, struct acpi_pci_link, node); in acpi_pci_link_check()
480 if (!link) { in acpi_pci_link_check()
489 if (link->irq.possible_count) { in acpi_pci_link_check()
490 int penalty = PIRQ_PENALTY_PCI_POSSIBLE / link->irq.possible_count; in acpi_pci_link_check()
492 for (i = 0; i < link->irq.possible_count; i++) { in acpi_pci_link_check()
493 if (link->irq.possible[i] < ACPI_MAX_ISA_IRQ) in acpi_pci_link_check()
494 acpi_irq_penalty[link->irq.possible[i]] += penalty; in acpi_pci_link_check()
497 } else if (link->irq.active) { in acpi_pci_link_check()
498 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_POSSIBLE; in acpi_pci_link_check()
509 static int acpi_pci_link_allocate(struct acpi_pci_link* link) { in acpi_pci_link_allocate() argument
515 if (link->irq.setonboot) in acpi_pci_link_allocate()
521 for (i = 0; i < link->irq.possible_count; ++i) { in acpi_pci_link_allocate()
522 if (link->irq.active == link->irq.possible[i]) in acpi_pci_link_allocate()
528 if (i == link->irq.possible_count) { in acpi_pci_link_allocate()
531 " in _PRS\n", link->irq.active); in acpi_pci_link_allocate()
532 link->irq.active = 0; in acpi_pci_link_allocate()
538 if (link->irq.active) { in acpi_pci_link_allocate()
539 irq = link->irq.active; in acpi_pci_link_allocate()
541 irq = link->irq.possible[link->irq.possible_count - 1]; in acpi_pci_link_allocate()
544 if (acpi_irq_balance || !link->irq.active) { in acpi_pci_link_allocate()
549 for (i = (link->irq.possible_count - 1); i >= 0; i--) { in acpi_pci_link_allocate()
550 if (acpi_irq_penalty[irq] > acpi_irq_penalty[link->irq.possible[i]]) in acpi_pci_link_allocate()
551 irq = link->irq.possible[i]; in acpi_pci_link_allocate()
556 if (acpi_pci_link_set(link, irq)) { in acpi_pci_link_allocate()
559 acpi_device_name(link->device), in acpi_pci_link_allocate()
560 acpi_device_bid(link->device)); in acpi_pci_link_allocate()
563 acpi_irq_penalty[link->irq.active] += PIRQ_PENALTY_PCI_USING; in acpi_pci_link_allocate()
565 acpi_device_name(link->device), in acpi_pci_link_allocate()
566 acpi_device_bid(link->device), link->irq.active); in acpi_pci_link_allocate()
569 link->irq.setonboot = 1; in acpi_pci_link_allocate()
584 struct acpi_pci_link *link = NULL; in acpi_pci_link_get_irq() local
594 link = (struct acpi_pci_link *) acpi_driver_data(device); in acpi_pci_link_get_irq()
595 if (!link) { in acpi_pci_link_get_irq()
606 if (acpi_pci_link_allocate(link)) in acpi_pci_link_get_irq()
609 if (!link->irq.active) { in acpi_pci_link_get_irq()
614 if (edge_level) *edge_level = link->irq.edge_level; in acpi_pci_link_get_irq()
615 if (active_high_low) *active_high_low = link->irq.active_high_low; in acpi_pci_link_get_irq()
616 return_VALUE(link->irq.active); in acpi_pci_link_get_irq()
629 struct acpi_pci_link *link = NULL; in acpi_pci_link_add() local
638 link = kmalloc(sizeof(struct acpi_pci_link), GFP_KERNEL); in acpi_pci_link_add()
639 if (!link) in acpi_pci_link_add()
641 memset(link, 0, sizeof(struct acpi_pci_link)); in acpi_pci_link_add()
643 link->device = device; in acpi_pci_link_add()
644 link->handle = device->handle; in acpi_pci_link_add()
647 acpi_driver_data(device) = link; in acpi_pci_link_add()
649 result = acpi_pci_link_get_possible(link); in acpi_pci_link_add()
654 acpi_pci_link_get_current(link); in acpi_pci_link_add()
658 for (i = 0; i < link->irq.possible_count; i++) { in acpi_pci_link_add()
659 if (link->irq.active == link->irq.possible[i]) { in acpi_pci_link_add()
660 printk(" *%d", link->irq.possible[i]); in acpi_pci_link_add()
664 printk(" %d", link->irq.possible[i]); in acpi_pci_link_add()
670 printk(" *%d", link->irq.active); in acpi_pci_link_add()
672 if(!link->device->status.enabled) in acpi_pci_link_add()
678 list_add_tail(&link->node, &acpi_link.entries); in acpi_pci_link_add()
683 acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL); in acpi_pci_link_add()
686 kfree(link); in acpi_pci_link_add()
697 struct acpi_pci_link *link = NULL; in acpi_pci_link_remove() local
704 link = (struct acpi_pci_link *) acpi_driver_data(device); in acpi_pci_link_remove()
707 list_del(&link->node); in acpi_pci_link_remove()
709 kfree(link); in acpi_pci_link_remove()