+#define DRV_VERSION "0.18"
+#define DRV_RELDATE "13Jun2008"
+
+/* define bits of a debug mask */
+#define DBG_PHY (1<< 0) /*!< show PHY read/write */
+#define DBG_FREE_BUFS (1<< 1) /*!< show calls to r6040_free_*bufs */
+#define DBG_RING (1<< 2) /*!< debug init./freeing of descr rings */
+#define DBG_RX_BUF (1<< 3) /*!< show alloc. of new rx buf (in IRQ context !) */
+#define DBG_TX_BUF (1<< 4) /*!< show arrival of new tx buf */
+#define DBG_RX_IRQ (1<< 5) /*!< show RX IRQ handling */
+#define DBG_TX_IRQ (1<< 6) /*!< debug TX done IRQ */
+#define DBG_RX_DESCR (1<< 7) /*!< debug rx descr to be processed */
+#define DBG_RX_DATA (1<< 8) /*!< show some user data of incoming packet */
+#define DBG_EXIT (1<< 9) /*!< show exit code calls */
+#define DBG_INIT (1<<10) /*!< show init. code calls */
+#define DBG_TX_RING_DUMP (1<<11) /*!< dump the tx ring after creation */
+#define DBG_RX_RING_DUMP (1<<12) /*!< dump the rx ring after creation */
+#define DBG_TX_DESCR (1<<13) /*!< dump the setting of a descr for tx */
+#define DBG_TX_DATA (1<<14) /*!< dump some tx data */
+#define DBG_IRQ (1<<15) /*!< print inside the irq handler */
+#define DBG_POLL (1<<16) /*!< dump info on poll procedure */
+#define DBG_MAC_ADDR (1<<17) /*!< debug mac address setting */
+#define DBG_OPEN (1<<18) /*!< debug open proc. */
+
+static int debug = 0;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "debug mask (-1 for all)");
+
+/* define wcd hich debugs are left in the code during compilation */
+#define DEBUG (-1) /* all debugs */
+
+#define dbg(l, f, ...) \
+ do { \
+ if ((DEBUG & l) && (debug & l)) { \
+ printk(KERN_INFO DRV_NAME " %s: " f, __FUNCTION__, ## __VA_ARGS__); \
+ } \
+ } while (0)
+
+#define err(f, ...) printk(KERN_WARNING DRV_NAME " %s: " f, __FUNCTION__, ## __VA_ARGS__)