]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - net/batman-adv/types.h
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / net / batman-adv / types.h
similarity index 83%
rename from drivers/staging/batman-adv/types.h
rename to net/batman-adv/types.h
index f3f7366231e7584886b1568143188d40ae4524de..bf3f6f5a12c4466c0ca86140650fe3d195d450ec 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;
 };
 
 /**
@@ -54,6 +55,7 @@ struct batman_if {
  *     @last_valid: when last packet from this node was received
  *     @bcast_seqno_reset: time when the broadcast seqno window was reset
  *     @batman_seqno_reset: time when the batman seqno window was reset
+ *     @gw_flags: flags related to gateway class
  *     @flags: for now only VIS_SERVER flag
  *     @last_real_seqno: last and best known squence number
  *     @last_ttl: ttl of last received packet
@@ -66,19 +68,20 @@ struct orig_node {
        uint8_t orig[ETH_ALEN];
        uint8_t primary_addr[ETH_ALEN];
        struct neigh_node *router;
-       TYPE_OF_WORD *bcast_own;
+       unsigned long *bcast_own;
        uint8_t *bcast_own_sum;
        uint8_t tq_own;
        int tq_asym_penalty;
        unsigned long last_valid;
        unsigned long bcast_seqno_reset;
        unsigned long batman_seqno_reset;
-       uint8_t  flags;
+       uint8_t gw_flags;
+       uint8_t flags;
        unsigned char *hna_buff;
        int16_t hna_buff_len;
        uint32_t last_real_seqno;
        uint8_t last_ttl;
-       TYPE_OF_WORD bcast_bits[NUM_WORDS];
+       unsigned long bcast_bits[NUM_WORDS];
        uint32_t last_bcast_seqno;
        struct list_head neigh_list;
        struct list_head frag_list;
@@ -89,6 +92,14 @@ struct orig_node {
        } bond;
 };
 
+struct gw_node {
+       struct hlist_node list;
+       struct orig_node *orig_node;
+       unsigned long deleted;
+       struct kref refcount;
+       struct rcu_head rcu;
+};
+
 /**
  *     neigh_node
  *     @last_valid: when last packet via this neighbor was received
@@ -103,7 +114,7 @@ struct neigh_node {
        uint8_t last_ttl;
        struct neigh_node *next_bond_candidate;
        unsigned long last_valid;
-       TYPE_OF_WORD real_bits[NUM_WORDS];
+       unsigned long real_bits[NUM_WORDS];
        struct orig_node *orig_node;
        struct batman_if *if_incoming;
 };
@@ -112,22 +123,29 @@ 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 gw_mode;               /* GW_MODE_* */
+       atomic_t gw_sel_class;          /* uint */
+       atomic_t gw_bandwidth;          /* gw bandwidth */
+       atomic_t orig_interval;         /* uint */
+       atomic_t hop_penalty;           /* 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;
        struct dentry *debug_dir;
        struct hlist_head forw_bat_list;
        struct hlist_head forw_bcast_list;
+       struct hlist_head gw_list;
        struct list_head vis_send_list;
        struct hashtable_t *orig_hash;
        struct hashtable_t *hna_local_hash;
@@ -138,13 +156,16 @@ struct bat_priv {
        spinlock_t forw_bcast_list_lock; /* protects  */
        spinlock_t hna_lhash_lock; /* protects hna_local_hash */
        spinlock_t hna_ghash_lock; /* protects hna_global_hash */
+       spinlock_t gw_list_lock; /* protects gw_list */
        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;
        struct delayed_work orig_work;
        struct delayed_work vis_work;
+       struct gw_node *curr_gw;
        struct vis_info *my_vis_info;
 };
 
@@ -225,17 +246,26 @@ struct vis_info {
        /* this packet might be part of the vis send queue. */
        struct sk_buff *skb_packet;
        /* vis_info may follow here*/
-} __attribute__((packed));
+} __packed;
 
 struct vis_info_entry {
        uint8_t  src[ETH_ALEN];
        uint8_t  dest[ETH_ALEN];
        uint8_t  quality;       /* quality = 0 means HNA */
-} __attribute__((packed));
+} __packed;
 
 struct recvlist_node {
        struct list_head list;
        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_ */