vm: fix potential null deref
[minix.git] / drivers / fxp / mii.h
blobd220392bb0f717d7581696368b059e26b097f971
1 /*
2 ibm/mii.h
4 Created: Nov 2004 by Philip Homburg <philip@f-mnx.phicoh.com>
6 Definitions for the Media Independent (Ethernet) Interface
7 */
9 #ifndef _FXP_MII_H
10 #define _FXP_MII_H
12 /* Registers in the Machine Independent Interface (MII) to the PHY.
13 * IEEE 802.3 (2000 Edition) Clause 22.
15 #define MII_CTRL 0x0 /* Control Register (basic) */
16 #define MII_CTRL_RST 0x8000 /* Reset PHY */
17 #define MII_CTRL_LB 0x4000 /* Enable Loopback Mode */
18 #define MII_CTRL_SP_LSB 0x2000 /* Speed Selection (LSB) */
19 #define MII_CTRL_ANE 0x1000 /* Auto Negotiation Enable */
20 #define MII_CTRL_PD 0x0800 /* Power Down */
21 #define MII_CTRL_ISO 0x0400 /* Isolate */
22 #define MII_CTRL_RAN 0x0200 /* Restart Auto-Negotiation Process */
23 #define MII_CTRL_DM 0x0100 /* Full Duplex */
24 #define MII_CTRL_CT 0x0080 /* Enable COL Signal Test */
25 #define MII_CTRL_SP_MSB 0x0040 /* Speed Selection (MSB) */
26 #define MII_CTRL_SP_10 0x0000 /* 10 Mb/s */
27 #define MII_CTRL_SP_100 0x2000 /* 100 Mb/s */
28 #define MII_CTRL_SP_1000 0x0040 /* 1000 Mb/s */
29 #define MII_CTRL_SP_RES 0x2040 /* Reserved */
30 #define MII_CTRL_RES 0x003F /* Reserved */
31 #define MII_STATUS 0x1 /* Status Register (basic) */
32 #define MII_STATUS_100T4 0x8000 /* 100Base-T4 support */
33 #define MII_STATUS_100XFD 0x4000 /* 100Base-X FD support */
34 #define MII_STATUS_100XHD 0x2000 /* 100Base-X HD support */
35 #define MII_STATUS_10FD 0x1000 /* 10 Mb/s FD support */
36 #define MII_STATUS_10HD 0x0800 /* 10 Mb/s HD support */
37 #define MII_STATUS_100T2FD 0x0400 /* 100Base-T2 FD support */
38 #define MII_STATUS_100T2HD 0x0200 /* 100Base-T2 HD support */
39 #define MII_STATUS_EXT_STAT 0x0100 /* Supports MII_EXT_STATUS */
40 #define MII_STATUS_RES 0x0080 /* Reserved */
41 #define MII_STATUS_MFPS 0x0040 /* MF Preamble Suppression */
42 #define MII_STATUS_ANC 0x0020 /* Auto-Negotiation Completed */
43 #define MII_STATUS_RF 0x0010 /* Remote Fault Detected */
44 #define MII_STATUS_ANA 0x0008 /* Auto-Negotiation Ability */
45 #define MII_STATUS_LS 0x0004 /* Link Up */
46 #define MII_STATUS_JD 0x0002 /* Jabber Condition Detected */
47 #define MII_STATUS_EC 0x0001 /* Ext Register Capabilities */
48 #define MII_PHYID_H 0x2 /* PHY ID (high) */
49 #define MII_PH_OUI_H_MASK 0xFFFF /* High part of OUI */
50 #define MII_PH_OUI_H_C_SHIFT 6 /* Shift up in OUI */
51 #define MII_PHYID_L 0x3 /* PHY ID (low) */
52 #define MII_PL_OUI_L_MASK 0xFC00 /* Low part of OUI */
53 #define MII_PL_OUI_L_SHIFT 10
54 #define MII_PL_MODEL_MASK 0x03F0 /* Model */
55 #define MII_PL_MODEL_SHIFT 4
56 #define MII_PL_REV_MASK 0x000F /* Revision */
57 #define MII_ANA 0x4 /* Auto-Negotiation Advertisement */
58 #define MII_ANA_NP 0x8000 /* Next PAge */
59 #define MII_ANA_RES 0x4000 /* Reserved */
60 #define MII_ANA_RF 0x2000 /* Remote Fault */
61 #define MII_ANA_TAF_M 0x1FE0 /* Technology Ability Field */
62 #define MII_ANA_TAF_S 5 /* Shift */
63 #define MII_ANA_TAF_RES 0x1000 /* Reserved */
64 #define MII_ANA_PAUSE_ASYM 0x0800 /* Asym. Pause */
65 #define MII_ANA_PAUSE_SYM 0x0400 /* Sym. Pause */
66 #define MII_ANA_100T4 0x0200 /* 100Base-T4 */
67 #define MII_ANA_100TXFD 0x0100 /* 100Base-TX FD */
68 #define MII_ANA_100TXHD 0x0080 /* 100Base-TX HD */
69 #define MII_ANA_10TFD 0x0040 /* 10Base-T FD */
70 #define MII_ANA_10THD 0x0020 /* 10Base-T HD */
71 #define MII_ANA_SEL_M 0x001F /* Selector Field */
72 #define MII_ANA_SEL_802_3 0x0001 /* 802.3 */
73 #define MII_ANLPA 0x5 /* Auto-Neg Link Partner Ability Register */
74 #define MII_ANLPA_NP 0x8000 /* Next Page */
75 #define MII_ANLPA_ACK 0x4000 /* Acknowledge */
76 #define MII_ANLPA_RF 0x2000 /* Remote Fault */
77 #define MII_ANLPA_TAF_M 0x1FC0 /* Technology Ability Field */
78 #define MII_ANLPA_SEL_M 0x001F /* Selector Field */
79 #define MII_ANE 0x6 /* Auto-Negotiation Expansion */
80 #define MII_ANE_RES 0xFFE0 /* Reserved */
81 #define MII_ANE_PDF 0x0010 /* Parallel Detection Fault */
82 #define MII_ANE_LPNPA 0x0008 /* Link Partner is Next Page Able */
83 #define MII_ANE_NPA 0x0002 /* Local Device is Next Page Able */
84 #define MII_ANE_PR 0x0002 /* New Page has been received */
85 #define MII_ANE_LPANA 0x0001 /* Link Partner is Auto-Neg.able */
86 #define MII_ANNPT 0x7 /* Auto-Negotiation Next Page Transmit */
87 #define MII_ANLPRNP 0x8 /* Auto-Neg Link Partner Received Next Page */
88 #define MII_MS_CTRL 0x9 /* MASTER-SLAVE Control Register */
89 #define MII_MSC_TEST_MODE 0xE000 /* Test mode */
90 #define MII_MSC_MS_MANUAL 0x1000 /* Master/slave manual config */
91 #define MII_MSC_MS_VAL 0x0800 /* Master/slave value */
92 #define MII_MSC_MULTIPORT 0x0400 /* Multi-port device */
93 #define MII_MSC_1000T_FD 0x0200 /* 1000Base-T Full Duplex */
94 #define MII_MSC_1000T_HD 0x0100 /* 1000Base-T Half Duplex */
95 #define MII_MSC_RES 0x00FF /* Reserved */
96 #define MII_MS_STATUS 0xA /* MASTER-SLAVE Status Register */
97 #define MII_MSS_FAULT 0x8000 /* Master/slave config fault */
98 #define MII_MSS_MASTER 0x4000 /* Master */
99 #define MII_MSS_LOCREC 0x2000 /* Local Receiver OK */
100 #define MII_MSS_REMREC 0x1000 /* Remote Receiver OK */
101 #define MII_MSS_LP1000T_FD 0x0800 /* Link Partner 1000-T FD */
102 #define MII_MSS_LP1000T_HD 0x0400 /* Link Partner 1000-T HD */
103 #define MII_MSS_RES 0x0300 /* Reserved */
104 #define MII_MSS_IDLE_ERR 0x00FF /* Idle Error Counter */
105 /* 0xB ... 0xE */ /* Reserved */
106 #define MII_EXT_STATUS 0xF /* Extended Status */
107 #define MII_ESTAT_1000XFD 0x8000 /* 1000Base-X Full Duplex */
108 #define MII_ESTAT_1000XHD 0x4000 /* 1000Base-X Half Duplex */
109 #define MII_ESTAT_1000TFD 0x2000 /* 1000Base-T Full Duplex */
110 #define MII_ESTAT_1000THD 0x1000 /* 1000Base-T Half Duplex */
111 #define MII_ESTAT_RES 0x0FFF /* Reserved */
112 /* 0x10 ... 0x1F */ /* Vendor Specific */
114 void mii_print_stat_speed(u16_t stat, u16_t extstat);
115 void mii_print_techab(u16_t techab);
117 #endif
119 * $PchId: mii.h,v 1.1 2004/12/27 13:33:30 philip Exp $