ns83820: Minor ethtool stuff and some cleanups
Subsystems (2)
PATCH 1/1 ns83820: Minor ethtool stuff and some cleanups
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
PATCH 1/3 ns83820: Remove unused have_optical variable.
Signed-off-by Denis Kirjanov <[email protected]>
--- drivers/net/ns83820.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-)
drivers/net/ns83820.c +1 -10
@@ -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;
Signature · 1 line
1.6.4.4
PATCH 2/3 ns83820: Add copper device settings
In reply to Denis KirjanovSigned-off-by Denis Kirjanov <[email protected]>
--- drivers/net/ns83820.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/net/ns83820.c +10 -2
@@ -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 ) {
Signature · 1 line
1.6.4.4
PATCH 3/3 ns83820: Use predefined autoneg constants
In reply to Denis KirjanovSigned-off-by Denis Kirjanov <[email protected]>
--- drivers/net/ns83820.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/ns83820.c +2 -1
@@ -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 ; }
Signature · 1 line
1.6.4.4
David Miller
maintainerFrom: Denis Kirjanov <[email protected]>
Date: Fri, 3 Sep 2010 20:05:38 +0000
Quoted 4 lines
Some ethtool stuff for the ns83820:
1/3 Remove unusedhave_opticalvariable.
2/3 Add copper device settings
3/3 Use predefined autoneg constants
All applied, thanks Denis.