CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 27 11:19:46 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ipgphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #490):

sys/dev/mii/ipgphy.c: revision 1.7

Print dmesg correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.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: [netbsd-9] src/sys/dev/mii

2019-11-27 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov 27 11:19:46 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ipgphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #490):

sys/dev/mii/ipgphy.c: revision 1.7

Print dmesg correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.6.2.2 -r1.6.2.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.6.2.2 src/sys/dev/mii/ipgphy.c:1.6.2.3
--- src/sys/dev/mii/ipgphy.c:1.6.2.2	Mon Nov 25 16:44:31 2019
+++ src/sys/dev/mii/ipgphy.c	Wed Nov 27 11:19:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipgphy.c,v 1.6.2.2 2019/11/25 16:44:31 martin Exp $ */
+/*	$NetBSD: ipgphy.c,v 1.6.2.3 2019/11/27 11:19:46 martin 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.2.2 2019/11/25 16:44:31 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipgphy.c,v 1.6.2.3 2019/11/27 11:19:46 martin Exp $");
 
 #include 
 #include 
@@ -118,7 +118,8 @@ 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);
- 
+
+	aprint_normal_dev(self, "");
 	mii_phy_add_media(sc);
 	aprint_normal("\n");
 }



CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:55:09 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket 479


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.4 -r1.151.2.5 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.4 -r1.139.2.5 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: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:55:09 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket 479


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.4 -r1.151.2.5 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.4 -r1.139.2.5 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.2.4 src/sys/dev/mii/miidevs.h:1.151.2.5
--- src/sys/dev/mii/miidevs.h:1.151.2.4	Mon Nov 25 16:53:55 2019
+++ src/sys/dev/mii/miidevs.h	Mon Nov 25 16:55:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs.h,v 1.151.2.4 2019/11/25 16:53:55 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.5 2019/11/25 16:55:09 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.4 src/sys/dev/mii/miidevs_data.h:1.139.2.5
--- src/sys/dev/mii/miidevs_data.h:1.139.2.4	Mon Nov 25 16:53:55 2019
+++ src/sys/dev/mii/miidevs_data.h	Mon Nov 25 16:55:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miidevs_data.h,v 1.139.2.4 2019/11/25 16:53:55 martin Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.139.2.5 2019/11/25 16:55:09 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.



CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:53:55 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: files.mii miidevs.h miidevs_data.h
Added Files:
src/sys/dev/mii [netbsd-9]: jmphy.c jmphyreg.h smscphy.c

Log Message:
Regen for ticket 479


To generate a diff of this commit:
cvs rdiff -u -r1.50.26.1 -r1.50.26.2 src/sys/dev/mii/files.mii
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/mii/jmphy.c src/sys/dev/mii/jmphyreg.h \
src/sys/dev/mii/smscphy.c
cvs rdiff -u -r1.151.2.3 -r1.151.2.4 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.3 -r1.139.2.4 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/files.mii
diff -u src/sys/dev/mii/files.mii:1.50.26.1 src/sys/dev/mii/files.mii:1.50.26.2
--- src/sys/dev/mii/files.mii:1.50.26.1	Mon Nov 25 16:44:31 2019
+++ src/sys/dev/mii/files.mii	Mon Nov 25 16:53:55 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mii,v 1.50.26.1 2019/11/25 16:44:31 martin Exp $
+#	$NetBSD: files.mii,v 1.50.26.2 2019/11/25 16:53:55 martin Exp $
 
 defflag	opt_mii.h	MIIVERBOSE
 
@@ -103,6 +103,10 @@ device	ipgphy: mii_phy
 attach	ipgphy at mii
 file	dev/mii/ipgphy.c			ipgphy
 
+device	jmphy: mii_phy
+attach	jmphy at mii
+file	dev/mii/jmphy.cjmphy
+
 device	sqphy: mii_phy
 attach	sqphy at mii
 file	dev/mii/sqphy.csqphy
@@ -162,3 +166,7 @@ file	dev/mii/rdcphy.c			rdcphy
 device	micphy: mii_phy, ukphy_subr
 attach	micphy at mii
 file	dev/mii/micphy.c			micphy
+
+device	smscphy: mii_phy
+attach	smscphy at mii
+file	dev/mii/smscphy.c			smscphy

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.151.2.3 src/sys/dev/mii/miidevs.h:1.151.2.4
--- src/sys/dev/mii/miidevs.h:1.151.2.3	Mon Nov 25 16:26:31 2019
+++ src/sys/dev/mii/miidevs.h	Mon Nov 25 16:53:55 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151.2.3 2019/11/25 16:26:31 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.4 2019/11/25 16:53:55 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin 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.139.2.3 src/sys/dev/mii/miidevs_data.h:1.139.2.4
--- src/sys/dev/mii/miidevs_data.h:1.139.2.3	Mon Nov 25 16:26:31 2019
+++ src/sys/dev/mii/miidevs_data.h	Mon Nov 25 16:53:55 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.139.2.3 2019/11/25 16:26:31 martin Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.139.2.4 2019/11/25 16:53:55 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin 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, 

CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:53:55 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: files.mii miidevs.h miidevs_data.h
Added Files:
src/sys/dev/mii [netbsd-9]: jmphy.c jmphyreg.h smscphy.c

Log Message:
Regen for ticket 479


To generate a diff of this commit:
cvs rdiff -u -r1.50.26.1 -r1.50.26.2 src/sys/dev/mii/files.mii
cvs rdiff -u -r0 -r1.1.2.2 src/sys/dev/mii/jmphy.c src/sys/dev/mii/jmphyreg.h \
src/sys/dev/mii/smscphy.c
cvs rdiff -u -r1.151.2.3 -r1.151.2.4 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.3 -r1.139.2.4 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: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:26:31 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #473


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.2 -r1.151.2.3 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.2 -r1.139.2.3 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.2.2 src/sys/dev/mii/miidevs.h:1.151.2.3
--- src/sys/dev/mii/miidevs.h:1.151.2.2	Wed Oct 23 19:46:53 2019
+++ src/sys/dev/mii/miidevs.h	Mon Nov 25 16:26:31 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151.2.2 2019/10/23 19:46:53 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.3 2019/11/25 16:26:31 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp
  */
 
 /*-
@@ -72,7 +72,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 */
@@ -81,7 +83,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 */
@@ -98,8 +99,9 @@
 #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 */
