aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2015-03-17 22:23:15 -0400
committerDavid S. Miller <davem@davemloft.net>2015-03-18 22:30:35 -0400
commitdb24a9044ee191c397dcd1c6574f56d67d7c8df5 (patch)
tree5d15e7aed127d9c211b5b2dc2d69607cef0d6d8d /include
parent56ef9c909b40483d2c8cb63fcbf83865f162d5ec (diff)
net: add support for phys_port_name
Similar to port id allow netdevices to specify port names and export the name via sysfs. Drivers can implement the netdevice operation to assist udev in having sane default names for the devices using the rule: $ cat /etc/udev/rules.d/80-net-setup-link.rules SUBSYSTEM=="net", ACTION=="add", ATTR{phys_port_name}!="", NAME="$attr{phys_port_name}" Use of phys_name versus phys_id was suggested-by Jiri Pirko. Signed-off-by: David Ahern <dsahern@gmail.com> Acked-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Scott Feldman <sfeldma@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/netdevice.h4
-rw-r--r--include/uapi/linux/if_link.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 76c5de4978a8..ec8f9b5f6500 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1164,6 +1164,8 @@ struct net_device_ops {
1164 bool new_carrier); 1164 bool new_carrier);
1165 int (*ndo_get_phys_port_id)(struct net_device *dev, 1165 int (*ndo_get_phys_port_id)(struct net_device *dev,
1166 struct netdev_phys_item_id *ppid); 1166 struct netdev_phys_item_id *ppid);
1167 int (*ndo_get_phys_port_name)(struct net_device *dev,
1168 char *name, size_t len);
1167 void (*ndo_add_vxlan_port)(struct net_device *dev, 1169 void (*ndo_add_vxlan_port)(struct net_device *dev,
1168 sa_family_t sa_family, 1170 sa_family_t sa_family,
1169 __be16 port); 1171 __be16 port);
@@ -2947,6 +2949,8 @@ int dev_set_mac_address(struct net_device *, struct sockaddr *);
2947int dev_change_carrier(struct net_device *, bool new_carrier); 2949int dev_change_carrier(struct net_device *, bool new_carrier);
2948int dev_get_phys_port_id(struct net_device *dev, 2950int dev_get_phys_port_id(struct net_device *dev,
2949 struct netdev_phys_item_id *ppid); 2951 struct netdev_phys_item_id *ppid);
2952int dev_get_phys_port_name(struct net_device *dev,
2953 char *name, size_t len);
2950struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev); 2954struct sk_buff *validate_xmit_skb_list(struct sk_buff *skb, struct net_device *dev);
2951struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, 2955struct sk_buff *dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2952 struct netdev_queue *txq, int *ret); 2956 struct netdev_queue *txq, int *ret);
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 756436e1ce89..7158fd00a109 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -147,6 +147,7 @@ enum {
147 IFLA_CARRIER_CHANGES, 147 IFLA_CARRIER_CHANGES,
148 IFLA_PHYS_SWITCH_ID, 148 IFLA_PHYS_SWITCH_ID,
149 IFLA_LINK_NETNSID, 149 IFLA_LINK_NETNSID,
150 IFLA_PHYS_PORT_NAME,
150 __IFLA_MAX 151 __IFLA_MAX
151}; 152};
152 153