Wed Feb 11 14:44:25 2009 UTC ()
Attach atphy(4) on ATTANSIC oui.
ok cube@


(cegger)
diff -r1.2 -r1.3 src/sys/dev/mii/atphy.c

cvs diff -r1.2 -r1.3 src/sys/dev/mii/atphy.c (expand / switch to unified diff)

--- src/sys/dev/mii/atphy.c 2009/01/16 21:50:02 1.2
+++ src/sys/dev/mii/atphy.c 2009/02/11 14:44:25 1.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: atphy.c,v 1.2 2009/01/16 21:50:02 cegger Exp $ */ 1/* $NetBSD: atphy.c,v 1.3 2009/02/11 14:44:25 cegger Exp $ */
2/* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ 2/* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org> 5 * Copyright (c) 2008, Pyun YongHyeon <yongari@FreeBSD.org>
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice unmodified, this list of conditions, and the following 12 * notice unmodified, this list of conditions, and the following
13 * disclaimer. 13 * disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * SUCH DAMAGE. 28 * SUCH DAMAGE.
29 */ 29 */
30 30
31/* 31/*
32 * Driver for the Attansic F1 10/100/1000 PHY. 32 * Driver for the Attansic F1 10/100/1000 PHY.
33 */ 33 */
34 34
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.2 2009/01/16 21:50:02 cegger Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.3 2009/02/11 14:44:25 cegger Exp $");
37 37
38#include <sys/param.h> 38#include <sys/param.h>
39#include <sys/systm.h> 39#include <sys/systm.h>
40#include <sys/kernel.h> 40#include <sys/kernel.h>
41#include <sys/device.h> 41#include <sys/device.h>
42#include <sys/socket.h> 42#include <sys/socket.h>
43 43
44#include <net/if.h> 44#include <net/if.h>
45#include <net/if_media.h> 45#include <net/if_media.h>
46 46
47#include <dev/mii/mii.h> 47#include <dev/mii/mii.h>
48#include <dev/mii/miivar.h> 48#include <dev/mii/miivar.h>
49#include <dev/mii/miidevs.h> 49#include <dev/mii/miidevs.h>
@@ -82,26 +82,28 @@ static void atphy_reset(struct mii_softc @@ -82,26 +82,28 @@ static void atphy_reset(struct mii_softc
82static void atphy_status(struct mii_softc *); 82static void atphy_status(struct mii_softc *);
83static int atphy_mii_phy_auto(struct mii_softc *); 83static int atphy_mii_phy_auto(struct mii_softc *);
84 84
85CFATTACH_DECL_NEW(atphy, sizeof(struct mii_softc), 85CFATTACH_DECL_NEW(atphy, sizeof(struct mii_softc),
86 atphy_match, atphy_attach, mii_phy_detach, mii_phy_activate); 86 atphy_match, atphy_attach, mii_phy_detach, mii_phy_activate);
87 87
88const struct mii_phy_funcs atphy_funcs = { 88const struct mii_phy_funcs atphy_funcs = {
89 atphy_service, atphy_status, atphy_reset, 89 atphy_service, atphy_status, atphy_reset,
90}; 90};
91 91
92static const struct mii_phydesc etphys[] = { 92static const struct mii_phydesc etphys[] = {
93 { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, 93 { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1,
94 MII_STR_ATHEROS_F1 }, 94 MII_STR_ATHEROS_F1 },
 95 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1,
 96 MII_STR_ATTANSIC_L1 },
95 { 0, 0, 97 { 0, 0,
96 NULL }, 98 NULL },
97}; 99};
98 100
99static int 101static int
100atphy_match(device_t parent, cfdata_t match, void *aux) 102atphy_match(device_t parent, cfdata_t match, void *aux)
101{ 103{
102 struct mii_attach_args *ma = aux; 104 struct mii_attach_args *ma = aux;
103 105
104 if (mii_phy_match(ma, etphys) != NULL) 106 if (mii_phy_match(ma, etphys) != NULL)
105 return 10; 107 return 10;
106 108
107 return 0; 109 return 0;