+/* 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 */
@@ -111,6 +113,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 */
@@ -343,14 +346,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
@@ -408,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.139.2.2 src/sys/dev/mii/miidevs_data.h:1.139.2.3
--- src/sys/dev/mii/miidevs_data.h:1.139.2.2	Wed Oct 23 19:46:53 2019
+++ src/sys/dev/mii/miidevs_data.h	Mon Nov 25 16:26:31 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.139.2.2 2019/10/23 19:46:53 martin Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.139.2.3 2019/11/25 16:26:31 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp
+ *	

CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:26:31 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #473


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.2 -r1.151.2.3 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.2 -r1.139.2.3 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: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:26:01 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs rlphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #473):

sys/dev/mii/rlphy.c: revision 1.37
sys/dev/mii/miidevs: revision 1.155
sys/dev/mii/miidevs: revision 1.156
sys/dev/mii/miidevs: revision 1.157
sys/dev/mii/miidevs: revision 1.159
sys/dev/mii/miidevs: revision 1.160

 Add Teranetics, Aquantia and Renesas.

 Use uppercase for vendor name.

 Change ICPLUS(0x0090c3) to xxICPLUS(0x0009c3)
- ICPLUS -> xxICPLUS
- Print model name if it's ICPLUS IP101 to avoid "Realtek internal PHY".

Fix typo. from vezhlys
- 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.153.2.2 -r1.153.2.3 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.36 -r1.36.4.1 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: [netbsd-9] src/sys/dev/mii

2019-11-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Nov 25 16:26:01 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs rlphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #473):

sys/dev/mii/rlphy.c: revision 1.37
sys/dev/mii/miidevs: revision 1.155
sys/dev/mii/miidevs: revision 1.156
sys/dev/mii/miidevs: revision 1.157
sys/dev/mii/miidevs: revision 1.159
sys/dev/mii/miidevs: revision 1.160

 Add Teranetics, Aquantia and Renesas.

 Use uppercase for vendor name.

 Change ICPLUS(0x0090c3) to xxICPLUS(0x0009c3)
