提交 ac019f08 编写于 作者: B Bert Kenward 提交者: David S. Miller

sfc: implement ndo_get_phys_port_name

Output is of the form p<port-number>.
Note that the port numbers don't necessarily map one-to-one to physical
 cages, partly because of 4x10G port modes on QSFP+ and partly because
 of hw/fw implementation details.
Signed-off-by: NEdward Cree <ecree@solarflare.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 08a7b29b
...@@ -2345,6 +2345,16 @@ int efx_get_phys_port_id(struct net_device *net_dev, ...@@ -2345,6 +2345,16 @@ int efx_get_phys_port_id(struct net_device *net_dev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
static int efx_get_phys_port_name(struct net_device *net_dev,
char *name, size_t len)
{
struct efx_nic *efx = netdev_priv(net_dev);
if (snprintf(name, len, "p%u", efx->port_num) >= len)
return -EINVAL;
return 0;
}
static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid) static int efx_vlan_rx_add_vid(struct net_device *net_dev, __be16 proto, u16 vid)
{ {
struct efx_nic *efx = netdev_priv(net_dev); struct efx_nic *efx = netdev_priv(net_dev);
...@@ -2387,6 +2397,7 @@ static const struct net_device_ops efx_netdev_ops = { ...@@ -2387,6 +2397,7 @@ static const struct net_device_ops efx_netdev_ops = {
.ndo_set_vf_link_state = efx_sriov_set_vf_link_state, .ndo_set_vf_link_state = efx_sriov_set_vf_link_state,
#endif #endif
.ndo_get_phys_port_id = efx_get_phys_port_id, .ndo_get_phys_port_id = efx_get_phys_port_id,
.ndo_get_phys_port_name = efx_get_phys_port_name,
#ifdef CONFIG_NET_POLL_CONTROLLER #ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = efx_netpoll, .ndo_poll_controller = efx_netpoll,
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册