summaryrefslogtreecommitdiffstats
path: root/net/hsr/hsr_device.c
diff options
context:
space:
mode:
authorArvid Brodin <arvid.brodin@alten.se>2014-07-04 23:35:24 +0200
committerDavid S. Miller <davem@davemloft.net>2014-07-08 11:35:30 -0700
commit81ba6afd6e6443d2bf4bf40f16df1f1f91c603f8 (patch)
tree62220e2dd7d59cb889a0b7859475f2a445450ab5 /net/hsr/hsr_device.c
parent70ebe4a47185db15f3c55be9611a1a971237870b (diff)
downloadop-kernel-dev-81ba6afd6e6443d2bf4bf40f16df1f1f91c603f8.zip
op-kernel-dev-81ba6afd6e6443d2bf4bf40f16df1f1f91c603f8.tar.gz
net/hsr: Switch from dev_add_pack() to netdev_rx_handler_register()
Also move the frame receive handler to hsr_slave.c. Signed-off-by: Arvid Brodin <arvid.brodin@alten.se> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_device.c')
-rw-r--r--net/hsr/hsr_device.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/hsr/hsr_device.c b/net/hsr/hsr_device.c
index 4dc2a42..4e5d92a 100644
--- a/net/hsr/hsr_device.c
+++ b/net/hsr/hsr_device.c
@@ -19,6 +19,7 @@
#include <linux/rtnetlink.h>
#include <linux/pkt_sched.h>
#include "hsr_device.h"
+#include "hsr_slave.h"
#include "hsr_framereg.h"
#include "hsr_main.h"
@@ -393,7 +394,6 @@ static void restore_slaves(struct net_device *hsr_dev)
rtnl_lock();
- /* Restore promiscuity */
for (i = 0; i < HSR_MAX_SLAVE; i++) {
if (!hsr->slave[i])
continue;
@@ -402,8 +402,12 @@ static void restore_slaves(struct net_device *hsr_dev)
netdev_info(hsr_dev,
"Cannot restore slave promiscuity (%s, %d)\n",
hsr->slave[i]->name, res);
+
+ if (hsr->slave[i]->rx_handler == hsr_handle_frame)
+ netdev_rx_handler_unregister(hsr->slave[i]);
}
+
rtnl_unlock();
}
@@ -575,6 +579,13 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
}
}
+ for (i = 0; i < HSR_MAX_SLAVE; i++) {
+ res = netdev_rx_handler_register(slave[i], hsr_handle_frame,
+ hsr);
+ if (res)
+ goto fail;
+ }
+
/* Make sure we recognize frames from ourselves in hsr_rcv() */
res = hsr_create_self_node(&hsr->self_node_db, hsr_dev->dev_addr,
hsr->slave[1]->dev_addr);
OpenPOWER on IntegriCloud