Date: Wed, 17 Mar 2010 17:42:43 GMT From: Rafal Jaworowski <raj@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 175768 for review Message-ID: <201003171742.o2HHgh3U060812@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=175768 Change 175768 by raj@raj_fdt on 2010/03/17 17:42:16 Teach tsec(4) to obtain its PHY address from the device tree. Affected files ... .. //depot/projects/fdt/sys/dev/tsec/if_tsec.c#3 edit .. //depot/projects/fdt/sys/dev/tsec/if_tsec.h#3 edit .. //depot/projects/fdt/sys/dev/tsec/if_tsec_fdt.c#3 edit Differences ... ==== //depot/projects/fdt/sys/dev/tsec/if_tsec.c#3 (text+ko) ==== @@ -1563,7 +1563,7 @@ sc = device_get_softc(dev); - if (device_get_unit(dev) != phy) + if (sc->phyaddr != phy) return (0); sc = tsec0_sc; @@ -1591,9 +1591,8 @@ sc = device_get_softc(dev); - if (device_get_unit(dev) != phy) - device_printf(dev, "Trying to write to an alien PHY(%d)\n", - phy); + if (sc->phyaddr != phy) + return (0); sc = tsec0_sc; ==== //depot/projects/fdt/sys/dev/tsec/if_tsec.h#3 (text+ko) ==== @@ -131,6 +131,8 @@ /* currently received frame */ struct mbuf *frame; + + int phyaddr; }; /* interface to get/put generic objects */ ==== //depot/projects/fdt/sys/dev/tsec/if_tsec_fdt.c#3 (text+ko) ==== @@ -50,6 +50,7 @@ #include <net/if_media.h> #include <net/if_arp.h> +#include <dev/fdt/fdt_common.h> #include <dev/mii/mii.h> #include <dev/mii/miivar.h> #include <dev/ofw/ofw_bus.h> @@ -160,6 +161,10 @@ if (device_get_unit(dev) == 0) tsec0_sc = sc; + /* Get phy address from fdt */ + if (fdt_get_phyaddr(sc->node, &sc->phyaddr) != 0) + return (ENXIO); + /* Init timer */ callout_init(&sc->tsec_callout, 1);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003171742.o2HHgh3U060812>