mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] eth_v10.c phy fix
@ 2008-06-13 15:04 Pieter Steyn
  2008-06-13 16:00 ` Pieter Steyn
  0 siblings, 1 reply; 5+ messages in thread
From: Pieter Steyn @ 2008-06-13 15:04 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 899 bytes --]

Hi guys,

This patch allows you to set phy address parameters through ethtool, like:

/bin/ethtool -s eth0 phyad 8

--- drivers/net/cris/eth_v10.c  2008-06-12 14:12:33.000000000 +0200
+++ drivers/net/cris/eth_v10.c  2008-06-12 14:19:35.000000000 +0200
@@ -1430,7 +1430,11 @@
                e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full);
                e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100);
        }
-
+        //Honor ethtool phy address parameter, which was simply
discarded before this.
+        if (ecmd->phy_address <= 31)
+                mdio_phy_addr = ecmd->phy_address;
+        else if (ecmd->phy_address == 32)
+                return -ENODEV;
        return 0;
 }

I've searched the MAINTAINERS file and haven't seen anything regarding
either the source file name or cris.  Please consider applying my
patch to main kernel...

Thanks,
Pieter Steyn

[-- Attachment #2: eth_v10.patch --]
[-- Type: application/octet-stream, Size: 558 bytes --]

--- drivers/net/cris/eth_v10.c	2008-06-12 14:12:33.000000000 +0200
+++ drivers/net/cris/eth_v10.c	2008-06-12 14:19:35.000000000 +0200
@@ -1430,7 +1430,11 @@
 		e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full);
 		e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100);
 	}
-
+        //Honor ethtool phy address parameter, which was simply unused before this.
+        if (ecmd->phy_address <= 31)
+                mdio_phy_addr = ecmd->phy_address;
+        else if (ecmd->phy_address == 32)
+                return -ENODEV;
 	return 0;
 }
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] eth_v10.c phy fix
  2008-06-13 15:04 [PATCH] eth_v10.c phy fix Pieter Steyn
@ 2008-06-13 16:00 ` Pieter Steyn
  2008-06-18 12:09   ` Pieter Steyn
  0 siblings, 1 reply; 5+ messages in thread
From: Pieter Steyn @ 2008-06-13 16:00 UTC (permalink / raw)
  To: linux-kernel; +Cc: jesper.nilsson

Ah, I did not consider case when searching...DOH! :]

I've now cc'ed in Jesper who seems to be the maintainer.

Cheers,
Pieter Steyn

> On 6/13/08, Pieter Steyn <pieterste@gmail.com> wrote:
> Hi guys,
>
>  This patch allows you to set phy address parameters through ethtool, like:
>
>  /bin/ethtool -s eth0 phyad 8
>
>  --- drivers/net/cris/eth_v10.c  2008-06-12 14:12:33.000000000 +0200
>  +++ drivers/net/cris/eth_v10.c  2008-06-12 14:19:35.000000000 +0200
>  @@ -1430,7 +1430,11 @@
>                 e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full);
>                 e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100);
>         }
>  -
>  +        //Honor ethtool phy address parameter, which was simply
>  discarded before this.
>  +        if (ecmd->phy_address <= 31)
>  +                mdio_phy_addr = ecmd->phy_address;
>  +        else if (ecmd->phy_address == 32)
>  +                return -ENODEV;
>         return 0;
>   }
>
>  I've searched the MAINTAINERS file and haven't seen anything regarding
>  either the source file name or cris.  Please consider applying my
>  patch to main kernel...
>
>  Thanks,
>
> Pieter Steyn
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] eth_v10.c phy fix
  2008-06-13 16:00 ` Pieter Steyn
@ 2008-06-18 12:09   ` Pieter Steyn
  2008-06-18 13:05     ` Jesper Nilsson
  0 siblings, 1 reply; 5+ messages in thread
From: Pieter Steyn @ 2008-06-18 12:09 UTC (permalink / raw)
  To: linux-kernel; +Cc: jesper.nilsson

Hi guys,

Any word on this?

Thanks,
Pieter