- ICPLUS -> xxICPLUS
- Print model name if it's ICPLUS IP101 to avoid "Realtek internal PHY".

Fix typo. from vezhlys
- 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.153.2.2 -r1.153.2.3 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.36 -r1.36.4.1 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/miidevs
diff -u src/sys/dev/mii/miidevs:1.153.2.2 src/sys/dev/mii/miidevs:1.153.2.3
--- src/sys/dev/mii/miidevs:1.153.2.2	Wed Oct 23 19:45:56 2019
+++ src/sys/dev/mii/miidevs	Mon Nov 25 16:26:00 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp $
+$NetBSD: miidevs,v 1.153.2.3 2019/11/25 16:26:00 martin Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -65,7 +65,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
@@ -74,7 +76,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
@@ -91,8 +92,9 @@ 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 */
+/* Unregistered or wrong OUI */
 oui yyREALTEK			0x04	Realtek
 oui yyAMD			0x58	Advanced Micro Devices
 oui xxMYSON			0x00032d	Myson Technology
@@ -104,6 +106,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
@@ -242,10 +245,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
@@ -278,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

Index: src/sys/dev/mii/rlphy.c
diff -u src/sys/dev/mii/rlphy.c:1.36 src/sys/dev/mii/rlphy.c:1.36.4.1
--- src/sys/dev/mii/rlphy.c:1.36	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/rlphy.c	Mon Nov 25 16:26:00 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rlphy.c,v 1.36 2019/03/25 09:20:46 msaitoh Exp $	*/
+/*	$NetBSD: rlphy.c,v 1.36.4.1 2019/11/25 16:26:00 martin 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.36.4.1 2019/11/25 16:26:00 martin 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, 

CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 21 14:00:49 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: atphy.c mii_physubr.c miivar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #459):

sys/dev/mii/atphy.c: revision 1.23
sys/dev/mii/atphy.c: revision 1.25
sys/dev/mii/miivar.h: revision 1.69
sys/dev/mii/mii_physubr.c: revision 1.88

s/etphy/atphy/. No functional change.

 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.22 -r1.22.4.1 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.87 -r1.87.4.1 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.68 -r1.68.4.1 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.22 src/sys/dev/mii/atphy.c:1.22.4.1
--- src/sys/dev/mii/atphy.c:1.22	Thu Apr 11 09:00:34 2019
+++ src/sys/dev/mii/atphy.c	Thu Nov 21 14:00:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.22 2019/04/11 09:00:34 msaitoh Exp $ */
+/*	$NetBSD: atphy.c,v 1.22.4.1 2019/11/21 14:00:49 martin 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.22.4.1 2019/11/21 14:00:49 martin 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));
 
@@ -222,7 +222,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.87.4.1
--- src/sys/dev/mii/mii_physubr.c:1.87	Tue Apr  9 11:28:45 2019
+++ src/sys/dev/mii/mii_physubr.c	Thu Nov 21 14:00:49 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.87.4.1 2019/11/21 14:00:49 martin 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.87.4.1 2019/11/21 14:00:49 martin 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.68.4.1
--- src/sys/dev/mii/miivar.h:1.68	Thu Apr 11 09:14:07 2019
+++ src/sys/dev/mii/miivar.h	Thu Nov 21 14:00:49 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: miivar.h,v 1.68 2019/04/11 09:14:07 msaitoh Exp $	*/
+/*	$NetBSD: miivar.h,v 1.68.4.1 2019/11/21 14:00:49 martin 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 *);
 

CVS commit: [netbsd-9] src/sys/dev/mii

2019-11-21 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Nov 21 14:00:49 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: atphy.c mii_physubr.c miivar.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #459):

sys/dev/mii/atphy.c: revision 1.23
sys/dev/mii/atphy.c: revision 1.25
sys/dev/mii/miivar.h: revision 1.69
sys/dev/mii/mii_physubr.c: revision 1.88

s/etphy/atphy/. No functional change.

 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.22 -r1.22.4.1 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.87 -r1.87.4.1 src/sys/dev/mii/mii_physubr.c
cvs rdiff -u -r1.68 -r1.68.4.1 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: [netbsd-9] src/sys/dev/mii

2019-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov  6 09:53:59 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ukphy_subr.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #402):

sys/dev/mii/ukphy_subr.c: revision 1.16

Fix a bug that ukphy_status() misunderstand master mode.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.4.1 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.15.4.1
--- src/sys/dev/mii/ukphy_subr.c:1.15	Mon Mar 25 09:20:46 2019
+++ src/sys/dev/mii/ukphy_subr.c	Wed Nov  6 09:53:59 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.15.4.1 2019/11/06 09:53:59 martin 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.15.4.1 2019/11/06 09:53:59 martin 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: [netbsd-9] src/sys/dev/mii

2019-11-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Nov  6 09:53:59 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ukphy_subr.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #402):

sys/dev/mii/ukphy_subr.c: revision 1.16

Fix a bug that ukphy_status() misunderstand master mode.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.4.1 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: [netbsd-9] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:29:13 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #378):

sys/dev/mii/ciphy.c: revision 1.36

Call mii_phy_flowstatus() to show the flow setting.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.2 -r1.34.4.3 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: [netbsd-9] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:29:13 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #378):

sys/dev/mii/ciphy.c: revision 1.36

Call mii_phy_flowstatus() to show the flow setting.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.2 -r1.34.4.3 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.34.4.2 src/sys/dev/mii/ciphy.c:1.34.4.3
--- src/sys/dev/mii/ciphy.c:1.34.4.2	Wed Oct 23 19:45:56 2019
+++ src/sys/dev/mii/ciphy.c	Thu Oct 24 16:29:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $ */
+/* $NetBSD: ciphy.c,v 1.34.4.3 2019/10/24 16:29:13 martin Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.3 2019/10/24 16:29:13 martin 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: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:46:53 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #372


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.1 -r1.151.2.2 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 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: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:46:53 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #372


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.1 -r1.151.2.2 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.1 -r1.139.2.2 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.2.1 src/sys/dev/mii/miidevs.h:1.151.2.2
--- src/sys/dev/mii/miidevs.h:1.151.2.1	Mon Sep  2 07:06:11 2019
+++ src/sys/dev/mii/miidevs.h	Wed Oct 23 19:46:53 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151.2.1 2019/09/02 07:06:11 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.2 2019/10/23 19:46:53 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin 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 */
@@ -118,6 +116,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 */
@@ -305,23 +304,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 */
@@ -601,9 +603,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.139.2.1 src/sys/dev/mii/miidevs_data.h:1.139.2.2
--- 

CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:45:57 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c miidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #372):

sys/dev/mii/miidevs: revision 1.158
sys/dev/mii/ciphy.c: revision 1.37

- All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx".
- Rename CS82xx -> CIS82xx
- Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501.
- 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.34.4.1 -r1.34.4.2 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.153.2.1 -r1.153.2.2 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: [netbsd-9] src/sys/dev/mii

2019-10-23 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Oct 23 19:45:57 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c miidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #372):

sys/dev/mii/miidevs: revision 1.158
sys/dev/mii/ciphy.c: revision 1.37

- All of Cicada and Vitesse devices' OUI are not bit-reversed, so use "xx".
- Rename CS82xx -> CIS82xx
- Add Vitesse VSC8224, VSC8234, VSC8641 and VSC8501.
- 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.34.4.1 -r1.34.4.2 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.153.2.1 -r1.153.2.2 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/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.34.4.1 src/sys/dev/mii/ciphy.c:1.34.4.2
--- src/sys/dev/mii/ciphy.c:1.34.4.1	Thu Oct 17 19:06:58 2019
+++ src/sys/dev/mii/ciphy.c	Wed Oct 23 19:45:56 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $ */
+/* $NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin 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",

Index: src/sys/dev/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.153.2.1 src/sys/dev/mii/miidevs:1.153.2.2
--- src/sys/dev/mii/miidevs:1.153.2.1	Sun Sep  1 13:56:01 2019
+++ src/sys/dev/mii/miidevs	Wed Oct 23 19:45:56 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp $
+$NetBSD: miidevs,v 1.153.2.2 2019/10/23 19:45:56 martin Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -50,10 +50,8 @@ $NetBSD: miidevs,v 1.153.2.1 2019/09/01 
  */
 
 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
