Re: CVS commit: src/sys/dev/mii

2020-02-26 Thread Masanobu SAITOH
On 2020/02/27 15:17, SAITOH Masanobu wrote:
> Module Name:  src
> Committed By: msaitoh
> Date: Thu Feb 27 06:17:28 UTC 2020
> 
> Modified Files:
>   src/sys/dev/mii: miidevs
> 
> Log Message:
>  Use xxVIA instead of VIA.
> 
>  0x004063 is VIA's official OUI but VT6103 use 0x0002c6.
> 0x0002c6 is non-bitreversed value of 0x004063. Reported by Andrius

It was PR kern/55016.

> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.163 -r1.164 src/sys/dev/mii/miidevs
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 


-- 
---
SAITOH Masanobu (msai...@execsw.org
 msai...@netbsd.org)


CVS commit: src/sys/dev/mii

2020-02-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb 27 06:17:50 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb 27 06:17:28 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Use xxVIA instead of VIA.

 0x004063 is VIA's official OUI but VT6103 use 0x0002c6.
0x0002c6 is non-bitreversed value of 0x004063. Reported by Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb 27 06:17:50 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.161 src/sys/dev/mii/miidevs.h:1.162
--- src/sys/dev/mii/miidevs.h:1.161	Sat Feb 22 18:57:09 2020
+++ src/sys/dev/mii/miidevs.h	Thu Feb 27 06:17:50 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.161 2020/02/22 18:57:09 jmcneill Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.162 2020/02/27 06:17:50 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp
+ *	NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp
  */
 
 /*-
@@ -77,7 +77,6 @@
 #define	MII_OUI_AQUANTIA	0x0017b6	/* Aquantia Corporation */
 #define	MII_OUI_BROADCOM3	0x001be9	/* Broadcom Corporation */
 #define	MII_OUI_LEVEL1	0x00207b	/* Level 1 */
-#define	MII_OUI_VIA	0x004063	/* VIA Technologies */
 #define	MII_OUI_MARVELL	0x005043	/* Marvell Semiconductor */
 #define	MII_OUI_QUALSEMI	0x006051	/* Quality Semiconductor */
 #define	MII_OUI_AMLOGIC	0x006051	/* Amlogic */
@@ -103,6 +102,7 @@
 /* Unregistered or wrong OUI */
 #define	MII_OUI_yyREALTEK	0x04	/* Realtek */
 #define	MII_OUI_yyAMD	0x58	/* Advanced Micro Devices */
+#define	MII_OUI_xxVIA	0x0002c6	/* VIA Technologies */
 #define	MII_OUI_xxMYSON	0x00032d	/* Myson Technology */
 #define	MII_OUI_xxTSC	0x00039c	/* TDK Semiconductor */
 #define	MII_OUI_xxASIX	0x000674	/* Asix Semiconductor */
@@ -617,10 +617,10 @@
 #define	MII_STR_xxTSC_78Q2121	"78Q2121 100BASE-TX media interface"
 
 /* VIA Technologies PHYs */
-#define	MII_MODEL_VIA_VT6103	0x0032
-#define	MII_STR_VIA_VT6103	"VT6103 10/100 PHY"
-#define	MII_MODEL_VIA_VT6103_2	0x0034
-#define	MII_STR_VIA_VT6103_2	"VT6103 10/100 PHY"
+#define	MII_MODEL_xxVIA_VT6103	0x0032
+#define	MII_STR_xxVIA_VT6103	"VT6103 10/100 PHY"
+#define	MII_MODEL_xxVIA_VT6103_2	0x0034
+#define	MII_STR_xxVIA_VT6103_2	"VT6103 10/100 PHY"
 
 /* Vitesse PHYs (Now Microsemi) */
 #define	MII_MODEL_xxVITESSE_VSC8601	0x0002

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.149 src/sys/dev/mii/miidevs_data.h:1.150
--- src/sys/dev/mii/miidevs_data.h:1.149	Sat Feb 22 18:57:09 2020
+++ src/sys/dev/mii/miidevs_data.h	Thu Feb 27 06:17:50 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.149 2020/02/22 18:57:09 jmcneill Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.150 2020/02/27 06:17:50 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp
+ *	NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp
  */
 
 /*-
@@ -253,8 +253,8 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_TI, MII_MODEL_TI_TNETE2101, MII_STR_TI_TNETE2101 },
  { MII_OUI_xxTSC, MII_MODEL_xxTSC_78Q2120, MII_STR_xxTSC_78Q2120 },
  { MII_OUI_xxTSC, MII_MODEL_xxTSC_78Q2121, MII_STR_xxTSC_78Q2121 },
- { MII_OUI_VIA, MII_MODEL_VIA_VT6103, MII_STR_VIA_VT6103 },
- { MII_OUI_VIA, MII_MODEL_VIA_VT6103_2, MII_STR_VIA_VT6103_2 },
+ { MII_OUI_xxVIA, MII_MODEL_xxVIA_VT6103, MII_STR_xxVIA_VT6103 },
+ { MII_OUI_xxVIA, MII_MODEL_xxVIA_VT6103_2, MII_STR_xxVIA_VT6103_2 },
  { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8601, MII_STR_xxVITESSE_VSC8601 },
  { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8641, MII_STR_xxVITESSE_VSC8641 },
  { MII_OUI_xxVITESSE, MII_MODEL_xxVITESSE_VSC8501, MII_STR_xxVITESSE_VSC8501 },



CVS commit: src/sys/dev/mii

2020-02-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb 27 06:17:28 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Use xxVIA instead of VIA.

 0x004063 is VIA's official OUI but VT6103 use 0x0002c6.
0x0002c6 is non-bitreversed value of 0x004063. Reported by Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.163 src/sys/dev/mii/miidevs:1.164
--- src/sys/dev/mii/miidevs:1.163	Sat Feb 22 18:56:57 2020
+++ src/sys/dev/mii/miidevs	Thu Feb 27 06:17:28 2020
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp $
+$NetBSD: miidevs,v 1.164 2020/02/27 06:17:28 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -70,7 +70,6 @@ oui RALINK2			0x0017a5	Ralink Technology
 oui AQUANTIA			0x0017b6	Aquantia Corporation
 oui BROADCOM3			0x001be9	Broadcom Corporation
 oui LEVEL1			0x00207b	Level 1
-oui VIA0x004063	VIA Technologies
 oui MARVELL			0x005043	Marvell Semiconductor
 oui QUALSEMI			0x006051	Quality Semiconductor
 oui AMLOGIC			0x006051	Amlogic
@@ -96,6 +95,7 @@ oui RENESAS			0x749050	Renesas
 /* Unregistered or wrong OUI */
 oui yyREALTEK			0x04	Realtek
 oui yyAMD			0x58	Advanced Micro Devices
+oui xxVIA			0x0002c6	VIA Technologies
 oui xxMYSON			0x00032d	Myson Technology
 oui xxTSC			0x00039c	TDK Semiconductor
 oui xxASIX			0x000674	Asix Semiconductor
@@ -399,8 +399,8 @@ model xxTSC 78Q2120		0x0014 78Q2120 10/1
 model xxTSC 78Q2121		0x0015 78Q2121 100BASE-TX media interface
 
 /* VIA Technologies PHYs */
-model VIA VT6103		0x0032	VT6103 10/100 PHY
-model VIA VT6103_2		0x0034	VT6103 10/100 PHY
+model xxVIA VT6103		0x0032	VT6103 10/100 PHY
+model xxVIA VT6103_2		0x0034	VT6103 10/100 PHY
 
 /* Vitesse PHYs (Now Microsemi) */
 model xxVITESSE VSC8601		0x0002 VSC8601 10/100/1000 PHY



CVS commit: src/sys/dev/mii

2020-02-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 22 18:57:31 UTC 2020

Modified Files:
src/sys/dev/mii: brgphy.c

Log Message:
Match BCM54213PE


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mii/brgphy.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/brgphy.c
diff -u src/sys/dev/mii/brgphy.c:1.86 src/sys/dev/mii/brgphy.c:1.87
--- src/sys/dev/mii/brgphy.c:1.86	Wed Nov 27 10:19:20 2019
+++ src/sys/dev/mii/brgphy.c	Sat Feb 22 18:57:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: brgphy.c,v 1.86 2019/11/27 10:19:20 msaitoh Exp $	*/
+/*	$NetBSD: brgphy.c,v 1.87 2020/02/22 18:57:31 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.86 2019/11/27 10:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.87 2020/02/22 18:57:31 jmcneill Exp $");
 
 #include 
 #include 
@@ -178,6 +178,7 @@ static const struct mii_phydesc brgphys[
 	MII_PHY_DESC(BROADCOM3, BCM5720C),
 	MII_PHY_DESC(BROADCOM3, BCM57765),
 	MII_PHY_DESC(BROADCOM3, BCM57780),
+	MII_PHY_DESC(BROADCOM4, BCM54213PE),
 	MII_PHY_DESC(BROADCOM4, BCM5725C),
 	MII_PHY_DESC(xxBROADCOM_ALT1, BCM5906),
 	MII_PHY_END,



CVS commit: src/sys/dev/mii

2020-02-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 22 18:57:09 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 22 18:57:09 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.148 -r1.149 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.160 src/sys/dev/mii/miidevs.h:1.161
--- src/sys/dev/mii/miidevs.h:1.160	Wed Feb  5 06:38:36 2020
+++ src/sys/dev/mii/miidevs.h	Sat Feb 22 18:57:09 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.160 2020/02/05 06:38:36 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.161 2020/02/22 18:57:09 jmcneill Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp
+ *	NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp
  */
 
 /*-
@@ -302,6 +302,8 @@
 #define	MII_STR_BROADCOM3_BCM53125	"BCM53125 1000BASE-T switch"
 #define	MII_MODEL_BROADCOM3_BCM5720C	0x0036
 #define	MII_STR_BROADCOM3_BCM5720C	"BCM5720C 1000BASE-T media interface"
+#define	MII_MODEL_BROADCOM4_BCM54213PE	0x000a
+#define	MII_STR_BROADCOM4_BCM54213PE	"BCM54213PE 1000BASE-T media interface"
 #define	MII_MODEL_BROADCOM4_BCM5725C	0x0038
 #define	MII_STR_BROADCOM4_BCM5725C	"BCM5725C 1000BASE-T media interface"
 #define	MII_MODEL_xxBROADCOM_ALT1_BCM5906	0x0004

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.148 src/sys/dev/mii/miidevs_data.h:1.149
--- src/sys/dev/mii/miidevs_data.h:1.148	Wed Feb  5 06:38:36 2020
+++ src/sys/dev/mii/miidevs_data.h	Sat Feb 22 18:57:09 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.148 2020/02/05 06:38:36 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.149 2020/02/22 18:57:09 jmcneill Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp
+ *	NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp
  */
 
 /*-
@@ -118,6 +118,7 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM57765, MII_STR_BROADCOM3_BCM57765 },
  { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM53125, MII_STR_BROADCOM3_BCM53125 },
  { MII_OUI_BROADCOM3, MII_MODEL_BROADCOM3_BCM5720C, MII_STR_BROADCOM3_BCM5720C },
+ { MII_OUI_BROADCOM4, MII_MODEL_BROADCOM4_BCM54213PE, MII_STR_BROADCOM4_BCM54213PE },
  { 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 },
  { MII_OUI_xxCICADA, MII_MODEL_xxCICADA_CIS8201, MII_STR_xxCICADA_CIS8201 },



CVS commit: src/sys/dev/mii

2020-02-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 22 18:57:31 UTC 2020

Modified Files:
src/sys/dev/mii: brgphy.c

Log Message:
Match BCM54213PE


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/mii/brgphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 22 18:56:57 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
Add BCM54213PE


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-22 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Feb 22 18:56:57 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
Add BCM54213PE


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.162 src/sys/dev/mii/miidevs:1.163
--- src/sys/dev/mii/miidevs:1.162	Wed Feb  5 06:38:20 2020
+++ src/sys/dev/mii/miidevs	Sat Feb 22 18:56:57 2020
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp $
+$NetBSD: miidevs,v 1.163 2020/02/22 18:56:57 jmcneill Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -219,6 +219,7 @@ model BROADCOM3 BCM5719C	0x0022 BCM5719C
 model BROADCOM3 BCM57765	0x0024 BCM57765 1000BASE-T media interface
 model BROADCOM3 BCM53125	0x0032 BCM53125 1000BASE-T switch
 model BROADCOM3 BCM5720C	0x0036 BCM5720C 1000BASE-T media interface
+model BROADCOM4 BCM54213PE	0x000a BCM54213PE 1000BASE-T media interface
 model BROADCOM4 BCM5725C	0x0038 BCM5725C 1000BASE-T media interface
 model xxBROADCOM_ALT1 BCM5906	0x0004 BCM5906 10/100baseTX media interface
 



CVS commit: src/sys/dev/mii

2020-02-14 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Feb 14 14:17:42 UTC 2020

Modified Files:
src/sys/dev/mii: dmphy.c

Log Message:
unbreak the previous commit error


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/mii/dmphy.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/dmphy.c
diff -u src/sys/dev/mii/dmphy.c:1.45 src/sys/dev/mii/dmphy.c:1.46
--- src/sys/dev/mii/dmphy.c:1.45	Fri Feb 14 14:14:45 2020
+++ src/sys/dev/mii/dmphy.c	Fri Feb 14 14:17:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $	*/
+/*	$NetBSD: dmphy.c,v 1.46 2020/02/14 14:17:42 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.46 2020/02/14 14:17:42 nisimura Exp $");
 
 #include 
 #include 
@@ -241,7 +241,7 @@ dmphy_status(struct mii_softc *sc)
 		else
 			mii->mii_media_active |= IFM_NONE;
 		if (mii->mii_media_active & IFM_FDX)
-			mii->mii_media_active |= mii_phy_flowstatus(phy);
+			mii->mii_media_active |= mii_phy_flowstatus(sc);
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }



CVS commit: src/sys/dev/mii

2020-02-14 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Feb 14 14:17:42 UTC 2020

Modified Files:
src/sys/dev/mii: dmphy.c

Log Message:
unbreak the previous commit error


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/mii/dmphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-14 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Feb 14 14:14:45 UTC 2020

Modified Files:
src/sys/dev/mii: dmphy.c

Log Message:
determine FDX flow control abilities


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/mii/dmphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-14 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Feb 14 14:14:45 UTC 2020

Modified Files:
src/sys/dev/mii: dmphy.c

Log Message:
determine FDX flow control abilities


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/mii/dmphy.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/dmphy.c
diff -u src/sys/dev/mii/dmphy.c:1.44 src/sys/dev/mii/dmphy.c:1.45
--- src/sys/dev/mii/dmphy.c:1.44	Wed Nov 27 10:19:20 2019
+++ src/sys/dev/mii/dmphy.c	Fri Feb 14 14:14:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmphy.c,v 1.44 2019/11/27 10:19:20 msaitoh Exp $	*/
+/*	$NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.44 2019/11/27 10:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dmphy.c,v 1.45 2020/02/14 14:14:45 nisimura Exp $");
 
 #include 
 #include 
@@ -240,6 +240,8 @@ dmphy_status(struct mii_softc *sc)
 			mii->mii_media_active |= IFM_10_T | IFM_HDX;
 		else
 			mii->mii_media_active |= IFM_NONE;
+		if (mii->mii_media_active & IFM_FDX)
+			mii->mii_media_active |= mii_phy_flowstatus(phy);
 	} else
 		mii->mii_media_active = ife->ifm_media;
 }



CVS commit: src/sys/dev/mii

2020-02-14 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Feb 14 12:14:34 UTC 2020

Modified Files:
src/sys/dev/mii: micphy.c

Log Message:
add missing two aprint_normal* lines


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/micphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-14 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Feb 14 12:14:34 UTC 2020

Modified Files:
src/sys/dev/mii: micphy.c

Log Message:
add missing two aprint_normal* lines


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/mii/micphy.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/micphy.c
diff -u src/sys/dev/mii/micphy.c:1.11 src/sys/dev/mii/micphy.c:1.12
--- src/sys/dev/mii/micphy.c:1.11	Fri Dec 13 08:30:26 2019
+++ src/sys/dev/mii/micphy.c	Fri Feb 14 12:14:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $	*/
+/*	$NetBSD: micphy.c,v 1.12 2020/02/14 12:14:33 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.12 2020/02/14 12:14:33 nisimura Exp $");
 
 #include "opt_mii.h"
 
@@ -241,7 +241,9 @@ micphyattach(device_t parent, device_t s
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
 
+	aprint_normal_dev(self, "");
 	mii_phy_add_media(sc);
+	aprint_normal("\n");
 }
 
 static void



CVS commit: src/sys/dev/mii

2020-02-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  5 06:39:13 UTC 2020

Modified Files:
src/sys/dev/mii: rdcphy.c

Log Message:
RDC -> xxRDC. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/rdcphy.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/rdcphy.c
diff -u src/sys/dev/mii/rdcphy.c:1.5 src/sys/dev/mii/rdcphy.c:1.6
--- src/sys/dev/mii/rdcphy.c:1.5	Wed Nov 27 10:19:21 2019
+++ src/sys/dev/mii/rdcphy.c	Wed Feb  5 06:39:13 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: rdcphy.c,v 1.5 2019/11/27 10:19:21 msaitoh Exp $*/
+/*  $NetBSD: rdcphy.c,v 1.6 2020/02/05 06:39:13 msaitoh Exp $*/
 
 /*-
  * Copyright (c) 2010, Pyun YongHyeon 
@@ -33,7 +33,7 @@
  * Driver for the RDC Semiconductor R6040 10/100 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.5 2019/11/27 10:19:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rdcphy.c,v 1.6 2020/02/05 06:39:13 msaitoh Exp $");
 
 #include 
 #include 
@@ -74,7 +74,7 @@ static const struct mii_phy_funcs rdcphy
 };
 
 static const struct mii_phydesc rdcphys[] = {
-	MII_PHY_DESC(RDC, R6040),
+	MII_PHY_DESC(xxRDC, R6040),
 	MII_PHY_END,
 };
 



CVS commit: src/sys/dev/mii

2020-02-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  5 06:39:13 UTC 2020

Modified Files:
src/sys/dev/mii: rdcphy.c

Log Message:
RDC -> xxRDC. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/rdcphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  5 06:38:36 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  5 06:38:36 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.147 -r1.148 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.159 src/sys/dev/mii/miidevs.h:1.160
--- src/sys/dev/mii/miidevs.h:1.159	Wed Nov  6 16:00:33 2019
+++ src/sys/dev/mii/miidevs.h	Wed Feb  5 06:38:36 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.159 2019/11/06 16:00:33 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.160 2020/02/05 06:38:36 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp
+ *	NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp
  */
 
 /*-
@@ -89,7 +89,6 @@
 #define	MII_OUI_TSC	0x00c039	/* TDK Semiconductor */
 #define	MII_OUI_MYSON	0x00c0b4	/* Myson Technology */
 #define	MII_OUI_ATTANSIC	0x00c82e	/* Attansic Technology */
