diff options
Diffstat (limited to 'drivers/net/sk98lin/skethtool.c')
-rw-r--r-- | drivers/net/sk98lin/skethtool.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/sk98lin/skethtool.c b/drivers/net/sk98lin/skethtool.c index e5cb5b548b88..36460694eb82 100644 --- a/drivers/net/sk98lin/skethtool.c +++ b/drivers/net/sk98lin/skethtool.c | |||
@@ -581,6 +581,30 @@ static int setRxCsum(struct net_device *dev, u32 data) | |||
581 | return 0; | 581 | return 0; |
582 | } | 582 | } |
583 | 583 | ||
584 | static int getRegsLen(struct net_device *dev) | ||
585 | { | ||
586 | return 0x4000; | ||
587 | } | ||
588 | |||
589 | /* | ||
590 | * Returns copy of whole control register region | ||
591 | * Note: skip RAM address register because accessing it will | ||
592 | * cause bus hangs! | ||
593 | */ | ||
594 | static void getRegs(struct net_device *dev, struct ethtool_regs *regs, | ||
595 | void *p) | ||
596 | { | ||
597 | DEV_NET *pNet = netdev_priv(dev); | ||
598 | const void __iomem *io = pNet->pAC->IoBase; | ||
599 | |||
600 | regs->version = 1; | ||
601 | memset(p, 0, regs->len); | ||
602 | memcpy_fromio(p, io, B3_RAM_ADDR); | ||
603 | |||
604 | memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, | ||
605 | regs->len - B3_RI_WTO_R1); | ||
606 | } | ||
607 | |||
584 | const struct ethtool_ops SkGeEthtoolOps = { | 608 | const struct ethtool_ops SkGeEthtoolOps = { |
585 | .get_settings = getSettings, | 609 | .get_settings = getSettings, |
586 | .set_settings = setSettings, | 610 | .set_settings = setSettings, |
@@ -599,4 +623,6 @@ const struct ethtool_ops SkGeEthtoolOps = { | |||
599 | .set_tx_csum = setTxCsum, | 623 | .set_tx_csum = setTxCsum, |
600 | .get_rx_csum = getRxCsum, | 624 | .get_rx_csum = getRxCsum, |
601 | .set_rx_csum = setRxCsum, | 625 | .set_rx_csum = setRxCsum, |
626 | .get_regs = getRegs, | ||
627 | .get_regs_len = getRegsLen, | ||
602 | }; | 628 | }; |