Author: scottl
Date: Mon Mar 12 08:03:51 2012
New Revision: 232854
URL: http://svn.freebsd.org/changeset/base/232854

Log:
  Convert a number of drivers to obtaining their parent DMA tag from their
  PCI device attachment.

Modified:
  head/sys/dev/advansys/adv_pci.c
  head/sys/dev/advansys/adw_pci.c
  head/sys/dev/amr/amr_pci.c
  head/sys/dev/an/if_an_pci.c
  head/sys/dev/arcmsr/arcmsr.c
  head/sys/dev/asr/asr.c
  head/sys/dev/buslogic/bt_pci.c
  head/sys/dev/bxe/if_bxe.c
  head/sys/dev/ciss/ciss.c
  head/sys/dev/cxgb/cxgb_sge.c
  head/sys/dev/dpt/dpt_pci.c
  head/sys/dev/hifn/hifn7751.c
  head/sys/dev/hptiop/hptiop.c
  head/sys/dev/hptmv/entry.c
  head/sys/dev/ida/ida_pci.c
  head/sys/dev/if_ndis/if_ndis_pci.c
  head/sys/dev/iir/iir_pci.c
  head/sys/dev/ips/ips_pci.c
  head/sys/dev/mfi/mfi_pci.c
  head/sys/dev/mlx/mlx_pci.c
  head/sys/dev/mly/mly.c
  head/sys/dev/twe/twe_freebsd.c
  head/sys/dev/tws/tws.c

