Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Mar 2011 12:50:50 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r219994 - stable/8/sys/dev/ti
Message-ID:  <201103251250.p2PCoohT081735@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Fri Mar 25 12:50:50 2011
New Revision: 219994
URL: http://svn.freebsd.org/changeset/base/219994

Log:
  MFC: r219547
  
  - Allocate the DMA memory shared between the host and the controller as
    coherent.
  - Constify the ti_devs table.
  - Don't bother to set if_mtu to ETHERMTU, ether_ifattach() does that.

Modified:
  stable/8/sys/dev/ti/if_ti.c
  stable/8/sys/dev/ti/if_tireg.h
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)

Modified: stable/8/sys/dev/ti/if_ti.c
==============================================================================
--- stable/8/sys/dev/ti/if_ti.c	Fri Mar 25 12:48:56 2011	(r219993)
+++ stable/8/sys/dev/ti/if_ti.c	Fri Mar 25 12:50:50 2011	(r219994)
@@ -145,7 +145,7 @@ typedef enum {
  * Various supported device vendors/types and their names.
  */
 
-static struct ti_type ti_devs[] = {
+static const struct ti_type const ti_devs[] = {
 	{ ALT_VENDORID,	ALT_DEVICEID_ACENIC,
 		"Alteon AceNIC 1000baseSX Gigabit Ethernet" },
 	{ ALT_VENDORID,	ALT_DEVICEID_ACENIC_COPPER,
@@ -1118,7 +1118,8 @@ ti_alloc_jumbo_mem(sc)
 
 	if (bus_dmamem_alloc(sc->ti_jumbo_dmat,
 			     (void**)&sc->ti_cdata.ti_jumbo_buf,
-			     BUS_DMA_NOWAIT, &sc->ti_jumbo_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &sc->ti_jumbo_dmamap) != 0) {
 		device_printf(sc->ti_dev, "Failed to allocate jumbo memory\n");
 		return (ENOBUFS);
 	}
@@ -2254,7 +2255,7 @@ static int
 ti_probe(dev)
 	device_t		dev;
 {
-	struct ti_type		*t;
+	const struct ti_type	*t;
 
 	t = ti_devs;
 
@@ -2390,7 +2391,8 @@ ti_attach(dev)
 	}
 
 	if (bus_dmamem_alloc(sc->ti_rdata_dmat, (void**)&sc->ti_rdata,
-			     BUS_DMA_NOWAIT, &sc->ti_rdata_dmamap) != 0) {
+			     BUS_DMA_NOWAIT | BUS_DMA_COHERENT,
+			     &sc->ti_rdata_dmamap) != 0) {
 		device_printf(dev, "Failed to allocate rdata memory\n");
 		error = ENOMEM;
 		goto fail;
@@ -2489,7 +2491,6 @@ ti_attach(dev)
 	ifp->if_watchdog = ti_watchdog;
 	ifp->if_init = ti_init;
 	ifp->if_baudrate = 1000000000;
-	ifp->if_mtu = ETHERMTU;
 	ifp->if_snd.ifq_maxlen = TI_TX_RING_CNT - 1;
 
 	/* Set up ifmedia support. */

Modified: stable/8/sys/dev/ti/if_tireg.h
==============================================================================
--- stable/8/sys/dev/ti/if_tireg.h	Fri Mar 25 12:48:56 2011	(r219993)
+++ stable/8/sys/dev/ti/if_tireg.h	Fri Mar 25 12:50:50 2011	(r219994)
@@ -967,7 +967,7 @@ struct ti_chain_data {
 struct ti_type {
 	u_int16_t		ti_vid;
 	u_int16_t		ti_did;
-	char			*ti_name;
+	const char		*ti_name;
 };
 
 #define TI_HWREV_TIGON		0x01



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