aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/main.h
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-04-08 15:48:52 -0400
committerJiri Kosina <jkosina@suse.cz>2012-04-08 15:48:52 -0400
commite75d660672ddd11704b7f0fdb8ff21968587b266 (patch)
treeccb9c107744c10b553c0373e450bee3971d16c00 /net/batman-adv/main.h
parent61282f37927143e45b03153f3e7b48d6b702147a (diff)
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
Merge branch 'master' into for-next
Merge with latest Linus' tree, as I have incoming patches that fix code that is newer than current HEAD of for-next. Conflicts: drivers/net/ethernet/realtek/r8169.c
Diffstat (limited to 'net/batman-adv/main.h')
-rw-r--r--net/batman-adv/main.h45
1 files changed, 26 insertions, 19 deletions
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 86354e06eb48..94fa1c2393a6 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (C) 2007-2011 B.A.T.M.A.N. contributors: 2 * Copyright (C) 2007-2012 B.A.T.M.A.N. contributors:
3 * 3 *
4 * Marek Lindner, Simon Wunderlich 4 * Marek Lindner, Simon Wunderlich
5 * 5 *
@@ -28,7 +28,7 @@
28#define DRIVER_DEVICE "batman-adv" 28#define DRIVER_DEVICE "batman-adv"
29 29
30#ifndef SOURCE_VERSION 30#ifndef SOURCE_VERSION
31#define SOURCE_VERSION "2012.0.0" 31#define SOURCE_VERSION "2012.1.0"
32#endif 32#endif
33 33
34/* B.A.T.M.A.N. parameters */ 34/* B.A.T.M.A.N. parameters */
@@ -41,13 +41,14 @@
41 41
42/* purge originators after time in seconds if no valid packet comes in 42/* purge originators after time in seconds if no valid packet comes in
43 * -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */ 43 * -> TODO: check influence on TQ_LOCAL_WINDOW_SIZE */
44#define PURGE_TIMEOUT 200 44#define PURGE_TIMEOUT 200000 /* 200 seconds */
45#define TT_LOCAL_TIMEOUT 3600 /* in seconds */ 45#define TT_LOCAL_TIMEOUT 3600000 /* in miliseconds */
46#define TT_CLIENT_ROAM_TIMEOUT 600 46#define TT_CLIENT_ROAM_TIMEOUT 600000 /* in miliseconds */
47/* sliding packet range of received originator messages in sequence numbers 47/* sliding packet range of received originator messages in sequence numbers
48 * (should be a multiple of our word size) */ 48 * (should be a multiple of our word size) */
49#define TQ_LOCAL_WINDOW_SIZE 64 49#define TQ_LOCAL_WINDOW_SIZE 64
50#define TT_REQUEST_TIMEOUT 3 /* seconds we have to keep pending tt_req */ 50#define TT_REQUEST_TIMEOUT 3000 /* miliseconds we have to keep
51 * pending tt_req */
51 52
52#define TQ_GLOBAL_WINDOW_SIZE 5 53#define TQ_GLOBAL_WINDOW_SIZE 5
53#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1 54#define TQ_LOCAL_BIDRECT_SEND_MINIMUM 1
@@ -56,8 +57,8 @@
56 57
57#define TT_OGM_APPEND_MAX 3 /* number of OGMs sent with the last tt diff */ 58#define TT_OGM_APPEND_MAX 3 /* number of OGMs sent with the last tt diff */
58 59
59#define ROAMING_MAX_TIME 20 /* Time in which a client can roam at most 60#define ROAMING_MAX_TIME 20000 /* Time in which a client can roam at most
60 * ROAMING_MAX_COUNT times */ 61 * ROAMING_MAX_COUNT times in miliseconds*/
61#define ROAMING_MAX_COUNT 5 62#define ROAMING_MAX_COUNT 5
62 63
63#define NO_FLAGS 0 64#define NO_FLAGS 0
@@ -106,9 +107,7 @@ enum uev_type {
106 107
107#define GW_THRESHOLD 50 108#define GW_THRESHOLD 50
108 109
109/* 110/* Debug Messages */
110 * Debug Messages
111 */
112#ifdef pr_fmt 111#ifdef pr_fmt
113#undef pr_fmt 112#undef pr_fmt
114#endif 113#endif
@@ -123,14 +122,7 @@ enum dbg_level {
123 DBG_ALL = 7 122 DBG_ALL = 7
124}; 123};
125 124
126 125/* Kernel headers */
127/*
128 * Vis
129 */
130
131/*
132 * Kernel headers
133 */
134 126
135#include <linux/mutex.h> /* mutex */ 127#include <linux/mutex.h> /* mutex */
136#include <linux/module.h> /* needed by all modules */ 128#include <linux/module.h> /* needed by all modules */
@@ -147,6 +139,7 @@ enum dbg_level {
147#include <linux/seq_file.h> 139#include <linux/seq_file.h>
148#include "types.h" 140#include "types.h"
149 141
142extern char bat_routing_algo[];
150extern struct list_head hardif_list; 143extern struct list_head hardif_list;
151 144
152extern unsigned char broadcast_addr[]; 145extern unsigned char broadcast_addr[];
@@ -157,6 +150,9 @@ void mesh_free(struct net_device *soft_iface);
157void inc_module_count(void); 150void inc_module_count(void);
158void dec_module_count(void); 151void dec_module_count(void);
159int is_my_mac(const uint8_t *addr); 152int is_my_mac(const uint8_t *addr);
153int bat_algo_register(struct bat_algo_ops *bat_algo_ops);
154int bat_algo_select(struct bat_priv *bat_priv, char *name);
155int bat_algo_seq_print_text(struct seq_file *seq, void *offset);
160 156
161#ifdef CONFIG_BATMAN_ADV_DEBUG 157#ifdef CONFIG_BATMAN_ADV_DEBUG
162int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) __printf(2, 3); 158int debug_log(struct bat_priv *bat_priv, const char *fmt, ...) __printf(2, 3);
@@ -202,6 +198,17 @@ static inline int compare_eth(const void *data1, const void *data2)
202 return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0); 198 return (memcmp(data1, data2, ETH_ALEN) == 0 ? 1 : 0);
203} 199}
204 200
201/**
202 * has_timed_out - compares current time (jiffies) and timestamp + timeout
203 * @timestamp: base value to compare with (in jiffies)
204 * @timeout: added to base value before comparing (in milliseconds)
205 *
206 * Returns true if current time is after timestamp + timeout
207 */
208static inline bool has_timed_out(unsigned long timestamp, unsigned int timeout)
209{
210 return time_is_before_jiffies(timestamp + msecs_to_jiffies(timeout));
211}
205 212
206#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0) 213#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
207 214