Some compilation fixes for 2.6.24 and 2.6.25
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Fri, 7 Aug 2009 23:33:33 +0000 (16:33 -0700)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Fri, 7 Aug 2009 23:33:33 +0000 (16:33 -0700)
2.6.24 is still left disabled, we need to figure out a way to deal with
this still:

  CC      /home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.o
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c: In function ‘wireless_dev_seq_start’:
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:678: warning: statement with no effect
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:679: warning: ISO C90 forbids mixed declarations and code
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c: In function ‘wireless_dev_seq_next’:
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:695: warning: statement with no effect
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c: In function ‘seq_open_wireless’:
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:717: error: implicit declaration of function ‘seq_open_net’
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:718: error: invalid application of ‘sizeof’ to incomplete type ‘struct seq_net_private’
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c: At top level:
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:726: error: ‘seq_release_net’ undeclared here (not in a function)
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c: In function ‘wireless_nlevent_process’:
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:1339: warning: passing argument 2 of ‘rtnl_notify’ makes integer from pointer without a cast
include/linux/rtnetlink.h:618: note: expected ‘u32’ but argument is of type ‘struct net *’
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:1339: warning: passing argument 4 of ‘rtnl_notify’ makes pointer from integer without a cast
include/linux/rtnetlink.h:618: note: expected ‘struct nlmsghdr *’ but argument is of type ‘int’
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:1339: warning: passing argument 5 of ‘rtnl_notify’ makes integer from pointer without a cast
include/linux/rtnetlink.h:618: note: expected ‘gfp_t’ but argument is of type ‘void *’
/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.c:1339: error: too many arguments to function ‘rtnl_notify’
make[3]: *** [/home/mcgrof/devel/compat-wireless-2.6/net/wireless/wext.o] Error 1
make[2]: *** [/home/mcgrof/devel/compat-wireless-2.6/net/wireless] Error 2
make[1]: *** [_module_/home/mcgrof/devel/compat-wireless-2.6] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-24-generic'

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
compat/compat-2.6.25.c
compat/compat-2.6.25.h
compat/compat-2.6.26.h

index bf13eb143b904861b138f70e21926cde59f1b1d5..e39971a558f1b7290834ff61ae6b2c4c7fafd2af 100644 (file)
@@ -326,5 +326,53 @@ define_strict_strtox(l, long)
 EXPORT_SYMBOL(strict_strtoul);
 EXPORT_SYMBOL(strict_strtol);
 
+int __dev_addr_sync(struct dev_addr_list **to, int *to_count,
+                   struct dev_addr_list **from, int *from_count)
+{
+       struct dev_addr_list *da, *next;
+       int err = 0;
+
+       da = *from;
+       while (da != NULL) {
+               next = da->next;
+               if (!da->da_synced) {
+                       err = __dev_addr_add(to, to_count,
+                                            da->da_addr, da->da_addrlen, 0);
+                       if (err < 0)
+                               break;
+                       da->da_synced = 1;
+                       da->da_users++;
+               } else if (da->da_users == 1) {
+                       __dev_addr_delete(to, to_count,
+                                         da->da_addr, da->da_addrlen, 0);
+                       __dev_addr_delete(from, from_count,
+                                         da->da_addr, da->da_addrlen, 0);
+               }
+               da = next;
+       }
+       return err;
+}
+EXPORT_SYMBOL_GPL(__dev_addr_sync);
+
+void __dev_addr_unsync(struct dev_addr_list **to, int *to_count,
+                      struct dev_addr_list **from, int *from_count)
+{
+       struct dev_addr_list *da, *next;
+
+       da = *from;
+       while (da != NULL) {
+               next = da->next;
+               if (da->da_synced) {
+                       __dev_addr_delete(to, to_count,
+                                         da->da_addr, da->da_addrlen, 0);
+                       da->da_synced = 0;
+                       __dev_addr_delete(from, from_count,
+                                         da->da_addr, da->da_addrlen, 0);
+               }
+               da = next;
+       }
+}
+EXPORT_SYMBOL_GPL(__dev_addr_unsync);
+
 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25) */
 
index 4643bf1a0434f38338958a3dd0ff56f47fc5f822..892a084ee5f735b6b24813ef96332c9bd4907b02 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/hw_random.h>
 #include <linux/leds.h>
 #include <linux/kernel.h>
-#include <linux/device.h>
+#include <linux/netdevice.h>
 #include <asm-generic/bug.h>
 
 #define __WARN(foo) dump_stack()
 #define dev_crit(dev, format, arg...)           \
        dev_printk(KERN_CRIT , dev , format , ## arg)
 
+extern int             __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
+extern void            __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
+
+#define seq_file_net &init_net;
+
 /* The patch:
  * commit 8b5f6883683c91ad7e1af32b7ceeb604d68e2865
  * Author: Marcin Slusarz <marcin.slusarz@gmail.com>
index 1bf82353f5afdf555f85c8b26cc2f7e7853f42cf..fd4716a01a7f59d706b708130b64fc007aa9313f 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/list.h>
 #include <linux/kernel.h>
 #include <linux/jiffies.h>
+#include <net/sock.h>
 #include <net/net_namespace.h>
 
 /* These jiffie helpers added as of 2.6.26 */