diff options
author | Sven Eckelmann <sven.eckelmann@open-mesh.com> | 2016-09-30 15:21:03 +0200 |
---|---|---|
committer | Simon Wunderlich <sw@simonwunderlich.de> | 2016-11-08 19:02:37 +0100 |
commit | 10b1bbb46c6c8e571458a9a8913514dbebbaf20c (patch) | |
tree | d6485a43f41c5867811004a8766eaafc3a56ce3f /net/batman-adv/types.h | |
parent | f44a3ae9a2811cfd5321e0f72c02bc270410db64 (diff) | |
download | linux-10b1bbb46c6c8e571458a9a8913514dbebbaf20c.tar.bz2 |
batman-adv: Cache the type of wifi device for each hardif
batman-adv is requiring the type of wifi device in different contexts. Some
of them can take the rtnl semaphore and some of them already have the
semaphore taken. But even others don't allow that the semaphore will be
taken.
The data has to be retrieved when the hardif is added to batman-adv because
some of the wifi information for an hardif will only be available with rtnl
lock. It can then be cached in the batadv_hard_iface and the functions
is_wifi_netdev and is_cfg80211_netdev can just compare the correct bits
without imposing extra locking requirements.
Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Diffstat (limited to 'net/batman-adv/types.h')
-rw-r--r-- | net/batman-adv/types.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h index 98ebac05c571..1bcce32d5d98 100644 --- a/net/batman-adv/types.h +++ b/net/batman-adv/types.h @@ -119,11 +119,23 @@ struct batadv_hard_iface_bat_v { }; /** + * enum batadv_hard_iface_wifi_flags - Flags describing the wifi configuration + * of a batadv_hard_iface + * @BATADV_HARDIF_WIFI_WEXT_DIRECT: it is a wext wifi device + * @BATADV_HARDIF_WIFI_CFG80211_DIRECT: it is a cfg80211 wifi device + */ +enum batadv_hard_iface_wifi_flags { + BATADV_HARDIF_WIFI_WEXT_DIRECT = BIT(0), + BATADV_HARDIF_WIFI_CFG80211_DIRECT = BIT(1), +}; + +/** * struct batadv_hard_iface - network device known to batman-adv * @list: list node for batadv_hardif_list * @if_num: identificator of the interface * @if_status: status of the interface for batman-adv * @num_bcasts: number of payload re-broadcasts on this interface (ARQ) + * @wifi_flags: flags whether this is (directly or indirectly) a wifi interface * @net_dev: pointer to the net_device * @hardif_obj: kobject of the per interface sysfs "mesh" directory * @refcount: number of contexts the object is used @@ -142,6 +154,7 @@ struct batadv_hard_iface { s16 if_num; char if_status; u8 num_bcasts; + u32 wifi_flags; struct net_device *net_dev; struct kobject *hardif_obj; struct kref refcount; |