Skip to content
/ linux Public

Commit 95dfc7e

Browse files
lunndavem330
authored andcommitted
net: ethtool: Export helpers for getting EEPROM info
There are two ways to retrieve information from SFP EEPROMs. Many devices make use of the common code, and assign the sfp_bus pointer in the netdev to point to the bus holding the SFP device. Some MAC drivers directly implement ops in there ethool structure. Export within net/ethtool the two helpers used to call these methods, so that they can also be used in the new netlink code. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 4c88fa4 commit 95dfc7e

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

net/ethtool/common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,9 @@ int __ethtool_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info);
4747

4848
extern const struct ethtool_phy_ops *ethtool_phy_ops;
4949

50+
int ethtool_get_module_info_call(struct net_device *dev,
51+
struct ethtool_modinfo *modinfo);
52+
int ethtool_get_module_eeprom_call(struct net_device *dev,
53+
struct ethtool_eeprom *ee, u8 *data);
54+
5055
#endif /* _ETHTOOL_COMMON_H */

net/ethtool/ioctl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,8 +2188,8 @@ static int ethtool_get_ts_info(struct net_device *dev, void __user *useraddr)
21882188
return 0;
21892189
}
21902190

2191-
static int __ethtool_get_module_info(struct net_device *dev,
2192-
struct ethtool_modinfo *modinfo)
2191+
int ethtool_get_module_info_call(struct net_device *dev,
2192+
struct ethtool_modinfo *modinfo)
21932193
{
21942194
const struct ethtool_ops *ops = dev->ethtool_ops;
21952195
struct phy_device *phydev = dev->phydev;
@@ -2215,7 +2215,7 @@ static int ethtool_get_module_info(struct net_device *dev,
22152215
if (copy_from_user(&modinfo, useraddr, sizeof(modinfo)))
22162216
return -EFAULT;
22172217

2218-
ret = __ethtool_get_module_info(dev, &modinfo);
2218+
ret = ethtool_get_module_info_call(dev, &modinfo);
22192219
if (ret)
22202220
return ret;
22212221

@@ -2225,8 +2225,8 @@ static int ethtool_get_module_info(struct net_device *dev,
22252225
return 0;
22262226
}
22272227

2228-
static int __ethtool_get_module_eeprom(struct net_device *dev,
2229-
struct ethtool_eeprom *ee, u8 *data)
2228+
int ethtool_get_module_eeprom_call(struct net_device *dev,
2229+
struct ethtool_eeprom *ee, u8 *data)
22302230
{
22312231
const struct ethtool_ops *ops = dev->ethtool_ops;
22322232
struct phy_device *phydev = dev->phydev;
@@ -2249,12 +2249,12 @@ static int ethtool_get_module_eeprom(struct net_device *dev,
22492249
int ret;
22502250
struct ethtool_modinfo modinfo;
22512251

2252-
ret = __ethtool_get_module_info(dev, &modinfo);
2252+
ret = ethtool_get_module_info_call(dev, &modinfo);
22532253
if (ret)
22542254
return ret;
22552255

22562256
return ethtool_get_any_eeprom(dev, useraddr,
2257-
__ethtool_get_module_eeprom,
2257+
ethtool_get_module_eeprom_call,
22582258
modinfo.eeprom_len);
22592259
}
22602260

0 commit comments

Comments
 (0)