developer | fd40db2 | 2021-04-29 10:08:25 +0800 | [diff] [blame] | 1 | /* Copyright 2016 MediaTek Inc. |
| 2 | * Author: Harry Huang <harry.huang@mediatek.com> |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | #ifndef RA_ETHTOOL_H |
| 14 | #define RA_ETHTOOL_H |
| 15 | |
| 16 | extern struct net_device *dev_raether; |
| 17 | |
| 18 | /* ethtool related */ |
| 19 | void ethtool_init(struct net_device *dev); |
| 20 | int et_get_settings(struct net_device *dev, struct ethtool_cmd *cmd); |
| 21 | u32 et_get_link(struct net_device *dev); |
| 22 | unsigned char get_current_phy_address(void); |
| 23 | int mdio_read(struct net_device *dev, int phy_id, int location); |
| 24 | void mdio_write(struct net_device *dev, int phy_id, int location, int value); |
| 25 | |
| 26 | /* for pseudo interface */ |
| 27 | void ethtool_virt_init(struct net_device *dev); |
| 28 | int et_virt_get_settings(struct net_device *dev, struct ethtool_cmd *cmd); |
| 29 | u32 et_virt_get_link(struct net_device *dev); |
| 30 | int mdio_virt_read(struct net_device *dev, int phy_id, int location); |
| 31 | void mdio_virt_write(struct net_device *dev, int phy_id, int location, |
| 32 | int value); |
| 33 | |
| 34 | #endif |