Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Nov 2005 05:29:48 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 87255 for review
Message-ID:  <200511260529.jAQ5TmWs039808@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=87255

Change 87255 by sam@sam_ebb on 2005/11/26 05:29:02

	use separate accounting for driver memory

Affected files ...

.. //depot/projects/wifi/sys/dev/ral/if_ral.c#12 edit

Differences ...

==== //depot/projects/wifi/sys/dev/ral/if_ral.c#12 (text+ko) ====

@@ -338,6 +338,8 @@
 	{ 161, 0x08808, 0x0242f, 0x00281 }
 };
 
+MALLOC_DEFINE(M_RALDEV, "raldev", "ral driver dma buffers");
+
 int
 ral_attach(device_t dev)
 {
@@ -655,7 +657,7 @@
 		goto fail;
 	}
 
-	ring->data = malloc(count * sizeof (struct ral_tx_data), M_DEVBUF,
+	ring->data = malloc(count * sizeof (struct ral_tx_data), M_RALDEV,
 	    M_NOWAIT | M_ZERO);
 	if (ring->data == NULL) {
 		device_printf(sc->sc_dev, "could not allocate soft data\n");
@@ -754,7 +756,7 @@
 				bus_dmamap_destroy(ring->data_dmat, data->map);
 		}
 
-		free(ring->data, M_DEVBUF);
+		free(ring->data, M_RALDEV);
 	}
 
 	if (ring->data_dmat != NULL)
@@ -795,7 +797,7 @@
 		goto fail;
 	}
 
-	ring->data = malloc(count * sizeof (struct ral_rx_data), M_DEVBUF,
+	ring->data = malloc(count * sizeof (struct ral_rx_data), M_RALDEV,
 	    M_NOWAIT | M_ZERO);
 	if (ring->data == NULL) {
 		device_printf(sc->sc_dev, "could not allocate soft data\n");
@@ -900,7 +902,7 @@
 				bus_dmamap_destroy(ring->data_dmat, data->map);
 		}
 
-		free(ring->data, M_DEVBUF);
+		free(ring->data, M_RALDEV);
 	}
 
 	if (ring->data_dmat != NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511260529.jAQ5TmWs039808>