]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - net/batman-adv/types.h
batman-adv: Reformat multiline comments to consistent style
[mirror_ubuntu-artful-kernel.git] / net / batman-adv / types.h
index 61308e8016ff85d201d68143d7760ae3c4437294..053c5d4776ce4367a4512f658ac50b10e82ada8a 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
+/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
  *
  * Marek Lindner, Simon Wunderlich
  *
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301, USA
- *
  */
 
-
-
 #ifndef _NET_BATMAN_ADV_TYPES_H_
 #define _NET_BATMAN_ADV_TYPES_H_
 
@@ -49,8 +45,7 @@ struct hard_iface {
        struct rcu_head rcu;
 };
 
-/**
- *     orig_node - structure for orig_list maintaining nodes of mesh
+/*     orig_node - structure for orig_list maintaining nodes of mesh
  *     @primary_addr: hosts primary interface address
  *     @last_seen: when last packet from this node was received
  *     @bcast_seqno_reset: time when the broadcast seqno window was reset
@@ -86,7 +81,8 @@ struct orig_node {
         * If true, then I sent a Roaming_adv to this orig_node and I have to
         * inspect every packet directed to it to check whether it is still
         * the true destination or not. This flag will be reset to false as
-        * soon as I receive a new TTVN from this orig_node */
+        * soon as I receive a new TTVN from this orig_node
+        */
        bool tt_poss_change;
        uint32_t last_real_seqno;
        uint8_t last_ttl;
@@ -101,7 +97,8 @@ struct orig_node {
        struct bat_priv *bat_priv;
        unsigned long last_frag_packet;
        /* ogm_cnt_lock protects: bcast_own, bcast_own_sum,
-        * neigh_node->real_bits, neigh_node->real_packet_count */
+        * neigh_node->real_bits, neigh_node->real_packet_count
+        */
        spinlock_t ogm_cnt_lock;
        /* bcast_seqno_lock protects bcast_bits, last_bcast_seqno */
        spinlock_t bcast_seqno_lock;
@@ -118,8 +115,7 @@ struct gw_node {
        struct rcu_head rcu;
 };
 
-/**
- *     neigh_node
+/*     neigh_node
  *     @last_seen: when last packet via this neighbor was received
  */
 struct neigh_node {
@@ -148,9 +144,26 @@ struct bcast_duplist_entry {
 };
 #endif
 
+enum bat_counters {
+       BAT_CNT_FORWARD,
+       BAT_CNT_FORWARD_BYTES,
+       BAT_CNT_MGMT_TX,
+       BAT_CNT_MGMT_TX_BYTES,
+       BAT_CNT_MGMT_RX,
+       BAT_CNT_MGMT_RX_BYTES,
+       BAT_CNT_TT_REQUEST_TX,
+       BAT_CNT_TT_REQUEST_RX,
+       BAT_CNT_TT_RESPONSE_TX,
+       BAT_CNT_TT_RESPONSE_RX,
+       BAT_CNT_TT_ROAM_ADV_TX,
+       BAT_CNT_TT_ROAM_ADV_RX,
+       BAT_CNT_NUM,
+};
+
 struct bat_priv {
        atomic_t mesh_state;
        struct net_device_stats stats;
+       uint64_t __percpu *bat_counters; /* Per cpu counters */
        atomic_t aggregated_ogms;       /* boolean */
        atomic_t bonding;               /* boolean */
        atomic_t fragmentation;         /* boolean */
@@ -174,7 +187,8 @@ struct bat_priv {
         * If true, then I received a Roaming_adv and I have to inspect every
         * packet directed to me to check whether I am still the true
         * destination or not. This flag will be reset to false as soon as I
-        * increase my TTVN */
+        * increase my TTVN
+        */
        bool tt_poss_change;
        char num_ifaces;
        struct debug_log *debug_log;
@@ -210,7 +224,7 @@ struct bat_priv {
        spinlock_t vis_list_lock; /* protects vis_info::recv_list */
        atomic_t num_local_tt;
        /* Checksum of the local table, recomputed before sending a new OGM */
-       atomic_t tt_crc;
+       uint16_t tt_crc;
        unsigned char *tt_buff;
        int16_t tt_buff_len;
        spinlock_t tt_buff_lock; /* protects tt_buff */
@@ -309,8 +323,7 @@ struct tt_roam_node {
        struct list_head list;
 };
 
-/**
- *     forw_packet - structure for forw_list maintaining packets to be
+/*     forw_packet - structure for forw_list maintaining packets to be
  *                   send/forwarded
  */
 struct forw_packet {
@@ -352,7 +365,8 @@ struct frag_packet_list_entry {
 struct vis_info {
        unsigned long first_seen;
        /* list of server-neighbors we received a vis-packet
-        * from.  we should not reply to them. */
+        * from.  we should not reply to them.
+        */
        struct list_head recv_list;
        struct list_head send_list;
        struct kref refcount;
@@ -360,7 +374,7 @@ struct vis_info {
        struct bat_priv *bat_priv;
        /* this packet might be part of the vis send queue. */
        struct sk_buff *skb_packet;
-       /* vis_info may follow here*/
+       /* vis_info may follow here */
 } __packed;
 
 struct vis_info_entry {
@@ -388,8 +402,7 @@ struct bat_algo_ops {
        /* called when primary interface is selected / changed */
        void (*bat_primary_iface_set)(struct hard_iface *hard_iface);
        /* prepare a new outgoing OGM for the send queue */
-       void (*bat_ogm_schedule)(struct hard_iface *hard_iface,
-                                int tt_num_changes);
+       void (*bat_ogm_schedule)(struct hard_iface *hard_iface);
        /* send scheduled OGM */
        void (*bat_ogm_emit)(struct forw_packet *forw_packet);
 };