···3333#include <linux/ethtool.h>3434#include <linux/mii.h>35353636+/**3737+ * mii_ethtool_gset - get settings that are specified in @ecmd3838+ * @mii: MII interface3939+ * @ecmd: requested ethtool_cmd4040+ *4141+ * Returns 0 for success, negative on error.4242+ */3643int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)3744{3845 struct net_device *dev = mii->dev;···121114 return 0;122115}123116117117+/**118118+ * mii_ethtool_sset - set settings that are specified in @ecmd119119+ * @mii: MII interface120120+ * @ecmd: requested ethtool_cmd121121+ *122122+ * Returns 0 for success, negative on error.123123+ */124124int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd)125125{126126 struct net_device *dev = mii->dev;···221207 return 0;222208}223209210210+/**211211+ * mii_check_gmii_support - check if the MII supports Gb interfaces212212+ * @mii: the MII interface213213+ */224214int mii_check_gmii_support(struct mii_if_info *mii)225215{226216 int reg;···239221 return 0;240222}241223224224+/**225225+ * mii_link_ok - is link status up/ok226226+ * @mii: the MII interface227227+ *228228+ * Returns 1 if the MII reports link status up/ok, 0 otherwise.229229+ */242230int mii_link_ok (struct mii_if_info *mii)243231{244232 /* first, a dummy read, needed to latch some MII phys */···254230 return 0;255231}256232233233+/**234234+ * mii_nway_restart - restart NWay (autonegotiation) for this interface235235+ * @mii: the MII interface236236+ *237237+ * Returns 0 on success, negative on error.238238+ */257239int mii_nway_restart (struct mii_if_info *mii)258240{259241 int bmcr;···277247 return r;278248}279249250250+/**251251+ * mii_check_link - check MII link status252252+ * @mii: MII interface253253+ *254254+ * If the link status changed (previous != current), call255255+ * netif_carrier_on() if current link status is Up or call256256+ * netif_carrier_off() if current link status is Down.257257+ */280258void mii_check_link (struct mii_if_info *mii)281259{282260 int cur_link = mii_link_ok(mii);···296258 netif_carrier_off(mii->dev);297259}298260261261+/**262262+ * mii_check_media - check the MII interface for a duplex change263263+ * @mii: the MII interface264264+ * @ok_to_print: OK to print link up/down messages265265+ * @init_media: OK to save duplex mode in @mii266266+ *267267+ * Returns 1 if the duplex mode changed, 0 if not.268268+ * If the media type is forced, always returns 0.269269+ */299270unsigned int mii_check_media (struct mii_if_info *mii,300271 unsigned int ok_to_print,301272 unsigned int init_media)···373326 return 0; /* duplex did not change */374327}375328329329+/**330330+ * generic_mii_ioctl - main MII ioctl interface331331+ * @mii_if: the MII interface332332+ * @mii_data: MII ioctl data structure333333+ * @cmd: MII ioctl command334334+ * @duplex_chg_out: pointer to @duplex_changed status if there was no335335+ * ioctl error336336+ *337337+ * Returns 0 on success, negative on error.338338+ */376339int generic_mii_ioctl(struct mii_if_info *mii_if,377340 struct mii_ioctl_data *mii_data, int cmd,378341 unsigned int *duplex_chg_out)