ieee802154: Adds configuration options for verbose logging of certain features, to aid in debugging

This commit is contained in:
Anthony Merlino 2017-07-09 23:57:11 -04:00
parent 93cdae50fc
commit b9a9ba7dd0
6 changed files with 40 additions and 2 deletions

View File

@ -35,4 +35,11 @@ config CLICKER2_STM32_MB2_BEE
---help---
Enable support for MRF24J40 BEE on mikroBUS2
config CLICKER2_STM32_MRF24J40LH_VERBOSE
bool "Verbose MRF24J40 lowerhalf"
default n
depends on DEBUG_WIRELESS_INFO
---help---
Enable verbose syslog for MRF24J40 lowerhalf
endif # ARCH_BOARD_CLICKER2_STM32

View File

@ -193,9 +193,12 @@ static void stm32_enable_irq(FAR const struct mrf24j40_lower_s *lower,
DEBUGASSERT(priv != NULL && (priv->handler != NULL || !state));
#ifdef CONFIG_CLICKER2_STM32_MRF24J40LH_VERBOSE
wlinfo("state:%d\n", (int)state);
#endif
/* Attach and enable, or detach and disable */
wlinfo("state:%d\n", (int)state);
if (state)
{
(void)stm32_gpiosetevent(priv->intcfg, true, true, true,

View File

@ -2381,7 +2381,10 @@ static void mrf24j40_irqworker(FAR void *arg)
if ((intstat & MRF24J40_INTSTAT_WAKEIF))
{
#ifdef CONFIG_MAC802154_SFEVENT_VERBOSE
wlinfo("Wake Interrupt\n");
#endif
/* This is right before the beacon, we set the bsn here, since the MAC
* uses the SLPIF (end of active portion of superframe). to make any
* changes to the beacon. This assumes that any changes to the beacon

View File

@ -83,6 +83,20 @@ config MAC802154_NPANDESC
information for all unique beacons received. This is the number of unique
descriptors that can be held before the scan cancels with LIMIT_REACHED.
config MAC802154_SFEVENT_VERBOSE
bool "Verbose logging related to superframe events"
default n
depends on DEBUG_WIRELESS_INFO
---help---
Enable verbose logging of superframe events Default: false
config MAC802154_LOCK_VERBOSE
bool "Verbose logging related to MAC lock management"
default n
depends on DEBUG_WIRELESS_INFO
---help---
Enable verbose logging of MAC lock management. Default: false
config IEEE802154_IND_PREALLOC
int "Number of pre-allocated meta-data structures"
default 20

View File

@ -1527,7 +1527,9 @@ static void mac802154_sfevent(FAR const struct ieee802154_radiocb_s *radiocb,
{
case IEEE802154_SFEVENT_ENDOFACTIVE:
{
#ifdef CONFIG_MAC802154_SFEVENT_VERBOSE
wlinfo("End of superframe\n");
#endif
/* Check if there is any reason to update the beacon */

View File

@ -581,9 +581,14 @@ static inline int mac802154_takesem(sem_t *sem, bool allowinterrupt)
return OK;
}
#ifdef CONFIG_MAC802154_LOCK_VERBOSE
#define mac802154_unlock(dev) \
mac802154_givesem(&dev->exclsem); \
wlinfo("MAC unlocked\n");
#else
#define mac802154_unlock(dev) \
mac802154_givesem(&dev->exclsem);
#endif
#define mac802154_lock(dev, allowinterrupt) \
mac802154_lockpriv(dev, allowinterrupt, __FUNCTION__)
@ -593,15 +598,19 @@ static inline int mac802154_lockpriv(FAR struct ieee802154_privmac_s *dev,
{
int ret;
#ifdef CONFIG_MAC802154_LOCK_VERBOSE
wlinfo("Locking MAC: %s\n", funcname);
#endif
ret = mac802154_takesem(&dev->exclsem, allowinterrupt);
if (ret < 0)
{
wlinfo("Failed to lock MAC\n");
wlwarn("Failed to lock MAC\n");
}
else
{
#ifdef CONFIG_MAC802154_LOCK_VERBOSE
wlinfo("MAC locked\n");
#endif
}
return ret;