From: Luis R. Rodriguez Date: Fri, 7 Aug 2009 23:33:33 +0000 (-0700) Subject: Some compilation fixes for 2.6.24 and 2.6.25 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=05a2f00dfe365e58772321a361a3da2c3220ed9d;p=openwrt%2Fstaging%2Fblogic.git Some compilation fixes for 2.6.24 and 2.6.25 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 --- diff --git a/compat/compat-2.6.25.c b/compat/compat-2.6.25.c index bf13eb143b90..e39971a558f1 100644 --- a/compat/compat-2.6.25.c +++ b/compat/compat-2.6.25.c @@ -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) */ diff --git a/compat/compat-2.6.25.h b/compat/compat-2.6.25.h index 4643bf1a0434..892a084ee5f7 100644 --- a/compat/compat-2.6.25.h +++ b/compat/compat-2.6.25.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #define __WARN(foo) dump_stack() @@ -25,6 +25,11 @@ #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 diff --git a/compat/compat-2.6.26.h b/compat/compat-2.6.26.h index 1bf82353f5af..fd4716a01a7f 100644 --- a/compat/compat-2.6.26.h +++ b/compat/compat-2.6.26.h @@ -11,6 +11,7 @@ #include #include #include +#include #include /* These jiffie helpers added as of 2.6.26 */