Module Name: src Committed By: christos Date: Sun Feb 24 17:22:21 UTC 2019
Modified Files: src/sys/dev/mii: acphy.c amhphy.c atphy.c bmtphy.c brgphy.c ciphy.c dmphy.c etphy.c glxtphy.c gphyter.c icsphy.c igphy.c ihphy.c ikphy.c inphy.c iophy.c lxtphy.c makphy.c micphy.c miivar.h mvphy.c nsphy.c nsphyter.c pnaphy.c qsphy.c rdcphy.c rgephy.c rlphy.c sqphy.c tlphy.c tqphy.c Log Message: use a macro to tidy up the phydesc array initialization, from FreeBSD To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/acphy.c cvs rdiff -u -r1.21 -r1.22 src/sys/dev/mii/amhphy.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/mii/atphy.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/bmtphy.c src/sys/dev/mii/rlphy.c cvs rdiff -u -r1.80 -r1.81 src/sys/dev/mii/brgphy.c cvs rdiff -u -r1.30 -r1.31 src/sys/dev/mii/ciphy.c cvs rdiff -u -r1.38 -r1.39 src/sys/dev/mii/dmphy.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/etphy.c src/sys/dev/mii/rdcphy.c cvs rdiff -u -r1.27 -r1.28 src/sys/dev/mii/glxtphy.c cvs rdiff -u -r1.31 -r1.32 src/sys/dev/mii/gphyter.c cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/icsphy.c src/sys/dev/mii/sqphy.c cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/igphy.c cvs rdiff -u -r1.12 -r1.13 src/sys/dev/mii/ihphy.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/mii/ikphy.c cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/inphy.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/mii/iophy.c cvs rdiff -u -r1.51 -r1.52 src/sys/dev/mii/lxtphy.c cvs rdiff -u -r1.54 -r1.55 src/sys/dev/mii/makphy.c cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/micphy.c cvs rdiff -u -r1.64 -r1.65 src/sys/dev/mii/miivar.h cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/mvphy.c cvs rdiff -u -r1.62 -r1.63 src/sys/dev/mii/nsphy.c cvs rdiff -u -r1.40 -r1.41 src/sys/dev/mii/nsphyter.c cvs rdiff -u -r1.22 -r1.23 src/sys/dev/mii/pnaphy.c cvs rdiff -u -r1.50 -r1.51 src/sys/dev/mii/qsphy.c cvs rdiff -u -r1.47 -r1.48 src/sys/dev/mii/rgephy.c cvs rdiff -u -r1.63 -r1.64 src/sys/dev/mii/tlphy.c cvs rdiff -u -r1.41 -r1.42 src/sys/dev/mii/tqphy.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/mii/acphy.c diff -u src/sys/dev/mii/acphy.c:1.26 src/sys/dev/mii/acphy.c:1.27 --- src/sys/dev/mii/acphy.c:1.26 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/acphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: acphy.c,v 1.26 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: acphy.c,v 1.27 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.26 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acphy.c,v 1.27 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -72,21 +72,13 @@ static const struct mii_phy_funcs acphy_ }; static const struct mii_phydesc acphys[] = { - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101, - MII_STR_ALTIMA_AC101 }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_AC101L, - MII_STR_ALTIMA_AC101L }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C874, - MII_STR_ALTIMA_Am79C874 }, - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C875, - MII_STR_ALTIMA_Am79C875 }, - + MII_PHY_DESC(ALTIMA, AC101), + MII_PHY_DESC(ALTIMA, AC101L), + MII_PHY_DESC(ALTIMA, Am79C874), + MII_PHY_DESC(ALTIMA, Am79C875), /* XXX This is reported to work, but it's not from any data sheet. */ - { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_ACXXX, - MII_STR_ALTIMA_ACXXX }, - - { 0, 0, - NULL }, + MII_PHY_DESC(ALTIMA, ACXXX), + MII_PHY_END, }; static int Index: src/sys/dev/mii/amhphy.c diff -u src/sys/dev/mii/amhphy.c:1.21 src/sys/dev/mii/amhphy.c:1.22 --- src/sys/dev/mii/amhphy.c:1.21 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/amhphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: amhphy.c,v 1.21 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: amhphy.c,v 1.22 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.21 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.22 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -72,11 +72,8 @@ static const struct mii_phy_funcs amhphy }; static const struct mii_phydesc amhphys[] = { - { MII_OUI_yyAMD, MII_MODEL_yyAMD_79c901, - MII_STR_yyAMD_79c901 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(yyAMD, 79c901), + MII_PHY_END, }; static int Index: src/sys/dev/mii/atphy.c diff -u src/sys/dev/mii/atphy.c:1.19 src/sys/dev/mii/atphy.c:1.20 --- src/sys/dev/mii/atphy.c:1.19 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/atphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: atphy.c,v 1.19 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: atphy.c,v 1.20 2019/02/24 17:22:21 christos Exp $ */ /* $OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $ */ /*- @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.19 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.20 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -91,18 +91,12 @@ const struct mii_phy_funcs atphy_funcs = }; static const struct mii_phydesc etphys[] = { - { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, - MII_STR_ATHEROS_F1 }, - { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1, - MII_STR_ATTANSIC_L1 }, - { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L2, - MII_STR_ATTANSIC_L2 }, - { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8021, - MII_STR_ATTANSIC_AR8021 }, - { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8035, - MII_STR_ATTANSIC_AR8035 }, - { 0, 0, - NULL }, + MII_PHY_DESC(ATHEROS, F1), + MII_PHY_DESC(ATTANSIC, L1), + MII_PHY_DESC(ATTANSIC, L2), + MII_PHY_DESC(ATTANSIC, AR8021), + MII_PHY_DESC(ATTANSIC, AR8035), + MII_PHY_END, }; static bool Index: src/sys/dev/mii/bmtphy.c diff -u src/sys/dev/mii/bmtphy.c:1.33 src/sys/dev/mii/bmtphy.c:1.34 --- src/sys/dev/mii/bmtphy.c:1.33 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/bmtphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: bmtphy.c,v 1.33 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: bmtphy.c,v 1.34 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1.33 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bmtphy.c,v 1.34 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -94,23 +94,14 @@ static const struct mii_phy_funcs bmtphy }; static const struct mii_phydesc bmtphys[] = { - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_3C905B, - MII_STR_xxBROADCOM_3C905B }, - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_3C905C, - MII_STR_xxBROADCOM_3C905C }, - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_BCM5201, - MII_STR_xxBROADCOM_BCM5201 }, - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_BCM5214, - MII_STR_xxBROADCOM_BCM5214 }, - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_BCM5221, - MII_STR_xxBROADCOM_BCM5221 }, - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_BCM5222, - MII_STR_xxBROADCOM_BCM5222 }, - { MII_OUI_xxBROADCOM, MII_MODEL_xxBROADCOM_BCM4401, - MII_STR_xxBROADCOM_BCM4401 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxBROADCOM, 3C905B), + MII_PHY_DESC(xxBROADCOM, 3C905C), + MII_PHY_DESC(xxBROADCOM, BCM5201), + MII_PHY_DESC(xxBROADCOM, BCM5214), + MII_PHY_DESC(xxBROADCOM, BCM5221), + MII_PHY_DESC(xxBROADCOM, BCM5222), + MII_PHY_DESC(xxBROADCOM, BCM4401), + MII_PHY_END, }; static int Index: src/sys/dev/mii/rlphy.c diff -u src/sys/dev/mii/rlphy.c:1.33 src/sys/dev/mii/rlphy.c:1.34 --- src/sys/dev/mii/rlphy.c:1.33 Sat Feb 9 02:48:39 2019 +++ src/sys/dev/mii/rlphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rlphy.c,v 1.33 2019/02/09 07:48:39 rin Exp $ */ +/* $NetBSD: rlphy.c,v 1.34 2019/02/24 17:22:21 christos Exp $ */ /* $OpenBSD: rlphy.c,v 1.20 2005/07/31 05:27:30 pvalchev Exp $ */ /* @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.33 2019/02/09 07:48:39 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.34 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -77,15 +77,10 @@ const struct mii_phy_funcs rlphy_funcs = }; static const struct mii_phydesc rlphys[] = { - { MII_OUI_yyREALTEK, MII_MODEL_yyREALTEK_RTL8201L, - MII_STR_yyREALTEK_RTL8201L }, - { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8201E, - MII_STR_REALTEK_RTL8201E }, - { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP101, - MII_STR_ICPLUS_IP101 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(yyREALTEK, RTL8201L), + MII_PHY_DESC(REALTEK, RTL8201E), + MII_PHY_DESC(ICPLUS, IP101), + MII_PHY_END, }; int Index: src/sys/dev/mii/brgphy.c diff -u src/sys/dev/mii/brgphy.c:1.80 src/sys/dev/mii/brgphy.c:1.81 --- src/sys/dev/mii/brgphy.c:1.80 Wed Feb 20 12:00:20 2019 +++ src/sys/dev/mii/brgphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: brgphy.c,v 1.80 2019/02/20 17:00:20 msaitoh Exp $ */ +/* $NetBSD: brgphy.c,v 1.81 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.80 2019/02/20 17:00:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.81 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -138,122 +138,45 @@ static const struct mii_phy_funcs brgphy }; static const struct mii_phydesc brgphys[] = { - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5400, - MII_STR_BROADCOM_BCM5400 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5401, - MII_STR_BROADCOM_BCM5401 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5411, - MII_STR_BROADCOM_BCM5411 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5421, - MII_STR_BROADCOM_BCM5421 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5462, - MII_STR_BROADCOM_BCM5462 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5461, - MII_STR_BROADCOM_BCM5461 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM54K2, - MII_STR_BROADCOM_BCM54K2 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5464, - MII_STR_BROADCOM_BCM5464 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5701, - MII_STR_BROADCOM_BCM5701 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5703, - MII_STR_BROADCOM_BCM5703 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5704, - MII_STR_BROADCOM_BCM5704 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5705, - MII_STR_BROADCOM_BCM5705 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5706, - MII_STR_BROADCOM_BCM5706 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5714, - MII_STR_BROADCOM_BCM5714 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5750, - MII_STR_BROADCOM_BCM5750 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5752, - MII_STR_BROADCOM_BCM5752 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5780, - MII_STR_BROADCOM_BCM5780 }, - - { MII_OUI_BROADCOM, MII_MODEL_BROADCOM_BCM5708C, - MII_STR_BROADCOM_BCM5708C }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5481, - MII_STR_BROADCOM2_BCM5481 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5482, - MII_STR_BROADCOM2_BCM5482 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5708S, - MII_STR_BROADCOM2_BCM5708S }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5709C, - MII_STR_BROADCOM2_BCM5709C }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5709S, - MII_STR_BROADCOM2_BCM5709S }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5709CAX, - MII_STR_BROADCOM2_BCM5709CAX }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5722, - MII_STR_BROADCOM2_BCM5722 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5754, - MII_STR_BROADCOM2_BCM5754 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5755, - MII_STR_BROADCOM2_BCM5755 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5756, - MII_STR_BROADCOM2_BCM5756 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5761, - MII_STR_BROADCOM2_BCM5761 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5784, - MII_STR_BROADCOM2_BCM5784 }, - - { MII_OUI_BROADCOM2, MII_MODEL_BROADCOM2_BCM5785, - MII_STR_BROADCOM2_BCM5785 }, - - { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5717C, - MII_STR_BROADCOM3_BCM5717C }, - - { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5719C, - MII_STR_BROADCOM3_BCM5719C }, - - { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C, - MII_STR_BROADCOM3_BCM5720C }, - - { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765, - MII_STR_BROADCOM3_BCM57765 }, - - { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57780, - MII_STR_BROADCOM3_BCM57780 }, - - { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM5725C, - MII_STR_BROADCOM4_BCM5725C }, - - { MII_OUI_xxBROADCOM_ALT1, MII_MODEL_xxBROADCOM_ALT1_BCM5906, - MII_STR_xxBROADCOM_ALT1_BCM5906 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(BROADCOM, BCM5400), + MII_PHY_DESC(BROADCOM, BCM5401), + MII_PHY_DESC(BROADCOM, BCM5411), + MII_PHY_DESC(BROADCOM, BCM5421), + MII_PHY_DESC(BROADCOM, BCM5462), + MII_PHY_DESC(BROADCOM, BCM5461), + MII_PHY_DESC(BROADCOM, BCM54K2), + MII_PHY_DESC(BROADCOM, BCM5464), + MII_PHY_DESC(BROADCOM, BCM5701), + MII_PHY_DESC(BROADCOM, BCM5703), + MII_PHY_DESC(BROADCOM, BCM5704), + MII_PHY_DESC(BROADCOM, BCM5705), + MII_PHY_DESC(BROADCOM, BCM5706), + MII_PHY_DESC(BROADCOM, BCM5714), + MII_PHY_DESC(BROADCOM, BCM5750), + MII_PHY_DESC(BROADCOM, BCM5752), + MII_PHY_DESC(BROADCOM, BCM5780), + MII_PHY_DESC(BROADCOM, BCM5708C), + MII_PHY_DESC(BROADCOM2, BCM5481), + MII_PHY_DESC(BROADCOM2, BCM5482), + MII_PHY_DESC(BROADCOM2, BCM5708S), + MII_PHY_DESC(BROADCOM2, BCM5709C), + MII_PHY_DESC(BROADCOM2, BCM5709S), + MII_PHY_DESC(BROADCOM2, BCM5709CAX), + MII_PHY_DESC(BROADCOM2, BCM5722), + MII_PHY_DESC(BROADCOM2, BCM5754), + MII_PHY_DESC(BROADCOM2, BCM5755), + MII_PHY_DESC(BROADCOM2, BCM5756), + MII_PHY_DESC(BROADCOM2, BCM5761), + MII_PHY_DESC(BROADCOM2, BCM5784), + MII_PHY_DESC(BROADCOM2, BCM5785), + MII_PHY_DESC(BROADCOM3, BCM5717C), + MII_PHY_DESC(BROADCOM3, BCM5719C), + MII_PHY_DESC(BROADCOM3, BCM5720C), + MII_PHY_DESC(BROADCOM3, BCM57765), + MII_PHY_DESC(BROADCOM3, BCM57780), + MII_PHY_DESC(BROADCOM4, BCM5725C), + MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906), + MII_PHY_END, }; static int Index: src/sys/dev/mii/ciphy.c diff -u src/sys/dev/mii/ciphy.c:1.30 src/sys/dev/mii/ciphy.c:1.31 --- src/sys/dev/mii/ciphy.c:1.30 Wed Feb 13 03:41:43 2019 +++ src/sys/dev/mii/ciphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ciphy.c,v 1.30 2019/02/13 08:41:43 msaitoh Exp $ */ +/* $NetBSD: ciphy.c,v 1.31 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.30 2019/02/13 08:41:43 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.31 2019/02/24 17:22:21 christos Exp $"); /* * Driver for the Cicada CS8201 10/100/1000 copper PHY. @@ -74,38 +74,17 @@ static const struct mii_phy_funcs ciphy_ }; static const struct mii_phydesc ciphys[] = { - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201, - MII_STR_CICADA_CS8201 }, - - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201A, - MII_STR_CICADA_CS8201A }, - - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8201B, - MII_STR_CICADA_CS8201B }, - - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8204, - MII_STR_CICADA_CS8204 }, - - { MII_OUI_CICADA, MII_MODEL_CICADA_VSC8211, - MII_STR_CICADA_VSC8211 }, - - { MII_OUI_CICADA, MII_MODEL_CICADA_CS8244, - MII_STR_CICADA_CS8244 }, - - { MII_OUI_xxCICADA, MII_MODEL_CICADA_CS8201, - MII_STR_CICADA_CS8201 }, - - { MII_OUI_xxCICADA, MII_MODEL_CICADA_CS8201A, - MII_STR_CICADA_CS8201A }, - - { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_CS8201B, - MII_STR_xxCICADA_CS8201B }, - - { MII_OUI_VITESSE, MII_MODEL_VITESSE_VSC8601, - MII_STR_VITESSE_VSC8601 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(CICADA, CS8201), + MII_PHY_DESC(CICADA, CS8201A), + MII_PHY_DESC(CICADA, CS8201B), + MII_PHY_DESC(CICADA, CS8204), + MII_PHY_DESC(CICADA, VSC8211), + MII_PHY_DESC(CICADA, CS8244), + MII_PHY_DESC(CICADA, CS8201), + MII_PHY_DESC(CICADA, CS8201A), + MII_PHY_DESC(xxCICADA, CS8201B), + MII_PHY_DESC(VITESSE, VSC8601), + MII_PHY_END, }; static int Index: src/sys/dev/mii/dmphy.c diff -u src/sys/dev/mii/dmphy.c:1.38 src/sys/dev/mii/dmphy.c:1.39 --- src/sys/dev/mii/dmphy.c:1.38 Mon Feb 18 02:27:15 2019 +++ src/sys/dev/mii/dmphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: dmphy.c,v 1.38 2019/02/18 07:27:15 msaitoh Exp $ */ +/* $NetBSD: dmphy.c,v 1.39 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.38 2019/02/18 07:27:15 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.39 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,17 +92,10 @@ static const struct mii_phy_funcs dmphy_ }; static const struct mii_phydesc dmphys[] = { - { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9101, - MII_STR_xxDAVICOM_DM9101 }, - - { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9102, - MII_STR_xxDAVICOM_DM9102 }, - - { MII_OUI_DAVICOM, MII_MODEL_xxDAVICOM_DM9101, - MII_STR_xxDAVICOM_DM9101 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxDAVICOM, DM9101), + MII_PHY_DESC(xxDAVICOM, DM9102), + MII_PHY_DESC(xxDAVICOM, DM9101), + MII_PHY_END, }; static int Index: src/sys/dev/mii/etphy.c diff -u src/sys/dev/mii/etphy.c:1.2 src/sys/dev/mii/etphy.c:1.3 --- src/sys/dev/mii/etphy.c:1.2 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/etphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: etphy.c,v 1.2 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: etphy.c,v 1.3 2019/02/24 17:22:21 christos Exp $ */ /* $OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $ */ /* @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.2 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.3 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -88,10 +88,8 @@ const struct mii_phy_funcs etphy_funcs = }; static const struct mii_phydesc etphys[] = { - { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, - MII_STR_AGERE_ET1011 }, - { 0, 0, - NULL }, + MII_PHY_DESC(AGERE, ET1011), + MII_PHY_END, }; CFATTACH_DECL_NEW(etphy, sizeof(struct mii_softc), Index: src/sys/dev/mii/rdcphy.c diff -u src/sys/dev/mii/rdcphy.c:1.2 src/sys/dev/mii/rdcphy.c:1.3 --- src/sys/dev/mii/rdcphy.c:1.2 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/rdcphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rdcphy.c,v 1.2 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: rdcphy.c,v 1.3 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 2010, Pyun YongHyeon <yong...@freebsd.org> @@ -33,7 +33,7 @@ * Driver for the RDC Semiconductor R6040 10/100 PHY. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.2 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.3 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -74,10 +74,8 @@ static const struct mii_phy_funcs rdcphy }; static const struct mii_phydesc rdcphys[] = { - { MII_OUI_RDC, MII_MODEL_RDC_R6040, - MII_STR_RDC_R6040 }, - { 0, 0, - NULL }, + MII_PHY_DESC(RDC, R6040), + MII_PHY_END, }; static int Index: src/sys/dev/mii/glxtphy.c diff -u src/sys/dev/mii/glxtphy.c:1.27 src/sys/dev/mii/glxtphy.c:1.28 --- src/sys/dev/mii/glxtphy.c:1.27 Mon Feb 18 21:51:02 2019 +++ src/sys/dev/mii/glxtphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: glxtphy.c,v 1.27 2019/02/19 02:51:02 msaitoh Exp $ */ +/* $NetBSD: glxtphy.c,v 1.28 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.27 2019/02/19 02:51:02 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.28 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -91,14 +91,9 @@ static const struct mii_phy_funcs glxtph }; static const struct mii_phydesc glxtphys[] = { - { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT1000_OLD, - MII_STR_LEVEL1_LXT1000_OLD }, - - { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT1000, - MII_STR_LEVEL1_LXT1000 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(LEVEL1, LXT1000_OLD), + MII_PHY_DESC(LEVEL1, LXT1000), + MII_PHY_END, }; static int Index: src/sys/dev/mii/gphyter.c diff -u src/sys/dev/mii/gphyter.c:1.31 src/sys/dev/mii/gphyter.c:1.32 --- src/sys/dev/mii/gphyter.c:1.31 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/gphyter.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: gphyter.c,v 1.31 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: gphyter.c,v 1.32 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.31 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.32 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -99,17 +99,10 @@ static const struct mii_phy_funcs gphyte }; static const struct mii_phydesc gphyters[] = { - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83861, - MII_STR_xxNATSEMI_DP83861 }, - - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83865, - MII_STR_xxNATSEMI_DP83865 }, - - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83891, - MII_STR_xxNATSEMI_DP83891 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxNATSEMI, DP83861), + MII_PHY_DESC(xxNATSEMI, DP83865), + MII_PHY_DESC(xxNATSEMI, DP83891), + MII_PHY_END, }; static int Index: src/sys/dev/mii/icsphy.c diff -u src/sys/dev/mii/icsphy.c:1.52 src/sys/dev/mii/icsphy.c:1.53 --- src/sys/dev/mii/icsphy.c:1.52 Wed Feb 13 03:42:26 2019 +++ src/sys/dev/mii/icsphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: icsphy.c,v 1.52 2019/02/13 08:42:26 msaitoh Exp $ */ +/* $NetBSD: icsphy.c,v 1.53 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.52 2019/02/13 08:42:26 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: icsphy.c,v 1.53 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,23 +92,12 @@ static const struct mii_phy_funcs icsphy }; static const struct mii_phydesc icsphys[] = { - { MII_OUI_ICS, MII_MODEL_ICS_1889, - MII_STR_ICS_1889 }, - - { MII_OUI_ICS, MII_MODEL_ICS_1890, - MII_STR_ICS_1890 }, - - { MII_OUI_ICS, MII_MODEL_ICS_1892, - MII_STR_ICS_1892 }, - - { MII_OUI_ICS, MII_MODEL_ICS_1893, - MII_STR_ICS_1893 }, - - { MII_OUI_ICS, MII_MODEL_ICS_1893C, - MII_STR_ICS_1893C }, - - { 0, 0, - NULL }, + MII_PHY_DESC(ICS, 1889), + MII_PHY_DESC(ICS, 1890), + MII_PHY_DESC(ICS, 1892), + MII_PHY_DESC(ICS, 1893), + MII_PHY_DESC(ICS, 1893C), + MII_PHY_END, }; static int Index: src/sys/dev/mii/sqphy.c diff -u src/sys/dev/mii/sqphy.c:1.52 src/sys/dev/mii/sqphy.c:1.53 --- src/sys/dev/mii/sqphy.c:1.52 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/sqphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sqphy.c,v 1.52 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: sqphy.c,v 1.53 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.52 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sqphy.c,v 1.53 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -97,17 +97,10 @@ static const struct mii_phy_funcs sqphy_ }; static const struct mii_phydesc sqphys[] = { - { MII_OUI_SEEQ, MII_MODEL_SEEQ_80220, - MII_STR_SEEQ_80220 }, - - { MII_OUI_SEEQ, MII_MODEL_SEEQ_80225, - MII_STR_SEEQ_80225 }, - - { MII_OUI_SEEQ, MII_MODEL_SEEQ_84220, - MII_STR_SEEQ_84220 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(SEEQ, 80220), + MII_PHY_DESC(SEEQ, 80225), + MII_PHY_DESC(SEEQ, 84220), + MII_PHY_END, }; static int Index: src/sys/dev/mii/igphy.c diff -u src/sys/dev/mii/igphy.c:1.29 src/sys/dev/mii/igphy.c:1.30 --- src/sys/dev/mii/igphy.c:1.29 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/igphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: igphy.c,v 1.29 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: igphy.c,v 1.30 2019/02/24 17:22:21 christos Exp $ */ /* * The Intel copyright applies to the analog register setup, and the @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.29 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: igphy.c,v 1.30 2019/02/24 17:22:21 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_mii.h" @@ -112,14 +112,9 @@ static const struct mii_phy_funcs igphy_ }; static const struct mii_phydesc igphys[] = { - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_IGP01E1000, - MII_STR_yyINTEL_IGP01E1000 }, - - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82566, - MII_STR_yyINTEL_I82566 }, - - {0, 0, - NULL }, + MII_PHY_DESC(yyINTEL, IGP01E1000), + MII_PHY_DESC(yyINTEL, I82566), + MII_PHY_END, }; static int Index: src/sys/dev/mii/ihphy.c diff -u src/sys/dev/mii/ihphy.c:1.12 src/sys/dev/mii/ihphy.c:1.13 --- src/sys/dev/mii/ihphy.c:1.12 Tue Feb 19 02:49:58 2019 +++ src/sys/dev/mii/ihphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ihphy.c,v 1.12 2019/02/19 07:49:58 msaitoh Exp $ */ +/* $NetBSD: ihphy.c,v 1.13 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.12 2019/02/19 07:49:58 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihphy.c,v 1.13 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -94,19 +94,12 @@ static const struct mii_phy_funcs ihphy_ }; static const struct mii_phydesc ihphys[] = { - { MII_OUI_INTEL, MII_MODEL_INTEL_I82577, - MII_STR_INTEL_I82577 }, - { MII_OUI_INTEL, MII_MODEL_INTEL_I82579, - MII_STR_INTEL_I82579 }, - { MII_OUI_INTEL, MII_MODEL_INTEL_I217, - MII_STR_INTEL_I217 }, - { MII_OUI_INTEL, MII_MODEL_INTEL_I82580, - MII_STR_INTEL_I82580}, - { MII_OUI_INTEL, MII_MODEL_INTEL_I350, - MII_STR_INTEL_I350}, - - { 0, 0, - NULL }, + MII_PHY_DESC(INTEL, I82577), + MII_PHY_DESC(INTEL, I82579), + MII_PHY_DESC(INTEL, I217), + MII_PHY_DESC(INTEL, I82580), + MII_PHY_DESC(INTEL, I350), + MII_PHY_END, }; static int Index: src/sys/dev/mii/ikphy.c diff -u src/sys/dev/mii/ikphy.c:1.13 src/sys/dev/mii/ikphy.c:1.14 --- src/sys/dev/mii/ikphy.c:1.13 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/ikphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ikphy.c,v 1.13 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: ikphy.c,v 1.14 2019/02/24 17:22:21 christos Exp $ */ /******************************************************************************* Copyright (c) 2001-2005, Intel Corporation @@ -59,7 +59,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.13 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.14 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,11 +92,8 @@ static const struct mii_phy_funcs ikphy_ }; static const struct mii_phydesc ikphys[] = { - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_I82563, - MII_STR_xxMARVELL_I82563 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxMARVELL, I82563), + MII_PHY_END, }; static int Index: src/sys/dev/mii/inphy.c diff -u src/sys/dev/mii/inphy.c:1.56 src/sys/dev/mii/inphy.c:1.57 --- src/sys/dev/mii/inphy.c:1.56 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/inphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: inphy.c,v 1.56 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: inphy.c,v 1.57 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.56 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: inphy.c,v 1.57 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,23 +92,12 @@ static const struct mii_phy_funcs inphy_ }; static const struct mii_phydesc inphys[] = { - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82555, - MII_STR_yyINTEL_I82555 }, - - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82562EH, - MII_STR_yyINTEL_I82562EH }, - - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82562EM, - MII_STR_yyINTEL_I82562EM }, - - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82562ET, - MII_STR_yyINTEL_I82562ET }, - - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82562G, - MII_STR_yyINTEL_I82562G }, - - { 0, 0, - NULL }, + MII_PHY_DESC(yyINTEL, I82555), + MII_PHY_DESC(yyINTEL, I82562EH), + MII_PHY_DESC(yyINTEL, I82562EM), + MII_PHY_DESC(yyINTEL, I82562ET), + MII_PHY_DESC(yyINTEL, I82562G), + MII_PHY_END, }; static int Index: src/sys/dev/mii/iophy.c diff -u src/sys/dev/mii/iophy.c:1.39 src/sys/dev/mii/iophy.c:1.40 --- src/sys/dev/mii/iophy.c:1.39 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/iophy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: iophy.c,v 1.39 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: iophy.c,v 1.40 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.39 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iophy.c,v 1.40 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -90,14 +90,9 @@ static const struct mii_phy_funcs iophy_ }; static const struct mii_phydesc iophys[] = { - { MII_OUI_xxINTEL, MII_MODEL_xxINTEL_I82553, - MII_STR_xxINTEL_I82553 }, - - { MII_OUI_yyINTEL, MII_MODEL_yyINTEL_I82553, - MII_STR_yyINTEL_I82553 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxINTEL, I82553), + MII_PHY_DESC(yyINTEL, I82553), + MII_PHY_END, }; static int Index: src/sys/dev/mii/lxtphy.c diff -u src/sys/dev/mii/lxtphy.c:1.51 src/sys/dev/mii/lxtphy.c:1.52 --- src/sys/dev/mii/lxtphy.c:1.51 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/lxtphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: lxtphy.c,v 1.51 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: lxtphy.c,v 1.52 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.51 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lxtphy.c,v 1.52 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -100,14 +100,9 @@ static const struct mii_phy_funcs lxtphy }; static const struct mii_phydesc lxtphys[] = { - { MII_OUI_xxLEVEL1, MII_MODEL_xxLEVEL1_LXT970, - MII_STR_xxLEVEL1_LXT970 }, - - { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT971, - MII_STR_LEVEL1_LXT971 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxLEVEL1, LXT970), + MII_PHY_DESC(LEVEL1, LXT971), + MII_PHY_END, }; static int Index: src/sys/dev/mii/makphy.c diff -u src/sys/dev/mii/makphy.c:1.54 src/sys/dev/mii/makphy.c:1.55 --- src/sys/dev/mii/makphy.c:1.54 Tue Feb 19 00:47:08 2019 +++ src/sys/dev/mii/makphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: makphy.c,v 1.54 2019/02/19 05:47:08 msaitoh Exp $ */ +/* $NetBSD: makphy.c,v 1.55 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.54 2019/02/19 05:47:08 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.55 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,77 +92,33 @@ static const struct mii_phy_funcs makphy }; static const struct mii_phydesc makphys[] = { - { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_0, - MII_STR_MARVELL_E1000_0 }, - - { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_3, - MII_STR_MARVELL_E1000_3 }, - - { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_5, - MII_STR_MARVELL_E1000_5 }, - - { MII_OUI_MARVELL, MII_MODEL_MARVELL_E1000_6, - MII_STR_MARVELL_E1000_6 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1000_3, - MII_STR_xxMARVELL_E1000_3 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1000_5, - MII_STR_xxMARVELL_E1000_5 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1000S, - MII_STR_xxMARVELL_E1000S }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1011, - MII_STR_xxMARVELL_E1011 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1111, - MII_STR_xxMARVELL_E1111 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1112, - MII_STR_xxMARVELL_E1112 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1116, - MII_STR_xxMARVELL_E1116 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1116R, - MII_STR_xxMARVELL_E1116R }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1318S, - MII_STR_xxMARVELL_E1318S }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1118, - MII_STR_xxMARVELL_E1118 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1145, - MII_STR_xxMARVELL_E1145 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1149, - MII_STR_xxMARVELL_E1149 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1149R, - MII_STR_xxMARVELL_E1149R }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1240, - MII_STR_xxMARVELL_E1240 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1512, - MII_STR_xxMARVELL_E1512 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E1543, - MII_STR_xxMARVELL_E1543 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E3016, - MII_STR_xxMARVELL_E3016 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E3082, - MII_STR_xxMARVELL_E3082 }, - - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_PHYG65G, - MII_STR_xxMARVELL_PHYG65G }, - - { 0, 0, - NULL }, + MII_PHY_DESC(MARVELL, E1000_0), + MII_PHY_DESC(MARVELL, E1000_3), + MII_PHY_DESC(MARVELL, E1000_5), + MII_PHY_DESC(MARVELL, E1000_6), + MII_PHY_DESC(xxMARVELL, E1000), + MII_PHY_DESC(xxMARVELL, E1000S), + MII_PHY_DESC(xxMARVELL, E1000_3), + MII_PHY_DESC(xxMARVELL, E1000_5), + MII_PHY_DESC(xxMARVELL, E1000S), + MII_PHY_DESC(xxMARVELL, E1011), + MII_PHY_DESC(xxMARVELL, E1101), + MII_PHY_DESC(xxMARVELL, E1111), + MII_PHY_DESC(xxMARVELL, E1112), + MII_PHY_DESC(xxMARVELL, E1116), + MII_PHY_DESC(xxMARVELL, E1116R), + MII_PHY_DESC(xxMARVELL, E1118), + MII_PHY_DESC(xxMARVELL, E1145), + MII_PHY_DESC(xxMARVELL, E1149), + MII_PHY_DESC(xxMARVELL, E1149R), + MII_PHY_DESC(xxMARVELL, E1240), + MII_PHY_DESC(xxMARVELL, E1318S), + MII_PHY_DESC(xxMARVELL, E1512), + MII_PHY_DESC(xxMARVELL, E1543), + MII_PHY_DESC(xxMARVELL, E3016), + MII_PHY_DESC(xxMARVELL, E3082), + MII_PHY_DESC(xxMARVELL, PHYG65G), + MII_PHY_END, }; #define MAKARG_PDOWN true /* Power DOWN */ Index: src/sys/dev/mii/micphy.c diff -u src/sys/dev/mii/micphy.c:1.6 src/sys/dev/mii/micphy.c:1.7 --- src/sys/dev/mii/micphy.c:1.6 Wed Feb 13 23:13:40 2019 +++ src/sys/dev/mii/micphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: micphy.c,v 1.6 2019/02/14 04:13:40 msaitoh Exp $ */ +/* $NetBSD: micphy.c,v 1.7 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.6 2019/02/14 04:13:40 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.7 2019/02/24 17:22:21 christos Exp $"); #include "opt_mii.h" @@ -94,14 +94,9 @@ static const struct mii_phy_funcs micphy }; static const struct mii_phydesc micphys[] = { - { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8081, - MII_STR_MICREL_KSZ8081 }, - - { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9021RNI, - MII_STR_MICREL_KSZ9021RNI }, - - { 0, 0, - NULL }, + MII_PHY_DESC(MICREL, KSZ8081), + MII_PHY_DESC(MICREL, KSZ9021RNI), + MII_PHY_END, }; #define MII_KSZ8081_PHYCTL2 0x1f Index: src/sys/dev/mii/miivar.h diff -u src/sys/dev/mii/miivar.h:1.64 src/sys/dev/mii/miivar.h:1.65 --- src/sys/dev/mii/miivar.h:1.64 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/miivar.h Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: miivar.h,v 1.64 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: miivar.h,v 1.65 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -187,6 +187,10 @@ struct mii_phydesc { const char *mpd_name; /* the PHY's name */ }; +#define MII_PHY_DESC(a, b) { MII_OUI_ ## a, MII_MODEL_ ## a ## _ ## b, \ + MII_STR_ ## a ## _ ## b } +#define MII_PHY_END { 0, 0, NULL } + /* * An array of these structures map MII media types to BMCR/ANAR settings. */ Index: src/sys/dev/mii/mvphy.c diff -u src/sys/dev/mii/mvphy.c:1.11 src/sys/dev/mii/mvphy.c:1.12 --- src/sys/dev/mii/mvphy.c:1.11 Tue Jan 22 22:38:26 2019 +++ src/sys/dev/mii/mvphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: mvphy.c,v 1.11 2019/01/23 03:38:26 msaitoh Exp $ */ +/* $NetBSD: mvphy.c,v 1.12 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 2006 Sam Leffler, Errno Consulting @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: mvphy.c,v 1.11 2019/01/23 03:38:26 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mvphy.c,v 1.12 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -86,11 +86,8 @@ static const struct mii_phy_funcs mvphy_ }; static const struct mii_phydesc mvphys[] = { - { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_E6060, - MII_STR_xxMARVELL_E6060 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxMARVELL, E6060), + MII_PHY_END, }; /* Index: src/sys/dev/mii/nsphy.c diff -u src/sys/dev/mii/nsphy.c:1.62 src/sys/dev/mii/nsphy.c:1.63 --- src/sys/dev/mii/nsphy.c:1.62 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/nsphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nsphy.c,v 1.62 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: nsphy.c,v 1.63 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.62 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphy.c,v 1.63 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -93,11 +93,8 @@ static const struct mii_phy_funcs nsphy_ }; static const struct mii_phydesc nsphys[] = { - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83840, - MII_STR_xxNATSEMI_DP83840 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxNATSEMI, DP83840), + MII_PHY_END, }; static int Index: src/sys/dev/mii/nsphyter.c diff -u src/sys/dev/mii/nsphyter.c:1.40 src/sys/dev/mii/nsphyter.c:1.41 --- src/sys/dev/mii/nsphyter.c:1.40 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/nsphyter.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: nsphyter.c,v 1.40 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: nsphyter.c,v 1.41 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.40 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nsphyter.c,v 1.41 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -97,20 +97,11 @@ static const struct mii_phy_funcs nsphyt }; static const struct mii_phydesc nsphyters[] = { - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83843, - MII_STR_xxNATSEMI_DP83843 }, - - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83847, - MII_STR_xxNATSEMI_DP83847 }, - - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83849, - MII_STR_xxNATSEMI_DP83849 }, - - { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83815, - MII_STR_xxNATSEMI_DP83815 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxNATSEMI, DP83843), + MII_PHY_DESC(xxNATSEMI, DP83847), + MII_PHY_DESC(xxNATSEMI, DP83849), + MII_PHY_DESC(xxNATSEMI, DP83815), + MII_PHY_END, }; static int Index: src/sys/dev/mii/pnaphy.c diff -u src/sys/dev/mii/pnaphy.c:1.22 src/sys/dev/mii/pnaphy.c:1.23 --- src/sys/dev/mii/pnaphy.c:1.22 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/pnaphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pnaphy.c,v 1.22 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: pnaphy.c,v 1.23 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -47,7 +47,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pnaphy.c,v 1.22 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pnaphy.c,v 1.23 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -77,11 +77,8 @@ static const struct mii_phy_funcs pnaphy }; static const struct mii_phydesc pnaphys[] = { - { MII_OUI_yyAMD, MII_MODEL_yyAMD_79c901home, - MII_STR_yyAMD_79c901home }, - - { 0, 0, - NULL }, + MII_PHY_DESC(yyAMD, 79c901home), + MII_PHY_END, }; static int Index: src/sys/dev/mii/qsphy.c diff -u src/sys/dev/mii/qsphy.c:1.50 src/sys/dev/mii/qsphy.c:1.51 --- src/sys/dev/mii/qsphy.c:1.50 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/qsphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: qsphy.c,v 1.50 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: qsphy.c,v 1.51 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.50 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.51 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,11 +92,8 @@ static const struct mii_phy_funcs qsphy_ }; static const struct mii_phydesc qsphys[] = { - { MII_OUI_xxQUALSEMI, MII_MODEL_xxQUALSEMI_QS6612, - MII_STR_xxQUALSEMI_QS6612 }, - - { 0, 0, - NULL }, + MII_PHY_DESC(xxQUALSEMI, QS6612), + MII_PHY_END, }; static int Index: src/sys/dev/mii/rgephy.c diff -u src/sys/dev/mii/rgephy.c:1.47 src/sys/dev/mii/rgephy.c:1.48 --- src/sys/dev/mii/rgephy.c:1.47 Thu Feb 21 10:41:56 2019 +++ src/sys/dev/mii/rgephy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: rgephy.c,v 1.47 2019/02/21 15:41:56 msaitoh Exp $ */ +/* $NetBSD: rgephy.c,v 1.48 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright (c) 2003 @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.47 2019/02/21 15:41:56 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.48 2019/02/24 17:22:21 christos Exp $"); /* @@ -83,17 +83,10 @@ static const struct mii_phy_funcs rgephy }; static const struct mii_phydesc rgephys[] = { - { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S, - MII_STR_xxREALTEK_RTL8169S }, - - { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8169S, - MII_STR_REALTEK_RTL8169S }, - - { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8251, - MII_STR_REALTEK_RTL8251 }, - - { 0, 0, - NULL } + MII_PHY_DESC(xxREALTEK, RTL8169S), + MII_PHY_DESC(REALTEK, RTL8169S), + MII_PHY_DESC(REALTEK, RTL8251), + MII_PHY_END, }; static int Index: src/sys/dev/mii/tlphy.c diff -u src/sys/dev/mii/tlphy.c:1.63 src/sys/dev/mii/tlphy.c:1.64 --- src/sys/dev/mii/tlphy.c:1.63 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/tlphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: tlphy.c,v 1.63 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: tlphy.c,v 1.64 2019/02/24 17:22:21 christos Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.63 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tlphy.c,v 1.64 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -107,11 +107,8 @@ static const struct mii_phy_funcs tlphy_ }; static const struct mii_phydesc tlphys[] = { - { MII_OUI_TI, MII_MODEL_TI_TLAN10T, - MII_STR_TI_TLAN10T }, - - { 0, 0, - NULL }, + MII_PHY_DESC(TI, TLAN10T), + MII_PHY_END, }; static int Index: src/sys/dev/mii/tqphy.c diff -u src/sys/dev/mii/tqphy.c:1.41 src/sys/dev/mii/tqphy.c:1.42 --- src/sys/dev/mii/tqphy.c:1.41 Mon Jan 21 22:42:27 2019 +++ src/sys/dev/mii/tqphy.c Sun Feb 24 12:22:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: tqphy.c,v 1.41 2019/01/22 03:42:27 msaitoh Exp $ */ +/* $NetBSD: tqphy.c,v 1.42 2019/02/24 17:22:21 christos Exp $ */ /* * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.41 2019/01/22 03:42:27 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tqphy.c,v 1.42 2019/02/24 17:22:21 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -92,14 +92,11 @@ static const struct mii_phy_funcs tqphy_ }; static const struct mii_phydesc tqphys[] = { - { MII_OUI_xxTSC, MII_MODEL_xxTSC_78Q2120, - MII_STR_xxTSC_78Q2120 }, + MII_PHY_DESC(xxTSC, 78Q2120), #if 0 - { MII_OUI_xxTSC, MII_MODEL_TSC_78Q2121, - MII_STR_TSC_78Q2121 }, + MII_PHY_DESC(xxTSC, 78Q2121), #endif - { 0, 0, - NULL }, + MII_PHY_END, }; static int