summaryrefslogtreecommitdiff
path: root/components/net/lwip-1.4.1/src/netif/ethernetif.c
diff options
context:
space:
mode:
Diffstat (limited to 'components/net/lwip-1.4.1/src/netif/ethernetif.c')
-rw-r--r--components/net/lwip-1.4.1/src/netif/ethernetif.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/components/net/lwip-1.4.1/src/netif/ethernetif.c b/components/net/lwip-1.4.1/src/netif/ethernetif.c
index 4a8ff12521..052ee1bb01 100644
--- a/components/net/lwip-1.4.1/src/netif/ethernetif.c
+++ b/components/net/lwip-1.4.1/src/netif/ethernetif.c
@@ -1,6 +1,6 @@
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
- * COPYRIGHT (C) 2006-2010, RT-Thread Development Team
+ * COPYRIGHT (C) 2006-2021, RT-Thread Development Team
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
@@ -59,9 +59,9 @@
#define netifapi_netif_set_link_down(n) netifapi_netif_common(n, netif_set_link_down, NULL)
#ifndef RT_LWIP_ETHTHREAD_PRIORITY
-#define RT_ETHERNETIF_THREAD_PREORITY 0x90
+#define RT_ETHERNETIF_THREAD_PREORITY 0x90
#else
-#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY
+#define RT_ETHERNETIF_THREAD_PREORITY RT_LWIP_ETHTHREAD_PRIORITY
#endif
#ifndef LWIP_NO_TX_THREAD
@@ -70,8 +70,8 @@
*/
struct eth_tx_msg
{
- struct netif *netif;
- struct pbuf *buf;
+ struct netif *netif;
+ struct pbuf *buf;
};
static struct rt_mailbox eth_tx_thread_mb;
@@ -156,16 +156,16 @@ static int lwip_netdev_set_dns_server(struct netdev *netif, uint8_t dns_num, ip_
static int lwip_netdev_set_dhcp(struct netdev *netif, rt_bool_t is_enabled)
{
netdev_low_level_set_dhcp_status(netif, is_enabled);
-
+
if(RT_TRUE == is_enabled)
{
dhcp_start((struct netif *)netif->user_data);
}
else
{
- dhcp_stop((struct netif *)netif->user_data);
+ dhcp_stop((struct netif *)netif->user_data);
}
-
+
return ERR_OK;
}
#endif /* RT_LWIP_DHCP */
@@ -368,7 +368,7 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p)
struct eth_tx_msg msg;
struct eth_device* enetif;
- RT_ASSERT(netif != RT_NULL);
+ RT_ASSERT(netif != RT_NULL);
enetif = (struct eth_device*)netif->state;
/* send a message to eth tx thread */
@@ -382,13 +382,13 @@ static err_t ethernetif_linkoutput(struct netif *netif, struct pbuf *p)
#else
struct eth_device* enetif;
- RT_ASSERT(netif != RT_NULL);
+ RT_ASSERT(netif != RT_NULL);
enetif = (struct eth_device*)netif->state;
- if (enetif->eth_tx(&(enetif->parent), p) != RT_EOK)
- {
- return ERR_IF;
- }
+ if (enetif->eth_tx(&(enetif->parent), p) != RT_EOK)
+ {
+ return ERR_IF;
+ }
#endif
return ERR_OK;
}
@@ -474,16 +474,16 @@ rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_
netif->name[1] = name[1];
/* set hw address to 6 */
- netif->hwaddr_len = 6;
+ netif->hwaddr_len = 6;
/* maximum transfer unit */
- netif->mtu = ETHERNET_MTU;
+ netif->mtu = ETHERNET_MTU;
/* get hardware MAC address */
rt_device_control(&(dev->parent), NIOCTL_GADDR, netif->hwaddr);
/* set output */
- netif->output = etharp_output;
- netif->linkoutput = ethernetif_linkoutput;
+ netif->output = etharp_output;
+ netif->linkoutput = ethernetif_linkoutput;
/* if tcp thread has been started up, we add this netif to the system */
if (rt_thread_find("tcpip") != RT_NULL)
@@ -565,12 +565,12 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
/* NOTE: please not use it in interrupt when no RxThread exist */
rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
{
- if (up == RT_TRUE)
- netifapi_netif_set_link_up(dev->netif);
- else
- netifapi_netif_set_link_down(dev->netif);
+ if (up == RT_TRUE)
+ netifapi_netif_set_link_up(dev->netif);
+ else
+ netifapi_netif_set_link_down(dev->netif);
- return RT_EOK;
+ return RT_EOK;
}
#endif
@@ -638,8 +638,8 @@ static void eth_rx_thread_entry(void* parameter)
/* receive all of buffer */
while (1)
{
- if(device->eth_rx == RT_NULL) break;
-
+ if(device->eth_rx == RT_NULL) break;
+
p = device->eth_rx(&(device->parent));
if (p != RT_NULL)
{