From c3cc7a29c8e8da3fa897a8ff95d6248c2a0fc3f7 Mon Sep 17 00:00:00 2001 From: MurphyZhao Date: Fri, 2 Nov 2018 10:23:29 +0800 Subject: [PATCH] =?UTF-8?q?[components][dfs]=20=E7=A7=BB=E9=99=A4=E5=86=97?= =?UTF-8?q?=E4=BD=99=E4=BB=A3=E7=A0=81=20[components][net]=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=20Kconfig=20[components][net][sal]=20=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=E5=AF=B9=20SAL=20=E6=A1=86=E6=9E=B6=E7=9A=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E5=9C=A8=20proto=5Fops=20=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E5=AE=9E=E4=BE=8B=E8=B5=8B=E5=80=BC=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MurphyZhao --- components/dfs/include/dfs_poll.h | 6 +----- components/net/Kconfig | 2 +- components/net/sal_socket/impl/af_inet_lwip.c | 4 ++-- components/net/sal_socket/include/sal.h | 5 ----- 4 files changed, 4 insertions(+), 13 deletions(-) diff --git a/components/dfs/include/dfs_poll.h b/components/dfs/include/dfs_poll.h index 066363d6fc..d9597a4364 100644 --- a/components/dfs/include/dfs_poll.h +++ b/components/dfs/include/dfs_poll.h @@ -29,8 +29,6 @@ #define POLLHUP (0x08) #define POLLNVAL (0x10) -#define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) - typedef unsigned int nfds_t; struct pollfd @@ -39,12 +37,10 @@ struct pollfd short events; short revents; }; +#endif /* !defined(POLLIN) && !defined(POLLOUT) */ -int poll(struct pollfd *fds, nfds_t nfds, int timeout); -#else /* !defined(POLLIN) && !defined(POLLOUT) */ #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) int poll(struct pollfd *fds, nfds_t nfds, int timeout); -#endif /* !defined(POLLIN) && !defined(POLLOUT) */ #endif /* RT_USING_POSIX */ #endif /* DFS_POLL_H__ */ diff --git a/components/net/Kconfig b/components/net/Kconfig index 8f3b87f055..c302dec152 100644 --- a/components/net/Kconfig +++ b/components/net/Kconfig @@ -73,7 +73,7 @@ config RT_USING_LWIP bool "lwIP v2.1.0" endchoice - if (RT_USING_LWIP210) + if (RT_USING_LWIP210 || RT_USING_LWIP202) config RT_USING_LWIP_IPV6 bool "IPV6 protocol" default n diff --git a/components/net/sal_socket/impl/af_inet_lwip.c b/components/net/sal_socket/impl/af_inet_lwip.c index b1e04373c6..df356f89d0 100644 --- a/components/net/sal_socket/impl/af_inet_lwip.c +++ b/components/net/sal_socket/impl/af_inet_lwip.c @@ -271,8 +271,8 @@ static const struct proto_ops lwip_inet_stream_ops = { lwip_listen, lwip_connect, inet_accept, - lwip_sendto, - lwip_recvfrom, + (int (*)(int, const void *, size_t, int, const struct sockaddr *, socklen_t))lwip_sendto, + (int (*)(int, void *, size_t, int, struct sockaddr *, socklen_t *))lwip_recvfrom, lwip_getsockopt, //TODO fix on 1.4.1 lwip_setsockopt, diff --git a/components/net/sal_socket/include/sal.h b/components/net/sal_socket/include/sal.h index ba5589c734..68248742d6 100644 --- a/components/net/sal_socket/include/sal.h +++ b/components/net/sal_socket/include/sal.h @@ -51,13 +51,8 @@ struct proto_ops int (*listen) (int s, int backlog); int (*connect) (int s, const struct sockaddr *name, socklen_t namelen); int (*accept) (int s, struct sockaddr *addr, socklen_t *addrlen); -#if LWIP_VERSION >= 0x20100ff - ssize_t (*sendto) (int s, const void *data, size_t size, int flags, const struct sockaddr *to, socklen_t tolen); - ssize_t (*recvfrom) (int s, void *mem, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); -#else int (*sendto) (int s, const void *data, size_t size, int flags, const struct sockaddr *to, socklen_t tolen); int (*recvfrom) (int s, void *mem, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); -#endif int (*getsockopt) (int s, int level, int optname, void *optval, socklen_t *optlen); int (*setsockopt) (int s, int level, int optname, const void *optval, socklen_t optlen); int (*shutdown) (int s, int how);