netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups
@ 2010-09-03 20:05 Denis Kirjanov
  2010-09-03 20:05 ` [PATCH net-next 1/3] ns83820: Remove unused have_optical variable Denis Kirjanov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Denis Kirjanov @ 2010-09-03 20:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

Some ethtool stuff for the ns83820:
1/3 Remove unused have_optical variable.
2/3 Add copper device settings
3/3 Use predefined autoneg constants

Regards,
	Denis

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

* [PATCH net-next 1/3] ns83820: Remove unused have_optical variable.
  2010-09-03 20:05 [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups Denis Kirjanov
@ 2010-09-03 20:05 ` Denis Kirjanov
  2010-09-03 20:05 ` [PATCH net-next 2/3] ns83820: Add copper device settings Denis Kirjanov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Denis Kirjanov @ 2010-09-03 20:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
 drivers/net/ns83820.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 447c2c4..3347125 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1246,7 +1246,6 @@ static int ns83820_get_settings(struct net_device *ndev,
 {
 	struct ns83820 *dev = PRIV(ndev);
 	u32 cfg, tanar, tbicr;
-	int have_optical = 0;
 	int fullduplex   = 0;
 
 	/*
@@ -1267,15 +1266,7 @@ static int ns83820_get_settings(struct net_device *ndev,
 	tanar = readl(dev->base + TANAR);
 	tbicr = readl(dev->base + TBICR);
 
-	if (dev->CFG_cache & CFG_TBI_EN) {
-		/* we have an optical interface */
-		have_optical = 1;
-		fullduplex = (cfg & CFG_DUPSTS) ? 1 : 0;
-
-	} else {
-		/* We have copper */
-		fullduplex = (cfg & CFG_DUPSTS) ? 1 : 0;
-        }
+	fullduplex = (cfg & CFG_DUPSTS) ? 1 : 0;
 
 	cmd->supported = SUPPORTED_Autoneg;
 
-- 
1.6.4.4


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

* [PATCH net-next 2/3] ns83820: Add copper device settings
  2010-09-03 20:05 [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups Denis Kirjanov
  2010-09-03 20:05 ` [PATCH net-next 1/3] ns83820: Remove unused have_optical variable Denis Kirjanov
@ 2010-09-03 20:05 ` Denis Kirjanov
  2010-09-03 20:05 ` [PATCH net-next 3/3] ns83820: Use predefined autoneg constants Denis Kirjanov
  2010-09-07  1:15 ` [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Denis Kirjanov @ 2010-09-03 20:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
 drivers/net/ns83820.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 3347125..712422a 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1270,13 +1270,21 @@ static int ns83820_get_settings(struct net_device *ndev,
 
 	cmd->supported = SUPPORTED_Autoneg;
 
-	/* we have optical interface */
 	if (dev->CFG_cache & CFG_TBI_EN) {
+		/* we have optical interface */
 		cmd->supported |= SUPPORTED_1000baseT_Half |
 					SUPPORTED_1000baseT_Full |
 					SUPPORTED_FIBRE;
 		cmd->port       = PORT_FIBRE;
-	} /* TODO: else copper related  support */
+	} else {
+		/* we have copper */
+		cmd->supported |= SUPPORTED_10baseT_Half |
+			SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half |
+			SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Half |
+			SUPPORTED_1000baseT_Full |
+			SUPPORTED_MII;
+		cmd->port = PORT_MII;
+	}
 
 	cmd->duplex = fullduplex ? DUPLEX_FULL : DUPLEX_HALF;
 	switch (cfg / CFG_SPDSTS0 & 3) {
-- 
1.6.4.4


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

* [PATCH net-next 3/3] ns83820: Use predefined autoneg constants
  2010-09-03 20:05 [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups Denis Kirjanov
  2010-09-03 20:05 ` [PATCH net-next 1/3] ns83820: Remove unused have_optical variable Denis Kirjanov
  2010-09-03 20:05 ` [PATCH net-next 2/3] ns83820: Add copper device settings Denis Kirjanov
@ 2010-09-03 20:05 ` Denis Kirjanov
  2010-09-07  1:15 ` [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Denis Kirjanov @ 2010-09-03 20:05 UTC (permalink / raw)
  To: davem; +Cc: netdev

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
 drivers/net/ns83820.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 712422a..bfab215 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1298,7 +1298,8 @@ static int ns83820_get_settings(struct net_device *ndev,
 		cmd->speed = SPEED_10;
 		break;
 	}
-	cmd->autoneg = (tbicr & TBICR_MR_AN_ENABLE) ? 1: 0;
+	cmd->autoneg = (tbicr & TBICR_MR_AN_ENABLE)
+		? AUTONEG_ENABLE : AUTONEG_DISABLE;
 	return 0;
 }
 
-- 
1.6.4.4


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

* Re: [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups
  2010-09-03 20:05 [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups Denis Kirjanov
                   ` (2 preceding siblings ...)
  2010-09-03 20:05 ` [PATCH net-next 3/3] ns83820: Use predefined autoneg constants Denis Kirjanov
@ 2010-09-07  1:15 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-09-07  1:15 UTC (permalink / raw)
  To: dkirjanov; +Cc: netdev

From: Denis Kirjanov <dkirjanov@hera.kernel.org>
Date: Fri,  3 Sep 2010 20:05:38 +0000

> Some ethtool stuff for the ns83820:
> 1/3 Remove unused have_optical variable.
> 2/3 Add copper device settings
> 3/3 Use predefined autoneg constants

All applied, thanks Denis.

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

end of thread, other threads:[~2010-09-07  1:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-03 20:05 [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups Denis Kirjanov
2010-09-03 20:05 ` [PATCH net-next 1/3] ns83820: Remove unused have_optical variable Denis Kirjanov
2010-09-03 20:05 ` [PATCH net-next 2/3] ns83820: Add copper device settings Denis Kirjanov
2010-09-03 20:05 ` [PATCH net-next 3/3] ns83820: Use predefined autoneg constants Denis Kirjanov
2010-09-07  1:15 ` [PATCH net-next] ns83820: Minor ethtool stuff and some cleanups David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).