Hi Matthias,
On Sat, Mar 09, 2013 at 11:40:26AM +0100, Matthias Schiffer wrote:
@@ -515,6 +515,17 @@ batadv_hardif_add_interface(struct net_device *net_dev) INIT_WORK(&hard_iface->cleanup_work, batadv_hardif_remove_interface_finish);
- hard_iface->num_bcasts = BATADV_NUM_BCASTS_DEFAULT;
+#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
- if (net_dev->ieee80211_ptr)
hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
+#if IS_ENABLED(CONFIG_WIRELESS_EXT)
- else if (net_dev->wireless_handlers)
hard_iface->num_bcasts = BATADV_NUM_BCASTS_WIRELESS;
+#endif +#endif
- /* extra reference for return */ atomic_set(&hard_iface->refcount, 2);
What about re-using batadv_is_wifi_iface() instead of adding the same code here? :)
batadv_is_wifi_iface() takes an ifindex as parameter and then gets the net_device by means of dev_get_by_index. You may want to split it up so that you can avoid the research since you already have the related net_device object.
Cheers,