Tue Apr 14 17:57:17 2020 UTC ()
Pull up the following revisions, requested by msaitoh in ticket #1529:

	sys/dev/mii/miidevs				1.154, 1.162-1.167
	sys/dev/mii/atphy.c				1.28 via patch
	sys/dev/mii/brgphy.c				1.87 via patch
	sys/dev/mii/etphy.c				1.5, 1.6 via patch
	sys/dev/mii/rdcphy.c				1.6, 1.8 via patch

- Add support Broadcom BCM54213PE and some new RDC devices.
- Rename RDC to xxRDC.
- Use xxVIA instead of VIA.
- etphy(4):
  - Rename ET1011 to ET1011C and add ET1011 support.
  - Use mii_phy_flowstatus() to reflect flow status from negotiated
    result.
- Use static.
- KNF.


(martin)
diff -r1.18.8.1 -r1.18.8.2 src/sys/dev/mii/atphy.c
diff -r1.76.20.2 -r1.76.20.3 src/sys/dev/mii/brgphy.c
diff -r1.1 -r1.1.54.1 src/sys/dev/mii/etphy.c
diff -r1.1 -r1.1.54.1 src/sys/dev/mii/rdcphy.c
diff -r1.125.6.8 -r1.125.6.9 src/sys/dev/mii/miidevs

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

--- src/sys/dev/mii/atphy.c 2019/11/21 14:06:16 1.18.8.1
+++ src/sys/dev/mii/atphy.c 2020/04/14 17:57:17 1.18.8.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: atphy.c,v 1.18.8.1 2019/11/21 14:06:16 martin Exp $ */ 1/* $NetBSD: atphy.c,v 1.18.8.2 2020/04/14 17:57:17 martin 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.18.8.1 2019/11/21 14:06:16 martin Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.18.8.2 2020/04/14 17:57:17 martin 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>
@@ -81,28 +81,26 @@ static int atphy_service(struct mii_soft @@ -81,28 +81,26 @@ static int atphy_service(struct mii_soft
81static void atphy_reset(struct mii_softc *); 81static 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 *);
84static bool atphy_is_gige(const struct mii_phydesc *); 84static bool atphy_is_gige(const struct mii_phydesc *);
85 85
86CFATTACH_DECL_NEW(atphy, sizeof(struct mii_softc), 86CFATTACH_DECL_NEW(atphy, sizeof(struct mii_softc),
87 atphy_match, atphy_attach, mii_phy_detach, mii_phy_activate); 87 atphy_match, atphy_attach, mii_phy_detach, mii_phy_activate);
88 88
89const struct mii_phy_funcs atphy_funcs = { 89const struct mii_phy_funcs atphy_funcs = {
90 atphy_service, atphy_status, atphy_reset, 90 atphy_service, atphy_status, atphy_reset,
91}; 91};
92 92
93static const struct mii_phydesc atphys[] = { 93static const struct mii_phydesc atphys[] = {
94 { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, 
95 MII_STR_ATHEROS_F1 }, 
96 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1, 94 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1,
97 MII_STR_ATTANSIC_L1 }, 95 MII_STR_ATTANSIC_L1 },
98 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L2, 96 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L2,
99 MII_STR_ATTANSIC_L2 }, 97 MII_STR_ATTANSIC_L2 },
100 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8021, 98 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8021,
101 MII_STR_ATTANSIC_AR8021 }, 99 MII_STR_ATTANSIC_AR8021 },
102 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8035, 100 { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8035,
103 MII_STR_ATTANSIC_AR8035 }, 101 MII_STR_ATTANSIC_AR8035 },
104 { 0, 0, 102 { 0, 0,
105 NULL }, 103 NULL },
106}; 104};
107 105
108static bool 106static bool

cvs diff -r1.76.20.2 -r1.76.20.3 src/sys/dev/mii/brgphy.c (expand / switch to unified diff)

--- src/sys/dev/mii/brgphy.c 2019/05/13 12:40:13 1.76.20.2
+++ src/sys/dev/mii/brgphy.c 2020/04/14 17:57:17 1.76.20.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: brgphy.c,v 1.76.20.2 2019/05/13 12:40:13 martin Exp $ */ 1/* $NetBSD: brgphy.c,v 1.76.20.3 2020/04/14 17:57:17 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -52,27 +52,27 @@ @@ -52,27 +52,27 @@
52 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 52 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
53 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 53 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
54 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 54 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
55 */ 55 */
56 56
57/* 57/*
58 * driver for the Broadcom BCM5400 and BCM5700 Gig-E PHYs. 58 * driver for the Broadcom BCM5400 and BCM5700 Gig-E PHYs.
59 * 59 *
60 * Programming information for this PHY was gleaned from FreeBSD 60 * Programming information for this PHY was gleaned from FreeBSD
61 * (they were apparently able to get a datasheet from Broadcom). 61 * (they were apparently able to get a datasheet from Broadcom).
62 */ 62 */
63 63
64#include <sys/cdefs.h> 64#include <sys/cdefs.h>
65__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.76.20.2 2019/05/13 12:40:13 martin Exp $"); 65__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.76.20.3 2020/04/14 17:57:17 martin Exp $");
66 66
67#include <sys/param.h> 67#include <sys/param.h>
68#include <sys/systm.h> 68#include <sys/systm.h>
69#include <sys/kernel.h> 69#include <sys/kernel.h>
70#include <sys/device.h> 70#include <sys/device.h>
71#include <sys/socket.h> 71#include <sys/socket.h>
72#include <sys/errno.h> 72#include <sys/errno.h>
73#include <prop/proplib.h> 73#include <prop/proplib.h>
74 74
75#include <net/if.h> 75#include <net/if.h>
76#include <net/if_media.h> 76#include <net/if_media.h>
77 77
78#include <dev/mii/mii.h> 78#include <dev/mii/mii.h>
@@ -236,26 +236,29 @@ static const struct mii_phydesc brgphys[ @@ -236,26 +236,29 @@ static const struct mii_phydesc brgphys[
236 236
237 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5719C, 237 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5719C,
238 MII_STR_BROADCOM3_BCM5719C }, 238 MII_STR_BROADCOM3_BCM5719C },
239 239
240 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C, 240 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C,
241 MII_STR_BROADCOM3_BCM5720C }, 241 MII_STR_BROADCOM3_BCM5720C },
242 242
243 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765, 243 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765,
244 MII_STR_BROADCOM3_BCM57765 }, 244 MII_STR_BROADCOM3_BCM57765 },
245 245
246 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57780, 246 { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57780,
247 MII_STR_BROADCOM3_BCM57780 }, 247 MII_STR_BROADCOM3_BCM57780 },
248 248
 249 { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM54213PE,
 250 MII_STR_BROADCOM4_BCM54213PE },
 251