-#define	MII_OUI_RDC	0x00d02d	/* RDC Semiconductor */
 #define	MII_OUI_JMICRON	0x00d831	/* JMicron */
 #define	MII_OUI_PMCSIERRA	0x00e004	/* PMC-Sierra */
 #define	MII_OUI_SIS	0x00e006	/* Silicon Integrated Systems */
@@ -122,6 +121,7 @@
 #define	MII_OUI_xxVITESSE	0x008083	/* Vitesse Semiconductor */
 #define	MII_OUI_xxPMCSIERRA2	0x009057	/* PMC-Sierra */
 #define	MII_OUI_xxCICADA	0x00c08f	/* Cicada Semiconductor */
+#define	MII_OUI_xxRDC	0x00d02d	/* RDC Semiconductor */
 #define	MII_OUI_xxNATSEMI	0x1000e8	/* National Semiconductor */
 #define	MII_OUI_xxLEVEL1	0x782000	/* Level 1 */
 #define	MII_OUI_xxXAQTI	0xace000	/* XaQti Corp. */
@@ -555,8 +555,8 @@
 #define	MII_STR_xxQUALSEMI_QS6612	"QS6612 10/100 media interface"
 
 /* RDC Semiconductor PHYs */
-#define	MII_MODEL_RDC_R6040	0x0003
-#define	MII_STR_RDC_R6040	"R6040 10/100 media interface"
+#define	MII_MODEL_xxRDC_R6040	0x0003
+#define	MII_STR_xxRDC_R6040	"R6040 10/100 media interface"
 
 /* RealTek PHYs */
 #define	MII_MODEL_xxREALTEK_RTL8169S	0x0011

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.147 src/sys/dev/mii/miidevs_data.h:1.148
--- src/sys/dev/mii/miidevs_data.h:1.147	Wed Nov  6 16:00:33 2019
+++ src/sys/dev/mii/miidevs_data.h	Wed Feb  5 06:38:36 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.147 2019/11/06 16:00:33 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.148 2020/02/05 06:38:36 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp
+ *	NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp
  */
 
 /*-
@@ -229,7 +229,7 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_xxPMCSIERRA2, MII_MODEL_xxPMCSIERRA2_PM8353, MII_STR_xxPMCSIERRA2_PM8353 },
  { MII_OUI_PMCSIERRA, MII_MODEL_PMCSIERRA_PM8354, MII_STR_PMCSIERRA_PM8354 },
  { MII_OUI_xxQUALSEMI, MII_MODEL_xxQUALSEMI_QS6612, MII_STR_xxQUALSEMI_QS6612 },
- { MII_OUI_RDC, MII_MODEL_RDC_R6040, MII_STR_RDC_R6040 },
+ { MII_OUI_xxRDC, MII_MODEL_xxRDC_R6040, MII_STR_xxRDC_R6040 },
  { MII_OUI_xxREALTEK, MII_MODEL_xxREALTEK_RTL8169S, MII_STR_xxREALTEK_RTL8169S },
  { MII_OUI_yyREALTEK, MII_MODEL_yyREALTEK_RTL8201L, MII_STR_yyREALTEK_RTL8201L },
  { MII_OUI_REALTEK, MII_MODEL_REALTEK_RTL8251, MII_STR_REALTEK_RTL8251 },



CVS commit: src/sys/dev/mii

2020-02-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  5 06:38:20 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Change the OUI macro name of RDC to xxRDC. 0x00d02d is non-bitreverse value
of official 0x000bb4. From Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2020-02-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Feb  5 06:38:20 UTC 2020

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Change the OUI macro name of RDC to xxRDC. 0x00d02d is non-bitreverse value
of official 0x000bb4. From Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.161 src/sys/dev/mii/miidevs:1.162
--- src/sys/dev/mii/miidevs:1.161	Wed Nov  6 16:00:02 2019
+++ src/sys/dev/mii/miidevs	Wed Feb  5 06:38:20 2020
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp $
+$NetBSD: miidevs,v 1.162 2020/02/05 06:38:20 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -82,7 +82,6 @@ oui INTEL			0x00aa00	Intel
 oui TSC0x00c039	TDK Semiconductor
 oui MYSON			0x00c0b4	Myson Technology
 oui ATTANSIC			0x00c82e	Attansic Technology
-oui RDC0x00d02d	RDC Semiconductor
 oui JMICRON			0x00d831	JMicron
 oui PMCSIERRA			0x00e004	PMC-Sierra
 oui SIS0x00e006	Silicon Integrated Systems
@@ -115,6 +114,7 @@ oui yyASIX			0x007063	Asix Semiconductor
 oui xxVITESSE			0x008083	Vitesse Semiconductor
 oui xxPMCSIERRA2		0x009057	PMC-Sierra
 oui xxCICADA			0x00c08f	Cicada Semiconductor
+oui xxRDC			0x00d02d	RDC Semiconductor
 oui xxNATSEMI			0x1000e8	National Semiconductor
 oui xxLEVEL1			0x782000	Level 1
 oui xxXAQTI			0xace000	XaQti Corp.
@@ -361,7 +361,7 @@ model PMCSIERRA PM8354		0x0004 PM8354 Qu
 model xxQUALSEMI QS6612		0x QS6612 10/100 media interface
 
 /* RDC Semiconductor PHYs */
-model RDC R6040			0x0003 R6040 10/100 media interface
+model xxRDC R6040		0x0003 R6040 10/100 media interface
 
 /* RealTek PHYs */
 model xxREALTEK RTL8169S	0x0011 RTL8169S/8110S/8211 1000BASE-T media interface



CVS commit: src/sys/dev/mii

2020-01-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 28 05:08:02 UTC 2020

Modified Files:
src/sys/dev/mii: makphy.c

Log Message:
 Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/mii/makphy.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/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.63 src/sys/dev/mii/makphy.c:1.64
--- src/sys/dev/mii/makphy.c:1.63	Thu Dec 12 09:25:37 2019
+++ src/sys/dev/mii/makphy.c	Tue Jan 28 05:08:02 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $	*/
+/*	$NetBSD: makphy.c,v 1.64 2020/01/28 05:08:02 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.64 2020/01/28 05:08:02 msaitoh Exp $");
 
 #include 
 #include 
@@ -213,7 +213,7 @@ page0:
 		!= 0)) {
 		bool fiberonly = false, copperonly = false;
 
-		/* Both copper and fiber is set. check MODE[] */
+		/* Both copper and fiber are set. check MODE[] */
 		switch (sc->mii_mpd_model) {
 		case MII_MODEL_xxMARVELL_E1011:
 		case MII_MODEL_xxMARVELL_E:



CVS commit: src/sys/dev/mii

2020-01-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Jan 28 05:08:02 UTC 2020

Modified Files:
src/sys/dev/mii: makphy.c

Log Message:
 Fix comment.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/mii/makphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-12-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 13 08:30:26 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c micphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/mii/micphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-12-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Dec 13 08:30:26 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c micphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.10 -r1.11 src/sys/dev/mii/micphy.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/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.26 src/sys/dev/mii/atphy.c:1.27
--- src/sys/dev/mii/atphy.c:1.26	Wed Nov 27 10:19:20 2019
+++ src/sys/dev/mii/atphy.c	Fri Dec 13 08:30:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.26 2019/11/27 10:19:20 msaitoh Exp $ */
+/*	$NetBSD: atphy.c,v 1.27 2019/12/13 08:30:26 msaitoh Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.26 2019/11/27 10:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.27 2019/12/13 08:30:26 msaitoh Exp $");
 
 #include 
 #include 
@@ -99,7 +99,7 @@ CFATTACH_DECL_NEW(atphy, sizeof(struct a
 	atphy_match, atphy_attach, mii_phy_detach, mii_phy_activate);
 
 const struct mii_phy_funcs atphy_funcs = {
-atphy_service, atphy_status, atphy_reset,
+	atphy_service, atphy_status, atphy_reset,
 };
 
 static const struct mii_phydesc atphys[] = {
@@ -192,8 +192,10 @@ atphy_attach(device_t parent, device_t s
 	sc->mii_flags = ma->mii_flags;
 	sc->mii_flags |= MIIF_NOLOOP;
 
-	prop_dictionary_get_bool(parent_prop, "tx_internal_delay", >rgmii_tx_internal_delay);
-	prop_dictionary_get_bool(parent_prop, "rx_internal_delay", >rgmii_rx_internal_delay);
+	prop_dictionary_get_bool(parent_prop, "tx_internal_delay",
+	>rgmii_tx_internal_delay);
+	prop_dictionary_get_bool(parent_prop, "rx_internal_delay",
+	>rgmii_rx_internal_delay);
 
 	prop_dictionary_get_uint32(prop, "clk_25m", >mii_clk_25m);
 	if (asc->mii_clk_25m != 0)

Index: src/sys/dev/mii/micphy.c
diff -u src/sys/dev/mii/micphy.c:1.10 src/sys/dev/mii/micphy.c:1.11
--- src/sys/dev/mii/micphy.c:1.10	Wed Nov 27 10:19:20 2019
+++ src/sys/dev/mii/micphy.c	Fri Dec 13 08:30:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: micphy.c,v 1.10 2019/11/27 10:19:20 msaitoh Exp $	*/
+/*	$NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.10 2019/11/27 10:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: micphy.c,v 1.11 2019/12/13 08:30:26 msaitoh Exp $");
 
 #include "opt_mii.h"
 
@@ -113,7 +113,7 @@ static const struct mii_phydesc micphys[
 };
 
 /*
- * Model Rev. Media  LSTYPE Devices	   
+ * Model Rev. Media  LSTYPE Devices
  *
  * 0x11	  1001F_42  KSZ8041
  * 0x13	  1001F_42? KSZ8041RNLI
@@ -129,10 +129,10 @@ static const struct mii_phydesc micphys[
  * 	 0x9  100none?  KSZ8721CL
  * 	 0xa  1001F_42  KSZ8001
  * 0x22	  giga   GIGA   KSZ9031
- * 0x23	   1? gigasw GIGA   KSZ9477 (No master/slave bit) 
+ * 0x23	   1? gigasw GIGA   KSZ9477 (No master/slave bit)
  * 	   5? giga   GIGA   LAN7430internal
- * 0x24	  giga   GIGA   KSZ9131	   
- * 0x32	  1001F_42  KS8737	   
+ * 0x24	  giga   GIGA   KSZ9131
+ * 0x32	  1001F_42  KS8737
  */
 
 /* Type of link status register */



CVS commit: src/sys/dev/mii

2019-12-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 12 09:25:37 UTC 2019

Modified Files:
src/sys/dev/mii: makphy.c makphyreg.h

Log Message:
- Remove ESSR_FIBER_LINK bit check in makphyattach(). This bit is valid only
  when the link is up, so it's not good to check in the attach function.
- There is an environment that both copper and fiber bits are set in EXTSR
  but it support copper only. To resolve this problem, check the ESSR
  register's HWCFG_MODE bit and drop unsupported bits.
- If the chip is in Fiber/Copper auto select mode, check which media is
  selected. Currently, the code supports 88E1011, 88E and 88E1112 only.
  To support other chips documents are required.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/makphyreg.h

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/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.62 src/sys/dev/mii/makphy.c:1.63
--- src/sys/dev/mii/makphy.c:1.62	Wed Nov 27 10:19:20 2019
+++ src/sys/dev/mii/makphy.c	Thu Dec 12 09:25:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.62 2019/11/27 10:19:20 msaitoh Exp $	*/
+/*	$NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.62 2019/11/27 10:19:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.63 2019/12/12 09:25:37 msaitoh Exp $");
 
 #include 
 #include 
@@ -200,21 +200,6 @@ page0:
 		break;
 	}
 
-	switch (model) {
-	case MII_MODEL_xxMARVELL_E1011:
-	case MII_MODEL_xxMARVELL_E1112:
-		if (PHY_READ(sc, MAKPHY_ESSR, ) != 0) {
-			aprint_verbose_dev(self,
-			"Failed to read MAKPHY_ESSR\n");
-			break;
-		}
-		if (reg & ESSR_FIBER_LINK)
-			sc->mii_flags |= MIIF_HAVEFIBER;
-		break;
-	default:
-		break;
-	}
-
 	PHY_RESET(sc);
 
 	PHY_READ(sc, MII_BMSR, >mii_capabilities);
@@ -222,6 +207,54 @@ page0:
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
 
+	if (((sc->mii_extcapabilities & (EXTSR_1000TFDX | EXTSR_1000THDX))
+		!= 0)
+	&& ((sc->mii_extcapabilities & (EXTSR_1000XFDX | EXTSR_1000XHDX))
+		!= 0)) {
+		bool fiberonly = false, copperonly = false;
+
+		/* Both copper and fiber is set. check MODE[] */
+		switch (sc->mii_mpd_model) {
+		case MII_MODEL_xxMARVELL_E1011:
+		case MII_MODEL_xxMARVELL_E:
+			/* These devices have ESSR register */
+			PHY_READ(sc, MAKPHY_ESSR, );
+			if ((reg & ESSR_AUTOSEL_DISABLE) != 0) {
+switch (reg & ESSR_HWCFG_MODE) {
+case ESSR_RTBI_FIBER:
+case ESSR_RGMII_FIBER:
+case ESSR_RGMII_SGMII: /* right? */
+case ESSR_TBI_FIBER:
+case ESSR_GMII_FIBER:
+	fiberonly = true;
+	break;
+case ESSR_SGMII_WC_COPPER:
+case ESSR_SGMII_WOC_COPPER:
+case ESSR_RTBI_COPPER:
+case ESSR_RGMII_COPPER:
+case ESSR_GMII_COPPER:
+	copperonly = true;
+default:
+	break;
+}
+			}
+			break;
+		default:
+			break;
+		}
+		if (fiberonly || copperonly)
+			aprint_debug_dev(self, "both copper and fiber are set "
+			"but MODE[] is %s only.\n",
+			fiberonly ? "fiber" : "copper");
+		if (fiberonly)
+			sc->mii_extcapabilities
+			&= ~(EXTSR_1000TFDX | EXTSR_1000THDX);
+		else if (copperonly) {
+			sc->mii_extcapabilities
+			&= ~(EXTSR_1000XFDX | EXTSR_1000XHDX);
+			sc->mii_flags &= ~MIIF_IS_1000X;
+		}
+	}
 	mii_phy_add_media(sc);
 }
 
@@ -378,7 +411,7 @@ static void
 makphy_status(struct mii_softc *sc)
 {
 	struct mii_data *mii = sc->mii_pdata;
-	uint16_t bmcr, gsr, pssr;
+	uint16_t bmcr, gsr, pssr, essr;
 
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
@@ -416,10 +449,45 @@ makphy_status(struct mii_softc *sc)
 		}
 	}
 
