summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
Diffstat (limited to 'target')
-rw-r--r--target/linux/realtek/patches-2.6.30/add-FRA_OIFNAME.patch124
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-arch-compile.patch83
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-igmp_delete-compile.patch14
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-procd-syslog-compile.patch11
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_asicL2-compile.patch20
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_fdb-compile.patch162
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_igmpsnooping_new-compile.patch345
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_ip-compile.patch19
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_multicast-compile.patch18
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_netif-compile.patch92
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_ppp-compile.patch68
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl865x_proc_debug-compile.patch17
-rw-r--r--target/linux/realtek/patches-2.6.30/fix-rtl_nic-compile.patch312
13 files changed, 1285 insertions, 0 deletions
diff --git a/target/linux/realtek/patches-2.6.30/add-FRA_OIFNAME.patch b/target/linux/realtek/patches-2.6.30/add-FRA_OIFNAME.patch
new file mode 100644
index 000000000..b8c9bd7a2
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/add-FRA_OIFNAME.patch
@@ -0,0 +1,124 @@
+--- linux-2.6.30.9/include/net/fib_rules.h 2009-10-05 18:38:08.000000000 +0300
++++ linux-2.6.30.9/include/net/fib_rules.h 2013-05-31 14:04:41.401861594 +0300
+@@ -12,7 +12,9 @@
+ struct list_head list;
+ atomic_t refcnt;
+ int ifindex;
++ int oifindex;
+ char ifname[IFNAMSIZ];
++ char oifname[IFNAMSIZ];
+ u32 mark;
+ u32 mark_mask;
+ u32 pref;
+@@ -73,6 +75,7 @@
+
+ #define FRA_GENERIC_POLICY \
+ [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
++ [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \
+ [FRA_PRIORITY] = { .type = NLA_U32 }, \
+ [FRA_FWMARK] = { .type = NLA_U32 }, \
+ [FRA_FWMASK] = { .type = NLA_U32 }, \
+--- linux-2.6.30.9/include/linux/fib_rules.h 2013-05-31 14:06:48.877864725 +0300
++++ linux-2.6.30.9/include/linux/fib_rules.h 2013-05-31 14:09:10.837868214 +0300
+@@ -9,6 +9,7 @@
+ #define FIB_RULE_INVERT 0x00000002
+ #define FIB_RULE_UNRESOLVED 0x00000004
+ #define FIB_RULE_DEV_DETACHED 0x00000008
++#define FIB_RULE_OIF_DETACHED 0x00000010
+
+ /* try to find source address in routing lookups */
+ #define FIB_RULE_FIND_SADDR 0x00010000
+@@ -47,6 +48,7 @@
+ FRA_UNUSED8,
+ FRA_TABLE, /* Extended table id */
+ FRA_FWMASK, /* mask for netfilter mark */
++ FRA_OIFNAME,
+ __FRA_MAX
+ };
+
+--- linux-2.6.30.9/net/core/fib_rules.c 2009-10-05 18:38:08.000000000 +0300
++++ linux-2.6.30.9/net/core/fib_rules.c 2013-05-31 14:35:01.125906310 +0300
+@@ -138,6 +138,9 @@
+ if (rule->ifindex && (rule->ifindex != fl->iif))
+ goto out;
+
++ if (rule->oifindex && (rule->oifindex != fl->oif))
++ goto out;
++
+ if ((rule->mark ^ fl->mark) & rule->mark_mask)
+ goto out;
+
+@@ -258,6 +261,16 @@
+ rule->ifindex = dev->ifindex;
+ }
+
++ if (tb[FRA_OIFNAME]) {
++ struct net_device *dev;
++
++ rule->oifindex = -1;
++ nla_strlcpy(rule->oifname, tb[FRA_OIFNAME], IFNAMSIZ);
++ dev = __dev_get_by_name(net, rule->oifname);
++ if (dev)
++ rule->oifindex = dev->ifindex;
++ }
++
+ if (tb[FRA_FWMARK]) {
+ rule->mark = nla_get_u32(tb[FRA_FWMARK]);
+ if (rule->mark)
+@@ -392,6 +405,10 @@
+ nla_strcmp(tb[FRA_IFNAME], rule->ifname))
+ continue;
+
++ if (tb[FRA_OIFNAME] &&
++ nla_strcmp(tb[FRA_OIFNAME], rule->oifname))
++ continue;
++
+ if (tb[FRA_FWMARK] &&
+ (rule->mark != nla_get_u32(tb[FRA_FWMARK])))
+ continue;
+@@ -448,6 +465,7 @@
+ {
+ size_t payload = NLMSG_ALIGN(sizeof(struct fib_rule_hdr))
+ + nla_total_size(IFNAMSIZ) /* FRA_IFNAME */
++ + nla_total_size(IFNAMSIZ) /* FRA_OIFNAME */
+ + nla_total_size(4) /* FRA_PRIORITY */
+ + nla_total_size(4) /* FRA_TABLE */
+ + nla_total_size(4) /* FRA_FWMARK */
+@@ -488,6 +506,13 @@
+ frh->flags |= FIB_RULE_DEV_DETACHED;
+ }
+
++ if (rule->oifname[0]) {
++ NLA_PUT_STRING(skb, FRA_OIFNAME, rule->oifname);
++
++ if (rule->oifindex == -1)
++ frh->flags |= FIB_RULE_OIF_DETACHED;
++ }
++
+ if (rule->pref)
+ NLA_PUT_U32(skb, FRA_PRIORITY, rule->pref);
+
+@@ -603,6 +628,9 @@
+ if (rule->ifindex == -1 &&
+ strcmp(dev->name, rule->ifname) == 0)
+ rule->ifindex = dev->ifindex;
++ if (rule->oifindex == -1 &&
++ strcmp(dev->name, rule->oifname) == 0)
++ rule->oifindex = dev->ifindex;
+ }
+ }
+
+@@ -610,9 +638,12 @@
+ {
+ struct fib_rule *rule;
+
+- list_for_each_entry(rule, rules, list)
++ list_for_each_entry(rule, rules, list) {
+ if (rule->ifindex == dev->ifindex)
+ rule->ifindex = -1;
++ if (rule->oifindex == dev->ifindex)
++ rule->oifindex = -1;
++ }
+ }
+
+
diff --git a/target/linux/realtek/patches-2.6.30/fix-arch-compile.patch b/target/linux/realtek/patches-2.6.30/fix-arch-compile.patch
new file mode 100644
index 000000000..54837c4c2
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-arch-compile.patch
@@ -0,0 +1,83 @@
+--- a/include/linux/pagemap.h 2013-06-01 00:11:09.206755761 +0300
++++ b/include/linux/pagemap.h 2013-06-01 00:11:54.466756873 +0300
+@@ -421,8 +421,10 @@
+ const char __user *end = uaddr + size - 1;
+
+ if (((unsigned long)uaddr & PAGE_MASK) !=
+- ((unsigned long)end & PAGE_MASK))
+- ret = __get_user(c, end);
++ ((unsigned long)end & PAGE_MASK)) {
++ ret = __get_user(c, end);
++ (void)c;
++ }
+ }
+ return ret;
+ }
+--- a/arch/rlx/mm/init.c 2013-05-31 23:48:35.526722498 +0300
++++ b/arch/rlx/mm/init.c 2013-05-31 23:48:49.186722833 +0300
+@@ -222,7 +222,6 @@
+ void __init paging_init(void)
+ {
+ unsigned long max_zone_pfns[MAX_NR_ZONES];
+- unsigned long lastpfn;
+
+ pagetable_init();
+
+@@ -238,10 +237,8 @@
+ max_zone_pfns[ZONE_DMA32] = MAX_DMA32_PFN;
+ #endif
+ max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
+- lastpfn = max_low_pfn;
+ #ifdef CONFIG_HIGHMEM
+ max_zone_pfns[ZONE_HIGHMEM] = highend_pfn;
+- lastpfn = highend_pfn;
+ #endif
+
+ free_area_init_nodes(max_zone_pfns);
+--- a/arch/rlx/mm/page-rlx.c 2013-06-01 00:23:35.690774104 +0300
++++ b/arch/rlx/mm/page-rlx.c 2013-06-01 00:26:41.074778659 +0300
+@@ -222,7 +222,7 @@
+
+ void __cpuinit build_clear_page(void)
+ {
+- unsigned int loop_start;
++ //unsigned int loop_start;
+ unsigned long off;
+
+ epc = (unsigned int *) &clear_page_array;
+@@ -241,7 +241,7 @@
+ //} while (store_offset < half_scache_line_size());
+
+ build_addiu_a0(2 * store_offset);
+- loop_start = store_offset;
++ //loop_start = store_offset;
+ //do {
+ build_store_reg(0);
+ build_store_reg(0);
+@@ -257,7 +257,7 @@
+
+ void __cpuinit build_copy_page(void)
+ {
+- unsigned int loop_start;
++ //unsigned int loop_start;
+
+ epc = (unsigned int *) &copy_page_array;
+ store_offset = load_offset = 0;
+@@ -266,7 +266,7 @@
+ build_addiu_a2_a0(PAGE_SIZE);
+
+ dest = label();
+- loop_start = store_offset;
++ //loop_start = store_offset;
+ //do {
+ build_load_reg( 8);
+ build_load_reg( 9);
+@@ -280,7 +280,7 @@
+
+ build_addiu_a0(2 * store_offset);
+ build_addiu_a1(2 * load_offset);
+- loop_start = store_offset;
++ //loop_start = store_offset;
+ //do {
+ build_load_reg( 8);
+ build_load_reg( 9);
diff --git a/target/linux/realtek/patches-2.6.30/fix-igmp_delete-compile.patch b/target/linux/realtek/patches-2.6.30/fix-igmp_delete-compile.patch
new file mode 100644
index 000000000..e667ff3cb
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-igmp_delete-compile.patch
@@ -0,0 +1,14 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/igmpsnooping/igmp_delete.c.old 2013-06-02 12:20:02.625953564 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/igmpsnooping/igmp_delete.c 2013-06-02 12:20:50.517954741 +0300
+@@ -93,11 +93,9 @@
+ int pid;
+ struct test_struct send_data,recv_data;
+ uint8 mac[6];
+- char *ptr;
+ pid=rtk_nlrecvmsg(__skb,sizeof(struct test_struct),&recv_data);
+ //printk("igmp_delete data:%s\n", recv_data.data);
+ memset(mac, 0, 6);
+- ptr = recv_data.data;
+ if(try_mac(recv_data.data, mac, 6, ':'))
+ {
+ rtl_delIgmpRecordByMacAddr(mac);
diff --git a/target/linux/realtek/patches-2.6.30/fix-procd-syslog-compile.patch b/target/linux/realtek/patches-2.6.30/fix-procd-syslog-compile.patch
new file mode 100644
index 000000000..40d22b5f0
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-procd-syslog-compile.patch
@@ -0,0 +1,11 @@
+--- linux-2.6.30.9/include/linux/un.h 2013-06-01 19:20:42.748450665 +0300
++++ linux-2.6.30.9/include/linux/un.h 2013-06-01 19:19:48.692449336 +0300
+@@ -2,7 +2,7 @@
+ #define _LINUX_UN_H
+
+ #define UNIX_PATH_MAX 108
+-
++typedef unsigned short sa_family_t;
+ struct sockaddr_un {
+ sa_family_t sun_family; /* AF_UNIX */
+ char sun_path[UNIX_PATH_MAX]; /* pathname */
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_asicL2-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_asicL2-compile.patch
new file mode 100644
index 000000000..b666fd851
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_asicL2-compile.patch
@@ -0,0 +1,20 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/AsicDriver/rtl865x_asicL2.c.old 2013-06-02 11:38:30.489892324 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/AsicDriver/rtl865x_asicL2.c 2013-06-02 11:37:36.665891001 +0300
+@@ -7807,7 +7807,7 @@
+
+ int32 rtl8651_setAsicEthernetLinkStatus(uint32 port, int8 linkUp)
+ {
+- int8 notify;
++// int8 notify;
+ // uint32 portmask;
+
+ if (port >= (RTL8651_PORT_NUMBER+rtl8651_totalExtPortNum))
+@@ -7815,7 +7815,7 @@
+ return FAILED;
+ }
+
+- notify = (rtl8651AsicEthernetTable[port].linkUp != ((linkUp==TRUE)? TRUE: FALSE))?TRUE:FALSE;
++// notify = (rtl8651AsicEthernetTable[port].linkUp != ((linkUp==TRUE)? TRUE: FALSE))?TRUE:FALSE;
+
+
+ rtl8651AsicEthernetTable[port].linkUp = (linkUp == TRUE)? TRUE: FALSE;
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_fdb-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_fdb-compile.patch
new file mode 100644
index 000000000..8c5eb7dcc
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_fdb-compile.patch
@@ -0,0 +1,162 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/l2Driver/rtl865x_fdb.c.old 2013-06-02 12:25:12.749961183 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/l2Driver/rtl865x_fdb.c 2013-06-02 12:54:35.246004494 +0300
+@@ -86,20 +86,18 @@
+ int32 _rtl865x_layer2_patch(void)
+ {
+
+- int32 retval = 0;
+ ether_addr_t mac = { {0xff, 0xff, 0xff, 0xff, 0xff, 0xff} };
+ uint32 portmask=RTL_WANPORT_MASK|RTL_LANPORT_MASK;
+
+- retval = _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_LAN_FID, &mac, FDB_TYPE_TRAPCPU, portmask, TRUE, FALSE);
++ _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_LAN_FID, &mac, FDB_TYPE_TRAPCPU, portmask, TRUE, FALSE);
+ #if defined (CONFIG_RTL_IVL_SUPPORT)
+- retval = _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_WAN_FID, &mac, FDB_TYPE_TRAPCPU, portmask, TRUE, FALSE);
++ _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_WAN_FID, &mac, FDB_TYPE_TRAPCPU, portmask, TRUE, FALSE);
+ #endif
+
+- retval = _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_LAN_FID, &cpu_mac, FDB_TYPE_TRAPCPU, 0, TRUE, FALSE);
++ _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_LAN_FID, &cpu_mac, FDB_TYPE_TRAPCPU, 0, TRUE, FALSE);
+ #if defined (CONFIG_RTL_IVL_SUPPORT)
+- retval = _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_WAN_FID, &cpu_mac, FDB_TYPE_TRAPCPU, 0, TRUE, FALSE);
++ _rtl865x_addFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_WAN_FID, &cpu_mac, FDB_TYPE_TRAPCPU, 0, TRUE, FALSE);
+ #endif
+- assert(retval == SUCCESS);
+
+ return SUCCESS;
+ }
+@@ -197,7 +195,7 @@
+ {
+
+ rtl865x_tblAsicDrv_l2Param_t L2temp, *L2buff;
+- uint32 rowIdx, col_num;
++ uint32 rowIdx;
+ uint32 colIdx = 0;
+ uint32 found = FALSE;
+
+@@ -213,7 +211,6 @@
+ if (((flags&FDB_STATIC) && L2buff->isStatic) ||
+ ((flags&FDB_DYNAMIC) && !L2buff->isStatic)) {
+ assert(colIdx);
+- col_num = colIdx;
+ found = TRUE;
+ break;
+ }
+@@ -478,7 +475,6 @@
+ {
+ uint32 rowIdx = 0;
+ uint32 colIdx = 0;
+- uint32 col_num = 0;
+ uint32 col_tmp = 0;
+ uint16 tmp_age = 0xffff;
+ int32 found = FALSE;
+@@ -522,7 +518,6 @@
+ if (tmp_age> L2buff->ageSec)
+ {
+ tmp_age = L2buff->ageSec;
+- col_num = colIdx;
+ }
+ }
+ else
+@@ -840,11 +835,10 @@
+ ether_addr_t *macAddr;
+ int32 column;
+ rtl865x_tblAsicDrv_l2Param_t fdbEntry;
+- rtl865x_filterDbTableEntry_t l2temp_entry;
+- int32 rowIdx;
+-
++ rtl865x_filterDbTableEntry_t l2temp_entry;
++
+ macAddr = (ether_addr_t *)(timeout_addr);
+- rowIdx = rtl8651_filterDbIndex(macAddr, RTL_LAN_FID);
++// int32 rowIdx = rtl8651_filterDbIndex(macAddr, RTL_LAN_FID);
+ found = rtl865x_Lookup_fdb_entry(RTL_LAN_FID, macAddr, FDB_DYNAMIC, &column, &fdbEntry);
+ if (found != SUCCESS)
+ {
+@@ -878,39 +872,33 @@
+
+ void update_hw_l2table(const char *srcName,const unsigned char *addr)
+ {
+-
+- //int32 found = FAILED;
+ ether_addr_t *macAddr;
+- int32 ret = 0;
+ #if defined (CONFIG_RTL_LAYERED_DRIVER) && defined (CONFIG_RTL_LAYERED_DRIVER_L2)
+ int32 column;
+ rtl865x_tblAsicDrv_l2Param_t fdbEntry;
+ #endif
+ macAddr = (ether_addr_t *)(addr);
+-
++
+ if (memcmp(srcName, RTL_WLAN_NAME, 4) ==0)
+ {
+-
+ #if defined (CONFIG_RTL_LAYERED_DRIVER)
+ #if defined (CONFIG_RTL_LAYERED_DRIVER_L2)
+ if (rtl865x_Lookup_fdb_entry(RTL_LAN_FID, macAddr, FDB_DYNAMIC, &column,&fdbEntry) == SUCCESS)
+ #endif
+ #else
+- if (rtl8651_lookupL2table(0, macAddr, FDB_DYNAMIC) == SUCCESS)
+-#endif
++ if (rtl8651_lookupL2table(0, macAddr, FDB_DYNAMIC) == SUCCESS)
++#endif
+ {
+-
+ if((fdbEntry.memberPortMask & RTL8651_PHYSICALPORTMASK)!=0)
+ {
+ #if defined (CONFIG_RTL_LAYERED_DRIVER)
+ #if defined (CONFIG_RTL_LAYERED_DRIVER_L2)
+- ret = rtl865x_delFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_LAN_FID, macAddr);
++ rtl865x_delFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_LAN_FID, macAddr);
+ #endif
+ #else
+- ret = rtl8651_delFilterDatabaseEntry(0, macAddr);
++ rtl8651_delFilterDatabaseEntry(0, macAddr);
+ #endif
+ }
+-
+ }
+
+ #if defined (CONFIG_RTL_IVL_SUPPORT)
+@@ -921,22 +909,17 @@
+ #endif
+ #endif
+ {
+-
+ if((fdbEntry.memberPortMask & RTL8651_PHYSICALPORTMASK)!=0)
+ {
+ #if defined (CONFIG_RTL_LAYERED_DRIVER)
+ #if defined (CONFIG_RTL_LAYERED_DRIVER_L2)
+- ret = rtl865x_delFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_WAN_FID, macAddr);
++ rtl865x_delFilterDatabaseEntry(RTL865x_L2_TYPEII, RTL_WAN_FID, macAddr);
+ #endif
+ #endif
+ }
+-
+ }
+ #endif
+-
+ }
+-
+-
+ }
+
+
+@@ -945,7 +928,7 @@
+ int32 found = FAILED;
+ ether_addr_t *macAddr;
+ int32 ret=FAILED;
+- int8 port_num = -1;
++// int8 port_num = -1;
+ int32 column;
+ rtl865x_tblAsicDrv_l2Param_t fdbEntry;
+ rtl865x_filterDbTableEntry_t l2temp_entry;
+@@ -957,7 +940,7 @@
+ found = rtl865x_Lookup_fdb_entry(RTL_LAN_FID, macAddr, FDB_DYNAMIC, &column, &fdbEntry);
+ if (found == SUCCESS )
+ {
+- port_num = rtl865x_ConvertPortMasktoPortNum(fdbEntry.memberPortMask);
++// port_num = rtl865x_ConvertPortMasktoPortNum(fdbEntry.memberPortMask);
+ //printk("[%s][%d].\n", __FUNCTION__, __LINE__);
+ //printk("\nbefore rtl865x_lookup_FilterDatabaseEntry, port is %d\n", port_num);
+ if (rtl865x_lookup_FilterDatabaseEntry(fdbEntry.fid, macAddr, &l2temp_entry) != SUCCESS)
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_igmpsnooping_new-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_igmpsnooping_new-compile.patch
new file mode 100644
index 000000000..0e8c41cd2
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_igmpsnooping_new-compile.patch
@@ -0,0 +1,345 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/igmpsnooping/rtl865x_igmpsnooping_new.c.old 2013-06-02 11:54:33.537915989 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/igmpsnooping/rtl865x_igmpsnooping_new.c 2013-06-02 12:17:25.265949697 +0300
+@@ -2298,7 +2298,7 @@
+
+ uint8 optionDataLen=0;
+ uint8 optionType=0;
+- uint32 ipv6RAO=0;
++// uint32 ipv6RAO=0;
+ #endif
+
+ uint32 ipAddr[4]={0,0,0,0};
+@@ -2488,7 +2488,7 @@
+ /*router alter option*/
+ if(ntohl(*(uint32 *)(ptr))==IPV6_ROUTER_ALTER_OPTION)
+ {
+- ipv6RAO=IPV6_ROUTER_ALTER_OPTION;
++ //ipv6RAO=IPV6_ROUTER_ALTER_OPTION;
+ ptr=ptr+4;
+ continue;
+ }
+@@ -2767,8 +2767,8 @@
+ #endif
+ uint32 groupAddress[4]={0,0,0,0};
+ uint32 suppressFlag=0;
+- uint32 *sourceAddr=NULL;
+- uint32 numOfSrc=0;
++// uint32 *sourceAddr=NULL;
++// uint32 numOfSrc=0;
+
+
+ /*querier timer update and election process*/
+@@ -2780,8 +2780,8 @@
+ {
+ groupAddress[0]=ntohl(((struct igmpv3Query*)pktBuf)->groupAddr);
+ suppressFlag=((struct igmpv3Query*)pktBuf)->rsq & S_FLAG_MASK;
+- sourceAddr=&(((struct igmpv3Query*)pktBuf)->srcList);
+- numOfSrc=(uint32)ntohs(((struct igmpv3Query*)pktBuf)->numOfSrc);
++// sourceAddr=&(((struct igmpv3Query*)pktBuf)->srcList);
++// numOfSrc=(uint32)ntohs(((struct igmpv3Query*)pktBuf)->numOfSrc);
+
+ }
+ else
+@@ -2810,8 +2810,8 @@
+ groupAddress[3]=ntohl(((struct mldv2Query*)pktBuf)->mCastAddr[3]);
+
+ suppressFlag=((struct mldv2Query*)pktBuf)->rsq & S_FLAG_MASK;
+- sourceAddr=&(((struct mldv2Query*)pktBuf)->srcList);
+- numOfSrc=(uint32)ntohs(((struct mldv2Query*)pktBuf)->numOfSrc);
++// sourceAddr=&(((struct mldv2Query*)pktBuf)->srcList);
++// numOfSrc=(uint32)ntohs(((struct mldv2Query*)pktBuf)->numOfSrc);
+
+ }
+ else /*means mldv1 query*/
+@@ -2954,7 +2954,7 @@
+ struct rtl_clientEntry* clientEntry=NULL;
+ struct rtl_clientEntry* newClientEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ uint32 multicastRouterPortMask=rtl_getMulticastRouterPortMask(moduleIndex, ipVersion, rtl_sysUpSeconds);
+ uint32 allClientPortMask=0;
+
+@@ -2981,7 +2981,7 @@
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+ if(groupEntry==NULL) /*means new group address, create new group entry*/
+@@ -3104,7 +3104,7 @@
+ struct rtl_sourceEntry *sourceEntry=NULL;
+ struct rtl_sourceEntry *nextSourceEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ // uint32 multicastRouterPortMask=rtl_getMulticastRouterPortMask(moduleIndex, ipVersion, rtl_sysUpSeconds);
+
+ if(ipVersion==IP_VERSION4)
+@@ -3121,7 +3121,7 @@
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -3217,7 +3217,7 @@
+ struct rtl_clientEntry* newClientEntry=NULL;
+ struct rtl_sourceEntry *newSourceEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+
+ uint16 numOfSrc=0;
+ uint32 *sourceAddr=NULL;
+@@ -3242,7 +3242,7 @@
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -3401,16 +3401,16 @@
+ struct rtl_clientEntry* newClientEntry=NULL;
+ struct rtl_sourceEntry *newSourceEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ uint16 numOfSrc=0;
+- uint32 *sourceArray=NULL;
++// uint32 *sourceArray=NULL;
+ uint32 *sourceAddr=NULL;
+
+ if(ipVersion==IP_VERSION4)
+ {
+ groupAddress[0]=ntohl(((struct groupRecord *)pktBuf)->groupAddr);
+ numOfSrc=ntohs(((struct groupRecord *)pktBuf)->numOfSrc);
+- sourceArray=&(((struct groupRecord *)pktBuf)->srcList);
++// sourceArray=&(((struct groupRecord *)pktBuf)->srcList);
+ sourceAddr=&(((struct groupRecord *)pktBuf)->srcList);
+
+ }
+@@ -3424,12 +3424,12 @@
+ groupAddress[3]=ntohl(((struct mCastAddrRecord *)pktBuf)->mCastAddr[3]);
+
+ numOfSrc=ntohs(((struct mCastAddrRecord *)pktBuf)->numOfSrc);
+- sourceArray=&(((struct mCastAddrRecord *)pktBuf)->srcList);
++// sourceArray=&(((struct mCastAddrRecord *)pktBuf)->srcList);
+ sourceAddr=&(((struct mCastAddrRecord *)pktBuf)->srcList);
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm( ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm( ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -3594,7 +3594,7 @@
+ struct rtl_sourceEntry *nextSourceEntry=NULL;
+ struct rtl_sourceEntry *newSourceEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ uint16 numOfSrc=0;
+ uint32 *sourceAddr=NULL;
+
+@@ -3619,7 +3619,7 @@
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -3852,16 +3852,16 @@
+ struct rtl_clientEntry* newClientEntry=NULL;
+ struct rtl_sourceEntry *newSourceEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ uint16 numOfSrc=0;
+- uint32 *sourceArray=NULL;
++// uint32 *sourceArray=NULL;
+ uint32 *sourceAddr=NULL;
+
+ if(ipVersion==IP_VERSION4)
+ {
+ groupAddress[0]=ntohl(((struct groupRecord *)pktBuf)->groupAddr);
+ numOfSrc=ntohs(((struct groupRecord *)pktBuf)->numOfSrc);
+- sourceArray=&(((struct groupRecord *)pktBuf)->srcList);
++// sourceArray=&(((struct groupRecord *)pktBuf)->srcList);
+ sourceAddr=&(((struct groupRecord *)pktBuf)->srcList);
+ }
+ #ifdef CONFIG_RTL_MLD_SNOOPING
+@@ -3874,12 +3874,12 @@
+ groupAddress[3]=ntohl(((struct mCastAddrRecord *)pktBuf)->mCastAddr[3]);
+
+ numOfSrc=ntohs(((struct mCastAddrRecord *)pktBuf)->numOfSrc);
+- sourceArray=&(((struct mCastAddrRecord *)pktBuf)->srcList);
++// sourceArray=&(((struct mCastAddrRecord *)pktBuf)->srcList);
+ sourceAddr=&(((struct mCastAddrRecord *)pktBuf)->srcList);
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm(ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -4037,7 +4037,7 @@
+ struct rtl_sourceEntry *sourceEntry=NULL;
+ struct rtl_sourceEntry *newSourceEntry=NULL;
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ uint16 numOfSrc=0;
+ uint32 *sourceAddr=NULL;
+
+@@ -4062,7 +4062,7 @@
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm( ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm( ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -4236,7 +4236,7 @@
+ struct rtl_sourceEntry *newSourceEntry=NULL;
+
+
+- uint32 hashIndex=0;
++// uint32 hashIndex=0;
+ uint16 numOfSrc=0;
+ uint32 *sourceAddr=NULL;
+
+@@ -4261,7 +4261,7 @@
+ }
+ #endif
+
+- hashIndex=rtl_igmpHashAlgorithm( ipVersion, groupAddress);
++// hashIndex=rtl_igmpHashAlgorithm( ipVersion, groupAddress);
+
+ groupEntry=rtl_searchGroupEntry(moduleIndex, ipVersion, groupAddress);
+
+@@ -4427,7 +4427,6 @@
+ uint8 *groupRecords=NULL;
+ uint8 recordType=0xff;
+ uint16 numOfSrc=0;
+- int32 returnVal=0;
+ //uint32 multicastRouterPortMask=rtl_getMulticastRouterPortMask(moduleIndex, ipVersion, rtl_sysUpSeconds);
+
+ if(ipVersion==IP_VERSION4)
+@@ -4465,27 +4464,27 @@
+ switch(recordType)
+ {
+ case MODE_IS_INCLUDE:
+- returnVal=rtl_processIsInclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
++ rtl_processIsInclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
+ break;
+
+ case MODE_IS_EXCLUDE:
+- returnVal=rtl_processIsExclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
++ rtl_processIsExclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
+ break;
+
+ case CHANGE_TO_INCLUDE_MODE:
+- returnVal=rtl_processToInclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
++ rtl_processToInclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
+ break;
+
+ case CHANGE_TO_EXCLUDE_MODE:
+- returnVal=rtl_processToExclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
++ rtl_processToExclude(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
+ break;
+
+ case ALLOW_NEW_SOURCES:
+- returnVal=rtl_processAllow(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
++ rtl_processAllow(moduleIndex, ipVersion, portNum, clientAddr, groupRecords);
+ break;
+
+ case BLOCK_OLD_SOURCES:
+- returnVal=rtl_processBlock(moduleIndex, ipVersion, portNum, clientAddr ,groupRecords);
++ rtl_processBlock(moduleIndex, ipVersion, portNum, clientAddr ,groupRecords);
+ break;
+
+ default:break;
+@@ -6480,25 +6479,19 @@
+
+
+ int igmp_write(struct file *file, const char __user *buffer, size_t count, loff_t *data)
+-
+ {
+-#if defined (CONFIG_STATIC_RESERVED_MULTICAST)
++#if defined (CONFIG_STATIC_RESERVED_MULTICAST)
+ char tmp[256];
+-
+- char *strptr, *cmd_addr;
+- char *tokptr;
++ char *strptr, *cmd_addr;
++ char *tokptr;
+ uint32 allModuleFlag=FALSE;
+ uint32 moduleIndex=0xFFFFFFFF;
+- uint32 ipAddr[4];
+- int cnt;
+-
++ uint32 ipAddr[4];
+ struct rtl_groupEntry groupEntry;
+
+-
+ if (count < 5)
+ return -EFAULT;
+
+-
+ if (buffer && !copy_from_user(tmp, buffer, count)) {
+
+ tmp[count] = '\0';
+@@ -6579,8 +6572,8 @@
+ goto errout;
+ }
+
+- cnt = sscanf(tokptr, "%d.%d.%d.%d", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
+-
++ sscanf(tokptr, "%d.%d.%d.%d", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
++
+ groupEntry.groupAddr[0]=(ipAddr[0]<<24)|(ipAddr[1]<<16)|(ipAddr[2]<<8)|(ipAddr[3]);
+ groupEntry.groupAddr[1]=0;
+ groupEntry.groupAddr[2]=0;
+@@ -6597,7 +6590,7 @@
+ goto errout;
+ }
+
+- cnt = sscanf(tokptr, "0x%x-%x-%x-%x", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
++ sscanf(tokptr, "0x%x-%x-%x-%x", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
+
+ groupEntry.groupAddr[0]=ipAddr[0];
+ groupEntry.groupAddr[1]=ipAddr[1];
+@@ -6697,8 +6690,8 @@
+ {
+ goto errout;
+ }
+- cnt = sscanf(tokptr, "%d.%d.%d.%d", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
+-
++ sscanf(tokptr, "%d.%d.%d.%d", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
++
+ groupEntry.groupAddr[0]=(ipAddr[0]<<24)|(ipAddr[1]<<16)|(ipAddr[2]<<8)|(ipAddr[3]);
+ groupEntry.groupAddr[1]=0;
+ groupEntry.groupAddr[2]=0;
+@@ -6714,8 +6707,8 @@
+ {
+ goto errout;
+ }
+- cnt = sscanf(tokptr, "0x%x-%x-%x-%x", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
+-
++ sscanf(tokptr, "0x%x-%x-%x-%x", &ipAddr[0], &ipAddr[1], &ipAddr[2], &ipAddr[3]);
++
+ groupEntry.groupAddr[0]=ipAddr[0];
+ groupEntry.groupAddr[1]=ipAddr[1];
+ groupEntry.groupAddr[2]=ipAddr[2];
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_ip-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_ip-compile.patch
new file mode 100644
index 000000000..f941d2f70
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_ip-compile.patch
@@ -0,0 +1,19 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/l3Driver/rtl865x_ip.c.old 2013-06-02 13:00:15.926012867 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/l3Driver/rtl865x_ip.c 2013-06-02 13:01:05.322014080 +0300
+@@ -80,7 +80,6 @@
+ int i;
+ rtl865x_ip_entry_t *entry = NULL;
+ rtl865x_tblAsicDrv_extIntIpParam_t asicIp;
+- int32 retval = FAILED;
+
+ if(ip_type < IP_TYPE_NAPT || ip_type > IP_TYPE_LOCALSERVER)
+ return RTL_EINVALIDINPUT;
+@@ -127,7 +126,7 @@
+ asicIp.nat = (ip_type == IP_TYPE_NAT)? TRUE: FALSE;
+ asicIp.nhIndex = 0;
+
+- retval = rtl8651_setAsicExtIntIpTable(IP_TABLE_INDEX(entry), &asicIp);
++ rtl8651_setAsicExtIntIpTable(IP_TABLE_INDEX(entry), &asicIp);
+
+ if(ip_type == IP_TYPE_NAPT)
+ rtl8651_setAsicOperationLayer(4);
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_multicast-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_multicast-compile.patch
new file mode 100644
index 000000000..9f8bd6b11
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_multicast-compile.patch
@@ -0,0 +1,18 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/l3Driver/rtl865x_multicast.c.old 2013-06-02 12:56:42.542007622 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/l3Driver/rtl865x_multicast.c 2013-06-02 12:58:23.494010104 +0300
+@@ -1691,7 +1691,6 @@
+ rtl865x_tblDrv_mCast_t *mCast_t, *nextMCast_t;
+ rtl865x_mcast_fwd_descriptor_t *curDesc,*nextDesc;
+ uint32 entry;
+- uint32 cnt;
+ printk("----------------------------------------------------\n");
+ printk("Asic Operation Layer :%d\n", rtl8651_getAsicOperationLayer());
+
+@@ -1775,7 +1774,6 @@
+ printk("\t extIP:0x%x,age:%d, cpu:%d, maxPPS:%d, inAsic:%d, (%s)\n",
+ mCast_t->extIp,mCast_t->age, mCast_t->cpu,mCast_t->maxPPS,mCast_t->inAsic,mCast_t->unKnownMCast?"UnknownMCast":"KnownMCast");
+
+- cnt=0;
+ curDesc=MC_LIST_FIRST(&mCast_t->fwdDescChain);
+ while(curDesc)
+ {
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_netif-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_netif-compile.patch
new file mode 100644
index 000000000..00b621f6c
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_netif-compile.patch
@@ -0,0 +1,92 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/common/rtl865x_netif.c.old 2013-06-02 11:41:42.385897039 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/common/rtl865x_netif.c 2013-06-02 11:47:55.557906209 +0300
+@@ -3846,11 +3846,6 @@
+
+ int rtl865x_del_pattern_acl_for_contentFilter(rtl865x_AclRule_t *rule,char *netifName)
+ {
+- union
+- {
+- char pat[4];
+- uint32 pattern;
+- }u;
+ int32 i;
+
+ rtl865x_netif_local_t *netif;
+@@ -3868,10 +3863,6 @@
+ if(vlan == NULL)
+ return FAILED;
+
+- u.pat[0]='T';
+- u.pat[1]='T';
+- u.pat[2]='P';
+- u.pat[3]='/';
+ for(i=0;i<RTL8651_PORT_NUMBER;i++)
+ {
+ if (vlan->memberPortMask & 1<<i) {
+@@ -4634,8 +4625,7 @@
+ extern int rtk_vlan_support_enable;
+ int32 rtl865x_reConfigDefaultAcl(char *ifName)
+ {
+- rtl865x_AclRule_t rule;
+- int ret=FAILED;
++ rtl865x_AclRule_t rule;
+
+ unsigned long flags;
+ local_irq_save(flags);
+@@ -4648,14 +4638,14 @@
+ rule.ruleType_ = RTL865X_ACL_MAC;
+ rule.pktOpApp_ = RTL865X_ACL_ALL_LAYER;
+ rule.actionType_ = RTL865X_ACL_PERMIT;
+- ret=_rtl865x_del_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
++ _rtl865x_del_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
+
+ /*add new default permit acl*/
+ bzero((void*)&rule,sizeof(rtl865x_AclRule_t));
+ rule.ruleType_ = RTL865X_ACL_MAC;
+ rule.pktOpApp_ = RTL865X_ACL_ALL_LAYER;
+ rule.actionType_ = RTL865X_ACL_PERMIT;
+- ret=_rtl865x_add_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
++ _rtl865x_add_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
+ }
+ else
+ {
+@@ -4664,14 +4654,14 @@
+ rule.ruleType_ = RTL865X_ACL_MAC;
+ rule.pktOpApp_ = RTL865X_ACL_ALL_LAYER;
+ rule.actionType_ = RTL865X_ACL_TOCPU;
+- ret=_rtl865x_del_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
++ _rtl865x_del_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
+
+ /*add new default to cpu acl*/
+ bzero((void*)&rule,sizeof(rtl865x_AclRule_t));
+ rule.ruleType_ = RTL865X_ACL_MAC;
+ rule.pktOpApp_ = RTL865X_ACL_ALL_LAYER;
+ rule.actionType_ = RTL865X_ACL_TOCPU;
+- ret=_rtl865x_add_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
++ _rtl865x_add_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
+ }
+ #else
+ {
+@@ -4680,18 +4670,18 @@
+ rule.ruleType_ = RTL865X_ACL_MAC;
+ rule.pktOpApp_ = RTL865X_ACL_ALL_LAYER;
+ rule.actionType_ = RTL865X_ACL_PERMIT;
+- ret=_rtl865x_del_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
++ _rtl865x_del_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
+
+ /*add new default permit acl*/
+ bzero((void*)&rule,sizeof(rtl865x_AclRule_t));
+ rule.ruleType_ = RTL865X_ACL_MAC;
+ rule.pktOpApp_ = RTL865X_ACL_ALL_LAYER;
+ rule.actionType_ = RTL865X_ACL_PERMIT;
+- ret=_rtl865x_add_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
++ _rtl865x_add_acl(&rule, ifName, RTL865X_ACL_SYSTEM_USED);
+ }
+ #endif
+- local_irq_restore(flags);
++ local_irq_restore(flags);
+
+- return SUCCESS;
++ return SUCCESS;
+ }
+
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_ppp-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_ppp-compile.patch
new file mode 100644
index 000000000..3a3f1cdc0
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_ppp-compile.patch
@@ -0,0 +1,68 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/l3Driver/rtl865x_ppp.c.old 2013-06-02 13:02:46.298016562 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/l3Driver/rtl865x_ppp.c 2013-06-02 13:06:17.642021755 +0300
+@@ -95,7 +95,6 @@
+ int i;
+ rtl865x_ppp_t *entry = NULL;
+ rtl865x_tblAsicDrv_pppoeParam_t asicppp;
+- int32 retval = FAILED;
+ uint32 fid;
+
+ /*found the entry*/
+@@ -124,12 +123,9 @@
+ rtl8651_setAsicPppoe(PPP_TABLE_INDEX(entry), &asicppp);
+
+ /*FIXME_hyking:dereference netif & mac*/
+- retval = rtl865x_deReferNetif(entry->netif->name);
+-
+- retval = rtl865x_getVlanFilterDatabaseId(entry->netif->vid, &fid);
+-
+- retval = rtl865x_delFilterDatabaseEntry(RTL865x_L2_TYPEII, fid, &entry->server_mac);
+-
++ rtl865x_deReferNetif(entry->netif->name);
++ rtl865x_getVlanFilterDatabaseId(entry->netif->vid, &fid);
++ rtl865x_delFilterDatabaseEntry(RTL865x_L2_TYPEII, fid, &entry->server_mac);
+
+ /*raise event??*/
+ rtl865x_raiseEvent(EVENT_DEL_PPP,(void *)entry);
+@@ -149,7 +145,6 @@
+ rtl865x_tblAsicDrv_l2Param_t fdbEntry;
+ rtl865x_filterDbTableEntry_t l2temp_entry;
+ uint32 fid,column;
+- int32 retval;
+ uint32 fdb_type[]={ FDB_STATIC, FDB_DYNAMIC };
+
+ /*printk("%s(%d): ifname(%s),mac(%02x:%02x:%02x:%02x:%02x:%02x),sid(%d),type(%d)",__FUNCTION__,__LINE__,ifname,
+@@ -200,12 +195,12 @@
+
+
+ /*FIXME_hyking:reference netif & mac*/
+- retval = rtl865x_referNetif(netif->name);
++ rtl865x_referNetif(netif->name);
+
+ /*add fdb entry...*/
+ fid = 0;
+ column = 0;
+- retval = rtl865x_getVlanFilterDatabaseId(netif->vid,&fid);
++ rtl865x_getVlanFilterDatabaseId(netif->vid,&fid);
+
+ for(i = 0; i < 2; i++)
+ {
+@@ -219,8 +214,7 @@
+ {
+ continue;
+ }
+-
+-
++
+ /*in case of layer2 auto learn, add hardware entry to layer 2 software table*/
+ l2temp_entry.l2type = (fdbEntry.nhFlag==0)?RTL865x_L2_TYPEI: RTL865x_L2_TYPEII;
+ l2temp_entry.process = FDB_TYPE_FWD;
+@@ -229,7 +223,7 @@
+ l2temp_entry.SrcBlk = fdbEntry.srcBlk;
+ memcpy(&(l2temp_entry.macAddr), mac, sizeof(ether_addr_t));
+ rtl865x_addFilterDatabaseEntryExtension(fid, &l2temp_entry);
+-// retval = _rtl865x_addFilterDatabaseEntry((fdbEntry.nhFlag==0)?RTL865x_L2_TYPEI: RTL865x_L2_TYPEII, fid, mac, FDB_TYPE_FWD, fdbEntry.memberPortMask, fdbEntry.auth,fdbEntry.srcBlk);
++// _rtl865x_addFilterDatabaseEntry((fdbEntry.nhFlag==0)?RTL865x_L2_TYPEI: RTL865x_L2_TYPEII, fid, mac, FDB_TYPE_FWD, fdbEntry.memberPortMask, fdbEntry.auth,fdbEntry.srcBlk);
+ rtl865x_refleshHWL2Table(mac, FDB_DYNAMIC|FDB_STATIC,fid);
+ }
+
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl865x_proc_debug-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl865x_proc_debug-compile.patch
new file mode 100644
index 000000000..3c1552133
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl865x_proc_debug-compile.patch
@@ -0,0 +1,17 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/rtl865x_proc_debug.c.old 2013-06-02 11:32:57.529884142 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/rtl865x_proc_debug.c 2013-06-02 11:32:01.649882768 +0300
+@@ -62,6 +62,14 @@
+ extern unsigned int tx_ringFull_cnt;
+ #endif
+
++/* fix implicit function declararion compile errors */
++/* from rtl865x_asicL2.c */
++extern int32 rtl865xC_setAsicEthernetForceModeRegs(uint32 port, uint32 enForceMode, uint32 forceLink, uint32 forceSpeed, uint32 forceDuplex);
++extern int32 rtl8651_setAsicEthernetPHYSpeed(uint32 port, uint32 speed);
++extern int32 rtl8651_setAsicEthernetPHYDuplex(uint32 port, uint32 duplex);
++extern int32 rtl8651_setAsicEthernetPHYAutoNeg(uint32 port, uint32 autoneg);
++extern int32 rtl8651_setAsicEthernetPHYAdvCapality(uint32 port, uint32 capality);
++
+ static struct proc_dir_entry *rtl865x_proc_dir;
+ #ifdef CONFIG_RTL_PROC_DEBUG //proc debug flag
+ static struct proc_dir_entry *vlan_entry,*netif_entry,*l2_entry, *arp_entry,
diff --git a/target/linux/realtek/patches-2.6.30/fix-rtl_nic-compile.patch b/target/linux/realtek/patches-2.6.30/fix-rtl_nic-compile.patch
new file mode 100644
index 000000000..5259e27f5
--- /dev/null
+++ b/target/linux/realtek/patches-2.6.30/fix-rtl_nic-compile.patch
@@ -0,0 +1,312 @@
+--- linux-2.6.30.9/drivers/net/rtl819x/rtl_nic.c.old 2013-06-02 02:19:07.721067577 +0300
++++ linux-2.6.30.9/drivers/net/rtl819x/rtl_nic.c 2013-06-02 11:21:59.473867971 +0300
+@@ -551,8 +551,35 @@
+ #if defined(CONFIG_RTK_VLAN_NEW_FEATURE)
+ static int rtk_vlan_management_read(char *page, char **start, off_t off, int count, int *eof, void *data);
+ static int rtk_vlan_management_write(struct file *file, const char *buffer, unsigned long len, void *data);
++/* from rtk_vlan.c */
++extern int rx_vlan_process(struct net_device *dev, struct vlan_info *info_ori, struct sk_buff *skb, struct sk_buff **new_skb);
++#else
++/* from rtk_vlan.c */
++extern int rx_vlan_process(struct net_device *dev, struct vlan_info *info, struct sk_buff *skb);
+ #endif
+
++/* fix implicit function declararion compile errors */
++int32 rtl8651_initMldSnooping(void);
++void FullAndSemiReset(void);
++int re865x_reProbe(void);
++void set_phy_pwr_save(int id, int val);
++int rtl865x_creatReInitSwitchCoreProc(void);
++/* from rtk_vlan.c */
++extern int tx_vlan_process(struct net_device *dev, struct vlan_info *info, struct sk_buff *skb, int wlan_pri);
++/* from rtl865x_asicL3.S */
++extern int32 rtl865x_initAsicL3(void);
++/* from rtl865x_igmpsnooping.c */
++extern int32 rtl_setIgmpSnoopingModuleStaticRouterPortMask(uint32 moduleIndex,uint32 staticRouterPortMask);
++/* from rtl865x_fdb.c */
++extern int32 rtl865x_layer2_reinit(void);
++/* for copy_skb_header */
++//#include <linux/skbuff.h>
++extern void copy_skb_header(struct sk_buff *new, const struct sk_buff *old);
++/* for rtl865x_proc_debug_cleanup and rtl865x_proc_debug_init */
++#include "rtl865x_proc_debug.h"
++/* for rtl865x_initEventMgr and rtl865x_reInitEventMgr */
++#include "common/rtl865x_eventMgr.h"
++
+ //__DRAM_FWD int rtk_vlan_support_enable;
+ int rtk_vlan_support_enable;
+
+@@ -1743,7 +1770,6 @@
+
+ unsigned char optionDataLen=0;
+ unsigned char optionType=0;
+- unsigned int ipv6RAO=0;
+
+ if(ipv6h==NULL)
+ {
+@@ -1791,7 +1817,6 @@
+ /*router altert option*/
+ if(ntohl(*(uint32 *)(ptr))==IPV6_ROUTER_ALTER_OPTION)
+ {
+- ipv6RAO=IPV6_ROUTER_ALTER_OPTION;
+ ptr=ptr+4;
+ continue;
+ }
+@@ -1959,6 +1984,8 @@
+ return;
+ }
+
++void rtl865x_igmpLinkStatusChangeCallback(uint32 moduleIndex, rtl_igmpPortInfo_t * portInfo);
++
+ void rtl865x_igmpSyncLinkStatus(void)
+ {
+ rtl_igmpPortInfo_t portInfo;
+@@ -2845,10 +2872,10 @@
+ __IRAM_FWD
+ static inline void rtl_processRxFrame(rtl_nicRx_info *info)
+ {
+- struct dev_priv *cp_this;
+- struct sk_buff *skb;
+- uint32 vid, pid, len;
+- uint8 *data;
++ struct dev_priv *cp_this;
++ struct sk_buff *skb;
++ uint32 vid, len;
++ uint8 *data;
+
+ cp_this = info->priv;
+ skb = info->input;
+@@ -2857,7 +2884,6 @@
+
+ #if defined(CONFIG_RTL_STP)
+ if(info->isStpVirtualDev){
+- pid = info->pid;
+ len = info->len;
+ skb->len = 0;
+ skb_put(skb, len);
+@@ -2890,7 +2916,6 @@
+ }
+ /* sanity check end */
+
+- pid = info->pid;
+ len = info->len;
+ skb->len = 0;
+ skb_put(skb, len);
+@@ -2914,7 +2939,7 @@
+
+
+ #if defined(CONFIG_NETFILTER_XT_MATCH_PHYPORT) || defined(CONFIG_RTL_FAST_FILTER) || defined(CONFIG_RTL_QOS_PATCH) || defined(CONFIG_RTK_VOIP_QOS) || defined(CONFIG_RTK_VLAN_WAN_TAG_SUPPORT) ||defined(CONFIG_RTL_MAC_FILTER_CARE_INPORT)
+- skb->srcPhyPort=(uint8)pid;
++ skb->srcPhyPort=(uint8)info->pid;
+ #endif
+ //printk("=======%s(%d),cp_this(%s)\n",__FUNCTION__,__LINE__,cp_this->dev->name);
+ /* vlan process (including strip vlan tag) */
+@@ -3074,7 +3099,6 @@
+ {
+ /* multicast process */
+ #if defined (CONFIG_RTL_IGMP_SNOOPING)
+- //rtl_MulticastRxCheck(skb, cp_this, vid, pid);
+ rtl_MulticastRxCheck(skb, info);
+ #endif /*end of CONFIG_RTL865X_IGMP_SNOOPING*/
+ /* multicast process end */
+@@ -3846,6 +3870,30 @@
+ }
+ #endif
+
++int rtl865x_reinitSwitchCore(void)
++{
++ /*enable switch core clock*/
++ rtl865x_duringReInitSwtichCore=1;
++ /*disable switch core interrupt*/
++ REG32(CPUICR) = 0;
++ REG32(CPUIIMR) = 0;
++ REG32(GIMR) &= ~(BSP_SW_IE);
++
++ re865x_reProbe();
++ swNic_reInit();
++ rtl865x_reChangeOpMode();
++
++ /*enable switch core interrupt*/
++
++ REG32(CPUICR) = TXCMD | RXCMD | BUSBURST_32WORDS | MBUF_2048BYTES;
++ REG32(CPUIIMR) = RX_DONE_IE_ALL | TX_ALL_DONE_IE_ALL | LINK_CHANGE_IE | PKTHDR_DESC_RUNOUT_IE_ALL;
++ REG32(SIRR) |= TRXRDY;
++ REG32(GIMR) |= (BSP_SW_IE);
++
++ rtl865x_duringReInitSwtichCore=0;
++ return 0;
++}
++
+ #if defined(DYNAMIC_ADJUST_TASKLET) || defined(CONFIG_RTL8186_TR) || defined(CONFIG_RTL8196C_REVISION_B) || defined(CONFIG_RTL_8198) || defined(RTL8196C_EEE_MAC) || defined(RTL_CPU_QOS_ENABLED) || defined(CONFIG_RTL_819XD) || defined(CONFIG_RTL_8196E)
+ static void one_sec_timer(unsigned long task_priv)
+ {
+@@ -4596,7 +4644,7 @@
+ #if defined (CONFIG_RTL_IGMP_SNOOPING)
+ int re865x_setMCastTxInfo(struct sk_buff *skb,struct net_device *dev, rtl_nicTx_info *nicTx)
+ {
+- int32 ret;
++ //int32 ret;
+ struct dev_priv *cp;
+ struct iphdr *iph=NULL;
+ #if defined (CONFIG_RTL_MLD_SNOOPING)
+@@ -4647,11 +4695,8 @@
+ multicastDataInfo.sourceIp[0]= (uint32)(iph->saddr);
+ multicastDataInfo.groupAddr[0]= (uint32)(iph->daddr);
+ */
+- ret= rtl_getMulticastDataFwdInfo(nicIgmpModuleIndex, &multicastDataInfo, &multicastFwdInfo);
++ rtl_getMulticastDataFwdInfo(nicIgmpModuleIndex, &multicastDataInfo, &multicastFwdInfo);
+ nicTx->portlist = multicastFwdInfo.fwdPortMask& cp->portmask & ((1<<RTL8651_MAC_NUMBER)-1);
+-
+-
+-
+ }
+ #ifdef CONFIG_RTK_VLAN_WAN_TAG_SUPPORT
+ //fix tim; upnp
+@@ -4706,14 +4751,10 @@
+ multicastDataInfo.ipVersion=6;
+ memcpy(&multicastDataInfo.sourceIp, &ipv6h->saddr, 16);
+ memcpy(&multicastDataInfo.groupAddr, &ipv6h->daddr, 16);
+- ret= rtl_getMulticastDataFwdInfo(nicIgmpModuleIndex, &multicastDataInfo, &multicastFwdInfo);
++ rtl_getMulticastDataFwdInfo(nicIgmpModuleIndex, &multicastDataInfo, &multicastFwdInfo);
+ nicTx->portlist = multicastFwdInfo.fwdPortMask& cp->portmask & ((1<<RTL8651_MAC_NUMBER)-1);
+-
+ }
+-
+ }
+-
+-
+ }
+ #endif
+ return 0;
+@@ -6007,7 +6048,7 @@
+ #endif
+ struct rtl865x_vlanConfig *pVlanConfig=NULL;
+ rtl865x_AclRule_t rule;
+- int ret=FAILED;
++ //int ret=FAILED;
+
+ if(vlanConfig==NULL)
+ {
+@@ -6045,7 +6086,7 @@
+ rule.dstMacMask_.octet[1]=0xFF;
+ rule.dstMacMask_.octet[2]=0xFF;
+
+- ret= rtl865x_add_acl(&rule, pVlanConfig[i].ifname, RTL865X_ACL_IPV6_USED);
++ //ret= rtl865x_add_acl(&rule, pVlanConfig[i].ifname, RTL865X_ACL_IPV6_USED);
+
+ /*ipv6 multicast data issue*/
+ bzero((void*)&rule,sizeof(rtl865x_AclRule_t));
+@@ -6062,7 +6103,7 @@
+ rule.dstMacMask_.octet[0]=0xFF;
+ rule.dstMacMask_.octet[1]=0xFF;
+
+- ret= rtl865x_add_acl(&rule, pVlanConfig[i].ifname, RTL865X_ACL_IPV6_USED);
++ //ret= rtl865x_add_acl(&rule, pVlanConfig[i].ifname, RTL865X_ACL_IPV6_USED);
+
+ }
+ else/*wan config*/
+@@ -6083,7 +6124,7 @@
+ rule.dstMacMask_.octet[0]=0xFF;
+ rule.dstMacMask_.octet[1]=0xFF;
+
+- ret= rtl865x_add_acl(&rule, pVlanConfig[i].ifname, RTL865X_ACL_IPV6_USED);
++ //ret= rtl865x_add_acl(&rule, pVlanConfig[i].ifname, RTL865X_ACL_IPV6_USED);
+
+ }
+
+@@ -6176,7 +6217,7 @@
+ int32 totalVlans=((sizeof(vlanconfig))/(sizeof(struct rtl865x_vlanConfig)))-1;
+ #if defined (CONFIG_RTL_IGMP_SNOOPING)
+ int32 retVal;
+- int32 igmpInitFlag=FAILED;
++ //int32 igmpInitFlag=FAILED;
+ struct rtl_mCastSnoopingGlobalConfig mCastSnoopingGlobalConfig;
+ #if defined (CONFIG_RTL_HARDWARE_MULTICAST)
+ rtl865x_mCastConfig_t mCastConfig;
+@@ -6409,7 +6450,7 @@
+ mCastSnoopingGlobalConfig.mospfRouterAgingTime=120;
+ mCastSnoopingGlobalConfig.pimRouterAgingTime=120;
+
+- igmpInitFlag=rtl_initMulticastSnooping(mCastSnoopingGlobalConfig);
++ //igmpInitFlag=rtl_initMulticastSnooping(mCastSnoopingGlobalConfig);
+ #endif
+
+ for(i=0;i<totalVlans;i++)
+@@ -7233,9 +7274,7 @@
+ */
+ int32 rtl865x_init(void)
+ {
+- int32 retval = 0;
+-
+-
++ //int32 retval = 0;
+ __865X_Config = 0;
+
+ #ifdef CONFIG_RTL8196_RTL8366
+@@ -7278,26 +7317,26 @@
+ #endif
+
+ /*common*/
+- retval = rtl865x_initNetifTable();
+- retval = rtl865x_initVlanTable();
++ rtl865x_initNetifTable();
++ rtl865x_initVlanTable();
+ #ifdef CONFIG_RTL_LAYERED_DRIVER_ACL
+- retval = rtl865x_init_acl();
++ rtl865x_init_acl();
+ #endif
+- retval = rtl865x_initEventMgr(NULL);
++ rtl865x_initEventMgr(NULL);
+
+ /*l2*/
+ #ifdef CONFIG_RTL_LAYERED_DRIVER_L2
+- retval = rtl865x_layer2_init();
++ rtl865x_layer2_init();
+ #endif
+
+
+ /*layer3*/
+ #ifdef CONFIG_RTL_LAYERED_DRIVER_L3
+- retval = rtl865x_initIpTable();
+- retval = rtl865x_initPppTable();
+- retval = rtl865x_initRouteTable();
+- retval = rtl865x_initNxtHopTable();
+- retval = rtl865x_arp_init();
++ rtl865x_initIpTable();
++ rtl865x_initPppTable();
++ rtl865x_initRouteTable();
++ rtl865x_initNxtHopTable();
++ rtl865x_arp_init();
+ #endif
+
+ /*layer4*/
+@@ -10809,29 +10848,6 @@
+ return 0;
+ }
+
+-int rtl865x_reinitSwitchCore(void)
+-{
+- /*enable switch core clock*/
+- rtl865x_duringReInitSwtichCore=1;
+- /*disable switch core interrupt*/
+- REG32(CPUICR) = 0;
+- REG32(CPUIIMR) = 0;
+- REG32(GIMR) &= ~(BSP_SW_IE);
+-
+- re865x_reProbe();
+- swNic_reInit();
+- rtl865x_reChangeOpMode();
+-
+- /*enable switch core interrupt*/
+-
+- REG32(CPUICR) = TXCMD | RXCMD | BUSBURST_32WORDS | MBUF_2048BYTES;
+- REG32(CPUIIMR) = RX_DONE_IE_ALL | TX_ALL_DONE_IE_ALL | LINK_CHANGE_IE | PKTHDR_DESC_RUNOUT_IE_ALL;
+- REG32(SIRR) |= TRXRDY;
+- REG32(GIMR) |= (BSP_SW_IE);
+-
+- rtl865x_duringReInitSwtichCore=0;
+- return 0;
+-}
+
+ static struct proc_dir_entry *reInitSwitchCoreProc=NULL;
+