> On 6/13/08, Pieter Steyn <pieterste@gmail.com> wrote:
> Ah, I did not consider case when searching...DOH! :]
>
>  I've now cc'ed in Jesper who seems to be the maintainer.
>
>  Cheers,
>
> Pieter Steyn
>
>
>  > On 6/13/08, Pieter Steyn <pieterste@gmail.com> wrote:
>  > Hi guys,
>  >
>  >  This patch allows you to set phy address parameters through ethtool, like:
>  >
>  >  /bin/ethtool -s eth0 phyad 8
>  >
>  >  --- drivers/net/cris/eth_v10.c  2008-06-12 14:12:33.000000000 +0200
>  >  +++ drivers/net/cris/eth_v10.c  2008-06-12 14:19:35.000000000 +0200
>  >  @@ -1430,7 +1430,11 @@
>  >                 e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full);
>  >                 e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100);
>  >         }
>  >  -
>  >  +        //Honor ethtool phy address parameter, which was simply
>  >  discarded before this.
>  >  +        if (ecmd->phy_address <= 31)
>  >  +                mdio_phy_addr = ecmd->phy_address;
>  >  +        else if (ecmd->phy_address == 32)
>  >  +                return -ENODEV;
>  >         return 0;
>  >   }
>  >
>  >  I've searched the MAINTAINERS file and haven't seen anything regarding
>  >  either the source file name or cris.  Please consider applying my
>  >  patch to main kernel...
>  >
>  >  Thanks,
>  >
>  > Pieter Steyn
>  >
>  >
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] eth_v10.c phy fix
  2008-06-18 12:09   ` Pieter Steyn
@ 2008-06-18 13:05     ` Jesper Nilsson
  2008-06-18 13:17       ` Pieter Steyn
  0 siblings, 1 reply; 5+ messages in thread
From: Jesper Nilsson @ 2008-06-18 13:05 UTC (permalink / raw)
  To: Pieter Steyn; +Cc: linux-kernel

On Wed, Jun 18, 2008 at 02:09:23PM +0200, Pieter Steyn wrote:
> Hi guys,

Hi,

> Any word on this?

The patch seems to be against the 2.6.23 kernel, mdio_phy_addr was
removed in 2.6.24. The following compiles, although I haven't had
time to test it yet:


diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 65d0a91..c8bcb22 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1431,6 +1431,14 @@ static int e100_set_settings(struct net_device *dev,
 		e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100);
 	}
 
+	struct net_local *np = netdev_priv(dev);
+	/* Honor ethtool phy address parameter, which was simply */
+	/* discarded before this. */
+	if (ecmd->phy_address <= 31)
+		np->mii_if.phy_id = ecmd->phy_address;
+	else if (ecmd->phy_address == 32)
+		return -ENODEV;
+
 	return 0;
 }
 


I'll add it to my queue (which will be published RSN :), thanks!

Best regards,

/Jesper


> Thanks,
> Pieter
> 
> > On 6/13/08, Pieter Steyn <pieterste@gmail.com> wrote:
> > Ah, I did not consider case when searching...DOH! :]
> >
> >  I've now cc'ed in Jesper who seems to be the maintainer.
> >
> >  Cheers,
> >
> > Pieter Steyn
> >
> >
> >  > On 6/13/08, Pieter Steyn <pieterste@gmail.com> wrote:
> >  > Hi guys,
> >  >
> >  >  This patch allows you to set phy address parameters through ethtool, like:
> >  >
> >  >  /bin/ethtool -s eth0 phyad 8
> >  >
> >  >  --- drivers/net/cris/eth_v10.c  2008-06-12 14:12:33.000000000 +0200
> >  >  +++ drivers/net/cris/eth_v10.c  2008-06-12 14:19:35.000000000 +0200
> >  >  @@ -1430,7 +1430,11 @@
> >  >                 e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full);
> >  >                 e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100);
> >  >         }
> >  >  -
> >  >  +        //Honor ethtool phy address parameter, which was simply
> >  >  discarded before this.
> >  >  +        if (ecmd->phy_address <= 31)
> >  >  +                mdio_phy_addr = ecmd->phy_address;
> >  >  +        else if (ecmd->phy_address == 32)
> >  >  +                return -ENODEV;
> >  >         return 0;
> >  >   }
> >  >
> >  >  I've searched the MAINTAINERS file and haven't seen anything regarding
> >  >  either the source file name or cris.  Please consider applying my
> >  >  patch to main kernel...
> >  >
> >  >  Thanks,
> >  >
> >  > Pieter Steyn
> >  >
> >  >
> >
/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] eth_v10.c phy fix
  2008-06-18 13:05     ` Jesper Nilsson
@ 2008-06-18 13:17       ` Pieter Steyn
  0 siblings, 0 replies; 5+ messages in thread
From: Pieter Steyn @ 2008-06-18 13:17 UTC (permalink / raw)
  To: Jesper Nilsson; +Cc: linux-kernel

> I'll add it to my queue (which will be published RSN :), thanks!
>
>  Best regards,
>
>  /Jesper


Thank you Jesper. :)

Cheers,
Pieter

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-06-18 13:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-13 15:04 [PATCH] eth_v10.c phy fix Pieter Steyn
2008-06-13 16:00 ` Pieter Steyn
2008-06-18 12:09   ` Pieter Steyn
2008-06-18 13:05     ` Jesper Nilsson
2008-06-18 13:17       ` Pieter Steyn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®