summaryrefslogtreecommitdiff
path: root/drivers/net/mii.c
diff options
context:
space:
mode:
authorDale Farnsworth <dale@farnsworth.org>2005-08-23 10:30:29 -0700
committerJeff Garzik <jgarzik@pobox.com>2005-09-14 08:46:21 -0400
commit43ec6e95e4d8a73afc2405a44b955c380aeeb65a (patch)
treee42008bc2e42ea42498229360f995d39357d6c62 /drivers/net/mii.c
parent7a700fafbed55eee2cc766fbe47cf68e229da281 (diff)
[PATCH] mii: Add test for GigE support
Signed-off-by: Dale Farnsworth <dale@farnsworth.org> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net/mii.c')
-rw-r--r--drivers/net/mii.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index c33cb3dc942b..e42aa797f08b 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -207,6 +207,20 @@ int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)
return 0;
}
+int mii_check_gmii_support(struct mii_if_info *mii)
+{
+ int reg;
+
+ reg = mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR);
+ if (reg & BMSR_ESTATEN) {
+ reg = mii->mdio_read(mii->dev, mii->phy_id, MII_ESTATUS);
+ if (reg & (ESTATUS_1000_TFULL | ESTATUS_1000_THALF))
+ return 1;
+ }
+
+ return 0;
+}
+
int mii_link_ok (struct mii_if_info *mii)
{
/* first, a dummy read, needed to latch some MII phys */
@@ -394,5 +408,6 @@ EXPORT_SYMBOL(mii_ethtool_gset);
EXPORT_SYMBOL(mii_ethtool_sset);
EXPORT_SYMBOL(mii_check_link);
EXPORT_SYMBOL(mii_check_media);
+EXPORT_SYMBOL(mii_check_gmii_support);
EXPORT_SYMBOL(generic_mii_ioctl);