diff options
author | Dale Farnsworth <dale@farnsworth.org> | 2005-08-23 13:30:29 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-14 08:46:21 -0400 |
commit | 43ec6e95e4d8a73afc2405a44b955c380aeeb65a (patch) | |
tree | e42008bc2e42ea42498229360f995d39357d6c62 | |
parent | 7a700fafbed55eee2cc766fbe47cf68e229da281 (diff) |
[PATCH] mii: Add test for GigE support
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r-- | drivers/net/mii.c | 15 | ||||
-rw-r--r-- | include/linux/mii.h | 1 |
2 files changed, 16 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) | |||
207 | return 0; | 207 | return 0; |
208 | } | 208 | } |
209 | 209 | ||
210 | int mii_check_gmii_support(struct mii_if_info *mii) | ||
211 | { | ||
212 | int reg; | ||
213 | |||
214 | reg = mii->mdio_read(mii->dev, mii->phy_id, MII_BMSR); | ||
215 | if (reg & BMSR_ESTATEN) { | ||
216 | reg = mii->mdio_read(mii->dev, mii->phy_id, MII_ESTATUS); | ||
217 | if (reg & (ESTATUS_1000_TFULL | ESTATUS_1000_THALF)) | ||
218 | return 1; | ||
219 | } | ||
220 | |||
221 | return 0; | ||
222 | } | ||
223 | |||
210 | int mii_link_ok (struct mii_if_info *mii) | 224 | int mii_link_ok (struct mii_if_info *mii) |
211 | { | 225 | { |
212 | /* first, a dummy read, needed to latch some MII phys */ | 226 | /* first, a dummy read, needed to latch some MII phys */ |
@@ -394,5 +408,6 @@ EXPORT_SYMBOL(mii_ethtool_gset); | |||
394 | EXPORT_SYMBOL(mii_ethtool_sset); | 408 | EXPORT_SYMBOL(mii_ethtool_sset); |
395 | EXPORT_SYMBOL(mii_check_link); | 409 | EXPORT_SYMBOL(mii_check_link); |
396 | EXPORT_SYMBOL(mii_check_media); | 410 | EXPORT_SYMBOL(mii_check_media); |
411 | EXPORT_SYMBOL(mii_check_gmii_support); | ||
397 | EXPORT_SYMBOL(generic_mii_ioctl); | 412 | EXPORT_SYMBOL(generic_mii_ioctl); |
398 | 413 | ||
diff --git a/include/linux/mii.h b/include/linux/mii.h index 9b8d0476988a..68f5a0f392dd 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -158,6 +158,7 @@ extern int mii_link_ok (struct mii_if_info *mii); | |||
158 | extern int mii_nway_restart (struct mii_if_info *mii); | 158 | extern int mii_nway_restart (struct mii_if_info *mii); |
159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 159 | extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); | 160 | extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); |
161 | extern int mii_check_gmii_support(struct mii_if_info *mii); | ||
161 | extern void mii_check_link (struct mii_if_info *mii); | 162 | extern void mii_check_link (struct mii_if_info *mii); |
162 | extern unsigned int mii_check_media (struct mii_if_info *mii, | 163 | extern unsigned int mii_check_media (struct mii_if_info *mii, |
163 | unsigned int ok_to_print, | 164 | unsigned int ok_to_print, |