Module Name:    src
Committed By:   msaitoh
Date:           Mon Jun 18 09:11:03 UTC 2018

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

Log Message:
- Rename ENP (Extended Next Page) to XNP.
- Add ANLPAR_XNP bit.
- Add definitions for RF1 and RF2 (for 1000BASE-X) .
- Rename MII_ANNP (Autonegotiation next page transmit) register to MII_ANNPT.
- Add bit definitions for MII_ANNPT and MII_ANLPRNP.
- Remove GTSR_LP_ASM_DIR bit. This is not described in the 802.3 spec now and
  no any NetBSD drivers use the definition.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/mii/mii.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/mii.h
diff -u src/sys/dev/mii/mii.h:1.22 src/sys/dev/mii/mii.h:1.23
--- src/sys/dev/mii/mii.h:1.22	Wed Jun  7 03:21:31 2017
+++ src/sys/dev/mii/mii.h	Mon Jun 18 09:11:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mii.h,v 1.22 2017/06/07 03:21:31 msaitoh Exp $	*/
+/*	$NetBSD: mii.h,v 1.23 2018/06/18 09:11:03 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
@@ -111,7 +111,7 @@
 #define ANAR_NP		0x8000	/* Next page (ro) */
 #define	ANAR_ACK	0x4000	/* link partner abilities acknowledged (ro) */
 #define ANAR_RF		0x2000	/* remote fault (ro) */
-#define ANAR_ENP	0x1000	/* Extended Next Page */
+#define ANAR_XNP	0x1000	/* Extended Next Page */
 		/* Annex 28B.2 */
 #define	ANAR_FC		0x0400	/* local device supports PAUSE */
 #define ANAR_T4		0x0200	/* local device supports 100bT4 */
@@ -132,12 +132,21 @@
 #define	ANAR_X_PAUSE_SYM	(1 << 7)
 #define	ANAR_X_PAUSE_ASYM	(2 << 7)
 #define	ANAR_X_PAUSE_TOWARDS	(3 << 7)
+	/* 37.2.1.5 Remore Fault */
+#define	ANAR_X_RF1	0x1000
+#define	ANAR_X_RF2	0x2000
+#define ANAR_X_RF_MASK		(ANAR_X_RF1 | ANAR_X_RF2)
+#define ANAR_X_RF_NONE		(0 << 12)
+#define ANAR_X_RF_OFFLINE	(1 << 12)
+#define ANAR_X_RF_LINKFAIL	(2 << 12)
+#define ANAR_X_RF_ANEGERR	(3 << 12)
 
 #define	MII_ANLPAR	0x05	/* ANEG Link Partner Base Page abilities (rw)*/
 		/* section 28.2.4.1 and 37.2.6.1 */
 #define ANLPAR_NP	0x8000	/* Next page (ro) */
 #define	ANLPAR_ACK	0x4000	/* link partner accepted ACK (ro) */
 #define ANLPAR_RF	0x2000	/* remote fault (ro) */
+#define ANLPAR_XNP	0x1000	/* Extended Next Page */
 #define	ANLPAR_FC	0x0400	/* link partner supports PAUSE */
 #define ANLPAR_T4	0x0200	/* link partner supports 100bT4 */
 #define ANLPAR_TX_FD	0x0100	/* link partner supports 100bTx FD */
@@ -158,6 +167,14 @@
 #define	ANLPAR_X_PAUSE_SYM	(1 << 7)
 #define	ANLPAR_X_PAUSE_ASYM	(2 << 7)
 #define	ANLPAR_X_PAUSE_TOWARDS	(3 << 7)
