Merged in antmerlino/nuttx/sixlowpan-mac802154 (pull request #526)

ieee802154: Simplifies notify() and rxframe() calls to a single notify() call. dataind's and all other "notifs" are now "primitives" which aligns with standard terminology

* mac802154: Adds missing breaks from case statement

* sixlowpan: Fixes bad logic where ACK is not requested if address is not a broadcast

* ieee802154: Simplification of "notifs" and "datainds" to generic primitives passed via a single notify call to the layer above the MAC

* Directories.mk should reference CONFIG_WIRELESS instead of CONFIG_DRIVERS_WIRELESS

* xbee_netdev: Network must be locked when calling sixlowpan_input

* sixlowpan: Reassembly buffer can't be freed if provided by radio driver

* sixlowpan: Don't free IOB if there is an error processing it as the MAC will try to pass it along to another receiver

* ieee802154: Adds basic logging to ieee802154_primitive.c

* Minor fixes after rebase

* xbee: Adds AT query timeout to retry if XBee doesn't respond to request

* same70-xplained: Adds Xbee support. Makes mikroBus slot Kconfig 'choice'

* mac802154: Removes unused function declaration

* drivers/mrf24j40: Fixes compilation error using . operator rather than -> operator

* mac802154_device: Changes a few mac802154_primtive_free's to ieee802154_primitive_free() and changes notif to primitive in a couple places.

* mac802154: Adds promiscous mode logic to bypass parsing of incoming frames. MAC char device also checks for promiscous mode and passes whole frames including header and FCS to the application if promiscous mode is enabled.

* sixlowpan: Fixes logic to correctly check if packet is large enough to include header.  This would cause packets to be considered too small when they are sufficiently sized.

* sixlowpan: Fixes forwarding logic to use forwarding device rather than received device to look up destination link layer address

* net/ipforward: Fixes typo that caused build error when IP forwarding was enabled with CONFIG_NET_ICMPv6_NEIGHBOR enabled as well.

* configs/same70-xplained: Simple spelling fix

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Anthony Merlino
2017-11-01 20:15:21 +00:00
committed by Gregory Nutt
parent 5c2e740ce3
commit 14fb37c995
42 changed files with 1388 additions and 2449 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ int sixlowpan_meta_data(FAR struct radio_driver_s *radio,
rcvrnull = sixlowpan_saddrnull(pktmeta->dest.nm_addr);
}
if (rcvrnull)
if (!rcvrnull)
{
meta->flags.ackreq = TRUE;
}
+2 -2
View File
@@ -88,7 +88,7 @@ void sixlowpan_icmpv6_send(FAR struct net_driver_s *dev,
/* Double check */
DEBUGASSERT(dev != NULL && dev->d_len > 0);
DEBUGASSERT(dev != NULL && dev->d_len > 0 && fwddev != NULL);
ninfo("d_len %u\n", dev->d_len);
@@ -118,7 +118,7 @@ void sixlowpan_icmpv6_send(FAR struct net_driver_s *dev,
* assumes an encoding of the MAC address in the IPv6 address.
*/
ret = sixlowpan_destaddrfromip((FAR struct radio_driver_s *)dev,
ret = sixlowpan_destaddrfromip((FAR struct radio_driver_s *)fwddev,
ipv6icmpv6->ipv6.destipaddr, &destmac);
if (ret < 0)
{
+12 -4
View File
@@ -438,6 +438,7 @@ static int sixlowpan_frame_process(FAR struct radio_driver_s *radio,
DEBUGASSERT(radio->r_dev.d_buf != NULL);
reass = (FAR struct sixlowpan_reassbuf_s *)radio->r_dev.d_buf;
reass->rb_pool = REASS_POOL_RADIO;
bptr = reass->rb_buf;
break;
}
@@ -735,9 +736,16 @@ int sixlowpan_input(FAR struct radio_driver_s *radio,
ret = sixlowpan_frame_process(radio, metadata, iob);
/* Free the IOB the held the consumed frame */
/* If the frame was a valid 6LoWPAN frame, free the IOB the held the
* consumed frame. Otherwise, the frame must stay allocated since the
* MAC layer will try and pass it to another receiver to see if that
* receiver wants it.
*/
iob_free(iob);
if (ret >= 0)
{
iob_free(iob);
}
/* Was the frame successfully processed? Is the packet in d_buf fully
* reassembled?
@@ -826,9 +834,9 @@ int sixlowpan_input(FAR struct radio_driver_s *radio,
}
}
if (hdrlen < radio->r_dev.d_len)
if (hdrlen > radio->r_dev.d_len)
{
nwarn("WARNING: Packet to small: Have %u need >%u\n",
nwarn("WARNING: Packet too small: Have %u need >%u\n",
radio->r_dev.d_len, hdrlen);
ret = -ENOBUFS;
goto drop;
+1
View File
@@ -122,6 +122,7 @@
#define REASS_POOL_PREALLOCATED 0
#define REASS_POOL_DYNAMIC 1
#define REASS_POOL_RADIO 2
/* Debug ********************************************************************/
+5 -1
View File
@@ -439,7 +439,7 @@ void sixlowpan_reass_free(FAR struct sixlowpan_reassbuf_s *reass)
reass->rb_flink = g_free_reass;
g_free_reass = reass;
}
else
else if (reass->rb_pool == REASS_POOL_DYNAMIC)
{
#ifdef CONFIG_NET_6LOWPAN_REASS_STATIC
DEBUGPANIC();
@@ -451,4 +451,8 @@ void sixlowpan_reass_free(FAR struct sixlowpan_reassbuf_s *reass)
sched_kfree(reass);
#endif
}
/* If the reassembly buffer structure was provided by the driver, nothing
* needs to be freed.
*/
}
+2 -2
View File
@@ -929,7 +929,7 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev,
sixlowpan_dumpbuffer("Outgoing TCP packet",
(FAR const uint8_t *)ipv6, dev->d_len);
if (dev != NULL && dev->d_len > 0)
if (dev != NULL && dev->d_len > 0 && fwddev != NULL)
{
FAR struct ipv6tcp_hdr_s *ipv6hdr;
@@ -961,7 +961,7 @@ void sixlowpan_tcp_send(FAR struct net_driver_s *dev,
* assumes an encoding of the MAC address in the IPv6 address.
*/
ret = sixlowpan_destaddrfromip((FAR struct radio_driver_s *)dev,
ret = sixlowpan_destaddrfromip((FAR struct radio_driver_s *)fwddev,
ipv6hdr->ipv6.destipaddr, &destmac);
if (ret < 0)
{
+3 -3
View File
@@ -441,11 +441,11 @@ void sixlowpan_udp_send(FAR struct net_driver_s *dev,
/* Double check */
DEBUGASSERT(dev != NULL && dev->d_len > 0);
DEBUGASSERT(dev != NULL && dev->d_len > 0 && fwddev != NULL);
ninfo("d_len %u\n", dev->d_len);
if (dev != NULL && dev->d_len > 0)
if (dev != NULL && dev->d_len > 0 && fwddev != NULL)
{
sixlowpan_dumpbuffer("Outgoing UDP packet",
@@ -472,7 +472,7 @@ void sixlowpan_udp_send(FAR struct net_driver_s *dev,
* assumes an encoding of the MAC address in the IPv6 address.
*/
ret = sixlowpan_destaddrfromip((FAR struct radio_driver_s *)dev,
ret = sixlowpan_destaddrfromip((FAR struct radio_driver_s *)fwddev,
ipv6udp->ipv6.destipaddr, &destmac);
if (ret < 0)
{