• Home
  • Raw
  • Download

Lines Matching refs:xdev

37 static struct xen_pcibk_device *alloc_pdev(struct xenbus_device *xdev)  in alloc_pdev()  argument
44 dev_dbg(&xdev->dev, "allocated pdev @ 0x%p\n", pdev); in alloc_pdev()
46 pdev->xdev = xdev; in alloc_pdev()
47 dev_set_drvdata(&xdev->dev, pdev); in alloc_pdev()
81 xenbus_unmap_ring_vfree(pdev->xdev, pdev->sh_info); in xen_pcibk_disconnect()
100 dev_set_drvdata(&pdev->xdev->dev, NULL); in free_pdev()
101 pdev->xdev = NULL; in free_pdev()
112 dev_dbg(&pdev->xdev->dev, in xen_pcibk_do_attach()
116 err = xenbus_map_ring_valloc(pdev->xdev, gnt_ref, &vaddr); in xen_pcibk_do_attach()
118 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_do_attach()
126 pdev->xdev->otherend_id, remote_evtchn, xen_pcibk_handle_event, in xen_pcibk_do_attach()
129 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_do_attach()
136 dev_dbg(&pdev->xdev->dev, "Attached!\n"); in xen_pcibk_do_attach()
150 if (xenbus_read_driver_state(pdev->xdev->nodename) != in xen_pcibk_attach()
155 if (xenbus_read_driver_state(pdev->xdev->otherend) != in xen_pcibk_attach()
159 dev_dbg(&pdev->xdev->dev, "Reading frontend config\n"); in xen_pcibk_attach()
161 err = xenbus_gather(XBT_NIL, pdev->xdev->otherend, in xen_pcibk_attach()
167 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_attach()
173 xenbus_dev_fatal(pdev->xdev, -EFAULT, in xen_pcibk_attach()
185 dev_dbg(&pdev->xdev->dev, "Connecting...\n"); in xen_pcibk_attach()
187 err = xenbus_switch_state(pdev->xdev, XenbusStateConnected); in xen_pcibk_attach()
189 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_attach()
192 dev_dbg(&pdev->xdev->dev, "Connected? %d\n", err); in xen_pcibk_attach()
216 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str, in xen_pcibk_publish_pci_dev()
231 dev_dbg(&pdev->xdev->dev, "exporting dom %x bus %x slot %x func %x\n", in xen_pcibk_export_device()
237 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_export_device()
250 dev_dbg(&dev->dev, "registering for %d\n", pdev->xdev->otherend_id); in xen_pcibk_export_device()
252 pdev->xdev->otherend_id) != 0) { in xen_pcibk_export_device()
256 xen_register_device_domain_owner(dev, pdev->xdev->otherend_id); in xen_pcibk_export_device()
277 dev_dbg(&pdev->xdev->dev, "removing dom %x bus %x slot %x func %x\n", in xen_pcibk_remove_device()
283 dev_dbg(&pdev->xdev->dev, "Couldn't locate PCI device " in xen_pcibk_remove_device()
289 dev_dbg(&dev->dev, "unregistering for %d\n", pdev->xdev->otherend_id); in xen_pcibk_remove_device()
307 dev_dbg(&pdev->xdev->dev, "Publishing pci roots\n"); in xen_pcibk_publish_pci_root()
309 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, in xen_pcibk_publish_pci_root()
324 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, in xen_pcibk_publish_pci_root()
345 dev_dbg(&pdev->xdev->dev, "writing root %d at %04x:%02x\n", in xen_pcibk_publish_pci_root()
348 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, str, in xen_pcibk_publish_pci_root()
353 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, in xen_pcibk_publish_pci_root()
371 dev_dbg(&pdev->xdev->dev, "Reconfiguring device ...\n"); in xen_pcibk_reconfigure()
375 if (xenbus_read_driver_state(pdev->xdev->nodename) != in xen_pcibk_reconfigure()
379 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "num_devs", "%d", in xen_pcibk_reconfigure()
384 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
393 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
398 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, state_str, in xen_pcibk_reconfigure()
405 dev_dbg(&pdev->xdev->dev, "Attaching dev-%d ...\n", i); in xen_pcibk_reconfigure()
410 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
415 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, in xen_pcibk_reconfigure()
419 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
426 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
441 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
447 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, in xen_pcibk_reconfigure()
451 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
459 dev_dbg(&pdev->xdev->dev, "Detaching dev-%d ...\n", i); in xen_pcibk_reconfigure()
464 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
469 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, in xen_pcibk_reconfigure()
473 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
480 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
503 err = xenbus_switch_state(pdev->xdev, XenbusStateReconfigured); in xen_pcibk_reconfigure()
505 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_reconfigure()
515 static void xen_pcibk_frontend_changed(struct xenbus_device *xdev, in xen_pcibk_frontend_changed() argument
518 struct xen_pcibk_device *pdev = dev_get_drvdata(&xdev->dev); in xen_pcibk_frontend_changed()
520 dev_dbg(&xdev->dev, "fe state changed %d\n", fe_state); in xen_pcibk_frontend_changed()
535 xenbus_switch_state(xdev, XenbusStateConnected); in xen_pcibk_frontend_changed()
540 xenbus_switch_state(xdev, XenbusStateClosing); in xen_pcibk_frontend_changed()
545 xenbus_switch_state(xdev, XenbusStateClosed); in xen_pcibk_frontend_changed()
546 if (xenbus_dev_is_online(xdev)) in xen_pcibk_frontend_changed()
550 dev_dbg(&xdev->dev, "frontend is gone! unregister device\n"); in xen_pcibk_frontend_changed()
551 device_unregister(&xdev->dev); in xen_pcibk_frontend_changed()
572 if (xenbus_read_driver_state(pdev->xdev->nodename) != in xen_pcibk_setup_backend()
576 dev_dbg(&pdev->xdev->dev, "getting be setup\n"); in xen_pcibk_setup_backend()
578 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, "num_devs", "%d", in xen_pcibk_setup_backend()
583 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
592 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
598 err = xenbus_scanf(XBT_NIL, pdev->xdev->nodename, dev_str, in xen_pcibk_setup_backend()
601 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
607 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
621 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
626 err = xenbus_printf(XBT_NIL, pdev->xdev->nodename, state_str, in xen_pcibk_setup_backend()
629 xenbus_dev_fatal(pdev->xdev, err, "Error switching " in xen_pcibk_setup_backend()
637 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
643 err = xenbus_switch_state(pdev->xdev, XenbusStateInitialised); in xen_pcibk_setup_backend()
645 xenbus_dev_fatal(pdev->xdev, err, in xen_pcibk_setup_backend()
662 switch (xenbus_read_driver_state(pdev->xdev->nodename)) { in xen_pcibk_be_watch()