summaryrefslogtreecommitdiffstatsabout
path: root/SylixOS
diff options
context:
space:
mode:
authorHanhui <hanhui@acoinfo.com>2020-07-04 08:14:44 (GMT)
committer Hanhui <hanhui@acoinfo.com>2020-07-04 08:14:44 (GMT)
commit702dfb37c929c4a3fb206ed8e0dc3c28c22dd135 (patch)
tree12cfc1b828b8e4ff9ad3e8145324db3cf92113c2 /SylixOS
parentfb1f48d22dec1108ef92fc95581303dc85b3ccfe (diff)
downloadlibsylixos-702dfb37c929c4a3fb206ed8e0dc3c28c22dd135.zip
libsylixos-702dfb37c929c4a3fb206ed8e0dc3c28c22dd135.tar.gz
libsylixos-702dfb37c929c4a3fb206ed8e0dc3c28c22dd135.tar.bz2
Fixed netlink speed update error.
Diffstat (limited to 'SylixOS')
-rw-r--r--SylixOS/net/lwip/netdev/netdev.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/SylixOS/net/lwip/netdev/netdev.c b/SylixOS/net/lwip/netdev/netdev.c
index 4201f10..e09b064 100644
--- a/SylixOS/net/lwip/netdev/netdev.c
+++ b/SylixOS/net/lwip/netdev/netdev.c
@@ -556,12 +556,17 @@ static void netdev_netif_set_linkup (netdev_t *netdev, int linkup, UINT32 speed
return;
}
+ netdev->speed = speed;
+
netif = (struct netif *)netdev->sys;
-
+ if (speed > 0xffffffff) {
+ netif->link_speed = 0;
+ } else {
+ netif->link_speed = (u32_t)speed;
+ }
+
if (linkup) {
netif->ts = sys_jiffies();
- netdev->speed = speed;
-
if (!netif->ext_ctl) { /* not in net bridge or bonding */
netifapi_netif_set_link_up(netif);
} else {
@@ -569,12 +574,6 @@ static void netdev_netif_set_linkup (netdev_t *netdev, int linkup, UINT32 speed
netdev_netif_linkup(netif);
}
- if (speed > 0xffffffff) {
- netif->link_speed = 0;
- } else {
- netif->link_speed = (u32_t)speed;
- }
-
} else {
if (!netif->ext_ctl) { /* not in net bridge or bonding */
netifapi_netif_set_link_down(netif);