diff options
Diffstat (limited to 'drivers/net/mii.c')
-rw-r--r-- | drivers/net/mii.c | 15 |
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) | |||
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 | ||