Skip to contentSkip to conversation

batman-adv: Add dummy soft-interface rx mode handler

PATCH Applied Linus Lüssing 2 participants 5 messages May 26, 2013 – Jun 9, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 batman-adv: Add dummy soft-interface rx mode handler

We do not actually need to set any rx filters for the virtual batman soft interface. However a dummy handler enables a user to set static multicast listeners for instance.

---
* Fixes issue #171

v2: added kernel doc

 soft-interface.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)
soft-interface.c +13 -0
index 2bad57f..54b3991 100644
@@ -137,6 +137,18 @@ static int batadv_interface_change_mtu(struct net_device *dev, int new_mtu)
 	return 0;
 }
 
+/**
+ * batadv_interface_set_rx_mode - set the rx mode of a device
+ * @dev: registered network device to modify
+ *
+ * We do not actually need to set any rx filters for the virtual batman
+ * soft interface. However a dummy handler enables a user to set static
+ * multicast listeners for instance.
+ */
+static void batadv_interface_set_rx_mode(struct net_device *dev)
+{
+}
+
 static int batadv_interface_tx(struct sk_buff *skb,
 			       struct net_device *soft_iface)
 {
@@ -572,6 +584,7 @@ static const struct net_device_ops batadv_netdev_ops = {
 	.ndo_get_stats = batadv_interface_stats,
 	.ndo_set_mac_address = batadv_interface_set_mac_addr,
 	.ndo_change_mtu = batadv_interface_change_mtu,
+	.ndo_set_rx_mode = batadv_interface_set_rx_mode,
 	.ndo_start_xmit = batadv_interface_tx,
 	.ndo_validate_addr = eth_validate_addr,
 	.ndo_add_slave = batadv_softif_slave_add,
Signature · 1 line
1.7.10.4
#1 lore raw

soft-interface.c static const struct net_device_ops batadv_netdev_ops = · line 590

Quoted 8 lines · On Sunday, May 26, 2013 23:56:07 Linus Lüssing wrote:
soft-interface.c +1 -0
@@ -572,6 +584,7 @@ static const struct net_device_ops batadv_netdev_ops =
 { .ndo_get_stats = batadv_interface_stats,
        .ndo_set_mac_address = batadv_interface_set_mac_addr,
        .ndo_change_mtu = batadv_interface_change_mtu,
+       .ndo_set_rx_mode = batadv_interface_set_rx_mode,
        .ndo_start_xmit = batadv_interface_tx,
        .ndo_validate_addr = eth_validate_addr,
        .ndo_add_slave = batadv_softif_slave_add,

Do we need compat code for this API call ?

Cheers,
Marek

#2 lore raw
Quoted 12 lines · Marek Lindner

soft-interface.c static const struct net_device_ops batadv_netdev_ops = · line 590

Quoted 8 lines · On Sunday, May 26, 2013 23:56:07 Linus Lüssing wrote:
soft-interface.c +1 -0
@@ -572,6 +584,7 @@ static const struct net_device_ops batadv_netdev_ops =
 { .ndo_get_stats = batadv_interface_stats,
        .ndo_set_mac_address = batadv_interface_set_mac_addr,
        .ndo_change_mtu = batadv_interface_change_mtu,
+       .ndo_set_rx_mode = batadv_interface_set_rx_mode,
        .ndo_start_xmit = batadv_interface_tx,
        .ndo_validate_addr = eth_validate_addr,
        .ndo_add_slave = batadv_softif_slave_add,

Do we need compat code for this API call ?

Quoted 2 lines

Cheers,
Marek

Yes it does, actually. A PATCHv3 will follow soonish. Thanks for the hint!

Cheers, Linus

#3 lore raw
Quoted 13 lines · Linus Lüssing
Quoted 12 lines · Marek Lindner

soft-interface.c static const struct net_device_ops batadv_netdev_ops = · line 590

Quoted 8 lines · On Sunday, May 26, 2013 23:56:07 Linus Lüssing wrote:
soft-interface.c +1 -0
@@ -572,6 +584,7 @@ static const struct net_device_ops batadv_netdev_ops =
 { .ndo_get_stats = batadv_interface_stats,
        .ndo_set_mac_address = batadv_interface_set_mac_addr,
        .ndo_change_mtu = batadv_interface_change_mtu,
+       .ndo_set_rx_mode = batadv_interface_set_rx_mode,
        .ndo_start_xmit = batadv_interface_tx,
        .ndo_validate_addr = eth_validate_addr,
        .ndo_add_slave = batadv_softif_slave_add,

Do we need compat code for this API call ?

Quoted 5 lines
Quoted 2 lines

Cheers,
Marek

Yes it does, actually. A PATCHv3 will follow soonish. Thanks for the hint!

Hm, I changed my mind, it actually shouldn't need any compat code. At least compiling worked fine for me for 2.6.29 to 3.9 kernels.

There was a .ndo_set_multicast_list once with all these calls being reassigned to .ndo_set_rx_mode and .ndo_set_multicast_list being removed since 3.2 ("net: remove use of ndo_set_multicast_list in drivers":afc4b13df143122f99a0eb10bfefb216c2806de0). However .ndo_set_rx_mode has always been threre for
kernels >= 2.6.29, <= 3.9.

Cheers, Linus

#4 lore raw
In reply to Linus Lüssing
Quoted 4 lines · On Sunday, May 26, 2013 23:56:07 Linus Lüssing wrote:

We do not actually need to set any rx filters for the virtual batman soft interface. However a dummy handler enables a user to set static multicast listeners for instance.

Quoted 8 lines

---
* Fixes issue #171

v2: added kernel doc

 soft-interface.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Applied in revision 1cfaca7.

Thanks,
Marek