From: Eli Cohen Date: Wed, 26 May 2010 19:56:24 +0000 (+0000) Subject: mlx4_en: use net_device dev_id to indicate port number X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=741a00be1f6bfa027225f44703ab72a741b757b7;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git mlx4_en: use net_device dev_id to indicate port number Today, there are no means to know which port of a hardware device a netdev interface uses. struct net_device conatins a field, dev_id, that can be used for that. Use this field to save the port number in ConnectX that is being used by the net device; port numbers are zero based. Signed-off-by: Eli Cohen Signed-off-by: David S. Miller --- diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c index 96180c0ec206..a0d8a26f5a02 100644 --- a/drivers/net/mlx4/en_netdev.c +++ b/drivers/net/mlx4/en_netdev.c @@ -961,6 +961,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, } SET_NETDEV_DEV(dev, &mdev->dev->pdev->dev); + dev->dev_id = port - 1; /* * Initialize driver private data