@@ -111,6 +109,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
@@ -220,15 +219,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 

CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 19:06:58 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c rgephy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #347):

sys/dev/mii/ciphy.c: revision 1.35
sys/dev/mii/rgephy.c: revision 1.56
sys/dev/mii/rgephy.c: revision 1.57

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

- Indicate master mode if the negotiated result say so.
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.55 -r1.55.2.1 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: [netbsd-9] src/sys/dev/mii

2019-10-17 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 17 19:06:58 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c rgephy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #347):

sys/dev/mii/ciphy.c: revision 1.35
sys/dev/mii/rgephy.c: revision 1.56
sys/dev/mii/rgephy.c: revision 1.57

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

- Indicate master mode if the negotiated result say so.
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.34.4.1 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.55 -r1.55.2.1 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.34.4.1
--- src/sys/dev/mii/ciphy.c:1.34	Thu Apr 11 09:14:07 2019
+++ src/sys/dev/mii/ciphy.c	Thu Oct 17 19:06:58 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.34.4.1 2019/10/17 19:06:58 martin 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.34.4.1 2019/10/17 19:06:58 martin 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.55 src/sys/dev/mii/rgephy.c:1.55.2.1
--- src/sys/dev/mii/rgephy.c:1.55	Wed Jun  5 17:50:06 2019
+++ src/sys/dev/mii/rgephy.c	Thu Oct 17 19:06:58 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rgephy.c,v 1.55 2019/06/05 17:50:06 triaxx Exp $	*/
+/*	$NetBSD: rgephy.c,v 1.55.2.1 2019/10/17 19:06:58 martin 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.55.2.1 2019/10/17 19:06:58 martin 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,28 +329,40 @@ 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)
 {
 	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;
 
-	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) {
-		

CVS commit: [netbsd-9] src/sys/dev/mii

2019-09-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep  2 07:06:11 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
regen (for ticket #144, also requested in ticket #171)


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.151.2.1 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139 -r1.139.2.1 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: [netbsd-9] src/sys/dev/mii

2019-09-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Sep  2 07:06:11 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: miidevs.h miidevs_data.h

Log Message:
regen (for ticket #144, also requested in ticket #171)


To generate a diff of this commit:
cvs rdiff -u -r1.151 -r1.151.2.1 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139 -r1.139.2.1 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.151.2.1
--- src/sys/dev/mii/miidevs.h:1.151	Thu Jun  6 16:05:45 2019
+++ src/sys/dev/mii/miidevs.h	Mon Sep  2 07:06:11 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151 2019/06/06 16:05:45 thorpej Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.1 2019/09/02 07:06:11 martin 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.153.2.1 2019/09/01 13:56:01 martin 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.139.2.1
--- src/sys/dev/mii/miidevs_data.h:1.139	Thu Jun  6 16:05:45 2019
+++ src/sys/dev/mii/miidevs_data.h	Mon Sep  2 07:06:11 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.139.2.1 2019/09/02 07:06:11 martin 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.153.2.1 2019/09/01 13:56:01 martin 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: [netbsd-9] src/sys/dev/mii

2019-09-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  1 13:56:01 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: etphy.c miidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #144):

sys/dev/mii/miidevs: revision 1.154
sys/dev/mii/etphy.c: revision 1.5
sys/dev/mii/etphy.c: revision 1.6

No functional change:
 - Use static.
 - KNF.

>From FreeBSD:
 - Rename ET1011 to ET1011C
 - Add ET1011

>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.4 -r1.4.4.1 src/sys/dev/mii/etphy.c
cvs rdiff -u -r1.153 -r1.153.2.1 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: [netbsd-9] src/sys/dev/mii

2019-09-01 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep  1 13:56:01 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: etphy.c miidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #144):

sys/dev/mii/miidevs: revision 1.154
sys/dev/mii/etphy.c: revision 1.5
sys/dev/mii/etphy.c: revision 1.6

No functional change:
 - Use static.
 - KNF.

>From FreeBSD:
 - Rename ET1011 to ET1011C
 - Add ET1011

>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.4 -r1.4.4.1 src/sys/dev/mii/etphy.c
cvs rdiff -u -r1.153 -r1.153.2.1 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/etphy.c
diff -u src/sys/dev/mii/etphy.c:1.4 src/sys/dev/mii/etphy.c:1.4.4.1
--- src/sys/dev/mii/etphy.c:1.4	Mon Mar 25 09:29:08 2019
+++ src/sys/dev/mii/etphy.c	Sun Sep  1 13:56:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: etphy.c,v 1.4 2019/03/25 09:29:08 msaitoh Exp $	*/
+/*	$NetBSD: etphy.c,v 1.4.4.1 2019/09/01 13:56:01 martin 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.4 2019/03/25 09:29:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.4.4.1 2019/09/01 13:56:01 martin Exp $");
 
 #include 
 #include 
@@ -77,18 +77,19 @@ __KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.
 #define ETPHY_SR_FDX		0x0080
 
 
-int	etphy_service(struct mii_softc *, struct mii_data *, int);
-void	etphy_attach(device_t, device_t, void *);
-int	etphy_match(device_t, cfdata_t, void *);
-void	etphy_reset(struct mii_softc *);
-void	etphy_status(struct mii_softc *);
+static int	etphy_service(struct mii_softc *, struct mii_data *, int);
+static void	etphy_attach(device_t, device_t, void *);
+static int	etphy_match(device_t, cfdata_t, void *);
+static void	etphy_reset(struct mii_softc *);
+static void	etphy_status(struct mii_softc *);
 
-const struct mii_phy_funcs etphy_funcs = {
+static const struct mii_phy_funcs etphy_funcs = {
 	etphy_service, etphy_status, etphy_reset,
 };
 
 static const struct mii_phydesc etphys[] = {
 	MII_PHY_DESC(AGERE, ET1011),
+	MII_PHY_DESC(AGERE, ET1011C),
 	MII_PHY_END,
 };
 
@@ -133,7 +134,7 @@ static const struct etphy_dsp {
 	{ 0x8010,	46 }	/* IdlguardTime */
 };
 
