mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-22 03:09:16 +08:00
[components][dfs] AND [components][net][sal] 适配 LWIP210
Signed-off-by: MurphyZhao <d2014zjt@163.com>
This commit is contained in:
@@ -33,6 +33,15 @@
|
||||
#ifdef SAL_USING_LWIP
|
||||
|
||||
#ifdef SAL_USING_POSIX
|
||||
|
||||
#if LWIP_VERSION >= 0x20100ff
|
||||
#include <lwip/priv/sockets_priv.h>
|
||||
|
||||
#if LWIP_NETCONN_FULLDUPLEX
|
||||
#error "Not support"
|
||||
#endif
|
||||
|
||||
#else /* LWIP_VERSION < 0x20100ff */
|
||||
/*
|
||||
* Re-define lwip socket
|
||||
*
|
||||
@@ -64,6 +73,7 @@ struct lwip_sock {
|
||||
|
||||
rt_wqueue_t wait_head;
|
||||
};
|
||||
#endif /* LWIP_VERSION >= 0x20100ff */
|
||||
|
||||
extern struct lwip_sock *lwip_tryget_socket(int s);
|
||||
|
||||
@@ -136,7 +146,11 @@ static void event_callback(struct netconn *conn, enum netconn_evt evt, u16_t len
|
||||
break;
|
||||
}
|
||||
|
||||
if (sock->lastdata || sock->rcvevent > 0)
|
||||
#if LWIP_VERSION >= 0x20100ff
|
||||
if ((void*)(sock->lastdata.pbuf) || (sock->rcvevent > 0))
|
||||
#else
|
||||
if ((void*)(sock->lastdata) || (sock->rcvevent > 0))
|
||||
#endif
|
||||
event |= POLLIN;
|
||||
if (sock->sendevent)
|
||||
event |= POLLOUT;
|
||||
@@ -226,7 +240,12 @@ static int inet_poll(struct dfs_fd *file, struct rt_pollreq *req)
|
||||
rt_poll_add(&sock->wait_head, req);
|
||||
|
||||
level = rt_hw_interrupt_disable();
|
||||
if (sock->lastdata || sock->rcvevent)
|
||||
|
||||
#if LWIP_VERSION >= 0x20100ff
|
||||
if ((void*)(sock->lastdata.pbuf) || sock->rcvevent)
|
||||
#else
|
||||
if ((void*)(sock->lastdata) || sock->rcvevent)
|
||||
#endif
|
||||
{
|
||||
mask |= POLLIN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user