From 29ab94198cf1f7c4695a05e8e203f9bf5f679995 Mon Sep 17 00:00:00 2001 From: Anthony Merlino Date: Fri, 16 Aug 2019 01:28:26 +0000 Subject: [PATCH] Merged in antmerlino/nuttx/mac802154_fixes (pull request #998) Mac802154 fixes * mac802154: Frame Version should have been 1, but was being set to 3 when payload exceeds version 0 capabilities. * mac802154: Corrects function reference in warning print-out * mac802154/sixlowpan: Adds warning to build to indicate what is noted in the menu for CONFIG_MAC802154_NTXDESC Approved-by: Gregory Nutt --- wireless/ieee802154/mac802154.c | 2 +- wireless/ieee802154/mac802154_data.c | 2 +- wireless/ieee802154/mac802154_netdev.c | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wireless/ieee802154/mac802154.c b/wireless/ieee802154/mac802154.c index 152d4e639b..a5f65757f6 100644 --- a/wireless/ieee802154/mac802154.c +++ b/wireless/ieee802154/mac802154.c @@ -206,7 +206,7 @@ int mac802154_txdesc_alloc(FAR struct ieee802154_privmac_s *priv, ret = mac802154_lock(priv, allow_interrupt); if (ret < 0) { - wlwarn("WARNING: mac802154_takesem failed: %d\n", ret); + wlwarn("WARNING: mac802154_lock failed: %d\n", ret); mac802154_givesem(&priv->txdesc_sem); return -EINTR; diff --git a/wireless/ieee802154/mac802154_data.c b/wireless/ieee802154/mac802154_data.c index 33cf0152b5..f43231b660 100644 --- a/wireless/ieee802154/mac802154_data.c +++ b/wireless/ieee802154/mac802154_data.c @@ -110,7 +110,7 @@ int mac802154_req_data(MACHANDLE mac, if ((frame->io_len - frame->io_offset) > IEEE802154_MAX_SAFE_MAC_PAYLOAD_SIZE) { - *frame_ctrl |= IEEE802154_FRAMECTRL_VERSION; + *frame_ctrl |= (1 << IEEE802154_FRAMECTRL_SHIFT_VERSION); } /* If the TXOptions parameter specifies that an acknowledged transmission diff --git a/wireless/ieee802154/mac802154_netdev.c b/wireless/ieee802154/mac802154_netdev.c index 1773e205e9..2c4191e6c8 100644 --- a/wireless/ieee802154/mac802154_netdev.c +++ b/wireless/ieee802154/mac802154_netdev.c @@ -114,6 +114,10 @@ # define MACNET_FRAMELEN IEEE802154_MAX_PHY_PACKET_SIZE #endif +#if (CONFIG_MAC802154_NTXDESC < CONFIG_IOB_NBUFFERS) +# warning "CONFIG_MAC802154_NTXDES should probably be equal to CONFIG_IOB_NBUFFERS to avoid waiting on req_data" +#endif + /* TX poll delay = 1 seconds. CLK_TCK is the number of clock ticks per second */ #define TXPOLL_WDDELAY (1*CLK_TCK)