pasemi_mac: ethtool get settings fix
Subsystems (3)
PATCH 1/1 pasemi_mac: ethtool get settings fix
Not all pasemi mac interfaces can have a phy attached. For example, XAUI has no phy and phydev is NULL for it. In this case ethtool get settings causes kernel crash. Fix it by returning -EOPNOTSUPP if there's no PHY attached.
--- drivers/net/pasemi_mac_ethtool.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/pasemi_mac_ethtool.c +2 -0
@@ -71,6 +71,8 @@ pasemi_mac_ethtool_get_settings(struct nstruct pasemi_mac *mac =netdev_priv (netdev);struct phy_device *phydev = mac->phydev; +if (!phydev) +return -EOPNOTSUPP ;return phy_ethtool_gset (phydev, cmd); }
Resending pasemi_mac ethtool patches...
Quoted 25 lines · Valentine Barshak
Not all pasemi mac interfaces can have a phy attached. For example, XAUI has no phy and phydev is NULL for it. In this case ethtool get settings causes kernel crash. Fix it by returning
-EOPNOTSUPPif there's no PHY attached.Signed-off-by Valentine Barshak <[email protected]>--- drivers/net/pasemi_mac_ethtool.c | 2 ++ 1 file changed, 2 insertions(+)drivers/net/pasemi_mac_ethtool.c +2
-0@@ -71,6 +71,8 @@ pasemi_mac_ethtool_get_settings(struct nstruct pasemi_mac *mac =netdev_priv (netdev);struct phy_device *phydev = mac->phydev; +if (!phydev) +return -EOPNOTSUPP ;return phy_ethtool_gset (phydev, cmd); }_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
PATCH 1/1 pasemi_mac: ethtool get settings fix
Not all pasemi mac interfaces can have a phy attached. For example, XAUI has no phy and phydev is NULL for it. In this case ethtool get settings causes kernel crash. Fix it by returning -EOPNOTSUPP if there's no PHY attached.
--- drivers/net/pasemi_mac_ethtool.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/pasemi_mac_ethtool.c +3 -0
@@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct nstruct pasemi_mac *mac =netdev_priv (netdev);struct phy_device *phydev = mac->phydev; +if (!phydev) +return -EOPNOTSUPP ; +return phy_ethtool_gset (phydev, cmd); }
Weird, I see my address in the to: line but I never got a copy in my inbox.
Quoted 6 lines · Valentine Barshak
Not all pasemi mac interfaces can have a phy attached. For example, XAUI has no phy and phydev is NULL for it. In this case ethtool get settings causes kernel crash. Fix it by returning
-EOPNOTSUPPif there's no PHY attached.Signed-off-by Valentine Barshak <[email protected]>
Quoted 21 lines
--- drivers/net/pasemi_mac_ethtool.c | 3 +++ 1 file changed, 3 insertions(+)diff -pruN
linux-2.6.orig/drivers/net/pasemi_mac_ethtool.clinux-2.6/drivers/net/pasemi_mac_ethtool.cdrivers/net/pasemi_mac_ethtool.c +3
-0@@ -71,6 +71,9 @@ pasemi_mac_ethtool_get_settings(struct nstruct pasemi_mac *mac =netdev_priv (netdev);struct phy_device *phydev = mac->phydev; +if (!phydev) +return -EOPNOTSUPP ; +return phy_ethtool_gset (phydev, cmd); }_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
From: Olof Johansson <[email protected]>
Date: Tue, 6 Oct 2009 11:10:54 -0500
Quoted 11 lines
Weird, I see my address in the to: line but I never got a copy in my inbox.
Quoted 6 lines · Valentine Barshak
Not all pasemi mac interfaces can have a phy attached. For example, XAUI has no phy and phydev is NULL for it. In this case ethtool get settings causes kernel crash. Fix it by returning
-EOPNOTSUPPif there's no PHY attached.Signed-off-by Valentine Barshak <[email protected]>Acked-by Olof Johansson <[email protected]>
Applied to net-2.6, thanks!
PATCH 1/1 pasemi_mac: ethtool set settings support
In reply to ValentineAdd ethtool set settings to pasemi_mac_ethtool.
--- drivers/net/pasemi_mac_ethtool.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/net/pasemi_mac_ethtool.c +14 -0
@@ -77,6 +77,19 @@ pasemi_mac_ethtool_get_settings(struct nreturn phy_ethtool_gset (phydev, cmd); } +static int +pasemi_mac_ethtool_set_settings (struct net_device *netdev, +struct ethtool_cmd *cmd) +{ +struct pasemi_mac *mac =netdev_priv (netdev); +struct phy_device *phydev = mac->phydev; + +if (!phydev) +return -EOPNOTSUPP ; + +return phy_ethtool_sset (phydev, cmd); +} +static void pasemi_mac_ethtool_get_drvinfo (struct net_device *netdev,struct ethtool_drvinfo *drvinfo)
@@ -150,6 +163,7 @@ static void pasemi_mac_get_strings(strucconst struct ethtool_ops pasemi_mac_ethtool_ops = { .get_settings = pasemi_mac_ethtool_get_settings, + .set_settings = pasemi_mac_ethtool_set_settings, .get_drvinfo = pasemi_mac_ethtool_get_drvinfo, .get_msglevel = pasemi_mac_ethtool_get_msglevel, .set_msglevel = pasemi_mac_ethtool_set_msglevel,
Re: [PATCH] pasemi_mac: ethtool set settings support
Quoted 3 lines · Valentine Barshak
Add ethtool set settings to
pasemi_mac_ethtool.Signed-off-by Valentine Barshak <[email protected]>
Re: [PATCH] pasemi_mac: ethtool set settings support
From: Olof Johansson <[email protected]>
Date: Tue, 6 Oct 2009 11:11:23 -0500
Quoted 6 lines · Valentine Barshak
Quoted 3 lines
Add ethtool set settings to
pasemi_mac_ethtool.Signed-off-by Valentine Barshak <[email protected]>Acked-by Olof Johansson <[email protected]>
Applied to net-next-2.6, thanks.