scripts/Lindent: handle missing indent gracefully
[cascardo/linux.git] / net / batman-adv / types.h
index 67d6348..d260efd 100644 (file)
@@ -44,7 +44,7 @@ struct seq_file;
  *
  * *Please be careful: batadv_dat_addr_t must be UNSIGNED*
  */
-#define batadv_dat_addr_t uint16_t
+#define batadv_dat_addr_t u16
 
 #endif /* CONFIG_BATMAN_ADV_DAT */
 
@@ -103,10 +103,10 @@ struct batadv_hard_iface_bat_iv {
  */
 struct batadv_hard_iface {
        struct list_head list;
-       int16_t if_num;
+       s16 if_num;
        char if_status;
        struct net_device *net_dev;
-       uint8_t num_bcasts;
+       u8 num_bcasts;
        struct kobject *hardif_obj;
        atomic_t refcount;
        struct packet_type batman_adv_ptype;
@@ -132,8 +132,8 @@ struct batadv_orig_ifinfo {
        struct hlist_node list;
        struct batadv_hard_iface *if_outgoing;
        struct batadv_neigh_node __rcu *router; /* rcu protected pointer */
-       uint32_t last_real_seqno;
-       uint8_t last_ttl;
+       u32 last_real_seqno;
+       u8 last_ttl;
        unsigned long batman_seqno_reset;
        atomic_t refcount;
        struct rcu_head rcu;
@@ -152,9 +152,9 @@ struct batadv_frag_table_entry {
        struct hlist_head head;
        spinlock_t lock; /* protects head */
        unsigned long timestamp;
-       uint16_t seqno;
-       uint16_t size;
-       uint16_t total_size;
+       u16 seqno;
+       u16 size;
+       u16 total_size;
 };
 
 /**
@@ -166,7 +166,7 @@ struct batadv_frag_table_entry {
 struct batadv_frag_list_entry {
        struct hlist_node list;
        struct sk_buff *skb;
-       uint8_t no;
+       u8 no;
 };
 
 /**
@@ -175,7 +175,7 @@ struct batadv_frag_list_entry {
  * @num_entries: number of TT entries for this VLAN
  */
 struct batadv_vlan_tt {
-       uint32_t crc;
+       u32 crc;
        atomic_t num_entries;
 };
 
@@ -190,7 +190,7 @@ struct batadv_vlan_tt {
 struct batadv_orig_node_vlan {
        unsigned short vid;
        struct batadv_vlan_tt tt;
-       struct list_head list;
+       struct hlist_node list;
        atomic_t refcount;
        struct rcu_head rcu;
 };
@@ -206,7 +206,7 @@ struct batadv_orig_node_vlan {
  */
 struct batadv_orig_bat_iv {
        unsigned long *bcast_own;
-       uint8_t *bcast_own_sum;
+       u8 *bcast_own_sum;
        /* ogm_cnt_lock protects: bcast_own, bcast_own_sum,
         * neigh_node->bat_iv.real_bits & neigh_node->bat_iv.real_packet_count
         */
@@ -221,6 +221,7 @@ struct batadv_orig_bat_iv {
  * @batadv_dat_addr_t:  address of the orig node in the distributed hash
  * @last_seen: time when last packet from this node was received
  * @bcast_seqno_reset: time when the broadcast seqno window was reset
+ * @mcast_handler_lock: synchronizes mcast-capability and -flag changes
  * @mcast_flags: multicast flags announced by the orig node
  * @mcast_want_all_unsnoop_node: a list node for the
  *  mcast.want_all_unsnoopables list
@@ -259,7 +260,7 @@ struct batadv_orig_bat_iv {
  * @bat_iv: B.A.T.M.A.N. IV private structure
  */
 struct batadv_orig_node {
-       uint8_t orig[ETH_ALEN];
+       u8 orig[ETH_ALEN];
        struct hlist_head ifinfo_list;
        struct batadv_orig_ifinfo *last_bonding_candidate;
 #ifdef CONFIG_BATMAN_ADV_DAT
@@ -268,21 +269,23 @@ struct batadv_orig_node {
        unsigned long last_seen;
        unsigned long bcast_seqno_reset;
 #ifdef CONFIG_BATMAN_ADV_MCAST
-       uint8_t mcast_flags;
+       /* synchronizes mcast tvlv specific orig changes */
+       spinlock_t mcast_handler_lock;
+       u8 mcast_flags;
        struct hlist_node mcast_want_all_unsnoopables_node;
        struct hlist_node mcast_want_all_ipv4_node;
        struct hlist_node mcast_want_all_ipv6_node;
 #endif
-       uint8_t capabilities;
-       uint8_t capa_initialized;
+       unsigned long capabilities;
+       unsigned long capa_initialized;
        atomic_t last_ttvn;
        unsigned char *tt_buff;
-       int16_t tt_buff_len;
+       s16 tt_buff_len;
        spinlock_t tt_buff_lock; /* protects tt_buff & tt_buff_len */
        /* prevents from changing the table while reading it */
        spinlock_t tt_lock;
        DECLARE_BITMAP(bcast_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
-       uint32_t last_bcast_seqno;
+       u32 last_bcast_seqno;
        struct hlist_head neigh_list;
        /* neigh_list_lock protects: neigh_list and router */
        spinlock_t neigh_list_lock;
@@ -299,7 +302,7 @@ struct batadv_orig_node {
        spinlock_t out_coding_list_lock; /* Protects out_coding_list */
 #endif
        struct batadv_frag_table_entry fragments[BATADV_FRAG_BUFFER_COUNT];
-       struct list_head vlan_list;
+       struct hlist_head vlan_list;
        spinlock_t vlan_list_lock; /* protects vlan_list */
        struct batadv_orig_bat_iv bat_iv;
 };
@@ -313,10 +316,10 @@ struct batadv_orig_node {
  *  (= orig node announces a tvlv of type BATADV_TVLV_MCAST)
  */
 enum batadv_orig_capabilities {
-       BATADV_ORIG_CAPA_HAS_DAT = BIT(0),
-       BATADV_ORIG_CAPA_HAS_NC = BIT(1),
-       BATADV_ORIG_CAPA_HAS_TT = BIT(2),
-       BATADV_ORIG_CAPA_HAS_MCAST = BIT(3),
+       BATADV_ORIG_CAPA_HAS_DAT,
+       BATADV_ORIG_CAPA_HAS_NC,
+       BATADV_ORIG_CAPA_HAS_TT,
+       BATADV_ORIG_CAPA_HAS_MCAST,
 };
 
 /**
@@ -325,16 +328,14 @@ enum batadv_orig_capabilities {
  * @orig_node: pointer to corresponding orig node
  * @bandwidth_down: advertised uplink download bandwidth
  * @bandwidth_up: advertised uplink upload bandwidth
- * @deleted: this struct is scheduled for deletion
  * @refcount: number of contexts the object is used
  * @rcu: struct used for freeing in an RCU-safe manner
  */
 struct batadv_gw_node {
        struct hlist_node list;
        struct batadv_orig_node *orig_node;
-       uint32_t bandwidth_down;
-       uint32_t bandwidth_up;
-       unsigned long deleted;
+       u32 bandwidth_down;
+       u32 bandwidth_up;
        atomic_t refcount;
        struct rcu_head rcu;
 };
@@ -355,7 +356,7 @@ struct batadv_gw_node {
 struct batadv_neigh_node {
        struct hlist_node list;
        struct batadv_orig_node *orig_node;
-       uint8_t addr[ETH_ALEN];
+       u8 addr[ETH_ALEN];
        struct hlist_head ifinfo_list;
        spinlock_t ifinfo_lock; /* protects ifinfo_list and its members */
        struct batadv_hard_iface *if_incoming;
@@ -375,11 +376,11 @@ struct batadv_neigh_node {
  * @real_packet_count: counted result of real_bits
  */
 struct batadv_neigh_ifinfo_bat_iv {
-       uint8_t tq_recv[BATADV_TQ_GLOBAL_WINDOW_SIZE];
-       uint8_t tq_index;
-       uint8_t tq_avg;
+       u8 tq_recv[BATADV_TQ_GLOBAL_WINDOW_SIZE];
+       u8 tq_index;
+       u8 tq_avg;
        DECLARE_BITMAP(real_bits, BATADV_TQ_LOCAL_WINDOW_SIZE);
-       uint8_t real_packet_count;
+       u8 real_packet_count;
 };
 
 /**
@@ -395,7 +396,7 @@ struct batadv_neigh_ifinfo {
        struct hlist_node list;
        struct batadv_hard_iface *if_outgoing;
        struct batadv_neigh_ifinfo_bat_iv bat_iv;
-       uint8_t last_ttl;
+       u8 last_ttl;
        atomic_t refcount;
        struct rcu_head rcu;
 };
@@ -408,7 +409,7 @@ struct batadv_neigh_ifinfo {
  */
 #ifdef CONFIG_BATMAN_ADV_BLA
 struct batadv_bcast_duplist_entry {
-       uint8_t orig[ETH_ALEN];
+       u8 orig[ETH_ALEN];
        __be32 crc;
        unsigned long entrytime;
 };
@@ -534,13 +535,13 @@ struct batadv_priv_tt {
        struct list_head changes_list;
        struct batadv_hashtable *local_hash;
        struct batadv_hashtable *global_hash;
-       struct list_head req_list;
+       struct hlist_head req_list;
        struct list_head roam_list;
        spinlock_t changes_list_lock; /* protects changes */
        spinlock_t req_list_lock; /* protects req_list */
        spinlock_t roam_list_lock; /* protects roam_list */
        unsigned char *last_changeset;
-       int16_t last_changeset_len;
+       s16 last_changeset_len;
        /* protects last_changeset & last_changeset_len */
        spinlock_t last_changeset_lock;
        /* prevents from executing a commit while reading the table */
@@ -660,7 +661,7 @@ struct batadv_priv_mcast {
        struct hlist_head want_all_unsnoopables_list;
        struct hlist_head want_all_ipv4_list;
        struct hlist_head want_all_ipv6_list;
-       uint8_t flags;
+       u8 flags;
        bool enabled;
        atomic_t num_disabled;
        atomic_t num_want_all_unsnoopables;
@@ -778,7 +779,7 @@ struct batadv_priv {
        atomic_t mesh_state;
        struct net_device *soft_iface;
        struct net_device_stats stats;
-       uint64_t __percpu *bat_counters; /* Per cpu counters */
+       u64 __percpu *bat_counters; /* Per cpu counters */
        atomic_t aggregated_ogms;
        atomic_t bonding;
        atomic_t fragmentation;
@@ -800,8 +801,8 @@ struct batadv_priv {
 #ifdef CONFIG_BATMAN_ADV_DEBUG
        atomic_t log_level;
 #endif
-       uint32_t isolation_mark;
-       uint32_t isolation_mark_mask;
+       u32 isolation_mark;
+       u32 isolation_mark_mask;
        atomic_t bcast_seqno;
        atomic_t bcast_queue_left;
        atomic_t batman_queue_left;
@@ -867,7 +868,7 @@ struct batadv_socket_client {
 struct batadv_socket_packet {
        struct list_head list;
        size_t icmp_len;
-       uint8_t icmp_packet[BATADV_ICMP_MAX_PACKET_SIZE];
+       u8 icmp_packet[BATADV_ICMP_MAX_PACKET_SIZE];
 };
 
 /**
@@ -888,14 +889,14 @@ struct batadv_socket_packet {
  */
 #ifdef CONFIG_BATMAN_ADV_BLA
 struct batadv_bla_backbone_gw {
-       uint8_t orig[ETH_ALEN];
+       u8 orig[ETH_ALEN];
        unsigned short vid;
        struct hlist_node hash_entry;
        struct batadv_priv *bat_priv;
        unsigned long lasttime;
        atomic_t wait_periods;
        atomic_t request_sent;
-       uint16_t crc;
+       u16 crc;
        atomic_t refcount;
        struct rcu_head rcu;
 };
@@ -911,7 +912,7 @@ struct batadv_bla_backbone_gw {
  * @rcu: struct used for freeing in an RCU-safe manner
  */
 struct batadv_bla_claim {
-       uint8_t addr[ETH_ALEN];
+       u8 addr[ETH_ALEN];
        unsigned short vid;
        struct batadv_bla_backbone_gw *backbone_gw;
        unsigned long lasttime;
@@ -933,10 +934,10 @@ struct batadv_bla_claim {
  * @rcu: struct used for freeing in an RCU-safe manner
  */
 struct batadv_tt_common_entry {
-       uint8_t addr[ETH_ALEN];
+       u8 addr[ETH_ALEN];
        unsigned short vid;
        struct hlist_node hash_entry;
-       uint16_t flags;
+       u16 flags;
        unsigned long added_at;
        atomic_t refcount;
        struct rcu_head rcu;
@@ -978,7 +979,7 @@ struct batadv_tt_global_entry {
  */
 struct batadv_tt_orig_list_entry {
        struct batadv_orig_node *orig_node;
-       uint8_t ttvn;
+       u8 ttvn;
        struct hlist_node list;
        atomic_t refcount;
        struct rcu_head rcu;
@@ -1001,9 +1002,9 @@ struct batadv_tt_change_node {
  * @list: list node for batadv_priv_tt::req_list
  */
 struct batadv_tt_req_node {
-       uint8_t addr[ETH_ALEN];
+       u8 addr[ETH_ALEN];
        unsigned long issued_at;
-       struct list_head list;
+       struct hlist_node list;
 };
 
 /**
@@ -1015,7 +1016,7 @@ struct batadv_tt_req_node {
  * @list: list node for batadv_priv_tt::roam_list
  */
 struct batadv_tt_roam_node {
-       uint8_t addr[ETH_ALEN];
+       u8 addr[ETH_ALEN];
        atomic_t counter;
        unsigned long first_time;
        struct list_head list;
@@ -1032,7 +1033,7 @@ struct batadv_tt_roam_node {
  */
 struct batadv_nc_node {
        struct list_head list;
-       uint8_t addr[ETH_ALEN];
+       u8 addr[ETH_ALEN];
        atomic_t refcount;
        struct rcu_head rcu;
        struct batadv_orig_node *orig_node;
@@ -1056,8 +1057,8 @@ struct batadv_nc_path {
        atomic_t refcount;
        struct list_head packet_list;
        spinlock_t packet_list_lock; /* Protects packet_list */
-       uint8_t next_hop[ETH_ALEN];
-       uint8_t prev_hop[ETH_ALEN];
+       u8 next_hop[ETH_ALEN];
+       u8 prev_hop[ETH_ALEN];
        unsigned long last_valid;
 };
 
@@ -1109,11 +1110,11 @@ struct batadv_skb_cb {
 struct batadv_forw_packet {
        struct hlist_node list;
        unsigned long send_time;
-       uint8_t own;
+       u8 own;
        struct sk_buff *skb;
-       uint16_t packet_len;
-       uint32_t direct_link_flags;
-       uint8_t num_packets;
+       u16 packet_len;
+       u32 direct_link_flags;
+       u8 num_packets;
        struct delayed_work delayed_work;
        struct batadv_hard_iface *if_incoming;
        struct batadv_hard_iface *if_outgoing;
@@ -1188,7 +1189,7 @@ struct batadv_algo_ops {
  */
 struct batadv_dat_entry {
        __be32 ip;
-       uint8_t mac_addr[ETH_ALEN];
+       u8 mac_addr[ETH_ALEN];
        unsigned short vid;
        unsigned long last_update;
        struct hlist_node hash_entry;
@@ -1250,14 +1251,13 @@ struct batadv_tvlv_handler {
        struct hlist_node list;
        void (*ogm_handler)(struct batadv_priv *bat_priv,
                            struct batadv_orig_node *orig,
-                           uint8_t flags,
-                           void *tvlv_value, uint16_t tvlv_value_len);
+                           u8 flags, void *tvlv_value, u16 tvlv_value_len);
        int (*unicast_handler)(struct batadv_priv *bat_priv,
-                              uint8_t *src, uint8_t *dst,
-                              void *tvlv_value, uint16_t tvlv_value_len);
-       uint8_t type;
-       uint8_t version;
-       uint8_t flags;
+                              u8 *src, u8 *dst,
+                              void *tvlv_value, u16 tvlv_value_len);
+       u8 type;
+       u8 version;
+       u8 flags;
        atomic_t refcount;
        struct rcu_head rcu;
 };