diff options
author | Jiri Pirko <jiri@mellanox.com> | 2016-07-05 05:27:37 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-05 12:06:28 -0400 |
commit | 503eebc265dcf5c512454fd5a6b6673ea4f1d7f2 (patch) | |
tree | c1d66bfa44f67121373f4ea98a4857e5645a17eb | |
parent | 9046a745e29aa4c7e4f1dda3a50199dbe62fc9e8 (diff) |
net: add dev arg to ndo_neigh_construct/destroy
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>
-rw-r--r-- | drivers/net/ethernet/rocker/rocker_main.c | 3 | ||||
-rw-r--r-- | include/linux/netdevice.h | 6 | ||||
-rw-r--r-- | net/atm/clip.c | 2 | ||||
-rw-r--r-- | net/core/neighbour.c | 4 | ||||
-rw-r--r-- | net/ieee802154/6lowpan/core.c | 2 |
5 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/ethernet/rocker/rocker_main.c b/drivers/net/ethernet/rocker/rocker_main.c index 28b775e5a9ad..f0b09b05ed3f 100644 --- a/drivers/net/ethernet/rocker/rocker_main.c +++ b/drivers/net/ethernet/rocker/rocker_main.c | |||
@@ -1996,7 +1996,8 @@ static int rocker_port_change_proto_down(struct net_device *dev, | |||
1996 | return 0; | 1996 | return 0; |
1997 | } | 1997 | } |
1998 | 1998 | ||
1999 | static void rocker_port_neigh_destroy(struct neighbour *n) | 1999 | static void rocker_port_neigh_destroy(struct net_device *dev, |
2000 | struct neighbour *n) | ||
2000 | { | 2001 | { |
2001 | struct rocker_port *rocker_port = netdev_priv(n->dev); | 2002 | struct rocker_port *rocker_port = netdev_priv(n->dev); |
2002 | int err; | 2003 | int err; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0c6ee2c5099f..91af73c9dd51 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1209,8 +1209,10 @@ struct net_device_ops { | |||
1209 | netdev_features_t features); | 1209 | netdev_features_t features); |
1210 | int (*ndo_set_features)(struct net_device *dev, | 1210 | int (*ndo_set_features)(struct net_device *dev, |
1211 | netdev_features_t features); | 1211 | netdev_features_t features); |
1212 | int (*ndo_neigh_construct)(struct neighbour *n); | 1212 | int (*ndo_neigh_construct)(struct net_device *dev, |
1213 | void (*ndo_neigh_destroy)(struct neighbour *n); | 1213 | struct neighbour *n); |
1214 | void (*ndo_neigh_destroy)(struct net_device *dev, | ||
1215 | struct neighbour *n); | ||
1214 | 1216 | ||
1215 | int (*ndo_fdb_add)(struct ndmsg *ndm, | 1217 | int (*ndo_fdb_add)(struct ndmsg *ndm, |
1216 | struct nlattr *tb[], | 1218 | struct nlattr *tb[], |
diff --git a/net/atm/clip.c b/net/atm/clip.c index e07f551a863c..53b4ac09e7b7 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -286,7 +286,7 @@ static const struct neigh_ops clip_neigh_ops = { | |||
286 | .connected_output = neigh_direct_output, | 286 | .connected_output = neigh_direct_output, |
287 | }; | 287 | }; |
288 | 288 | ||
289 | static int clip_constructor(struct neighbour *neigh) | 289 | static int clip_constructor(struct net_device *dev, struct neighbour *neigh) |
290 | { | 290 | { |
291 | struct atmarp_entry *entry = neighbour_priv(neigh); | 291 | struct atmarp_entry *entry = neighbour_priv(neigh); |
292 | 292 | ||
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 510cd62fcb99..952aabb5aa56 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -473,7 +473,7 @@ struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey, | |||
473 | } | 473 | } |
474 | 474 | ||
475 | if (dev->netdev_ops->ndo_neigh_construct) { | 475 | if (dev->netdev_ops->ndo_neigh_construct) { |
476 | error = dev->netdev_ops->ndo_neigh_construct(n); | 476 | error = dev->netdev_ops->ndo_neigh_construct(dev, n); |
477 | if (error < 0) { | 477 | if (error < 0) { |
478 | rc = ERR_PTR(error); | 478 | rc = ERR_PTR(error); |
479 | goto out_neigh_release; | 479 | goto out_neigh_release; |
@@ -701,7 +701,7 @@ void neigh_destroy(struct neighbour *neigh) | |||
701 | neigh->arp_queue_len_bytes = 0; | 701 | neigh->arp_queue_len_bytes = 0; |
702 | 702 | ||
703 | if (dev->netdev_ops->ndo_neigh_destroy) | 703 | if (dev->netdev_ops->ndo_neigh_destroy) |
704 | dev->netdev_ops->ndo_neigh_destroy(neigh); | 704 | dev->netdev_ops->ndo_neigh_destroy(dev, neigh); |
705 | 705 | ||
706 | dev_put(dev); | 706 | dev_put(dev); |
707 | neigh_parms_put(neigh->parms); | 707 | neigh_parms_put(neigh->parms); |
diff --git a/net/ieee802154/6lowpan/core.c b/net/ieee802154/6lowpan/core.c index 8c004a0c8d64..935ab932e841 100644 --- a/net/ieee802154/6lowpan/core.c +++ b/net/ieee802154/6lowpan/core.c | |||
@@ -81,7 +81,7 @@ static int lowpan_stop(struct net_device *dev) | |||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | static int lowpan_neigh_construct(struct neighbour *n) | 84 | static int lowpan_neigh_construct(struct net_device *dev, struct neighbour *n) |
85 | { | 85 | { |
86 | struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n)); | 86 | struct lowpan_802154_neigh *neigh = lowpan_802154_neigh(neighbour_priv(n)); |
87 | 87 | ||