Skip to content

Commit e056ef2

Browse files
authored
Merge pull request #271 from rdkcentral/lan-ethernet
RDKBACCL-945 : Ping,FTP, HTTP, HTTPS, Telnet, TCP and UDP services working even when Device.Ethernet.Interface.1.Enable is disabled
2 parents bda8cd5 + f3b460c commit e056ef2

File tree

2 files changed

+85
-0
lines changed

2 files changed

+85
-0
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
Index: ethsw/rdkb_hal/src/ethsw/ccsp_hal_ethsw.c
2+
===================================================================
3+
--- ethsw.orig/rdkb_hal/src/ethsw/ccsp_hal_ethsw.c
4+
+++ ethsw/rdkb_hal/src/ethsw/ccsp_hal_ethsw.c
5+
@@ -179,9 +179,13 @@ CcspHalEthSwGetPortStatus
6+
#ifdef THREE_GMACS_SUPPORT
7+
if(PortId == 5){
8+
sprintf(ifName,"%s", "eth3");
9+
- }else
10+
+ }
11+
#endif
12+
+ else if (PortId == 1)
13+
{
14+
+ sprintf(ifName,"%s", "erouter0");
15+
+ }
16+
+ else{
17+
sprintf(ifName, "lan%d", (PortId-1));
18+
}
19+
sprintf(path, "/sys/class/net/%s/carrier", ifName);
20+
@@ -337,8 +341,13 @@ CcspHalEthSwGetPortCfg
21+
#ifdef THREE_GMACS_SUPPORT
22+
if(PortId == 5){
23+
sprintf(ifName,"%s", "eth3");
24+
- }else
25+
+ }
26+
#endif
27+
+ else if (PortId == 1)
28+
+ {
29+
+ sprintf(ifName,"%s", "erouter0");
30+
+ }
31+
+ else
32+
{
33+
sprintf(ifName, "lan%d", (PortId-1));
34+
}
35+
@@ -469,7 +478,7 @@ CcspHalEthSwSetPortCfg
36+
{
37+
CcspHalEthSwTrace(("set port %d LinkRate to %d, DuplexMode to %d", PortId, LinkRate, DuplexMode));
38+
39+
- if(PortId < 1 || PortId > MAX_LAN_PORT)
40+
+ if(PortId <= 1 || PortId > MAX_LAN_PORT)
41+
return RETURN_ERR;
42+
43+
char cmd[128] = {0};
44+
@@ -579,7 +588,10 @@ CcspHalEthSwGetPortAdminStatus
45+
}
46+
47+
memset(&ifr, 0, sizeof(ifr));
48+
- snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%s", "eth1");
49+
+ if (PortId == 1)
50+
+ snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "erouter0");
51+
+ else
52+
+ snprintf(ifr.ifr_name, sizeof(ifr.ifr_name),"lan",(PortId-1));
53+
54+
if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) < 0)
55+
{
56+
@@ -594,8 +606,8 @@ CcspHalEthSwGetPortAdminStatus
57+
else
58+
*pAdminStatus = CCSP_HAL_ETHSW_AdminDown;
59+
60+
- if(admin_status)
61+
- *pAdminStatus = CCSP_HAL_ETHSW_AdminDown;
62+
+ /*if(admin_status)
63+
+ *pAdminStatus = CCSP_HAL_ETHSW_AdminDown; */
64+
65+
return RETURN_OK;
66+
}
67+
@@ -629,14 +641,14 @@ CcspHalEthSwSetPortAdminStatus
68+
CcspHalEthSwTrace(("set port %d AdminStatus to %d", PortId, AdminStatus));
69+
if(AdminStatus < CCSP_HAL_ETHSW_AdminUp || AdminStatus > CCSP_HAL_ETHSW_AdminTest)
70+
return RETURN_ERR;
71+
- if(PortId < 1 || PortId > MAX_LAN_PORT)
72+
+ if(PortId <= 1 || PortId > MAX_LAN_PORT)
73+
return RETURN_ERR;
74+
75+
char cmd1[32] = {0};
76+
char cmd2[32] = {0};
77+
78+
- sprintf(cmd1,"ip link set lan%d up",PortId);
79+
- sprintf(cmd2,"ip link set lan%d down",PortId);
80+
+ sprintf(cmd1,"ip link set lan%d up",(PortId-1));
81+
+ sprintf(cmd2,"ip link set lan%d down",(PortId-1));
82+
83+
switch (PortId)
84+
{

meta-rdk-mtk-bpir4/recipes-ccsp/hal/hal-ethsw-generic_git.bbappend

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
22
CFLAGS_append += " -D_PLATFORM_BANANAPI_R4_ "
33
SRC_URI_append += "file://Add_interface_Changes.patch"
44
SRC_URI_append += "file://gw_lan_refresh.patch"
5+
SRC_URI_append += "file://Ethernet-Lan-changes.patch"

0 commit comments

Comments
 (0)