-int
+static int
 etphy_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct mii_attach_args *ma = aux;
@@ -144,7 +145,7 @@ etphy_match(device_t parent, cfdata_t ma
 	return 0;
 }
 
-void
+static void
 etphy_attach(device_t parent, device_t self, void *aux)
 {
 	struct mii_softc *sc = device_private(self);
@@ -185,7 +186,7 @@ etphy_attach(device_t parent, device_t s
 		aprint_error_dev(self, "couldn't establish power handler\n");
 }
 
-int
+static int
 etphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
 {
 	struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
@@ -229,7 +230,7 @@ etphy_service(struct mii_softc *sc, stru
 
 			if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
 PHY_WRITE(sc, MII_BMCR,
-	  bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
+bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
 			}
 		}
 		break;
@@ -252,19 +253,23 @@ etphy_service(struct mii_softc *sc, stru
 	return 0;
 }
 
-void
+static void
 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, );
 
 		PHY_READ(sc, ETPHY_CTRL, );
-		PHY_WRITE(sc, ETPHY_CTRL,
-		ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1);
+		PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1);
 
 		PHY_WRITE(sc, ETPHY_INDEX, ETPHY_INDEX_MAGIC);
 		PHY_READ(sc, ETPHY_DATA, );
@@ -294,13 +299,13 @@ etphy_reset(struct mii_softc *sc)
 
 	PHY_READ(sc, MII_BMCR, );
 	PHY_READ(sc, ETPHY_CTRL, );
-	PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN |  BMCR_S1000);
+	PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000);
 	PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1);
 
 	mii_phy_reset(sc);
 }
 
-void
+static void
 etphy_status(struct mii_softc *sc)
 {
 	struct mii_data *mii = sc->mii_pdata;
@@ -340,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;
 }

Index: src/sys/dev/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.153 src/sys/dev/mii/miidevs:1.153.2.1
--- src/sys/dev/mii/miidevs:1.153	Thu Jun  6 16:04:13 2019
+++ src/sys/dev/mii/miidevs	Sun Sep  1 13:56:01 2019
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp $
+$NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -124,7 +124,8 @@