Staging: batman-adv: Unify sysfs file names with their bat_priv atomics
[firefly-linux-kernel-4.4.55.git] / drivers / staging / batman-adv / types.h
index f3f7366231e7584886b1568143188d40ae4524de..4463da3914988e7581dc6476da1fadcec06284e0 100644 (file)
@@ -43,9 +43,10 @@ struct batman_if {
        unsigned char *packet_buff;
        int packet_len;
        struct kobject *hardif_obj;
-       atomic_t refcnt;
+       struct kref refcount;
        struct packet_type batman_adv_ptype;
        struct net_device *soft_iface;
+       struct rcu_head rcu;
 };
 
 /**
@@ -112,16 +113,18 @@ struct neigh_node {
 struct bat_priv {
        atomic_t mesh_state;
        struct net_device_stats stats;
-       atomic_t aggregation_enabled;
-       atomic_t bonding_enabled;
-       atomic_t frag_enabled;
-       atomic_t vis_mode;
-       atomic_t orig_interval;
-       atomic_t log_level;
+       atomic_t aggregated_ogms;       /* boolean */
+       atomic_t bonding;               /* boolean */
+       atomic_t fragmentation;         /* boolean */
+       atomic_t vis_mode;              /* VIS_TYPE_* */
+       atomic_t orig_interval;         /* uint */
+       atomic_t log_level;             /* uint */
        atomic_t bcast_seqno;
        atomic_t bcast_queue_left;
        atomic_t batman_queue_left;
        char num_ifaces;
+       struct hlist_head softif_neigh_list;
+       struct softif_neigh *softif_neigh;
        struct debug_log *debug_log;
        struct batman_if *primary_if;
        struct kobject *mesh_obj;
@@ -140,6 +143,7 @@ struct bat_priv {
        spinlock_t hna_ghash_lock; /* protects hna_global_hash */
        spinlock_t vis_hash_lock; /* protects vis_hash */
        spinlock_t vis_list_lock; /* protects vis_info::recv_list */
+       spinlock_t softif_neigh_lock; /* protects soft-interface neigh list */
        int16_t num_local_hna;
        atomic_t hna_local_changed;
        struct delayed_work hna_work;
@@ -238,4 +242,13 @@ struct recvlist_node {
        uint8_t mac[ETH_ALEN];
 };
 
+struct softif_neigh {
+       struct hlist_node list;
+       uint8_t addr[ETH_ALEN];
+       unsigned long last_seen;
+       short vid;
+       struct kref refcount;
+       struct rcu_head rcu;
+};
+
 #endif /* _NET_BATMAN_ADV_TYPES_H_ */