Don't redefine netdev_for_each_mc_addr()
[madwifi/.git] / include / compat.h
index 27d92ee87474d4d837187e83df014f8a54f4140f..c29f57ab279caf37aa842f94e7bc818a9aaa763a 100644 (file)
 #define NETDEV_TX_BUSY  1
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
+#ifndef netdev_for_each_mc_addr
+#define netdev_for_each_mc_addr(mclist, dev) \
+       for (mclist = (dev)->mc_list; mclist; mclist = mclist->next)
+#endif
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
+#define ath_netdev_hw_addr dev_mc_list
+#define ath_ha_addr(ha) ha->dmi_addr
+#else
+#define ath_netdev_hw_addr netdev_hw_addr
+#define ath_ha_addr(ha) ha->addr
+#endif
+
 /*
  * BSD/Linux compatibility shims.  These are used mainly to
- * minimize differences when importing necesary BSD code.
+ * minimize differences when importing necessary BSD code.
  */
 #define        NBBY    8                       /* number of bits/byte */
 
@@ -175,7 +190,9 @@ typedef unsigned long resource_size_t;
 #define IRQF_SHARED SA_SHIRQ
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,27)) || \
+    ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)) && \
+     ((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,3))))
 #define netdev_priv(_netdev) ((_netdev)->priv)
 #endif