1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
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;
|