From: Stefan Roese <sr@denx.de>
To: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: [PATCH] ibm_emac: Correctly detect old link speed
Date: Wed, 16 May 2007 13:00:08 +0200 [thread overview]
Message-ID: <200705161300.08521.sr@denx.de> (raw)
This patch fixes a bug where the link speed change was not
detected correctly. This occured on a 440SPe (EMAC4) system
where the old link speed was 100Mbps and the new link speed
is 1000Mbps.
Signed-off-by: Stefan Roese <sr@denx.de>
---
commit 1e2a6085bbb6bd384e0812b6e9c62d18d14e1c0f
tree f441a914c9d66fb00fcde1e4bd7e02effba20dc7
parent 7b104bcb8e460e45a1aebe3da9b86aacdb4cab12
author Stefan Roese <sr@denx.de> Wed, 16 May 2007 12:54:40 +0200
committer Stefan Roese <sr@denx.de> Wed, 16 May 2007 12:54:40 +0200
drivers/net/ibm_emac/ibm_emac_core.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 50035eb..ab38727 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -926,12 +926,18 @@ static int emac_link_differs(struct ocp_enet_private *dev)
int duplex = r & EMAC_MR1_FDE ? DUPLEX_FULL : DUPLEX_HALF;
int speed, pause, asym_pause;
- if (r & (EMAC_MR1_MF_1000 | EMAC_MR1_MF_1000GPCS))
- speed = SPEED_1000;
- else if (r & EMAC_MR1_MF_100)
- speed = SPEED_100;
- else
- speed = SPEED_10;
+ switch (r & EMAC_MR1_MF_MASK) {
+ case EMAC_MR1_MF_1000:
+ case EMAC_MR1_MF_1000GPCS:
+ speed = 1000;
+ break;
+ case EMAC_MR1_MF_10:
+ speed = 10;
+ break;
+ case EMAC_MR1_MF_100:
+ default:
+ speed = 100;
+ }
switch (r & (EMAC_MR1_EIFC | EMAC_MR1_APP)) {
case (EMAC_MR1_EIFC | EMAC_MR1_APP):
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Roese <sr@denx.de>
To: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org
Cc: ebs@ebshome.net
Subject: [PATCH] ibm_emac: Correctly detect old link speed
Date: Wed, 16 May 2007 13:00:08 +0200 [thread overview]
Message-ID: <200705161300.08521.sr@denx.de> (raw)
This patch fixes a bug where the link speed change was not
detected correctly. This occured on a 440SPe (EMAC4) system
where the old link speed was 100Mbps and the new link speed
is 1000Mbps.
Signed-off-by: Stefan Roese <sr@denx.de>
---
commit 1e2a6085bbb6bd384e0812b6e9c62d18d14e1c0f
tree f441a914c9d66fb00fcde1e4bd7e02effba20dc7
parent 7b104bcb8e460e45a1aebe3da9b86aacdb4cab12
author Stefan Roese <sr@denx.de> Wed, 16 May 2007 12:54:40 +0200
committer Stefan Roese <sr@denx.de> Wed, 16 May 2007 12:54:40 +0200
drivers/net/ibm_emac/ibm_emac_core.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c
index 50035eb..ab38727 100644
--- a/drivers/net/ibm_emac/ibm_emac_core.c
+++ b/drivers/net/ibm_emac/ibm_emac_core.c
@@ -926,12 +926,18 @@ static int emac_link_differs(struct ocp_enet_private *dev)
int duplex = r & EMAC_MR1_FDE ? DUPLEX_FULL : DUPLEX_HALF;
int speed, pause, asym_pause;
- if (r & (EMAC_MR1_MF_1000 | EMAC_MR1_MF_1000GPCS))
- speed = SPEED_1000;
- else if (r & EMAC_MR1_MF_100)
- speed = SPEED_100;
- else
- speed = SPEED_10;
+ switch (r & EMAC_MR1_MF_MASK) {
+ case EMAC_MR1_MF_1000:
+ case EMAC_MR1_MF_1000GPCS:
+ speed = 1000;
+ break;
+ case EMAC_MR1_MF_10:
+ speed = 10;
+ break;
+ case EMAC_MR1_MF_100:
+ default:
+ speed = 100;
+ }
switch (r & (EMAC_MR1_EIFC | EMAC_MR1_APP)) {
case (EMAC_MR1_EIFC | EMAC_MR1_APP):
next reply other threads:[~2007-05-16 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-16 11:00 Stefan Roese [this message]
2007-05-16 11:00 ` [PATCH] ibm_emac: Correctly detect old link speed Stefan Roese
2007-05-16 17:30 ` Eugene Surovegin
2007-05-16 18:44 ` Stefan Roese
2007-05-21 5:13 ` David Gibson
2007-05-21 5:13 ` David Gibson
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=200705161300.08521.sr@denx.de \
--to=sr@denx.de \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.