• Home
  • Raw
  • Download

Lines Matching +full:pci +full:- +full:domain

2  * PCI Stub Driver - Grabs devices in backend to be exported later
16 #include <linux/pci.h>
21 #include <asm/xen/pci.h>
40 int domain; member
53 struct xen_pcibk_device *pdev;/* non-NULL if struct pci_dev is in use */
72 dev_dbg(&dev->dev, "pcistub_device_alloc\n"); in pcistub_device_alloc()
78 psdev->dev = pci_dev_get(dev); in pcistub_device_alloc()
79 if (!psdev->dev) { in pcistub_device_alloc()
84 kref_init(&psdev->kref); in pcistub_device_alloc()
85 spin_lock_init(&psdev->lock); in pcistub_device_alloc()
98 dev = psdev->dev; in pcistub_device_release()
101 dev_dbg(&dev->dev, "pcistub_device_release\n"); in pcistub_device_release()
110 pci_load_and_free_saved_state(dev, &dev_data->pci_saved_state)) in pcistub_device_release()
111 dev_info(&dev->dev, "Could not reload PCI state\n"); in pcistub_device_release()
115 if (dev->msix_cap) { in pcistub_device_release()
117 .seg = pci_domain_nr(dev->bus), in pcistub_device_release()
118 .bus = dev->bus->number, in pcistub_device_release()
119 .devfn = dev->devfn in pcistub_device_release()
124 if (err && err != -ENOSYS) in pcistub_device_release()
125 dev_warn(&dev->dev, "MSI-X release failed (%d)\n", in pcistub_device_release()
135 /* Clean-up the device */ in pcistub_device_release()
147 kref_get(&psdev->kref); in pcistub_device_get()
152 kref_put(&psdev->kref, pcistub_device_release); in pcistub_device_put()
155 static struct pcistub_device *pcistub_device_find_locked(int domain, int bus, in pcistub_device_find_locked() argument
161 if (psdev->dev != NULL in pcistub_device_find_locked()
162 && domain == pci_domain_nr(psdev->dev->bus) in pcistub_device_find_locked()
163 && bus == psdev->dev->bus->number in pcistub_device_find_locked()
164 && slot == PCI_SLOT(psdev->dev->devfn) in pcistub_device_find_locked()
165 && func == PCI_FUNC(psdev->dev->devfn)) { in pcistub_device_find_locked()
173 static struct pcistub_device *pcistub_device_find(int domain, int bus, in pcistub_device_find() argument
181 psdev = pcistub_device_find_locked(domain, bus, slot, func); in pcistub_device_find()
197 spin_lock_irqsave(&psdev->lock, flags); in pcistub_device_get_pci_dev()
198 if (!psdev->pdev) { in pcistub_device_get_pci_dev()
199 psdev->pdev = pdev; in pcistub_device_get_pci_dev()
200 pci_dev = psdev->dev; in pcistub_device_get_pci_dev()
202 spin_unlock_irqrestore(&psdev->lock, flags); in pcistub_device_get_pci_dev()
211 int domain, int bus, in pcistub_get_pci_dev_by_slot() argument
220 psdev = pcistub_device_find_locked(domain, bus, slot, func); in pcistub_get_pci_dev_by_slot()
238 if (psdev->dev == dev) { in pcistub_get_pci_dev()
250 * - XenBus state has been reconfigure (pci unplug). See xen_pcibk_remove_device
251 * - XenBus state has been disconnected (guest shutdown). See xen_pcibk_xenbus_remove
252 * - 'echo BDF > unbind' on pciback module with no guest attached. See pcistub_remove
253 * - 'echo BDF > unbind' with a guest still using it. See pcistub_remove
269 if (psdev->dev == dev) { in pcistub_put_pci_dev()
284 * (so it's ready for the next domain) in pcistub_put_pci_dev()
286 device_lock_assert(&dev->dev); in pcistub_put_pci_dev()
290 ret = pci_load_saved_state(dev, dev_data->pci_saved_state); in pcistub_put_pci_dev()
299 dev_info(&dev->dev, "Could not reload PCI state\n"); in pcistub_put_pci_dev()
309 spin_lock_irqsave(&found_psdev->lock, flags); in pcistub_put_pci_dev()
310 found_psdev->pdev = NULL; in pcistub_put_pci_dev()
311 spin_unlock_irqrestore(&found_psdev->lock, flags); in pcistub_put_pci_dev()
320 /* Match the specified device by domain, bus, slot, func and also if in pcistub_match_one()
323 for (; dev != NULL; dev = dev->bus->self) { in pcistub_match_one()
324 if (pci_domain_nr(dev->bus) == pdev_id->domain in pcistub_match_one()
325 && dev->bus->number == pdev_id->bus in pcistub_match_one()
326 && dev->devfn == pdev_id->devfn) in pcistub_match_one()
330 if (dev == dev->bus->self) in pcistub_match_one()
360 dev_dbg(&dev->dev, "initializing...\n"); in pcistub_init_device()
362 /* The PCI backend is not intended to be a module (or to work with in pcistub_init_device()
363 * removable PCI devices (yet). If it were, xen_pcibk_config_free() in pcistub_init_device()
365 * here and then to call kfree(pci_get_drvdata(psdev->dev)). in pcistub_init_device()
370 err = -ENOMEM; in pcistub_init_device()
379 sprintf(dev_data->irq_name, DRV_NAME "[%s]", pci_name(dev)); in pcistub_init_device()
381 dev_dbg(&dev->dev, "initializing config\n"); in pcistub_init_device()
388 /* HACK: Force device (& ACPI) to determine what IRQ it's on - we in pcistub_init_device()
390 * the pci device's true irq (and possibly its other resources) in pcistub_init_device()
395 dev_dbg(&dev->dev, "enabling device\n"); in pcistub_init_device()
400 if (dev->msix_cap) { in pcistub_init_device()
402 .seg = pci_domain_nr(dev->bus), in pcistub_init_device()
403 .bus = dev->bus->number, in pcistub_init_device()
404 .devfn = dev->devfn in pcistub_init_device()
408 if (err && err != -ENOSYS) in pcistub_init_device()
409 dev_err(&dev->dev, "MSI-X preparation failed (%d)\n", in pcistub_init_device()
414 dev_dbg(&dev->dev, "save state of device\n"); in pcistub_init_device()
416 dev_data->pci_saved_state = pci_store_saved_state(dev); in pcistub_init_device()
417 if (!dev_data->pci_saved_state) in pcistub_init_device()
418 dev_err(&dev->dev, "Could not store PCI conf saved state!\n"); in pcistub_init_device()
420 dev_dbg(&dev->dev, "resetting (FLR, D3, etc) the device\n"); in pcistub_init_device()
427 dev_dbg(&dev->dev, "reset device\n"); in pcistub_init_device()
459 list_del(&psdev->dev_list); in pcistub_init_devices_late()
463 err = pcistub_init_device(psdev->dev); in pcistub_init_devices_late()
465 dev_err(&psdev->dev->dev, in pcistub_init_devices_late()
474 list_add_tail(&psdev->dev_list, &pcistub_devices); in pcistub_init_devices_late()
485 int domain, int bus, unsigned int devfn) in pcistub_device_id_add_list() argument
494 if (pci_dev_id->domain == domain && pci_dev_id->bus == bus && in pcistub_device_id_add_list()
495 pci_dev_id->devfn == devfn) { in pcistub_device_id_add_list()
502 new->domain = domain; in pcistub_device_id_add_list()
503 new->bus = bus; in pcistub_device_id_add_list()
504 new->devfn = devfn; in pcistub_device_id_add_list()
505 list_add_tail(&new->slot_list, &pcistub_device_ids); in pcistub_device_id_add_list()
524 return -ENOMEM; in pcistub_seize()
533 err = pcistub_init_device(psdev->dev); in pcistub_seize()
538 list_add(&psdev->dev_list, &pcistub_devices); in pcistub_seize()
540 dev_dbg(&dev->dev, "deferring initialization\n"); in pcistub_seize()
541 list_add(&psdev->dev_list, &seized_devices); in pcistub_seize()
550 pcistub_device_id_add_list(pci_dev_id, pci_domain_nr(dev->bus), in pcistub_seize()
551 dev->bus->number, dev->devfn); in pcistub_seize()
563 dev_dbg(&dev->dev, "probing...\n"); in pcistub_probe()
567 if ((dev->driver_override && in pcistub_probe()
568 !strcmp(dev->driver_override, PCISTUB_DRIVER_NAME)) || in pcistub_probe()
571 if (dev->hdr_type != PCI_HEADER_TYPE_NORMAL in pcistub_probe()
572 && dev->hdr_type != PCI_HEADER_TYPE_BRIDGE) { in pcistub_probe()
573 dev_err(&dev->dev, "can't export pci devices that " in pcistub_probe()
576 err = -ENODEV; in pcistub_probe()
583 err = -ENOMEM; in pcistub_probe()
588 dev_info(&dev->dev, "seizing device\n"); in pcistub_probe()
592 err = -ENODEV; in pcistub_probe()
605 dev_dbg(&dev->dev, "removing\n"); in pcistub_remove()
612 if (psdev->dev == dev) { in pcistub_remove()
621 dev_dbg(&dev->dev, "found device to remove %s\n", in pcistub_remove()
622 found_psdev->pdev ? "- in-use" : ""); in pcistub_remove()
624 if (found_psdev->pdev) { in pcistub_remove()
627 pr_warn("****** removing device %s while still in-use by domain %d! ******\n", in pcistub_remove()
628 pci_name(found_psdev->dev), domid); in pcistub_remove()
629 pr_warn("****** driver domain may still access this device's i/o resources!\n"); in pcistub_remove()
630 pr_warn("****** shutdown driver domain before binding device\n"); in pcistub_remove()
635 xen_pcibk_release_pci_dev(found_psdev->pdev, in pcistub_remove()
636 found_psdev->dev, in pcistub_remove()
641 list_del(&found_psdev->dev_list); in pcistub_remove()
667 snprintf(nodename, PCI_NODENAME_MAX, "/local/domain/0/backend/pci/%d/0", in kill_domain_by_device()
668 psdev->pdev->xdev->otherend_id); in kill_domain_by_device()
673 dev_err(&psdev->dev->dev, in kill_domain_by_device()
681 if (err == -EAGAIN) in kill_domain_by_device()
683 dev_err(&psdev->dev->dev, in kill_domain_by_device()
699 struct xen_pcibk_device *pdev = psdev->pdev; in common_process()
700 struct xen_pci_sharedinfo *sh_info = pdev->sh_info; in common_process()
704 aer_op = &(sh_info->aer_op); in common_process()
705 aer_op->cmd = aer_cmd ; in common_process()
707 aer_op->err = state; in common_process()
709 ret = xen_pcibk_get_pcifront_dev(psdev->dev, psdev->pdev, in common_process()
710 &aer_op->domain, &aer_op->bus, &aer_op->devfn); in common_process()
712 dev_err(&psdev->dev->dev, in common_process()
718 dev_dbg(&psdev->dev->dev, in common_process()
720 aer_cmd, aer_op->domain, aer_op->bus, aer_op->devfn); in common_process()
722 * this flag to judge whether we need to check pci-front give aer in common_process()
725 set_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags); in common_process()
732 (unsigned long *)&sh_info->flags); in common_process()
734 notify_remote_via_irq(pdev->evtchn_irq); in common_process()
741 &sh_info->flags)), 300*HZ); in common_process()
744 if (!test_bit(_PDEVF_op_active, &pdev->flags)) in common_process()
749 (unsigned long *)&sh_info->flags)) { in common_process()
750 dev_err(&psdev->dev->dev, in common_process()
753 (unsigned long *)&sh_info->flags); in common_process()
754 aer_op->err = PCI_ERS_RESULT_NONE; in common_process()
758 clear_bit(_PCIB_op_pending, (unsigned long *)&pdev->flags); in common_process()
760 res = (pci_ers_result_t)aer_op->err; in common_process()
768 * @dev: pointer to PCI devices
777 dev_dbg(&dev->dev, "xen_pcibk_slot_reset(bus:%x,devfn:%x)\n", in xen_pcibk_slot_reset()
778 dev->bus->number, dev->devfn); in xen_pcibk_slot_reset()
781 psdev = pcistub_device_find(pci_domain_nr(dev->bus), in xen_pcibk_slot_reset()
782 dev->bus->number, in xen_pcibk_slot_reset()
783 PCI_SLOT(dev->devfn), in xen_pcibk_slot_reset()
784 PCI_FUNC(dev->devfn)); in xen_pcibk_slot_reset()
786 if (!psdev || !psdev->pdev) { in xen_pcibk_slot_reset()
787 dev_err(&dev->dev, in xen_pcibk_slot_reset()
792 if (!psdev->pdev->sh_info) { in xen_pcibk_slot_reset()
793 dev_err(&dev->dev, DRV_NAME " device is not connected or owned" in xen_pcibk_slot_reset()
800 (unsigned long *)&psdev->pdev->sh_info->flags)) { in xen_pcibk_slot_reset()
801 dev_err(&dev->dev, in xen_pcibk_slot_reset()
809 dev_dbg(&dev->dev, in xen_pcibk_slot_reset()
825 * @dev: pointer to PCI devices
835 dev_dbg(&dev->dev, "xen_pcibk_mmio_enabled(bus:%x,devfn:%x)\n", in xen_pcibk_mmio_enabled()
836 dev->bus->number, dev->devfn); in xen_pcibk_mmio_enabled()
839 psdev = pcistub_device_find(pci_domain_nr(dev->bus), in xen_pcibk_mmio_enabled()
840 dev->bus->number, in xen_pcibk_mmio_enabled()
841 PCI_SLOT(dev->devfn), in xen_pcibk_mmio_enabled()
842 PCI_FUNC(dev->devfn)); in xen_pcibk_mmio_enabled()
844 if (!psdev || !psdev->pdev) { in xen_pcibk_mmio_enabled()
845 dev_err(&dev->dev, in xen_pcibk_mmio_enabled()
850 if (!psdev->pdev->sh_info) { in xen_pcibk_mmio_enabled()
851 dev_err(&dev->dev, DRV_NAME " device is not connected or owned" in xen_pcibk_mmio_enabled()
858 (unsigned long *)&psdev->pdev->sh_info->flags)) { in xen_pcibk_mmio_enabled()
859 dev_err(&dev->dev, in xen_pcibk_mmio_enabled()
867 dev_dbg(&dev->dev, in xen_pcibk_mmio_enabled()
881 * @dev: pointer to PCI devices
882 * @error: the current PCI connection state
893 dev_dbg(&dev->dev, "xen_pcibk_error_detected(bus:%x,devfn:%x)\n", in xen_pcibk_error_detected()
894 dev->bus->number, dev->devfn); in xen_pcibk_error_detected()
897 psdev = pcistub_device_find(pci_domain_nr(dev->bus), in xen_pcibk_error_detected()
898 dev->bus->number, in xen_pcibk_error_detected()
899 PCI_SLOT(dev->devfn), in xen_pcibk_error_detected()
900 PCI_FUNC(dev->devfn)); in xen_pcibk_error_detected()
902 if (!psdev || !psdev->pdev) { in xen_pcibk_error_detected()
903 dev_err(&dev->dev, in xen_pcibk_error_detected()
908 if (!psdev->pdev->sh_info) { in xen_pcibk_error_detected()
909 dev_err(&dev->dev, DRV_NAME " device is not connected or owned" in xen_pcibk_error_detected()
917 (unsigned long *)&psdev->pdev->sh_info->flags)) { in xen_pcibk_error_detected()
918 dev_dbg(&dev->dev, "guest may have no aer driver, kill it\n"); in xen_pcibk_error_detected()
926 dev_dbg(&dev->dev, in xen_pcibk_error_detected()
940 * @dev: pointer to PCI devices
947 dev_dbg(&dev->dev, "xen_pcibk_error_resume(bus:%x,devfn:%x)\n", in xen_pcibk_error_resume()
948 dev->bus->number, dev->devfn); in xen_pcibk_error_resume()
951 psdev = pcistub_device_find(pci_domain_nr(dev->bus), in xen_pcibk_error_resume()
952 dev->bus->number, in xen_pcibk_error_resume()
953 PCI_SLOT(dev->devfn), in xen_pcibk_error_resume()
954 PCI_FUNC(dev->devfn)); in xen_pcibk_error_resume()
956 if (!psdev || !psdev->pdev) { in xen_pcibk_error_resume()
957 dev_err(&dev->dev, in xen_pcibk_error_resume()
962 if (!psdev->pdev->sh_info) { in xen_pcibk_error_resume()
963 dev_err(&dev->dev, DRV_NAME " device is not connected or owned" in xen_pcibk_error_resume()
970 (unsigned long *)&psdev->pdev->sh_info->flags)) { in xen_pcibk_error_resume()
971 dev_err(&dev->dev, in xen_pcibk_error_resume()
1008 static inline int str_to_slot(const char *buf, int *domain, int *bus, in str_to_slot() argument
1013 switch (sscanf(buf, " %x:%x:%x.%x %n", domain, bus, slot, func, in str_to_slot()
1016 *func = -1; in str_to_slot()
1017 sscanf(buf, " %x:%x:%x.* %n", domain, bus, slot, &parsed); in str_to_slot()
1020 *slot = *func = -1; in str_to_slot()
1021 sscanf(buf, " %x:%x:*.* %n", domain, bus, &parsed); in str_to_slot()
1027 /* try again without domain */ in str_to_slot()
1028 *domain = 0; in str_to_slot()
1031 *func = -1; in str_to_slot()
1035 *slot = *func = -1; in str_to_slot()
1042 return -EINVAL; in str_to_slot()
1045 static inline int str_to_quirk(const char *buf, int *domain, int *bus, int in str_to_quirk() argument
1050 sscanf(buf, " %x:%x:%x.%x-%x:%x:%x %n", domain, bus, slot, func, in str_to_quirk()
1055 /* try again without domain */ in str_to_quirk()
1056 *domain = 0; in str_to_quirk()
1057 sscanf(buf, " %x:%x.%x-%x:%x:%x %n", bus, slot, func, reg, size, in str_to_quirk()
1062 return -EINVAL; in str_to_quirk()
1065 static int pcistub_device_id_add(int domain, int bus, int slot, int func) in pcistub_device_id_add() argument
1072 rc = pcistub_device_id_add(domain, bus, slot, func); in pcistub_device_id_add()
1078 rc = pcistub_device_id_add(domain, bus, slot, func); in pcistub_device_id_add()
1085 !pci_domains_supported ? domain : in pcistub_device_id_add()
1087 domain < 0 || domain > 0xffff) in pcistub_device_id_add()
1091 return -EINVAL; in pcistub_device_id_add()
1095 return -ENOMEM; in pcistub_device_id_add()
1098 domain, bus, slot, func); in pcistub_device_id_add()
1100 pcistub_device_id_add_list(pci_dev_id, domain, bus, devfn); in pcistub_device_id_add()
1105 static int pcistub_device_id_remove(int domain, int bus, int slot, int func) in pcistub_device_id_remove() argument
1108 int err = -ENOENT; in pcistub_device_id_remove()
1114 if (pci_dev_id->domain == domain && pci_dev_id->bus == bus in pcistub_device_id_remove()
1115 && (slot < 0 || PCI_SLOT(pci_dev_id->devfn) == slot) in pcistub_device_id_remove()
1116 && (func < 0 || PCI_FUNC(pci_dev_id->devfn) == func)) { in pcistub_device_id_remove()
1120 list_del(&pci_dev_id->slot_list); in pcistub_device_id_remove()
1126 domain, bus, slot, func); in pcistub_device_id_remove()
1134 static int pcistub_reg_add(int domain, int bus, int slot, int func, in pcistub_reg_add() argument
1144 return -EINVAL; in pcistub_reg_add()
1146 psdev = pcistub_device_find(domain, bus, slot, func); in pcistub_reg_add()
1148 err = -ENODEV; in pcistub_reg_add()
1151 dev = psdev->dev; in pcistub_reg_add()
1155 err = -ENOMEM; in pcistub_reg_add()
1159 field->offset = reg; in pcistub_reg_add()
1160 field->size = size; in pcistub_reg_add()
1161 field->mask = mask; in pcistub_reg_add()
1162 field->init = NULL; in pcistub_reg_add()
1163 field->reset = NULL; in pcistub_reg_add()
1164 field->release = NULL; in pcistub_reg_add()
1165 field->clean = xen_pcibk_config_field_free; in pcistub_reg_add()
1179 int domain, bus, slot, func; in new_slot_store() local
1182 err = str_to_slot(buf, &domain, &bus, &slot, &func); in new_slot_store()
1186 err = pcistub_device_id_add(domain, bus, slot, func); in new_slot_store()
1198 int domain, bus, slot, func; in remove_slot_store() local
1201 err = str_to_slot(buf, &domain, &bus, &slot, &func); in remove_slot_store()
1205 err = pcistub_device_id_remove(domain, bus, slot, func); in remove_slot_store()
1225 count += scnprintf(buf + count, PAGE_SIZE - count, in slots_show()
1227 pci_dev_id->domain, pci_dev_id->bus, in slots_show()
1228 PCI_SLOT(pci_dev_id->devfn), in slots_show()
1229 PCI_FUNC(pci_dev_id->devfn)); in slots_show()
1248 if (!psdev->dev) in irq_handlers_show()
1250 dev_data = pci_get_drvdata(psdev->dev); in irq_handlers_show()
1254 scnprintf(buf + count, PAGE_SIZE - count, in irq_handlers_show()
1256 pci_name(psdev->dev), in irq_handlers_show()
1257 dev_data->isr_on ? "on" : "off", in irq_handlers_show()
1258 dev_data->ack_intr ? "ack" : "not ack", in irq_handlers_show()
1259 dev_data->handled); in irq_handlers_show()
1271 int domain, bus, slot, func; in irq_handler_state_store() local
1274 err = str_to_slot(buf, &domain, &bus, &slot, &func); in irq_handler_state_store()
1278 psdev = pcistub_device_find(domain, bus, slot, func); in irq_handler_state_store()
1280 err = -ENOENT; in irq_handler_state_store()
1284 dev_data = pci_get_drvdata(psdev->dev); in irq_handler_state_store()
1286 err = -ENOENT; in irq_handler_state_store()
1290 dev_dbg(&psdev->dev->dev, "%s fake irq handler: %d->%d\n", in irq_handler_state_store()
1291 dev_data->irq_name, dev_data->isr_on, in irq_handler_state_store()
1292 !dev_data->isr_on); in irq_handler_state_store()
1294 dev_data->isr_on = !(dev_data->isr_on); in irq_handler_state_store()
1295 if (dev_data->isr_on) in irq_handler_state_store()
1296 dev_data->ack_intr = 1; in irq_handler_state_store()
1309 int domain, bus, slot, func, reg, size, mask; in quirks_store() local
1312 err = str_to_quirk(buf, &domain, &bus, &slot, &func, &reg, &size, in quirks_store()
1317 err = pcistub_reg_add(domain, bus, slot, func, reg, size, mask); in quirks_store()
1339 count += scnprintf(buf + count, PAGE_SIZE - count, in quirks_show()
1341 quirk->pdev->bus->number, in quirks_show()
1342 PCI_SLOT(quirk->pdev->devfn), in quirks_show()
1343 PCI_FUNC(quirk->pdev->devfn), in quirks_show()
1344 quirk->devid.vendor, quirk->devid.device, in quirks_show()
1345 quirk->devid.subvendor, in quirks_show()
1346 quirk->devid.subdevice); in quirks_show()
1348 dev_data = pci_get_drvdata(quirk->pdev); in quirks_show()
1350 list_for_each_entry(cfg_entry, &dev_data->config_fields, list) { in quirks_show()
1351 field = cfg_entry->field; in quirks_show()
1355 count += scnprintf(buf + count, PAGE_SIZE - count, in quirks_show()
1357 cfg_entry->base_offset + in quirks_show()
1358 field->offset, field->size, in quirks_show()
1359 field->mask); in quirks_show()
1373 int domain, bus, slot, func; in permissive_store() local
1378 err = str_to_slot(buf, &domain, &bus, &slot, &func); in permissive_store()
1382 psdev = pcistub_device_find(domain, bus, slot, func); in permissive_store()
1384 err = -ENODEV; in permissive_store()
1388 dev_data = pci_get_drvdata(psdev->dev); in permissive_store()
1391 err = -ENXIO; in permissive_store()
1394 if (!dev_data->permissive) { in permissive_store()
1395 dev_data->permissive = 1; in permissive_store()
1397 dev_warn(&psdev->dev->dev, "enabling permissive mode " in permissive_store()
1399 dev_warn(&psdev->dev->dev, in permissive_store()
1420 if (!psdev->dev) in permissive_show()
1422 dev_data = pci_get_drvdata(psdev->dev); in permissive_show()
1423 if (!dev_data || !dev_data->permissive) in permissive_show()
1426 scnprintf(buf + count, PAGE_SIZE - count, "%s\n", in permissive_show()
1427 pci_name(psdev->dev)); in permissive_show()
1454 int domain, bus, slot, func; in pcistub_init() local
1463 &domain, &bus, &slot, &func, &parsed); in pcistub_init()
1466 func = -1; in pcistub_init()
1469 &domain, &bus, &slot, &parsed); in pcistub_init()
1472 slot = func = -1; in pcistub_init()
1475 &domain, &bus, &parsed); in pcistub_init()
1480 domain = 0; in pcistub_init()
1486 func = -1; in pcistub_init()
1492 slot = func = -1; in pcistub_init()
1503 err = pcistub_device_id_add(domain, bus, slot, func); in pcistub_init()
1511 /* If we're the first PCI Device Driver to register, we're the in pcistub_init()
1512 * first one to get offered PCI devices as they become in pcistub_init()
1549 return -EINVAL; in pcistub_init()
1557 * get a chance by being the first pci device
1572 if (!psdev->pdev && psdev->dev != pdev in find_vfs()
1573 && pci_physfn(psdev->dev) == pdev) { in find_vfs()
1593 if (!pdev->is_physfn) in pci_stub_notifier()
1600 device_release_driver(&psdev->dev->dev); in pci_stub_notifier()
1615 return -ENODEV; in xen_pcibk_init()
1652 MODULE_ALIAS("xen-backend:pci");