249 { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM5725C, 252 { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM5725C,
250 MII_STR_BROADCOM4_BCM5725C }, 253 MII_STR_BROADCOM4_BCM5725C },
251 254
252 { MII_OUI_xxBROADCOM_ALT1, MII_MODEL_xxBROADCOM_ALT1_BCM5906, 255 { MII_OUI_xxBROADCOM_ALT1, MII_MODEL_xxBROADCOM_ALT1_BCM5906,
253 MII_STR_xxBROADCOM_ALT1_BCM5906 }, 256 MII_STR_xxBROADCOM_ALT1_BCM5906 },
254 257
255 { 0, 0, 258 { 0, 0,
256 NULL }, 259 NULL },
257}; 260};
258 261
259static int 262static int
260brgphymatch(device_t parent, cfdata_t match, void *aux) 263brgphymatch(device_t parent, cfdata_t match, void *aux)
261{ 264{

cvs diff -r1.1 -r1.1.54.1 src/sys/dev/mii/etphy.c (expand / switch to unified diff)

--- src/sys/dev/mii/etphy.c 2010/11/13 00:47:24 1.1
+++ src/sys/dev/mii/etphy.c 2020/04/14 17:57:17 1.1.54.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: etphy.c,v 1.1 2010/11/13 00:47:24 jnemeth Exp $ */ 1/* $NetBSD: etphy.c,v 1.1.54.1 2020/04/14 17:57:17 martin Exp $ */
2/* $OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $ */ 2/* $OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $ */
3 3
4/* 4/*
5 * Copyright (c) 2007 The DragonFly Project. All rights reserved. 5 * Copyright (c) 2007 The DragonFly Project. All rights reserved.
6 *  6 *
7 * This code is derived from software contributed to The DragonFly Project 7 * This code is derived from software contributed to The DragonFly Project
8 * by Sepherosa Ziehau <sepherosa@gmail.com> 8 * by Sepherosa Ziehau <sepherosa@gmail.com>
9 *  9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 *  13 *
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -28,27 +28,27 @@ @@ -28,27 +28,27 @@
28 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, 29 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 31 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
32 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
34 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE. 35 * SUCH DAMAGE.
36 *  36 *
37 * $DragonFly: src/sys/dev/netif/mii_layer/truephy.c,v 1.1 2007/10/12 14:12:42 sephe Exp $ 37 * $DragonFly: src/sys/dev/netif/mii_layer/truephy.c,v 1.1 2007/10/12 14:12:42 sephe Exp $
38 */ 38 */
39 39
40#include <sys/cdefs.h> 40#include <sys/cdefs.h>
41__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.1 2010/11/13 00:47:24 jnemeth Exp $"); 41__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.1.54.1 2020/04/14 17:57:17 martin Exp $");
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/socket.h> 47#include <sys/socket.h>
48 48
49#include <net/if.h> 49#include <net/if.h>
50#include <net/if_media.h> 50#include <net/if_media.h>
51 51
52#include <dev/mii/mii.h> 52#include <dev/mii/mii.h>
53#include <dev/mii/miivar.h> 53#include <dev/mii/miivar.h>
54#include <dev/mii/miidevs.h> 54#include <dev/mii/miidevs.h>
@@ -67,39 +67,41 @@ __KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1. @@ -67,39 +67,41 @@ __KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.
67#define ETPHY_CONF_TXFIFO_8 0x0000 67#define ETPHY_CONF_TXFIFO_8 0x0000
68#define ETPHY_CONF_TXFIFO_16 0x1000 68#define ETPHY_CONF_TXFIFO_16 0x1000
69#define ETPHY_CONF_TXFIFO_24 0x2000 69#define ETPHY_CONF_TXFIFO_24 0x2000
70#define ETPHY_CONF_TXFIFO_32 0x3000 70#define ETPHY_CONF_TXFIFO_32 0x3000
71 71
72#define ETPHY_SR 0x1a 72#define ETPHY_SR 0x1a
73#define ETPHY_SR_SPD_MASK 0x0300 73#define ETPHY_SR_SPD_MASK 0x0300
74#define ETPHY_SR_SPD_1000T 0x0200 74#define ETPHY_SR_SPD_1000T 0x0200
75#define ETPHY_SR_SPD_100TX 0x0100 75#define ETPHY_SR_SPD_100TX 0x0100
76#define ETPHY_SR_SPD_10T 0x0000 76#define ETPHY_SR_SPD_10T 0x0000
77#define ETPHY_SR_FDX 0x0080 77#define ETPHY_SR_FDX 0x0080
78 78
79 79
80int etphy_service(struct mii_softc *, struct mii_data *, int); 80static int etphy_service(struct mii_softc *, struct mii_data *, int);
81void etphy_attach(device_t, device_t, void *); 81static void etphy_attach(device_t, device_t, void *);
82int etphy_match(device_t, cfdata_t, void *); 82static int etphy_match(device_t, cfdata_t, void *);
83void etphy_reset(struct mii_softc *); 83static void etphy_reset(struct mii_softc *);
84void etphy_status(struct mii_softc *); 84static void etphy_status(struct mii_softc *);
85 85
86const struct mii_phy_funcs etphy_funcs = { 86static const struct mii_phy_funcs etphy_funcs = {
87 etphy_service, etphy_status, etphy_reset, 87 etphy_service, etphy_status, etphy_reset,
88}; 88};
89 89
90static const struct mii_phydesc etphys[] = { 90static const struct mii_phydesc etphys[] = {
91 { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, 91 { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011,
92 MII_STR_AGERE_ET1011 }, 92 MII_STR_AGERE_ET1011 },
 93 { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011C,
 94 MII_STR_AGERE_ET1011C },
93 { 0, 0, 95 { 0, 0,
94 NULL }, 96 NULL },
95}; 97};
96 98
97CFATTACH_DECL_NEW(etphy, sizeof(struct mii_softc), 99CFATTACH_DECL_NEW(etphy, sizeof(struct mii_softc),
98 etphy_match, etphy_attach, mii_phy_detach, mii_phy_activate); 100 etphy_match, etphy_attach, mii_phy_detach, mii_phy_activate);
99 101
100static const struct etphy_dsp { 102static const struct etphy_dsp {
101 uint16_t index; 103 uint16_t index;
102 uint16_t data; 104 uint16_t data;
103} etphy_dspcode[] = { 105} etphy_dspcode[] = {
104 { 0x880b, 0x0926 }, /* AfeIfCreg4B1000Msbs */ 106 { 0x880b, 0x0926 }, /* AfeIfCreg4B1000Msbs */
105 { 0x880c, 0x0926 }, /* AfeIfCreg4B100Msbs */ 107 { 0x880c, 0x0926 }, /* AfeIfCreg4B100Msbs */
@@ -125,38 +127,38 @@ static const struct etphy_dsp { @@ -125,38 +127,38 @@ static const struct etphy_dsp {
125 127
126 { 0x3821, 6 }, /* FfeLkgTx0 */ 128 { 0x3821, 6 }, /* FfeLkgTx0 */
127 { 0x381d, 1 }, /* FfeLkg1g4 */ 129 { 0x381d, 1 }, /* FfeLkg1g4 */
128 { 0x381e, 1 }, /* FfeLkg1g5 */ 130 { 0x381e, 1 }, /* FfeLkg1g5 */
129 { 0x381f, 1 }, /* FfeLkg1g6 */ 131 { 0x381f, 1 }, /* FfeLkg1g6 */
130 { 0x3820, 1 }, /* FfeLkg1g7 */ 132 { 0x3820, 1 }, /* FfeLkg1g7 */
131 133
132 { 0x8402, 0x01f0 }, /* Btinact */ 134 { 0x8402, 0x01f0 }, /* Btinact */
133 { 0x800e, 20 }, /* LftrainTime */ 135 { 0x800e, 20 }, /* LftrainTime */
134 { 0x800f, 24 }, /* DvguardTime */ 136 { 0x800f, 24 }, /* DvguardTime */
135 { 0x8010, 46 } /* IdlguardTime */ 137 { 0x8010, 46 } /* IdlguardTime */
136}; 138};
137 139
138int 140static int
139etphy_match(device_t parent, cfdata_t match, void *aux) 141etphy_match(device_t parent, cfdata_t match, void *aux)
140{ 142{
141 struct mii_attach_args *ma = aux; 143 struct mii_attach_args *ma = aux;
142 144
143 if (mii_phy_match(ma, etphys) != NULL) 145 if (mii_phy_match(ma, etphys) != NULL)
144 return 10; 146 return 10;
145 147
146 return 0; 148 return 0;
147} 149}
148 150
149void 151static void
150etphy_attach(device_t parent, device_t self, void *aux) 152etphy_attach(device_t parent, device_t self, void *aux)
151{ 153{
152 struct mii_softc *sc = device_private(self); 154 struct mii_softc *sc = device_private(self);
153 struct mii_attach_args *ma = aux; 155 struct mii_attach_args *ma = aux;
154 struct mii_data *mii = ma->mii_data; 156 struct mii_data *mii = ma->mii_data;
155 const struct mii_phydesc *mpd; 157 const struct mii_phydesc *mpd;
156 158
157 mpd = mii_phy_match(ma, etphys); 159 mpd = mii_phy_match(ma, etphys);
158 aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2)); 160 aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2));
159 161
160 sc->mii_dev = self; 162 sc->mii_dev = self;
161 sc->mii_inst = mii->mii_instance; 163 sc->mii_inst = mii->mii_instance;
162 sc->mii_phy = ma->mii_phyno; 164 sc->mii_phy = ma->mii_phyno;
@@ -176,27 +178,27 @@ etphy_attach(device_t parent, device_t s @@ -176,27 +178,27 @@ etphy_attach(device_t parent, device_t s
176 sc->mii_extcapabilities &= ~EXTSR_1000THDX; 178 sc->mii_extcapabilities &= ~EXTSR_1000THDX;
177 } 179 }
178 aprint_normal_dev(self, ""); 180 aprint_normal_dev(self, "");
179 if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) 181 if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0)
180 aprint_error("no media present"); 182 aprint_error("no media present");
181 else 183 else
182 mii_phy_add_media(sc); 184 mii_phy_add_media(sc);
183 aprint_normal("\n"); 185 aprint_normal("\n");
184 186
185 if (!pmf_device_register(self, NULL, mii_phy_resume)) 187 if (!pmf_device_register(self, NULL, mii_phy_resume))
186 aprint_error_dev(self, "couldn't establish power handler\n"); 188 aprint_error_dev(self, "couldn't establish power handler\n");
187} 189}
188 190
189int 191static int
190etphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) 192etphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
191{ 193{
192 struct ifmedia_entry *ife = mii->mii_media.ifm_cur; 194 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
193 int bmcr; 195 int bmcr;
194 196
195 switch (cmd) { 197 switch (cmd) {
196 case MII_POLLSTAT: 198 case MII_POLLSTAT:
197 /* 199 /*
198 * If we're not polling our PHY instance, just return. 200 * If we're not polling our PHY instance, just return.
199 */ 201 */
200 if (IFM_INST(ife->ifm_media) != sc->mii_inst) 202 if (IFM_INST(ife->ifm_media) != sc->mii_inst)
201 return 0; 203 return 0;
202 break; 204 break;
@@ -222,63 +224,67 @@ etphy_service(struct mii_softc *sc, stru @@ -222,63 +224,67 @@ etphy_service(struct mii_softc *sc, stru
222 bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_AUTOEN; 224 bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_AUTOEN;
223 PHY_WRITE(sc, MII_BMCR, bmcr); 225 PHY_WRITE(sc, MII_BMCR, bmcr);
224 PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_PDOWN); 226 PHY_WRITE(sc, MII_BMCR, bmcr | BMCR_PDOWN);
225 } 227 }
226 228
227 mii_phy_setmedia(sc); 229 mii_phy_setmedia(sc);
228 230
229 if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) { 231 if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
230 bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_PDOWN; 232 bmcr = PHY_READ(sc, MII_BMCR) & ~BMCR_PDOWN;
231 PHY_WRITE(sc, MII_BMCR, bmcr); 233 PHY_WRITE(sc, MII_BMCR, bmcr);
232 234
233 if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) { 235 if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
234 PHY_WRITE(sc, MII_BMCR, 236 PHY_WRITE(sc, MII_BMCR,
235 bmcr | BMCR_AUTOEN | BMCR_STARTNEG); 237 bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
236 } 238 }
237 } 239 }
238 break; 240 break;
239 241
240 case MII_TICK: 242 case MII_TICK:
241 /* 243 /*
242 * If we're not currently selected, just return. 244 * If we're not currently selected, just return.
243 */ 245 */
244 if (IFM_INST(ife->ifm_media) != sc->mii_inst) 246 if (IFM_INST(ife->ifm_media) != sc->mii_inst)
245 return 0; 247 return 0;
246 248
247 if (mii_phy_tick(sc) == EJUSTRETURN) 249 if (mii_phy_tick(sc) == EJUSTRETURN)
248 return 0; 250 return 0;
249 break; 251 break;
250 } 252 }
251 253
252 /* Update the media status. */ 254 /* Update the media status. */
253 mii_phy_status(sc); 255 mii_phy_status(sc);
254 256
255 /* Callback if something changed. */ 257 /* Callback if something changed. */
256 mii_phy_update(sc, cmd); 258 mii_phy_update(sc, cmd);
257 return 0; 259 return 0;
258} 260}
259 261
260void 262static void
261etphy_reset(struct mii_softc *sc) 263etphy_reset(struct mii_softc *sc)
262{ 264{
263 int i; 265 int i;
264 266
 267 if (sc->mii_mpd_model == MII_MODEL_AGERE_ET1011) {
 268 mii_phy_reset(sc);
 269 return;
 270 }
 271
265 for (i = 0; i < 2; ++i) { 272 for (i = 0; i < 2; ++i) {
266 PHY_READ(sc, MII_PHYIDR1); 273 PHY_READ(sc, MII_PHYIDR1);
267 PHY_READ(sc, MII_PHYIDR2); 274 PHY_READ(sc, MII_PHYIDR2);
268 275
269 PHY_READ(sc, ETPHY_CTRL); 276 PHY_READ(sc, ETPHY_CTRL);
270 PHY_WRITE(sc, ETPHY_CTRL, 277 PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1);
271 ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1); 
272 278
273 PHY_WRITE(sc, ETPHY_INDEX, ETPHY_INDEX_MAGIC); 279 PHY_WRITE(sc, ETPHY_INDEX, ETPHY_INDEX_MAGIC);
274 PHY_READ(sc, ETPHY_DATA); 280 PHY_READ(sc, ETPHY_DATA);
275 281
276 PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1); 282 PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1);
277 } 283 }
278 284
279 PHY_READ(sc, MII_BMCR); 285 PHY_READ(sc, MII_BMCR);
280 PHY_READ(sc, ETPHY_CTRL); 286 PHY_READ(sc, ETPHY_CTRL);
281 PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_PDOWN | BMCR_S1000); 287 PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_PDOWN | BMCR_S1000);
282 PHY_WRITE(sc, ETPHY_CTRL, 288 PHY_WRITE(sc, ETPHY_CTRL,
283 ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1 | ETPHY_CTRL_RSV0); 289 ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1 | ETPHY_CTRL_RSV0);
284 290
@@ -288,33 +294,33 @@ etphy_reset(struct mii_softc *sc) @@ -288,33 +294,33 @@ etphy_reset(struct mii_softc *sc)
288 const struct etphy_dsp *dsp = &etphy_dspcode[i]; 294 const struct etphy_dsp *dsp = &etphy_dspcode[i];
289 295
290 PHY_WRITE(sc, ETPHY_INDEX, dsp->index); 296 PHY_WRITE(sc, ETPHY_INDEX, dsp->index);
291 PHY_WRITE(sc, ETPHY_DATA, dsp->data); 297 PHY_WRITE(sc, ETPHY_DATA, dsp->data);
292 298
293 PHY_WRITE(sc, ETPHY_INDEX, dsp->index); 299 PHY_WRITE(sc, ETPHY_INDEX, dsp->index);
294 PHY_READ(sc, ETPHY_DATA); 300 PHY_READ(sc, ETPHY_DATA);
295 } 301 }
296 302
297#undef N 303#undef N
298 304
299 PHY_READ(sc, MII_BMCR); 305 PHY_READ(sc, MII_BMCR);
300 PHY_READ(sc, ETPHY_CTRL); 306 PHY_READ(sc, ETPHY_CTRL);
301 PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000); 307 PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000);
302 PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1); 308 PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1);
303 309
304 mii_phy_reset(sc); 310 mii_phy_reset(sc);
305} 311}
306 312
307void 313static void
308etphy_status(struct mii_softc *sc) 314etphy_status(struct mii_softc *sc)
309{ 315{
310 struct mii_data *mii = sc->mii_pdata; 316 struct mii_data *mii = sc->mii_pdata;
311 int bmsr, bmcr, sr; 317 int bmsr, bmcr, sr;
312 318
313 mii->mii_media_status = IFM_AVALID; 319 mii->mii_media_status = IFM_AVALID;
314 mii->mii_media_active = IFM_ETHER; 320 mii->mii_media_active = IFM_ETHER;
315 321
316 sr = PHY_READ(sc, ETPHY_SR); 322 sr = PHY_READ(sc, ETPHY_SR);
317 bmcr = PHY_READ(sc, MII_BMCR); 323 bmcr = PHY_READ(sc, MII_BMCR);
318 324
319 bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR); 325 bmsr = PHY_READ(sc, MII_BMSR) | PHY_READ(sc, MII_BMSR);
320 if (bmsr & BMSR_LINK) 326 if (bmsr & BMSR_LINK)
@@ -333,17 +339,17 @@ etphy_status(struct mii_softc *sc) @@ -333,17 +339,17 @@ etphy_status(struct mii_softc *sc)
333 break; 339 break;
334 case ETPHY_SR_SPD_100TX: 340 case ETPHY_SR_SPD_100TX:
335 mii->mii_media_active |= IFM_100_TX; 341 mii->mii_media_active |= IFM_100_TX;
336 break; 342 break;
337 case ETPHY_SR_SPD_10T: 343 case ETPHY_SR_SPD_10T:
338 mii->mii_media_active |= IFM_10_T; 344 mii->mii_media_active |= IFM_10_T;
339 break; 345 break;
340 default: 346 default:
341 mii->mii_media_active |= IFM_NONE; 347 mii->mii_media_active |= IFM_NONE;
342 return; 348 return;
343 } 349 }
344 350
345 if (sr & ETPHY_SR_FDX) 351 if (sr & ETPHY_SR_FDX)
346 mii->mii_media_active |= IFM_FDX; 352 mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
347 else 353 else
348 mii->mii_media_active |= IFM_HDX; 354 mii->mii_media_active |= IFM_HDX;
349} 355}

