/* Assign to a new slot on the virtual PCI bus */ for (slot = 0; slot < PCI_SLOT_MAX; slot++) { if (list_empty(&vpci_dev->dev_list[slot])) {
dev_info(&dev->dev, "vpci: assign to virtual slot %d\n",
slot);
list_add_tail(&dev_entry->list,
&vpci_dev->dev_list[slot]); goto unlock;
}
}
err = -ENOMEM;
xenbus_dev_fatal(pdev->xdev, err, "No more space on root virtual PCI bus");
unlock:
mutex_unlock(&vpci_dev->lock);
/* Publish this device. */ if (!err)
err = publish_cb(pdev, 0, 0, PCI_DEVFN(slot, func), devid); else
kfree(dev_entry);
if (found_dev) { if (lock)
device_lock(&found_dev->dev);
pcistub_put_pci_dev(found_dev); if (lock)
device_unlock(&found_dev->dev);
}
}
staticint __xen_pcibk_init_devices(struct xen_pcibk_device *pdev)
{ int slot; struct vpci_dev_data *vpci_dev;
vpci_dev = kmalloc(sizeof(*vpci_dev), GFP_KERNEL); if (!vpci_dev) return -ENOMEM;
mutex_init(&vpci_dev->lock);
for (slot = 0; slot < PCI_SLOT_MAX; slot++)
INIT_LIST_HEAD(&vpci_dev->dev_list[slot]);
pdev->pci_dev_data = vpci_dev;
return0;
}
staticint __xen_pcibk_publish_pci_roots(struct xen_pcibk_device *pdev,
publish_pci_root_cb publish_cb)
{ /* The Virtual PCI bus has only one root */ return publish_cb(pdev, 0, 0);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.