+	/* 37.2.1.5 Remore Fault */
+#define	ANLPAR_X_RF1	0x1000
+#define	ANLPAR_X_RF2	0x2000
+#define	ANLPAR_X_RF_MASK	(ANLPAR_X_RF1 | ANLPAR_X_RF2)
+#define ANLPAR_X_RF_NONE	(0 << 12)
+#define ANLPAR_X_RF_OFFLINE	(1 << 12)
+#define ANLPAR_X_RF_LINKFAIL	(2 << 12)
+#define ANLPAR_X_RF_ANEGERR	(3 << 12)
 
 #define	MII_ANER	0x06	/* Autonegotiation expansion (ro) */
 		/* section 28.2.4.1 and 37.2.6.1 */
@@ -169,11 +186,36 @@
 #define ANER_PAGE_RX	0x0002	/* Page received */
 #define ANER_LPAN	0x0001	/* link partner autoneg-able */
 
-#define	MII_ANNP	0x07	/* Autonegotiation next page (rw) */
+#define	MII_ANNPT	0x07	/* Autonegotiation next page transmit (rw) */
 		/* section 28.2.4.1 and 37.2.6.1 */
+#define ANNPT_NP	0x8000	/* Next Page */
+#define ANNPT_MP	0x2000	/* Message Page */
+#define ANNPT_ACK2	0x1000	/* Acknowledge 2 */
+#define ANNPT_TOGGLE	0x0800	/* Toggle */
+#define ANNPT_MSGUNF_MASK 0x07ff /* Message(Annex28C)/Unformatted Code Field */
+
+/* Next Page Message Code used in ANNPT and ANLPRNP */
+#define ANNP_MSG_NULL		1    /* Null Message */
+#define ANNP_MSG_1UP_TAF	2    /* 1Up w/ Tech. Ability Field follows */
+#define ANNP_MSG_2UP_TAF	3    /* 2Up w/ Tech. Ability Field follows */
+#define ANNP_MSG_1UP_BCRF	4    /* 1Up w/ Bin. coded Remote Flt follows */
+#define ANNP_MSG_OUIDTMSG	5    /* OUI tagged Message */
+#define ANNP_MSG_PHYIDTC	6    /* PHY Identifier Tag Code */
+#define ANNP_MSG_TMC_100T2	7    /* 100BASE-T2 Tech. Message Code */
+#define ANNP_MSG_TMC_1000T	8    /* 1000BASE-T Tech. Message Code */
+#define ANNP_MSG_TMC_10G1G	9    /* 10GBASE-T/1000BASE-T TMC: (XNP) */
+#define ANNP_MSG_TMC_EEE	10   /* EEE Technology Message Code */
+#define ANNP_MSG_OUIDTM_XNP	11   /* OUI tagged Message (XNP) */
+
 
 #define	MII_ANLPRNP	0x08	/* Autonegotiation link partner rx next page */
 		/* section 32.5.1 and 37.2.6.1 */
+#define ANLPRNP_NP	0x8000	/* Next Page */
+#define ANLPRNP_ACK	0x4000	/* Acknowledge */
+#define ANLPRNP_MP	0x2000	/* Message Page */
+#define ANLPRNP_ACK2	0x1000	/* Acknowledge 2 */
+#define ANLPRNP_TOGGLE	0x0800	/* Toggle */
+#define ANLPRNP_MSGUNF_MASK 0x07ff /* Message(Anx28C)/Unformatted Code Field */
 
 			/* This is also the 1000baseT control register */
 #define	MII_100T2CR	0x09	/* 100base-T2 control register */
@@ -192,7 +234,6 @@
 #define	GTSR_RRS	0x1000	/* remote rx status, 1 = ok */
 #define	GTSR_LP_1000TFDX 0x0800	/* link partner 1000baseT FDX capable */
 #define	GTSR_LP_1000THDX 0x0400	/* link partner 1000baseT HDX capable */
-#define	GTSR_LP_ASM_DIR	0x0200	/* link partner asym. pause dir. capable */
 #define	GTSR_IDLE_ERR	0x00ff	/* IDLE error count */
 
 #define	MII_PSECR	0x0b	/* PSE control register */

Reply via email to