svn commit: r220702 - head/sys/dev/iwn

Bernhard Schmidt bschmidt at FreeBSD.org
Sat Apr 16 10:38:27 UTC 2011


Author: bschmidt
Date: Sat Apr 16 10:38:27 2011
New Revision: 220702
URL: http://svn.freebsd.org/changeset/base/220702

Log:
  Unify TX/RX ring allocation, finish the descriptior DMA stuff before
  starting with data.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Sat Apr 16 10:35:02 2011	(r220701)
+++ head/sys/dev/iwn/if_iwn.c	Sat Apr 16 10:38:27 2011	(r220702)
@@ -1250,23 +1250,24 @@ iwn_alloc_rx_ring(struct iwn_softc *sc, 
 		goto fail;
 	}
 
-	error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0,
-	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
-	    IWN_RBUF_SIZE, 1, IWN_RBUF_SIZE, BUS_DMA_NOWAIT, NULL, NULL,
-	    &ring->data_dmat);
+	/* Allocate RX status area (16-byte aligned). */
+	error = iwn_dma_contig_alloc(sc, &ring->stat_dma, (void **)&ring->stat,
+	    sizeof (struct iwn_rx_status), 16);
 	if (error != 0) {
 		device_printf(sc->sc_dev,
-		    "%s: bus_dma_tag_create_failed, error %d\n",
+		    "%s: could not allocate Rx status DMA memory, error %d\n",
 		    __func__, error);
 		goto fail;
 	}
 
-	/* Allocate RX status area (16-byte aligned). */
-	error = iwn_dma_contig_alloc(sc, &ring->stat_dma, (void **)&ring->stat,
-	    sizeof (struct iwn_rx_status), 16);
+	/* Create RX buffer DMA tag. */
+	error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0,
+	    BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
+	    IWN_RBUF_SIZE, 1, IWN_RBUF_SIZE, BUS_DMA_NOWAIT, NULL, NULL,
+	    &ring->data_dmat);
 	if (error != 0) {
 		device_printf(sc->sc_dev,
-		    "%s: could not allocate Rx status DMA memory, error %d\n",
+		    "%s: bus_dma_tag_create_failed, error %d\n",
 		    __func__, error);
 		goto fail;
 	}


More information about the svn-src-all mailing list