summaryrefslogtreecommitdiff
path: root/nuttx/net/uip
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/net/uip')
-rw-r--r--nuttx/net/uip/uip.h107
-rw-r--r--nuttx/net/uip/uip_initialize.c3
-rw-r--r--nuttx/net/uip/uip_input.c1
-rw-r--r--nuttx/net/uip/uip_poll.c5
4 files changed, 94 insertions, 22 deletions
diff --git a/nuttx/net/uip/uip.h b/nuttx/net/uip/uip.h
index ad612d186..7a11dab26 100644
--- a/nuttx/net/uip/uip.h
+++ b/nuttx/net/uip/uip.h
@@ -96,35 +96,104 @@ extern "C"
#define EXTERN extern
#endif
-/* Defined in uip_callback.c ************************************************/
+/****************************************************************************
+ * Function: uip_callbackinit
+ *
+ * Description:
+ * Configure the pre-allocated callback structures into a free list.
+ * This is called internally as part of uIP initialization and should not
+ * be accessed from the application or socket layer.
+ *
+ * Assumptions:
+ * This function is called with interrupts disabled.
+ *
+ ****************************************************************************/
void uip_callbackinit(void);
-FAR struct uip_callback_s *uip_callbackalloc(struct uip_callback_s **list);
-void uip_callbackfree(FAR struct uip_callback_s *cb, struct uip_callback_s **list);
-uint16_t uip_callbackexecute(FAR struct uip_driver_s *dev, void *pvconn,
- uint16_t flags, FAR struct uip_callback_s *list);
-#ifdef CONFIG_NET_PKT
-/* Defined in uip_pktconn.c *************************************************/
+/****************************************************************************
+ * Function: uip_callbackalloc
+ *
+ * Description:
+ * Allocate a callback container from the free list.
+ * This is called internally as part of uIP initialization and should not
+ * be accessed from the application or socket layer.
+ *
+ * Assumptions:
+ * This function is called with interrupts disabled.
+ *
+ ****************************************************************************/
+
+FAR struct uip_callback_s *uip_callbackalloc(FAR struct uip_callback_s **list);
+
+/****************************************************************************
+ * Function: uip_callbackfree
+ *
+ * Description:
+ * Return a callback container to the free list.
+ * This is called internally as part of uIP initialization and should not
+ * be accessed from the application or socket layer.
+ *
+ * Assumptions:
+ * This function is called with interrupts disabled.
+ *
+ ****************************************************************************/
-void uip_pktinit(void);
-struct uip_pkt_conn *uip_pktalloc(void);
-void uip_pktfree(struct uip_pkt_conn *conn);
-struct uip_pkt_conn *uip_pktactive(struct eth_hdr_s *buf);
-struct uip_pkt_conn *uip_nextpktconn(struct uip_pkt_conn *conn);
+void uip_callbackfree(FAR struct uip_callback_s *cb,
+ FAR struct uip_callback_s **list);
-/* Defined in uip_pktcallback.c *********************************************/
+/****************************************************************************
+ * Function: uip_callbackexecute
+ *
+ * Description:
+ * Execute a list of callbacks.
+ * This is called internally as part of uIP initialization and should not
+ * be accessed from the application or socket layer.
+ *
+ * Assumptions:
+ * This function is called with interrupts disabled.
+ *
+ ****************************************************************************/
-uint16_t uip_pktcallback(struct uip_driver_s *dev, struct uip_pkt_conn *conn,
- uint16_t flags);
+uint16_t uip_callbackexecute(FAR struct uip_driver_s *dev, FAR void *pvconn,
+ uint16_t flags, FAR struct uip_callback_s *list);
-/* Defined in uip_pktinput.c ************************************************/
+/****************************************************************************
+ * Send data on the current connection.
+ *
+ * This function is used to send out a single segment of TCP
+ * data. Only applications that have been invoked by uIP for event
+ * processing can send data.
+ *
+ * The amount of data that actually is sent out after a call to this
+ * function is determined by the maximum amount of data TCP allows. uIP
+ * will automatically crop the data so that only the appropriate
+ * amount of data is sent. The function uip_mss() can be used to query
+ * uIP for the amount of data that actually will be sent.
+ *
+ * Note: This function does not guarantee that the sent data will
+ * arrive at the destination. If the data is lost in the network, the
+ * application will be invoked with the UIP_REXMIT flag set. The
+ * application will then have to resend the data using this function.
+ *
+ * data A pointer to the data which is to be sent.
+ *
+ * len The maximum amount of data bytes to be sent.
+ *
+ ****************************************************************************/
-/* Defined in uip_pktpoll.c *************************************************/
+void uip_send(FAR struct uip_driver_s *dev, FAR const void *buf, int len);
-void uip_pktpoll(struct uip_driver_s *dev, struct uip_pkt_conn *conn);
+#ifdef CONFIG_NET_IOB
+struct iob_s;
+void uip_iobsend(FAR struct uip_driver_s *dev, FAR struct iob_s *buf,
+ unsigned int len, unsigned int offset);
+#endif
-#endif /* CONFIG_NET_PKT */
+#ifdef CONFIG_NET_PKT
+void uip_pktsend(FAR struct uip_driver_s *dev, FAR const void *buf,
+ unsigned int len);
+#endif
#undef EXTERN
#ifdef __cplusplus
diff --git a/nuttx/net/uip/uip_initialize.c b/nuttx/net/uip/uip_initialize.c
index f71c3ab58..93e417099 100644
--- a/nuttx/net/uip/uip_initialize.c
+++ b/nuttx/net/uip/uip_initialize.c
@@ -50,6 +50,7 @@
#include "uip/uip.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
+#include "pkt/pkt.h"
#include "igmp/igmp.h"
/****************************************************************************
@@ -129,7 +130,7 @@ void uip_initialize(void)
/* Initialize packet socket suport */
#ifdef CONFIG_NET_PKT
- uip_pktinit();
+ pkt_initialize();
#endif
/* Initialize the listening port structures */
diff --git a/nuttx/net/uip/uip_input.c b/nuttx/net/uip/uip_input.c
index c43a22f8a..cb51cafff 100644
--- a/nuttx/net/uip/uip_input.c
+++ b/nuttx/net/uip/uip_input.c
@@ -96,6 +96,7 @@
#include "uip/uip.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
+#include "pkt/pkt.h"
#include "icmp/icmp.h"
#include "igmp/igmp.h"
diff --git a/nuttx/net/uip/uip_poll.c b/nuttx/net/uip/uip_poll.c
index 614ee1ddc..f7c212f99 100644
--- a/nuttx/net/uip/uip_poll.c
+++ b/nuttx/net/uip/uip_poll.c
@@ -49,6 +49,7 @@
#include "uip/uip.h"
#include "tcp/tcp.h"
#include "udp/udp.h"
+#include "pkt/pkt.h"
#include "icmp/icmp.h"
#include "igmp/igmp.h"
@@ -76,7 +77,7 @@
static int uip_pollpktconnections(struct uip_driver_s *dev,
uip_poll_callback_t callback)
{
- struct uip_pkt_conn *pkt_conn = NULL;
+ FAR struct pkt_conn_s *pkt_conn = NULL;
int bstop = 0;
/* Traverse all of the allocated packet connections and perform the poll action */
@@ -85,7 +86,7 @@ static int uip_pollpktconnections(struct uip_driver_s *dev,
{
/* Perform the packet TX poll */
- uip_pktpoll(dev, pkt_conn);
+ pkt_poll(dev, pkt_conn);
/* Call back into the driver */