Send ETHTOOL_MSG_EEE_NTF notification whenever EEE settings of a network device are modified using ETHTOOL_MSG_EEE_SET netlink message or ETHTOOL_SEEE ioctl request.
Unified · Split
| @@ -232,6 +232,7 @@ Kernel to userspace: · 231 unmodified lines | |||
| 232 | ``ETHTOOL_MSG_PAUSE_GET_REPLY`` pause parameters | 232 | ``ETHTOOL_MSG_PAUSE_GET_REPLY`` pause parameters |
| 233 | ``ETHTOOL_MSG_PAUSE_NTF`` pause parameters | 233 | ``ETHTOOL_MSG_PAUSE_NTF`` pause parameters |
| 234 | ``ETHTOOL_MSG_EEE_GET_REPLY`` EEE settings | 234 | ``ETHTOOL_MSG_EEE_GET_REPLY`` EEE settings |
| 235 | ``ETHTOOL_MSG_EEE_NTF`` EEE settings | ||
| 235 | ===================================== ================================= | 236 | ===================================== ================================= |
| 236 | 237 | ||
| 237 | ``GET`` requests are sent by userspace applications to retrieve device | 238 | ``GET`` requests are sent by userspace applications to retrieve device |
| @@ -71,6 +71,7 @@ enum { · 70 unmodified lines | |||
| 71 | ETHTOOL_MSG_PAUSE_GET_REPLY, | 71 | ETHTOOL_MSG_PAUSE_GET_REPLY, |
| 72 | ETHTOOL_MSG_PAUSE_NTF, | 72 | ETHTOOL_MSG_PAUSE_NTF, |
| 73 | ETHTOOL_MSG_EEE_GET_REPLY, | 73 | ETHTOOL_MSG_EEE_GET_REPLY, |
| 74 | ETHTOOL_MSG_EEE_NTF, | ||
| 74 | 75 | ||
| 75 | /* add new constants above here */ | 76 | /* add new constants above here */ |
| 76 | __ETHTOOL_MSG_KERNEL_CNT, | 77 | __ETHTOOL_MSG_KERNEL_CNT, |
| @@ -192,6 +192,9 @@ int ethnl_set_eee(struct sk_buff *skb, struct genl_info *info) · 191 unmodified lines | |||
| 192 | goto out_ops; | 192 | goto out_ops; |
| 193 | 193 | ||
| 194 | ret = dev->ethtool_ops->set_eee(dev, &eee); | 194 | ret = dev->ethtool_ops->set_eee(dev, &eee); |
| 195 | if (ret < 0) | ||
| 196 | goto out_ops; | ||
| 197 | ethtool_notify(dev, ETHTOOL_MSG_EEE_NTF, NULL); | ||
| 195 | 198 | ||
| 196 | out_ops: | 199 | out_ops: |
| 197 | ethnl_ops_complete(dev); | 200 | ethnl_ops_complete(dev); |
| @@ -1354,6 +1354,7 @@ static int ethtool_get_eee(struct net_device *dev, char __user *useraddr) · 1353 unmodified lines | |||
| 1354 | static int ethtool_set_eee(struct net_device *dev, char __user *useraddr) | 1354 | static int ethtool_set_eee(struct net_device *dev, char __user *useraddr) |
| 1355 | { | 1355 | { |
| 1356 | struct ethtool_eee edata; | 1356 | struct ethtool_eee edata; |
| 1357 | int ret; | ||
| 1357 | 1358 | ||
| 1358 | if (!dev->ethtool_ops->set_eee) | 1359 | if (!dev->ethtool_ops->set_eee) |
| 1359 | return -EOPNOTSUPP; | 1360 | return -EOPNOTSUPP; |
| @@ -1361,7 +1362,10 @@ static int ethtool_set_eee(struct net_device *dev, char __user *useraddr) · 1 unmodified line | |||
| 1361 | if (copy_from_user(&edata, useraddr, sizeof(edata))) | 1362 | if (copy_from_user(&edata, useraddr, sizeof(edata))) |
| 1362 | return -EFAULT; | 1363 | return -EFAULT; |
| 1363 | 1364 | ||
| 1364 | return dev->ethtool_ops->set_eee(dev, &edata); | 1365 | ret = dev->ethtool_ops->set_eee(dev, &edata); |
| 1366 | if (!ret) | ||
| 1367 | ethtool_notify(dev, ETHTOOL_MSG_EEE_NTF, NULL); | ||
| 1368 | return ret; | ||
| 1365 | } | 1369 | } |
| 1366 | 1370 | ||
| 1367 | static int ethtool_nway_reset(struct net_device *dev) | 1371 | static int ethtool_nway_reset(struct net_device *dev) |
| @@ -548,6 +548,7 @@ ethnl_default_notify_ops[ETHTOOL_MSG_KERNEL_MAX + 1] = { · 547 unmodified lines | |||
| 548 | [ETHTOOL_MSG_CHANNELS_NTF] = ðnl_channels_request_ops, | 548 | [ETHTOOL_MSG_CHANNELS_NTF] = ðnl_channels_request_ops, |
| 549 | [ETHTOOL_MSG_COALESCE_NTF] = ðnl_coalesce_request_ops, | 549 | [ETHTOOL_MSG_COALESCE_NTF] = ðnl_coalesce_request_ops, |
| 550 | [ETHTOOL_MSG_PAUSE_NTF] = ðnl_pause_request_ops, | 550 | [ETHTOOL_MSG_PAUSE_NTF] = ðnl_pause_request_ops, |
| 551 | [ETHTOOL_MSG_EEE_NTF] = ðnl_eee_request_ops, | ||
| 551 | }; | 552 | }; |
| 552 | 553 | ||
| 553 | /* default notification handler */ | 554 | /* default notification handler */ |
| @@ -639,6 +640,7 @@ static const ethnl_notify_handler_t ethnl_notify_handlers[] = { · 85 unmodified lines | |||
| 639 | [ETHTOOL_MSG_CHANNELS_NTF] = ethnl_default_notify, | 640 | [ETHTOOL_MSG_CHANNELS_NTF] = ethnl_default_notify, |
| 640 | [ETHTOOL_MSG_COALESCE_NTF] = ethnl_default_notify, | 641 | [ETHTOOL_MSG_COALESCE_NTF] = ethnl_default_notify, |
| 641 | [ETHTOOL_MSG_PAUSE_NTF] = ethnl_default_notify, | 642 | [ETHTOOL_MSG_PAUSE_NTF] = ethnl_default_notify, |
| 643 | [ETHTOOL_MSG_EEE_NTF] = ethnl_default_notify, | ||
| 642 | }; | 644 | }; |
| 643 | 645 | ||
| 644 | void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data) | 646 | void ethtool_notify(struct net_device *dev, unsigned int cmd, const void *data) |