From 4f696dc9cd557219fa51ceab9901bc7f1da10a10 Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Sat, 10 Aug 2019 17:51:05 +0000 Subject: [PATCH] Merged in antmerlino/nuttx/multi-macnet (pull request #979) mac802154: Moves iobuffer into macnet struct so that more than one macnet dev can exist. Approved-by: Gregory Nutt --- wireless/ieee802154/mac802154_netdev.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wireless/ieee802154/mac802154_netdev.c b/wireless/ieee802154/mac802154_netdev.c index 4b631a63b5..6dde5c0f3e 100644 --- a/wireless/ieee802154/mac802154_netdev.c +++ b/wireless/ieee802154/mac802154_netdev.c @@ -165,6 +165,10 @@ struct macnet_driver_s pid_t md_notify_pid; struct sigevent md_notify_event; struct sigwork_s md_notify_work; + +#ifdef CONFIG_NET_6LOWPAN + struct sixlowpan_reassbuf_s md_iobuffer; +#endif }; /**************************************************************************** @@ -231,10 +235,6 @@ static int macnet_properties(FAR struct radio_driver_s *netdev, * Private Data ****************************************************************************/ -#ifdef CONFIG_NET_6LOWPAN -static struct sixlowpan_reassbuf_s g_iobuffer; -#endif - /**************************************************************************** * Private Functions ****************************************************************************/ @@ -489,7 +489,7 @@ static int macnet_rxframe(FAR struct macnet_driver_s *priv, { /* Make sure the our single packet buffer is attached */ - priv->md_dev.r_dev.d_buf = g_iobuffer.rb_buf; + priv->md_dev.r_dev.d_buf = priv->md_iobuffer.rb_buf; /* And give the packet to 6LoWPAN */ @@ -584,7 +584,7 @@ static void macnet_txpoll_work(FAR void *arg) #ifdef CONFIG_NET_6LOWPAN /* Make sure the our single packet buffer is attached */ - priv->md_dev.r_dev.d_buf = g_iobuffer.rb_buf; + priv->md_dev.r_dev.d_buf = priv->md_iobuffer.rb_buf; #endif /* Then perform the poll */ @@ -865,7 +865,7 @@ static void macnet_txavail_work(FAR void *arg) #ifdef CONFIG_NET_6LOWPAN /* Make sure the our single packet buffer is attached */ - priv->md_dev.r_dev.d_buf = g_iobuffer.rb_buf; + priv->md_dev.r_dev.d_buf = priv->md_iobuffer.rb_buf; #endif /* Then poll the network for new XMIT data */