Martin Michlmayr <[EMAIL PROTECTED]> :
[...]
> Here's the output using the r8169 driver:
> 
> RealTek RTL-8110 registers:
> ------------------------------

The (untested) patch below should apply to the source code that Realtek
included in linux-r1000(103).zip, wherence supporting the extraction
of the same info.

--- r1000/src/r1000_ioctl.c     2006-07-28 21:35:25.000000000 +0200
+++ r1000/src/r1000_ioctl.c     2006-07-28 21:38:17.000000000 +0200
@@ -4,6 +4,27 @@ extern int R1000_READ_GMII_REG(unsigned 
 extern int R1000_WRITE_GMII_REG(unsigned long ioaddr, int RegAddr, int value);
 extern int r1000_set_speed_duplex(unsigned long ioaddr, unsigned long anar, 
unsigned long gbcr, unsigned long bmcr);
 
+#define R1000_REGS_SIZE 256
+
+static int r1000_get_regs_len(struct net_device *dev)
+{
+       return R1000_REGS_SIZE;
+}
+
+static void r1000_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+                          void *p)
+{
+       struct r1000_private *priv = netdev_priv(dev);
+       unsigned long flags;
+
+       if (regs->len > R1000_REGS_SIZE)
+               regs->len = R1000_REGS_SIZE;
+
+       spin_lock_irqsave(&priv->lock, flags);
+       memcpy_fromio(p, (void __iomem *)priv->ioaddr, regs->len);
+       spin_unlock_irqrestore(&priv->lock, flags);
+}
+
 static int ethtool_get_settings(struct net_device *netdev,struct ethtool_cmd 
*ecmd){
        struct r1000_private *priv = (struct r1000_private *)(netdev->priv);
        unsigned long ioaddr = priv->ioaddr;
@@ -136,6 +157,8 @@ int ethtool_ioctl(struct ifreq *ifr){
 
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
 struct ethtool_ops r1000_ethtool_ops = {
+       .get_regs_len   = r1000_get_regs_len,
+       .get_regs       = r1000_get_regs,
        .get_settings   = ethtool_get_settings,
        .set_settings   = ethtool_set_settings,
 };
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to