struct passthrough_dev_data *dev_data = pdev->pci_dev_data;
struct pci_dev_entry *dev_entry;
unsigned long flags;
+ unsigned int domain, bus, devfn;
+ int err;
dev_entry = kmalloc(sizeof(*dev_entry), GFP_KERNEL);
if (!dev_entry)
list_add_tail(&dev_entry->list, &dev_data->dev_list);
spin_unlock_irqrestore(&dev_data->lock, flags);
- /* TODO: Publish virtual domain:bus:slot.func here. */
+ /* Publish this device. */
+ domain = (unsigned int)pci_domain_nr(dev->bus);
+ bus = (unsigned int)dev->bus->number;
+ devfn = dev->devfn;
+ err = publish_cb(pdev, domain, bus, devfn, devid);
- return 0;
+ return err;
}
void pciback_release_pci_dev(struct pciback_device *pdev, struct pci_dev *dev)
substate = XenbusStateUnknown;
switch (substate) {
- /* case XenbusStateUnknown: */
case XenbusStateInitialising:
dev_dbg(&pdev->xdev->dev, "Attaching dev-%d ...\n", i);
if (err)
goto out;
- /* TODO: if we are to support multiple pci roots
- * (CONFIG_XEN_PCIDEV_BACKEND_PASS), publish newly
- * added root here.
- */
+ /* Publish pci roots. */
+ err = pciback_publish_pci_roots(pdev, pciback_publish_pci_root);
+ if (err) {
+ xenbus_dev_fatal(pdev->xdev, err,
+ "Error while publish PCI root"
+ "buses for frontend");
+ goto out;
+ }
err = xenbus_printf(XBT_NIL, pdev->xdev->nodename,
state_str, "%d",
if(err)
goto out;
- /* TODO: if we are to support multiple pci roots
- * (CONFIG_XEN_PCIDEV_BACKEND_PASS), remove unnecessary
- * root here.
+ /* TODO: If at some point we implement support for pci
+ * root hot-remove on pcifront side, we'll need to
+ * remove unnecessary xenstore nodes of pci roots here.
*/
+
break;
default: