Author: kib
Date: Sun Apr 14 14:02:34 2013
New Revision: 249476
URL: http://svnweb.freebsd.org/changeset/base/249476

Log:
  Usnure that PCI bus BIS_GET_DMA_TAG() method sees the actual PCI
  device which makes the request for dma tag, instead of some descendant
  of the PCI device, by creating a pass-through trampoline for vga_pci
  and ata_pci buses.
  
  Sponsored by: The FreeBSD Foundation
  Suggested by: jhb
  Discussed with:       jhb, mav
  MFC after:    1 week

Modified:
  head/sys/dev/ata/ata-pci.c
  head/sys/dev/pci/vga_pci.c

Modified: head/sys/dev/ata/ata-pci.c
==============================================================================
--- head/sys/dev/ata/ata-pci.c  Sun Apr 14 13:06:07 2013        (r249475)
+++ head/sys/dev/ata/ata-pci.c  Sun Apr 14 14:02:34 2013        (r249476)
@@ -571,6 +571,13 @@ ata_pci_child_location_str(device_t dev,
        return (0);
 }
 
+static bus_dma_tag_t
+ata_pci_get_dma_tag(device_t bus, device_t child)
+{
+
+       return (bus_get_dma_tag(bus));
+}
+
 static device_method_t ata_pci_methods[] = {
     /* device interface */
     DEVMETHOD(device_probe,             ata_pci_probe),
@@ -593,6 +600,7 @@ static device_method_t ata_pci_methods[]
     DEVMETHOD(pci_write_config,                ata_pci_write_config),
     DEVMETHOD(bus_print_child,         ata_pci_print_child),
     DEVMETHOD(bus_child_location_str,  ata_pci_child_location_str),
+    DEVMETHOD(bus_get_dma_tag,         ata_pci_get_dma_tag),
 
     DEVMETHOD_END
 };

Modified: head/sys/dev/pci/vga_pci.c
==============================================================================
--- head/sys/dev/pci/vga_pci.c  Sun Apr 14 13:06:07 2013        (r249475)
+++ head/sys/dev/pci/vga_pci.c  Sun Apr 14 14:02:34 2013        (r249476)
@@ -419,6 +419,13 @@ vga_pci_msix_count(device_t dev, device_
        return (pci_msix_count(dev));
 }
 
+static bus_dma_tag_t
+vga_pci_get_dma_tag(device_t bus, device_t child)
+{
+
+       return (bus_get_dma_tag(bus));
+}
+
 static device_method_t vga_pci_methods[] = {
        /* Device interface */
        DEVMETHOD(device_probe,         vga_pci_probe),
@@ -436,6 +443,7 @@ static device_method_t vga_pci_methods[]
        DEVMETHOD(bus_release_resource, vga_pci_release_resource),
        DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
        DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+       DEVMETHOD(bus_get_dma_tag,      vga_pci_get_dma_tag),
 
        /* PCI interface */
        DEVMETHOD(pci_read_config,      vga_pci_read_config),
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to