Modified: head/sys/dev/advansys/adv_pci.c
==============================================================================
--- head/sys/dev/advansys/adv_pci.c     Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/advansys/adv_pci.c     Mon Mar 12 08:03:51 2012        
(r232854)
@@ -189,7 +189,7 @@ adv_pci_attach(device_t dev)
        /* Allocate a dmatag for our transfer DMA maps */
        /* XXX Should be a child of the PCI bus dma tag */
        error = bus_dma_tag_create(
-                       /* parent       */ NULL,
+                       /* parent       */ bus_get_dma_tag(dev),
                        /* alignment    */ 1,
                        /* boundary     */ 0,
                        /* lowaddr      */ ADV_PCI_MAX_DMA_ADDR,

Modified: head/sys/dev/advansys/adw_pci.c
==============================================================================
--- head/sys/dev/advansys/adw_pci.c     Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/advansys/adw_pci.c     Mon Mar 12 08:03:51 2012        
(r232854)
@@ -260,7 +260,7 @@ adw_pci_attach(device_t dev)
        /* Allocate a dmatag for our transfer DMA maps */
        /* XXX Should be a child of the PCI bus dma tag */
        error = bus_dma_tag_create(
-                       /* parent       */ NULL,
+                       /* parent       */ bus_get_dma_tag(dev),
                        /* alignment    */ 1,
                        /* boundary     */ 0,
                        /* lowaddr      */ ADW_PCI_MAX_DMA_ADDR,

Modified: head/sys/dev/amr/amr_pci.c
==============================================================================
--- head/sys/dev/amr/amr_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/amr/amr_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -275,7 +275,7 @@ amr_pci_attach(device_t dev)
     /*
      * Allocate the parent bus DMA tag appropriate for PCI.
      */
-    if (bus_dma_tag_create(NULL,                       /* parent */
+    if (bus_dma_tag_create(bus_get_dma_tag(dev),       /* PCI parent */
                           1, 0,                        /* alignment,boundary */
                           AMR_IS_SG64(sc) ?
                           BUS_SPACE_MAXADDR :

Modified: head/sys/dev/an/if_an_pci.c
==============================================================================
--- head/sys/dev/an/if_an_pci.c Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/an/if_an_pci.c Mon Mar 12 08:03:51 2012        (r232854)
@@ -195,7 +195,7 @@ an_attach_pci(dev)
                }
 
                /* Allocate DMA region */
-               error = bus_dma_tag_create(NULL,        /* parent */
+               error = bus_dma_tag_create(bus_get_dma_tag(dev),/* parent */
                               1, 0,                    /* alignment, bounds */
                               BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
                               BUS_SPACE_MAXADDR,       /* highaddr */

Modified: head/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- head/sys/dev/arcmsr/arcmsr.c        Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/arcmsr/arcmsr.c        Mon Mar 12 08:03:51 2012        
(r232854)
@@ -3486,7 +3486,7 @@ static u_int32_t arcmsr_initialize(devic
                        return ENOMEM;
                }
        }
-       if(bus_dma_tag_create(  /*parent*/              NULL,
+       if(bus_dma_tag_create(  /*PCI parent*/          bus_get_dma_tag(dev),
                                                        /*alignemnt*/   1,
                                                        /*boundary*/    0,
                                                        /*lowaddr*/             
BUS_SPACE_MAXADDR,

Modified: head/sys/dev/asr/asr.c
==============================================================================
--- head/sys/dev/asr/asr.c      Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/asr/asr.c      Mon Mar 12 08:03:51 2012        (r232854)
@@ -2328,7 +2328,7 @@ asr_alloc_dma(Asr_softc_t *sc)
 
        dev = sc->ha_dev;
 
-       if (bus_dma_tag_create(NULL,                    /* parent */
+       if (bus_dma_tag_create(bus_get_dma_tag(dev),    /* PCI parent */
                               1, 0,                    /* algnmnt, boundary */
                               BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
                               BUS_SPACE_MAXADDR,       /* highaddr */

Modified: head/sys/dev/buslogic/bt_pci.c
==============================================================================
--- head/sys/dev/buslogic/bt_pci.c      Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/buslogic/bt_pci.c      Mon Mar 12 08:03:51 2012        
(r232854)
@@ -173,7 +173,7 @@ bt_pci_attach(device_t dev)
 
        /* Allocate a dmatag for our CCB DMA maps */
        /* XXX Should be a child of the PCI bus dma tag */
-       if (bus_dma_tag_create( /* parent       */ NULL,
+       if (bus_dma_tag_create( /* PCI parent   */ bus_get_dma_tag(dev),
                                /* alignemnt    */ 1,
                                /* boundary     */ 0,
                                /* lowaddr      */ BUS_SPACE_MAXADDR_32BIT,

Modified: head/sys/dev/bxe/if_bxe.c
==============================================================================
--- head/sys/dev/bxe/if_bxe.c   Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/bxe/if_bxe.c   Mon Mar 12 08:03:51 2012        (r232854)
@@ -13582,7 +13582,8 @@ bxe_host_structures_alloc(device_t dev)
        /*
         * Allocate the parent bus DMA tag appropriate for PCI.
         */
-       rc = bus_dma_tag_create(NULL,   /* parent tag */
+       rc = bus_dma_tag_create(
+           bus_get_dma_tag(dev),       /* PCI parent tag */
            1,                          /* alignment for segs */
            BXE_DMA_BOUNDARY,           /* cannot cross */
            BUS_SPACE_MAXADDR,          /* restricted low */

Modified: head/sys/dev/ciss/ciss.c
==============================================================================
--- head/sys/dev/ciss/ciss.c    Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/ciss/ciss.c    Mon Mar 12 08:03:51 2012        (r232854)
@@ -796,7 +796,7 @@ setup:
      * Note that "simple" adapters can only address within a 32-bit
      * span.
      */
-    if (bus_dma_tag_create(NULL,                       /* parent */
+    if (bus_dma_tag_create(bus_get_dma_tag(sc->ciss_dev),/* PCI parent */
                           1, 0,                        /* alignment, boundary 
*/
                           BUS_SPACE_MAXADDR,           /* lowaddr */
                           BUS_SPACE_MAXADDR,           /* highaddr */

Modified: head/sys/dev/cxgb/cxgb_sge.c
==============================================================================
--- head/sys/dev/cxgb/cxgb_sge.c        Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/cxgb/cxgb_sge.c        Mon Mar 12 08:03:51 2012        
(r232854)
@@ -592,7 +592,7 @@ t3_sge_alloc(adapter_t *sc)
 {
 
        /* The parent tag. */
-       if (bus_dma_tag_create( NULL,                   /* parent */
+       if (bus_dma_tag_create( bus_get_dma_tag(sc->dev),/* PCI parent */
                                1, 0,                   /* algnmnt, boundary */
                                BUS_SPACE_MAXADDR,      /* lowaddr */
                                BUS_SPACE_MAXADDR,      /* highaddr */

Modified: head/sys/dev/dpt/dpt_pci.c
==============================================================================
--- head/sys/dev/dpt/dpt_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/dpt/dpt_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -133,7 +133,7 @@ dpt_pci_attach (device_t dev)
 
        /* Allocate a dmatag representing the capabilities of this attachment */
        /* XXX Should be a child of the PCI bus dma tag */
-       if (bus_dma_tag_create( /* parent    */ NULL,
+       if (bus_dma_tag_create( /* PCI parent */ bus_get_dma_tag(dev),
                                /* alignemnt */ 1,
                                /* boundary  */ 0,
                                /* lowaddr   */ BUS_SPACE_MAXADDR_32BIT,

Modified: head/sys/dev/hifn/hifn7751.c
==============================================================================
--- head/sys/dev/hifn/hifn7751.c        Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/hifn/hifn7751.c        Mon Mar 12 08:03:51 2012        
(r232854)
@@ -431,7 +431,7 @@ hifn_attach(device_t dev)
         * Setup the area where the Hifn DMA's descriptors
         * and associated data structures.
         */
-       if (bus_dma_tag_create(NULL,                    /* parent */
+       if (bus_dma_tag_create(bus_get_dma_tag(dev),    /* PCI parent */
                               1, 0,                    /* alignment,boundary */
                               BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
                               BUS_SPACE_MAXADDR,       /* highaddr */

Modified: head/sys/dev/hptiop/hptiop.c
==============================================================================
--- head/sys/dev/hptiop/hptiop.c        Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/hptiop/hptiop.c        Mon Mar 12 08:03:51 2012        
(r232854)
@@ -1358,7 +1358,7 @@ static int hptiop_attach(device_t dev)
        mtx_init(&hba->lock, "hptioplock", NULL, MTX_DEF);
 #endif
 
-       if (bus_dma_tag_create(NULL,/* parent */
+       if (bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */
                        1,  /* alignment */
                        0, /* boundary */
                        BUS_SPACE_MAXADDR,  /* lowaddr */

Modified: head/sys/dev/hptmv/entry.c
==============================================================================
--- head/sys/dev/hptmv/entry.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/hptmv/entry.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -1326,7 +1326,7 @@ init_adapter(IAL_ADAPTER_T *pAdapter)
        _vbus_p->OsExt = (void *)pAdapter; 
        pMvSataAdapter->IALData = pAdapter;
 
-       if (bus_dma_tag_create(NULL,/* parent */
+       if (bus_dma_tag_create(bus_get_dma_tag(pAdapter->hpt_dev),/* parent */
                        4,      /* alignment */
                        BUS_SPACE_MAXADDR_32BIT+1, /* boundary */
                        BUS_SPACE_MAXADDR,      /* lowaddr */

Modified: head/sys/dev/ida/ida_pci.c
==============================================================================
--- head/sys/dev/ida/ida_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/ida/ida_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -267,7 +267,7 @@ ida_pci_attach(device_t dev)
        }
 
        error = bus_dma_tag_create(
-               /* parent       */ NULL,
+               /* parent       */ bus_get_dma_tag(dev),
                /* alignment    */ 1,
                /* boundary     */ 0,
                /* lowaddr      */ BUS_SPACE_MAXADDR_32BIT,

Modified: head/sys/dev/if_ndis/if_ndis_pci.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis_pci.c  Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/if_ndis/if_ndis_pci.c  Mon Mar 12 08:03:51 2012        
(r232854)
@@ -290,7 +290,7 @@ ndis_attach_pci(dev)
         * Allocate the parent bus DMA tag appropriate for PCI.
         */
 #define NDIS_NSEG_NEW 32
-       error = bus_dma_tag_create(NULL,        /* parent */
+       error = bus_dma_tag_create(bus_get_dma_tag(dev),/* PCI parent */
                        1, 0,                   /* alignment, boundary */
                        BUS_SPACE_MAXADDR_32BIT,/* lowaddr */
                         BUS_SPACE_MAXADDR,     /* highaddr */

Modified: head/sys/dev/iir/iir_pci.c
==============================================================================
--- head/sys/dev/iir/iir_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/iir/iir_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -318,7 +318,8 @@ iir_pci_attach(device_t dev)
 
     /* Allocate a dmatag representing the capabilities of this attachment */
     /* XXX Should be a child of the PCI bus dma tag */
-    if (bus_dma_tag_create(/*parent*/NULL, /*alignemnt*/1, /*boundary*/0,
+    if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev),
+                           /*alignemnt*/1, /*boundary*/0,
                            /*lowaddr*/BUS_SPACE_MAXADDR_32BIT,
                            /*highaddr*/BUS_SPACE_MAXADDR,
                            /*filter*/NULL, /*filterarg*/NULL,

Modified: head/sys/dev/ips/ips_pci.c
==============================================================================
--- head/sys/dev/ips/ips_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/ips/ips_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -135,7 +135,7 @@ static int ips_pci_attach(device_t dev)
                 device_printf(dev, "irq setup failed\n");
                 goto error;
         }
-       if (bus_dma_tag_create( /* parent    */ NULL,
+       if (bus_dma_tag_create( /* PCI parent */bus_get_dma_tag(dev),
                                /* alignemnt */ 1,
                                /* boundary  */ 0,
                                /* lowaddr   */ BUS_SPACE_MAXADDR_32BIT,

Modified: head/sys/dev/mfi/mfi_pci.c
==============================================================================
--- head/sys/dev/mfi/mfi_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/mfi/mfi_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -216,7 +216,7 @@ mfi_pci_attach(device_t dev)
        error = ENOMEM;
 
        /* Allocate parent DMA tag */
-       if (bus_dma_tag_create( NULL,                   /* parent */
+       if (bus_dma_tag_create( bus_get_dma_tag(dev),   /* PCI parent */
                                1, 0,                   /* algnmnt, boundary */
                                BUS_SPACE_MAXADDR,      /* lowaddr */
                                BUS_SPACE_MAXADDR,      /* highaddr */

Modified: head/sys/dev/mlx/mlx_pci.c
==============================================================================
--- head/sys/dev/mlx/mlx_pci.c  Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/mlx/mlx_pci.c  Mon Mar 12 08:03:51 2012        (r232854)
@@ -189,7 +189,7 @@ mlx_pci_attach(device_t dev)
     /*
      * Allocate the parent bus DMA tag appropriate for PCI.
      */
-    error = bus_dma_tag_create(NULL,                   /* parent */
+    error = bus_dma_tag_create(bus_get_dma_tag(dev),   /* PCI parent */
                               1, 0,                    /* alignment, boundary 
*/
                               BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
                               BUS_SPACE_MAXADDR,       /* highaddr */

Modified: head/sys/dev/mly/mly.c
==============================================================================
--- head/sys/dev/mly/mly.c      Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/mly/mly.c      Mon Mar 12 08:03:51 2012        (r232854)
@@ -392,7 +392,7 @@ mly_pci_attach(struct mly_softc *sc)
      * 
      * Note that all of these controllers are 64-bit capable.
      */
-    if (bus_dma_tag_create(NULL,                       /* parent */
+    if (bus_dma_tag_create(bus_get_dma_tag(sc->mly_dev),/* PCI parent */
                           1, 0,                        /* alignment, boundary 
*/
                           BUS_SPACE_MAXADDR_32BIT,     /* lowaddr */
                           BUS_SPACE_MAXADDR,           /* highaddr */

Modified: head/sys/dev/twe/twe_freebsd.c
==============================================================================
--- head/sys/dev/twe/twe_freebsd.c      Mon Mar 12 07:34:15 2012        
(r232853)
+++ head/sys/dev/twe/twe_freebsd.c      Mon Mar 12 08:03:51 2012        
(r232854)
@@ -225,7 +225,7 @@ twe_attach(device_t dev)
     /*
      * Allocate the parent bus DMA tag appropriate for PCI.
      */
-    if (bus_dma_tag_create(NULL,                               /* parent */
+    if (bus_dma_tag_create(bus_get_dma_tag(dev),               /* PCI parent */
                           1, 0,                                /* alignment, 
boundary */
                           BUS_SPACE_MAXADDR_32BIT,             /* lowaddr */
                           BUS_SPACE_MAXADDR,                   /* highaddr */

Modified: head/sys/dev/tws/tws.c
==============================================================================
--- head/sys/dev/tws/tws.c      Mon Mar 12 07:34:15 2012        (r232853)
+++ head/sys/dev/tws/tws.c      Mon Mar 12 08:03:51 2012        (r232854)
@@ -521,7 +521,7 @@ tws_init(struct tws_softc *sc)
                                  TWS_MAX_32BIT_SG_ELEMENTS;
     dma_mem_size = (sizeof(struct tws_command_packet) * tws_queue_depth) +
                              (TWS_SECTOR_SIZE) ;
-    if ( bus_dma_tag_create(NULL,                    /* parent */          
+    if ( bus_dma_tag_create(bus_get_dma_tag(sc->tws_dev), /* PCI parent */ 
                             TWS_ALIGNMENT,           /* alignment */
                             0,                       /* boundary */
                             BUS_SPACE_MAXADDR_32BIT, /* lowaddr */
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to