Staging: batman-adv: Update copyright years
[pandora-kernel.git] / drivers / staging / batman-adv / main.h
index facb6b7..c943e89 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2009 B.A.T.M.A.N. contributors:
+ * Copyright (C) 2007-2010 B.A.T.M.A.N. contributors:
  *
  * Marek Lindner, Simon Wunderlich
  *
 
 #define TQ_MAX_VALUE 255
 #define JITTER 20
-#define TTL 50                   /* Time To Live of broadcast messages */
-#define MAX_ADDR 16              /* number of interfaces which can be added to
+#define TTL 50                   /* Time To Live of broadcast messages */
+#define MAX_ADDR 16              /* number of interfaces which can be added to
                                   * batman. */
 
-#define PURGE_TIMEOUT 200000      /* purge originators after time in ms if no
+#define PURGE_TIMEOUT 200000     /* purge originators after time in ms if no
                                   * valid packet comes in -> TODO: check
                                   * influence on TQ_LOCAL_WINDOW_SIZE */
 #define LOCAL_HNA_TIMEOUT 3600000
 
-#define TQ_LOCAL_WINDOW_SIZE 64   /* sliding packet range of received originator
+#define TQ_LOCAL_WINDOW_SIZE 64          /* sliding packet range of received originator
                                   * messages in squence numbers (should be a
                                   * multiple of our word size) */
 #define TQ_GLOBAL_WINDOW_SIZE 5
 
 
 /*
- * Logging
+ * Debug Messages
  */
 
-#define LOG_TYPE_CRIT 0                /* highest priority for fatal errors such as
-                                * blocked sockets / failed packet delivery /
-                                * programming errors */
-#define LOG_TYPE_WARN 1                /* warnings for small errors like wrong user
-                                * input / damaged packets / etc */
-#define LOG_TYPE_NOTICE 2      /* notice information for new interfaces /
-                                * changed settings / new originators / etc */
-#define LOG_TYPE_BATMAN 4      /* all messages related to routing / flooding /
-                                * broadcasting / etc */
-#define LOG_TYPE_ROUTES 8      /* route or hna added / changed / deleted */
-#define LOG_TYPE_CRIT_NAME     "critical"
-#define LOG_TYPE_WARN_NAME     "warnings"
-#define LOG_TYPE_NOTICE_NAME   "notices"
-#define LOG_TYPE_BATMAN_NAME   "batman"
-#define LOG_TYPE_ROUTES_NAME   "routes"
+#define DBG_BATMAN 1   /* all messages related to routing / flooding /
+                        * broadcasting / etc */
+#define DBG_ROUTES 2   /* route or hna added / changed / deleted */
+
+#ifdef CONFIG_BATMAN_ADV_DEBUG
+extern int debug;
+
+extern int bat_debug_type(int type);
+#define bat_dbg(type, fmt, arg...) do {                                        \
+               if (bat_debug_type(type))                               \
+                       printk(KERN_DEBUG "batman-adv:" fmt, ## arg);   \
+       }                                                               \
+       while (0)
+#else /* !CONFIG_BATMAN_ADV_DEBUG */
+#define bat_dbg(type, fmt, arg...) do {                \
+       }                                       \
+       while (0)
+#endif
 
 /*
  *  Vis
 #include <linux/kthread.h>     /* kernel threads */
 #include <linux/pkt_sched.h>   /* schedule types */
 #include <linux/workqueue.h>   /* workqueue */
+#include <linux/slab.h>
 #include <net/sock.h>          /* struct sock */
 #include <linux/jiffies.h>
 #include "types.h"
@@ -127,6 +131,7 @@ extern spinlock_t forw_bcast_list_lock;
 
 extern atomic_t originator_interval;
 extern atomic_t vis_interval;
+extern atomic_t vis_mode;
 extern atomic_t aggregation_enabled;
 extern int16_t num_hna;
 extern int16_t num_ifs;
@@ -147,5 +152,3 @@ int choose_orig(void *data, int32_t size);
 int is_my_mac(uint8_t *addr);
 int is_bcast(uint8_t *addr);
 int is_mcast(uint8_t *addr);
-
-