4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
27 * MII overrides for Cicada (now Vitesse) PHYs.
30 #include <sys/types.h>
32 #include <sys/sunddi.h>
34 #include <sys/miiregs.h>
39 * The Realtek 10/100 PHYs are mostly standard compliant, but they
40 * lack a true vendor/device ID for the integrated PHY, and they don't
41 * report the "detected" non-Nway link speed in the appropriate
44 static int rtl8139_check(phy_handle_t
*);
45 static int rtl8201_check(phy_handle_t
*);
48 phy_realtek_probe(phy_handle_t
*ph
)
50 if ((ph
->phy_id
== 0) &&
51 (strcmp(phy_get_driver(ph
), "rtls") == 0)) {
52 ph
->phy_vendor
= "Realtek";
53 ph
->phy_model
= "Internal RTL8139";
54 ph
->phy_check
= rtl8139_check
;
56 } else if (ph
->phy_id
== 0x8201) {
57 ph
->phy_vendor
= "Realtek";
58 ph
->phy_model
= "RTL8201";
59 ph
->phy_check
= rtl8201_check
;
67 rtl8139_check(phy_handle_t
*ph
)
75 * We possibly override settings, so that we can use the PHYs
76 * autodetected link speed if the partner isn't doing NWay.
78 s
= phy_read(ph
, MII_VENDOR(0));
80 ph
->phy_link
= LINK_STATE_DOWN
;
82 ph
->phy_link
= LINK_STATE_UP
;
94 rtl8201_check(phy_handle_t
*ph
)
102 * We possibly override settings, so that we can use the PHYs
103 * autodetected link speed if the partner isn't doing NWay.
105 s
= phy_read(ph
, MII_VENDOR(9));
107 ph
->phy_link
= LINK_STATE_UP
;
109 } else if (s
& (1 << 1)) {
110 ph
->phy_link
= LINK_STATE_UP
;
113 ph
->phy_link
= LINK_STATE_DOWN
;