Commit 1112909f authored by Max Filippov's avatar Max Filippov Committed by David S. Miller

net: ethoc: implement ethtool get registers

Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Reviewed-by: default avatarBen Hutchings <ben@decadent.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 01cd7d57
...@@ -51,6 +51,7 @@ MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size"); ...@@ -51,6 +51,7 @@ MODULE_PARM_DESC(buffer_size, "DMA buffer allocation size");
#define ETH_HASH0 0x48 #define ETH_HASH0 0x48
#define ETH_HASH1 0x4c #define ETH_HASH1 0x4c
#define ETH_TXCTRL 0x50 #define ETH_TXCTRL 0x50
#define ETH_END 0x54
/* mode register */ /* mode register */
#define MODER_RXEN (1 << 0) /* receive enable */ #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,9 +913,28 @@ static int ethoc_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
return phy_ethtool_sset(phydev, cmd); return phy_ethtool_sset(phydev, cmd);
} }
static int ethoc_get_regs_len(struct net_device *netdev)
{
return ETH_END;
}
static void ethoc_get_regs(struct net_device *dev, struct ethtool_regs *regs,
void *p)
{
struct ethoc *priv = netdev_priv(dev);
u32 *regs_buff = p;
unsigned i;
regs->version = 0;
for (i = 0; i < ETH_END / sizeof(u32); ++i)
regs_buff[i] = ethoc_read(priv, i * sizeof(u32));
}
const struct ethtool_ops ethoc_ethtool_ops = { const struct ethtool_ops ethoc_ethtool_ops = {
.get_settings = ethoc_get_settings, .get_settings = ethoc_get_settings,
.set_settings = ethoc_set_settings, .set_settings = ethoc_set_settings,
.get_regs_len = ethoc_get_regs_len,
.get_regs = ethoc_get_regs,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_ts_info = ethtool_op_get_ts_info, .get_ts_info = ethtool_op_get_ts_info,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment