mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Pieter Steyn" <pieterste@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] eth_v10.c phy fix
Date: Fri, 13 Jun 2008 17:04:34 +0200	[thread overview]
Message-ID: <c49e66200806130804u280fdfa1gd1027f3401ae7f4f@mail.gmail.com> (raw)

[-- 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;
 }
 

             reply	other threads:[~2008-06-13 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-13 15:04 Pieter Steyn [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c49e66200806130804u280fdfa1gd1027f3401ae7f4f@mail.gmail.com \
    --to=pieterste@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®