-	/* XXX FIXME: Use different page for Fiber on newer chips */
+	/*
+	 * XXX The following code support Fiber/Copper auto select mode
+	 * only for 88E1011, 88E and 88E1112. For other chips, the document
+	 * is required.
+	 */
 	if (sc->mii_flags & MIIF_IS_1000X) {
+		/* Not in Fiber/Copper auto select mode */
+		mii->mii_media_active |= IFM_1000_SX;
+	} else if ((sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1011) ||
+	(sc->mii_mpd_model == MII_MODEL_xxMARVELL_E)) {
+		/* Fiber/Copper auto select mode */
+
+		PHY_READ(sc, MAKPHY_ESSR, );
+		if ((essr & ESSR_FIBER_LINK) == 0)
+			goto copper;
+
+		/* XXX Assume 1000BASE-SX only */
 		mii->mii_media_active |= IFM_1000_SX;
+	} else if (sc->mii_mpd_model == MII_MODEL_xxMARVELL_E1112) {
+		/* Fiber/Copper auto select mode */
+
+		PHY_READ(sc, MAKPHY_PSSR, );
+		if ((pssr & PSSR_RESOLUTION_FIBER) == 0)
+			goto copper;
+
+		switch (PSSR_SPEED_get(pssr)) {
+		case SPEED_1000:
+			mii->mii_media_active |= IFM_1000_SX;
+			break;
+		case SPEED_100:
+			mii->mii_media_active |= IFM_100_FX;
+			break;
+		

CVS commit: src/sys/dev/mii

2019-12-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Dec 12 09:25:37 UTC 2019

Modified Files:
src/sys/dev/mii: makphy.c makphyreg.h

Log Message:
- Remove ESSR_FIBER_LINK bit check in makphyattach(). This bit is valid only
  when the link is up, so it's not good to check in the attach function.
- There is an environment that both copper and fiber bits are set in EXTSR
  but it support copper only. To resolve this problem, check the ESSR
  register's HWCFG_MODE bit and drop unsupported bits.
- If the chip is in Fiber/Copper auto select mode, check which media is
  selected. Currently, the code supports 88E1011, 88E and 88E1112 only.
  To support other chips documents are required.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/makphyreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 11 02:22:39 UTC 2019

Modified Files:
src/sys/dev/mii: files.mii

Log Message:
 Add ukphy_subr flag to ipgphy to make kernel compilable with ipgphy and
without ukphy. Pointed out by Hauke.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/files.mii

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/files.mii
diff -u src/sys/dev/mii/files.mii:1.53 src/sys/dev/mii/files.mii:1.54
--- src/sys/dev/mii/files.mii:1.53	Fri Nov  1 02:53:22 2019
+++ src/sys/dev/mii/files.mii	Wed Dec 11 02:22:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mii,v 1.53 2019/11/01 02:53:22 msaitoh Exp $
+#	$NetBSD: files.mii,v 1.54 2019/12/11 02:22:38 msaitoh Exp $
 
 defflag	opt_mii.h	MIIVERBOSE
 
@@ -99,7 +99,7 @@ device	ikphy: mii_phy
 attach	ikphy at mii
 file	dev/mii/ikphy.cikphy
 
-device	ipgphy: mii_phy
+device	ipgphy: mii_phy, ukphy_subr
 attach	ipgphy at mii
 file	dev/mii/ipgphy.c			ipgphy
 



CVS commit: src/sys/dev/mii

2019-12-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 11 02:22:39 UTC 2019

Modified Files:
src/sys/dev/mii: files.mii

Log Message:
 Add ukphy_subr flag to ipgphy to make kernel compilable with ipgphy and
without ukphy. Pointed out by Hauke.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/mii/files.mii

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-12-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec  2 21:24:50 UTC 2019

Modified Files:
src/sys/dev/mii: devlist2h.awk

Log Message:
Fix s/product/model/ search-and-destroy accident that affected license.

Back in 1998 thorpej@ adapted this from one of the several versions we
have in the tree but needed s/product/model/ in the text of the
script.  Unfortunately that also affected the license text: "This
model includes software..." and "...or promote models".


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/devlist2h.awk

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/devlist2h.awk
diff -u src/sys/dev/mii/devlist2h.awk:1.9 src/sys/dev/mii/devlist2h.awk:1.10
--- src/sys/dev/mii/devlist2h.awk:1.9	Mon Mar 25 09:46:24 2019
+++ src/sys/dev/mii/devlist2h.awk	Mon Dec  2 21:24:50 2019
@@ -1,5 +1,5 @@
 #! /usr/bin/awk -f
-#	$NetBSD: devlist2h.awk,v 1.9 2019/03/25 09:46:24 msaitoh Exp $
+#	$NetBSD: devlist2h.awk,v 1.10 2019/12/02 21:24:50 uwe Exp $
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -41,8 +41,8 @@
 #documentation and/or other materials provided with the distribution.
 # 3. All advertising materials mentioning features or use of this software
 #must display the following acknowledgement:
-#  This model includes software developed by Christopher G. Demetriou.
-# 4. The name of the author(s) may not be used to endorse or promote models
+#  This product includes software developed by Christopher G. Demetriou.
+# 4. The name of the author(s) may not be used to endorse or promote products
 #derived from this software without specific prior written permission
 #
 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR



CVS commit: src/sys/dev/mii

2019-12-02 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Mon Dec  2 21:24:50 UTC 2019

Modified Files:
src/sys/dev/mii: devlist2h.awk

Log Message:
Fix s/product/model/ search-and-destroy accident that affected license.

Back in 1998 thorpej@ adapted this from one of the several versions we
have in the tree but needed s/product/model/ in the text of the
script.  Unfortunately that also affected the license text: "This
model includes software..." and "...or promote models".


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/mii/devlist2h.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 08:53:32 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 Print dmesg correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/ipgphy.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/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.6 src/sys/dev/mii/ipgphy.c:1.7
--- src/sys/dev/mii/ipgphy.c:1.6	Thu Nov 21 09:48:57 2019
+++ src/sys/dev/mii/ipgphy.c	Wed Nov 27 08:53:32 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $ */
+/*	$NetBSD: ipgphy.c,v 1.7 2019/11/27 08:53:32 msaitoh Exp $ */
 /*	$OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.7 2019/11/27 08:53:32 msaitoh Exp $");
 
 #include 
 #include 
@@ -119,6 +119,7 @@ ipgphy_attach(device_t parent, device_t 
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
 
+	aprint_normal_dev(self, "");
 	mii_phy_add_media(sc);
 	aprint_normal("\n");
 }



CVS commit: src/sys/dev/mii

2019-11-27 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 27 08:53:32 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 Print dmesg correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/mii/ipgphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:21:03 UTC 2019

Modified Files:
src/sys/dev/mii: amhphy.c brgphy.c glxtphy.c gphyter.c ikphy.c

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/amhphy.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/mii/ikphy.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/amhphy.c
diff -u src/sys/dev/mii/amhphy.c:1.23 src/sys/dev/mii/amhphy.c:1.24
--- src/sys/dev/mii/amhphy.c:1.23	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/amhphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: amhphy.c,v 1.24 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.23 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amhphy.c,v 1.24 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -200,7 +200,7 @@ amhphy_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/brgphy.c
diff -u src/sys/dev/mii/brgphy.c:1.84 src/sys/dev/mii/brgphy.c:1.85
--- src/sys/dev/mii/brgphy.c:1.84	Thu Apr 11 08:50:20 2019
+++ src/sys/dev/mii/brgphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $	*/
+/*	$NetBSD: brgphy.c,v 1.85 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.84 2019/04/11 08:50:20 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.85 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -491,7 +491,7 @@ brgphy_copper_status(struct mii_softc *s
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/glxtphy.c
diff -u src/sys/dev/mii/glxtphy.c:1.29 src/sys/dev/mii/glxtphy.c:1.30
--- src/sys/dev/mii/glxtphy.c:1.29	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/glxtphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: glxtphy.c,v 1.29 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: glxtphy.c,v 1.30 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.29 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: glxtphy.c,v 1.30 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -223,7 +223,7 @@ glxtphy_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((qsr & QSR_ACOMP) == 0) {

Index: src/sys/dev/mii/gphyter.c
diff -u src/sys/dev/mii/gphyter.c:1.34 src/sys/dev/mii/gphyter.c:1.35
--- src/sys/dev/mii/gphyter.c:1.34	Thu Nov 21 09:48:57 2019
+++ src/sys/dev/mii/gphyter.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $	*/
+/*	$NetBSD: gphyter.c,v 1.35 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.35 2019/11/26 08:21:03 msaitoh Exp $");
 
 #include 
 #include 
@@ -255,7 +255,7 @@ gphyter_status(struct mii_softc *sc)
 
 	if (bmcr & BMCR_AUTOEN) {
 		/*
-		 * The media status bits are only valid of autonegotiation
+		 * The media status bits are only valid if autonegotiation
 		 * has completed (or it's disabled).
 		 */
 		if ((bmsr & BMSR_ACOMP) == 0) {

Index: src/sys/dev/mii/ikphy.c
diff -u src/sys/dev/mii/ikphy.c:1.16 src/sys/dev/mii/ikphy.c:1.17
--- src/sys/dev/mii/ikphy.c:1.16	Wed Sep  4 06:28:30 2019
+++ src/sys/dev/mii/ikphy.c	Tue Nov 26 08:21:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ikphy.c,v 1.16 2019/09/04 06:28:30 msaitoh Exp $	*/
+/*	$NetBSD: ikphy.c,v 1.17 2019/11/26 08:21:03 msaitoh Exp $	*/
 
 /***
 Copyright (c) 2001-2005, Intel Corporation 
@@ -59,7 +59,7 @@ POSSIBILITY OF SUCH 

CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:21:03 UTC 2019

Modified Files:
src/sys/dev/mii: amhphy.c brgphy.c glxtphy.c gphyter.c ikphy.c

Log Message:
 Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/dev/mii/amhphy.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/mii/brgphy.c
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/mii/glxtphy.c
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/mii/ikphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:19:51 UTC 2019

Modified Files:
src/sys/dev/mii: jmphy.c makphy.c qsphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/qsphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-26 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 26 08:19:51 UTC 2019

Modified Files:
src/sys/dev/mii: jmphy.c makphy.c qsphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/jmphy.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/mii/makphy.c
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/mii/qsphy.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/jmphy.c
diff -u src/sys/dev/mii/jmphy.c:1.1 src/sys/dev/mii/jmphy.c:1.2
--- src/sys/dev/mii/jmphy.c:1.1	Wed Oct 30 12:06:26 2019
+++ src/sys/dev/mii/jmphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: jmphy.c,v 1.1 2019/10/30 12:06:26 msaitoh Exp $ */
+/*	$NetBSD: jmphy.c,v 1.2 2019/11/26 08:19:51 msaitoh Exp $ */
 /*	$OpenBSD: jmphy.c,v 1.6 2015/03/14 03:38:48 jsg Exp $	*/
 /*-
  * Copyright (c) 2008, Pyun YongHyeon 
@@ -127,9 +127,7 @@ jmphy_service(struct mii_softc *sc, stru
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -145,9 +143,7 @@ jmphy_service(struct mii_softc *sc, stru
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -156,21 +152,15 @@ jmphy_service(struct mii_softc *sc, stru
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 
-		/*
-		 * Is the interface even up?
-		 */
+		/* Is the interface even up? */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			return 0;
 
-		/*
-		 * Only used for autonegotiation.
-		 */
+		/* Only used for autonegotiation. */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
 			break;
 

Index: src/sys/dev/mii/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.60 src/sys/dev/mii/makphy.c:1.61
--- src/sys/dev/mii/makphy.c:1.60	Wed Jul  3 17:40:29 2019
+++ src/sys/dev/mii/makphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $	*/
+/*	$NetBSD: makphy.c,v 1.61 2019/11/26 08:19:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.60 2019/07/03 17:40:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: makphy.c,v 1.61 2019/11/26 08:19:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -240,9 +240,7 @@ makphy_reset(struct mii_softc *sc)
 
 	mii_phy_reset(sc);
 
-	/*
-	 * Initialize PHY Specific Control Register.
-	 */
+	/* Initialize PHY Specific Control Register. */
 	PHY_READ(sc, MAKPHY_PSCR, );
 
 	/* Assert CRS on transmit. */

Index: src/sys/dev/mii/qsphy.c
diff -u src/sys/dev/mii/qsphy.c:1.52 src/sys/dev/mii/qsphy.c:1.53
--- src/sys/dev/mii/qsphy.c:1.52	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/qsphy.c	Tue Nov 26 08:19:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: qsphy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: qsphy.c,v 1.53 2019/11/26 08:19:51 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.52 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qsphy.c,v 1.53 2019/11/26 08:19:51 msaitoh Exp $");
 
 #include 
 #include 
@@ -147,9 +147,7 @@ qsphy_service(struct mii_softc *sc, stru
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -165,9 +163,7 @@ qsphy_service(struct mii_softc *sc, stru
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -175,9 +171,7 @@ qsphy_service(struct mii_softc *sc, stru
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 



CVS commit: src/sys/dev/mii

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:48:57 UTC 2019

Modified Files:
src/sys/dev/mii: gphyter.c ipgphy.c

Log Message:
 Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/ipgphy.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/gphyter.c
diff -u src/sys/dev/mii/gphyter.c:1.33 src/sys/dev/mii/gphyter.c:1.34
--- src/sys/dev/mii/gphyter.c:1.33	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/gphyter.c	Thu Nov 21 09:48:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: gphyter.c,v 1.33 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.33 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gphyter.c,v 1.34 2019/11/21 09:48:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -264,7 +264,7 @@ gphyter_status(struct mii_softc *sc)
 			return;
 		}
 
-		switch (physup & (PHY_SUP_SPEED1|PHY_SUP_SPEED0)) {
+		switch (physup & (PHY_SUP_SPEED1 | PHY_SUP_SPEED0)) {
 		case PHY_SUP_SPEED1:
 			mii->mii_media_active |= IFM_1000_T;
 			PHY_READ(sc, MII_100T2SR, );

Index: src/sys/dev/mii/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.5 src/sys/dev/mii/ipgphy.c:1.6
--- src/sys/dev/mii/ipgphy.c:1.5	Thu Nov 21 03:04:21 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 21 09:48:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $ */
+/*	$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $ */
 /*	$OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6 2019/11/21 09:48:57 msaitoh Exp $");
 
 #include 
 #include 
@@ -118,7 +118,7 @@ ipgphy_attach(device_t parent, device_t 
 	//sc->mii_capabilities &= ~BMSR_ANEG;
 	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		PHY_READ(sc, MII_EXTSR, >mii_extcapabilities);
- 
+
 	mii_phy_add_media(sc);
 	aprint_normal("\n");
 }
@@ -256,7 +256,7 @@ ipgphy_status(struct mii_softc *sc)
 
 	PHY_READ(sc, MII_BMSR, );
 	PHY_READ(sc, MII_BMSR, );
-	if (bmsr & BMSR_LINK) 
+	if (bmsr & BMSR_LINK)
 		mii->mii_media_status |= IFM_ACTIVE;
 
 	PHY_READ(sc, MII_BMCR, );



CVS commit: src/sys/dev/mii

2019-11-21 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 09:48:57 UTC 2019

Modified Files:
src/sys/dev/mii: gphyter.c ipgphy.c

Log Message:
 Whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/mii/gphyter.c
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/ipgphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 03:04:22 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c ipgphyreg.h

Log Message:
 Add missing NetBSD RCS Id. Reported by Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/ipgphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphyreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 21 03:04:22 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c ipgphyreg.h

Log Message:
 Add missing NetBSD RCS Id. Reported by Andrius V.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/mii/ipgphy.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphyreg.h

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/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.4 src/sys/dev/mii/ipgphy.c:1.5
--- src/sys/dev/mii/ipgphy.c:1.4	Thu Nov 14 09:06:21 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 21 03:04:21 2019
@@ -1,3 +1,4 @@
+/*	$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $ */
 /*	$OpenBSD: ipgphy.c,v 1.19 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-
@@ -32,7 +33,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.4 2019/11/14 09:06:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.5 2019/11/21 03:04:21 msaitoh Exp $");
 
 #include 
 #include 

Index: src/sys/dev/mii/ipgphyreg.h
diff -u src/sys/dev/mii/ipgphyreg.h:1.2 src/sys/dev/mii/ipgphyreg.h:1.3
--- src/sys/dev/mii/ipgphyreg.h:1.2	Tue Nov 12 14:07:09 2019
+++ src/sys/dev/mii/ipgphyreg.h	Thu Nov 21 03:04:21 2019
@@ -1,3 +1,4 @@
+/*	$NetBSD: ipgphyreg.h,v 1.3 2019/11/21 03:04:21 msaitoh Exp $ */
 /*	$OpenBSD: ipgphyreg.h,v 1.3 2015/07/19 06:28:12 yuo Exp $	*/
 
 /*-



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 20 08:51:00 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c mii_physubr.c miivar.h

Log Message:
 Fix a bug that atphy(4) can't negotiate correctly when the media setting is
neither auto nor 1000baseT. Use correct index for mii_media_table[].

 History: mii_anar() is first added in OpenBSD and ported to NetBSD. On NetBSD,
only atphy(4) use this function. mii_physubr.c rev. 1.75 changed mii_anar()
for simplify. It changed the argument from the ifmedia word to ifm_data used
in our MII API, but the caller have not been changed. And then, PR kern/50206
was reported and the caller was modified by me to prevent panic but it was not
correct fix.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/mii/miivar.h

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/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.24 src/sys/dev/mii/atphy.c:1.25
--- src/sys/dev/mii/atphy.c:1.24	Fri Oct 18 12:53:08 2019
+++ src/sys/dev/mii/atphy.c	Wed Nov 20 08:50:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.24 2019/10/18 12:53:08 hkenken Exp $ */
+/*	$NetBSD: atphy.c,v 1.25 2019/11/20 08:50:59 msaitoh Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.24 2019/10/18 12:53:08 hkenken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.25 2019/11/20 08:50:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -273,7 +273,7 @@ atphy_service(struct mii_softc *sc, stru
 			return EINVAL;
 		}
 
-		anar = mii_anar(IFM_SUBTYPE(ife->ifm_media));
+		anar = mii_anar(ife);
 		if ((ife->ifm_media & IFM_FDX) != 0) {
 			bmcr |= BMCR_FDX;
 			/* Enable pause. */

Index: src/sys/dev/mii/mii_physubr.c
diff -u src/sys/dev/mii/mii_physubr.c:1.87 src/sys/dev/mii/mii_physubr.c:1.88
--- src/sys/dev/mii/mii_physubr.c:1.87	Tue Apr  9 11:28:45 2019
+++ src/sys/dev/mii/mii_physubr.c	Wed Nov 20 08:50:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $	*/
+/*	$NetBSD: mii_physubr.c,v 1.88 2019/11/20 08:50:59 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.87 2019/04/09 11:28:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.88 2019/11/20 08:50:59 msaitoh Exp $");
 
 #include 
 #include 
@@ -697,19 +697,16 @@ mii_phy_resume(device_t dv, const pmf_qu
 
 
 /*
- * Given an ifmedia word, return the corresponding ANAR value.
+ * Given an ifmedia_entry, return the corresponding ANAR value.
  */
 uint16_t
-mii_anar(int media)
+mii_anar(struct ifmedia_entry *ife)
 {
-	int rv;
 
 #ifdef DIAGNOSTIC
-	if (/* media < 0 || */ media >= MII_NMEDIA)
+	if (ife->ifm_data >= MII_NMEDIA)
 		panic("mii_anar");
 #endif
 
-	rv = mii_media_table[media].mm_anar;
-
-	return rv;
+	return mii_media_table[ife->ifm_data].mm_anar;
 }

Index: src/sys/dev/mii/miivar.h
diff -u src/sys/dev/mii/miivar.h:1.68 src/sys/dev/mii/miivar.h:1.69
--- src/sys/dev/mii/miivar.h:1.68	Thu Apr 11 09:14:07 2019
+++ src/sys/dev/mii/miivar.h	Wed Nov 20 08:50:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miivar.h,v 1.68 2019/04/11 09:14:07 msaitoh Exp $	*/
+/*	$NetBSD: miivar.h,v 1.69 2019/11/20 08:50:59 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -287,7 +287,7 @@ int	mii_mediachg(struct mii_data *);
 void	mii_tick(struct mii_data *);
 void	mii_pollstat(struct mii_data *);
 void	mii_down(struct mii_data *);
-uint16_t mii_anar(int);
+uint16_t mii_anar(struct ifmedia_entry *);
 
 int	mii_ifmedia_change(struct mii_data *);
 



CVS commit: src/sys/dev/mii

2019-11-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov 20 08:51:00 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c mii_physubr.c miivar.h

Log Message:
 Fix a bug that atphy(4) can't negotiate correctly when the media setting is
neither auto nor 1000baseT. Use correct index for mii_media_table[].

 History: mii_anar() is first added in OpenBSD and ported to NetBSD. On NetBSD,
only atphy(4) use this function. mii_physubr.c rev. 1.75 changed mii_anar()
for simplify. It changed the argument from the ifmedia word to ifm_data used
in our MII API, but the caller have not been changed. And then, PR kern/50206
was reported and the caller was modified by me to prevent panic but it was not
correct fix.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.87 -r1.88 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.68 -r1.69 src/sys/dev/mii/miivar.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-18 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Nov 18 15:09:59 UTC 2019

Modified Files:
src/sys/dev/mii: ihphy.c

Log Message:
 Remove extra 10ms delay in ihphy_reset(). The delay are in if_wm.c side.
It's required for hardware full reset and it't not requred on soft reset.
 When ihphy.c was added in 9 years ago, some workaround code were not in
if_wm.c yet and the initialization code was not good.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/mii/ihphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:06:21 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
- Use auto-negotiation when forcing 1000BASE-T.
- Add XXX comment for strange pause setting code. I suspect this is wrong.
- On my environments, 1000BASE-T half duplex doesn't work, so we might remove
  IFM_1000T_HDX from this device in future.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ipgphy.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/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.3 src/sys/dev/mii/ipgphy.c:1.4
--- src/sys/dev/mii/ipgphy.c:1.3	Thu Nov 14 09:00:23 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 14 09:06:21 2019
@@ -32,7 +32,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.3 2019/11/14 09:00:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.4 2019/11/14 09:06:21 msaitoh Exp $");
 
 #include 
 #include 
@@ -60,7 +60,7 @@ CFATTACH_DECL_NEW(ipgphy, sizeof(struct 
 
 static int	ipgphy_service(struct mii_softc *, struct mii_data *, int);
 static void	ipgphy_status(struct mii_softc *);
-static int	ipgphy_mii_phy_auto(struct mii_softc *);
+static int	ipgphy_mii_phy_auto(struct mii_softc *, u_int);
 static void	ipgphy_load_dspcode(struct mii_softc *);
 static void	ipgphy_reset(struct mii_softc *);
 
@@ -126,7 +126,7 @@ static int
 ipgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
 {
 	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
-	uint16_t gig, reg, speed;
+	uint16_t reg, speed;
 
 	switch (cmd) {
 	case MII_POLLSTAT:
@@ -154,16 +154,13 @@ ipgphy_service(struct mii_softc *sc, str
 
 		switch (IFM_SUBTYPE(ife->ifm_media)) {
 		case IFM_AUTO:
-			(void)ipgphy_mii_phy_auto(sc);
-			goto done;
-			break;
-
 		case IFM_1000_T:
 			/*
-			 * XXX
-			 * Manual 1000baseT setting doesn't seem to work.
+			 * This device is required to do auto negotiation
+			 * on 1000BASE-T.
 			 */
-			speed = BMCR_S1000;
+			(void)ipgphy_mii_phy_auto(sc, ife->ifm_media);
+			goto done;
 			break;
 
 		case IFM_100_TX:
@@ -178,26 +175,11 @@ ipgphy_service(struct mii_softc *sc, str
 			return EINVAL;
 		}
 
-		if (((ife->ifm_media & IFM_GMASK) & IFM_FDX) != 0) {
+		if ((ife->ifm_media & IFM_FDX) != 0)
 			speed |= BMCR_FDX;
-			gig = GTCR_ADV_1000TFDX;
-		} else
-			gig = GTCR_ADV_1000THDX;
 
 		PHY_WRITE(sc, MII_100T2CR, 0);
 		PHY_WRITE(sc, MII_BMCR, speed);
-
-		if (IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)
-			break;
-
-		PHY_WRITE(sc, MII_100T2CR, gig);
-		PHY_WRITE(sc, MII_BMCR, speed);
-
-		if (mii->mii_media.ifm_media & IFM_ETH_MASTER)
-			gig |= GTCR_MAN_MS | GTCR_ADV_MS;
-
-		PHY_WRITE(sc, MII_100T2CR, gig);
-
 done:
 		break;
 
@@ -211,7 +193,8 @@ done:
 			return 0;
 
 		/* Only used for autonegotiation. */
-		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
+		if ((IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) &&
+		(IFM_SUBTYPE(ife->ifm_media) != IFM_1000_T)) {
 			sc->mii_ticks = 0;
 			break;
 		}
@@ -242,7 +225,7 @@ done:
 			break;
 
 		sc->mii_ticks = 0;
-		ipgphy_mii_phy_auto(sc);
+		ipgphy_mii_phy_auto(sc, ife->ifm_media);
 		break;
 	}
 
@@ -320,26 +303,36 @@ ipgphy_status(struct mii_softc *sc)
 }
 
 static int
-ipgphy_mii_phy_auto(struct mii_softc *sc)
+ipgphy_mii_phy_auto(struct mii_softc *sc, u_int media)
 {
 	uint16_t reg = 0;
+	u_int subtype = IFM_SUBTYPE(media);
 
+	/* XXX Is it requreid ? */
 	if (sc->mii_mpd_model == MII_MODEL_xxICPLUS_IP1001) {
 		PHY_READ(sc, MII_ANAR, );
 		reg &= ~(ANAR_PAUSE_SYM | ANAR_PAUSE_ASYM);
 		reg |= ANAR_NP;
 	}
 
-	reg |= ANAR_10 | ANAR_10_FD | ANAR_TX | ANAR_TX_FD;
+	if (subtype == IFM_AUTO)
+		reg |= ANAR_10 | ANAR_10_FD | ANAR_TX | ANAR_TX_FD;
 
 	if (sc->mii_flags & MIIF_DOPAUSE)
 		reg |= ANAR_PAUSE_SYM | ANAR_PAUSE_ASYM;
 
 	PHY_WRITE(sc, MII_ANAR, reg | ANAR_CSMA);
 
-	reg = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
-	if (sc->mii_mpd_model != MII_MODEL_xxICPLUS_IP1001)
-		reg |= GTCR_ADV_MS;
+	if (subtype == IFM_AUTO)
+		reg = GTCR_ADV_1000TFDX | GTCR_ADV_1000THDX;
+	else if (subtype == IFM_1000_T) {
+		if ((media & IFM_FDX) != 0)
+			reg = GTCR_ADV_1000TFDX;
+		else
+			reg = GTCR_ADV_1000THDX;
+	} else
+		reg = 0;
+
 	PHY_WRITE(sc, MII_100T2CR, reg);
 
 	PHY_WRITE(sc, MII_BMCR, BMCR_FDX | BMCR_AUTOEN | BMCR_STARTNEG);



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:06:21 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
- Use auto-negotiation when forcing 1000BASE-T.
- Add XXX comment for strange pause setting code. I suspect this is wrong.
- On my environments, 1000BASE-T half duplex doesn't work, so we might remove
  IFM_1000T_HDX from this device in future.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/ipgphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:00:23 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 STGE_PhyCtrl is not PHY register but MAC register, so use ukphy_status()
for IP1000A device.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphy.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/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.2 src/sys/dev/mii/ipgphy.c:1.3
--- src/sys/dev/mii/ipgphy.c:1.2	Thu Nov 14 08:52:34 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 14 09:00:23 2019
@@ -32,7 +32,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.2 2019/11/14 08:52:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.3 2019/11/14 09:00:23 msaitoh Exp $");
 
 #include 
 #include 
@@ -261,6 +261,12 @@ ipgphy_status(struct mii_softc *sc)
 	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
 	uint16_t bmsr, bmcr, stat, gtsr;
 
+	/* For IP1000A, use generic way */
+	if (sc->mii_mpd_model == MII_MODEL_xxICPLUS_IP1000A) {
+		ukphy_status(sc);
+		return;
+	}
+
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
 
@@ -280,53 +286,27 @@ ipgphy_status(struct mii_softc *sc)
 			return;
 		}
 
-		if (sc->mii_mpd_model == MII_MODEL_xxICPLUS_IP1001) {
-			PHY_READ(sc, IPGPHY_LSR, );
-			switch (stat & IPGPHY_LSR_SPEED_MASK) {
-			case IPGPHY_LSR_SPEED_10:
-mii->mii_media_active |= IFM_10_T;
-break;
-			case IPGPHY_LSR_SPEED_100:
-mii->mii_media_active |= IFM_100_TX;
-break;
-			case IPGPHY_LSR_SPEED_1000:
-mii->mii_media_active |= IFM_1000_T;
-break;
-			default:
-mii->mii_media_active |= IFM_NONE;
-return;
-			}
-
-			if (stat & IPGPHY_LSR_FULL_DUPLEX)
-mii->mii_media_active |= IFM_FDX;
-			else
-mii->mii_media_active |= IFM_HDX;
-		} else {
-			PHY_READ(sc, STGE_PhyCtrl, );
-			switch (PC_LinkSpeed(stat)) {
-			case PC_LinkSpeed_Down:
-mii->mii_media_active |= IFM_NONE;
-return;
-			case PC_LinkSpeed_10:
-mii->mii_media_active |= IFM_10_T;
-break;
-			case PC_LinkSpeed_100:
-mii->mii_media_active |= IFM_100_TX;
-break;
-			case PC_LinkSpeed_1000:
-mii->mii_media_active |= IFM_1000_T;
-break;
-			default:
-mii->mii_media_active |= IFM_NONE;
-return;
-			}
-
-			if (stat & PC_PhyDuplexStatus)
-mii->mii_media_active |= IFM_FDX;
-			else
-mii->mii_media_active |= IFM_HDX;
+		PHY_READ(sc, IPGPHY_LSR, );
+		switch (stat & IPGPHY_LSR_SPEED_MASK) {
+		case IPGPHY_LSR_SPEED_10:
+			mii->mii_media_active |= IFM_10_T;
+			break;
+		case IPGPHY_LSR_SPEED_100:
+			mii->mii_media_active |= IFM_100_TX;
+			break;
+		case IPGPHY_LSR_SPEED_1000:
+			mii->mii_media_active |= IFM_1000_T;
+			break;
+		default:
+			mii->mii_media_active |= IFM_NONE;
+			return;
 		}
 
+		if (stat & IPGPHY_LSR_FULL_DUPLEX)
+			mii->mii_media_active |= IFM_FDX;
+		else
+			mii->mii_media_active |= IFM_HDX;
+
 		if (mii->mii_media_active & IFM_FDX)
 			mii->mii_media_active |= mii_phy_flowstatus(sc);
 



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 09:00:23 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 STGE_PhyCtrl is not PHY register but MAC register, so use ukphy_status()
for IP1000A device.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/mii/ipgphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 08:52:34 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-14 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Nov 14 08:52:34 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphy.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/ipgphy.c
diff -u src/sys/dev/mii/ipgphy.c:1.1 src/sys/dev/mii/ipgphy.c:1.2
--- src/sys/dev/mii/ipgphy.c:1.1	Mon Oct  7 11:53:40 2019
+++ src/sys/dev/mii/ipgphy.c	Thu Nov 14 08:52:34 2019
@@ -32,7 +32,7 @@
  * Driver for the IC Plus IP1000A/IP1001 10/100/1000 PHY.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.1 2019/10/07 11:53:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.2 2019/11/14 08:52:34 msaitoh Exp $");
 
 #include 
 #include 
@@ -79,9 +79,9 @@ ipgphy_match(device_t parent, cfdata_t m
 {
 	struct mii_attach_args *ma = aux;
 
-	if (mii_phy_match(ma, ipgphys) != NULL) {
+	if (mii_phy_match(ma, ipgphys) != NULL)
 		return 10;
-	}
+
 	return 0;
 }
 
@@ -130,9 +130,7 @@ ipgphy_service(struct mii_softc *sc, str
 
 	switch (cmd) {
 	case MII_POLLSTAT:
-		/*
-		 * If we're not polling our PHY instance, just return.
-		 */
+		/* If we're not polling our PHY instance, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 		break;
@@ -148,9 +146,7 @@ ipgphy_service(struct mii_softc *sc, str
 			return 0;
 		}
 
-		/*
-		 * If the interface is not up, don't do anything.
-		 */
+		/* If the interface is not up, don't do anything. */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			break;
 
@@ -206,21 +202,15 @@ done:
 		break;
 
 	case MII_TICK:
-		/*
-		 * If we're not currently selected, just return.
-		 */
+		/* If we're not currently selected, just return. */
 		if (IFM_INST(ife->ifm_media) != sc->mii_inst)
 			return 0;
 
-		/*
-		 * Is the interface even up?
-		 */
+		/* Is the interface even up? */
 		if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
 			return 0;
 
-		/*
-		 * Only used for autonegotiation.
-		 */
+		/* Only used for autonegotiation. */
 		if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO) {
 			sc->mii_ticks = 0;
 			break;
@@ -247,9 +237,7 @@ done:
 		if (sc->mii_ticks++ == 0)
 			break;
 
-		/*
-		 * Only retry autonegotiation every mii_anegticks seconds.
-		 */
+		/* Only retry autonegotiation every mii_anegticks seconds. */
 		if (sc->mii_ticks <= sc->mii_anegticks)
 			break;
 
@@ -401,7 +389,7 @@ ipgphy_reset(struct mii_softc *sc)
 
 	mii_phy_reset(sc);
 
-	/* clear autoneg/full-duplex as we don't want it after reset */
+	/* Clear autoneg/full-duplex as we don't want it after reset */
 	PHY_READ(sc, MII_BMCR, );
 	reg &= ~(BMCR_AUTOEN | BMCR_FDX);
 	PHY_WRITE(sc, MII_BMCR, reg);



CVS commit: src/sys/dev/mii

2019-11-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 12 14:07:09 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphyreg.h

Log Message:
- Define IPGPHY_SCR's address.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphyreg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-12 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Tue Nov 12 14:07:09 UTC 2019

Modified Files:
src/sys/dev/mii: ipgphyreg.h

Log Message:
- Define IPGPHY_SCR's address.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/mii/ipgphyreg.h

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/ipgphyreg.h
diff -u src/sys/dev/mii/ipgphyreg.h:1.1 src/sys/dev/mii/ipgphyreg.h:1.2
--- src/sys/dev/mii/ipgphyreg.h:1.1	Mon Oct  7 11:53:40 2019
+++ src/sys/dev/mii/ipgphyreg.h	Tue Nov 12 14:07:09 2019
@@ -36,48 +36,48 @@
  */
 
 /* PHY specific control & status register. IP1001 only. */
-#define IPGPHY_SCSR			0x10
-#define IPGPHY_SCSR_RXPHASE_SEL	0x0001
-#define IPGPHY_SCSR_TXPHASE_SEL	0x0002
+#define IPGPHY_SCSR		0x10
+#define IPGPHY_SCSR_RXPHASE_SEL		0x0001
+#define IPGPHY_SCSR_TXPHASE_SEL		0x0002
 #define IPGPHY_SCSR_REPEATOR_MODE	0x0004
 #define IPGPHY_SCSR_RESERVED1_DEF	0x0008
 #define IPGPHY_SCSR_RXCLK_DRV_MASK	0x0060
 #define IPGPHY_SCSR_RXCLK_DRV_DEF	0x0040
 #define IPGPHY_SCSR_RXD_DRV_MASK	0x0180
-#define IPGPHY_SCSR_RXD_DRV_DEF	0x0100
-#define IPGPHY_SCSR_JABBER_ENB	0x0200
+#define IPGPHY_SCSR_RXD_DRV_DEF		0x0100
+#define IPGPHY_SCSR_JABBER_ENB		0x0200
 #define IPGPHY_SCSR_HEART_BEAT_ENB	0x0400
 #define IPGPHY_SCSR_DOWNSHIFT_ENB	0x0800
 #define IPGPHY_SCSR_RESERVED2_DEF	0x1000
-#define IPGPHY_SCSR_LED_DRV_4MA	0x
-#define IPGPHY_SCSR_LED_DRV_8MA	0x2000
+#define IPGPHY_SCSR_LED_DRV_4MA		0x
+#define IPGPHY_SCSR_LED_DRV_8MA		0x2000
 #define IPGPHY_SCSR_LED_MODE_MASK	0xC000
 #define IPGPHY_SCSR_LED_MODE_DEF	0x
 
 /* PHY link status register. IP1001 only. */
-#define IPGPHY_LSR			0x11
-#define IPGPHY_LSR_JABBER_DET	0x0200
+#define IPGPHY_LSR		0x11
+#define IPGPHY_LSR_JABBER_DET		0x0200
 #define IPGPHY_LSR_APS_SLEEP		0x0400
-#define IPGPHY_LSR_MDIX		0x0800
-#define IPGPHY_LSR_FULL_DUPLEX	0x1000
+#define IPGPHY_LSR_MDIX			0x0800
+#define IPGPHY_LSR_FULL_DUPLEX		0x1000
 #define IPGPHY_LSR_SPEED_10		0x
 #define IPGPHY_LSR_SPEED_100		0x2000
-#define IPGPHY_LSR_SPEED_1000	0x4000
-#define IPGPHY_LSR_SPEED_MASK	0x6000
+#define IPGPHY_LSR_SPEED_1000		0x4000
+#define IPGPHY_LSR_SPEED_MASK		0x6000
 #define IPGPHY_LSR_LINKUP		0x8000
 
 /* PHY specific control register 2. IP1001 only. */
-#define IPGPHY_SCR
+#define IPGPHY_SCR		0x14
 #define IPGPHY_SCR_SEW_RATE_MASK	0x0003
-#define IPGPHY_SCR_SEW_RATE_DEF	0x0003
-#define IPGPHY_SCR_AUTO_XOVER	0x0004
+#define IPGPHY_SCR_SEW_RATE_DEF		0x0003
+#define IPGPHY_SCR_AUTO_XOVER		0x0004
 #define IPGPHY_SCR_SPEED_10_100_ENB	0x0040
 #define IPGPHY_SCR_FIFO_LATENCY_2	0x
 #define IPGPHY_SCR_FIFO_LATENCY_3	0x0080
 #define IPGPHY_SCR_FIFO_LATENCY_4	0x0100
 #define IPGPHY_SCR_FIFO_LATENCY_5	0x0180
 #define IPGPHY_SCR_MDIX_ENB		0x0200
-#define IPGPHY_SCR_RESERVED_DEF	0x0400
+#define IPGPHY_SCR_RESERVED_DEF		0x0400
 #define IPGPHY_SCR_APS_ON		0x0800
 
 #endif /* _DEV_MII_IPGPHYREG_H_ */



CVS commit: src/sys/dev/mii

2019-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  6 16:00:33 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.146 -r1.147 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.158 src/sys/dev/mii/miidevs.h:1.159
--- src/sys/dev/mii/miidevs.h:1.158	Wed Oct 30 12:02:01 2019
+++ src/sys/dev/mii/miidevs.h	Wed Nov  6 16:00:33 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.158 2019/10/30 12:02:01 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.159 2019/11/06 16:00:33 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.160 2019/10/30 12:01:36 msaitoh Exp
+ *	NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp
  */
 
 /*-
@@ -494,13 +494,27 @@
 #define	MII_MODEL_MARVELL_E	0x000c
 #define	MII_STR_MARVELL_E	"Marvell 88E Gigabit PHY"
 
-/* Micrel PHYs */
+/* Micrel PHYs (Kendin and Microchip) */
+#define	MII_MODEL_MICREL_KSZ8041	0x0011
+#define	MII_STR_MICREL_KSZ8041	"Micrel KSZ8041TL/FTL/MLL 10/100 PHY"
+#define	MII_MODEL_MICREL_KSZ8041RNLI	0x0013
+#define	MII_STR_MICREL_KSZ8041RNLI	"Micrel KSZ8041RNLI 10/100 PHY"
+#define	MII_MODEL_MICREL_KSZ8051	0x0015
+#define	MII_STR_MICREL_KSZ8051	"Micrel KSZ80[235]1 10/100 PHY"
 #define	MII_MODEL_MICREL_KSZ8081	0x0016
-#define	MII_STR_MICREL_KSZ8081	"Micrel KSZ8081 10/100 PHY"
-#define	MII_MODEL_MICREL_KSZ9021RNI	0x0021
-#define	MII_STR_MICREL_KSZ9021RNI	"Micrel KSZ9021RNI 10/100/1000 PHY"
+#define	MII_STR_MICREL_KSZ8081	"Micrel KSZ80[89]1 10/100 PHY"
+#define	MII_MODEL_MICREL_KSZ8061	0x0017
+#define	MII_STR_MICREL_KSZ8061	"Micrel KSZ8061 10/100 PHY"
+#define	MII_MODEL_MICREL_KSZ9021_8001_8721	0x0021
+#define	MII_STR_MICREL_KSZ9021_8001_8721	"Micrel KSZ9021 Gb & KSZ8001/8721 10/100 PHY"
 #define	MII_MODEL_MICREL_KSZ9031	0x0022
 #define	MII_STR_MICREL_KSZ9031	"Micrel KSZ9031 10/100/1000 PHY"
+#define	MII_MODEL_MICREL_KSZ9477	0x0023
+#define	MII_STR_MICREL_KSZ9477	"Micrel KSZ9477 10/100/1000 PHY"
+#define	MII_MODEL_MICREL_KSZ9131	0x0024
+#define	MII_STR_MICREL_KSZ9131	"Micrel KSZ9131 10/100/1000 PHY"
+#define	MII_MODEL_MICREL_KS8737	0x0032
+#define	MII_STR_MICREL_KS8737	"Micrel KS8737 10/100 PHY"
 
 /* Myson Technology PHYs */
 #define	MII_MODEL_xxMYSON_MTD972	0x

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.146 src/sys/dev/mii/miidevs_data.h:1.147
--- src/sys/dev/mii/miidevs_data.h:1.146	Wed Oct 30 12:02:01 2019
+++ src/sys/dev/mii/miidevs_data.h	Wed Nov  6 16:00:33 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.146 2019/10/30 12:02:01 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.147 2019/11/06 16:00:33 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.160 2019/10/30 12:01:36 msaitoh Exp
+ *	NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp
  */
 
 /*-
@@ -204,9 +204,16 @@ struct mii_knowndev mii_knowndevs[] = {
  { 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_MARVELL, MII_MODEL_MARVELL_E, MII_STR_MARVELL_E },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8041, MII_STR_MICREL_KSZ8041 },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8041RNLI, MII_STR_MICREL_KSZ8041RNLI },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8051, MII_STR_MICREL_KSZ8051 },
  { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8081, MII_STR_MICREL_KSZ8081 },
- { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9021RNI, MII_STR_MICREL_KSZ9021RNI },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ8061, MII_STR_MICREL_KSZ8061 },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9021_8001_8721, MII_STR_MICREL_KSZ9021_8001_8721 },
  { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9031, MII_STR_MICREL_KSZ9031 },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9477, MII_STR_MICREL_KSZ9477 },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KSZ9131, MII_STR_MICREL_KSZ9131 },
+ { MII_OUI_MICREL, MII_MODEL_MICREL_KS8737, MII_STR_MICREL_KS8737 },
  { MII_OUI_xxMYSON, MII_MODEL_xxMYSON_MTD972, MII_STR_xxMYSON_MTD972 },
  { MII_OUI_MYSON, MII_MODEL_MYSON_MTD803, MII_STR_MYSON_MTD803 },
  { MII_OUI_xxNATSEMI, MII_MODEL_xxNATSEMI_DP83840, MII_STR_xxNATSEMI_DP83840 },



CVS commit: src/sys/dev/mii

2019-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  6 16:00:33 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.146 -r1.147 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  6 16:00:02 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Micrel (now Microchip) KSZ80[0456]1, KSZ8721, KSZ9[01]31, KS8731 and
KSZ9477.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-11-06 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Nov  6 16:00:02 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Micrel (now Microchip) KSZ80[0456]1, KSZ8721, KSZ9[01]31, KS8731 and
KSZ9477.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.160 src/sys/dev/mii/miidevs:1.161
--- src/sys/dev/mii/miidevs:1.160	Wed Oct 30 12:01:36 2019
+++ src/sys/dev/mii/miidevs	Wed Nov  6 16:00:02 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.160 2019/10/30 12:01:36 msaitoh Exp $
+$NetBSD: miidevs,v 1.161 2019/11/06 16:00:02 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -325,10 +325,17 @@ model MARVELL E1000_5		0x0005 Marvell 88
 model MARVELL E1000_6		0x0006 Marvell 88E1000 Gigabit PHY
 model MARVELL E		0x000c Marvell 88E Gigabit PHY
 
-/* Micrel PHYs */
-model MICREL KSZ8081		0x0016 Micrel KSZ8081 10/100 PHY
-model MICREL KSZ9021RNI		0x0021 Micrel KSZ9021RNI 10/100/1000 PHY
+/* Micrel PHYs (Kendin and Microchip) */
+model MICREL KSZ8041		0x0011 Micrel KSZ8041TL/FTL/MLL 10/100 PHY
+model MICREL KSZ8041RNLI	0x0013 Micrel KSZ8041RNLI 10/100 PHY
+model MICREL KSZ8051		0x0015 Micrel KSZ80[235]1 10/100 PHY
+model MICREL KSZ8081		0x0016 Micrel KSZ80[89]1 10/100 PHY
+model MICREL KSZ8061		0x0017 Micrel KSZ8061 10/100 PHY
+model MICREL KSZ9021_8001_8721	0x0021 Micrel KSZ9021 Gb & KSZ8001/8721 10/100 PHY
 model MICREL KSZ9031		0x0022 Micrel KSZ9031 10/100/1000 PHY
+model MICREL KSZ9477		0x0023 Micrel KSZ9477 10/100/1000 PHY
+model MICREL KSZ9131		0x0024 Micrel KSZ9131 10/100/1000 PHY
+model MICREL KS8737		0x0032 Micrel KS8737 10/100 PHY
 
 /* Myson Technology PHYs */
 model xxMYSON MTD972		0x MTD972 10/100 media interface



CVS commit: src/sys/dev/mii

2019-10-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 30 12:02:01 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.145 -r1.146 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.157 src/sys/dev/mii/miidevs.h:1.158
--- src/sys/dev/mii/miidevs.h:1.157	Fri Oct 18 20:42:10 2019
+++ src/sys/dev/mii/miidevs.h	Wed Oct 30 12:02:01 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.157 2019/10/18 20:42:10 maya Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.158 2019/10/30 12:02:01 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.158 2019/10/17 09:21:40 msaitoh Exp
+ *	NetBSD: miidevs,v 1.160 2019/10/30 12:01:36 msaitoh Exp
  */
 
 /*-
@@ -411,10 +411,10 @@
 
 
 /* JMicron PHYs */
-#define	MII_MODEL_JMICRON_JMC250	0x0021
-#define	MII_STR_JMICRON_JMC250	"JMC250 10/100/1000 media interface"
-#define	MII_MODEL_JMICRON_JMC260	0x0022
-#define	MII_STR_JMICRON_JMC260	"JMC260 10/100 media interface"
+#define	MII_MODEL_JMICRON_JMP211	0x0021
+#define	MII_STR_JMICRON_JMP211	"JMP211 10/100/1000 media interface"
+#define	MII_MODEL_JMICRON_JMP202	0x0022
+#define	MII_STR_JMICRON_JMP202	"JMP202 10/100 media interface"
 
 /* Level 1 PHYs */
 #define	MII_MODEL_xxLEVEL1_LXT970	0x

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.145 src/sys/dev/mii/miidevs_data.h:1.146
--- src/sys/dev/mii/miidevs_data.h:1.145	Fri Oct 18 20:42:10 2019
+++ src/sys/dev/mii/miidevs_data.h	Wed Oct 30 12:02:01 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.145 2019/10/18 20:42:10 maya Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.146 2019/10/30 12:02:01 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.158 2019/10/17 09:21:40 msaitoh Exp
+ *	NetBSD: miidevs,v 1.160 2019/10/30 12:01:36 msaitoh Exp
  */
 
 /*-
@@ -165,8 +165,8 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_I210, MII_STR_xxMARVELL_I210 },
  { MII_OUI_xxMARVELL, MII_MODEL_xxMARVELL_I82563, MII_STR_xxMARVELL_I82563 },
  { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_I82578, MII_STR_ATTANSIC_I82578 },
- { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMC250, MII_STR_JMICRON_JMC250 },
- { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMC260, MII_STR_JMICRON_JMC260 },
+ { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMP211, MII_STR_JMICRON_JMP211 },
+ { MII_OUI_JMICRON, MII_MODEL_JMICRON_JMP202, MII_STR_JMICRON_JMP202 },
  { MII_OUI_xxLEVEL1, MII_MODEL_xxLEVEL1_LXT970, MII_STR_xxLEVEL1_LXT970 },
  { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT1000_OLD, MII_STR_LEVEL1_LXT1000_OLD },
  { MII_OUI_LEVEL1, MII_MODEL_LEVEL1_LXT974, MII_STR_LEVEL1_LXT974 },



CVS commit: src/sys/dev/mii

2019-10-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 30 12:01:36 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
- Rename JMICRON 0x0021 from JMC250 to JMP211
- Rename JMICRON 0x0022 from JMC260 to JMP202


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.159 src/sys/dev/mii/miidevs:1.160
--- src/sys/dev/mii/miidevs:1.159	Fri Oct 18 20:42:10 2019
+++ src/sys/dev/mii/miidevs	Wed Oct 30 12:01:36 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.159 2019/10/18 20:42:10 maya Exp $
+$NetBSD: miidevs,v 1.160 2019/10/30 12:01:36 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -281,8 +281,8 @@ model ATTANSIC I82578		0x0004 Intel 8257
 
 
 /* JMicron PHYs */
-model JMICRON JMC250		0x0021 JMC250 10/100/1000 media interface
-model JMICRON JMC260		0x0022 JMC260 10/100 media interface
+model JMICRON JMP211		0x0021 JMP211 10/100/1000 media interface
+model JMICRON JMP202		0x0022 JMP202 10/100 media interface
 
 /* Level 1 PHYs */
 model xxLEVEL1 LXT970		0x LXT970 10/100 media interface



CVS commit: src/sys/dev/mii

2019-10-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 30 12:01:36 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
- Rename JMICRON 0x0021 from JMC250 to JMP211
- Rename JMICRON 0x0022 from JMC260 to JMP202


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-30 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 30 12:02:01 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.145 -r1.146 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 24 03:37:58 UTC 2019

Modified Files:
src/sys/dev/mii: ukphy_subr.c

Log Message:
 Fix a bug that ukphy_status() misunderstand master mode.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ukphy_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-23 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 24 03:37:58 UTC 2019

Modified Files:
src/sys/dev/mii: ukphy_subr.c

Log Message:
 Fix a bug that ukphy_status() misunderstand master mode.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ukphy_subr.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/ukphy_subr.c
diff -u src/sys/dev/mii/ukphy_subr.c:1.15 src/sys/dev/mii/ukphy_subr.c:1.16
--- src/sys/dev/mii/ukphy_subr.c:1.15	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/ukphy_subr.c	Thu Oct 24 03:37:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ukphy_subr.c,v 1.15 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: ukphy_subr.c,v 1.16 2019/10/24 03:37:58 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.15 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ukphy_subr.c,v 1.16 2019/10/24 03:37:58 msaitoh Exp $");
 
 #include 
 #include 
@@ -119,7 +119,7 @@ ukphy_status(struct mii_softc *phy)
 		else
 			mii->mii_media_active |= IFM_NONE;
 
-		if ((mii->mii_media_active & IFM_1000_T) &&
+		if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) &&
 		(gtsr & GTSR_MS_RES))
 			mii->mii_media_active |= IFM_ETH_MASTER;
 



CVS commit: src/sys/dev/mii

2019-10-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct 18 20:42:10 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs miidevs.h miidevs_data.h

Log Message:
Fix typo. from vezhlys


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/mii/miidevs_data.h

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.158 src/sys/dev/mii/miidevs:1.159
--- src/sys/dev/mii/miidevs:1.158	Thu Oct 17 09:21:40 2019
+++ src/sys/dev/mii/miidevs	Fri Oct 18 20:42:10 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.158 2019/10/17 09:21:40 msaitoh Exp $
+$NetBSD: miidevs,v 1.159 2019/10/18 20:42:10 maya Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -94,7 +94,7 @@ oui TI0x080028	Texas Instruments
 oui BROADCOM4			0x18c086	Broadcom Corporation
 oui RENESAS			0x749050	Renesas
 
-/* Unregisterd or wrong OUI */
+/* Unregistered or wrong OUI */
 oui yyREALTEK			0x04	Realtek
 oui yyAMD			0x58	Advanced Micro Devices
 oui xxMYSON			0x00032d	Myson Technology

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.156 src/sys/dev/mii/miidevs.h:1.157
--- src/sys/dev/mii/miidevs.h:1.156	Thu Oct 17 09:22:00 2019
+++ src/sys/dev/mii/miidevs.h	Fri Oct 18 20:42:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs.h,v 1.156 2019/10/17 09:22:00 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.157 2019/10/18 20:42:10 maya Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
@@ -101,7 +101,7 @@
 #define	MII_OUI_BROADCOM4	0x18c086	/* Broadcom Corporation */
 #define	MII_OUI_RENESAS	0x749050	/* Renesas */
 
-/* Unregisterd or wrong OUI */
+/* Unregistered or wrong OUI */
 #define	MII_OUI_yyREALTEK	0x04	/* Realtek */
 #define	MII_OUI_yyAMD	0x58	/* Advanced Micro Devices */
 #define	MII_OUI_xxMYSON	0x00032d	/* Myson Technology */

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.144 src/sys/dev/mii/miidevs_data.h:1.145
--- src/sys/dev/mii/miidevs_data.h:1.144	Thu Oct 17 09:22:00 2019
+++ src/sys/dev/mii/miidevs_data.h	Fri Oct 18 20:42:10 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs_data.h,v 1.144 2019/10/17 09:22:00 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.145 2019/10/18 20:42:10 maya Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.



CVS commit: src/sys/dev/mii

2019-10-18 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Fri Oct 18 20:42:10 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs miidevs.h miidevs_data.h

Log Message:
Fix typo. from vezhlys


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.144 -r1.145 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 09:22:49 UTC 2019

Modified Files:
src/sys/dev/mii: ciphy.c

Log Message:
- Match a lot of Cicada and Vitesse devices correctly. This change also fixes
  a bug that ciphy_fixup() didn't work.
- Match VSC8221, VSC8234 and VSC8641.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/mii/ciphy.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/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.36 src/sys/dev/mii/ciphy.c:1.37
--- src/sys/dev/mii/ciphy.c:1.36	Fri Oct 11 09:31:52 2019
+++ src/sys/dev/mii/ciphy.c	Thu Oct 17 09:22:49 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.36 2019/10/11 09:31:52 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.37 2019/10/17 09:22:49 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.36 2019/10/11 09:31:52 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.37 2019/10/17 09:22:49 msaitoh Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -74,16 +74,16 @@ static const struct mii_phy_funcs ciphy_
 };
 
 static const struct mii_phydesc ciphys[] = {
-	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_DESC(xxCICADA, CIS8201),
+	MII_PHY_DESC(xxCICADA, CIS8201A),
+	MII_PHY_DESC(xxCICADA, CIS8201B),
+	MII_PHY_DESC(xxCICADA, CIS8204),
+	MII_PHY_DESC(xxCICADA, VSC8211),
+	MII_PHY_DESC(xxCICADA, VSC8221),
+	MII_PHY_DESC(xxCICADA, VSC8234),
+	MII_PHY_DESC(xxCICADA, VSC8244),
+	MII_PHY_DESC(xxVITESSE, VSC8601),
+	MII_PHY_DESC(xxVITESSE, VSC8641),
 	MII_PHY_END,
 };
 
@@ -398,8 +398,8 @@ ciphy_fixup(struct mii_softc *sc)
 	}
 
 	switch (model) {
-	case MII_MODEL_CICADA_CS8201:
-	case MII_MODEL_CICADA_CS8204:
+	case MII_MODEL_xxCICADA_CIS8201:
+	case MII_MODEL_xxCICADA_CIS8204:
 		/* Turn off "aux mode" (whatever that means) */
 		PHY_SETBIT(sc, CIPHY_MII_AUXCSR, CIPHY_AUXCSR_MDPPS);
 
@@ -418,8 +418,8 @@ ciphy_fixup(struct mii_softc *sc)
 
 		break;
 
-	case MII_MODEL_CICADA_CS8201A:
-	case MII_MODEL_CICADA_CS8201B:
+	case MII_MODEL_xxCICADA_CIS8201A:
+	case MII_MODEL_xxCICADA_CIS8201B:
 		/*
 		 * Work around speed polling bug in VT3119/VT3216
 		 * when using MII in full duplex mode.
@@ -431,9 +431,12 @@ ciphy_fixup(struct mii_softc *sc)
 			PHY_CLRBIT(sc, CIPHY_MII_10BTCSR, CIPHY_10BTCSR_ECHO);
 
 		break;
-	case MII_MODEL_CICADA_VSC8211:
-	case MII_MODEL_CICADA_CS8244:
-	case MII_MODEL_VITESSE_VSC8601:
+	case MII_MODEL_xxCICADA_VSC8211:
+	case MII_MODEL_xxCICADA_VSC8221:
+	case MII_MODEL_xxCICADA_VSC8234:
+	case MII_MODEL_xxCICADA_VSC8244:
+	case MII_MODEL_xxVITESSE_VSC8601:
+	case MII_MODEL_xxVITESSE_VSC8641:
 		break;
 	default:
 		aprint_error_dev(sc->mii_dev, "unknown CICADA PHY model %x\n",



CVS commit: src/sys/dev/mii

2019-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 09:22:49 UTC 2019

Modified Files:
src/sys/dev/mii: ciphy.c

Log Message:
- Match a lot of Cicada and Vitesse devices correctly. This change also fixes
  a bug that ciphy_fixup() didn't work.
- Match VSC8221, VSC8234 and VSC8641.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/mii/ciphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 09:22:00 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.155 src/sys/dev/mii/miidevs.h:1.156
--- src/sys/dev/mii/miidevs.h:1.155	Thu Sep 19 14:39:08 2019
+++ src/sys/dev/mii/miidevs.h	Thu Oct 17 09:22:00 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.155 2019/09/19 14:39:08 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.156 2019/10/17 09:22:00 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.157 2019/09/19 14:38:45 msaitoh Exp
+ *	NetBSD: miidevs,v 1.158 2019/10/17 09:21:40 msaitoh Exp
  */
 
 /*-
@@ -57,10 +57,8 @@
  */
 
 #define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
-#define	MII_OUI_VITESSE	0x0001c1	/* Vitesse */
 #define	MII_OUI_TRIDIUM	0x0001f0	/* Tridium */
 #define	MII_OUI_DATATRACK	0x0002c6	/* Data Track Technology */
-#define	MII_OUI_CICADA	0x0003f1	/* Cicada Semiconductor */
 #define	MII_OUI_AGERE	0x00053d	/* Agere */
 #define	MII_OUI_BANKSPEED	0x0006b8	/* Bankspeed Pty */
 #define	MII_OUI_NETEXCELL	0x0008bb	/* NetExcell */
@@ -121,6 +119,7 @@
 #define	MII_OUI_xxBROADCOM_ALT1	0x0050ef	/* Broadcom Corporation */
 #define	MII_OUI_yyINTEL	0x005500	/* Intel */
 #define	MII_OUI_yyASIX	0x007063	/* Asix Semiconductor */
+#define	MII_OUI_xxVITESSE	0x008083	/* Vitesse Semiconductor */
 #define	MII_OUI_xxPMCSIERRA2	0x009057	/* PMC-Sierra */
 #define	MII_OUI_xxCICADA	0x00c08f	/* Cicada Semiconductor */
 #define	MII_OUI_xxNATSEMI	0x1000e8	/* National Semiconductor */
@@ -308,23 +307,26 @@
 #define	MII_MODEL_xxBROADCOM_ALT1_BCM5906	0x0004
 #define	MII_STR_xxBROADCOM_ALT1_BCM5906	"BCM5906 10/100baseTX media interface"
 
-/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
-#define	MII_MODEL_CICADA_CS8201	0x0001
-#define	MII_STR_CICADA_CS8201	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8204	0x0004
-#define	MII_STR_CICADA_CS8204	"Cicada CS8204 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_VSC8211	0x000b
-#define	MII_STR_CICADA_VSC8211	"Cicada VSC8211 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8201A	0x0020
-#define	MII_STR_CICADA_CS8201A	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8201B	0x0021
-#define	MII_STR_CICADA_CS8201B	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8244	0x002c
-#define	MII_STR_CICADA_CS8244	"Vitesse VSC8244 Quad 10/100/1000BASE-T PHY"
+/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */
+
+#define	MII_MODEL_xxCICADA_CIS8201	0x0001
+#define	MII_STR_xxCICADA_CIS8201	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_CIS8204	0x0004
+#define	MII_STR_xxCICADA_CIS8204	"Cicada CIS8204 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8211	0x000b
+#define	MII_STR_xxCICADA_VSC8211	"Cicada VSC8211 10/100/1000TX PHY"
 #define	MII_MODEL_xxCICADA_VSC8221	0x0015
 #define	MII_STR_xxCICADA_VSC8221	"Vitesse VSC8221 10/100/1000BASE-T PHY"
-#define	MII_MODEL_xxCICADA_CS8201B	0x0021
-#define	MII_STR_xxCICADA_CS8201B	"Cicada CS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8224	0x0018
+#define	MII_STR_xxCICADA_VSC8224	"Vitesse VSC8224 10/100/1000BASE-T PHY"
+#define	MII_MODEL_xxCICADA_CIS8201A	0x0020
+#define	MII_STR_xxCICADA_CIS8201A	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_CIS8201B	0x0021
+#define	MII_STR_xxCICADA_CIS8201B	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8234	0x0022
+#define	MII_STR_xxCICADA_VSC8234	"Vitesse VSC8234 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8244	0x002c
+#define	MII_STR_xxCICADA_VSC8244	"Vitesse VSC8244 Quad 10/100/1000BASE-T PHY"
 
 /* Davicom Semiconductor PHYs */
 /* AMD Am79C873 seems to be a relabeled DM9101 */
@@ -604,9 +606,13 @@
 #define	MII_MODEL_VIA_VT6103_2	0x0034
 #define	MII_STR_VIA_VT6103_2	"VT6103 10/100 PHY"
 
-/* Vitesse PHYs */
-#define	MII_MODEL_VITESSE_VSC8601	0x0002
-#define	MII_STR_VITESSE_VSC8601	"VSC8601 10/100/1000 PHY"
+/* Vitesse PHYs (Now Microsemi) */
+#define	MII_MODEL_xxVITESSE_VSC8601	0x0002
+#define	MII_STR_xxVITESSE_VSC8601	"VSC8601 10/100/1000 PHY"
+#define	MII_MODEL_xxVITESSE_VSC8641	0x0003
+#define	MII_STR_xxVITESSE_VSC8641	"Vitesse VSC8641 10/100/1000TX PHY"
+#define	MII_MODEL_xxVITESSE_VSC8501	0x0013
+#define	MII_STR_xxVITESSE_VSC8501	"Vitesse VSC8501 10/100/1000TX PHY"
 
 /* XaQti Corp. PHYs */
 #define	MII_MODEL_xxXAQTI_XMACII	0x

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.143 src/sys/dev/mii/miidevs_data.h:1.144
--- src/sys/dev/mii/miidevs_data.h:1.143	Thu Sep 19 14:39:08 2019
+++ src/sys/dev/mii/miidevs_data.h	Thu Oct 

CVS commit: src/sys/dev/mii

2019-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 09:21:40 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
- All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx".
- Rename CS82xx -> CIS82xx
- Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 09:22:00 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.143 -r1.144 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Oct 17 09:21:40 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
- All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx".
- Rename CS82xx -> CIS82xx
- Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.157 src/sys/dev/mii/miidevs:1.158
--- src/sys/dev/mii/miidevs:1.157	Thu Sep 19 14:38:45 2019
+++ src/sys/dev/mii/miidevs	Thu Oct 17 09:21:40 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.157 2019/09/19 14:38:45 msaitoh Exp $
+$NetBSD: miidevs,v 1.158 2019/10/17 09:21:40 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -50,10 +50,8 @@ $NetBSD: miidevs,v 1.157 2019/09/19 14:3
  */
 
 oui AMD0x1a	Advanced Micro Devices
-oui VITESSE			0x0001c1	Vitesse
 oui TRIDIUM			0x0001f0	Tridium
 oui DATATRACK			0x0002c6	Data Track Technology
-oui CICADA			0x0003f1	Cicada Semiconductor
 oui AGERE			0x00053d	Agere
 oui BANKSPEED			0x0006b8	Bankspeed Pty
 oui NETEXCELL			0x0008bb	NetExcell
@@ -114,6 +112,7 @@ oui xxINTEL			0x001f00	Intel
 oui xxBROADCOM_ALT1		0x0050ef	Broadcom Corporation
 oui yyINTEL			0x005500	Intel
 oui yyASIX			0x007063	Asix Semiconductor
+oui xxVITESSE			0x008083	Vitesse Semiconductor
 oui xxPMCSIERRA2		0x009057	PMC-Sierra
 oui xxCICADA			0x00c08f	Cicada Semiconductor
 oui xxNATSEMI			0x1000e8	National Semiconductor
@@ -223,15 +222,17 @@ model BROADCOM3 BCM5720C	0x0036 BCM5720C
 model BROADCOM4 BCM5725C	0x0038 BCM5725C 1000BASE-T media interface
 model xxBROADCOM_ALT1 BCM5906	0x0004 BCM5906 10/100baseTX media interface
 
-/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
-model CICADA CS8201		0x0001 Cicada CS8201 10/100/1000TX PHY
-model CICADA CS8204		0x0004 Cicada CS8204 10/100/1000TX PHY
-model CICADA VSC8211		0x000b Cicada VSC8211 10/100/1000TX PHY
-model CICADA CS8201A		0x0020 Cicada CS8201 10/100/1000TX PHY
-model CICADA CS8201B		0x0021 Cicada CS8201 10/100/1000TX PHY
-model CICADA CS8244		0x002c Vitesse VSC8244 Quad 10/100/1000BASE-T PHY
+/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */
+
+model xxCICADA CIS8201		0x0001 Cicada CIS8201 10/100/1000TX PHY
+model xxCICADA CIS8204		0x0004 Cicada CIS8204 10/100/1000TX PHY
+model xxCICADA VSC8211		0x000b Cicada VSC8211 10/100/1000TX PHY
 model xxCICADA VSC8221		0x0015 Vitesse VSC8221 10/100/1000BASE-T PHY
-model xxCICADA CS8201B		0x0021 Cicada CS8201 10/100/1000TX PHY
+model xxCICADA VSC8224		0x0018 Vitesse VSC8224 10/100/1000BASE-T PHY
+model xxCICADA CIS8201A		0x0020 Cicada CIS8201 10/100/1000TX PHY
+model xxCICADA CIS8201B		0x0021 Cicada CIS8201 10/100/1000TX PHY
+model xxCICADA VSC8234		0x0022 Vitesse VSC8234 10/100/1000TX PHY
+model xxCICADA VSC8244		0x002c Vitesse VSC8244 Quad 10/100/1000BASE-T PHY
 
 /* Davicom Semiconductor PHYs */
 /* AMD Am79C873 seems to be a relabeled DM9101 */
@@ -393,8 +394,10 @@ model xxTSC 78Q2121		0x0015 78Q2121 100B
 model VIA VT6103		0x0032	VT6103 10/100 PHY
 model VIA VT6103_2		0x0034	VT6103 10/100 PHY
 
-/* Vitesse PHYs */
-model VITESSE VSC8601		0x0002	VSC8601 10/100/1000 PHY
+/* Vitesse PHYs (Now Microsemi) */
+model xxVITESSE VSC8601		0x0002 VSC8601 10/100/1000 PHY
+model xxVITESSE VSC8641		0x0003 Vitesse VSC8641 10/100/1000TX PHY
+model xxVITESSE VSC8501		0x0013 Vitesse VSC8501 10/100/1000TX PHY
 
 /* XaQti Corp. PHYs */
 model xxXAQTI XMACII		0x XaQti Corp. XMAC II gigabit interface



CVS commit: src/sys/dev/mii

2019-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 09:31:52 UTC 2019

Modified Files:
src/sys/dev/mii: ciphy.c

Log Message:
 Call mii_phy_flowstatus() to show the flow setting.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/ciphy.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/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.35 src/sys/dev/mii/ciphy.c:1.36
--- src/sys/dev/mii/ciphy.c:1.35	Fri Oct 11 09:29:04 2019
+++ src/sys/dev/mii/ciphy.c	Fri Oct 11 09:31:52 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.35 2019/10/11 09:29:04 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.36 2019/10/11 09:31:52 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.35 2019/10/11 09:29:04 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.36 2019/10/11 09:31:52 msaitoh Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -339,7 +339,7 @@ ciphy_status(struct mii_softc *sc)
 	}
 
 	if (bmsr & CIPHY_AUXCSR_FDX)
-		mii->mii_media_active |= IFM_FDX;
+		mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
 	else
 		mii->mii_media_active |= IFM_HDX;
 



CVS commit: src/sys/dev/mii

2019-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 09:31:52 UTC 2019

Modified Files:
src/sys/dev/mii: ciphy.c

Log Message:
 Call mii_phy_flowstatus() to show the flow setting.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/dev/mii/ciphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 09:29:04 UTC 2019

Modified Files:
src/sys/dev/mii: ciphy.c rgephy.c

Log Message:
- Indicat master mode if the negotiated result say so.
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/rgephy.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/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.34 src/sys/dev/mii/ciphy.c:1.35
--- src/sys/dev/mii/ciphy.c:1.34	Thu Apr 11 09:14:07 2019
+++ src/sys/dev/mii/ciphy.c	Fri Oct 11 09:29:04 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.35 2019/10/11 09:29:04 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.35 2019/10/11 09:29:04 msaitoh Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -297,7 +297,7 @@ static void
 ciphy_status(struct mii_softc *sc)
 {
 	struct mii_data *mii = sc->mii_pdata;
-	uint16_t bmsr, bmcr;
+	uint16_t bmsr, bmcr, gtsr;
 
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
@@ -343,16 +343,19 @@ ciphy_status(struct mii_softc *sc)
 	else
 		mii->mii_media_active |= IFM_HDX;
 
-	return;
+	if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) {
+		PHY_READ(sc, MII_GTSR, );
+		if ((gtsr & GTSR_MS_RES) != 0)
+			mii->mii_media_active |= IFM_ETH_MASTER;
+	}
 }
 
 static void
 ciphy_reset(struct mii_softc *sc)
 {
+
 	mii_phy_reset(sc);
 	DELAY(1000);
-
-	return;
 }
 
 static inline int
@@ -437,6 +440,4 @@ ciphy_fixup(struct mii_softc *sc)
 		model);
 		break;
 	}
-
-	return;
 }

Index: src/sys/dev/mii/rgephy.c
diff -u src/sys/dev/mii/rgephy.c:1.56 src/sys/dev/mii/rgephy.c:1.57
--- src/sys/dev/mii/rgephy.c:1.56	Fri Oct 11 03:40:01 2019
+++ src/sys/dev/mii/rgephy.c	Fri Oct 11 09:29:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $	*/
+/*	$NetBSD: rgephy.c,v 1.57 2019/10/11 09:29:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.57 2019/10/11 09:29:04 msaitoh Exp $");
 
 
 /*
@@ -356,7 +356,7 @@ static void
 rgephy_status(struct mii_softc *sc)
 {
 	struct mii_data *mii = sc->mii_pdata;
-	uint16_t gstat, bmsr, bmcr, physr, ssr;
+	uint16_t gstat, bmsr, bmcr, gtsr, physr, ssr;
 
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
@@ -442,6 +442,12 @@ rgephy_status(struct mii_softc *sc)
 		else
 			mii->mii_media_active |= IFM_HDX;
 	}
+
+	if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) {
+		PHY_READ(sc, MII_GTSR, );
+		if ((gtsr & GTSR_MS_RES) != 0)
+			mii->mii_media_active |= IFM_ETH_MASTER;
+	}
 }
 
 static int



CVS commit: src/sys/dev/mii

2019-10-11 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 09:29:04 UTC 2019

Modified Files:
src/sys/dev/mii: ciphy.c rgephy.c

Log Message:
- Indicat master mode if the negotiated result say so.
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.56 -r1.57 src/sys/dev/mii/rgephy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-10-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 03:40:01 UTC 2019

Modified Files:
src/sys/dev/mii: rgephy.c

Log Message:
Make new rgephy_linkup() function and share it like FreeBSD.
No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/mii/rgephy.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/rgephy.c
diff -u src/sys/dev/mii/rgephy.c:1.55 src/sys/dev/mii/rgephy.c:1.56
--- src/sys/dev/mii/rgephy.c:1.55	Wed Jun  5 17:50:06 2019
+++ src/sys/dev/mii/rgephy.c	Fri Oct 11 03:40:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $	*/
+/*	$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $");
 
 
 /*
@@ -75,6 +75,7 @@ static int	rgephy_service(struct mii_sof
 static void	rgephy_status(struct mii_softc *);
 static int	rgephy_mii_phy_auto(struct mii_softc *);
 static void	rgephy_reset(struct mii_softc *);
+static bool	rgephy_linkup(struct mii_softc *);
 static void	rgephy_loop(struct mii_softc *);
 static void	rgephy_load_dspcode(struct mii_softc *);
 
@@ -295,26 +296,9 @@ rgephy_service(struct mii_softc *sc, str
 		 * need to restart the autonegotiation process.  Read
 		 * the BMSR twice in case it's latched.
 		 */
-		if (sc->mii_mpd_rev >= RGEPHY_8211F) {
-			/* RTL8211F */
-			PHY_READ(sc, RGEPHY_MII_PHYSR, );
-			if (reg & RGEPHY_PHYSR_LINK) {
-sc->mii_ticks = 0;
-break;
-			}
-		} else if (sc->mii_mpd_rev >= RGEPHY_8211B) {
-			/* RTL8211B(L) */
-			PHY_READ(sc, RGEPHY_MII_SSR, );
-			if (reg & RGEPHY_SSR_LINK) {
-sc->mii_ticks = 0;
-break;
-			}
-		} else {
-			PHY_READ(sc, RTK_GMEDIASTAT, );
-			if ((reg & RTK_GMEDIASTAT_LINK) != 0) {
-sc->mii_ticks = 0;
-break;
-			}
+		if (rgephy_linkup(sc)) {
+			sc->mii_ticks = 0;
+			break;
 		}
 
 		/* Announce link loss right after it happens. */
@@ -345,6 +329,29 @@ rgephy_service(struct mii_softc *sc, str
 	return 0;
 }
 
+static bool
+rgephy_linkup(struct mii_softc *sc)
+{
+	bool linkup = false;
+	uint16_t reg;
+
+	if (sc->mii_mpd_rev >= RGEPHY_8211F) {
+		PHY_READ(sc, RGEPHY_MII_PHYSR, );
+		if (reg & RGEPHY_PHYSR_LINK)
+			linkup = true;
+	} else if (sc->mii_mpd_rev >= RGEPHY_8211B) {
+		PHY_READ(sc, RGEPHY_MII_SSR, );
+		if (reg & RGEPHY_SSR_LINK)
+			linkup = true;
+	} else {
+		PHY_READ(sc, RTK_GMEDIASTAT, );
+		if ((reg & RTK_GMEDIASTAT_LINK) != 0)
+			linkup = true;
+	}
+
+	return linkup;
+}
+
 static void
 rgephy_status(struct mii_softc *sc)
 {
@@ -354,19 +361,8 @@ rgephy_status(struct mii_softc *sc)
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
 
-	if (sc->mii_mpd_rev >= RGEPHY_8211F) {
-		PHY_READ(sc, RGEPHY_MII_PHYSR, );
-		if (physr & RGEPHY_PHYSR_LINK)
-			mii->mii_media_status |= IFM_ACTIVE;
-	} else if (sc->mii_mpd_rev >= RGEPHY_8211B) {
-		PHY_READ(sc, RGEPHY_MII_SSR, );
-		if (ssr & RGEPHY_SSR_LINK)
-			mii->mii_media_status |= IFM_ACTIVE;
-	} else {
-		PHY_READ(sc, RTK_GMEDIASTAT, );
-		if ((gstat & RTK_GMEDIASTAT_LINK) != 0)
-			mii->mii_media_status |= IFM_ACTIVE;
-	}
+	if (rgephy_linkup(sc))
+		mii->mii_media_status |= IFM_ACTIVE;
 
 	PHY_READ(sc, MII_BMSR, );
 	PHY_READ(sc, MII_BMCR, );



CVS commit: src/sys/dev/mii

2019-10-10 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Oct 11 03:40:01 UTC 2019

Modified Files:
src/sys/dev/mii: rgephy.c

Log Message:
Make new rgephy_linkup() function and share it like FreeBSD.
No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/dev/mii/rgephy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 19 14:41:28 UTC 2019

Modified Files:
src/sys/dev/mii: rlphy.c

Log Message:
- ICPLUS -> xxICPLUS
- Print model name if it's ICPLUS IP101 to avoid "Realtek internal PHY".


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/mii/rlphy.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/rlphy.c
diff -u src/sys/dev/mii/rlphy.c:1.36 src/sys/dev/mii/rlphy.c:1.37
--- src/sys/dev/mii/rlphy.c:1.36	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/rlphy.c	Thu Sep 19 14:41:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rlphy.c,v 1.36 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: rlphy.c,v 1.37 2019/09/19 14:41:28 msaitoh Exp $	*/
 /*	$OpenBSD: rlphy.c,v 1.20 2005/07/31 05:27:30 pvalchev Exp $	*/
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.36 2019/03/25 09:20:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rlphy.c,v 1.37 2019/09/19 14:41:28 msaitoh Exp $");
 
 #include 
 #include 
@@ -78,7 +78,7 @@ const struct mii_phy_funcs rlphy_funcs =
 static const struct mii_phydesc rlphys[] = {
 	MII_PHY_DESC(yyREALTEK, RTL8201L),
 	MII_PHY_DESC(REALTEK, RTL8201E),
-	MII_PHY_DESC(ICPLUS, IP101),
+	MII_PHY_DESC(xxICPLUS, IP101),
 	MII_PHY_END,
 };
 
@@ -125,6 +125,9 @@ rlphyattach(device_t parent, device_t se
 		rsc->sc_rtl8201 = 1;
 		aprint_normal(": %s, rev. %d\n", MII_STR_REALTEK_RTL8201E,
 		MII_REV(ma->mii_id2));
+	} else if (MII_MODEL(ma->mii_id2) == MII_MODEL_xxICPLUS_IP101) {
+		aprint_normal(": %s, rev. %d\n", MII_STR_xxICPLUS_IP101,
+		MII_REV(ma->mii_id2));
 	} else
 		aprint_normal(": Realtek internal PHY\n");
 



CVS commit: src/sys/dev/mii

2019-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 19 14:41:28 UTC 2019

Modified Files:
src/sys/dev/mii: rlphy.c

Log Message:
- ICPLUS -> xxICPLUS
- Print model name if it's ICPLUS IP101 to avoid "Realtek internal PHY".


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/mii/rlphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 19 14:39:08 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 19 14:39:08 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.142 -r1.143 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.154 src/sys/dev/mii/miidevs.h:1.155
--- src/sys/dev/mii/miidevs.h:1.154	Wed Sep  4 08:57:05 2019
+++ src/sys/dev/mii/miidevs.h	Thu Sep 19 14:39:08 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.154 2019/09/04 08:57:05 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.155 2019/09/19 14:39:08 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.156 2019/09/04 08:56:45 msaitoh Exp
+ *	NetBSD: miidevs,v 1.157 2019/09/19 14:38:45 msaitoh Exp
  */
 
 /*-
@@ -85,7 +85,6 @@
 #define	MII_OUI_AMLOGIC	0x006051	/* Amlogic */
 #define	MII_OUI_DAVICOM	0x00606e	/* Davicom Semiconductor */
 #define	MII_OUI_SMSC	0x00800f	/* SMSC */
-#define	MII_OUI_ICPLUS	0x0090c3	/* IC Plus Corp. */
 #define	MII_OUI_SEEQ	0x00a07d	/* Seeq */
 #define	MII_OUI_ICS	0x00a0be	/* Integrated Circuit Systems */
 #define	MII_OUI_INTEL	0x00aa00	/* Intel */
@@ -116,6 +115,7 @@
 #define	MII_OUI_xxREALTEK	0x000732	/* Realtek */
 #define	MII_OUI_xxBROADCOM	0x000818	/* Broadcom Corporation */
 #define	MII_OUI_xxPMCSIERRA	0x0009c0	/* PMC-Sierra */
+#define	MII_OUI_xxICPLUS	0x0009c3	/* IC Plus Corp. */
 #define	MII_OUI_xxMARVELL	0x000ac2	/* Marvell Semiconductor */
 #define	MII_OUI_xxINTEL	0x001f00	/* Intel */
 #define	MII_OUI_xxBROADCOM_ALT1	0x0050ef	/* Broadcom Corporation */
@@ -344,14 +344,14 @@
 #define	MII_STR_xxDAVICOM_DM9601	"DM9601 internal 10/100 media interface"
 
 /* IC Plus Corp. PHYs */
-#define	MII_MODEL_ICPLUS_IP100	0x0004
-#define	MII_STR_ICPLUS_IP100	"IP100 10/100 PHY"
-#define	MII_MODEL_ICPLUS_IP101	0x0005
-#define	MII_STR_ICPLUS_IP101	"IP101 10/100 PHY"
-#define	MII_MODEL_ICPLUS_IP1000A	0x0008
-#define	MII_STR_ICPLUS_IP1000A	"IP1000A 10/100/1000 PHY"
-#define	MII_MODEL_ICPLUS_IP1001	0x0019
-#define	MII_STR_ICPLUS_IP1001	"IP1001 10/100/1000 PHY"
+#define	MII_MODEL_xxICPLUS_IP100	0x0004
+#define	MII_STR_xxICPLUS_IP100	"IP100 10/100 PHY"
+#define	MII_MODEL_xxICPLUS_IP101	0x0005
+#define	MII_STR_xxICPLUS_IP101	"IP101 10/100 PHY"
+#define	MII_MODEL_xxICPLUS_IP1000A	0x0008
+#define	MII_STR_xxICPLUS_IP1000A	"IP1000A 10/100/1000 PHY"
+#define	MII_MODEL_xxICPLUS_IP1001	0x0019
+#define	MII_STR_xxICPLUS_IP1001	"IP1001 10/100/1000 PHY"
 
 /* Integrated Circuit Systems PHYs */
 #define	MII_MODEL_ICS_1889	0x0001

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.142 src/sys/dev/mii/miidevs_data.h:1.143
--- src/sys/dev/mii/miidevs_data.h:1.142	Wed Sep  4 08:57:05 2019
+++ src/sys/dev/mii/miidevs_data.h	Thu Sep 19 14:39:08 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.142 2019/09/04 08:57:05 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.143 2019/09/19 14:39:08 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.156 2019/09/04 08:56:45 msaitoh Exp
+ *	NetBSD: miidevs,v 1.157 2019/09/19 14:38:45 msaitoh Exp
  */
 
 /*-
@@ -135,10 +135,10 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161A, MII_STR_xxDAVICOM_DM9161A },
  { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9161B, MII_STR_xxDAVICOM_DM9161B },
  { MII_OUI_xxDAVICOM, MII_MODEL_xxDAVICOM_DM9601, MII_STR_xxDAVICOM_DM9601 },
- { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP100, MII_STR_ICPLUS_IP100 },
- { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP101, MII_STR_ICPLUS_IP101 },
- { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP1000A, MII_STR_ICPLUS_IP1000A },
- { MII_OUI_ICPLUS, MII_MODEL_ICPLUS_IP1001, MII_STR_ICPLUS_IP1001 },
+ { MII_OUI_xxICPLUS, MII_MODEL_xxICPLUS_IP100, MII_STR_xxICPLUS_IP100 },
+ { MII_OUI_xxICPLUS, MII_MODEL_xxICPLUS_IP101, MII_STR_xxICPLUS_IP101 },
+ { MII_OUI_xxICPLUS, MII_MODEL_xxICPLUS_IP1000A, MII_STR_xxICPLUS_IP1000A },
+ { MII_OUI_xxICPLUS, MII_MODEL_xxICPLUS_IP1001, MII_STR_xxICPLUS_IP1001 },
  { 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 },



CVS commit: src/sys/dev/mii

2019-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 19 14:38:45 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Change ICPLUS(0x0090c3) to xxICPLUS(0x0009c3)


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-19 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Sep 19 14:38:45 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Change ICPLUS(0x0090c3) to xxICPLUS(0x0009c3)


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.156 src/sys/dev/mii/miidevs:1.157
--- src/sys/dev/mii/miidevs:1.156	Wed Sep  4 08:56:45 2019
+++ src/sys/dev/mii/miidevs	Thu Sep 19 14:38:45 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.156 2019/09/04 08:56:45 msaitoh Exp $
+$NetBSD: miidevs,v 1.157 2019/09/19 14:38:45 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -78,7 +78,6 @@ oui QUALSEMI			0x006051	Quality Semicond
 oui AMLOGIC			0x006051	Amlogic
 oui DAVICOM			0x00606e	Davicom Semiconductor
 oui SMSC			0x00800f	SMSC
-oui ICPLUS			0x0090c3	IC Plus Corp.
 oui SEEQ			0x00a07d	Seeq
 oui ICS0x00a0be	Integrated Circuit Systems
 oui INTEL			0x00aa00	Intel
@@ -109,6 +108,7 @@ oui xxQUALSEMI			0x00068a	Quality Semico
 oui xxREALTEK			0x000732	Realtek
 oui xxBROADCOM			0x000818	Broadcom Corporation
 oui xxPMCSIERRA			0x0009c0	PMC-Sierra
+oui xxICPLUS			0x0009c3	IC Plus Corp.
 oui xxMARVELL			0x000ac2	Marvell Semiconductor
 oui xxINTEL			0x001f00	Intel
 oui xxBROADCOM_ALT1		0x0050ef	Broadcom Corporation
@@ -244,10 +244,10 @@ model xxDAVICOM DM9161B		0x000b DM9161[B
 model xxDAVICOM DM9601		0x000c DM9601 internal 10/100 media interface
 
 /* IC Plus Corp. PHYs */
-model ICPLUS IP100		0x0004 IP100 10/100 PHY
-model ICPLUS IP101		0x0005 IP101 10/100 PHY
-model ICPLUS IP1000A		0x0008 IP1000A 10/100/1000 PHY
-model ICPLUS IP1001		0x0019 IP1001 10/100/1000 PHY
+model xxICPLUS IP100		0x0004 IP100 10/100 PHY
+model xxICPLUS IP101		0x0005 IP101 10/100 PHY
+model xxICPLUS IP1000A		0x0008 IP1000A 10/100/1000 PHY
+model xxICPLUS IP1001		0x0019 IP1001 10/100/1000 PHY
 
 /* Integrated Circuit Systems PHYs */
 model ICS 1889			0x0001 ICS1889 10/100 media interface



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 08:57:05 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.141 -r1.142 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 08:56:45 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Use uppercase for vendor name.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 08:57:05 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.153 -r1.154 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.141 -r1.142 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.153 src/sys/dev/mii/miidevs.h:1.154
--- src/sys/dev/mii/miidevs.h:1.153	Wed Sep  4 06:28:08 2019
+++ src/sys/dev/mii/miidevs.h	Wed Sep  4 08:57:05 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.153 2019/09/04 06:28:08 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.154 2019/09/04 08:57:05 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.155 2019/09/04 06:27:49 msaitoh Exp
+ *	NetBSD: miidevs,v 1.156 2019/09/04 08:56:45 msaitoh Exp
  */
 
 /*-
@@ -102,7 +102,7 @@
 #define	MII_OUI_NATSEMI	0x080017	/* National Semiconductor */
 #define	MII_OUI_TI	0x080028	/* Texas Instruments */
 #define	MII_OUI_BROADCOM4	0x18c086	/* Broadcom Corporation */
-#define	MII_OUI_Renesas	0x749050	/* Renesas */
+#define	MII_OUI_RENESAS	0x749050	/* Renesas */
 
 /* Unregisterd or wrong OUI */
 #define	MII_OUI_yyREALTEK	0x04	/* Realtek */

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.141 src/sys/dev/mii/miidevs_data.h:1.142
--- src/sys/dev/mii/miidevs_data.h:1.141	Wed Sep  4 06:28:08 2019
+++ src/sys/dev/mii/miidevs_data.h	Wed Sep  4 08:57:05 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.141 2019/09/04 06:28:08 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.142 2019/09/04 08:57:05 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.155 2019/09/04 06:27:49 msaitoh Exp
+ *	NetBSD: miidevs,v 1.156 2019/09/04 08:56:45 msaitoh Exp
  */
 
 /*-



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 08:56:45 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Use uppercase for vendor name.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.155 src/sys/dev/mii/miidevs:1.156
--- src/sys/dev/mii/miidevs:1.155	Wed Sep  4 06:27:49 2019
+++ src/sys/dev/mii/miidevs	Wed Sep  4 08:56:45 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.155 2019/09/04 06:27:49 msaitoh Exp $
+$NetBSD: miidevs,v 1.156 2019/09/04 08:56:45 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -95,7 +95,7 @@ oui XAQTI			0x00e0ae	XaQti Corp.
 oui NATSEMI			0x080017	National Semiconductor
 oui TI0x080028	Texas Instruments
 oui BROADCOM4			0x18c086	Broadcom Corporation
-oui Renesas			0x749050	Renesas
+oui RENESAS			0x749050	Renesas
 
 /* Unregisterd or wrong OUI */
 oui yyREALTEK			0x04	Realtek



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 06:28:30 UTC 2019

Modified Files:
src/sys/dev/mii: ikphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ikphy.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/ikphy.c
diff -u src/sys/dev/mii/ikphy.c:1.15 src/sys/dev/mii/ikphy.c:1.16
--- src/sys/dev/mii/ikphy.c:1.15	Mon Mar 25 07:34:13 2019
+++ src/sys/dev/mii/ikphy.c	Wed Sep  4 06:28:30 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ikphy.c,v 1.15 2019/03/25 07:34:13 msaitoh Exp $	*/
+/*	$NetBSD: ikphy.c,v 1.16 2019/09/04 06:28:30 msaitoh Exp $	*/
 
 /***
 Copyright (c) 2001-2005, Intel Corporation 
@@ -59,7 +59,7 @@ POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.15 2019/03/25 07:34:13 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ikphy.c,v 1.16 2019/09/04 06:28:30 msaitoh Exp $");
 
 #include 
 #include 
@@ -212,21 +212,21 @@ ikphy_setmedia(struct mii_softc *sc)
 	phy_data |= GG82563_MSCR_TX_CLK_1000MBPS_25MHZ;
 	PHY_WRITE(sc, GG82563_PHY_MAC_SPEC_CTRL, phy_data);
 
-	/* set mdi/mid-x options */
+	/* Set mdi/mid-x options */
 	PHY_READ(sc, GG82563_PHY_SPEC_CTRL, _data);
 	phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
 	if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO)
 		phy_data |= GG82563_PSCR_CROSSOVER_MODE_AUTO;
 	else
 		phy_data |= GG82563_PSCR_CROSSOVER_MODE_MDI;
-	/* set polarity correction */
+	/* Set polarity correction */
 	phy_data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
 	PHY_WRITE(sc, GG82563_PHY_SPEC_CTRL, phy_data);
 
 	/* SW Reset the PHY so all changes take effect */
 	PHY_RESET(sc);
 
-	/* for the i80003 */
+	/* For the i80003 */
 	PHY_READ(sc, GG82563_PHY_SPEC_CTRL_2, _data);
 	phy_data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG;
 	PHY_WRITE(sc, GG82563_PHY_SPEC_CTRL_2, phy_data);
@@ -260,7 +260,7 @@ ikphy_setmedia(struct mii_softc *sc)
 	}
 	PHY_READ(sc, GG82563_PHY_MAC_SPEC_CTRL, _data);
 	phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
-	switch(IFM_SUBTYPE(ife->ifm_media)) {
+	switch (IFM_SUBTYPE(ife->ifm_media)) {
 	case IFM_10_T:
 		phy_data |= GG82563_MSCR_TX_CLK_10MBPS_2_5MHZ;
 		break;



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 06:28:08 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.152 src/sys/dev/mii/miidevs.h:1.153
--- src/sys/dev/mii/miidevs.h:1.152	Fri Aug 16 15:20:18 2019
+++ src/sys/dev/mii/miidevs.h	Wed Sep  4 06:28:08 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.152 2019/08/16 15:20:18 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.153 2019/09/04 06:28:08 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.154 2019/08/16 15:19:48 msaitoh Exp
+ *	NetBSD: miidevs,v 1.155 2019/09/04 06:27:49 msaitoh Exp
  */
 
 /*-
@@ -74,7 +74,9 @@
 #define	MII_OUI_ENABLESEMI	0x0010dd	/* Enable Semiconductor */
 #define	MII_OUI_SUNPLUS	0x001105	/* Sunplus Technology */
 #define	MII_OUI_ATHEROS	0x001374	/* Atheros */
+#define	MII_OUI_TERANETICS	0x0014a6	/* Teranetics */
 #define	MII_OUI_RALINK2	0x0017a5	/* Ralink Technology */
+#define	MII_OUI_AQUANTIA	0x0017b6	/* Aquantia Corporation */
 #define	MII_OUI_BROADCOM3	0x001be9	/* Broadcom Corporation */
 #define	MII_OUI_LEVEL1	0x00207b	/* Level 1 */
 #define	MII_OUI_VIA	0x004063	/* VIA Technologies */
@@ -100,6 +102,7 @@
 #define	MII_OUI_NATSEMI	0x080017	/* National Semiconductor */
 #define	MII_OUI_TI	0x080028	/* Texas Instruments */
 #define	MII_OUI_BROADCOM4	0x18c086	/* Broadcom Corporation */
+#define	MII_OUI_Renesas	0x749050	/* Renesas */
 
 /* Unregisterd or wrong OUI */
 #define	MII_OUI_yyREALTEK	0x04	/* Realtek */

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.140 src/sys/dev/mii/miidevs_data.h:1.141
--- src/sys/dev/mii/miidevs_data.h:1.140	Fri Aug 16 15:20:18 2019
+++ src/sys/dev/mii/miidevs_data.h	Wed Sep  4 06:28:08 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.140 2019/08/16 15:20:18 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.141 2019/09/04 06:28:08 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.154 2019/08/16 15:19:48 msaitoh Exp
+ *	NetBSD: miidevs,v 1.155 2019/09/04 06:27:49 msaitoh Exp
  */
 
 /*-



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 06:28:30 UTC 2019

Modified Files:
src/sys/dev/mii: ikphy.c

Log Message:
 KNF. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/mii/ikphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 06:28:08 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.152 -r1.153 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.140 -r1.141 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 06:27:49 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Teranetics, Aquantia and Renesas.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/mii/miidevs

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-04 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Sep  4 06:27:49 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Teranetics, Aquantia and Renesas.


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/sys/dev/mii/miidevs

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/miidevs
diff -u src/sys/dev/mii/miidevs:1.154 src/sys/dev/mii/miidevs:1.155
--- src/sys/dev/mii/miidevs:1.154	Fri Aug 16 15:19:48 2019
+++ src/sys/dev/mii/miidevs	Wed Sep  4 06:27:49 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.154 2019/08/16 15:19:48 msaitoh Exp $
+$NetBSD: miidevs,v 1.155 2019/09/04 06:27:49 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -67,7 +67,9 @@ oui ALTIMA			0x0010a9	Altima Communicati
 oui ENABLESEMI			0x0010dd	Enable Semiconductor
 oui SUNPLUS			0x001105	Sunplus Technology
 oui ATHEROS			0x001374	Atheros
+oui TERANETICS			0x0014a6	Teranetics
 oui RALINK2			0x0017a5	Ralink Technology
+oui AQUANTIA			0x0017b6	Aquantia Corporation
 oui BROADCOM3			0x001be9	Broadcom Corporation
 oui LEVEL1			0x00207b	Level 1
 oui VIA0x004063	VIA Technologies
@@ -93,6 +95,7 @@ oui XAQTI			0x00e0ae	XaQti Corp.
 oui NATSEMI			0x080017	National Semiconductor
 oui TI0x080028	Texas Instruments
 oui BROADCOM4			0x18c086	Broadcom Corporation
+oui Renesas			0x749050	Renesas
 
 /* Unregisterd or wrong OUI */
 oui yyREALTEK			0x04	Realtek



CVS commit: src/sys/dev/mii

2019-09-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep  2 12:48:52 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c

Log Message:
s/etphy/atphy/. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/mii/atphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-09-02 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Mon Sep  2 12:48:52 UTC 2019

Modified Files:
src/sys/dev/mii: atphy.c

Log Message:
s/etphy/atphy/. No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/mii/atphy.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/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.22 src/sys/dev/mii/atphy.c:1.23
--- src/sys/dev/mii/atphy.c:1.22	Thu Apr 11 09:00:34 2019
+++ src/sys/dev/mii/atphy.c	Mon Sep  2 12:48:52 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.22 2019/04/11 09:00:34 msaitoh Exp $ */
+/*	$NetBSD: atphy.c,v 1.23 2019/09/02 12:48:52 msaitoh Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.22 2019/04/11 09:00:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.23 2019/09/02 12:48:52 msaitoh Exp $");
 
 #include 
 #include 
@@ -90,7 +90,7 @@ const struct mii_phy_funcs atphy_funcs =
 atphy_service, atphy_status, atphy_reset,
 };
 
-static const struct mii_phydesc etphys[] = {
+static const struct mii_phydesc atphys[] = {
 	MII_PHY_DESC(ATHEROS, F1),
 	MII_PHY_DESC(ATTANSIC, L1),
 	MII_PHY_DESC(ATTANSIC, L2),
@@ -118,7 +118,7 @@ atphy_match(device_t parent, cfdata_t ma
 {
 	struct mii_attach_args *ma = aux;
 
-	if (mii_phy_match(ma, etphys) != NULL)
+	if (mii_phy_match(ma, atphys) != NULL)
 		return 10;
 
 	return 0;
@@ -133,7 +133,7 @@ atphy_attach(device_t parent, device_t s
 	const struct mii_phydesc *mpd;
 	uint16_t bmsr;
 
-	mpd = mii_phy_match(ma, etphys);
+	mpd = mii_phy_match(ma, atphys);
 	aprint_naive(": Media interface\n");
 	aprint_normal(": %s, rev. %d\n", mpd->mpd_name, MII_REV(ma->mii_id2));
 



CVS commit: src/sys/dev/mii

2019-08-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 16 15:24:09 UTC 2019

Modified Files:
src/sys/dev/mii: etphy.c

Log Message:
>From FreeBSD:
- Support ET1011.
- Use mii_phy_flowstatus() to reflect flow status from negotiated result.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/etphy.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/mii

2019-08-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 16 15:24:09 UTC 2019

Modified Files:
src/sys/dev/mii: etphy.c

Log Message:
>From FreeBSD:
- Support ET1011.
- Use mii_phy_flowstatus() to reflect flow status from negotiated result.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/mii/etphy.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/etphy.c
diff -u src/sys/dev/mii/etphy.c:1.5 src/sys/dev/mii/etphy.c:1.6
--- src/sys/dev/mii/etphy.c:1.5	Fri Aug 16 15:17:31 2019
+++ src/sys/dev/mii/etphy.c	Fri Aug 16 15:24:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: etphy.c,v 1.5 2019/08/16 15:17:31 msaitoh Exp $	*/
+/*	$NetBSD: etphy.c,v 1.6 2019/08/16 15:24:09 msaitoh Exp $	*/
 /*	$OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $	*/
 
 /*
@@ -38,7 +38,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.5 2019/08/16 15:17:31 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.6 2019/08/16 15:24:09 msaitoh Exp $");
 
 #include 
 #include 
@@ -89,6 +89,7 @@ static const struct mii_phy_funcs etphy_
 
 static const struct mii_phydesc etphys[] = {
 	MII_PHY_DESC(AGERE, ET1011),
+	MII_PHY_DESC(AGERE, ET1011C),
 	MII_PHY_END,
 };
 
@@ -258,6 +259,11 @@ etphy_reset(struct mii_softc *sc)
 	uint16_t reg;
 	int i;
 
+	if (sc->mii_mpd_model == MII_MODEL_AGERE_ET1011) {
+		mii_phy_reset(sc);
+		return;
+	}
+
 	for (i = 0; i < 2; ++i) {
 		PHY_READ(sc, MII_PHYIDR1, );
 		PHY_READ(sc, MII_PHYIDR2, );
@@ -339,7 +345,7 @@ etphy_status(struct mii_softc *sc)
 	}
 
 	if (sr & ETPHY_SR_FDX)
-		mii->mii_media_active |= IFM_FDX;
+		mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
 	else
 		mii->mii_media_active |= IFM_HDX;
 }



CVS commit: src/sys/dev/mii

2019-08-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 16 15:20:18 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139 -r1.140 src/sys/dev/mii/miidevs_data.h

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/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.151 src/sys/dev/mii/miidevs.h:1.152
--- src/sys/dev/mii/miidevs.h:1.151	Thu Jun  6 16:05:45 2019
+++ src/sys/dev/mii/miidevs.h	Fri Aug 16 15:20:18 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151 2019/06/06 16:05:45 thorpej Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.152 2019/08/16 15:20:18 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp
+ *	NetBSD: miidevs,v 1.154 2019/08/16 15:19:48 msaitoh Exp
  */
 
 /*-
@@ -131,8 +131,10 @@
 /*
  * Agere PHYs
  */
-#define	MII_MODEL_AGERE_ET1011	0x0004
-#define	MII_STR_AGERE_ET1011	"Agere ET1011 10/100/1000baseT PHY"
+#define	MII_MODEL_AGERE_ET1011	0x0001
+#define	MII_STR_AGERE_ET1011	"ET1011 10/100/1000baseT PHY"
+#define	MII_MODEL_AGERE_ET1011C	0x0004
+#define	MII_STR_AGERE_ET1011C	"ET1011C 10/100/1000baseT PHY"
 
 /* Asix semiconductor PHYs */
 #define	MII_MODEL_xxASIX_AX88X9X	0x0031

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.139 src/sys/dev/mii/miidevs_data.h:1.140
--- src/sys/dev/mii/miidevs_data.h:1.139	Thu Jun  6 16:05:45 2019
+++ src/sys/dev/mii/miidevs_data.h	Fri Aug 16 15:20:18 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.139 2019/06/06 16:05:45 thorpej Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.140 2019/08/16 15:20:18 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp
+ *	NetBSD: miidevs,v 1.154 2019/08/16 15:19:48 msaitoh Exp
  */
 
 /*-
@@ -43,6 +43,7 @@ struct mii_knowndev {
 };
 struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011, MII_STR_AGERE_ET1011 },
+ { MII_OUI_AGERE, MII_MODEL_AGERE_ET1011C, MII_STR_AGERE_ET1011C },
  { MII_OUI_xxASIX, MII_MODEL_xxASIX_AX88X9X, MII_STR_xxASIX_AX88X9X },
  { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772, MII_STR_yyASIX_AX88772 },
  { MII_OUI_yyASIX, MII_MODEL_yyASIX_AX88772A, MII_STR_yyASIX_AX88772A },



CVS commit: src/sys/dev/mii

2019-08-16 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 16 15:20:18 UTC 2019

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.152 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139 -r1.140 src/sys/dev/mii/miidevs_data.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



<    1   2   3   4   5   6   7   8   >