mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 09:02:06 +00:00
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>
This commit is contained in:
parent
9ad8fef6c6
commit
66b52b0dc8
2 changed files with 38 additions and 0 deletions
|
@ -4988,6 +4988,24 @@ int dev_change_carrier(struct net_device *dev, bool new_carrier)
|
|||
}
|
||||
EXPORT_SYMBOL(dev_change_carrier);
|
||||
|
||||
/**
|
||||
* dev_get_phys_port_id - Get device physical port ID
|
||||
* @dev: device
|
||||
* @ppid: port ID
|
||||
*
|
||||
* Get device physical port ID
|
||||
*/
|
||||
int dev_get_phys_port_id(struct net_device *dev,
|
||||
struct netdev_phys_port_id *ppid)
|
||||
{
|
||||
const struct net_device_ops *ops = dev->netdev_ops;
|
||||
|
||||
if (!ops->ndo_get_phys_port_id)
|
||||
return -EOPNOTSUPP;
|
||||
return ops->ndo_get_phys_port_id(dev, ppid);
|
||||
}
|
||||
EXPORT_SYMBOL(dev_get_phys_port_id);
|
||||
|
||||
/**
|
||||
* dev_new_index - allocate an ifindex
|
||||
* @net: the applicable net namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue