[components][dfs] 移除冗余代码

[components][net] 修复 Kconfig
[components][net][sal] 还原对 SAL 框架的修改,在 proto_ops 结构体实例赋值位置修改

Signed-off-by: MurphyZhao <d2014zjt@163.com>
This commit is contained in:
MurphyZhao 2018-11-02 10:23:29 +08:00
parent 58a6b51236
commit c3cc7a29c8
4 changed files with 4 additions and 13 deletions

View File

@ -29,8 +29,6 @@
#define POLLHUP (0x08) #define POLLHUP (0x08)
#define POLLNVAL (0x10) #define POLLNVAL (0x10)
#define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
typedef unsigned int nfds_t; typedef unsigned int nfds_t;
struct pollfd struct pollfd
@ -39,12 +37,10 @@ struct pollfd
short events; short events;
short revents; 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) #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM)
int poll(struct pollfd *fds, nfds_t nfds, int timeout); int poll(struct pollfd *fds, nfds_t nfds, int timeout);
#endif /* !defined(POLLIN) && !defined(POLLOUT) */
#endif /* RT_USING_POSIX */ #endif /* RT_USING_POSIX */
#endif /* DFS_POLL_H__ */ #endif /* DFS_POLL_H__ */

View File

@ -73,7 +73,7 @@ config RT_USING_LWIP
bool "lwIP v2.1.0" bool "lwIP v2.1.0"
endchoice endchoice
if (RT_USING_LWIP210) if (RT_USING_LWIP210 || RT_USING_LWIP202)
config RT_USING_LWIP_IPV6 config RT_USING_LWIP_IPV6
bool "IPV6 protocol" bool "IPV6 protocol"
default n default n

View File

@ -271,8 +271,8 @@ static const struct proto_ops lwip_inet_stream_ops = {
lwip_listen, lwip_listen,
lwip_connect, lwip_connect,
inet_accept, inet_accept,
lwip_sendto, (int (*)(int, const void *, size_t, int, const struct sockaddr *, socklen_t))lwip_sendto,
lwip_recvfrom, (int (*)(int, void *, size_t, int, struct sockaddr *, socklen_t *))lwip_recvfrom,
lwip_getsockopt, lwip_getsockopt,
//TODO fix on 1.4.1 //TODO fix on 1.4.1
lwip_setsockopt, lwip_setsockopt,

View File

@ -51,13 +51,8 @@ struct proto_ops
int (*listen) (int s, int backlog); int (*listen) (int s, int backlog);
int (*connect) (int s, const struct sockaddr *name, socklen_t namelen); int (*connect) (int s, const struct sockaddr *name, socklen_t namelen);
int (*accept) (int s, struct sockaddr *addr, socklen_t *addrlen); 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 (*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); 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 (*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 (*setsockopt) (int s, int level, int optname, const void *optval, socklen_t optlen);
int (*shutdown) (int s, int how); int (*shutdown) (int s, int how);