6loWPAN: Updates/fixes from early testing with the IEEE802.15.4 loopback driver.

This commit is contained in:
Gregory Nutt
2017-04-03 12:01:04 -06:00
parent e9d831ac60
commit 2c06f8ab78
6 changed files with 177 additions and 38 deletions
+9 -4
View File
@@ -110,15 +110,20 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
* Function: sixlowpan_tcp_send
*
* Description:
* TCP output comes through two different mechansims. Either from:
* TCP output comes through three different mechansims. Either from:
*
* 1. TCP socket output. For the case of TCP output to an
* IEEE802.15.4, the TCP output is caught in the socket
* send()/sendto() logic and and redirected to psock_6lowpan_tcp_send().
* 2. TCP output from the TCP state machine. That will occur
* during TCP packet processing by the TCP state meachine. It
* is detected there when ipv6_tcp_input() returns with d_len > 0. This
* will be redirected here.
* during TCP packet processing by the TCP state meachine.
* 3. TCP output resulting from TX or timer polling
*
* Cases 2 and 3 will be handled here. Logic in ipv6_tcp_input(),
* devif_poll(), and devif_timer() detect if (1) an attempt to return with
* d_len > 0 and (2) that the device is an IEEE802.15.4 MAC network
* driver. Under those conditions, this function will be called to create
* the IEEE80215.4 frames.
*
* Parameters:
* dev - An instance of nework device state structure
+13 -4
View File
@@ -155,6 +155,8 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
uint16_t iplen;
int ret;
ninfo("buflen %lu\n", (unsigned long)buflen);
DEBUGASSERT(psock != NULL && psock->s_crefs > 0);
DEBUGASSERT(psock->s_type == SOCK_STREAM);
@@ -333,15 +335,20 @@ ssize_t psock_6lowpan_tcp_send(FAR struct socket *psock, FAR const void *buf,
* Function: sixlowpan_tcp_send
*
* Description:
* TCP output comes through two different mechansims. Either from:
* TCP output comes through three different mechansims. Either from:
*
* 1. TCP socket output. For the case of TCP output to an
* IEEE802.15.4, the TCP output is caught in the socket
* send()/sendto() logic and and redirected to psock_6lowpan_tcp_send().
* 2. TCP output from the TCP state machine. That will occur
* during TCP packet processing by the TCP state meachine. It
* is detected there when ipv6_tcp_input() returns with d_len > 0. This
* will be redirected here.
* during TCP packet processing by the TCP state meachine.
* 3. TCP output resulting from TX or timer polling
*
* Cases 2 and 3 will be handled here. Logic in ipv6_tcp_input(),
* devif_poll(), and devif_timer() detect if (1) an attempt to return with
* d_len > 0 and (2) that the device is an IEEE802.15.4 MAC network
* driver. Under those conditions, this function will be called to create
* the IEEE80215.4 frames.
*
* Parameters:
* dev - An instance of nework device state structure
@@ -360,6 +367,8 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev)
/* Double check */
ninfo("d_len %u\n", dev->d_len);
if (dev != NULL && dev->d_len > 0)
{
FAR struct ipv6_hdr_s *ipv6hdr;