Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 351638e7 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller
Browse files

net: pass info struct via netdevice notifier



So far, only net_device * could be passed along with netdevice notifier
event. This patch provides a possibility to pass custom structure
able to provide info that event listener needs to know.

Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>

v2->v3: fix typo on simeth
	shortened dev_getter
	shortened notifier_info struct name
v1->v2: fix notifier_call parameter in call_netdevice_notifier()
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b1098bbe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -268,7 +268,7 @@ static __inline__ int dev_is_ethdev(struct net_device *dev)
static int
simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
{
	struct net_device *dev = ptr;
	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
	struct simeth_local *local;
	struct in_device *in_dev;
	struct in_ifaddr **ifap = NULL;
+2 −1
Original line number Diff line number Diff line
@@ -331,7 +331,8 @@ static int tx4939_netdev_event(struct notifier_block *this,
			       unsigned long event,
			       void *ptr)
{
	struct net_device *dev = ptr;
	struct net_device *dev = netdev_notifier_info_to_dev(ptr);

	if (event == NETDEV_CHANGE && netif_carrier_ok(dev)) {
		__u64 bit = 0;
		if (dev->irq == TXX9_IRQ_BASE + TX4939_IR_ETH(0))
+2 −2
Original line number Diff line number Diff line
@@ -3269,9 +3269,9 @@ static int cma_netdev_change(struct net_device *ndev, struct rdma_id_private *id
}

static int cma_netdev_callback(struct notifier_block *self, unsigned long event,
			       void *ctx)
			       void *ptr)
{
	struct net_device *ndev = (struct net_device *)ctx;
	struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
	struct cma_device *cma_dev;
	struct rdma_id_private *id_priv;
	int ret = NOTIFY_DONE;
+1 −1
Original line number Diff line number Diff line
@@ -1161,7 +1161,7 @@ static void netdev_removed(struct mlx4_ib_dev *dev, int port)
static int mlx4_ib_netdev_event(struct notifier_block *this, unsigned long event,
				void *ptr)
{
	struct net_device *dev = ptr;
	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
	struct mlx4_ib_dev *ibdev;
	struct net_device *oldnd;
	struct mlx4_ib_iboe *iboe;
+1 −1
Original line number Diff line number Diff line
@@ -3277,7 +3277,7 @@ static int bond_slave_netdev_event(unsigned long event,
static int bond_netdev_event(struct notifier_block *this,
			     unsigned long event, void *ptr)
{
	struct net_device *event_dev = (struct net_device *)ptr;
	struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);

	pr_debug("event_dev: %s, event: %lx\n",
		 event_dev ? event_dev->name : "None",
Loading