X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fstaging%2Fbatman-adv%2Fhard-interface.h;h=d5640b045cb3cded11531b00401026a076a1fb9b;hb=a0e3390787ef523699ae1f3f3ea0ca953e630be2;hp=1e5fc3e720f4b2263a37aacfb618030aa11533b4;hpb=7a996d3ab150bb0e1b71fa182f70199a703efdd1;p=pandora-kernel.git diff --git a/drivers/staging/batman-adv/hard-interface.h b/drivers/staging/batman-adv/hard-interface.h index 1e5fc3e720f4..d5508899065b 100644 --- a/drivers/staging/batman-adv/hard-interface.h +++ b/drivers/staging/batman-adv/hard-interface.h @@ -19,6 +19,9 @@ * */ +#ifndef _NET_BATMAN_ADV_HARD_INTERFACE_H_ +#define _NET_BATMAN_ADV_HARD_INTERFACE_H_ + #define IF_NOT_IN_USE 0 #define IF_TO_BE_REMOVED 1 #define IF_INACTIVE 2 @@ -29,12 +32,27 @@ extern struct notifier_block hard_if_notifier; struct batman_if *get_batman_if_by_netdev(struct net_device *net_dev); -int hardif_enable_interface(struct batman_if *batman_if); +int hardif_enable_interface(struct batman_if *batman_if, char *iface_name); void hardif_disable_interface(struct batman_if *batman_if); void hardif_remove_interfaces(void); int batman_skb_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *ptype, struct net_device *orig_dev); -int hardif_min_mtu(void); -void update_min_mtu(void); +int hardif_min_mtu(struct net_device *soft_iface); +void update_min_mtu(struct net_device *soft_iface); + +static inline void hardif_hold(struct batman_if *batman_if) +{ + atomic_inc(&batman_if->refcnt); +} + +static inline void hardif_put(struct batman_if *batman_if) +{ + if (atomic_dec_and_test(&batman_if->refcnt)) { + dev_put(batman_if->net_dev); + kfree(batman_if); + } +} + +#endif /* _NET_BATMAN_ADV_HARD_INTERFACE_H_ */