Lines Matching refs:netdev

84 	struct net_device *netdev = to_net_dev(dev);  in netdev_store()  local
85 struct net *net = dev_net(netdev); in netdev_store()
99 if (dev_isalive(netdev)) { in netdev_store()
100 ret = (*set)(netdev, new); in netdev_store()
181 struct net_device *netdev = to_net_dev(dev); in carrier_store() local
186 if (!netdev->netdev_ops->ndo_change_carrier) in carrier_store()
195 struct net_device *netdev = to_net_dev(dev); in carrier_show() local
197 if (netif_running(netdev)) in carrier_show()
198 return sysfs_emit(buf, fmt_dec, !!netif_carrier_ok(netdev)); in carrier_show()
207 struct net_device *netdev = to_net_dev(dev); in speed_show() local
213 if (!netdev->ethtool_ops->get_link_ksettings) in speed_show()
219 if (netif_running(netdev) && netif_device_present(netdev)) { in speed_show()
222 if (!__ethtool_get_link_ksettings(netdev, &cmd)) in speed_show()
233 struct net_device *netdev = to_net_dev(dev); in duplex_show() local
239 if (!netdev->ethtool_ops->get_link_ksettings) in duplex_show()
245 if (netif_running(netdev)) { in duplex_show()
248 if (!__ethtool_get_link_ksettings(netdev, &cmd)) { in duplex_show()
273 struct net_device *netdev = to_net_dev(dev); in testing_show() local
275 if (netif_running(netdev)) in testing_show()
276 return sysfs_emit(buf, fmt_dec, !!netif_testing(netdev)); in testing_show()
285 struct net_device *netdev = to_net_dev(dev); in dormant_show() local
287 if (netif_running(netdev)) in dormant_show()
288 return sysfs_emit(buf, fmt_dec, !!netif_dormant(netdev)); in dormant_show()
307 const struct net_device *netdev = to_net_dev(dev); in operstate_show() local
310 operstate = READ_ONCE(netdev->operstate); in operstate_show()
311 if (!netif_running(netdev)) in operstate_show()
325 struct net_device *netdev = to_net_dev(dev); in carrier_changes_show() local
328 atomic_read(&netdev->carrier_up_count) + in carrier_changes_show()
329 atomic_read(&netdev->carrier_down_count)); in carrier_changes_show()
337 struct net_device *netdev = to_net_dev(dev); in carrier_up_count_show() local
339 return sysfs_emit(buf, fmt_dec, atomic_read(&netdev->carrier_up_count)); in carrier_up_count_show()
347 struct net_device *netdev = to_net_dev(dev); in carrier_down_count_show() local
349 return sysfs_emit(buf, fmt_dec, atomic_read(&netdev->carrier_down_count)); in carrier_down_count_show()
427 struct net_device *netdev = to_net_dev(dev); in ifalias_store() local
428 struct net *net = dev_net(netdev); in ifalias_store()
442 if (dev_isalive(netdev)) { in ifalias_store()
443 ret = dev_set_alias(netdev, buf, count); in ifalias_store()
447 netdev_state_change(netdev); in ifalias_store()
458 const struct net_device *netdev = to_net_dev(dev); in ifalias_show() local
462 ret = dev_get_alias(netdev, tmp, sizeof(tmp)); in ifalias_show()
499 struct net_device *netdev = to_net_dev(dev); in phys_port_id_show() local
505 if (!netdev->netdev_ops->ndo_get_phys_port_id) in phys_port_id_show()
511 if (dev_isalive(netdev)) { in phys_port_id_show()
514 ret = dev_get_phys_port_id(netdev, &ppid); in phys_port_id_show()
527 struct net_device *netdev = to_net_dev(dev); in phys_port_name_show() local
533 if (!netdev->netdev_ops->ndo_get_phys_port_name && in phys_port_name_show()
534 !netdev->devlink_port) in phys_port_name_show()
540 if (dev_isalive(netdev)) { in phys_port_name_show()
543 ret = dev_get_phys_port_name(netdev, name, sizeof(name)); in phys_port_name_show()
556 struct net_device *netdev = to_net_dev(dev); in phys_switch_id_show() local
563 if (!netdev->netdev_ops->ndo_get_port_parent_id && in phys_switch_id_show()
564 !netdev->devlink_port) in phys_switch_id_show()
570 if (dev_isalive(netdev)) { in phys_switch_id_show()
573 ret = dev_get_port_parent_id(netdev, &ppid, false); in phys_switch_id_show()
586 struct net_device *netdev = to_net_dev(dev); in threaded_show() local
592 if (dev_isalive(netdev)) in threaded_show()
593 ret = sysfs_emit(buf, fmt_dec, netdev->threaded); in threaded_show()