net: add dev arg to ndo_neigh_construct/destroy
authorJiri Pirko <jiri@mellanox.com>
Tue, 5 Jul 2016 09:27:37 +0000 (11:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Jul 2016 16:06:28 +0000 (09:06 -0700)
As the following patch will allow upper devices to follow the call down
lower devices, we need to add dev here and not rely on n->dev.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/rocker/rocker_main.c
include/linux/netdevice.h
net/atm/clip.c
net/core/neighbour.c
net/ieee802154/6lowpan/core.c

index 28b775e5a9ad459ccd4e1a6dc1ebe5fde4df7cd1..f0b09b05ed3f1eb0461fc52ebfee26dea8e2dda2 100644 (file)
@@ -1996,7 +1996,8 @@ static int rocker_port_change_proto_down(struct net_device *dev,
        return 0;
 }
 
-static void rocker_port_neigh_destroy(struct neighbour *n)
+static void rocker_port_neigh_destroy(struct net_device *dev,
+                                     struct neighbour *n)
 {
        struct rocker_port *rocker_port = netdev_priv(n->dev);
        int err;
index 0c6ee2c5099f2a50dddb1e4cd68248610be8c921..91af73c9dd5108a68b9fe8b4dd4ef2b035b81ace 100644 (file)
@@ -1209,8 +1209,10 @@ struct net_device_ops {
                                                    netdev_features_t features);
        int                     (*ndo_set_features)(struct net_device *dev,
                                                    netdev_features_t features);
-       int                     (*ndo_neigh_construct)(struct neighbour *n);
-       void                    (*ndo_neigh_destroy)(struct neighbour *n);
+       int                     (*ndo_neigh_construct)(struct net_device *dev,
+                                                      struct neighbour *n);
+       void                    (*ndo_neigh_destroy)(struct net_device *dev,
+                                                    struct neighbour *n);
 
        int                     (*ndo_fdb_add)(struct ndmsg *ndm,
                                               struct nlattr *tb[],
index e07f551a863c89705fcbd348f2ac2eb73fd002fe..53b4ac09e7b7d5d6a57f049dc1653c961b052622 100644 (file)
@@ -286,7 +286,7 @@ static const struct neigh_ops clip_neigh_ops = {
        .connected_output =     neigh_direct_output,
 };
 
-static int clip_constructor(struct neighbour *neigh)
+static int clip_constructor(struct net_device *dev, struct neighbour *neigh)
 {
        struct atmarp_entry *entry = neighbour_priv(neigh);
 
index 510cd62fcb9963f92591e03b6c4d40502f2f37bf..952aabb5aa565325656069c14078462146caf0b8 100644 (file)
@@ -473,7 +473,7 @@ struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
        }
 
        if (dev->netdev_ops->ndo_neigh_construct) {
-               error = dev->netdev_ops->ndo_neigh_construct(n);
+               error = dev->netdev_ops->ndo_neigh_construct(dev, n);
                if (error < 0) {
                        rc = ERR_PTR(error);
                        goto out_neigh_release;
@@ -701,7 +701,7 @@ void neigh_destroy(struct neighbour *neigh)
        neigh->arp_queue_len_bytes = 0;
 
        if (dev->netdev_ops->ndo_neigh_destroy)
-               dev->netdev_ops->ndo_neigh_destroy(neigh);
+               dev->netdev_ops->ndo_neigh_destroy(dev, neigh);
 
        dev_put(dev);
        neigh_parms_put(neigh->parms);
index 8c004a0c8d64121096fd1c8075e2a0d4d1105c09..935ab932e841205b9584f2c00c142ac2da9636cf 100644 (file)
@@ -81,7 +81,7 @@ static int lowpan_stop(struct net_device *dev)
        return 0;
 }
 
-static int lowpan_neigh_construct(struct neighbour *n)
+static int lowpan_neigh_construct(struct net_device *dev, struct neighbour *n)
 {
        struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n));