aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2013-07-29 12:16:49 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-30 20:31:24 -0400
commit66b52b0dc82c5c88d769dc1c7d44cf45d0deb07c (patch)
tree2fa19024bd1afefcc0fc4a09ea7ae1b6c095edcd /include/linux/netdevice.h
parent9ad8fef6c61a9dfcaa8444e526020de88c540fa9 (diff)
net: add ndo to get id of physical port of the device
This patch adds a ndo for getting physical port of the device. Driver which is aware of being virtual function of some physical port should implement this ndo. This is applicable not only for IOV, but for other solutions (NPAR, multichannel) as well. Basically if there is possible to have multiple netdevs on the single hw port. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3ca60b070ef0..875f869dc38a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -728,6 +728,16 @@ struct netdev_fcoe_hbainfo {
728}; 728};
729#endif 729#endif
730 730
731#define MAX_PHYS_PORT_ID_LEN 32
732
733/* This structure holds a unique identifier to identify the
734 * physical port used by a netdevice.
735 */
736struct netdev_phys_port_id {
737 unsigned char id[MAX_PHYS_PORT_ID_LEN];
738 unsigned char id_len;
739};
740
731/* 741/*
732 * This structure defines the management hooks for network devices. 742 * This structure defines the management hooks for network devices.
733 * The following hooks can be defined; unless noted otherwise, they are 743 * The following hooks can be defined; unless noted otherwise, they are
@@ -932,6 +942,12 @@ struct netdev_fcoe_hbainfo {
932 * that determine carrier state from physical hardware properties (eg 942 * that determine carrier state from physical hardware properties (eg
933 * network cables) or protocol-dependent mechanisms (eg 943 * network cables) or protocol-dependent mechanisms (eg
934 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function. 944 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function.
945 *
946 * int (*ndo_get_phys_port_id)(struct net_device *dev,
947 * struct netdev_phys_port_id *ppid);
948 * Called to get ID of physical port of this device. If driver does
949 * not implement this, it is assumed that the hw is not able to have
950 * multiple net devices on single physical port.
935 */ 951 */
936struct net_device_ops { 952struct net_device_ops {
937 int (*ndo_init)(struct net_device *dev); 953 int (*ndo_init)(struct net_device *dev);
@@ -1060,6 +1076,8 @@ struct net_device_ops {
1060 struct nlmsghdr *nlh); 1076 struct nlmsghdr *nlh);
1061 int (*ndo_change_carrier)(struct net_device *dev, 1077 int (*ndo_change_carrier)(struct net_device *dev,
1062 bool new_carrier); 1078 bool new_carrier);
1079 int (*ndo_get_phys_port_id)(struct net_device *dev,
1080 struct netdev_phys_port_id *ppid);
1063}; 1081};
1064 1082
1065/* 1083/*
@@ -2315,6 +2333,8 @@ extern int dev_set_mac_address(struct net_device *,
2315 struct sockaddr *); 2333 struct sockaddr *);
2316extern int dev_change_carrier(struct net_device *, 2334extern int dev_change_carrier(struct net_device *,
2317 bool new_carrier); 2335 bool new_carrier);
2336extern int dev_get_phys_port_id(struct net_device *dev,
2337 struct netdev_phys_port_id *ppid);
2318extern int dev_hard_start_xmit(struct sk_buff *skb, 2338extern int dev_hard_start_xmit(struct sk_buff *skb,
2319 struct net_device *dev, 2339 struct net_device *dev,
2320 struct netdev_queue *txq); 2340 struct netdev_queue *txq);