cvs diff -r1.1 -r1.1.54.1 src/sys/dev/mii/rdcphy.c (expand / switch to unified diff)

--- src/sys/dev/mii/rdcphy.c 2011/01/26 18:48:12 1.1
+++ src/sys/dev/mii/rdcphy.c 2020/04/14 17:57:17 1.1.54.1
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: rdcphy.c,v 1.1 2011/01/26 18:48:12 bouyer Exp $ */ 1/* $NetBSD: rdcphy.c,v 1.1.54.1 2020/04/14 17:57:17 martin Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2010, Pyun YongHyeon <yongari@FreeBSD.org> 4 * Copyright (c) 2010, Pyun YongHyeon <yongari@FreeBSD.org>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice unmodified, this list of conditions, and the following 11 * notice unmodified, this list of conditions, and the following
12 * disclaimer. 12 * disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -23,27 +23,27 @@ @@ -23,27 +23,27 @@
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30/* FreeBSD: src/sys/dev/mii/rdcphy.c,v 1.1 2010/12/30 23:50:25 yongari Exp */ 30/* FreeBSD: src/sys/dev/mii/rdcphy.c,v 1.1 2010/12/30 23:50:25 yongari Exp */
31 31
32/* 32/*
33 * Driver for the RDC Semiconductor R6040 10/100 PHY. 33 * Driver for the RDC Semiconductor R6040 10/100 PHY.
34 */ 34 */
35#include <sys/cdefs.h> 35#include <sys/cdefs.h>
36__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.1 2011/01/26 18:48:12 bouyer Exp $"); 36__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.1.54.1 2020/04/14 17:57:17 martin 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#include <sys/errno.h> 43#include <sys/errno.h>
44 44
45#include <sys/bus.h> 45#include <sys/bus.h>
46 46
47#include <net/if.h> 47#include <net/if.h>
48#include <net/if_media.h> 48#include <net/if_media.h>
49 49
@@ -64,28 +64,32 @@ static void rdcphyattach(device_t, devic @@ -64,28 +64,32 @@ static void rdcphyattach(device_t, devic
64 64
65CFATTACH_DECL_NEW(rdcphy, sizeof(struct rdcphy_softc), 65CFATTACH_DECL_NEW(rdcphy, sizeof(struct rdcphy_softc),
66 rdcphymatch, rdcphyattach, mii_phy_detach, mii_phy_activate); 66 rdcphymatch, rdcphyattach, mii_phy_detach, mii_phy_activate);
67 67
68 68
69static int rdcphy_service(struct mii_softc *, struct mii_data *, int); 69static int rdcphy_service(struct mii_softc *, struct mii_data *, int);
70static void rdcphy_status(struct mii_softc *); 70static void rdcphy_status(struct mii_softc *);
71 71
72static const struct mii_phy_funcs rdcphy_funcs = { 72static const struct mii_phy_funcs rdcphy_funcs = {
73 rdcphy_service, rdcphy_status, mii_phy_reset, 73 rdcphy_service, rdcphy_status, mii_phy_reset,
74}; 74};
75 75
76static const struct mii_phydesc rdcphys[] = { 76static const struct mii_phydesc rdcphys[] = {
77 { MII_OUI_RDC, MII_MODEL_RDC_R6040, 77 { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040,
78 MII_STR_RDC_R6040 }, 78 MII_STR_xxRDC_R6040 },
 79 { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040_2,
 80 MII_STR_xxRDC_R6040_2 },
 81 { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040_3,
 82 MII_STR_xxRDC_R6040_3 },
79 { 0, 0, 83 { 0, 0,
80 NULL }, 84 NULL },
81}; 85};
82 86
83static int 87static int
84rdcphymatch(device_t parent, cfdata_t match, void *aux) 88rdcphymatch(device_t parent, cfdata_t match, void *aux)
85{ 89{
86 struct mii_attach_args *ma = aux; 90 struct mii_attach_args *ma = aux;
87 91
88 if (mii_phy_match(ma, rdcphys) != NULL) 92 if (mii_phy_match(ma, rdcphys) != NULL)
89 return (10); 93 return (10);
90 94
91 return (0); 95 return (0);

cvs diff -r1.125.6.8 -r1.125.6.9 src/sys/dev/mii/miidevs (expand / switch to unified diff)

--- src/sys/dev/mii/miidevs 2019/11/25 15:57:23 1.125.6.8
+++ src/sys/dev/mii/miidevs 2020/04/14 17:57:17 1.125.6.9
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: miidevs,v 1.125.6.8 2019/11/25 15:57:23 martin Exp $ 1$NetBSD: miidevs,v 1.125.6.9 2020/04/14 17:57:17 martin Exp $
2 2
3/*- 3/*-
4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center. 9 * NASA Ames Research Center.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -43,125 +43,123 @@ $NetBSD: miidevs,v 1.125.6.8 2019/11/25  @@ -43,125 +43,123 @@ $NetBSD: miidevs,v 1.125.6.8 2019/11/25
43 * The MII_OUI() macro in "miivar.h" reflects this. 43 * The MII_OUI() macro in "miivar.h" reflects this.
44 * If a vendor uses a different mapping, an "xx" prefixed OUI is defined here 44 * If a vendor uses a different mapping, an "xx" prefixed OUI is defined here
45 * which is mangled accordingly to compensate. 45 * which is mangled accordingly to compensate.
46 */ 46 */
47 47
48/* 48/*
49 * Use "make -f Makefile.miidevs" to regenerate miidevs.h and miidevs_data.h 49 * Use "make -f Makefile.miidevs" to regenerate miidevs.h and miidevs_data.h
50 */ 50 */
51 51
52oui AMD 0x00001a Advanced Micro Devices 52oui AMD 0x00001a Advanced Micro Devices
53oui TRIDIUM 0x0001f0 Tridium 53oui TRIDIUM 0x0001f0 Tridium
54oui DATATRACK 0x0002c6 Data Track Technology 54oui DATATRACK 0x0002c6 Data Track Technology
55oui AGERE 0x00053d Agere 55oui AGERE 0x00053d Agere
 56oui QUAKE 0x000897 Quake Technologies
56oui BANKSPEED 0x0006b8 Bankspeed Pty 57oui BANKSPEED 0x0006b8 Bankspeed Pty
57oui NETEXCELL 0x0008bb NetExcell 58oui NETEXCELL 0x0008bb NetExcell
58oui NETAS 0x0009c3 Netas 59oui NETAS 0x0009c3 Netas
59oui BROADCOM2 0x000af7 Broadcom Corporation 60oui BROADCOM2 0x000af7 Broadcom Corporation
 61oui AELUROS 0x000b25 Aeluros
60oui RALINK 0x000c43 Ralink Technology 62oui RALINK 0x000c43 Ralink Technology
61oui ASIX 0x000ec6 ASIX 63oui ASIX 0x000ec6 ASIX
62oui BROADCOM 0x001018 Broadcom Corporation 64oui BROADCOM 0x001018 Broadcom Corporation
63oui MICREL 0x0010a1 Micrel 65oui MICREL 0x0010a1 Micrel
64oui ALTIMA 0x0010a9 Altima Communications 66oui ALTIMA 0x0010a9 Altima Communications
65oui ENABLESEMI 0x0010dd Enable Semiconductor 67oui ENABLESEMI 0x0010dd Enable Semiconductor
66oui SUNPLUS 0x001105 Sunplus Technology 68oui SUNPLUS 0x001105 Sunplus Technology
67oui ATHEROS 0x001374 Atheros 
68oui TERANETICS 0x0014a6 Teranetics 69oui TERANETICS 0x0014a6 Teranetics
69oui RALINK2 0x0017a5 Ralink Technology 70oui RALINK2 0x0017a5 Ralink Technology
70oui AQUANTIA 0x0017b6 Aquantia Corporation 71oui AQUANTIA 0x0017b6 Aquantia Corporation
71oui BROADCOM3 0x001be9 Broadcom Corporation 72oui BROADCOM3 0x001be9 Broadcom Corporation
72oui LEVEL1 0x00207b Level 1 73oui LEVEL1 0x00207b Level 1
73oui VIA 0x004063 VIA Technologies 
74oui MARVELL 0x005043 Marvell Semiconductor 74oui MARVELL 0x005043 Marvell Semiconductor
75oui QUALSEMI 0x006051 Quality Semiconductor 75oui QUALSEMI 0x006051 Quality Semiconductor
76oui AMLOGIC 0x006051 Amlogic 76oui AMLOGIC 0x006051 Amlogic
77oui DAVICOM 0x00606e Davicom Semiconductor 77oui DAVICOM 0x00606e Davicom Semiconductor
78oui SMSC 0x00800f SMSC 78oui SMSC 0x00800f SMSC
79oui SEEQ 0x00a07d Seeq 79oui SEEQ 0x00a07d Seeq
80oui ICS 0x00a0be Integrated Circuit Systems 80oui ICS 0x00a0be Integrated Circuit Systems
81oui INTEL 0x00aa00 Intel 81oui INTEL 0x00aa00 Intel
82oui TSC 0x00c039 TDK Semiconductor 82oui TSC 0x00c039 TDK Semiconductor
83oui MYSON 0x00c0b4 Myson Technology 83oui MYSON 0x00c0b4 Myson Technology
84oui ATTANSIC 0x00c82e Attansic Technology 84oui ATTANSIC 0x00c82e Attansic Technology
85oui RDC 0x00d02d RDC Semiconductor 
86oui JMICRON 0x00d831 JMicron 85oui JMICRON 0x00d831 JMicron
87oui PMCSIERRA 0x00e004 PMC-Sierra 86oui PMCSIERRA 0x00e004 PMC-Sierra
88oui SIS 0x00e006 Silicon Integrated Systems 87oui SIS 0x00e006 Silicon Integrated Systems
89oui REALTEK 0x00e04c RealTek 88oui REALTEK 0x00e04c RealTek
90oui ADMTEK 0x00e092 ADMtek 89oui ADMTEK 0x00e092 ADMtek
91oui XAQTI 0x00e0ae XaQti Corp. 90oui XAQTI 0x00e0ae XaQti Corp.
92oui NATSEMI 0x080017 National Semiconductor 91oui NATSEMI 0x080017 National Semiconductor
93oui TI 0x080028 Texas Instruments 92oui TI 0x080028 Texas Instruments
94oui BROADCOM4 0x18c086 Broadcom Corporation 93oui BROADCOM4 0x18c086 Broadcom Corporation
95oui RENESAS 0x749050 Renesas 94oui RENESAS 0x749050 Renesas
96 95
97/* Unregistered or wrong OUI */ 96/* Unregistered or wrong OUI */
98oui yyREALTEK 0x000004 Realtek 97oui yyREALTEK 0x000004 Realtek
99oui yyAMD 0x000058 Advanced Micro Devices 98oui yyAMD 0x000058 Advanced Micro Devices
 99oui xxVIA 0x0002c6 VIA Technologies
100oui xxMYSON 0x00032d Myson Technology 100oui xxMYSON 0x00032d Myson Technology
101oui xxTSC 0x00039c TDK Semiconductor 101oui xxTSC 0x00039c TDK Semiconductor
102oui xxASIX 0x000674 Asix Semiconductor 102oui xxASIX 0x000674 Asix Semiconductor
103oui xxDAVICOM 0x000676 Davicom Semiconductor 103oui xxDAVICOM 0x000676 Davicom Semiconductor
104oui xxAMLOGIC 0x00068a Amlogic 104oui xxAMLOGIC 0x00068a Amlogic
105oui xxQUALSEMI 0x00068a Quality Semiconductor 105oui xxQUALSEMI 0x00068a Quality Semiconductor
106oui xxREALTEK 0x000732 Realtek 106oui xxREALTEK 0x000732 Realtek
107oui xxBROADCOM 0x000818 Broadcom Corporation 107oui xxBROADCOM 0x000818 Broadcom Corporation
108oui xxPMCSIERRA 0x0009c0 PMC-Sierra 108oui xxPMCSIERRA 0x0009c0 PMC-Sierra
109oui xxICPLUS 0x0009c3 IC Plus Corp. 109oui xxICPLUS 0x0009c3 IC Plus Corp.
110oui xxMARVELL 0x000ac2 Marvell Semiconductor 110oui xxMARVELL 0x000ac2 Marvell Semiconductor
111oui xxINTEL 0x001f00 Intel 111oui xxINTEL 0x001f00 Intel
112oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation 112oui xxBROADCOM_ALT1 0x0050ef Broadcom Corporation
113oui yyINTEL 0x005500 Intel 113oui yyINTEL 0x005500 Intel
114oui yyASIX 0x007063 Asix Semiconductor 114oui yyASIX 0x007063 Asix Semiconductor
115oui xxVITESSE 0x008083 Vitesse Semiconductor 115oui xxVITESSE 0x008083 Vitesse Semiconductor
116oui xxPMCSIERRA2 0x009057 PMC-Sierra 116oui xxPMCSIERRA2 0x009057 PMC-Sierra
117oui xxCICADA 0x00c08f Cicada Semiconductor 117oui xxCICADA 0x00c08f Cicada Semiconductor
 118oui xxRDC 0x00d02d RDC Semiconductor
118oui xxNATSEMI 0x1000e8 National Semiconductor 119oui xxNATSEMI 0x1000e8 National Semiconductor
119oui xxLEVEL1 0x782000 Level 1 120oui xxLEVEL1 0x782000 Level 1
120oui xxXAQTI 0xace000 XaQti Corp. 121oui xxXAQTI 0xace000 XaQti Corp.
121 122
122/* 123/*
123 * List of known models. Grouped by oui. 124 * List of known models. Grouped by oui.
124 */ 125 */
125 126
126/* 127/*
127 * Agere PHYs 128 * Agere PHYs
128 */ 129 */
129model AGERE ET1011 0x0004 Agere ET1011 10/100/1000baseT PHY 130model AGERE ET1011 0x0001 ET1011 10/100/1000baseT PHY
 131model AGERE ET1011C 0x0004 ET1011C 10/100/1000baseT PHY
130 132
131/* Asix semiconductor PHYs */ 133/* Asix semiconductor PHYs */
132model xxASIX AX88X9X 0x0031 Ax88x9x internal PHY 134model xxASIX AX88X9X 0x0031 Ax88x9x internal PHY
133model yyASIX AX88772 0x0001 AX88772 internal PHY 135model yyASIX AX88772 0x0001 AX88772 internal PHY
134model yyASIX AX88772A 0x0006 AX88772A internal PHY 136model yyASIX AX88772A 0x0006 AX88772A internal PHY
135model yyASIX AX88772B 0x0008 AX88772B internal PHY 137model yyASIX AX88772B 0x0008 AX88772B internal PHY
136 138
137/* Altima Communications PHYs */ 139/* Altima Communications PHYs */
138/* Don't know the model for ACXXX */ 140/* Don't know the model for ACXXX */
139model ALTIMA ACXXX 0x0001 ACXXX 10/100 media interface 141model ALTIMA ACXXX 0x0001 ACXXX 10/100 media interface
140model ALTIMA AC101L 0x0012 AC101L 10/100 media interface 142model ALTIMA AC101L 0x0012 AC101L 10/100 media interface
141model ALTIMA AC101 0x0021 AC101 10/100 media interface 143model ALTIMA AC101 0x0021 AC101 10/100 media interface
142/* AMD Am79C87[45] have ALTIMA OUI */ 144/* AMD Am79C87[45] have ALTIMA OUI */
143model ALTIMA Am79C875 0x0014 Am79C875 10/100 media interface 145model ALTIMA Am79C875 0x0014 Am79C875 10/100 media interface
144model ALTIMA Am79C874 0x0021 Am79C874 10/100 media interface 146model ALTIMA Am79C874 0x0021 Am79C874 10/100 media interface
145 147
146/* Amlogic PHYs */ 148/* Amlogic PHYs */
147model AMLOGIC GXL 0x0000 Meson GXL internal PHY 149model AMLOGIC GXL 0x0000 Meson GXL internal PHY
148model xxAMLOGIC GXL 0x0000 Meson GXL internal PHY 150model xxAMLOGIC GXL 0x0000 Meson GXL internal PHY
149 151
150/* Atheros PHYs */ 152/* Attansic/Atheros PHYs */
151model ATHEROS F1 0x0001 F1 10/100/1000 PHY 
152model ATHEROS F2 0x0002 F2 10/100 PHY 
153 
154/* Attansic PHYs */ 
155model ATTANSIC L1 0x0001 L1 10/100/1000 PHY 153model ATTANSIC L1 0x0001 L1 10/100/1000 PHY
156model ATTANSIC L2 0x0002 L2 10/100 PHY 154model ATTANSIC L2 0x0002 L2 10/100 PHY
157model ATTANSIC AR8021 0x0004 Atheros AR8021 10/100/1000 PHY 155model ATTANSIC AR8021 0x0004 Atheros AR8021 10/100/1000 PHY
158model ATTANSIC AR8035 0x0007 Atheros AR8035 10/100/1000 PHY 156model ATTANSIC AR8035 0x0007 Atheros AR8035 10/100/1000 PHY
159 157
160/* Advanced Micro Devices PHYs */ 158/* Advanced Micro Devices PHYs */
161/* see Davicom DM9101 for Am79C873 */ 159/* see Davicom DM9101 for Am79C873 */
162model yyAMD 79C972_10T 0x0001 Am79C972 internal 10BASE-T interface 160model yyAMD 79C972_10T 0x0001 Am79C972 internal 10BASE-T interface
163model yyAMD 79c973phy 0x0036 Am79C973 internal 10/100 media interface 161model yyAMD 79c973phy 0x0036 Am79C973 internal 10/100 media interface
164model yyAMD 79c901 0x0037 Am79C901 10BASE-T interface 162model yyAMD 79c901 0x0037 Am79C901 10BASE-T interface
165model yyAMD 79c901home 0x0039 Am79C901 HomePNA 1.0 interface 163model yyAMD 79c901home 0x0039 Am79C901 HomePNA 1.0 interface
166 164
167/* Broadcom Corp. PHYs */ 165/* Broadcom Corp. PHYs */
@@ -208,26 +206,27 @@ model BROADCOM2 BCM5708S 0x0015 BCM5708S @@ -208,26 +206,27 @@ model BROADCOM2 BCM5708S 0x0015 BCM5708S
208model BROADCOM2 BCM5785 0x0016 BCM5785 1000BASE-T media interface 206model BROADCOM2 BCM5785 0x0016 BCM5785 1000BASE-T media interface
209model BROADCOM2 BCM5709CAX 0x002c BCM5709CAX 10/100/1000baseT PHY 207model BROADCOM2 BCM5709CAX 0x002c BCM5709CAX 10/100/1000baseT PHY
210model BROADCOM2 BCM5722 0x002d BCM5722 1000BASE-T media interface 208model BROADCOM2 BCM5722 0x002d BCM5722 1000BASE-T media interface
211model BROADCOM2 BCM5784 0x003a BCM5784 10/100/1000baseT PHY 209model BROADCOM2 BCM5784 0x003a BCM5784 10/100/1000baseT PHY
212model BROADCOM2 BCM5709C 0x003c BCM5709 10/100/1000baseT PHY 210model BROADCOM2 BCM5709C 0x003c BCM5709 10/100/1000baseT PHY
213model BROADCOM2 BCM5761 0x003d BCM5761 10/100/1000baseT PHY 211model BROADCOM2 BCM5761 0x003d BCM5761 10/100/1000baseT PHY
214model BROADCOM2 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY 212model BROADCOM2 BCM5709S 0x003f BCM5709S 1000/2500baseSX PHY
215model BROADCOM3 BCM57780 0x0019 BCM57780 1000BASE-T media interface 213model BROADCOM3 BCM57780 0x0019 BCM57780 1000BASE-T media interface
216model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T media interface 214model BROADCOM3 BCM5717C 0x0020 BCM5717C 1000BASE-T media interface
217model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface 215model BROADCOM3 BCM5719C 0x0022 BCM5719C 1000BASE-T media interface
218model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface 216model BROADCOM3 BCM57765 0x0024 BCM57765 1000BASE-T media interface
219model BROADCOM3 BCM53125 0x0032 BCM53125 1000BASE-T switch 217model BROADCOM3 BCM53125 0x0032 BCM53125 1000BASE-T switch
220model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface 218model BROADCOM3 BCM5720C 0x0036 BCM5720C 1000BASE-T media interface
 219model BROADCOM4 BCM54213PE 0x000a BCM54213PE 1000BASE-T media interface
221model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface 220model BROADCOM4 BCM5725C 0x0038 BCM5725C 1000BASE-T media interface
222model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface 221model xxBROADCOM_ALT1 BCM5906 0x0004 BCM5906 10/100baseTX media interface
223 222
224/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */ 223/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */
225 224
226model xxCICADA CIS8201 0x0001 Cicada CIS8201 10/100/1000TX PHY 225model xxCICADA CIS8201 0x0001 Cicada CIS8201 10/100/1000TX PHY
227model xxCICADA CIS8204 0x0004 Cicada CIS8204 10/100/1000TX PHY 226model xxCICADA CIS8204 0x0004 Cicada CIS8204 10/100/1000TX PHY
228model xxCICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY 227model xxCICADA VSC8211 0x000b Cicada VSC8211 10/100/1000TX PHY
229model xxCICADA VSC8221 0x0015 Vitesse VSC8221 10/100/1000BASE-T PHY 228model xxCICADA VSC8221 0x0015 Vitesse VSC8221 10/100/1000BASE-T PHY
230model xxCICADA VSC8224 0x0018 Vitesse VSC8224 10/100/1000BASE-T PHY 229model xxCICADA VSC8224 0x0018 Vitesse VSC8224 10/100/1000BASE-T PHY
231model xxCICADA CIS8201A 0x0020 Cicada CIS8201 10/100/1000TX PHY 230model xxCICADA CIS8201A 0x0020 Cicada CIS8201 10/100/1000TX PHY
232model xxCICADA CIS8201B 0x0021 Cicada CIS8201 10/100/1000TX PHY 231model xxCICADA CIS8201B 0x0021 Cicada CIS8201 10/100/1000TX PHY
233model xxCICADA VSC8234 0x0022 Vitesse VSC8234 10/100/1000TX PHY 232model xxCICADA VSC8234 0x0022 Vitesse VSC8234 10/100/1000TX PHY
@@ -343,60 +342,65 @@ model xxNATSEMI DP83861 0x0006 DP83861  @@ -343,60 +342,65 @@ model xxNATSEMI DP83861 0x0006 DP83861
343model xxNATSEMI DP83865 0x0007 DP83865 1000BASE-T media interface 342model xxNATSEMI DP83865 0x0007 DP83865 1000BASE-T media interface
344model xxNATSEMI DP83849 0x000a DP83849 10/100 media interface 343model xxNATSEMI DP83849 0x000a DP83849 10/100 media interface
345 344
346/* PMC Sierra PHYs */ 345/* PMC Sierra PHYs */
347model xxPMCSIERRA PM8351 0x0000 PM8351 OctalPHY Gigabit interface 346model xxPMCSIERRA PM8351 0x0000 PM8351 OctalPHY Gigabit interface
348model xxPMCSIERRA2 PM8352 0x0002 PM8352 OctalPHY Gigabit interface 347model xxPMCSIERRA2 PM8352 0x0002 PM8352 OctalPHY Gigabit interface
349model xxPMCSIERRA2 PM8353 0x0003 PM8353 QuadPHY Gigabit interface 348model xxPMCSIERRA2 PM8353 0x0003 PM8353 QuadPHY Gigabit interface
350model PMCSIERRA PM8354 0x0004 PM8354 QuadPHY Gigabit interface 349model PMCSIERRA PM8354 0x0004 PM8354 QuadPHY Gigabit interface
351 350
352/* Quality Semiconductor PHYs */ 351/* Quality Semiconductor PHYs */
353model xxQUALSEMI QS6612 0x0000 QS6612 10/100 media interface 352model xxQUALSEMI QS6612 0x0000 QS6612 10/100 media interface
354 353
355/* RDC Semiconductor PHYs */ 354/* RDC Semiconductor PHYs */
356model RDC R6040 0x0003 R6040 10/100 media interface 355model xxRDC R6040 0x0003 R6040 10/100 media interface
 356model xxRDC R6040_2 0x0005 R6040 10/100 media interface
 357model xxRDC R6040_3 0x0006 R6040 10/100 media interface
357 358
358/* RealTek PHYs */ 359/* RealTek PHYs */
359model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface 360model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
360model yyREALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface 361model yyREALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface
361model REALTEK RTL8251 0x0000 RTL8251 1000BASE-T media interface 362model REALTEK RTL8251 0x0000 RTL8251 1000BASE-T media interface
362model REALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface 363model REALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface
363model REALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface 364model REALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
364 365
365/* Seeq PHYs */ 366/* Seeq PHYs */
366model SEEQ 80220 0x0003 Seeq 80220 10/100 media interface 367model SEEQ 80220 0x0003 Seeq 80220 10/100 media interface
367model SEEQ 84220 0x0004 Seeq 84220 10/100 media interface 368model SEEQ 84220 0x0004 Seeq 84220 10/100 media interface
368model SEEQ 80225 0x0008 Seeq 80225 10/100 media interface 369model SEEQ 80225 0x0008 Seeq 80225 10/100 media interface
369 370
370/* Silicon Integrated Systems PHYs */ 371/* Silicon Integrated Systems PHYs */
371model SIS 900 0x0000 SiS 900 10/100 media interface 372model SIS 900 0x0000 SiS 900 10/100 media interface
372 373
373/* SMSC PHYs */ 374/* SMSC PHYs */
374model SMSC LAN83C185 0x000a SMSC LAN83C185 10/100 PHY 375model SMSC LAN83C185 0x000a SMSC LAN83C185 10/100 PHY
375model SMSC LAN8700 0x000c SMSC LAN8700 10/100 Ethernet Transceiver 376model SMSC LAN8700 0x000c SMSC LAN8700 10/100 Ethernet Transceiver
376model SMSC LAN911X 0x000d SMSC LAN911X internal 10/100 PHY 377model SMSC LAN911X 0x000d SMSC LAN911X internal 10/100 PHY
377model SMSC LAN75XX 0x000e SMSC LAN75XX internal 10/100 PHY 378model SMSC LAN75XX 0x000e SMSC LAN75XX internal 10/100 PHY
378model SMSC LAN8710_LAN8720 0x000f SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver 379model SMSC LAN8710_LAN8720 0x000f SMSC LAN8710/LAN8720 10/100 Ethernet Transceiver
379model SMSC LAN8740 0x0011 SMSC LAN8740 10/100 media interface 380model SMSC LAN8740 0x0011 SMSC LAN8740 10/100 media interface
380model SMSC LAN8741A 0x0012 SMSC LAN8741A 10/100 media interface 381model SMSC LAN8741A 0x0012 SMSC LAN8741A 10/100 media interface
381model SMSC LAN8742 0x0013 SMSC LAN8742 10/100 media interface 382model SMSC LAN8742 0x0013 SMSC LAN8742 10/100 media interface
382 383
 384/* Teranetics PHY */
 385model TERANETICS TN1010 0x0001 Teranetics TN1010 10GBase-T PHY
 386
383/* Texas Instruments PHYs */ 387/* Texas Instruments PHYs */
384model TI TLAN10T 0x0001 ThunderLAN 10BASE-T media interface 388model TI TLAN10T 0x0001 ThunderLAN 10BASE-T media interface
385model TI 100VGPMI 0x0002 ThunderLAN 100VG-AnyLan media interface 389model TI 100VGPMI 0x0002 ThunderLAN 100VG-AnyLan media interface
386model TI TNETE2101 0x0003 TNETE2101 media interface 390model TI TNETE2101 0x0003 TNETE2101 media interface
387 391
388/* TDK Semiconductor PHYs */ 392/* TDK Semiconductor PHYs */
389model xxTSC 78Q2120 0x0014 78Q2120 10/100 media interface 393model xxTSC 78Q2120 0x0014 78Q2120 10/100 media interface
390model xxTSC 78Q2121 0x0015 78Q2121 100BASE-TX media interface 394model xxTSC 78Q2121 0x0015 78Q2121 100BASE-TX media interface
391 395
392/* VIA Technologies PHYs */ 396/* VIA Technologies PHYs */
393model VIA VT6103 0x0032 VT6103 10/100 PHY 397model xxVIA VT6103 0x0032 VT6103 10/100 PHY
394model VIA VT6103_2 0x0034 VT6103 10/100 PHY 398model xxVIA VT6103_2 0x0034 VT6103 10/100 PHY
395 399
396/* Vitesse PHYs (Now Microsemi) */ 400/* Vitesse PHYs (Now Microsemi) */
397model xxVITESSE VSC8601 0x0002 VSC8601 10/100/1000 PHY 401model xxVITESSE VSC8601 0x0002 VSC8601 10/100/1000 PHY
398model xxVITESSE VSC8641 0x0003 Vitesse VSC8641 10/100/1000TX PHY 402model xxVITESSE VSC8641 0x0003 Vitesse VSC8641 10/100/1000TX PHY
399model xxVITESSE VSC8501 0x0013 Vitesse VSC8501 10/100/1000TX PHY 403model xxVITESSE VSC8501 0x0013 Vitesse VSC8501 10/100/1000TX PHY
400 404
401/* XaQti Corp. PHYs */ 405/* XaQti Corp. PHYs */
402model xxXAQTI XMACII 0x0000 XaQti Corp. XMAC II gigabit interface 406model xxXAQTI XMACII 0x0000 XaQti Corp. XMAC II gigabit interface