diff options
Diffstat (limited to 'nuttx/net/tcp')
-rw-r--r-- | nuttx/net/tcp/Make.defs | 8 | ||||
-rw-r--r-- | nuttx/net/tcp/tcp.h | 41 | ||||
-rw-r--r-- | nuttx/net/tcp/tcp_devpoll.c (renamed from nuttx/net/tcp/tcp_poll.c) | 4 |
3 files changed, 50 insertions, 3 deletions
diff --git a/nuttx/net/tcp/Make.defs b/nuttx/net/tcp/Make.defs index 41a03469e..6daf33532 100644 --- a/nuttx/net/tcp/Make.defs +++ b/nuttx/net/tcp/Make.defs @@ -47,9 +47,15 @@ else SOCK_CSRCS += tcp_send_unbuffered.c endif +ifneq ($(CONFIG_DISABLE_POLL),y) +ifeq ($(CONFIG_NET_TCP_READAHEAD),y) +NET_CSRCS += tcp_netpoll.c +endif +endif + # Transport layer -NET_CSRCS += tcp_conn.c tcp_seqno.c tcp_poll.c tcp_timer.c tcp_send.c +NET_CSRCS += tcp_conn.c tcp_seqno.c tcp_devpoll.c tcp_timer.c tcp_send.c NET_CSRCS += tcp_input.c tcp_appsend.c tcp_listen.c tcp_callback.c NET_CSRCS += tcp_backlog.c tcp_ipselect.c diff --git a/nuttx/net/tcp/tcp.h b/nuttx/net/tcp/tcp.h index 72fc3b96b..6fa263d4b 100644 --- a/nuttx/net/tcp/tcp.h +++ b/nuttx/net/tcp/tcp.h @@ -275,6 +275,7 @@ extern "C" struct sockaddr; /* Forward reference */ struct socket; /* Forward reference */ +struct pollfd; /* Forward reference */ /**************************************************************************** * Name: tcp_initialize @@ -1063,6 +1064,46 @@ void tcp_wrbuffer_dump(FAR const char *msg, FAR struct tcp_wrbuffer_s *wrb, #endif #endif /* CONFIG_NET_TCP_WRITE_BUFFERS */ +/**************************************************************************** + * Function: tcp_pollsetup + * + * Description: + * Setup to monitor events on one TCP/IP socket + * + * Input Parameters: + * psock - The TCP/IP socket of interest + * fds - The structure describing the events to be monitored, OR NULL if + * this is a request to stop monitoring events. + * + * Returned Value: + * 0: Success; Negated errno on failure + * + ****************************************************************************/ + +#ifdef HAVE_TCP_POLL +int tcp_pollsetup(FAR struct socket *psock, FAR struct pollfd *fds); +#endif + +/**************************************************************************** + * Function: tcp_pollteardown + * + * Description: + * Teardown monitoring of events on an TCP/IP socket + * + * Input Parameters: + * psock - The TCP/IP socket of interest + * fds - The structure describing the events to be monitored, OR NULL if + * this is a request to stop monitoring events. + * + * Returned Value: + * 0: Success; Negated errno on failure + * + ****************************************************************************/ + +#ifdef HAVE_TCP_POLL +int tcp_pollteardown(FAR struct socket *psock, FAR struct pollfd *fds); +#endif + #undef EXTERN #ifdef __cplusplus } diff --git a/nuttx/net/tcp/tcp_poll.c b/nuttx/net/tcp/tcp_devpoll.c index e5e99cabe..32bf535ee 100644 --- a/nuttx/net/tcp/tcp_poll.c +++ b/nuttx/net/tcp/tcp_devpoll.c @@ -1,6 +1,6 @@ /**************************************************************************** - * net/tcp/tcp_poll.c - * Poll for the availability of TCP TX data + * net/tcp/tcp_devpoll.c + * Driver poll for the availability of TCP TX data * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> |