Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jul 2013 01:34:25 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r253406 - head/sys/dev/ae
Message-ID:  <201307170134.r6H1YP18077958@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Wed Jul 17 01:34:25 2013
New Revision: 253406
URL: http://svnweb.freebsd.org/changeset/base/253406

Log:
  Avoid magic constant.
  No functional change.

Modified:
  head/sys/dev/ae/if_ae.c
  head/sys/dev/ae/if_aereg.h

Modified: head/sys/dev/ae/if_ae.c
==============================================================================
--- head/sys/dev/ae/if_ae.c	Wed Jul 17 01:32:29 2013	(r253405)
+++ head/sys/dev/ae/if_ae.c	Wed Jul 17 01:34:25 2013	(r253406)
@@ -585,7 +585,7 @@ ae_init_locked(ae_softc_t *sc)
 	val = eaddr[0] << 8 | eaddr[1];
 	AE_WRITE_4(sc, AE_EADDR1_REG, val);
 
-	bzero(sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + 120);
+	bzero(sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING);
 	bzero(sc->txd_base, AE_TXD_BUFSIZE_DEFAULT);
 	bzero(sc->txs_base, AE_TXS_COUNT_DEFAULT * 4);
 	/*
@@ -1145,8 +1145,8 @@ ae_alloc_rings(ae_softc_t *sc)
 	 */
 	error = bus_dma_tag_create(sc->dma_parent_tag,
 	    128, 0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
-	    NULL, NULL, AE_RXD_COUNT_DEFAULT * 1536 + 120, 1,
-	    AE_RXD_COUNT_DEFAULT * 1536 + 120, 0, NULL, NULL,
+	    NULL, NULL, AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING, 1,
+	    AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING, 0, NULL, NULL,
 	    &sc->dma_rxd_tag);
 	if (error != 0) {
 		device_printf(sc->dev, "could not creare TxS DMA tag.\n");
@@ -1205,15 +1205,15 @@ ae_alloc_rings(ae_softc_t *sc)
 		return (error);
 	}
 	error = bus_dmamap_load(sc->dma_rxd_tag, sc->dma_rxd_map,
-	    sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + 120, ae_dmamap_cb,
-	    &busaddr, BUS_DMA_NOWAIT);
+	    sc->rxd_base_dma, AE_RXD_COUNT_DEFAULT * 1536 + AE_RXD_PADDING,
+	    ae_dmamap_cb, &busaddr, BUS_DMA_NOWAIT);
 	if (error != 0 || busaddr == 0) {
 		device_printf(sc->dev,
 		    "could not load DMA map for RxD ring.\n");
 		return (error);
 	}
-	sc->dma_rxd_busaddr = busaddr + 120;
-	sc->rxd_base = (ae_rxd_t *)(sc->rxd_base_dma + 120);
+	sc->dma_rxd_busaddr = busaddr + AE_RXD_PADDING;
+	sc->rxd_base = (ae_rxd_t *)(sc->rxd_base_dma + AE_RXD_PADDING);
 
 	return (0);
 }

Modified: head/sys/dev/ae/if_aereg.h
==============================================================================
--- head/sys/dev/ae/if_aereg.h	Wed Jul 17 01:32:29 2013	(r253405)
+++ head/sys/dev/ae/if_aereg.h	Wed Jul 17 01:34:25 2013	(r253406)
@@ -104,6 +104,8 @@
 #define	AE_RXD_COUNT_MIN	16
 #define	AE_RXD_COUNT_MAX	512
 #define	AE_RXD_COUNT_DEFAULT	64
+/* Padding to align frames on a 128-byte boundary. */
+#define	AE_RXD_PADDING		120
 
 #define	AE_TXD_BUFSIZE_MIN	4096
 #define	AE_TXD_BUFSIZE_MAX	65536



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