summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/nfp_port.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfp_port.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfp_port.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_port.c b/drivers/net/ethernet/netronome/nfp/nfp_port.c
index fcd16877e6e0..93c5bfc0510b 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_port.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_port.c
@@ -30,6 +30,22 @@ struct nfp_port *nfp_port_from_netdev(struct net_device *netdev)
return NULL;
}
+int nfp_port_get_port_parent_id(struct net_device *netdev,
+ struct netdev_phys_item_id *ppid)
+{
+ struct nfp_port *port;
+ const u8 *serial;
+
+ port = nfp_port_from_netdev(netdev);
+ if (!port)
+ return -EOPNOTSUPP;
+
+ ppid->id_len = nfp_cpp_serial(port->app->cpp, &serial);
+ memcpy(&ppid->id, serial, ppid->id_len);
+
+ return 0;
+}
+
int nfp_port_setup_tc(struct net_device *netdev, enum tc_setup_type type,
void *type_data)
{