svn commit: r292862 - user/ngie/stable-10-libnv/sys/dev/pci

Garrett Cooper ngie at FreeBSD.org
Tue Dec 29 08:39:09 UTC 2015


Author: ngie
Date: Tue Dec 29 08:39:07 2015
New Revision: 292862
URL: https://svnweb.freebsd.org/changeset/base/292862

Log:
  MFC r270332:
  r270332 (by royger):
  
  pci: add a new pci_child_added newbus method.
  
  This is needed so when running under Xen the calls to pci_child_added
  can be intercepted and a custom Xen method can be used to register
  those devices with Xen. This should not include any functional
  change, since the Xen implementation will be added in a following
  patch and the native implementation is a noop.
  
  Sponsored by: Citrix Systems R&D
  Reviewed by: jhb
  
  dev/pci/pci.c:
  dev/pci/pci_if.m:
  dev/pci/pci_private.h:
  dev/pci/pcivar.h:
   - Add the pci_child_added newbus method.

Modified:
  user/ngie/stable-10-libnv/sys/dev/pci/pci.c
  user/ngie/stable-10-libnv/sys/dev/pci/pci_if.m
  user/ngie/stable-10-libnv/sys/dev/pci/pci_private.h
  user/ngie/stable-10-libnv/sys/dev/pci/pcivar.h
Directory Properties:
  user/ngie/stable-10-libnv/   (props changed)

Modified: user/ngie/stable-10-libnv/sys/dev/pci/pci.c
==============================================================================
--- user/ngie/stable-10-libnv/sys/dev/pci/pci.c	Tue Dec 29 08:19:43 2015	(r292861)
+++ user/ngie/stable-10-libnv/sys/dev/pci/pci.c	Tue Dec 29 08:39:07 2015	(r292862)
@@ -183,6 +183,7 @@ static device_method_t pci_methods[] = {
 	DEVMETHOD(pci_msi_count,	pci_msi_count_method),
 	DEVMETHOD(pci_msix_count,	pci_msix_count_method),
 	DEVMETHOD(pci_get_rid,		pci_get_rid_method),
+	DEVMETHOD(pci_child_added,	pci_child_added_method),
 
 	DEVMETHOD_END
 };
@@ -3604,6 +3605,13 @@ pci_add_child(device_t bus, struct pci_d
 	pci_cfg_restore(dinfo->cfg.dev, dinfo);
 	pci_print_verbose(dinfo);
 	pci_add_resources(bus, dinfo->cfg.dev, 0, 0);
+	pci_child_added(dinfo->cfg.dev);
+}
+
+void
+pci_child_added_method(device_t dev, device_t child)
+{
+
 }
 
 static int

Modified: user/ngie/stable-10-libnv/sys/dev/pci/pci_if.m
==============================================================================
--- user/ngie/stable-10-libnv/sys/dev/pci/pci_if.m	Tue Dec 29 08:19:43 2015	(r292861)
+++ user/ngie/stable-10-libnv/sys/dev/pci/pci_if.m	Tue Dec 29 08:39:07 2015	(r292862)
@@ -185,3 +185,7 @@ METHOD uint16_t get_rid {
 	device_t	child;
 };
 
+METHOD void child_added {
+	device_t	dev;
+	device_t	child;
+};

Modified: user/ngie/stable-10-libnv/sys/dev/pci/pci_private.h
==============================================================================
--- user/ngie/stable-10-libnv/sys/dev/pci/pci_private.h	Tue Dec 29 08:19:43 2015	(r292861)
+++ user/ngie/stable-10-libnv/sys/dev/pci/pci_private.h	Tue Dec 29 08:39:07 2015	(r292862)
@@ -125,6 +125,7 @@ int		pci_assign_interrupt_method(device_
 int		pci_resume(device_t dev);
 int		pci_suspend(device_t dev);
 bus_dma_tag_t pci_get_dma_tag(device_t bus, device_t dev);
+void		pci_child_added_method(device_t dev, device_t child);
 
 /** Restore the config register state.  The state must be previously
  * saved with pci_cfg_save.  However, the pci bus driver takes care of

Modified: user/ngie/stable-10-libnv/sys/dev/pci/pcivar.h
==============================================================================
--- user/ngie/stable-10-libnv/sys/dev/pci/pcivar.h	Tue Dec 29 08:19:43 2015	(r292861)
+++ user/ngie/stable-10-libnv/sys/dev/pci/pcivar.h	Tue Dec 29 08:39:07 2015	(r292862)
@@ -506,6 +506,13 @@ pci_get_rid(device_t dev)
 	return (PCI_GET_RID(device_get_parent(dev), dev));
 }
 
+static __inline void
+pci_child_added(device_t dev)
+{
+
+    return (PCI_CHILD_ADDED(device_get_parent(dev), dev));
+}
+
 device_t pci_find_bsf(uint8_t, uint8_t, uint8_t);
 device_t pci_find_dbsf(uint32_t, uint8_t, uint8_t, uint8_t);
 device_t pci_find_device(uint16_t, uint16_t);


More information about the svn-src-user mailing list