diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2014-01-31 00:41:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-02-01 19:56:49 -0500 |
commit | 1112909f76650e1d4c6de44b80c2d044c7c11e59 (patch) | |
tree | c0069612525bd3046f0f7231ca5537db4c63b230 /drivers/net/ethernet/ethoc.c | |
parent | 01cd7d578e01d342b1c06f0dc41c00b445415753 (diff) |
net: ethoc: implement ethtool get registers
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/ethoc.c')
-rw-r--r-- | drivers/net/ethernet/ethoc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c index 779d3c386ea7..5da32a71e8ac 100644 --- a/drivers/net/ethernet/ethoc.c +++ b/drivers/net/ethernet/ethoc.c | |||
@@ -51,6 +51,7 @@ MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size"); | |||
51 | #define ETH_HASH0 0x48 | 51 | #define ETH_HASH0 0x48 |
52 | #define ETH_HASH1 0x4c | 52 | #define ETH_HASH1 0x4c |
53 | #define ETH_TXCTRL 0x50 | 53 | #define ETH_TXCTRL 0x50 |
54 | #define ETH_END 0x54 | ||
54 | 55 | ||
55 | /* mode register */ | 56 | /* mode register */ |
56 | #define MODER_RXEN (1 << 0) /* receive enable */ | 57 | #define MODER_RXEN (1 << 0) /* receive enable */ |
@@ -912,9 +913,28 @@ static int ethoc_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
912 | return phy_ethtool_sset(phydev, cmd); | 913 | return phy_ethtool_sset(phydev, cmd); |
913 | } | 914 | } |
914 | 915 | ||
916 | static int ethoc_get_regs_len(struct net_device *netdev) | ||
917 | { | ||
918 | return ETH_END; | ||
919 | } | ||
920 | |||
921 | static void ethoc_get_regs(struct net_device *dev, struct ethtool_regs *regs, | ||
922 | void *p) | ||
923 | { | ||
924 | struct ethoc *priv = netdev_priv(dev); | ||
925 | u32 *regs_buff = p; | ||
926 | unsigned i; | ||
927 | |||
928 | regs->version = 0; | ||
929 | for (i = 0; i < ETH_END / sizeof(u32); ++i) | ||
930 | regs_buff[i] = ethoc_read(priv, i * sizeof(u32)); | ||
931 | } | ||
932 | |||
915 | const struct ethtool_ops ethoc_ethtool_ops = { | 933 | const struct ethtool_ops ethoc_ethtool_ops = { |
916 | .get_settings = ethoc_get_settings, | 934 | .get_settings = ethoc_get_settings, |
917 | .set_settings = ethoc_set_settings, | 935 | .set_settings = ethoc_set_settings, |
936 | .get_regs_len = ethoc_get_regs_len, | ||
937 | .get_regs = ethoc_get_regs, | ||
918 | .get_link = ethtool_op_get_link, | 938 | .get_link = ethtool_op_get_link, |
919 | .get_ts_info = ethtool_op_get_ts_info, | 939 | .get_ts_info = ethtool_op_get_ts_info, |
920 | }; | 940 | }; |